MPEG-2 video, m2v1 (?) vs mp2v

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

MPEG-2 video, m2v1 (?) vs mp2v

Jason C
I'm using ffmpeg on Windows, the latest build available as of the time of
this writing:

  ffmpeg version N-78067-g9079e99 Copyright (c) 2000-2016 the FFmpeg
developers

My goal is to create an MPEG-2 video (container format doesn't matter).
When I use "-vcodec mpeg2video" the output has the fourcc "m2v1". This
output is unplayable in VLC, Windows Media Player (with K-Lite codec pack),
mplayer, and the QuickTime player. Additionally, "m2v1" doesn't seem to
exist in any fourcc databases. It seems to be incorrect.

What I *have *found is that the fourcc for MPEG-2 video seems to actually
be "mp2v", but I can't find another MPEG-2 video codec listed with
"-codecs".

So my main question is: How do I encode an MPEG-2 video with ffmpeg, with
fourcc code "mp2v", or at least to something that is playable by any common
media players?

And my second question is: What is "m2v1"? It seems to be rarely used,
possibly nonexistent, and possibly unique to ffmpeg (although I did read
some forum posts that look like rare combinations of older Mac software
used to generate it).

Actually I have a third question: I also have a similar problem with
MPEG-1, where ffmpeg uses "m1v1" which is unplayable by VLC at least, but
I'm not actually sure what the fourcc is supposed to be.

Thanks,
Jason
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: MPEG-2 video, m2v1 (?) vs mp2v

Jason C
I discovered the -vtag option. There also seems to be "mpgv"... but it only
works in certain containers (e.g. works with AVI, ffmpeg fails with MOV).
Now I'm really confused...

Jason

On Wed, Jan 27, 2016 at 9:20 PM, Jason C <[hidden email]> wrote:

> I'm using ffmpeg on Windows, the latest build available as of the time of
> this writing:
>
>   ffmpeg version N-78067-g9079e99 Copyright (c) 2000-2016 the FFmpeg
> developers
>
> My goal is to create an MPEG-2 video (container format doesn't matter).
> When I use "-vcodec mpeg2video" the output has the fourcc "m2v1". This
> output is unplayable in VLC, Windows Media Player (with K-Lite codec pack),
> mplayer, and the QuickTime player. Additionally, "m2v1" doesn't seem to
> exist in any fourcc databases. It seems to be incorrect.
>
> What I *have *found is that the fourcc for MPEG-2 video seems to actually
> be "mp2v", but I can't find another MPEG-2 video codec listed with
> "-codecs".
>
> So my main question is: How do I encode an MPEG-2 video with ffmpeg, with
> fourcc code "mp2v", or at least to something that is playable by any common
> media players?
>
> And my second question is: What is "m2v1"? It seems to be rarely used,
> possibly nonexistent, and possibly unique to ffmpeg (although I did read
> some forum posts that look like rare combinations of older Mac software
> used to generate it).
>
> Actually I have a third question: I also have a similar problem with
> MPEG-1, where ffmpeg uses "m1v1" which is unplayable by VLC at least, but
> I'm not actually sure what the fourcc is supposed to be.
>
> Thanks,
> Jason
>
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: MPEG-2 video, m2v1 (?) vs mp2v

Moritz Barsnick
Hi Jason,

On Wed, Jan 27, 2016 at 21:34:23 -0500, Jason C wrote:
> > My goal is to create an MPEG-2 video (container format doesn't matter).
> > When I use "-vcodec mpeg2video" the output has the fourcc "m2v1". This
> > output is unplayable in VLC, Windows Media Player (with K-Lite codec pack),
> > mplayer, and the QuickTime player. Additionally, "m2v1" doesn't seem to
> > exist in any fourcc databases. It seems to be incorrect.

How did you check the FourCC?

That said, I just created a file with mpeg2video as such:
$ ffmpeg -f lavfi -i testsrc2 -c:v mpeg2video -t 5 ffmpeg.mpeg2video.avi
(albeit on Linux) an it plays just fine in (Windows) mplayer and VLC.

Could you please show us the full command line you used and the
complete, uncut console output?

Thanks,
Moritz

P.S.:
$ ffmpeg -f lavfi -i testsrc2 -c:v mpeg2video -t 5 ffmpeg.mpeg2video.avi
ffmpeg version N-77840-gcc538e9 Copyright (c) 2000-2016 the FFmpeg developers
  built with icc (ICC) 14.0.3 20140422
  configuration: --prefix=/usr/new/tools/video/install/ffmpeg/2016-01-14 --cc=icc --cxx=icpc --enable-gpl --enable-version3 --enable-nonfree  --disable-shared --enable-gnutls --enable-libcdio --enable-libfreetype --enable-libx264 --enable-libvpx --enable-libmp3lame --enable-openal --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtwolame --enable-libopenjpeg --enable-librtmp --enable-libass --enable-libv4l2 --enable-libvidstab --enable-libfdk-aac --enable-libsmbclient --enable-libquvi --enable-libzvbi --enable-libtesseract --enable-libzmq
  libavutil      55. 13.100 / 55. 13.100
  libavcodec     57. 22.100 / 57. 22.100
  libavformat    57. 21.101 / 57. 21.101
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 23.100 /  6. 23.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Input #0, lavfi, from 'testsrc2':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Output #0, avi, to 'ffmpeg.mpeg2video.avi':
  Metadata:
    ISFT            : Lavf57.21.101
    Stream #0:0: Video: mpeg2video (Main) (mpg2 / 0x3267706D), yuv420p, 320x240 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.22.100 mpeg2video
    Side data:
      unknown side data type 10 (24 bytes)
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> mpeg2video (native))
Press [q] to stop, [?] for help
frame=  125 fps=0.0 q=23.4 Lsize=     222kB time=00:00:04.96 bitrate= 367.0kbits/s speed=15.3x
video:214kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 4.032623%
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: MPEG-2 video, m2v1 (?) vs mp2v

Carl Eugen Hoyos
In reply to this post by Jason C
Jason C <jason.cipriani <at> gmail.com> writes:

> My goal is to create an MPEG-2 video

> (container format doesn't matter).

That is not true...

Please provide the command line you tested together with the
complete, uncut console output.

Carl Eugen

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: MPEG-2 video, m2v1 (?) vs mp2v

Carl Eugen Hoyos
In reply to this post by Moritz Barsnick
Moritz Barsnick <barsnick <at> gmx.net> writes:

> That said, I just created a file with mpeg2video as such:
> $ ffmpeg -f lavfi -i testsrc2 -c:v mpeg2video -t 5 ffmpeg.mpeg2video.avi

But the OP is only interested in mov...

Carl Eugen

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: MPEG-2 video, m2v1 (?) vs mp2v

Moritz Barsnick
On Thu, Jan 28, 2016 at 08:53:01 +0000, Carl Eugen Hoyos wrote:
> But the OP is only interested in mov...

I cannot find that information in the original e-mail. He is very
general and even writes:
> My goal is to create an MPEG-2 video (container format doesn't
> matter).

In the second e-mail he writes:
> but it only works in certain containers (e.g. works with AVI, ffmpeg
> fails with MOV)
which sounds like an experiment, not a desired format.

But indeed, with MOV, the named FourCCs are used, and while my mplayer
*can* play then, VLC refuses to. And those FourCCs are not listed here:
http://wiki.multimedia.cx/?title=QuickTime_container#Video_FOURCCs
(while I would probably need to look into the official Quicktime file
format documentation, where I can right now only find pixel format
FourCCs).

Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: MPEG-2 video, m2v1 (?) vs mp2v

Moritz Barsnick
On Thu, Jan 28, 2016 at 10:25:23 +0100, Moritz Barsnick wrote:
> But indeed, with MOV, the named FourCCs are used, and while my mplayer
> *can* play then, VLC refuses to. And those FourCCs are not listed here:

And I can find reports from the last 10 years saying people have videos
with m2v1 FourCC (even created by other software than ffmpeg) which
cannot be played in QT, VLC, ... due to the FourCC.

I wonder what should really be chosen. Can't figure it out...

Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: MPEG-2 video, m2v1 (?) vs mp2v

Carl Eugen Hoyos
In reply to this post by Moritz Barsnick
Moritz Barsnick <barsnick <at> gmx.net> writes:

> But indeed, with MOV, the named FourCCs are used, and while
> my mplayer *can* play then, VLC refuses to.

FourCCs are related to riff / avi.
mov / mp4 code points can be found here:
http://www.mp4ra.org/codecs.html
Since mpeg1video and mpeg2video are not listed
it is difficult to find the right code point;-(

> And those FourCCs are not listed here:
> http://wiki.multimedia.cx/?title=QuickTime_container#Video_FOURCCs

But no (good) alternatives are presented on this list either;-(

Note that from a quick look, -f mp4 works fine for one of the codecs.
It uses these object type indicators:
http://www.mp4ra.org/object.html

Carl Eugen

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: MPEG-2 video, m2v1 (?) vs mp2v

Jason C
In reply to this post by Moritz Barsnick
On Thu, Jan 28, 2016 at 3:51 AM, Moritz Barsnick <[hidden email]> wrote:

> On Wed, Jan 27, 2016 at 21:34:23 -0500, Jason C wrote:
> > > My goal is to create an MPEG-2 video (container format doesn't matter).
> > > When I use "-vcodec mpeg2video" the output has the fourcc "m2v1". This
> > > output is unplayable in VLC, Windows Media Player (with K-Lite codec
> pack),
> > > mplayer, and the QuickTime player. Additionally, "m2v1" doesn't seem to
> > > exist in any fourcc databases. It seems to be incorrect.
>
> How did you check the FourCC?
>
Guys, I'm so sorry. I think I was really tired last night and confused all
of my tests. I just redid all of this in a much more controlled way and
found that the issue is unique to MOV output. I tested the following
formats with mpeg2video and they all play just fine: AVI, ASF, Matroska,
MP4. The AVI uses the code "mpg2" (checked with VLC and a hex editor). So
that takes care of my general goal. Still...

It's only the MOV output that uses the strange "m2v1" by default and is
unplayable. The following produces an MOV with "m2v1", which is not
playable:

  ffmpeg -i input.avi -vcodec mpeg2video -f mov output.mov

The following produces an MOV with "mp2v", which is playable:

  ffmpeg -i input.avi -vcodec mpeg2video -vtag mp2v -f mov output.mov

The following fails with the error "Tag mpgv/0x7667706d incompatible with
output codec id '2' (m2v1)":

  ffmpeg -i input.avi -vcodec mpeg2video -vtag mpgv -f mov output.mov

Using "-vtag mpg2" fails in a similar manner.

Could you please show us the full command line you used and the
> complete, uncut console output?
>

Full "-v 9 -loglevel 99 -report" command lines and console output for the
above is attached, and I've also pasted the output of the first command
below in case something goes awry with the attachments.

Again, very sorry about the confusion that led to this discussion.

I am wondering if I should file a bug report about the MOV output. Open
questions in that vein, though, are:

- What is the "correct" FourCC? mp2v seems like a more reasonable choice
than m2v1.
- Is it a bug that mpg2 and mpgv cause MOV output to fail or is that
correct behavior?

Jason

====

ffmpeg started on 2016-01-28 at 08:21:11
Report written to "ffmpeg-20160128-082111.log"
Command line:
ffmpeg -v 9 -loglevel 99 -report -i input.avi -vcodec mpeg2video -f mov
output.mov
ffmpeg version N-78067-g9079e99 Copyright (c) 2000-2016 the FFmpeg
developers
  built with gcc 5.2.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads
--enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r
--enable-gnutls --enable-iconv --enable-libass --enable-libbluray
--enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype
--enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug
--enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb
--enable-libopenjpeg --enable-libopus --enable-librtmp
--enable-libschroedinger --enable-libsoxr --enable-libspeex
--enable-libtheora --enable-libtwolame --enable-libvidstab
--enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis
--enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264
--enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg
--enable-lzma --enable-decklink --enable-zlib
  libavutil      55. 15.100 / 55. 15.100
  libavcodec     57. 22.102 / 57. 22.102
  libavformat    57. 23.100 / 57. 23.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 27.100 /  6. 27.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with
argument '9'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging
level) with argument '99'.
Reading option '-report' ... matched as option 'report' (generate a report)
with argument '1'.
Reading option '-i' ... matched as input file with argument 'input.avi'.
Reading option '-vcodec' ... matched as option 'vcodec' (force video codec
('copy' to copy stream)) with argument 'mpeg2video'.
Reading option '-f' ... matched as option 'f' (force format) with argument
'mov'.
Reading option 'output.mov' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument 9.
Applying option loglevel (set logging level) with argument 99.
Applying option report (generate a report) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input file input.avi.
Successfully parsed a group of options.
Opening an input file: input.avi.
[avi @ 00000000004b3ea0] Format avi probed with size=2048 and score=100
[avi @ 00000000004bd760] use odml:1
[avi @ 00000000004b3ea0] Before avformat_find_stream_info() pos: 5698 bytes
read:127144 seeks:4
[avi @ 00000000004b3ea0] parser not found for codec rawvideo, packets or
times may be invalid.
[avi @ 00000000004b3ea0] parser not found for codec rawvideo, packets or
times may be invalid.
[avi @ 00000000004b3ea0] All info found
[avi @ 00000000004b3ea0] After avformat_find_stream_info() pos: 466506
bytes read:555184 seeks:4 frames:1
Input #0, avi, from 'input.avi':
  Metadata:
    encoder         : Lavf57.23.100
    timecode        : 00:00:00:00
  Duration: 00:00:30.03, start: 0.000000, bitrate: 110599 kb/s
    Stream #0:0, 1, 1/30: Video: rawvideo, 1 reference frame (I420 /
0x30323449), yuv420p, 640x480, 1/30, 110714 kb/s, 30 fps, 30 tbr, 30 tbn,
30 tbc
Successfully opened the file.
Parsing a group of options: output file output.mov.
Applying option vcodec (force video codec ('copy' to copy stream)) with
argument mpeg2video.
Applying option f (force format) with argument mov.
Successfully parsed a group of options.
Opening an output file: output.mov.
Successfully opened the file.
detected 4 logical cores
[graph 0 input from stream 0:0 @ 0000000000543ce0] Setting 'video_size' to
value '640x480'
[graph 0 input from stream 0:0 @ 0000000000543ce0] Setting 'pix_fmt' to
value '0'
[graph 0 input from stream 0:0 @ 0000000000543ce0] Setting 'time_base' to
value '1/30'
[graph 0 input from stream 0:0 @ 0000000000543ce0] Setting 'pixel_aspect'
to value '0/1'
[graph 0 input from stream 0:0 @ 0000000000543ce0] Setting 'sws_param' to
value 'flags=2'
[graph 0 input from stream 0:0 @ 0000000000543ce0] Setting 'frame_rate' to
value '30/1'
[graph 0 input from stream 0:0 @ 0000000000543ce0] w:640 h:480
pixfmt:yuv420p tb:1/30 fr:30/1 sar:0/1 sws_param:flags=2
[format @ 00000000004bcb20] compat: called with args=[yuv420p|yuv422p]
[format @ 00000000004bcb20] Setting 'pix_fmts' to value 'yuv420p|yuv422p'
[AVFilterGraph @ 00000000004b3ac0] query_formats: 4 queried, 3 merged, 0
already done, 0 delayed
[mpeg2video @ 00000000005389c0] intra_quant_bias = 96 inter_quant_bias = 0
Output #0, mov, to 'output.mov':
  Metadata:
    timecode        : 00:00:00:00
    encoder         : Lavf57.23.100
    Stream #0:0, 0, 1/15360: Video: mpeg2video (Main), 1 reference frame
(m2v1 / 0x3176326D), yuv420p, 640x480, 1/30, q=2-31, 200 kb/s, 30 fps,
15360 tbn, 30 tbc
    Metadata:
      encoder         : Lavc57.22.102 mpeg2video
    Side data:
      unknown side data type 10 (24 bytes)
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> mpeg2video (native))
Press [q] to stop, [?] for help
cur_dts is invalid (this is harmless if it occurs once at the start per
stream)
Clipping frame in rate conversion by 0.000008
cur_dts is invalid (this is harmless if it occurs once at the start per
stream)
frame=  199 fps=0.0 q=31.0 size=     377kB time=00:00:06.56 bitrate=
470.6kbits/s speed=12.8x
frame=  406 fps=394 q=31.0 size=     736kB time=00:00:13.46 bitrate=
447.4kbits/s speed=13.1x
frame=  614 fps=398 q=24.8 size=    1088kB time=00:00:20.40 bitrate=
437.0kbits/s speed=13.2x
frame=  818 fps=397 q=24.8 size=    1418kB time=00:00:27.20 bitrate=
427.2kbits/s speed=13.2x
[output stream 0:0 @ 00000000004bc900] EOF on sink link output stream
0:0:default.
No more output streams to write to, finishing.
frame=  901 fps=398 q=24.8 Lsize=    1562kB time=00:00:30.00 bitrate=
426.6kbits/s speed=13.3x
video:1557kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 0.333133%
Input file #0 (input.avi):
  Input stream #0:0 (video): 901 packets read (415180800 bytes); 901 frames
decoded;
  Total: 901 packets (415180800 bytes) demuxed
Output file #0 (output.mov):
  Output stream #0:0 (video): 901 frames encoded; 901 packets muxed
(1594556 bytes);
  Total: 901 packets (1594556 bytes) muxed
901 frames successfully decoded, 0 decoding errors
[AVIOContext @ 00000000005438c0] Statistics: 66 seeks, 952 writeouts
[AVIOContext @ 00000000004bd660] Statistics: 415296808 bytes read, 4 seeks

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

ffmpeg-20160128-082140-mp2v.log (9K) Download Attachment
ffmpeg-20160128-082149-mpgv.log (7K) Download Attachment
ffmpeg-20160128-082215-mpg2.log (7K) Download Attachment
ffmpeg-20160128-082111-m2v1-default.log (9K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: MPEG-2 video, m2v1 (?) vs mp2v

Jason C
On Thu, Jan 28, 2016 at 8:35 AM, Jason C <[hidden email]> wrote:

> I am wondering if I should file a bug report about the MOV output. Open
> questions in that vein, though, are:
> - What is the "correct" FourCC? mp2v seems like a more reasonable choice
> than m2v1.
> - Is it a bug that mpg2 and mpgv cause MOV output to fail or is that
> correct behavior?


Also this hypothetical bug report would include similar behavior with
mpeg1video in MOV: By default it uses "m1v1", which is unplayable, but
"-vtag mp1v" seems to produce usable output. The other output formats
tested are fine by default, with the AVI using "mpg1". Encoding fails
similarly with "-vtag mp1v -f mov" and "-vtag mpg1 -f mov". It's basically
the same issue but with 1's instead of 2's. Same open questions.

Jason
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: MPEG-2 video, m2v1 (?) vs mp2v

Moritz Barsnick
In reply to this post by Jason C
On Thu, Jan 28, 2016 at 08:35:47 -0500, Jason C wrote:
> Guys, I'm so sorry. I think I was really tired last night and confused all
> of my tests.

No problem, we got it figured out.

> - What is the "correct" FourCC? mp2v seems like a more reasonable choice
> than m2v1.

That is an interesting question. Perhaps there are bigger MOV experts
somewhere else. I did read reports from 2008 that iMovie (also Apple
:-)) had exported such "m1v" or "m2v1" videos.

Perhaps at least open a bug report on trac?

> - Is it a bug that mpg2 and mpgv cause MOV output to fail or is that
> correct behavior?

I have no idea, I leave this one open.

Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user