Opened 4 years ago

Closed 4 years ago

#1483 closed enhancement (fixed)

Allow a list of keyframe numbers that are valid for starting a new segment

Reported by: gordon Owned by:
Priority: normal Component: avformat
Version: unspecified Keywords: segment
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: yes

Description

It would be beneficial to have an option with the segmenter to white list keyframes that can be used to start new segments. The duration of the segment would not cause a new segment to be created until a keyframe in the white list is reached.

This will allow videos that have a subset of common keyframes to be segmented and maintain common starting points. Otherwise, a constant gop is required which is not optimal.

My feature request will allow the encoder to optimize keyframe placement for different quality levels of the encode in variant streams without risking playback getting out of sync between the variant streams which makes swapping between streams impossible.

Adding a command line option to input a comma separated list of frame numbers would be an easy way to implement this. Then the list can be checked against the current frame number when outputting packets into segments.

Attachments (2)

0001-support-a-keyframe-white-list-in-the-segment-format..patch (5.8 KB) - added by gordon 4 years ago.
patch
0001-lavf-segment-add-segment_frames-option.patch (9.0 KB) - added by saste 4 years ago.

Download all attachments as: .zip

Change History (8)

comment:3 Changed 4 years ago by cehoyos

Please consider sending patches to ffmpeg-devel, they usually receive more attention there.

comment:4 follow-up: Changed 4 years ago by saste

See patch in attachment. Test and comments are welcome.

Also I'm not sure the patch is still useful, considering that there is already the segment_times option.

comment:5 in reply to: ↑ 4 ; follow-up: Changed 4 years ago by gordon

Replying to saste:

See patch in attachment. Test and comments are welcome.

Also I'm not sure the patch is still useful, considering that there is already the segment_times option.

I think that are cases where it is still useful. I will use it. Thanks!

Version 0, edited 4 years ago by gordon (next)

comment:6 in reply to: ↑ 5 Changed 4 years ago by saste

  • Analyzed by developer set
  • Reproduced by developer set
  • Resolution set to fixed
  • Status changed from new to closed

Replying to gordon:

Replying to saste:

See patch in attachment. Test and comments are welcome.

Also I'm not sure the patch is still useful, considering that there is already the segment_times option.

I think there are cases where it is still useful. I will use it. Thanks!

Should be fixed in:

commit 0156dd6530b998923405e0b21f31bc1fbe68e009
Author: Stefano Sabatini <stefasab@gmail.com>
Date:   Sun Dec 9 20:26:30 2012 +0100

    lavf/segment: add segment_frames option
    
    This is meant to address trac ticket #1483.
Note: See TracTickets for help on using tickets.