Opened 13 years ago

Closed 12 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 13 years ago.
patch
0001-lavf-segment-add-segment_frames-option.patch (9.0 KB ) - added by Stefano Sabatini 12 years ago.

Download all attachments as: .zip

Change History (8)

comment:3 by Carl Eugen Hoyos, 13 years ago

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

comment:4 by Stefano Sabatini, 12 years ago

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.

in reply to:  4 ; comment:5 by gordon, 12 years ago

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!

Last edited 12 years ago by gordon (previous) (diff)

in reply to:  5 comment:6 by Stefano Sabatini, 12 years ago

Analyzed by developer: set
Reproduced by developer: set
Resolution: fixed
Status: newclosed

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.