mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-01-23 23:20:51 +01:00
[PR #13053] [CLOSED] Set -copytb 1 in ffmpeg when creating an HLS stream, to fix "non-monotonic DTS" time breakage when remuxing. #13277
Labels
No labels
area:database
awaiting-feedback
backend
blocked
breaking change: web api
bug
build
ci
confirmed
discussion needed
dotnet future
downstream
duplicate
EFjellyfin.db
enhancement
feature
future
github-actions
good first issue
hdr
help wanted
invalid
investigation
librarydb
live-tv
lyrics
media playback
music
needs testing
nuget
performance
platform
pull-request
question
regression
release critical
requires-web
roadmap
security
security
stale
support
syncplay
ui & ux
upstream
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: starred/jellyfin#13277
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/jellyfin/jellyfin/pull/13053
Author: @tsuereth
Created: 11/17/2024
Status: ❌ Closed
Base:
master← Head:hls-ffmpeg-copytb📝 Commits (3)
d0fb477Set-copytb 1which "is sometimes required to avoid non monotonically increasing timestamps when copying video streams with variable frame rate."b12f354Merge branch 'master' into hls-ffmpeg-copytb62e1c57Use configExperimentalFfmpegSetCopytbto set ffmpeg's-copytboption (default -1, matching the ffmpeg default).📊 Changes
2 files changed (+6 additions, -1 deletions)
View changed files
📝
Jellyfin.Api/Controllers/DynamicHlsController.cs(+4 -1)📝
MediaBrowser.Model/Configuration/ServerConfiguration.cs(+2 -0)📄 Description
Set
-copytb 1which "is sometimes required to avoid non monotonically increasing timestamps when copying video streams with variable frame rate."Does this adversely affect non-copy (transcode) streams? ... is an excellent question. :) In my limited testing, I don't think it does, though admittedly I don't have a ton of domain knowledge or relevant testing material.
Changes
This change simply adds
-copytb 1to ffmpeg's command-line arguments when creating an HLS stream. As ffmpeg documentation mentions: https://ffmpeg.org/ffmpeg.htmlLike the doc says, when a source video has "non monotonically increasing timestamps," this setting appears necessary to ensure that a remux operation outputs frames with the source's intended timings.
Otherwise an HLS remux stream will adjust those non-monotonic timestamps, and produce a video which appears to miss or skip frames. This results in warnings logged by ffmpeg such as:
Issues
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.