Opened 8 years ago

Last modified 7 years ago

#6025 new defect

prores encoder does not write interlacement data in the stream

Reported by: dave rice Owned by:
Priority: normal Component: avcodec
Version: unspecified Keywords: prores
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

The 'prores' encoder does not set the interlacement (though the 'prores_ks' encoder does).

Here is a sample created with 'prores_ks' called prores_ks.mov.

ffmpeg -f lavfi -i mandelbrot=r=1 -t 1 -c:v prores_ks -vf setfield=tff -field_order tt -flags +ildct+ilme -y prores_ks.mov
ffmpeg version N-44102-g457e933 Copyright (c) 2000-2016 the FFmpeg developers
  built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD-457e933 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-chromaprint --enable-ffplay --enable-libfreetype --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --disable-lzma --enable-vda
  libavutil      55. 43.100 / 55. 43.100
  libavcodec     57. 68.100 / 57. 68.100
  libavformat    57. 60.100 / 57. 60.100
  libavdevice    57.  2.100 / 57.  2.100
  libavfilter     6. 68.100 /  6. 68.100
  libavresample   3.  2.  0 /  3.  2.  0
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
  libpostproc    54.  2.100 / 54.  2.100
Input #0, lavfi, from 'mandelbrot=r=1':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: rawvideo (RGB[0] / 0x424752), rgb0, 640x480 [SAR 1:1 DAR 4:3], 1 fps, 1 tbr, 1 tbn, 1 tbc
[prores_ks @ 0x7fbf5c825600] Autoselected 4:4:4:4 profile because of the used input colorspace. It can be overridden through -profile option.
Output #0, mov, to 'prores_ks.mov':
  Metadata:
    encoder         : Lavf57.60.100
    Stream #0:0: Video: prores (prores_ks) (ap4h / 0x68347061), yuv444p10le(top first), 640x480 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 1 fps, 16384 tbn, 1 tbc
    Metadata:
      encoder         : Lavc57.68.100 prores_ks
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> prores (prores_ks))
Press [q] to stop, [?] for help
frame=    1 fps=0.0 q=-0.0 Lsize=     256kB time=00:00:00.00 bitrate=34329180.3kbits/s speed=0.00173x    
video:255kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.284272%

prores_ks.mov shows that it is TFF as requested with interlaced_frame=1 and top_field_first=1.

ffprobe -i prores_ks.mov -show_entries frame=interlaced_frame,top_field_first
ffprobe version N-44102-g457e933 Copyright (c) 2007-2016 the FFmpeg developers
  built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD-457e933 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-chromaprint --enable-ffplay --enable-libfreetype --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --disable-lzma --enable-vda
  libavutil      55. 43.100 / 55. 43.100
  libavcodec     57. 68.100 / 57. 68.100
  libavformat    57. 60.100 / 57. 60.100
  libavdevice    57.  2.100 / 57.  2.100
  libavfilter     6. 68.100 /  6. 68.100
  libavresample   3.  2.  0 /  3.  2.  0
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
  libpostproc    54.  2.100 / 54.  2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'prores_ks.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 512
    compatible_brands: qt  
    encoder         : Lavf57.60.100
  Duration: 00:00:01.00, start: 0.000000, bitrate: 2094 kb/s
    Stream #0:0(eng): Video: prores (ap4h / 0x68347061), yuv444p10le(top first), 640x480, 2088 kb/s, SAR 1:1 DAR 4:3, 1 fps, 1 tbr, 16384 tbn, 16384 tbc (default)
    Metadata:
      handler_name    : DataHandler
      encoder         : Lavc57.68.100 prores_ks
[FRAME]
interlaced_frame=1
top_field_first=1
[/FRAME]

However the 'prores' encoder does not set the interlacement data in the stream. This creates prores.mov with the same settings except with the prores (rather than prores_ks) encoder.

ffmpeg -f lavfi -i mandelbrot=r=1 -t 1 -c:v prores -vf setfield=tff -field_order tt -flags +ildct+ilme -y prores.mov
ffmpeg version N-44102-g457e933 Copyright (c) 2000-2016 the FFmpeg developers
  built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD-457e933 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-chromaprint --enable-ffplay --enable-libfreetype --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --disable-lzma --enable-vda
  libavutil      55. 43.100 / 55. 43.100
  libavcodec     57. 68.100 / 57. 68.100
  libavformat    57. 60.100 / 57. 60.100
  libavdevice    57.  2.100 / 57.  2.100
  libavfilter     6. 68.100 /  6. 68.100
  libavresample   3.  2.  0 /  3.  2.  0
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
  libpostproc    54.  2.100 / 54.  2.100
