0

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

Ajit
  • 261
  • 3
  • 15

2 Answers2

3

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.

Gyan
  • 85,394
  • 9
  • 169
  • 201
  • I tried both the commands and running ffprobe -show_format on the output files gave the same result which is "format_name=mpeg, format_long_name=MPEG-PS (MPEG-2 Program Stream)". Am I wrong to assume 00 00 01 B3 is the pack start code for MPEG-1 container. – Ajit Jul 30 '18 at 22:22
  • The two container are chiefly the same; the difference being the frequency of system headers and the addition/modification of a few packet fields.etc. FFmpeg has a single demuxer for both, so you'll get the same ID. – Gyan Jul 31 '18 at 04:42
  • I have a mpeg-2 file which starts with 00 00 01 B3. A -show_format on ffprobe returns the following result "format_name=mpegvideo, format_long_name=raw MPEG video". I am confused about the container format used in this case. Is it not MPEG-1 or MPEG-2 container in this case? – Ajit Jul 31 '18 at 09:27
  • That is a raw bitstream i.e. MPEG ES, not a PS container. It will have exactly one stream. – Gyan Jul 31 '18 at 09:30
0

MPEG-1 video encodes video intended to be used with a particular generation of video CD and the corresponding players. It was restricted to this on-disk format. The purpose of the systems layer is, for example, to explain how video and audio are interleaved for storage and sync’d for playout.

MPEG-2 video builds on some of the basic encoding concepts of the earlier standard but broadens its application to what might roughly be described as “broadcast TV quality” at roughly “standard definition”, leading to the first generation of digital STBs and associated services. It is what I understand by “DVD format”. Most DVDs are encoded in MPEG-2 format, you need to play DVD with MPEG-2 decoder.