Opened 5 years ago

Last modified 5 years ago

#7468 open defect

AVC muxing issue in a MOV container

Reported by: Buisson Owned by:
Priority: important Component: avformat
Version: git-master Keywords: mov regression
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Hi,
we found that a transcoding command line may result an invalid output file just by changing the output file extension from MP4 to MOV.

Using

ffmpeg version N-92087-gdcbd89e000 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 8.2.1 (GCC) 20180813
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
  libavutil      56. 19.101 / 56. 19.101
  libavcodec     58. 31.102 / 58. 31.102
  libavformat    58. 18.104 / 58. 18.104
  libavdevice    58.  4.105 / 58.  4.105
  libavfilter     7. 33.100 /  7. 33.100
  libswscale      5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
  libpostproc    55.  2.100 / 55.  2.100

We run 2 transcoding, the input file is a proprietary content I cannot share it, but please find it's spec below, the same transcoding to MOV work well with others files but only that intputfile leads to a "High 4:2:2@L3.1 10bits 422" output AVC stream.

Input file spec:

1
Format                      : ProRes
Format version              : Version 0
Format profile              : 422 Proxy
Codec ID                    : apco
Duration                    : 1 s 0 ms
Bit rate mode               : Variable
Bit rate                    : 37.3 Mb/s
Width                       : 1 920 pixels
Height                      : 1 080 pixels
Display aspect ratio        : 16:9
Frame rate mode             : Constant
Frame rate                  : 25.000 FPS
Color space                 : YUV
Chroma subsampling          : 4:2:2
Scan type                   : Interlaced
Scan type, store method     : Interleaved fields
Scan order                  : Top Field First

the command we use to create those weird MOV file is:

ffmpeg -i inputfile -t 5 -vf yadif -an -c:v libx264 -vsync 1 -r 30 -s 1280x720 -b:v 600k -g 60 -keyint_min 60 -preset ultrafast -tune zerolatency -y out.mov

and for the MP4

ffmpeg -i inputfile -t 5 -vf yadif -an -c:v libx264 -vsync 1 -r 30 -s 1280x720 -b:v 600k -g 60 -keyint_min 60 -preset ultrafast -tune zerolatency -y out.mp4

just the output file extension changed, I also compared the 2 command line logs and they are the same

[libx264 @ 064e4c80] using SAR=1/1
[libx264 @ 064e4c80] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 064e4c80] profile High 4:2:2, level 3.1, 4:2:2, 10-bit
[libx264 @ 064e4c80] 264 - core 157 r2932 303c484 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=8 lookahead_threads=8 sliced_threads=1 slices=8 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=60 keyint_min=31 scenecut=0 intra_refresh=0 rc=abr mbtree=0 bitrate=600 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=81 qpstep=4 ip_ratio=1.40 aq=0

So why the output files are so different, the MOV output file report to be encoded using "AVC High 422 Intra profile" where it should be "High 4:2:2@L3.1" ! ffplay cannot play the output MOV file ! The MP4 is exactly what we expected and play well.

ffmpeg -i out.mov
....
Duration: 00:00:05.00, start: 0.000000, bitrate: 621 kb/s
Stream #0:0(eng): Video: h264 (High 4:2:2 Intra) (ai1p / 0x70316961), yuv422p10le(pc, bt709), 1280x720 [SAR 1:1 DAR 16:9], 618 kb/s, 30 fps, 30 tbr, 15360 tbn, 100 tbc (default)
....

Attachments (1)

inputfile.mov (2.1 MB ) - added by Buisson 5 years ago.
BigBugBunny h264 (High 4:2:2) (avc1 / 0x31637661), yuv422p10le, 1920x1080

Change History (5)

comment:1 by Carl Eugen Hoyos, 5 years ago

Keywords: mov added; x264 AVC MOV muxer removed

To make this a valid ticket, please provide a short input file and post the command line you tested together with the complete, uncut console output.

by Buisson, 5 years ago

Attachment: inputfile.mov added

BigBugBunny h264 (High 4:2:2) (avc1 / 0x31637661), yuv422p10le, 1920x1080

comment:2 by Buisson, 5 years ago

