Opened 8 years ago

Last modified 6 years ago

#6468 open enhancement

ffmpeg doesn't maintain chapters when concatenating two MP4 files using the concat demuxer

Reported by: whereswardy Owned by:
Priority: wish Component: avformat
Version: git-master Keywords: concat
Cc: c18h25no@gmail.com Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

I'm trying to concatenate two MP4 files using the concat demuxer and want to retain the chapter markers that exist in both files so that the output file contains all the chapters from both of my input files. The source files contain chapter markers according to mediainfo which I want to be maintained in the output, but when using the -map_chapters option in ffmpeg they don't appear in the output file.

I'm concatenating the following two files from streams.txt:

file 'episode2.mp4'
file 'episode3.mp4'

which contain the following chapter/menu data (output cut down for brevity):

$ mediainfo episode2.mp4
...
Menu
ID                                       : 3
Codec ID                                 : text
Duration                                 : 22mn 25s
Language                                 : English
Encoded date                             : UTC 2017-06-18 15:27:40
Tagged date                              : UTC 2017-06-18 15:27:40
Bit rate mode                            : CBR
00:00:00.000                             : Chapter 1
00:00:59.720                             : Chapter 2
...

and I'm using the following ffmpeg command:

ffmpeg -f concat -safe 0 -i streams.txt -map_metadata 0 -map_chapters 0 -c copy output.mp4

however the output.mp4 file contains no chapter markers according to mediainfo and there's nothing viewable in any media player. I'm using ffmpeg 3.3.2 on Ubuntu 14.04.5:

$ ffmpeg -version
ffmpeg version 3.3.1 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --mandir=/usr/share/man --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libfreetype --enable-gnutls --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvidstab --enable-libwavpack --enable-nvenc
libavutil      55. 58.100 / 55. 58.100
libavcodec     57. 89.100 / 57. 89.100
libavformat    57. 71.100 / 57. 71.100
libavdevice    57.  6.100 / 57.  6.100
libavfilter     6. 82.100 /  6. 82.100
libavresample   3.  5.  0 /  3.  5.  0
libswscale      4.  6.100 /  4.  6.100
libswresample   2.  7.100 /  2.  7.100
libpostproc    54.  5.100 / 54.  5.100
$ uname -a
Linux server 3.13.0-119-generic #166-Ubuntu SMP Wed May 3 12:18:55 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Change History (3)

comment:1 by Cigaes, 8 years ago

Component: undeterminedavformat
Priority: normalwish
Status: newopen
Type: defectenhancement
Version: unspecifiedgit-master

Yes, the concat demuxer does not support chapters (yet).

comment:2 by Carl Eugen Hoyos, 8 years ago

Keywords: concat added

comment:3 by dextro, 6 years ago

Cc: c18h25no@gmail.com added
Note: See TracTickets for help on using tickets.