Opened 9 years ago

Last modified 9 years ago

#2327 open enhancement

accept "chapters" as segment_times

Reported by: dave rice Owned by:
Priority: wish Component: undetermined
Version: git-master Keywords: segment chapters
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: yes

Description

Summary of the bug:

FFmpeg adds recent support for "chapters" within -force-key-frames.

At: http://ffmpeg.org/ffmpeg.html

If one of the times is "chapters[delta]", it is expanded into the time of the beginning of all chapters in the file, shifted by delta, expressed as a time in seconds. This option can be useful to ensure that a seek point is present at a chapter mark or any other designated place in the output file. 

Could "chapters" be similarly supported in -segment_times, so that this would be feasible (segment input based on embedded chapters):

ffmpeg -i file_with_chapters.mov -map 0 -c:v libx264 -c:a libfaac -force_key_frames chapters-0.1 -f segment -segment_list tout.csv -segment_times chapters-0.1 chaptered_%03d.mp4

Currently to do the same the user must parse out the chapter start values and do this:

ffmpeg -i /Users/davidrice/SoundieF.mpeg -map 0 -c:v libx264 -c:a libfaac -force_key_frames chapters-0.1 -f segment -segment_list tout.csv -segment_times 10,20,30 chaptered_%03d.mp4

Change History (3)

comment:1 by Carl Eugen Hoyos, 9 years ago

Keywords: segment,chapters → segment chapters

comment:2 by Stefano Sabatini, 9 years ago

Analyzed by developer: set
Reproduced by developer: set
Status: newopen

The problem is that the segment muxer knows nothing about the input file chapters, and I don't know how/if that information can be propagated.

comment:3 by Nicolas George, 9 years ago

That was my first reaction too, but then I realized that the muxer has access to the chapters of the output file, it is even precisely its task to do something with them.

The ffmpeg command-line tool constructs the chapters for the outputs using, by default, the chapters from the inputs, adjusting times and dropping unused chapters if necessary, so propagation from input to output is already implemented.

I believe this feature would, in fact, be quite simple.

Note: See TracTickets for help on using tickets.