jellyfin / jellyfin-roku

The Official Roku Client for Jellyfin
https://jellyfin.org
GNU General Public License v2.0
438 stars 133 forks source link

Option to force transcoding #1243

Open sks316 opened 1 year ago

sks316 commented 1 year ago

Describe the feature you'd like

I'd like a feature in the Roku app that tells the server to transcode as opposed to directly playing the file, regardless of whether the client supports the original file.

Additional context

I ran into an issue today playing back a HEVC video with AAC 7.1 audio, namely that the video was playing but the audio was not. I suspect an incompatibility with the Roku device and the audio codec of this specific file, and I found that lowering the max bitrate enough to force transcoding fixed it, but it reduced the video quality to a point that I simply didn't want to watch it anymore. Evidently transcoding is solving my problem, so I'd like to suggest an option to force transcoding regardless of the codecs that the device says it supports, without drastic quality loss.

I know it's not an issue with the file, because it plays just fine on every other device.

sks316 commented 1 year ago

Ran into an issue again today that would be resolved by this feature, the Roku client kept wanting to direct-play a video but it would continuously fail without even trying to transcode. None of the settings did anything, it kept giving me a non-descript error that said "An error was encountered while playing this item", and there was absolutely nothing in my server logs to help me diagnose the problem. The video played perfectly fine on every other client, including other Roku clients, it's just this one Roku client refusing to play it. Lowering the bitrate to 1 to force it to transcode resolved the issue, but again, reduced the quality to an almost-unwatchable point.

cewert commented 1 year ago

I understand your feature request and I don't see a problem with adding a user setting to force transcoding but wouldn't you rather the file direct play if possible? Less work for your jellyfin server, possibly better quality output, and one less setting to mess with and remember that you have turned on. A user setting to force transcoding would be more of a workaround and wouldn't address the underlying problem.

The video played perfectly fine on every other client, including other Roku clients, it's just this one Roku client refusing to play it.