Hi, I was able to reproduce the issue with an open source content bigBugBunny, re-encoded with ffmpeg:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'inputfile.mov':

Metadata:

major_brand : qt
minor_version : 512
compatible_brands: qt
encoder : Lavf58.18.104

Duration: 00:00:05.01, start: 0.000000, bitrate: 3506 kb/s

Stream #0:0(eng): Video: h264 (High 4:2:2) (avc1 / 0x31637661), yuv422p10le, 1920x1080 [SAR 1:1 DAR 16:9], 3503 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
Metadata:

handler_name : VideoHandler
encoder : Lavc58.31.102 libx264

I'm quite sure that the issue is coming from the yuv422p10le decoded frame, x264 choose the encoding profile to re-encode and that format "h264 (High 4:2:2) (avc1 / 0x31637661), yuv422p10le, 1280x720" may not be supported by the MOV muxer....

comment:3 by Buisson, 5 years ago

Full command line output

ffmpeg -i inputfile.mov -t 5 -vf yadif -an -c:v libx264 -vsync 1 -r 30 -s 1280x720 -b:v 600k -g 60 -keyint_min 60 -preset ultrafast -tune zerolatency -y out.mov
ffmpeg version N-92087-gdcbd89e000 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 8.2.1 (GCC) 20180813
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
  libavutil      56. 19.101 / 56. 19.101
  libavcodec     58. 31.102 / 58. 31.102
  libavformat    58. 18.104 / 58. 18.104
  libavdevice    58.  4.105 / 58.  4.105
  libavfilter     7. 33.100 /  7. 33.100
  libswscale      5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
  libpostproc    55.  2.100 / 55.  2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'inputfile.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf58.18.104
  Duration: 00:00:05.01, start: 0.000000, bitrate: 3506 kb/s
    Stream #0:0(eng): Video: h264 (High 4:2:2) (avc1 / 0x31637661), yuv422p10le, 1920x1080 [SAR 1:1 DAR 16:9], 3503 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      encoder         : Lavc58.31.102 libx264
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 05dbc240] using SAR=1/1
[libx264 @ 05dbc240] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 05dbc240] profile High 4:2:2, level 3.1, 4:2:2, 10-bit
[libx264 @ 05dbc240] 264 - core 157 r2932 303c484 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=8 lookahead_threads=8 sliced_threads=1 slices=8 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=60 keyint_min=31 scenecut=0 intra_refresh=0 rc=abr mbtree=0 bitrate=600 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=81 qpstep=4 ip_ratio=1.40 aq=0
Output #0, mov, to 'out.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf58.18.104
    Stream #0:0(eng): Video: h264 (libx264) (avc1 / 0x31637661), yuv422p10le, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 600 kb/s, 30 fps, 15360 tbn, 30 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      encoder         : Lavc58.31.102 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/600000 buffer size: 0 vbv_delay: -1
frame=  150 fps= 94 q=49.0 Lsize=     410kB time=00:00:04.96 bitrate= 677.0kbits/s dup=30 drop=0 speed=3.11x
video:409kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.324600%
[libx264 @ 05dbc240] frame I:3     Avg QP:44.00  size: 15055
[libx264 @ 05dbc240] frame P:147   Avg QP:46.31  size:  2539
[libx264 @ 05dbc240] mb I  I16..4: 100.0%  0.0%  0.0%
[libx264 @ 05dbc240] mb P  I16..4: 22.9%  0.0%  0.0%  P16..4:  8.9%  0.0%  0.0%  0.0%  0.0%    skip:68.1%
[libx264 @ 05dbc240] final ratefactor: 38.28
[libx264 @ 05dbc240] coded y,uvDC,uvAC intra: 1.5% 9.8% 1.0% inter: 2.5% 3.7% 0.2%
[libx264 @ 05dbc240] i16 v,h,dc,p: 58% 17% 22%  3%
[libx264 @ 05dbc240] i8c dc,h,v,p: 83% 10%  6%  2%
[libx264 @ 05dbc240] kb/s:669.37

looks fine .... BUT look at the following !!!!

