mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Fix keyframes i-frame type on hardware transcode
This commit is contained in:
parent
71fe10efaf
commit
9531795066
@ -207,6 +207,12 @@ func (ts *Stream) run(start int32) error {
|
||||
"-start_at_zero",
|
||||
// for hls streams, -copyts is mandatory
|
||||
"-copyts",
|
||||
// this makes output file start at 0s instead of a random delay + the -ss value
|
||||
// this also cancel -start_at_zero weird delay.
|
||||
// this is not always respected but generally it gives better results.
|
||||
// even when this is not respected, it does not result in a bugged experience but this is something
|
||||
// to keep in mind when debugging
|
||||
"-muxdelay", "0",
|
||||
)
|
||||
args = append(args, ts.handle.getTranscodeArgs(toSegmentStr(segments))...)
|
||||
args = append(args,
|
||||
|
@ -63,7 +63,11 @@ func (vs *VideoStream) getTranscodeArgs(segments string) []string {
|
||||
"-b:v", fmt.Sprint(vs.quality.AverageBitrate()),
|
||||
"-maxrate", fmt.Sprint(vs.quality.MaxBitrate()),
|
||||
// Force segments to be split exactly on keyframes (only works when transcoding)
|
||||
// forced-idr is needed to force keyframes to be an idr-frame (by default it can be any i frames)
|
||||
// without this option, some hardware encoders uses others i-frames and the -f segment can't cut at them.
|
||||
"-forced-idr", "1",
|
||||
"-force_key_frames", segments,
|
||||
// make ffmpeg globaly less buggy
|
||||
"-strict", "-2",
|
||||
)
|
||||
return args
|
||||
|
Loading…
x
Reference in New Issue
Block a user