Please provide as many details as possible about your roku device (model for working devices and model for device that doesn't work), the video file you are having trouble playing, and the audio device you are using. Are all the roku devices using the same speakers? Do all the roku devices have the same settings selected in the roku settings? Also, what version is your server on and what version of the rokuapp are you using?

sks316 commented 1 year ago

I'd be perfectly fine with forcing transcoding actually, as far as I can see it's the only way to address the issue, and my server can handle it just fine. The only device that doesn't work properly is a TCL 65S431 Roku TV, every other device in my household can play back the videos properly. The Roku app is using the latest release version, as is the server. All settings are identical.

sks316 commented 1 year ago

Didn't mean to close it, oops.

sks316 commented 1 year ago

Video 1 is a movie, video is 1080p HEVC SDR and audio is AAC 7.1. The video plays fine, but the audio is totally silent, both on optical audio and through the onboard TV speakers. Video 2 is a TV episode, with MPEG4 AVC video and DTS-HD master audio. The client refuses to play back the video at all and fails with a non-descript error, and nothing helpful is stored in my server logs. The client doesn't even try to transcode either case until I lower the bitrate client-side.

sks316 commented 1 year ago

I've talked with individuals in the Matrix troubleshooting community, and they believe it to be a device failure: The device is improperly reporting its playback capabilities to the client, which then tells the server that the device can play codecs that, in reality, it doesn't support. When the client tries to play an unsupported codec, it obviously fails, but because the client thinks the device can play codecs it doesn't support, it doesn't even try to transcode and instead displays a nondescript error. One member of the troubleshooting community says they've seen this before, both on Roku and on Android TV, and in my opinion, the best fix or workaround is to add an option to the client to force transcoding, regardless of the device's reported capabilities.

cewert commented 1 year ago

I've talked with individuals in the Matrix troubleshooting community, and they believe it to be a device failure: The device is improperly reporting its playback capabilities to the client, which then tells the server that the device can play codecs that, in reality, it doesn't support. When the client tries to play an unsupported codec, it obviously fails, but because the client thinks the device can play codecs it doesn't support, it doesn't even try to transcode and instead displays a nondescript error. One member of the troubleshooting community says they've seen this before, both on Roku and on Android TV, and in my opinion, the best fix or workaround is to add an option to the client to force transcoding, regardless of the device's reported capabilities.

Yes, that's totally possible and I agree this would be the best workaround but what if it's being caused by a bug in our code? It would be nice to fix the root cause of the problem if possible. There may be other users experiencing the same problem as you that don't want to transcode for whatever reason.

cewert commented 1 year ago

The only device that doesn't work properly is a TCL 65S431 Roku TV, every other device in my household can play back the videos properly.

Can you goto Home -> Settings -> System -> About and tell me the model and software version listed please? I don't know how to figure out the roku device model from a TV.

sks316 commented 1 year ago

TCL model: 65S431 Hardware ID: C141X Serial number: X000003JUA0N Software version: 11.5.0 - build 4312-93

I don't believe it to be a bug with your code, otherwise one could assume it would be present on most other Roku devices.

natzilllla commented 1 year ago

Hello, recently I'm also seeing my Roku device being unable to transcode 7.1 aac. It used to get picked up that it doesn't support aac 7.1 and transcode the audio which was fine with me.

My Roku device is the streaming stick

Model: 3820x - streaming stick 4k Software: 11.5.0 * build 4312-cu

I have two of these streaming sticks and they both exhibit the same issue. I don't want to necessarily force transcode all audio, but I hope this can help find out what's triggered the behavior on aac 7.1

Note: aac 5.1 is recognized and transcoded like normal in my testing.

cewert commented 1 year ago

@natzilllla do you know what version of the app that 7.1 aac files last worked?

natzilllla commented 1 year ago

@natzilllla do you know what version of the app that 7.1 aac files last worked?

It might have been four versions ago. I'm basing this off my memory of the update notify screen.

biscuitash commented 1 year ago

Hello, I am also experiencing the same problem as the two other people in this thread. I have looked around to see whether I could find a possible solution, but haven't been successful. Like the original poster, my Roku Stick 4k plays HEVC video with AAC 7.1 audio, but there is no sound. The only way to have audio play is by using the Opensubtitles plugin which forces Roku to transcode the file, but in turn significantly lowers the quality of the original video. Every other file plays normally, and this issue only happens with files that have AAC 7.1 audio.

Skin80 commented 1 year ago

Roku doesn't support AAC 7.1 audio, only 2.0

Needs to be transcoded to AC3/E-AC3.

image

jakub77 commented 1 year ago

I'm having a similar issue with my TCL 65R615 Roku TV using ARC to a Yamaha RX-483 set up in a 5.0 configuration. I'm on the current roku and jellyfin release (and I tried the latest developmental roku jellyfin release with no difference). When I have a HEVC video with AAC 5.1, the video will DirectPlay perfectly; however, when I have a AAC 7.1 video, the audio track is silent. The server & roku client will report directPlay being used as the "source file is entirely compatible with this client." The receiver states it is receiving a 2 channel DD+ signal. I don't hear any audio from the video, but I can still hear the button clicks from from moving around the Roku UI. When I turn on subtitles which force transcoding, the server sends 5.1 AAC which allows the audio to work again (at the cost of seeing subtitles). This happens on all my 7.1 AAC files. The files play fine through a laptop/phone (but these require transcoding).

As of now, the only work-around I've found is adding a 5.1 track to all of my files with a 7.1 only audio track, but this isn't ideal.

cewert commented 1 year ago

Currently our app doesn't check for 8 channel audio support and the device profile will report MaxAudioChannels as either 2 or 6.

@sks316 @jakub77 I've attempted to add 8 channel audio support in #1299 but I don't have a way of testing it. I believe that's the issue you guys are having. If possible, please give it a test and let me know if it fixes your problem 🤞

jakub77 commented 1 year ago

Currently our app doesn't check for 8 channel audio support and the device profile will report MaxAudioChannels as either 2 or 6.

@sks316 @jakub77 I've attempted to add 8 channel audio support in #1299 but I don't have a way of testing it. I believe that's the issue you guys are having. If possible, please give it a test and let me know if it fixes your problem 🤞

Hello @cewert, thanks for the reply! I'm a bit of a github noob and am a bit uncertain which build-dev to use to correspond to the pull request of #1299. I tried using the latest build-dev (build-dev 658) which I don't think is the one you wanted me to try, but I experienced the same issue.

A HEVC 7.1 AAC channel file was played through the dev jellyfin client and the video played fine, but there was no audio from the film. The server and jellyfin client both stated that directplay was being used as "source file is entirely compatible with this client." My receiver showed a 2 channel DD+ signal and I could hear roku system sounds, but again no video sound. If incompatible subtitles were turned on, the film was transcoded and I could hear audio. 5.1 AAC files work as intended.

As a person with extremely rusty programming skills (and zero brightscript knowledge), I did notice that /source/utils/ has deviceCapabilities.brs which has MaxAudioChannels as a part of TranscodingProfiles, but these are not a part of DirectPlayProfiles. In this case, is MaxAudioChannels only relevant for transcoded audio, and not for DirectPlay audio? The GetDirectPlayProfiles function seems to look at Codecs, but not channel counts.

Additionally... my receiver is a 5.1 receiver and I wonder if somehow this is influencing this issue. I wish I had a 7.1 receiver to test with. The simplest answer probably is to just transcode all the 7.1 to 5.1 and save that to each file, but some part of me hates to get rid of the extra information that may be nice later on.

Sorry for the rambling, appreciate any continued insight!

cewert commented 12 months ago

@jakub77 thanks for trying to test it! As for your comments about the code, are you talking about the code in unstable or the code in #1299?

Here are some instructions to help you find the right build to use for #1299 and any other build you might want to test in the future:

  1. Go to the PR you want to test - #1299
  2. You have two options now:
    • Find the most recent commit and click the icon next to it (green checkmark or red x), then next to "build-dev" click details green-checkmark-menu
    • Scroll to the bottom of the page where the CI checks are. Click "Show all checks" if necessary. Then click details next to "build-dev" (this method will always show the details of the most recent build) all-checks-menu
  3. Click the "Summary" link in the top left of the page github-actions-details-link
  4. Click the "Artifact" link at the bottom of the page. This is the build zip file that was created by the CI based on the last commit. github-action-detail-summary