Jump to content

Roku Direct Play


AmericanCrisis

Recommended Posts

AmericanCrisis

I've been doing a lot of re-encoding of my library and have noticed some clients on Roku are still causing the server to transcode or in some cases Direct Stream (which still shows a transcode but I guess that has minimal impact on server resources).

 

My target output has been 720p/H264/MP4/AAC 5.1 for the re-encoded media.

 

Roku website states:

Roku officially supports the following media formats:

  • Video file types: MP4, MOV, M4V, MKV, WebM
  • Video codecs: H.264/AVC, HEVC/H.265, VP9
  • Audio file types: AAC, MP3, WMA, WAV (PCM), AIFF, FLAC, ALAC, AC3, E-AC3
  • Streaming protocols: HLS, Smooth, DASH

 

The server dashboard showed one file as causing a transcode and the reason was the container was not compatible. Another file was causing a transcode for audio codec. Am I missing something here? The whole point of re-encoding my library was to have a media file that was compatible with all clients. What else could I do on the re-encoding side to mitigate this?

Link to comment
Share on other sites

The AVI container is not supported. Only MP4, MOV, M4V, MKV, and WEBM. If it says container isn't supported neither is MPEG2-TS supported. We cannot seek in this container so we remux it.

 

There are environmental reasons it is transcoding your audio. Does you AVR/TV support Dolby? If not any surround sound codecs (ac3, eac3, dts) will need to be transcoded.

 

Can you supply an ffmpeg log of your media that is transcoding? We will be happy to explain what is happening. Thanks. :)

 

NOTE: Also avoid AAC 5.1 like the plague. The Roku cannot play AAC 5.1 it will downsample it to AAC 2.0 and destroy your surround sound reducing it to stereo. In the app we have a setting that will cause transcoding on AAC 5.1 to transcode it into AC3 (dolby) 5.1. This will keep the surround sound as pass-through rather than turn it into AAC 2.0 stereo. Look for the "Convert Multi-Channel AAC" option in settings and make sure it is OFF. This will keep transcoding to a minimum.

Edited by speechles
  • Like 1
Link to comment
Share on other sites

AmericanCrisis

Ah man, I've been encoding all files to AAC 5.1 because somewhere I read that AAC was the most compatible audio codec out there. What is your recommendation here going forward? I've been encoding AAC 5.1 at 256kbps.

 

I did some double checking, it looks like the file that was being transcoded was already in an MKV container. I used ffmpeg to re-encode that media file and I'm new to ffmpeg.

 

Currently I do not have any local Roku units. Practically all my users/clients do though. To clarify, keep the setting "Convert Mulit...." to off in the Roku app will not cause a transcode but it will cause Roku app to downsample AAC 5.1 to AAC 2.0? In order for the client to get 5.1 they'll need to have that setting to on?

Link to comment
Share on other sites

Ah man, I've been encoding all files to AAC 5.1 because somewhere I read that AAC was the most compatible audio codec out there. What is your recommendation here going forward? I've been encoding AAC 5.1 at 256kbps.

 

I did some double checking, it looks like the file that was being transcoded was already in an MKV container. I used ffmpeg to re-encode that media file and I'm new to ffmpeg.

 

For maximum compatibility you need to include both a stereo and a surround track (AAC 2.0 and AC3 5.1). This way you can choose your own audio in the app via the OSD in the video player. All newer Roku models support secondary audio with direct play.

 

Currently I do not have any local Roku units. Practically all my users/clients do though. To clarify, keep the setting "Convert Mulit...." to off in the Roku app will not cause a transcode but it will cause Roku app to downsample AAC 5.1 to AAC 2.0? In order for the client to get 5.1 they'll need to have that setting to on?

 

 Yes, with the setting Convert Multi-Channel AAC set to OFF it will let the Roku natively handle the AAC. The Roku will natively downsample all AAC 5.1 to AAC 2.0 (at least in the present firmware, maybe this will change in the future.. who knows). To prevent this native behavior we can tell the server to transcode this to AC3 in 5.1 when set to ON. This does preserve the surround but does come at the cost of transcoding the audio stream. You are correct.

 

Any other questions feel free to ask.

Edited by speechles
  • Like 1
Link to comment
Share on other sites

AmericanCrisis

For maximum compatibility you need to include both a stereo and a surround track (AAC 2.0 and AC3 5.1). This way you can choose your own audio in the app via the OSD in the video player. All newer Roku models support secondary audio with direct play.

 

 

 Yes, with the setting Convert Multi-Channel AAC set to OFF it will let the Roku natively handle the AAC. The Roku will natively downsample all AAC 5.1 to AAC 2.0 (at least in the present firmware, maybe this will change in the future.. who knows). To prevent this native behavior we can tell the server to transcode this to AC3 in 5.1 when set to ON. This does preserve the surround but does come at the cost of transcoding the audio stream. You are correct.

 

Any other questions feel free to ask.

 

Ok great... I'll incorporate that into my workflow. What bitrate is recommended for the two? I found this on ffmpeg's website:

 

These settings target a specific bit rate, with less variation between samples. It gives you greater control over file size, and it is compatible with the HE-AAC profile. As a rule of thumb, for audible transparency, use 64 kBit/s for each channel (so 128 kBit/s for stereo, 384 kBit/s for 5.1 surround sound).

 

https://trac.ffmpeg.org/wiki/Encode/AAC

Edited by AmericanCrisis
Link to comment
Share on other sites

Ok great... I'll incorporate that into my workflow. What bitrate is recommended for the two? I found this on ffmpeg's website:

 

These settings target a specific bit rate, with less variation between samples. It gives you greater control over file size, and it is compatible with the HE-AAC profile. As a rule of thumb, for audible transparency, use 64 kBit/s for each channel (so 128 kBit/s for stereo, 384 kBit/s for 5.1 surround sound).

 

https://trac.ffmpeg.org/wiki/Encode/AAC

 

Disregard anything you read there. They are old documents they base off old firmware verisons.

 

For 5.1 you can go up to 640Kb/sec in AC3 (768 in DTS). It will be normalized at 384kbps if it has to be transcoded to. It will not transcode your AAC 5.1 to AC3 5.1 at 640Kbps. But your AC3 5.1 at 640Kbps can direct play/direct stream. With AAC/AC3/DTS/ETC the limit is what the codec supports not what Roku documentation says anymore. Go with the recommended settings normally used for these codecs without care they are done on a Roku. We do not restrict playback based on bitrate of your audio so you are safe there.

Edited by speechles
Link to comment
Share on other sites

AmericanCrisis

Disregard anything you read there. They are old documents they base off old firmware verisons.

 

For 5.1 you can go up to 640Kb/sec in AC3 (768 in DTS). It will be normalized at 384kbps if it has to be transcoded to. It will not transcode your AAC 5.1 to AC3 5.1 at 640Kbps. But your AC3 5.1 at 640Kbps can direct play/direct stream. With AAC/AC3/DTS/ETC the limit is what the codec supports not what Roku documentation says anymore. Go with the recommended settings normally used for these codecs without care they are done on a Roku. We do not restrict playback based on bitrate of your audio so you are safe there.

 

Ok thank you. I think I'll adjust my audio re-encoding to be AC3 5.1 @ 384kbps and another AAC 2.0 @ 128kbps. That'll be decent for the streaming client (a lot higher than Netflix IIRC).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...