[FFmpeg-user] Save webcam stream in mpg, not avi format

Carl Eugen Hoyos cehoyos at ag.or.at
Tue Aug 4 19:30:51 CEST 2015


Felix Baier <felixbaier-at-yahoo.de <at> ffmpeg.org> writes:

> …but I’m having trouble saving in .mpg format. The reason 
> why I would like to save in .mpg format is that

> (1) .avi files are very large 

This is wrong and indicates that you don't know what you 
are talking about. This is generally no problem (that's 
why you ask here) but in the context of your question, it 
makes it very difficult to answer...

> and (2) my downstream analysis requires .mpg format.

Could you elaborate?
mpg (MPEG program streams) are among the few containers 
that are slightly more difficult to use (create) because 
additional constraints are generally necessary ("mpg" is 
not enough), see also FFmpeg's output:

> VBV buffer size not set, using default size of 130KB
> If you want the mpeg file to be compliant to some 
> specification Like DVD, VCD or others, make sure you 
> set the correct buffer size

If you don't know the difference between container and 
codec (the codec is the reason for "files being very 
large"), now is a good time to find out using Google 
and / or Wikipedia.

>     Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x360

You cannot put rawvideo in mpg (neither program nor 
transport stream), the resulting file will be invalid.
This is not a limitation of FFmpeg, but the MPEG 
specifications.

Carl Eugen


More information about the ffmpeg-user mailing list