I am currently using FFMPEG v1.1 on CentOS 6.3.
I configured FFMPEG with:
./configure --arch=x86_64 --enable-libmp3lame --enable-librtmp --enable-
Your output video's pixel format is probably unsupported in the player you're using to show the video. If you observe your output logs, you can see yuv422p
being chosen as the format. That's a 4:2:2 subsampled chroma in a planar format.
Choosing -pix_fmt yuv420p
(4:2:0 subsampling) should give you an H.264-encoded video that can be viewed everywhere.
ffmpeg -f video4linux2 -s 640x480 -i /dev/video0 \
-c:v libx264 -pix_fmt yuv420p /home/irdb/Desktop/test.mp4
I explicitly set the video codec here. Just a good habit to develop so as not to be surprised when FFmpeg defaults to another encoder for a format. For example, choosing an MPEG output format made FFmpeg choose another default encoder, MPEG-1 (mpeg1video
), which uses 4:2:0 subsampling again.