mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
lavf/segment: add an option to allow breaking on non-keyframes
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
e100966575
commit
e60b018c74
@ -111,6 +111,7 @@ typedef struct SegmentContext {
|
||||
int64_t initial_offset; ///< initial timestamps offset, expressed in microseconds
|
||||
char *reference_stream_specifier; ///< reference stream specifier
|
||||
int reference_stream_index;
|
||||
int break_non_keyframes;
|
||||
|
||||
SegmentListEntry cur_entry;
|
||||
SegmentListEntry *segment_list_entries;
|
||||
@ -780,7 +781,7 @@ static int seg_write_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
pkt->stream_index == seg->reference_stream_index ? seg->frame_count : -1);
|
||||
|
||||
if (pkt->stream_index == seg->reference_stream_index &&
|
||||
pkt->flags & AV_PKT_FLAG_KEY &&
|
||||
(pkt->flags & AV_PKT_FLAG_KEY || seg->break_non_keyframes) &&
|
||||
seg->segment_frame_count > 0 &&
|
||||
(seg->cut_pending || seg->frame_count >= start_frame ||
|
||||
(pkt->pts != AV_NOPTS_VALUE &&
|
||||
@ -920,6 +921,7 @@ static const AVOption options[] = {
|
||||
{ "segment_start_number", "set the sequence number of the first segment", OFFSET(segment_idx), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, E },
|
||||
{ "segment_wrap_number", "set the number of wrap before the first segment", OFFSET(segment_idx_wrap_nb), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, E },
|
||||
{ "strftime", "set filename expansion with strftime at segment creation", OFFSET(use_strftime), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 1, E },
|
||||
{ "break_non_keyframes", "allow breaking segments on non-keyframes", OFFSET(break_non_keyframes), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, E },
|
||||
|
||||
{ "individual_header_trailer", "write header/trailer to each segment", OFFSET(individual_header_trailer), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, E },
|
||||
{ "write_header_trailer", "write a header to the first segment and a trailer to the last one", OFFSET(write_header_trailer), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, E },
|
||||
|
Loading…
Reference in New Issue
Block a user