From da29d9753d408e2c6852c49a4071bcf5dca8fcd7 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Thu, 22 Aug 2024 00:37:05 +0200 Subject: [PATCH] Use genpts as an input param for transcodes --- transcoder/src/stream.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/transcoder/src/stream.go b/transcoder/src/stream.go index 3692e3ec..027180e1 100644 --- a/transcoder/src/stream.go +++ b/transcoder/src/stream.go @@ -238,6 +238,11 @@ func (ts *Stream) run(start int32) error { ) } args = append(args, + // some avi files are missing pts, using this flag makes ffmpeg use dts as pts and prevents an error with + // -c:v copy. Only issue: pts is sometime wrong (+1fps than expected) and this leads to some clients refusing + // to play the file (they just switch back to the previous quality). + // since this is better than errorring or not supporting transmux at all, i'll keep it here for now. + "-fflags", "+genpts", "-i", ts.file.Info.Path, // this makes behaviors consistent between soft and hardware decodes. // this also means that after a -ss 50, the output video will start at 50s