mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-23 17:52:36 -04:00
wip: Try to fix disconituity segment
This commit is contained in:
parent
2ae26d108d
commit
f03464aa4c
@ -68,7 +68,10 @@ func (fs *FileStream) Destroy() {
|
||||
}
|
||||
|
||||
func (fs *FileStream) GetMaster() string {
|
||||
master := "#EXTM3U\n"
|
||||
master := `#EXTM3U
|
||||
#EXT-X-VERSION:7
|
||||
#EXT-X-INDEPENDENT-SEGMENTS
|
||||
`
|
||||
if fs.Info.Video != nil {
|
||||
var transmux_quality Quality
|
||||
for _, quality := range Qualities {
|
||||
|
@ -17,7 +17,6 @@ const OptimalFragmentDuration = float64(5)
|
||||
type Keyframe struct {
|
||||
Sha string
|
||||
Keyframes []float64
|
||||
CanTransmux bool
|
||||
IsDone bool
|
||||
info *KeyframeInfo
|
||||
}
|
||||
|
@ -271,6 +271,15 @@ func (ts *Stream) run(start int32) error {
|
||||
"-muxdelay", "0",
|
||||
)
|
||||
args = append(args, ts.handle.getTranscodeArgs(toSegmentStr(segments))...)
|
||||
|
||||
if start_ref != 0 {
|
||||
args = append(args,
|
||||
// We need to add frag_discout to the movflags to get ffmpeg to calculate the correct presentation time otherwise players get lost.
|
||||
// Since we can't append to movflags but only override them, we also copy the default hls w/ fmp4 movflags
|
||||
// Initial flags from: https://github.com/FFmpeg/FFmpeg/blob/master/libavformat/hlsenc.c#L934C32-L934C72
|
||||
"-hls_segment_options", "movflags=frag_custom+dash+delay_moov+frag_discont",
|
||||
)
|
||||
}
|
||||
args = append(args,
|
||||
"-f", "hls",
|
||||
"-hls_time", fmt.Sprint(OptimalFragmentDuration),
|
||||
|
Loading…
x
Reference in New Issue
Block a user