Search code examples
ffmpegconvertersmpeg

Convert video to mpg format using FFMPEG


I am using FFMPEG to convert video files to mpg format. Conversion works fine for audio content, but the output has no video content. This is the parameters I am using:

ffmpeg.exe -i "Path to input file" -y -s 640x360 -b:v 1024k -vcodec libx264 -r 29.7 -movflags faststart -pix_fmt yuv420p "output.mpg"

Am I missing something?


Solution

  • I posted the question in SuperUser and got this answer

    The .mpg container is for MPEG-1 & MPEG-2 encoding:

    If you wish to encode h.264 you should use .mp4.

    If you wish create a .mpg file then omit the codec options, ffmpeg will produce MPEG-2.

    I had to omit the unnecessary vcodec parameter(which I was using previously to convert to mp4 format) and it works fine now with the following parameters:

    ffmpeg.exe -i "sourcePath" -y -s 640x360 -b:v 1024k -r 29.7 -movflags faststart -pix_fmt yuv420p "output.mpg"