Message ID | 20200103070522.2260-1-ffmpeg@gyani.pro |
---|---|
State | Accepted |
Headers | show |
Series | [FFmpeg-devel] ffmpeg: don't force source-tracked keyframes for duplicates | expand |
Context | Check | Description |
---|---|---|
andriy/ffmpeg-patchwork | success | Make fate finished |
On Fri, Jan 03, 2020 at 12:35:22PM +0530, Gyan Doshi wrote: > Prevents a run of consecutive duplicate frames from all being encoded > as keyframes, when force_key_frames is set to source. > --- > fftools/ffmpeg.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) maybe ok (i wonder if this would be expected behavior with intra only input) thx [...]
On 03-01-2020 03:30 pm, Michael Niedermayer wrote: > On Fri, Jan 03, 2020 at 12:35:22PM +0530, Gyan Doshi wrote: >> Prevents a run of consecutive duplicate frames from all being encoded >> as keyframes, when force_key_frames is set to source. >> --- >> fftools/ffmpeg.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) > maybe ok (i wonder if this would be expected behavior with intra only input) If user wants intra-only output, they can use an intra-coded encoder or -g 1. If they want to preserve same seek points as source, then the non-duplicated frame has the closest pts sync to the source timestamp. Gyan
On 03-01-2020 04:05 pm, Gyan wrote: > > > On 03-01-2020 03:30 pm, Michael Niedermayer wrote: >> On Fri, Jan 03, 2020 at 12:35:22PM +0530, Gyan Doshi wrote: >>> Prevents a run of consecutive duplicate frames from all being encoded >>> as keyframes, when force_key_frames is set to source. >>> --- >>> fftools/ffmpeg.c | 3 ++- >>> 1 file changed, 2 insertions(+), 1 deletion(-) >> maybe ok (i wonder if this would be expected behavior with intra only >> input) > > If user wants intra-only output, they can use an intra-coded encoder > or -g 1. > > If they want to preserve same seek points as source, then the > non-duplicated frame has the closest pts sync to the source timestamp. Will push tonight. Gyan
On 04-01-2020 10:02 am, Gyan wrote: > > > On 03-01-2020 04:05 pm, Gyan wrote: >> >> >> On 03-01-2020 03:30 pm, Michael Niedermayer wrote: >>> On Fri, Jan 03, 2020 at 12:35:22PM +0530, Gyan Doshi wrote: >>>> Prevents a run of consecutive duplicate frames from all being encoded >>>> as keyframes, when force_key_frames is set to source. >>>> --- >>>> fftools/ffmpeg.c | 3 ++- >>>> 1 file changed, 2 insertions(+), 1 deletion(-) >>> maybe ok (i wonder if this would be expected behavior with intra >>> only input) >> >> If user wants intra-only output, they can use an intra-coded encoder >> or -g 1. >> >> If they want to preserve same seek points as source, then the >> non-duplicated frame has the closest pts sync to the source timestamp. > > Will push tonight. Pushed as 5d82c078ea93d7eee12ff863a4f9eb5fb2d30d16 Gyan
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 9af2bc2fb5..d821b40877 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -1266,7 +1266,8 @@ static void do_video_out(OutputFile *of, ost->forced_keyframes_expr_const_values[FKF_N] += 1; } else if ( ost->forced_keyframes && !strncmp(ost->forced_keyframes, "source", 6) - && in_picture->key_frame==1) { + && in_picture->key_frame==1 + && !i) { forced_keyframe = 1; }