Skip to content
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

Fix transcoding problem when using 10.8 server #681

Merged
merged 9 commits into from Jul 22, 2022

Conversation

neilsb
Copy link
Member

@neilsb neilsb commented Jul 1, 2022

In the current device profile, we specify that we support h264 profile level up to 5.1, whereas the Roku specification says they only support 4.0,4.1. In in the 10.7 releases, the maximum Profile Level the server would use was 4.1.

@nyanmisaka explained that hardware decoders may be able to decode higher profile levels but with some quality implications (e.g. 5.2 may play on 4.x hardware with macroblock artifacts). This seems to be the case with Roku when Direct Playing, but when transcoding the device will have more strict checking using the info from the play, so will just refuse to play.

In order to allow a user to reduce transcodes, and attempt direct play of videos where the only reason for transcoding is an unsupported profile level, a user setting was added. If the direct play fails, the transcoding url will be used instead.

Changes

  • Update Device Profile to correctly set max supported h264 profile level to 4.1
  • Add user option to allow user to attempt to direct play h264 media where only the Profile Level is compatible.
  • Add logic in Video Player to force direct play in cases when user setting is true, and video is only transcoding due to profile level
  • Add logic in Main for when video ends, to replay video using Transcoding if requested

Issues
fixes #670 #651

Copy link
Member

@1hitsong 1hitsong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried several files that previously failed and all played without issue.

@neilsb neilsb marked this pull request as draft July 1, 2022 16:57
@neilsb neilsb marked this pull request as ready for review July 4, 2022 09:36
@whiteowl3
Copy link
Contributor

whiteowl3 commented Jul 4, 2022

in deviceCapabilities.brs, the "Value" of the "hevc" "VideoLevel" needs to be the float multiplied by 30, in my tests.
https://stackoverflow.com/questions/69983131/whats-the-difference-between-ffprobe-level-and-h-264-level
such as

{
                "Type": "Video",
                "Codec": "hevc",
                "Conditions": [
                    {
                        "Condition": "EqualsAny",
                        "Property": "VideoProfile",
                        "Value": "high|main",
                        "IsRequired": false
                    },
                    {
                        "Condition": "LessThanEqual",
                        "Property": "VideoLevel",
                        "Value": StrI(5.1*30),
                        "IsRequired": false
                    }
                ]
            }

but, to be clear, this has NOT fixed transcoding on my infra. it only avoids transcoding everywhere it can. when something still must transcode, it still failing for me on 10.8.x
other parts of my infra caused this, transcoding is working as expected with these changes.

@whiteowl3
Copy link
Contributor

some of my subtitle changes are also required to prevent the erroneous transcoding, but im not sure which ones. probably just ass/ssa profiles of either embed/external type would be sufficient.

@neilsb
Copy link
Member Author

neilsb commented Jul 5, 2022

in deviceCapabilities.brs, the "Value" of the "hevc" "VideoLevel" needs to be the float multiplied by 30

Good catch, thanks. Updated.

Copy link
Member

@cewert cewert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had one file that wouldn't play because it needed transcoding that now plays fine with this PR. I also played a bunch of random files that needed transcoding and they all played as expected.

My setup is pretty simple though: local only server, 1080p TV, and a 2.1 soundbar.

@1hitsong
Copy link
Member

1hitsong commented Jul 12, 2022

Left a comment in the chat, but will put it here for a paper trail.

I tested this again on the files I had problems with and everything worked without issue.

@funkybunch
Copy link

Upon merge I believe this also fixes #694

@cewert cewert merged commit 5a97762 into jellyfin:master Jul 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

roku does not transcode
5 participants