Tuesday, February 14, 2012

Converting AVI to YUV to H264

Using FFMPEG to transcode directly from AVI/MJPEG won't work:

$ ffmpeg -i input.avi -vcodec libx264 output.mp4

Still trying to get the commands from the following article to work:

http://www.linuxjournal.com/article/9005

$ mencoder -vf format=i420 -nosound -ovc raw -of rawvideo -ofps 24 -o tmp.yuv input.avi

$ x264 -o output.mp4 --fps 24 --bframes 2 --crf 26 --subme 6 --analyse p8x8,b8x8,i4x4,p4x4 --input-res 720x480 tmp.yuv

Using the lav2yuv command produces a raw YUV file of exactly the same size playable in VLC. The one from mencoder produces garbage.


Another example x264 invocation from http://mewiki.project357.com/wiki/X264_Settings:

$ x264 --output /dev/null --fps 30000/1001 --input-res 720x480 input.yuv

No comments:

Post a Comment