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

HEVC Direct Play override for Profile Version #774

Merged

Conversation

neilsb
Copy link
Member

@neilsb neilsb commented Sep 4, 2022

Add user profile option to attempt direct play of HEVC content where the profile lever of the media is not supported by the Roku device. If it fails, silently fall back to transcoding.

The functionality exists for h264 media, this is just adding an option for HEVC content.

Changes

  • New User Setting to attempt direct play
  • Translation for the new HEVC setting and h264 setting that was missed

Issues
fixes #724

@neilsb
Copy link
Member Author

neilsb commented Sep 4, 2022

Not overly keen of the way the if has been structured in VidepPlayer.brs. But since Roku doesn't support multi line if statements, and the line was so long, thought this made it slightly more readable.

@neilsb
Copy link
Member Author

neilsb commented Sep 4, 2022

@crobibero Lvl was short for Level. I thought the generally used term was "Profile Level" as opposed to just "Profile" and was trying to save some space when displaying the title. But for the sake of 2 characters, best to stick to "Level"?

@lakerssuperman
Copy link

I took it for a test drive. I see in the options that the profile override now exists. However, when I click on a movie it opens the movie screen with the synopsis and options (play, options, set watched, favorites) and freezes there on every title I click on. Only pressing the home button on the remote and closing out of the app unfreezes things. As a result, I wasn't able to test if HEVC video successfully direct plays.

@neilsb
Copy link
Member Author

neilsb commented Sep 25, 2022

I took it for a test drive. I see in the options that the profile override now exists. However, when I click on a movie it opens the movie screen with the synopsis and options (play, options, set watched, favorites) and freezes there on every title I click on

@lakerssuperman : It freezes when displaying the movie details? Before attempting to click Play or anything?

I'm unable to replicate this, and the code changes shouldn't affect that screen at from my understanding. Does it happen in all movies or just some? If it's just some, is there any commonality between them that you can see?

If you turn the setting off in the settings menu does the same happen?

@lakerssuperman
Copy link

I took it for a test drive. I see in the options that the profile override now exists. However, when I click on a movie it opens the movie screen with the synopsis and options (play, options, set watched, favorites) and freezes there on every title I click on

@lakerssuperman : It freezes when displaying the movie details? Before attempting to click Play or anything?

I'm unable to replicate this, and the code changes shouldn't affect that screen at from my understanding. Does it happen in all movies or just some? If it's just some, is there any commonality between them that you can see?

If you turn the setting off in the settings menu does the same happen?

IMG_20220926_163239791

Neil,

Hope all is well.

When I click into a movie it freezes at the screen I attached. I'm unable to select play or use the dpad to select any of the other iptions. The only thing that works is pressing home to close out of the app. I will double check later, but I believe the HEVC direct play option being toggled had no effect. This was on my 46xx series uktras and as I recall from my tests any item I selected led to the freeze

If you can't replicate it, it could very well be on my end, but as soon as I reverted to the older dev building I've been using everything work correctly again. I'm happy to do more testing.

@lakerssuperman
Copy link

I took it for a test drive. I see in the options that the profile override now exists. However, when I click on a movie it opens the movie screen with the synopsis and options (play, options, set watched, favorites) and freezes there on every title I click on

@lakerssuperman : It freezes when displaying the movie details? Before attempting to click Play or anything?

I'm unable to replicate this, and the code changes shouldn't affect that screen at from my understanding. Does it happen in all movies or just some? If it's just some, is there any commonality between them that you can see?

If you turn the setting off in the settings menu does the same happen?

I did some further testing and here's what's happening on my end:

  1. I tried your HEVC direct play branch on my Roku Ultra 4800x series. It also freezes.
  2. Freezing occurs on the 4800x: as I described above when clicking on movies and TV shows. TV shows freeze either from navigating to the show via the TV Show library or by clicking on a next up TV episode and using the pop up menu options "start from beginning, go to series, etc".
  3. Music playback seems to work correctly. I was able to navigate to an album, select a song and playback would start as expected. Individual song playback worked, full album playback worked. I tried this on several albums.
  4. On my 4800x, I'm able to bring up the options menu and scroll to settings. However, as soon as I click settings the options menu disappears and the app freezes.

