[FFmpeg-user] MPEG-2 video, m2v1 (?) vs mp2v

Jason C jason.cipriani at gmail.com
Thu Jan 28 14:35:47 CET 2016


On Thu, Jan 28, 2016 at 3:51 AM, Moritz Barsnick <barsnick at gmx.net> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg-20160128-082140-mp2v.log
Type: application/octet-stream
Size: 6966 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20160128/e36ed051/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg-20160128-082149-mpgv.log
Type: application/octet-stream
Size: 5813 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20160128/e36ed051/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg-20160128-082215-mpg2.log
Type: application/octet-stream
Size: 5813 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20160128/e36ed051/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg-20160128-082111-m2v1-default.log
Type: application/octet-stream
Size: 6758 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20160128/e36ed051/attachment-0003.obj>


More information about the ffmpeg-user mailing list