ffmpeg -i out.mov
ffmpeg version N-92087-gdcbd89e000 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 8.2.1 (GCC) 20180813
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
  libavutil      56. 19.101 / 56. 19.101
  libavcodec     58. 31.102 / 58. 31.102
  libavformat    58. 18.104 / 58. 18.104
  libavdevice    58.  4.105 / 58.  4.105
  libavfilter     7. 33.100 /  7. 33.100
  libswscale      5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
  libpostproc    55.  2.100 / 55.  2.100
[h264 @ 04615980] deblocking_filter_idc 5 out of range
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] deblocking_filter_idc 5 out of range
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] deblocking_filter_idc 5 out of range
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] deblocking_filter_idc 5 out of range
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] deblocking_filter_idc 5 out of range
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] deblocking_filter_idc 5 out of range
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] deblocking_filter_idc 5 out of range
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] deblocking_filter_idc 5 out of range
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] no frame!
[h264 @ 04615980] reference count overflow
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] reference count overflow
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] reference count overflow
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] reference count overflow
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] reference count overflow
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] reference count overflow
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] reference count overflow
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] reference count overflow
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] no frame!
[h264 @ 04615980] illegal memory management control operation 32
[h264 @ 04615980] deblocking_filter_idc 3 out of range
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] illegal memory management control operation 32
[h264 @ 04615980] deblocking_filter_idc 3 out of range
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] illegal memory management control operation 32
[h264 @ 04615980] deblocking_filter_idc 15 out of range
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] illegal memory management control operation 32
[h264 @ 04615980] QP 103 out of range
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] illegal memory management control operation 32
[h264 @ 04615980] QP 103 out of range
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] illegal memory management control operation 32
[h264 @ 04615980] deblocking_filter_idc 15 out of range
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] illegal memory management control operation 32
[h264 @ 04615980] deblocking_filter_idc 15 out of range
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] illegal memory management control operation 32
[h264 @ 04615980] deblocking_filter_idc 32 out of range
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] no frame!
[h264 @ 04615980] illegal long ref in memory management control operation 4
[h264 @ 04615980] QP 103 out of range
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] illegal long ref in memory management control operation 4
[h264 @ 04615980] QP 103 out of range
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] illegal long ref in memory management control operation 4
[h264 @ 04615980] deblocking_filter_idc 15 out of range
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] illegal long ref in memory management control operation 4
[h264 @ 04615980] deblocking_filter_idc 3 out of range
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] illegal long ref in memory management control operation 4
[h264 @ 04615980] deblocking_filter_idc 3 out of range
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] illegal long ref in memory management control operation 4
[h264 @ 04615980] deblocking_filter_idc 15 out of range
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] illegal long ref in memory management control operation 4
[h264 @ 04615980] deblocking_filter_idc 15 out of range
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] illegal long ref in memory management control operation 4
[h264 @ 04615980] deblocking_filter_idc 32 out of range
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] no frame!
[h264 @ 04615980] deblocking filter parameters -481 65 out of range
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] deblocking filter parameters -401 65 out of range
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] deblocking filter parameters -481 16 out of range
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] deblocking filter parameters -481 4 out of range
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] deblocking filter parameters -401 4 out of range
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] deblocking filter parameters -481 1 out of range
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] deblocking filter parameters 93 -2 out of range
[h264 @ 04615980] decode_slice_header error
[h264 @ 04615980] Missing reference picture, default is 0
[h264 @ 04615980] decode_slice_header error
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'out.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf58.18.104
  Duration: 00:00:05.00, start: 0.000000, bitrate: 672 kb/s
    Stream #0:0(eng): Video: h264 (High 4:2:2 Intra) (ai1p / 0x70316961), yuv422p10le(pc, bt709), 1280x720 [SAR 1:1 DAR 16:9], 670 kb/s, 30 fps, 30 tbr, 15360 tbn, 100 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      encoder         : Lavc58.31.102 libx264
At least one output file must be specified

comment:4 by Carl Eugen Hoyos, 5 years ago

Keywords: regression added
Priority: normalimportant
Reproduced by developer: set
Status: newopen
Version: unspecifiedgit-master

Regression since f2e53808e329c403d1a409f3c35a93854064b6a2, probably related to ticket #3597.

Note: See TracTickets for help on using tickets.