[FFmpeg-trac] #2522(undetermined:new): Give ffmpeg (better) mp4 chapter editing support

FFmpeg trac at avcodec.org
Wed May 1 00:37:43 CEST 2013


#2522: Give ffmpeg (better) mp4 chapter editing support
-------------------------------------+-------------------------------------
             Reporter:  otters       |                    Owner:
                 Type:  enhancement  |                   Status:  new
             Priority:  normal       |                Component:
              Version:  1.2          |  undetermined
             Keywords:               |               Resolution:
             Blocking:               |               Blocked By:
Analyzed by developer:  0            |  Reproduced by developer:  0
-------------------------------------+-------------------------------------

Comment (by otters):

 Okay, with ffmpeg HEAD (just compiled it), I use the concat demuxer and
 the resultant file is of correct length, but it has no metadata or
 chapters at all.

 inputs.txt
 {{{
 file '04 Harry Potter and the Goblet of Fire, Part 1.m4b'
 file '05 Harry Potter and the Goblet of Fire, Part 2.m4b'
 }}}

 Also, ffmpeg crashes upon exit (though the file is fine). GDB session:

 {{{
 gdb ffmpeg_g
 GNU gdb 6.3.50-20050815 (Apple version gdb-1824) (Wed Feb  6 22:51:23 UTC
 2013)
 Copyright 2004 Free Software Foundation, Inc.
 GDB is free software, covered by the GNU General Public License, and you
 are
 welcome to change it and/or distribute copies of it under certain
 conditions.
 Type "show copying" to see the conditions.
 There is absolutely no warranty for GDB.  Type "show warranty" for
 details.
 This GDB was configured as "x86_64-apple-darwin"...Reading symbols for
 shared libraries ..... done

 warning: .o file
 "/Users/otters/src/ffmpeg/libavcodec/libavcodec.a(cavsdsp.o)" more recent
 than executable timestamp in "/usr/local/bin/ffmpeg_g"

 warning: Could not open OSO file
 /Users/otters/src/ffmpeg/libavcodec/libavcodec.a(cavsdsp.o) to scan for
 pubtypes for objfile /usr/local/bin/ffmpeg_g

 warning: .o file
 "/Users/otters/src/ffmpeg/libavcodec/libavcodec.a(dirac_dwt.o)" more
 recent than executable timestamp in "/usr/local/bin/ffmpeg_g"

 warning: Could not open OSO file
 /Users/otters/src/ffmpeg/libavcodec/libavcodec.a(dirac_dwt.o) to scan for
 pubtypes for objfile /usr/local/bin/ffmpeg_g

 warning: .o file
 "/Users/otters/src/ffmpeg/libavcodec/libavcodec.a(dnxhdenc.o)" more recent
 than executable timestamp in "/usr/local/bin/ffmpeg_g"

 warning: Could not open OSO file
 /Users/otters/src/ffmpeg/libavcodec/libavcodec.a(dnxhdenc.o) to scan for
 pubtypes for objfile /usr/local/bin/ffmpeg_g

 warning: .o file "/Users/otters/src/ffmpeg/libavcodec/libavcodec.a(lpc.o)"
 more recent than executable timestamp in "/usr/local/bin/ffmpeg_g"

 warning: Could not open OSO file
 /Users/otters/src/ffmpeg/libavcodec/libavcodec.a(lpc.o) to scan for
 pubtypes for objfile /usr/local/bin/ffmpeg_g

 warning: .o file
 "/Users/otters/src/ffmpeg/libavcodec/libavcodec.a(mlpdsp.o)" more recent
 than executable timestamp in "/usr/local/bin/ffmpeg_g"

 warning: Could not open OSO file
 /Users/otters/src/ffmpeg/libavcodec/libavcodec.a(mlpdsp.o) to scan for
 pubtypes for objfile /usr/local/bin/ffmpeg_g

 warning: .o file
 "/Users/otters/src/ffmpeg/libavcodec/libavcodec.a(motion_est.o)" more
 recent than executable timestamp in "/usr/local/bin/ffmpeg_g"

 warning: Could not open OSO file
 /Users/otters/src/ffmpeg/libavcodec/libavcodec.a(motion_est.o) to scan for
 pubtypes for objfile /usr/local/bin/ffmpeg_g

 warning: .o file
 "/Users/otters/src/ffmpeg/libavcodec/libavcodec.a(mpegaudiodec.o)" more
 recent than executable timestamp in "/usr/local/bin/ffmpeg_g"

 warning: Could not open OSO file
 /Users/otters/src/ffmpeg/libavcodec/libavcodec.a(mpegaudiodec.o) to scan
 for pubtypes for objfile /usr/local/bin/ffmpeg_g

 warning: .o file
 "/Users/otters/src/ffmpeg/libavcodec/libavcodec.a(mpegvideo.o)" more
 recent than executable timestamp in "/usr/local/bin/ffmpeg_g"

 warning: Could not open OSO file
 /Users/otters/src/ffmpeg/libavcodec/libavcodec.a(mpegvideo.o) to scan for
 pubtypes for objfile /usr/local/bin/ffmpeg_g

 warning: .o file
 "/Users/otters/src/ffmpeg/libavcodec/libavcodec.a(simple_idct.o)" more
 recent than executable timestamp in "/usr/local/bin/ffmpeg_g"

 warning: Could not open OSO file
 /Users/otters/src/ffmpeg/libavcodec/libavcodec.a(simple_idct.o) to scan
 for pubtypes for objfile /usr/local/bin/ffmpeg_g

 warning: .o file
 "/Users/otters/src/ffmpeg/libswscale/libswscale.a(rgb2rgb.o)" more recent
 than executable timestamp in "/usr/local/bin/ffmpeg_g"

 warning: Could not open OSO file
 /Users/otters/src/ffmpeg/libswscale/libswscale.a(rgb2rgb.o) to scan for
 pubtypes for objfile /usr/local/bin/ffmpeg_g

 warning: .o file
 "/Users/otters/src/ffmpeg/libswscale/libswscale.a(swscale.o)" more recent
 than executable timestamp in "/usr/local/bin/ffmpeg_g"

 warning: Could not open OSO file
 /Users/otters/src/ffmpeg/libswscale/libswscale.a(swscale.o) to scan for
 pubtypes for objfile /usr/local/bin/ffmpeg_g

 warning: .o file "/Users/otters/src/ffmpeg/libavutil/libavutil.a(cpu.o)"
 more recent than executable timestamp in "/usr/local/bin/ffmpeg_g"

 warning: Could not open OSO file
 /Users/otters/src/ffmpeg/libavutil/libavutil.a(cpu.o) to scan for pubtypes
 for objfile /usr/local/bin/ffmpeg_g

 (gdb) r -f concat -i inputs.txt -c copy output.mp4
 Starting program: /usr/local/bin/ffmpeg_g -f concat -i inputs.txt -c copy
 output.mp4
 Reading symbols for shared libraries ++++.............................
 done
 ffmpeg version N-52587-g53efb2f Copyright (c) 2000-2013 the FFmpeg
 developers
   built on Apr 30 2013 15:32:22 with llvm-gcc 4.2.1 (LLVM build
 2336.11.00)
   configuration: --prefix=/usr/local --enable-debug
   libavutil      52. 27.101 / 52. 27.101
   libavcodec     55.  6.100 / 55.  6.100
   libavformat    55.  3.100 / 55.  3.100
   libavdevice    55.  0.100 / 55.  0.100
   libavfilter     3. 61.101 /  3. 61.101
   libswscale      2.  2.100 /  2.  2.100
   libswresample   0. 17.102 /  0. 17.102
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x102035c00] stream 0, timescale not set
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x102035c00] max_analyze_duration 5000000
 reached at 5015510 microseconds
 [concat @ 0x10202d600] max_analyze_duration 5000000 reached at 5015510
 microseconds
 [concat @ 0x10202d600] Estimating duration from bitrate, this may be
 inaccurate
 Input #0, concat, from 'inputs.txt':
   Duration: 00:00:00.00, start: 0.000000, bitrate: 278 kb/s
     Stream #0:0: Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp,
 298 kb/s
     Stream #0:1: Video: png (png  / 0x20676E70), rgba, 425x512 [SAR
 2835:2835 DAR 425:512], 0 kb/s, 0k fps, 0k tbr, 600 tbn, 600 tbc
     Stream #0:2: Subtitle: mov_text (text / 0x74786574)
     Stream #0:3: Video: png, rgba, 850x1024 [SAR 5669:5669 DAR 425:512],
 90k tbr, 90k tbn, 90k tbc
 Output #0, mp4, to 'output.mp4':
   Metadata:
     encoder         : Lavf55.3.100
     Stream #0:0: Video: png (m[0][0][0] / 0x006D), rgba, 850x1024 [SAR
 5669:5669 DAR 425:512], q=2-31, 90k tbn, 90k tbc
     Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo,
 298 kb/s
 Stream mapping:
   Stream #0:3 -> #0:0 (copy)
   Stream #0:0 -> #0:1 (copy)
 Press [q] to stop, [?] for help
 stream 0, timescale not setsize=    1682kB time=12:18:49.07 bitrate=
 0.3kbits/s
 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x102035c00] max_analyze_duration 5000000
 reached at 5015510 microseconds
 [mp4 @ 0x102054a00] st:0 PTS: 2011615032 DTS: 2011615032 < 2011615233
 invalid, clipping
 frame=    2 fps=0.0 q=-1.0 Lsize= 2747329kB time=20:36:10.21 bitrate=
 303.4kbits/s
 video:3364kB audio:2731445kB subtitle:0 global headers:0kB muxing overhead
 0.457797%
 ffmpeg_g(67492) malloc: *** error for object 0x101809600: pointer being
 freed was not allocated
 *** set a breakpoint in malloc_error_break to debug

 Program received signal SIGABRT, Aborted.
 0x00000001013a8d46 in __kill ()
 (gdb) bt
 #0  0x00000001013a8d46 in __kill ()
 #1  0x0000000101285df0 in abort ()
 #2  0x00000001012599b9 in free ()
 #3  0x000000010060fb9c in av_freep (arg=0x1020541c8) at mem.c:194
 #4  0x0000000101288f57 in exit ()
 #5  0x0000000100013c82 in main (argc=33740288, argv=0x16171) at
 ffmpeg.c:3372
 (gdb) disass $pc-32,$pc+32
 Dump of assembler code for function listen:
 0x00000001013a8d64 <listen+0>:  mov    $0x200006a,%eax
 0x00000001013a8d69 <listen+5>:  mov    %rcx,%r10
 0x00000001013a8d6c <listen+8>:  syscall
 0x00000001013a8d6e <listen+10>: jae    0x1013a8d75 <listen+17>
 0x00000001013a8d70 <listen+12>: jmpq   0x1013aa4d4 <cerror_nocancel>
 0x00000001013a8d75 <listen+17>: retq
 0x00000001013a8d76 <listen+18>: nop
 0x00000001013a8d77 <listen+19>: nop
 End of assembler dump.
 (gdb) info all-registers
 rax            0x0      0
 rbx            0x7fff5fbff5b0   140734799803824
 rcx            0x7fff5fbff598   140734799803800
 rdx            0x0      0
 rsi            0x6      6
 rdi            0x107a4  67492
 rbp            0x7fff5fbff5c0   0x7fff5fbff5c0
 rsp            0x7fff5fbff598   0x7fff5fbff598
 r8             0x0      0
 r9             0x0      0
 r10            0x1013aa342      4315587394
 r11            0x202    514
 r12            0x101790000      4319674368
 r13            0x1017c0000      4319870976
 r14            0x101809600      4320171520
 r15            0x1      1
 rip            0x1013a8d46      0x1013a8d46 <__kill+10>
 eflags         0x202    514
 cs             0x7      7
 ss             0x0      0
 ds             0x0      0
 es             0x0      0
 fs             0x0      0
 gs             0x0      0
 st0            -nan(0xff0023002d00bb)   (raw 0xffff00ff0023002d00bb)
 st1            -nan(0xff0023002d00bb)   (raw 0xffff00ff0023002d00bb)
 st2            <invalid float value>    (raw 0xffff0000000000000000)
 st3            -nan(0xff232dbbff232dbb) (raw 0xffffff232dbbff232dbb)
 st4            <invalid float value>    (raw 0xffff0000000000000000)
 st5            <invalid float value>    (raw 0xffff0000000000000000)
 st6            <invalid float value>    (raw 0xffff0000000000000000)
 st7            <invalid float value>    (raw 0xffff0000000000000000)
 fctrl          0x37f    895
 fstat          0x220    544
 ftag           0xffff   65535
 fiseg          0x2b     43
 fioff          0x13cd8b0        20764848
 foseg          0x23     35
 fooff          0x5fbff508       1606415624
 fop            0x0      0
 xmm0           {
   v4_float = {-1.70141183e+38, 0, 0, 0},
   v2_double = {-5.4861240687936887e+303, 0},
   v16_int8 = {-1, 0 <repeats 15 times>},
   v8_int16 = {-256, 0, 0, 0, 0, 0, 0, 0},
   v4_int32 = {-16777216, 0, 0, 0},
   v2_int64 = {-72057594037927936, 0},
   uint128 = 0xff000000000000000000000000000000
 }       (raw 0x000000000000000000000000000000ff)
 xmm1           {
   v4_float = {6.4105482e-10, 6.70087097e-10, 3.61161057e-09,
 7.20647161e+31},
   v2_double = {1.400079248234015e-76, 2.1903872225921411e-70},
   v16_int8 = {48, 48, 54, 57, 48, 56, 49, 48, 49, 120, 48, 32, 116, 99,
 101, 106},
   v8_int16 = {12336, 13881, 12344, 12592, 12664, 12320, 29795, 25962},
   v4_int32 = {808465977, 808988976, 829960224, 1952671082},
   v2_int64 = {3472334931952677168, 3564652021013505386},
   uint128 = 0x3030363930383130317830207463656a
 }       (raw 0x6a656374203078313031383039363030)
 xmm2           {
   v4_float = {1.96029927e-19, 6.67408335e+22, 7.21433831e+22,
 7.43153619e+28},
   v2_double = {1.398068697773651e-152, 5.2987488844886402e+180},
   v16_int8 = {32, 103, 110, 105, 101, 98, 32, 114, 101, 116, 110, 105,
 111, 112, 32, 58},
   v8_int16 = {8295, 28265, 25954, 8306, 25972, 28265, 28528, 8250},
   v4_int32 = {543649385, 1700929650, 1702129257, 1869619258},
   v2_int64 = {2334956330766442610, 7310589494249398330},
   uint128 = 0x20676e696562207265746e696f70203a
 }       (raw 0x3a20706f696e746572206265696e6720)
 xmm3           {
   v4_float = {1.08864626e+27, 7.3696661e+28, 2.84917486e+20,
 6.77207627e+22},
   v2_double = {1.153141411761155e+214, 3.2513835464533637e+161},
   v16_int8 = {108, 97, 32, 116, 111, 110, 32, 115, 97, 119, 32, 100, 101,
 101, 114, 102},
   v8_int16 = {27745, 8308, 28526, 8307, 24951, 8292, 25957, 29286},
   v4_int32 = {1818304628, 1869488243, 1635197028, 1701147238},
   v2_int64 = {7809558913294934131, 7023117759477543526},
   uint128 = 0x6c6120746f6e20736177206465657266
 }       (raw 0x667265656420776173206e6f7420616c)
 xmm4           {
   v4_float = {2.38793926e-38, 6.30194116e-36, 2.4375, 0},
   v2_double = {8.2078803991318393e-304, 7},
   v16_int8 = {1, 2, 3, 4, 5, 6, 7, 8, 64, 28, 0, 0, 0, 0, 0, 0},
   v8_int16 = {258, 772, 1286, 1800, 16412, 0, 0, 0},
   v4_int32 = {16909060, 84281096, 1075576832, 0},
   v2_int64 = {72623859790382856, 4619567317775286272},
   uint128 = 0x0102030405060708401c000000000000
 }       (raw 0x0000000000001c400807060504030201)
 xmm5           {
   v4_float = {0, 0, 1.72889864, 3.16473191e+35},
   v2_double = {0, 0.45779740293729293},
   v16_int8 = {0, 0, 0, 0, 0, 0, 0, 0, 63, -35, 76, -115, 122, 115, -51,
 85},
   v8_int16 = {0, 0, 0, 0, 16349, 19597, 31347, -12971},
   v4_int32 = {0, 0, 1071467661, 2054409557},
   v2_int64 = {0, 4601918564771024213},
   uint128 = 6182724833643388223
 }       (raw 0x55cd737a8d4cdd3f0000000000000000)
 xmm6           {
   v4_float = {1.15232481e-28, 3.03104765e-26, 7.96708809e-24,
 2.09272171e-21},
   v2_double = {1.9074368412237584e-226, 9.3747856527310008e-188},
   v16_int8 = {17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
 32},
   v8_int16 = {4370, 4884, 5398, 5912, 6426, 6940, 7454, 7968},
   v4_int32 = {286397204, 353769240, 421141276, 488513312},
   v2_int64 = {1230066625199609624, 1808788007904223008},
   uint128 = 0x1112131415161718191a1b1c1d1e1f20
 }       (raw 0x201f1e1d1c1b1a191817161514131211)
 xmm7           {
   v4_float = {0, 0, 0, 0},
   v2_double = {0, 0},
   v16_int8 = {0 <repeats 16 times>},
   v8_int16 = {0, 0, 0, 0, 0, 0, 0, 0},
   v4_int32 = {0, 0, 0, 0},
   v2_int64 = {0, 0},
   uint128 = 0
 }       (raw 0x00000000000000000000000000000000)
 xmm8           {
   v4_float = {2.59315147e-09, 6.78806373e-07, 0.000177604088,
 0.0464470387},
   v2_double = {1.0300843656201408e-71, 5.0519815492833995e-33},
   v16_int8 = {49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
 64},
   v8_int16 = {12594, 13108, 13622, 14136, 14650, 15164, 15678, 16192},
   v4_int32 = {825373492, 892745528, 960117564, 1027489600},
   v2_int64 = {3544952156018063160, 4123673538722676544},
   uint128 = 0x3132333435363738393a3b3c3d3e3f40
 }       (raw 0x403f3e3d3c3b3a393837363534333231)
 xmm9           {
   v4_float = {5.49342432e-19, 1.44114715e-16, 3.77850285e-14,
 9.90123261e-12},
   v2_double = {4.4326565212010269e-149, 2.1762701218027049e-110},
   v16_int8 = {33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
 48},
   v8_int16 = {8482, 8996, 9510, 10024, 10538, 11052, 11566, 12080},
   v4_int32 = {555885348, 623257384, 690629420, 758001456},
   v2_int64 = {2387509390608836392, 2966230773313449776},
   uint128 = 0x2122232425262728292a2b2c2d2e2f30
 }       (raw 0x302f2e2d2c2b2a292827262524232221)
 xmm10          {
   v4_float = {0, 0, 0, 0},
   v2_double = {0, 0},
   v16_int8 = {0 <repeats 16 times>},
   v8_int16 = {0, 0, 0, 0, 0, 0, 0, 0},
   v4_int32 = {0, 0, 0, 0},
   v2_int64 = {0, 0},
   uint128 = 0
 }       (raw 0x00000000000000000000000000000000)
 xmm11          {
   v4_float = {0, 0, 0, 0},
   v2_double = {0, 0},
   v16_int8 = {0 <repeats 16 times>},
   v8_int16 = {0, 0, 0, 0, 0, 0, 0, 0},
   v4_int32 = {0, 0, 0, 0},
   v2_int64 = {0, 0},
   uint128 = 0
 }       (raw 0x00000000000000000000000000000000)
 xmm12          {
   v4_float = {0, 0, 0, 0},
   v2_double = {0, 0},
   v16_int8 = {0 <repeats 16 times>},
   v8_int16 = {0, 0, 0, 0, 0, 0, 0, 0},
   v4_int32 = {0, 0, 0, 0},
   v2_int64 = {0, 0},
   uint128 = 0
 }       (raw 0x00000000000000000000000000000000)
 xmm13          {
   v4_float = {0, 0, 0, 0},
   v2_double = {0, 0},
   v16_int8 = {0 <repeats 16 times>},
   v8_int16 = {0, 0, 0, 0, 0, 0, 0, 0},
   v4_int32 = {0, 0, 0, 0},
   v2_int64 = {0, 0},
   uint128 = 0
 }       (raw 0x00000000000000000000000000000000)
 xmm14          {
   v4_float = {0, 0, 0, 0},
   v2_double = {0, 0},
   v16_int8 = {0 <repeats 16 times>},
   v8_int16 = {0, 0, 0, 0, 0, 0, 0, 0},
   v4_int32 = {0, 0, 0, 0},
   v2_int64 = {0, 0},
   uint128 = 0
 }       (raw 0x00000000000000000000000000000000)
 xmm15          {
   v4_float = {0, 0, 0, 0},
   v2_double = {0, 0},
   v16_int8 = {0 <repeats 16 times>},
   v8_int16 = {0, 0, 0, 0, 0, 0, 0, 0},
   v4_int32 = {0, 0, 0, 0},
   v2_int64 = {0, 0},
   uint128 = 0
 }       (raw 0x00000000000000000000000000000000)
 mxcsr          0x1fa0   8096
 }}}

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2522#comment:5>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list