[FFmpeg-trac] #5698(avformat:new): support for Matroska's EditionFlagOrdered

FFmpeg trac at avcodec.org
Fri Jul 8 23:26:13 EEST 2016


#5698: support for Matroska's EditionFlagOrdered
---------------------------------------+----------------------------------
               Reporter:  dericed      |                  Owner:
                   Type:  defect       |                 Status:  new
               Priority:  normal       |              Component:  avformat
                Version:  unspecified  |               Keywords:  matroska
             Blocked By:               |               Blocking:
Reproduced by developer:  0            |  Analyzed by developer:  0
---------------------------------------+----------------------------------
 Summary of the bug:

 When digitizing videotapes for preservation they usually include color
 bars, titles, and countdown before the presentation. I'd like to digitize
 the entire tape to Matroska and then use Ordered Editions to manage two
 presentations (a default one just referencing the presentation and one
 referencing the whole tape). In VLC the use of Ordered Chapters works
 great.

 In FFmpeg I would like to support the file with ordered chapters as an
 input so that it decodes according to the timeline of the ordered
 chapters. There is a one minute sample here, where the file starts with
 color bars, black frames, and countdown before the program. The default
 chapter edition should start the presentation at 36 seconds, but ffmpeg
 starts from the beginning of the timeline. The Ordered Chapters should
 create a 10 second long presentation from two in-out points.

 I see that in ffmpeg discussions there is concern about using Ordered
 Editions with Linked Segments as a security issue, but this use is for
 Ordered Editions within an unLinked Segment.

 How to reproduce:
 {{{
 ffmpeg -i
 https://archive.org/download/SXL01601Ffv1Test/SXL01601_ffv1_test.mkv
 is_this_about_10_seconds_long.mkv
 ffmpeg version N-44953-g0f2654c Copyright (c) 2000-2016 the FFmpeg
 developers
   built with Apple LLVM version 7.3.0 (clang-703.0.31)
   configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD --enable-shared
 --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables
 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-
 opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --enable-
 libfreetype --enable-ffplay --disable-lzma --enable-vda
   libavutil      55. 28.100 / 55. 28.100
   libavcodec     57. 49.103 / 57. 49.103
   libavformat    57. 41.100 / 57. 41.100
   libavdevice    57.  0.102 / 57.  0.102
   libavfilter     6. 47.100 /  6. 47.100
   libavresample   3.  0.  0 /  3.  0.  0
   libswscale      4.  1.100 /  4.  1.100
   libswresample   2.  1.100 /  2.  1.100
   libpostproc    54.  0.100 / 54.  0.100
 Guessed Channel Layout for Input Stream #0.1 : stereo
 Guessed Channel Layout for Input Stream #0.2 : stereo
 Input #0, matroska,webm, from
 'https://archive.org/download/SXL01601Ffv1Test/SXL01601_ffv1_test.mkv':
   Metadata:
     COMPATIBLE_BRANDS: qt
     MAJOR_BRAND     : qt
     MINOR_VERSION   : 512
     ENCODER         : Lavf57.25.100
   Duration: 00:01:00.03, start: 0.000000, bitrate: 30151 kb/s
     Chapter #0:0: start 36.302000, end 41.015000
     Metadata:
       title           : Introduction
     Chapter #0:1: start 44.382000, end 48.918000
     Metadata:
       title           : Discussion
     Stream #0:0(eng): Video: ffv1 (FFV1 / 0x31564646), yuv422p, 720x486,
 SAR 9:10 DAR 4:3, 29.97 fps, 29.97 tbr, 1k tbn, 1k tbc (default)
     Metadata:
       HANDLER_NAME    : DataHandler
       ENCODER         : FFV1 version 3
       DURATION        : 00:01:00.026000000
     Stream #0:1(eng): Audio: pcm_s24le, 48000 Hz, 2 channels, s32 (24
 bit), 2304 kb/s (default)
     Metadata:
       HANDLER_NAME    : DataHandler
       DURATION        : 00:01:00.014000000
     Stream #0:2(eng): Audio: pcm_s24le, 48000 Hz, 2 channels, s32 (24
 bit), 2304 kb/s
     Metadata:
       HANDLER_NAME    : DataHandler
       DURATION        : 00:01:00.014000000
 No pixel format specified, yuv422p for H.264 encoding chosen.
 Use -pix_fmt yuv420p for compatibility with outdated media players.
 [libx264 @ 0x7fe8d4016800] using SAR=9/10
 [libx264 @ 0x7fe8d4016800] using cpu capabilities: MMX2 SSE2Fast SSSE3
 SSE4.2 AVX
 [libx264 @ 0x7fe8d4016800] profile High 4:2:2, level 3.1, 4:2:2 8-bit
 [libx264 @ 0x7fe8d4016800] 264 - core 148 r2668 fd2c324 - H.264/MPEG-4 AVC
 codec - Copyleft 2003-2016 - http://www.videolan.org/x264.html - options:
 cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1
 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1
 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6
 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0
 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1
 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25
 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0
 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
 [matroska @ 0x7fe8d4017400] Using AVStream.codec to pass codec parameters
 to muxers is deprecated, use AVStream.codecpar instead.
     Last message repeated 1 times
 Output #0, matroska, to 'is_this_about_10_seconds_long.mkv':
   Metadata:
     COMPATIBLE_BRANDS: qt
     MAJOR_BRAND     : qt
     MINOR_VERSION   : 512
     encoder         : Lavf57.41.100
     Chapter #0:0: start 36.302000, end 41.015000
     Metadata:
       title           : Introduction
     Chapter #0:1: start 44.382000, end 48.918000
     Metadata:
       title           : Discussion
     Stream #0:0(eng): Video: h264 (libx264) (H264 / 0x34363248), yuv422p,
 720x486 [SAR 9:10 DAR 4:3], q=-1--1, 29.97 fps, 1k tbn, 29.97 tbc
 (default)
     Metadata:
       HANDLER_NAME    : DataHandler
       DURATION        : 00:01:00.026000000
       encoder         : Lavc57.49.103 libx264
     Side data:
       cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
     Stream #0:1(eng): Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, stereo,
 fltp (24 bit), 192 kb/s (default)
     Metadata:
       HANDLER_NAME    : DataHandler
       DURATION        : 00:01:00.014000000
       encoder         : Lavc57.49.103 ac3
 Stream mapping:
   Stream #0:0 -> #0:0 (ffv1 (native) -> h264 (libx264))
   Stream #0:1 -> #0:1 (pcm_s24le (native) -> ac3 (native))
 Press [q] to stop, [?] for help
 frame= 1799 fps= 29 q=-1.0 Lsize=    5719kB time=00:01:00.02 bitrate=
 780.4kbits/s speed=0.964x
 video:4286kB audio:1407kB subtitle:0kB other streams:0kB global
 headers:0kB muxing overhead: 0.457560%
 [libx264 @ 0x7fe8d4016800] frame I:9     Avg QP:19.26  size: 18768
 [libx264 @ 0x7fe8d4016800] frame P:735   Avg QP:22.72  size:  5101
 [libx264 @ 0x7fe8d4016800] frame B:1055  Avg QP:27.01  size:   445
 [libx264 @ 0x7fe8d4016800] consecutive B-frames: 10.9% 27.5% 15.8% 45.8%
 [libx264 @ 0x7fe8d4016800] mb I  I16..4: 39.8% 48.2% 12.1%
 [libx264 @ 0x7fe8d4016800] mb P  I16..4:  2.8%  3.7%  0.2%  P16..4: 38.1%
 7.9%  5.0%  0.0%  0.0%    skip:42.4%
 [libx264 @ 0x7fe8d4016800] mb B  I16..4:  0.2%  0.0%  0.0%  B16..8: 11.7%
 0.1%  0.0%  direct: 1.0%  skip:86.8%  L0:26.9% L1:71.3% BI: 1.8%
 [libx264 @ 0x7fe8d4016800] 8x8 transform intra:52.6% inter:75.4%
 [libx264 @ 0x7fe8d4016800] coded y,uvDC,uvAC intra: 27.3% 53.2% 9.0%
 inter: 11.2% 21.4% 1.0%
 [libx264 @ 0x7fe8d4016800] i16 v,h,dc,p: 40% 45%  4% 11%
 [libx264 @ 0x7fe8d4016800] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 18% 16% 43%  3%
 4%  4%  5%  3%  5%
 [libx264 @ 0x7fe8d4016800] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 37% 11%  4%
 5%  5%  7%  4%  6%
 [libx264 @ 0x7fe8d4016800] i8c dc,h,v,p: 51% 25% 19%  5%
 [libx264 @ 0x7fe8d4016800] Weighted P-Frames: Y:31.4% UV:20.5%
 [libx264 @ 0x7fe8d4016800] ref P L0: 55.2% 24.9% 15.2%  3.8%  1.0%
 [libx264 @ 0x7fe8d4016800] ref B L0: 85.7% 13.5%  0.8%
 [libx264 @ 0x7fe8d4016800] ref B L1: 99.9%  0.1%
 [libx264 @ 0x7fe8d4016800] kb/s:584.77

 }}}

--
Ticket URL: <https://trac.ffmpeg.org/ticket/5698>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list