mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-31 04:04:21 -04:00
Fix timestamps padding in transcode mode
This commit is contained in:
parent
030a4e0e86
commit
3f9446d46f
@ -147,14 +147,18 @@ func (ts *Stream) run(start int32) error {
|
|||||||
args := []string{
|
args := []string{
|
||||||
"-nostats", "-hide_banner", "-loglevel", "warning",
|
"-nostats", "-hide_banner", "-loglevel", "warning",
|
||||||
|
|
||||||
|
// This is the default behavior in transmux mode and needed to force pre/post segment to work
|
||||||
|
"-noaccurate_seek",
|
||||||
"-ss", fmt.Sprintf("%.6f", start_ref),
|
"-ss", fmt.Sprintf("%.6f", start_ref),
|
||||||
"-i", ts.file.Path,
|
"-i", ts.file.Path,
|
||||||
"-copyts",
|
|
||||||
}
|
}
|
||||||
// do not include -to if we want the file to go to the end
|
// do not include -to if we want the file to go to the end
|
||||||
if end != int32(len(ts.file.Keyframes)) {
|
if end+1 < int32(len(ts.file.Keyframes)) {
|
||||||
|
// sometimes, the duration is shorter than expected (only during transcode it seems)
|
||||||
|
// always include more and use the -f segment to split the file where we want
|
||||||
|
end_ref := ts.file.Keyframes[end+1]
|
||||||
args = append(args,
|
args = append(args,
|
||||||
"-to", fmt.Sprintf("%.6f", ts.file.Keyframes[end]),
|
"-t", fmt.Sprintf("%.6f", end_ref-start_ref),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
args = append(args, ts.handle.getTranscodeArgs(segments_str)...)
|
args = append(args, ts.handle.getTranscodeArgs(segments_str)...)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user