[Libav-user] How to enable chapter info

Ryan Owen ryaowe at gmail.com
Thu Oct 25 19:59:31 CEST 2012


I recently updated my libav* libraries to the latest from git (revisoin d8245c3bcdd162891825a52cf55e4e8173d85a18) in order to take advantage of new features/bug fixes.  Since updating, I'm no longer able to get chapter information from m4v or mov files.  Everything else continues to work as expected, but my AVFormatContext's nb_chapters is always 0.  Is there something I need to do to enable parsing of chapter information?

The same behavior can be observed from the ffmpeg command:

With current revision (d8245c3bcdd162891825a52cf55e4e8173d85a18):

./ffmpeg -i chapters.m4v 
ffmpeg version N-46017-gd8245c3 Copyright (c) 2000-2012 the FFmpeg developers
  built on Oct 25 2012 11:30:53 with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
  configuration: --enable-shared --disable-static --enable-memalign-hack --disable-outdevs --disable-ffplay --enable-pic --enable-debug=3 --disable-optimizations --disable-mmx --disable-stripping --enable-debug
  libavutil      52.  0.100 / 52.  0.100
  libavcodec     54. 69.100 / 54. 69.100
  libavformat    54. 34.100 / 54. 34.100
  libavdevice    54.  3.100 / 54.  3.100
  libavfilter     3. 20.105 /  3. 20.105
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 16.100 /  0. 16.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'chapters.m4v':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42isomavc1
    creation_time   : 2012-10-24 22:41:46
    encoder         : HandBrake 0.9.6 2012022800
  Duration: 00:20:22.29, start: 0.000000, bitrate: 1982 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 960x544, 1817 kb/s, 23.98 fps, 23.98 tbr, 90k tbn, 180k tbc
    Metadata:
      creation_time   : 2012-10-24 22:41:46
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, s16, 159 kb/s
    Metadata:
      creation_time   : 2012-10-24 22:41:46
    Stream #0:2(und): Subtitle: mov_text (text / 0x74786574)
    Metadata:
      creation_time   : 2012-10-24 22:41:46

Note no chapters are listed.

With my old revision (7028c9f42168e704db74e0fc37b0ba029ab127b4):

./ffmpeg -i chapters.m4v 
ffmpeg version N-36033-g7028c9f, Copyright (c) 2000-2011 the FFmpeg developers
  built on Jul  2 2012 17:47:29 with llvm_gcc 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00)
  configuration: --enable-shared --disable-static --enable-memalign-hack --disable-outdevs --disable-ffplay --enable-pic
  libavutil    51. 32. 0 / 51. 32. 0
  libavcodec   53. 46. 1 / 53. 46. 1
  libavformat  53. 27. 0 / 53. 27. 0
  libavdevice  53.  4. 0 / 53.  4. 0
  libavfilter   2. 53. 0 /  2. 53. 0
  libswscale    2.  1. 0 /  2.  1. 0

Seems stream 0 codec frame rate differs from container frame rate: 180000.00 (180000/1) -> 23.98 (24000/1001)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'chapters.m4v':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42isomavc1
    creation_time   : 2012-10-24 22:41:46
    encoder         : HandBrake 0.9.6 2012022800
  Duration: 00:20:22.29, start: 0.000000, bitrate: 1982 kb/s
    Chapter #0.0: start -0.083000, end 380.547000
    Metadata:
      title           : Chapter 1
    Chapter #0.1: start 380.547000, end 735.360000
    Metadata:
      title           : Chapter 2
    Chapter #0.2: start 735.360000, end 986.068000
    Metadata:
      title           : Chapter 3
    Chapter #0.3: start 986.068000, end 1182.807000
    Metadata:
      title           : Chapter 4
    Chapter #0.4: start 1182.807000, end 1222.262700
    Metadata:
      title           : Chapter 5
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 960x544, 1817 kb/s, 23.98 fps, 23.98 tbr, 90k tbn, 180k tbc
    Metadata:
      creation_time   : 2012-10-24 22:41:46
      handler_name    : 
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, s16, 159 kb/s
    Metadata:
      creation_time   : 2012-10-24 22:41:46
      handler_name    : 
    Stream #0:2(und): Subtitle: mov_text (text / 0x74786574)
    Metadata:
      creation_time   : 2012-10-24 22:41:46
      handler_name    : 


I tried searching the mailing lists, bug tracker, and revision history, but I couldn't find anything that seemed to address my question.  My apologies if I'm missing something obvious.

Thanks in advance for your help!

--
Ryan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2925 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20121025/06b2867b/attachment.p7s>


More information about the Libav-user mailing list