What is the correct MPEG-2 FourCC? In my attempts to encode a video to MPEG-2 in an MOV (which seems to be a valid combination, at least according to Wikipedia), using ffmpeg (-vcodec mpeg2video) and other tools, I have become extremely confused about the FourCCs as well as seemingly related limitations on container formats. I have found:


m2v1: This is the default FourCC used by ffmpeg when encoding MPEG-2, but it is unplayable in all media players I have tried (VLC, Windows Media Player, mplayer, and QuickTime Player). It also does not seem to exist in any FourCC databases I have found. Forum posts are rare and are related to old Mac software and compatibility problems regarding this code.
mp2v: I can force this code with ffmpeg. It is then playable in all common media players. However, MPEG-2 videos encoded with other encoders (such as Handbrake or Prism), to AVIs, do not use this code, they use mpgv, which makes me suspicious.
mpgv: I can force this code with ffmpeg as well, but only when outputting to an AVI (and Handbrake uses it too but only outputs Matroska and MP4). Ffmpeg fails when I attempt to output MOV. Forum posts also indicate trouble with the mpgv + QuickTime container combination.


I'm very confused. Why are there different FourCC's for this, what is the correct one to use, how is it related to the container and, at the end of the day, if I want an MPEG-2 in an MOV what do I do?

I guess by "correct" in the title I mean compatible with the most common players; least likely to cause problems for normal people with stock software.

As a sub-question, VLC describes mpgv and mp2v as "MPEG-1/2 Video". So, if I see a video with FourCC mpgv, is it MPEG-1, or is it MPEG-2? I suspect my lack of understanding of how all the MPEG versions are related to each other is coming into play here.
Strictly speaking, fourcc is the codec ID used by Microsoft. It has been adapted for use with many other formats, thus making it seem like a standardized ID format, but it's not.

ffmpeg, in particular, seems to only consider XDCAM standard MPEG2 for inclusion in MOV.

From the source code:

else if (track-&gt;enc-&gt;codec_id == AV_CODEC_ID_MPEG2VIDEO)
    tag = mov_get_mpeg2_xdcam_codec_tag(s, track);


where if the xdcam tag function doesn't find a matching XDCAM stream, it runs

if (!tag)
    tag = MKTAG('m', '2', 'v', '1'); //fallback tag


which ffmpeg, interestingly, thinks is tha tag that should be used for recording MPEG-2 in a MOV by a camera.

{ AV_CODEC_ID_MPEG2VIDEO, MKTAG('m', '2', 'v', '1') }, /* Apple MPEG-2 Camcorder */ 


and mp2v is signalled as required for (an old version of) Final Cut Pro.

{ AV_CODEC_ID_MPEG2VIDEO, MKTAG('m', 'p', '2', 'v') }, /* FCP5 */


mpgv is not on that (ISO media) list that the MOV muxer can be forced to work with, but it is on the RIFF list (for AVIs) where it's only declared for MPEG-2, not MPEG-1

{ AV_CODEC_ID_MPEG2VIDEO, MKTAG('m', 'p', 'g', 'v') }




All the tag variants exist because each vendor or program decides to mark their streams a certain way and there's no single body policing their use. Stick with mp2v since that works for you.

Update: I just realized that any stream can be tagged with any tag if -strict -1 or -2 is applied. I was able to tag an AVC stream in a MOV with mpgv :)