@lakerssuperman
Copy link

Greetings!!

After some help over in the Matrix chat, I now have the correct ropm modules setup and building Unstable works perfectly fine with no hard locks.

Trying to build the HEVC direct play fix repo now with ropm installed gives me the ability to access settings and toggle HEVC directly play, however when attempting to play a video I get a hard lock. Enabling or disabling HEVC direct play bot h resulted in a hard lock.

I didn't realize I was able to telnet into the Roku and get an error log, but now that I know that this is what my Roku reports:
https://pastebin.com/wHJ6nSZ5

Thanks!!

@neilsb
Copy link
Member Author

neilsb commented Oct 6, 2022

@lakerssuperman Thanks -that was useful. I think it was an error on my part when testing, but pushed an update to the PR which should fix it. Sorry about that.

@lakerssuperman
Copy link

@lakerssuperman Thanks -that was useful. I think it was an error on my part when testing, but pushed an update to the PR which should fix it. Sorry about that.

No need to be sorry. I'm glad I could help and I appreciate your time in adding this feature. Thank you!!

@melat0nin
Copy link

Are there instructions for building and testing this version? I'm keen to give it a go!

@neilsb
Copy link
Member Author

neilsb commented Oct 6, 2022

Are there instructions for building and testing this version? I'm keen to give it a go!

Easiest way is to use the output form our CI checks. Saves having to build anything.

First step is enable developer mode on your device if you have not yet done so (Step 1). This will allow you to sideload apps but will not affect the normal use of your device.

Then you can access the developer installer (Step 2 from the instructions above) and upload the output form any of our PR Build steps.

To get the appropriate file to upload:

  • Goto the PR and at the bottom of the conversation tab you'll see the Checks (Should say "2 successful checks") and just expand the show all checks
  • For the build / run check, click the Details link
  • Select the Summary link at the top left of that page
  • You'll see the "Artifacts" section at the bottom of the page showing the build file you can upload to your Roku (called something similar to Jellyfin-Roku-dev-50bc99366de3428d46c8ce0818d943d24eacdf60

Once uploaded to your Roku, it should appear on the home screen as any normal channel would. It will always be the last entry on the list, and you can only have one sideloaded app on your device at a time. You can upload new versions without uninstalling previous ones, as it will just overwrite it.

@lakerssuperman
Copy link

I just gave the new code a run through and video does play, but I'm getting still getting transcoding even with the HEVC direct play override enabled.

Here's my log from the Roku: https://pastebin.com/3fk19rnF

@neilsb
Copy link
Member Author

neilsb commented Oct 6, 2022

While playing the content, can you press the up button. This should show media and transcode information, and should display the reason why it's transcoding.

@lakerssuperman
Copy link

lakerssuperman commented Oct 6, 2022

While playing the content, can you press the up button. This should show media and transcode information, and should display the reason why it's transcoding.

I'm away from my computer right now, but I had the server dashboard open during playback to check that and it reported that the video profile wasn't supported. I will give it a more thorough look when I get home later and see if I can turn anything else up.

@melat0nin
Copy link

Thanks @neilsb, it installed great. Alas, HEVC main 10 files are still being transcoded for me, despite the setting being enabled (TranscodeReason=VideoProfileNotSupported)

Media info from JF web:

Title1080p HEVC SDR
Codec HEVC
Codec tag hev1
Profile Main 10
Level 120
Resolution 1920x1080
Aspect ratio 16:9
Interlaced No
Framerate 23.976025
Bitrate 2000 kbps
Bit depth 10 bit
Video range SDR
Video range type SDR
Pixel format yuv420p10le
Ref frames 1

@lakerssuperman
Copy link

Thanks @neilsb, it installed great. Alas, HEVC main 10 files are still being transcoded for me, despite the setting being enabled (TranscodeReason=VideoProfileNotSupported)

Media info from JF web:

Title1080p HEVC SDR
Codec HEVC
Codec tag hev1
Profile Main 10
Level 120
Resolution 1920x1080
Aspect ratio 16:9
Interlaced No
Framerate 23.976025
Bitrate 2000 kbps
Bit depth 10 bit
Video range SDR
Video range type SDR
Pixel format yuv420p10le
Ref frames 1

