-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
ffmpeg_file vframes arg broken #3862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Could you give it a shot with "ffmpeg_file" writer instead of "ffmpeg"? On Sat, Nov 29, 2014 at 11:43 AM, Michael notifications@github.com wrote:
|
sorry for delay. python moviewriter1.py
Traceback (most recent call last):
File "moviewriter1.py", line 36, in <module>
ani_frame()
File "moviewriter1.py", line 33, in ani_frame
ani.save('demo1.mp4',writer=writer,dpi=dpi)
File "/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/animation.py", line 718, in save
writer.grab_frame(**savefig_kwargs)
File "/Users/ifmichael/anaconda/lib/python2.7/contextlib.py", line 24, in __exit__
self.gen.next()
File "/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/animation.py", line 171, in saving
self.finish()
File "/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/animation.py", line 334, in finish
+ ' Try running with --verbose-debug')
RuntimeError: Error creating movie, return code: -5 Try running with --verbose-debug I'm running the examples by copy paste them into a py file, then run it with python. |
It would be a command-line flag. But actually, I might be wrong and it is On Mon, Dec 1, 2014 at 10:55 AM, Michael notifications@github.com wrote:
|
ah. this is the result (i changed the example's 300 frames into 10 frames, for a shorter output to paste it here): python moviewriter1.py --verbose-debug
$HOME=/Users/ifmichael
matplotlib data path /Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/mpl-data
loaded rc file /Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/mpl-data/matplotlibrc
matplotlib version 1.3.1
verbose.level debug
interactive is False
platform is darwin
loaded modules: <dictionary-keyiterator object at 0x1021c5158>
CACHEDIR=/Users/ifmichael/.matplotlib
Using fontManager instance from /Users/ifmichael/.matplotlib/fontList.cache
backend MacOSX version unknown
Animation.save using <class 'matplotlib.animation.FFMpegFileWriter'>
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 0 to fname=_tmp0000000.png
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 1 to fname=_tmp0000001.png
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 2 to fname=_tmp0000002.png
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 3 to fname=_tmp0000003.png
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 4 to fname=_tmp0000004.png
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 5 to fname=_tmp0000005.png
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 6 to fname=_tmp0000006.png
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 7 to fname=_tmp0000007.png
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 8 to fname=_tmp0000008.png
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 9 to fname=_tmp0000009.png
MovieWriter.run: running command: ffmpeg -vframes 10 -r 30 -i _tmp%07d.png -vcodec mpeg4 -y demo1.mp4
dyld: Library not loaded: /usr/local/lib/libfreetype.6.dylib
Referenced from: /usr/local/bin/ffmpeg
Reason: image not found
MovieWriter -- Command stdout:
None
MovieWriter -- Command stderr:
None
MovieWriter: clearing temporary fnames=['_tmp0000000.png', '_tmp0000001.png', '_tmp0000002.png', '_tmp0000003.png', '_tmp0000004.png', '_tmp0000005.png', '_tmp0000006.png', '_tmp0000007.png', '_tmp0000008.png', '_tmp0000009.png']
Traceback (most recent call last):
File "moviewriter1.py", line 36, in <module>
ani_frame()
File "moviewriter1.py", line 33, in ani_frame
ani.save('demo1.mp4',writer=writer,dpi=dpi)
File "/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/animation.py", line 718, in save
writer.grab_frame(**savefig_kwargs)
File "/Users/ifmichael/anaconda/lib/python2.7/contextlib.py", line 24, in __exit__
self.gen.next()
File "/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/animation.py", line 171, in saving
self.finish()
File "/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/animation.py", line 334, in finish
+ ' Try running with --verbose-debug')
RuntimeError: Error creating movie, return code: -5 Try running with --verbose-debug |
Very interesting... how did you install ffmpeg? On Mon, Dec 1, 2014 at 11:08 AM, Michael notifications@github.com wrote:
|
I installed it through homebrew |
Can you try to install freetype manually? Homebrew ffmpeg lists it as an optional dependency which doesn't seem to be true.
|
Is is linked? I.e. is does /usr/local/lib/libfreetype.6.dylib exist? If so I would suggest trying to reinstall ffmpeg. |
I searched for this file and it's in many places mdfind libfreetype.6.dylib
/Users/ifmichael/anaconda/lib/libfreetype.6.dylib
/opt/X11/lib/libfreetype.6.dylib
/Users/ifmichael/anaconda/pkgs/freetype-2.4.10-1/lib/libfreetype.6.dylib
/usr/local/Cellar/freetype/2.5.3_1/lib/libfreetype.6.dylib
/Library/Frameworks/Mono.framework/Versions/3.10.0/lib/libfreetype.6.dylib
/Library/Frameworks/Mono.framework/Versions/3.10.0/lib/libfreetype.6.dylib.dSYM
/Users/ifmichael/anaconda/pkgs/freetype-2.4.10-1/info/files |
That probably means that homebrew freetype is not linked: Try
Or if that doesn't work
|
Apparently there are some changes now, but it still ends in exception. First, brew linking: brew link freetype
Warning: Already linked: /usr/local/Cellar/freetype/2.5.3_1
To relink: brew unlink freetype && brew link freetype
brew unlink freetype
Unlinking /usr/local/Cellar/freetype/2.5.3_1... 1 symlinks removed
brew link freetype
Linking /usr/local/Cellar/freetype/2.5.3_1... 8 symlinks created Now, the ffmpeg_file output: python moviewriter1.py --verbose-debug
$HOME=/Users/ifmichael
matplotlib data path /Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/mpl-data
loaded rc file /Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/mpl-data/matplotlibrc
matplotlib version 1.3.1
verbose.level debug
interactive is False
platform is darwin
loaded modules: <dictionary-keyiterator object at 0x1021c51b0>
CACHEDIR=/Users/ifmichael/.matplotlib
Using fontManager instance from /Users/ifmichael/.matplotlib/fontList.cache
backend MacOSX version unknown
Animation.save using <class 'matplotlib.animation.FFMpegFileWriter'>
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 0 to fname=_tmp0000000.png
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 1 to fname=_tmp0000001.png
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 2 to fname=_tmp0000002.png
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 3 to fname=_tmp0000003.png
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 4 to fname=_tmp0000004.png
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 5 to fname=_tmp0000005.png
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 6 to fname=_tmp0000006.png
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 7 to fname=_tmp0000007.png
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 8 to fname=_tmp0000008.png
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 9 to fname=_tmp0000009.png
MovieWriter.run: running command: ffmpeg -vframes 10 -r 30 -i _tmp%07d.png -vcodec mpeg4 -y demo1.mp4
dyld: Library not loaded: /usr/local/lib/libfontconfig.1.dylib
Referenced from: /usr/local/lib/libass.5.dylib
Reason: image not found
MovieWriter -- Command stdout:
None
MovieWriter -- Command stderr:
None
MovieWriter: clearing temporary fnames=['_tmp0000000.png', '_tmp0000001.png', '_tmp0000002.png', '_tmp0000003.png', '_tmp0000004.png', '_tmp0000005.png', '_tmp0000006.png', '_tmp0000007.png', '_tmp0000008.png', '_tmp0000009.png']
Traceback (most recent call last):
File "moviewriter1.py", line 39, in <module>
ani_frame()
File "moviewriter1.py", line 36, in ani_frame
ani.save('demo1.mp4',writer=writer,dpi=dpi)
File "/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/animation.py", line 718, in save
writer.grab_frame(**savefig_kwargs)
File "/Users/ifmichael/anaconda/lib/python2.7/contextlib.py", line 24, in __exit__
self.gen.next()
File "/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/animation.py", line 171, in saving
self.finish()
File "/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/animation.py", line 334, in finish
+ ' Try running with --verbose-debug')
RuntimeError: Error creating movie, return code: -5 Try running with --verbose-debug |
ok. after reading the output again, I saw a pb with fontconfig. I did brew unlink fontconfig
brew link fontconfig Now the output is changed: python moviewriter1.py --verbose-debug
$HOME=/Users/ifmichael
matplotlib data path /Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/mpl-data
loaded rc file /Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/mpl-data/matplotlibrc
matplotlib version 1.3.1
verbose.level debug
interactive is False
platform is darwin
loaded modules: <dictionary-keyiterator object at 0x1021c5158>
CACHEDIR=/Users/ifmichael/.matplotlib
Using fontManager instance from /Users/ifmichael/.matplotlib/fontList.cache
backend MacOSX version unknown
Animation.save using <class 'matplotlib.animation.FFMpegFileWriter'>
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 0 to fname=_tmp0000000.png
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 1 to fname=_tmp0000001.png
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 2 to fname=_tmp0000002.png
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 3 to fname=_tmp0000003.png
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 4 to fname=_tmp0000004.png
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 5 to fname=_tmp0000005.png
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 6 to fname=_tmp0000006.png
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 7 to fname=_tmp0000007.png
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 8 to fname=_tmp0000008.png
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 9 to fname=_tmp0000009.png
MovieWriter.run: running command: ffmpeg -vframes 10 -r 30 -i _tmp%07d.png -vcodec mpeg4 -y demo1.mp4
ffmpeg version 2.4.3 Copyright (c) 2000-2014 the FFmpeg developers
built on Nov 29 2014 17:33:28 with Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.4.3 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid --enable-libfreetype --enable-libvorbis --enable-libvpx --enable-libass --enable-ffplay --enable
8000
-libfdk-aac --enable-libopus --enable-libquvi --enable-libx265 --enable-vda
libavutil 54. 7.100 / 54. 7.100
libavcodec 56. 1.100 / 56. 1.100
libavformat 56. 4.101 / 56. 4.101
libavdevice 56. 0.100 / 56. 0.100
libavfilter 5. 1.100 / 5. 1.100
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 0.100 / 3. 0.100
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 0.100 / 53. 0.100
Option vframes (set the number of video frames to record) cannot be applied to input file _tmp%07d.png -- you are trying to apply an input option to an output file or vice versa. Move this option before the file it belongs to.
Error parsing options for input file _tmp%07d.png.
Error opening input files: Invalid argument
MovieWriter -- Command stdout:
None
MovieWriter -- Command stderr:
None
MovieWriter: clearing temporary fnames=['_tmp0000000.png', '_tmp0000001.png', '_tmp0000002.png', '_tmp0000003.png', '_tmp0000004.png', '_tmp0000005.png', '_tmp0000006.png', '_tmp0000007.png', '_tmp0000008.png', '_tmp0000009.png']
Traceback (most recent call last):
File "moviewriter1.py", line 39, in <module>
ani_frame()
File "moviewriter1.py", line 36, in ani_frame
ani.save('demo1.mp4',writer=writer,dpi=dpi)
File "/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/animation.py", line 718, in save
writer.grab_frame(**savefig_kwargs)
File "/Users/ifmichael/anaconda/lib/python2.7/contextlib.py", line 24, in __exit__
self.gen.next()
File "/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/animation.py", line 171, in saving
self.finish()
File "/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/animation.py", line 334, in finish
+ ' Try running with --verbose-debug')
RuntimeError: Error creating movie, return code: 1 Try running with --verbose-debug One more mention. I checked again how I installed ffmpeg. I did it through the following command (from their site, for macosx): brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-libass --with-libquvi --with-libvorbis --with-libvpx --with-opus --with-x265 I will unlink/link all of these |
Just for sanity checking, run "which ffmpeg". On Mon, Dec 1, 2014 at 11:43 AM, Michael notifications@github.com wrote:
|
which ffmpeg
/usr/local/bin/ffmpeg |
apparently, the core of the issue now is: Option vframes (set the number of video frames to record) cannot be applied to input file _tmp%07d.png -- you are trying to apply an input option to an output file or vice versa. Move this option before the file it belongs to. I'm not sure what this means, but it may be a syntax error given to ffmpeg? |
Are the tmp files still in the directory? If not, then that might be the On Mon, Dec 1, 2014 at 12:01 PM, Michael notifications@github.com wrote:
|
I've watched in parallel the directory in finder. After unlink/link all packages installed along with ffmpeg but it still doesn't work with 'ffmpeg_file' the result is: python moviewriter1.py --verbose-debug
$HOME=/Users/ifmichael
matplotlib data path /Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/mpl-data
loaded rc file /Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/mpl-data/matplotlibrc
matplotlib version 1.3.1
verbose.level debug
interactive is False
platform is darwin
loaded modules: <dictionary-keyiterator object at 0x1021c51b0>
CACHEDIR=/Users/ifmichael/.matplotlib
Using fontManager instance from /Users/ifmichael/.matplotlib/fontList.cache
backend MacOSX version unknown
Animation.save using <class 'matplotlib.animation.FFMpegFileWriter'>
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 0 to fname=_tmp0000000.png
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 1 to fname=_tmp0000001.png
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 2 to fname=_tmp0000002.png
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 3 to fname=_tmp0000003.png
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 4 to fname=_tmp0000004.png
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 5 to fname=_tmp0000005.png
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 6 to fname=_tmp0000006.png
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 7 to fname=_tmp0000007.png
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 8 to fname=_tmp0000008.png
MovieWriter.grab_frame: Grabbing frame.
FileMovieWriter.frame_sink: saving frame 9 to fname=_tmp0000009.png
MovieWriter.run: running command: ffmpeg -vframes 10 -r 30 -i _tmp%07d.png -vcodec mpeg4 -y demo1.mp4
ffmpeg version 2.4.3 Copyright (c) 2000-2014 the FFmpeg developers
built on Nov 29 2014 17:33:28 with Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.4.3 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid --enable-libfreetype --enable-libvorbis --enable-libvpx --enable-libass --enable-ffplay --enable-libfdk-aac --enable-libopus --enable-libquvi --enable-libx265 --enable-vda
libavutil 54. 7.100 / 54. 7.100
libavcodec 56. 1.100 / 56. 1.100
libavformat 56. 4.101 / 56. 4.101
libavdevice 56. 0.100 / 56. 0.100
libavfilter 5. 1.100 / 5. 1.100
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 0.100 / 3. 0.100
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 0.100 / 53. 0.100
Option vframes (set the number of video frames to record) cannot be applied to input file _tmp%07d.png -- you are trying to apply an input option to an output file or vice versa. Move this option before the file it belongs to.
Error parsing options for input file _tmp%07d.png.
Error opening input files: Invalid argument
MovieWriter -- Command stdout:
None
MovieWriter -- Command stderr:
None
MovieWriter: clearing temporary fnames=['_tmp0000000.png', '_tmp0000001.png', '_tmp0000002.png', '_tmp0000003.png', '_tmp0000004.png', '_tmp0000005.png', '_tmp0000006.png', '_tmp0000007.png', '_tmp0000008.png', '_tmp0000009.png']
Traceback (most recent call last):
File "moviewriter1.py", line 39, in <module>
ani_frame()
File "moviewriter1.py", line 36, in ani_frame
ani.save('demo1.mp4',writer=writer,dpi=dpi)
File "/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/animation.py", line 718, in save
writer.grab_frame(**savefig_kwargs)
File "/Users/ifmichael/anaconda/lib/python2.7/contextlib.py", line 24, in __exit__
self.gen.next()
File "/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/animation.py", line 171, in saving
self.finish()
File "/Users/ifmichael/anaconda/lib/python2.7/site-packages/matplotlib/animation.py", line 334, in finish
+ ' Try running with --verbose-debug')
RuntimeError: Error creating movie, return code: 1 Try running with --verbose-debug |
Change title to point at the real issue found here which is the incantation for ffmpeg file seems to have rotted. My understanding is that ffmpeg has a history of breaking api without much warning. It is also made far worse by the ffmpeg/libav split. |
I went to go fix this latter problem with ffmpeg options, and it turns out this is a duplicate of #2482. I tested, was able to reproduce the error using the ffmpeg I have installed on my Mac and the problematic command from the log above. Using a current matplotlib version, everything works fine here. |
blah, I totally missed that this was a 1.3.1 bug, closing as fixed. |
I got into animation subject.
I get the same exception(s) with two different examples.
I searched the web, I tried to get my head around the exceptions, but now I'm stuck. hence this issue.
I don't know where is the problem.
The examples I ran:
the exception(s):
my configuration
macosx mavericks 10.9.4
anaconda bundle
matplotlib 1.3.1 (as 1.4.2 still doesn't work in my configuration, the ascii bug #3517 still prevails)
matplotlib.get_backend() gives 'MacOSX'
I've installed ffmpeg and mencoder (through homebrew)
matplotlib.animation.writers.list() recognizes both codecs
Any help on this? is it a bug or a problem with my configuration?
The text was updated successfully, but these errors were encountered: