I am trying to convert mp4 or 3gp video files into Flash (flv) format (using Perl script), using following (mencoder) command:
mencoder test.mp4 -of lavf -ovc lavc -lavcopts vcodec=flv:vbitrate=1000:mbd=2 -fps 20.80 -ofps 20.80 -oac mp3lame -lameopts abr:br=32 -srate 22050 -o test.flv
It works fine, but some files which comes as attachments from mobile phone has problem, the converted FLV file has only audio.
I also used ffmpeg command as follows:
ffmpeg -i test.mp4 -ar 22050 -acodec libmp3lame -ab 32K -r 25 -vcodec flv test.flv
This ffmpeg command helps to convert to flv, which is failed by mencoder
.
I am thinking some solution like, need to check whether converted flv has audio and video then will take action depends on it. Could you help me to solve this issue?
Here is some more info (log):
[mov,mp4,m4a,3gp,3g2,mj2 @ 0xb6b9a3a0]multiple edit list entries, a/v desync might occur, patch welcome ** MUXER_LAVF ************************************* REMEMBER: MEncoder's libavformat muxing is presently broken and can generate INCORRECT files in the presence of B-frames. Moreover, due to bugs MPlayer will play these INCORRECT files as if nothing were wrong!
Unsupported PixelFormat 61 Unsupported PixelFormat 53 Unsupported PixelFormat 81 [flv @ 0xb6b9a3a0]Codec for stream 0 does not use global headers but container format requires global headers [flv @ 0xb6b9a3a0]Codec for stream 1 does not use global headers but container format requires global headers [flv @ 0xb6b9a3a0]pts < dts in stream 0 Error while writing frame.
[flv @ 0xb6b9a3a0]pts < dts in stream 0 Error while writing frame.
[flv @ 0xb6b9a3a0]pts < dts in stream 0 Error while writing frame.
[flv @ 0xb6b9a3a0]pts < dts in stream 0 Error while writing frame.
[flv @ 0xb6b9a3a0]pts < dts in stream 0 Error while writing frame.
Skipping frame!
.........................