-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Always set ffmpeg flag +genpts when video stream is being copied #977
Conversation
Would be helpful if you could paste the actual command before and after the changes. Also, I'm not convinced this actually places the flag before |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look okay-ish, but I second @cvium - please provide pre- and post-change ffmpeg
command lines.
Sure thing. Here are the commands taken from Before patch:
After patch:
I believe the flags are placed in the correct location because of the code at |
@cvium, this pull requests addresses EncodingHelper.cs:2453; it is moved up to line 2439 to read clearer. As for EncodedRecorder.cs:152, what exactly needs fixing? I do not use the Live TV feature so I would not be able to test any changes, so I wouldn't feel comfortable doing any work to that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Please add yourself to CONTRIBUTORS.md!
Hah alright, will do! |
The problem with EncodingHelper.cs:2453 is that the function is called here
-i flag.
Regarding EncodedRecorder.cs:152, it's a similar problem in that it's used here after
|
@cvium, I provided a before/after log showing the issued ffmpeg command having Here is how EncodingHelper.cs:2453 is called from 4 locations:
Number 1 and 2 from my list are similar so we'll examine those together. Look at the Number 3 are 4 are similar as well. The You are right about the call to |
In regards to @cvium's second point, I do not know why you are asking me to fix EncodedRecorder.cs:152. This patch does not touch that file at all. The code you are referencing is existing code; Jellyfin will behave exactly the same with or without my patch. It is also for a completely different aspect (LiveTV) so should probably be it's own PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved pending feedback from @cvium.
No, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved
Changes
Ensure ffmpeg flag
+genpts
is set if target codec iscopy
.Issues
Transcoding fails on video streams that lack PTS data. When ffmpeg is copying a video stream which lacks PTS data or for some other reason PTS is not passed along correctly, the ffmpeg decoder is bypassed and PTS data is not ever generated, resulting in a stream that never plays.
Output of ffmpeg in such a case:
The
+genpts
flag will generate missing PTS if DTS is present. Relevant Stack Exchange answer: https://superuser.com/questions/710008/how-to-get-rid-of-ffmpeg-pts-has-no-value-error