Title: Rolling image if the FFMpegWriter dpi setting does not match that specified when a figure is created · Issue #8852 · matplotlib/matplotlib · GitHub
Open Graph Title: Rolling image if the FFMpegWriter dpi setting does not match that specified when a figure is created · Issue #8852 · matplotlib/matplotlib
X Title: Rolling image if the FFMpegWriter dpi setting does not match that specified when a figure is created · Issue #8852 · matplotlib/matplotlib
Description: Bug report Bug summary Playback of mp4 files written by FFMpegWriter shows a rolling image if the dpi setting does not match that specified when a figure is created. In particular, this happens if the movie frame images are being display...
Open Graph Description: Bug report Bug summary Playback of mp4 files written by FFMpegWriter shows a rolling image if the dpi setting does not match that specified when a figure is created. In particular, this happens if ...
X Description: Bug report Bug summary Playback of mp4 files written by FFMpegWriter shows a rolling image if the dpi setting does not match that specified when a figure is created. In particular, this happens if ...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/8852
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Rolling image if the FFMpegWriter dpi setting does not match that specified when a figure is created","articleBody":"### Bug report\r\n\r\n**Bug summary**\r\nPlayback of mp4 files written by FFMpegWriter shows a rolling image if the dpi setting does not match that specified when a figure is created. In particular, this happens if the movie frame images are being displayed on the screen, e.g. during creation of the movie. (There is also an annoying flicker.)\r\n\r\n**Code for reproduction**\r\n\r\nAnimation in the code below fails, resulting in a rolling image on playback of the saved mp4 movie. Either of two modifications indicated in the comments make the saved movie play back normally.\r\n\r\n```python\r\nimport matplotlib.animation\r\nimport numpy\r\nimport pylab\r\n\r\nfig = pylab.figure(figsize=(6,6), dpi=120)\r\nwriter = matplotlib.animation.FFMpegWriter(fps=10)\r\nx = numpy.linspace(0, 6.28, 100)\r\n\r\nwith writer.saving(fig, 'rolling_bug.mp4', dpi=100): # saving OK if dpi=120\r\n for offset in numpy.linspace(0, 6.28, 30):\r\n pylab.plot(numpy.cos(x-offset), color='black')\r\n # saving OK if the next line is commented out\r\n pylab.pause(0.01)\r\n writer.grab_frame()\r\n```\r\nNote that commenting out the pylab.pause() call results in no image being displayed on the screen until the end of the script.\r\n\r\n**Actual outcome**\r\nInspection of the figure vertical dimension in pixels shows that it has changed across the call to grab_frame(), from 600 to 590 in the above example. The horizontal dimension does not change.\r\nA screen grab from VLC Media Player is shown here:\r\n\r\n\r\n**Expected outcome**\r\n\r\nThe writer.grab_frame() should not change the vertical dimension of the figure.\r\n\r\nThe flickering did not occur in the last version of Matplotlib I had installed, but I do not know what version that was. I'm pretty sure the vertical image dimension also stayed constant across the grab_frame() call, since this was (abstracted from) working code from about a year ago.\r\n\r\n**Version info**\r\n\r\nWindows 8.1\r\nMatplotlib 2.0.2\r\nPython 3.6.1\r\nAnaconda 4.4.0\r\n\r\nInstalled from conda\r\n\r\n","author":{"url":"https://github.com/Patrick5","@type":"Person","name":"Patrick5"},"datePublished":"2017-07-09T02:05:12.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/8852/matplotlib/issues/8852"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2d3f5b72-a9c9-2a5b-b0a3-d5da12b21739 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DF50:1D4F69:12DA2B3:1940FAD:6A5342F5 |
| html-safe-nonce | 7892279ea2c3ae6c3534a14e99d5ce66bc00ca1bdcae8cf88a6c94689450b8dd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERjUwOjFENEY2OToxMkRBMkIzOjE5NDBGQUQ6NkE1MzQyRjUiLCJ2aXNpdG9yX2lkIjoiMjA2MjgyMDY3ODkxOTQ3MTg2MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b08ef2306aa6607ade46c395594d6f9872c02b2dbfcfaf9b6adb3fc065edb91d |
| hovercard-subject-tag | issue:241493923 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/8852/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4089a60d50243ae90a814c65117c2ed116f41dfc20df74973db783efff0446dc/matplotlib/matplotlib/issues/8852 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4089a60d50243ae90a814c65117c2ed116f41dfc20df74973db783efff0446dc/matplotlib/matplotlib/issues/8852 |
| og:image:alt | Bug report Bug summary Playback of mp4 files written by FFMpegWriter shows a rolling image if the dpi setting does not match that specified when a figure is created. In particular, this happens if ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Patrick5 |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width