Input #0, lavfi, from 'mandelbrot=r=1':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: rawvideo (RGB[0] / 0x424752), rgb0, 640x480 [SAR 1:1 DAR 4:3], 1 fps, 1 tbr, 1 tbn, 1 tbc
[prores @ 0x7fd6a8803e00] encoding with ProRes standard (apcn) profile
[prores @ 0x7fd6a8837200] encoding with ProRes standard (apcn) profile
[prores @ 0x7fd6a8839a00] encoding with ProRes standard (apcn) profile
[prores @ 0x7fd6a883c200] encoding with ProRes standard (apcn) profile
[prores @ 0x7fd6a883ea00] encoding with ProRes standard (apcn) profile
[prores @ 0x7fd6a8841200] encoding with ProRes standard (apcn) profile
[prores @ 0x7fd6a8843a00] encoding with ProRes standard (apcn) profile
[prores @ 0x7fd6a8846200] encoding with ProRes standard (apcn) profile
[prores @ 0x7fd6a8848a00] encoding with ProRes standard (apcn) profile
[prores @ 0x7fd6a884b200] encoding with ProRes standard (apcn) profile
[prores @ 0x7fd6a884da00] encoding with ProRes standard (apcn) profile
[prores @ 0x7fd6a8850200] encoding with ProRes standard (apcn) profile
[prores @ 0x7fd6a8852a00] encoding with ProRes standard (apcn) profile
[prores @ 0x7fd6a8855200] encoding with ProRes standard (apcn) profile
[prores @ 0x7fd6a8857a00] encoding with ProRes standard (apcn) profile
[prores @ 0x7fd6a885a200] encoding with ProRes standard (apcn) profile
[prores @ 0x7fd6a885ca00] encoding with ProRes standard (apcn) profile
[prores @ 0x7fd6a885f200] encoding with ProRes standard (apcn) profile
[prores @ 0x7fd6a8861a00] encoding with ProRes standard (apcn) profile
[prores @ 0x7fd6a8864200] encoding with ProRes standard (apcn) profile
[prores @ 0x7fd6a8866a00] encoding with ProRes standard (apcn) profile
[prores @ 0x7fd6a8869200] encoding with ProRes standard (apcn) profile
[prores @ 0x7fd6a886ba00] encoding with ProRes standard (apcn) profile
[prores @ 0x7fd6a886e200] encoding with ProRes standard (apcn) profile
[prores @ 0x7fd6aa001800] encoding with ProRes standard (apcn) profile
Output #0, mov, to 'prores.mov':
  Metadata:
    encoder         : Lavf57.60.100
    Stream #0:0: Video: prores (apcn / 0x6E637061), yuv422p10le(top first), 640x480 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 1 fps, 16384 tbn, 1 tbc
    Metadata:
      encoder         : Lavc57.68.100 prores
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> prores (native))
Press [q] to stop, [?] for help
frame=    1 fps=0.0 q=-0.0 Lsize=     107kB time=00:00:00.00 bitrate=14404196.7kbits/s speed=0.00253x    
video:107kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.680172%

The resulting prores.mov is considered as interlaced_frame=0 and top_field_first=0.

ffprobe -i prores.mov -show_entries frame=interlaced_frame,top_field_first
ffprobe version N-44102-g457e933 Copyright (c) 2007-2016 the FFmpeg developers
  built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD-457e933 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-chromaprint --enable-ffplay --enable-libfreetype --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --disable-lzma --enable-vda
  libavutil      55. 43.100 / 55. 43.100
  libavcodec     57. 68.100 / 57. 68.100
  libavformat    57. 60.100 / 57. 60.100
  libavdevice    57.  2.100 / 57.  2.100
  libavfilter     6. 68.100 /  6. 68.100
  libavresample   3.  2.  0 /  3.  2.  0
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
  libpostproc    54.  2.100 / 54.  2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'prores.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 512
    compatible_brands: qt  
    encoder         : Lavf57.60.100
  Duration: 00:00:01.00, start: 0.000000, bitrate: 878 kb/s
    Stream #0:0(eng): Video: prores (apcn / 0x6E637061), yuv422p10le(top first), 640x480, 872 kb/s, SAR 1:1 DAR 4:3, 1 fps, 1 tbr, 16384 tbn, 16384 tbc (default)
    Metadata:
      handler_name    : DataHandler
      encoder         : Lavc57.68.100 prores
[FRAME]
interlaced_frame=0
top_field_first=0
[/FRAME]

Should note that both samples have the 'fiel' atom in QuickTime set correctly to TFF, but the discrepancy in the encoding for prores.mov causes issues when the resulting files are handled in Final Cut software.

Change History (1)

comment:1 by Elon Musk, 7 years ago

Prores will be replaced with prores_ks.

Note: See TracTickets for help on using tickets.