Environments
ffmpeg 4.2.2
ffmpeg-python 0.2.0
Details
The ffmpeg-python's format option conflicts with some ffmpeg codec options. https://www.ffmpeg.org/ffmpeg-codecs.html#Hap https://www.ffmpeg.org/ffmpeg-codecs.html#jpeg2000
For instance,
ffmpeg.input('test.mp4').output('out.mov', vcodec='hap', format='hap_q').run()
the above code returns the following error.
[NULL @ 0x7fc69c80ea00] Requested output format 'hap_q' is not a suitable output format
out.mov: Invalid argument
Traceback (most recent call last):
File "encoder.py", line 180, in <module>
ffmpeg.input('test.mp4').output('out.mov', vcodec='hap', format='hap_q').run()
File "/usr/local/lib/python3.7/site-packages/ffmpeg/_run.py", line 325, in run
raise Error('ffmpeg', out, err)
ffmpeg._run.Error: ffmpeg error (see stderr output for detail)
Looking at the ffmpeg documentation, the format option is -f
and -fmt
.
https://www.ffmpeg.org/ffmpeg.html#toc-Main-options
I think it's better to use the same option as ffmpeg. But this PR breaks old code, so we should to be careful.