I tried to convert a video with: ffmpeg -i input.mov -f avi -vcodec mpeg4 -b 400k -g 150 -bf 2 -acodec libmp3lame -ab 64k output.avi At input I get: Stream #0.1(eng): Audio: pcm_u8, 7875 Hz, 1 channels, u8, 63 kb/s and at output I get: Stream #0.1(eng): Audio: libmp3lame, 7875 Hz, 1 channels, s16, 64 kb/s So far so good, but I also get: Error while opening encoder for output stream #0.1 - maybe incorrect parameters such as bit_rate, rate, width or height You have to define the audio frequency with for example '-ar 8000'. So it becomes: ffmpeg -i input.mov -f avi -vcodec mpeg4 -b 400k -g 150 -bf 2 -acodec libmp3lame -ar 8000 -ab 64k output.avi Would be nice if the documentation would be updated. -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof
Hi, On Fri, Apr 9, 2010 at 3:13 PM, Cecil Westerhof wrote:
I tried to convert a video with: ? ?ffmpeg -i input.mov -f avi -vcodec mpeg4 -b 400k -g 150 -bf 2 -acodec libmp3lame -ab 64k output.avi
At ?input I get: ? ?Stream #0.1(eng): Audio: pcm_u8, 7875 Hz, 1 channels, u8, 63 kb/s and at output I get: ? ?Stream #0.1(eng): Audio: libmp3lame, 7875 Hz, 1 channels, s16, 64 kb/s
So far so good, but I also get: ? ?Error while opening encoder for output stream #0.1 - maybe incorrect parameters such as bit_rate, rate, width or height
You have to define the audio frequency with for example '-ar 8000'.
Yes. That is a limitation of MP3, that only supports a few audio sample rates.
So it becomes: ? ?ffmpeg -i input.mov -f avi -vcodec mpeg4 -b 400k -g 150 -bf 2 -acodec libmp3lame -ar 8000 -ab 64k output.avi
Would be nice if the documentation would be updated.
Indeed.
-- Cecil Westerhof Senior Software Engineer
You have a C background. Maybe you might devise codec specific error messages. Patches to improve FFmpeg are welcomed. Regards, V?ctor
V?ctor Paesa <victorpaesa at googlemail.com> writes:
I tried to convert a video with: ? ?ffmpeg -i input.mov -f avi -vcodec mpeg4 -b 400k -g 150 -bf 2 -acodec libmp3lame -ab 64k output.avi
At ?input I get: ? ?Stream #0.1(eng): Audio: pcm_u8, 7875 Hz, 1 channels, u8, 63 kb/s and at output I get: ? ?Stream #0.1(eng): Audio: libmp3lame, 7875 Hz, 1 channels, s16, 64 kb/s
So far so good, but I also get: ? ?Error while opening encoder for output stream #0.1 - maybe incorrect parameters such as bit_rate, rate, width or height
You have to define the audio frequency with for example '-ar 8000'.
Yes. That is a limitation of MP3, that only supports a few audio sample rates.
Where is this documented? So I know which values to use.
So it becomes: ? ?ffmpeg -i input.mov -f avi -vcodec mpeg4 -b 400k -g 150 -bf 2 -acodec libmp3lame -ar 8000 -ab 64k output.avi
Would be nice if the documentation would be updated.
Indeed.
How to get it updated? So others do not get the same problem.
You have a C background. Maybe you might devise codec specific error messages. Patches to improve FFmpeg are welcomed.
Is true, but I do not know ffmpeg. I just started using it, but I can try to help. No promises made. ;-} -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof
On date Saturday 2010-04-10 09:45:35 +0200, Cecil Westerhof encoded:
V?ctor Paesa <victorpaesa at googlemail.com> writes:
I tried to convert a video with: ? ?ffmpeg -i input.mov -f avi -vcodec mpeg4 -b 400k -g 150 -bf 2 -acodec libmp3lame -ab 64k output.avi
At ?input I get: ? ?Stream #0.1(eng): Audio: pcm_u8, 7875 Hz, 1 channels, u8, 63 kb/s and at output I get: ? ?Stream #0.1(eng): Audio: libmp3lame, 7875 Hz, 1 channels, s16, 64 kb/s
So far so good, but I also get: ? ?Error while opening encoder for output stream #0.1 - maybe incorrect parameters such as bit_rate, rate, width or height
You have to define the audio frequency with for example '-ar 8000'.
Yes. That is a limitation of MP3, that only supports a few audio sample rates.
Where is this documented? So I know which values to use.
Official specs or maybe the code of libmp3lame.
So it becomes: ? ?ffmpeg -i input.mov -f avi -vcodec mpeg4 -b 400k -g 150 -bf 2 -acodec libmp3lame -ar 8000 -ab 64k output.avi
Would be nice if the documentation would be updated.
Indeed.
How to get it updated? So others do not get the same problem.
Ideally it should be the program itself to give this info, issue a meaningful error message and eventually expose this information. Note that there is a supported_samplerates in AVCodec which we are not yet using. In this case the error message should be issued by libmp3lame (check libavcodec/libmp3lame.c:MP3lame_encode_init), but we're using no logging facilities from libmp3lame and I'm not even sure it has such. So the right fix could be either to register a callback for libmp3lame if this functionality is available, either add a check in FFmpeg itself, possibly using the supported_framerates field. There is also an old patch from mine which I did when I was trying to implement a general mechanism for checking constraints: http://thread.gmane.org/gmane.comp.video.ffmpeg.devel/73091 Another idea could be to document these constraints in the documentation for the supported codecs. Unfortunately currently there is no such thing! (I'm thinking about an overhaul of the FFmpeg docs layout, with one man page for each type of element: codecs, formats, protocols, filters, etc... help in this area is much welcome!)
You have a C background. Maybe you might devise codec specific error messages. Patches to improve FFmpeg are welcomed.
Is true, but I do not know ffmpeg. I just started using it, but I can try to help. No promises made. ;-}
Regards. -- ffmpeg-user random tip #16 Patches are welcome!
participants (3)
-
Cecil@decebal.nl -
stefano.sabatini-lala@poste.it -
victorpaesa@googlemail.com