ffmpegmpeg-2

Distinguish between MPEG-1 container and MPEG-2 container


I am looking at concrete ways to distinguish between files that use MPEG-1 and MPEG-2 containers as most of the resources that I find suggest that the start code is 00 00 01 BA for both containers.

I have tried to convert a video in MP4 container to MPEG-1 container using VLC's GUI and the packet start code for the resulting file was 00 00 01 BA which is the cause of my confusion.

Is it even possible to convert a video in a MP4 to a MPEG-1 container using FFMPEG as whatever I try generates a file in a MPEG-2 program stream container instead. The command used was ffmpeg -i video.mp4 video.mpg


Solution

  • The command ffmpeg -i video.mp4 video.mpg will produce a MPEG-1 systems container. Use ffmpeg -i video.mp4 -f vob video.mpg for MPEG-2 PS.

    Immediately after the PACK START CODE 00 00 01 BA. if the next two bits are 01, it's MPEG-2 PS (VOB, DVD-VOB or SVCD), else if it's 0010. it's MPEG-1 Systems or VCD.