Fix timestamp seeking for progressive downloads in mpv/iina/infuse

- Remove avoid_negative_ts from movflags (not a movflag option)
- Add explicit -avoid_negative_ts make_zero -start_at_zero for progressive downloads
- Ensures timestamps always start at 0 for proper seeking in strict players
This commit is contained in:
mani
2026-01-08 02:20:41 +01:00
parent d37a0f3e93
commit 1ed9bf2f50

View File

@@ -7495,8 +7495,7 @@ namespace MediaBrowser.Controller.MediaEncoding
{
// Progressive download - use faststart for proper seeking and duration
// Use frag_keyframe for better seeking compatibility with mpv
// avoid_negative_ts make_zero ensures timestamps start at 0 for better player compatibility
format = " -f mp4 -movflags frag_keyframe+faststart+default_base_moof -avoid_negative_ts make_zero";
format = " -f mp4 -movflags frag_keyframe+faststart+default_base_moof";
}
}
@@ -7603,6 +7602,12 @@ namespace MediaBrowser.Controller.MediaEncoding
args += " -start_at_zero";
}
}
else if (state.TranscodingType == TranscodingJobType.Progressive && !state.BaseRequest.CopyTimestamps)
{
// For progressive downloads without copyTimestamps, ensure timestamps start at 0
// This fixes seeking issues in strict players like mpv, iina, and infuse
args += " -avoid_negative_ts make_zero -start_at_zero";
}
var qualityParam = GetVideoQualityParam(state, videoCodec, encodingOptions, defaultPreset);