Exactly what I'm seeing. Always glad when it's not just me lol.

@lakerssuperman
Copy link

@neilsb Hey there, hope all is well. I did a little more checking with a different clip with a different HEVC profile level and that also failed to direct play, which I figured it would, but just wanted to be sure. Let me know if you need any more info about the clips I'm using or logs from my Roku. Thanks again!!

@neilsb
Copy link
Member Author

neilsb commented Oct 11, 2022

I did a little more checking with a different clip with a different HEVC profile level and that also failed to direct play

Was this another main-10 clip? I think that I may have confused things with my terminology and PR wording, which may not be technically correct. This PR currently only looks at the profile level (4.1, 5.0, 5.1 etc) and not the actual profile (main, main 10) so I think main 10 may we always transcode.

I think there was another draft PR (#686) that also added support for checking the profiles supported on the device and updating the profile. In think this may be what’s needed to fix main 10 transcoding.

I’ll check out that and incorporate it in this PR is that helps (and @whiteowl3 is happy with that)

@lakerssuperman
Copy link

I did a little more checking with a different clip with a different HEVC profile level and that also failed to direct play

Was this another main-10 clip? I think that I may have confused things with my terminology and PR wording, which may not be technically correct. This PR currently only looks at the profile level (4.1, 5.0, 5.1 etc) and not the actual profile (main, main 10) so I think main 10 may we always transcode.

I think there was another draft PR (#686) that also added support for checking the profiles supported on the device and updating the profile. In think this may be what’s needed to fix main 10 transcoding.

I’ll check out that and incorporate it in this PR is that helps (and @whiteowl3 is happy with that)

Yes, it was a main 10 clip so that makes sense.

I did a little more checking with a different clip with a different HEVC profile level and that also failed to direct play

Was this another main-10 clip? I think that I may have confused things with my terminology and PR wording, which may not be technically correct. This PR currently only looks at the profile level (4.1, 5.0, 5.1 etc) and not the actual profile (main, main 10) so I think main 10 may we always transcode.

I think there was another draft PR (#686) that also added support for checking the profiles supported on the device and updating the profile. In think this may be what’s needed to fix main 10 transcoding.

I’ll check out that and incorporate it in this PR is that helps (and @whiteowl3 is happy with that)

Yes, it was a main 10 clip so that makes sense.

And that would be awesome. Thank you.

@whiteowl3
Copy link
Contributor

yeah you are welcome to whatever code in that PR might be helpful. I wont have time to clean it up for weeks.

@github-actions
Copy link

github-actions bot commented Nov 3, 2022

This pull request has been inactive for 21 days and will be automatically closed in 7 days if there is no further activity.

@github-actions github-actions bot added the stale This issue/PR has gone stale. label Nov 3, 2022
@github-actions
Copy link

This pull request has been closed because it has been inactive for 28 days. You may submit a new pull request if desired.

@github-actions github-actions bot closed this Nov 11, 2022
@neilsb neilsb reopened this Dec 1, 2022
@neilsb
Copy link
Member Author

neilsb commented Dec 1, 2022

I think PR still makes sense to include to allow users to choose to direct play HEVC titles with a higher profile level than the box supports.

Many of the comments in this were due to the video Profile rather than the ProfileLevel, which is fixed in #686 . This PR is specifically for ProfileLevel

@neilsb neilsb removed the stale This issue/PR has gone stale. label Dec 1, 2022
@kamanwu
Copy link

kamanwu commented Dec 3, 2022

My Roku TV still cannot play HEVC directly. Hope this PR will fix the issue.

locale/en_US/translations.ts Outdated Show resolved Hide resolved
settings/settings.json Outdated Show resolved Hide resolved
settings/settings.json Outdated Show resolved Hide resolved
settings/settings.json Outdated Show resolved Hide resolved
@1hitsong 1hitsong merged commit 961dc28 into jellyfin:unstable Dec 6, 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.

HEVC Content Being Transcoded on app version 1.5 because of VideoProfile
8 participants