PDA

View Full Version : Roku (again)



hsbrown2
02-21-2021, 09:02 PM
I’ve been playing around with the Roku device profiles a bit, and have had some decent results reducing transcoding and getting Mezzmo to send various devices media they support. Newer Roku devices support Dolby, DTS, etc... up to six channels (5.1) some support Atmos although I can’t get more than 5.1 to stream so far, and they support .MKV (finally), and so on...

The trouble I’m having is testing changes to the device profiles. It seems like when I make changes, stop Mezzmo, and exit the Mezzmo app on the Roku, more often than not it doesn’t take the new setting. Especially if I revert a setting. It drives me batty because I can’t seem to get results I can be confident in every time when I change something.

Is there a cache I should clear somewhere, or something? Transcoding to Roku is almost invariably problematic. I get that for the most part they’re designed to be web streamers, but a lot of that web content makes them fairly compelling, since it’s not available for Android TV (Nvidia Shield). Any pointers or tutorials on device profiles would be great, also any information on if there is some means to query a device for its capabilities would be huge.

hsbrown2
02-22-2021, 06:59 AM
I just thought I'd add some more to this. For newer Roku OSes, the table "Audio fields" list supported audio formats (https://developer.roku.com/docs/references/scenegraph/media-playback-nodes/video.md).

There are a lot of tables on this page (https://developer.roku.com/docs/developer-program/getting-started/architecture/content-metadata.md#descriptive-attributes), but in the table "Playback configuration attributes" under "Stream format", it seems to list supported video formats. In the same table, under "Subtitle URL", it shows what seem to be supported external subtitle formats *SRT and TTML, but another page also shows WebVTT, which is all I see in the device profiles). There's a page here with details on closed captioning, which says closed captions and subtitles are different, but in Mezzmo I don;t think they really are (https://developer.roku.com/docs/developer-program/media-playback/closed-caption.md).

Here has the table of what looks like supported video in the table "Trickplay fields" and "videoFormat". There's also a table "Closed caption fields" that might be of value.

There are things I don't get about the device profiles, but some things I've found...

Essentially I copied in this section of xml from the Kodi profile into the Matroska <avcontainer> in the Roku MKV profile:

<format id="ac3" encode="1" codec="ac3" preferredtranscoded="1">
<channels>2</channels>
<channels>6</channels>
<maxbitrate>448000</maxbitrate>
<bitrate>448000</bitrate>
<maxsamplingrate>48000</maxsamplingrate>
<minsamplingrate>11025</minsamplingrate>
<samplingrate>48000</samplingrate>
<samplingrate>44100</samplingrate>
<samplingrate>32000</samplingrate>
</format>

And Mezzmo stopped transcoding Dolby Digital to my Roku, and it played without a problem. But I'm getting out of my element here - what about other formats? What about Dolby Atmos? For DTS, can I control what flavors of DTS are transcoded and which are not?

Things get even more unstable on Roku when there are forced subtitles that are external. It seems that by default it tries to burn them in, but I *think* it pre-transcodes the whole file before it will start to play, and if you navigate off the video, it just leaves a partially transcoded stub file with a GUID in the transcoded file folder, and just plays until that ends until you delete the files, and force it to transcode anew.

It seems like getting Roku going well would be valuable, as these things are becoming ubiquitous in the United States. I know you guys are in Oz, but if there is anything I can do to help get this working perfectly on Roku, I'm willing to invest any time I can. I don't think I can ship one to you folks to play with but let me know what would be helpful.

hsbrown2
02-22-2021, 07:04 AM
This link should have everything you might need to create a solid device profile:

https://developer.roku.com/docs/specs/media/streaming-specifications.md

Peter
02-22-2021, 10:04 AM
When you make a change to the device profile you need to stop your Mezzmo Media server and start it again so that the new profile changes are loaded. We have the Roku 4k profile in the current version of Mezzmo which supports h265, dts and matroska. The problem with Roku devices is that it is difficult to determine the model from the Mezzmo server and each Roku supports different formats depending upon the age of the device. For newer Roku devices you should use the 4k profile.

hsbrown2
02-23-2021, 04:29 AM
So, the 4k profile still runs into some issues, like supported subtitle formats. And I don’t see VP8 in there, but maybe VP9 encapsulates that as well. I’d ask for at least a review of the info on the developer page I linked to, and I’m happy to test. Also, there are middle of the road support for streaming sticks too, where DTS and Dolby are partially supported, etc... but the first order of business IMO would be to get the subtitle support going. It looks like webvtt is all the profile shows as supported, but srt and one I’ve never seen before are also supported. SRT is low hanging fruit because they can be extracted on the fly. PGS is a manual process, but can still be pulled to SRT. But I’m not clear on whether or not those will work without transcoding and burning them in unless the profile shows the support.

Peter
02-23-2021, 09:14 AM
We had a look at the developer page and it looks like most of the formats are covered in the 4k profile. Files encoded in VP8 are not very common, usually VP8 or VP9 is used as a format for transcoding rather than a native format to support. We have only been able to get WebVTT subtitles to work. Mezzmo transcodes other text based subtitle formats to webVTT on the fly so any SRT files will be transcoded to webVTT seamlessly.

hsbrown2
02-23-2021, 10:35 AM
So the goal I’m trying to achieve is to minimize transcoding. Almost invariably, but especially when there’s an unsupported audio format or something and an unsupported subtitle stream, the Roku bombs a lot, especially 1080p content. I’m using NVENC so I know it can transcode smoothly.

I added “srt,” in front of the wbvtt entry, and disabled transcoding on the test stick device, and it’s playing perfectly. But transcoding may still be necessary. Dolby Digital Plus (e-ac3) doesn’t seem to be in the MKV profile (the stick does not support 4k), and I’ll need to add the DTS flag in the container to pass it through, but I think both of those may need filtering of some kind configured in the device profile to work in all cases it should work. I didn’t note if it was in the 4k profile, but it should support Atmos as well...

I guess I’m more or less on my own here, but the Roku experience is really bad whenever transcoding is enabled, although I don’t think it is a Mezzmo issue, maybe the Roku times out. It seems especially problematic at the beginning of transcoding. I have to attempt to play the stream several time (3-6) before the video begins playing.

hsbrown2
02-23-2021, 10:41 AM
Oh and just to add a bit to this, the biggest issue transcoding subtitles are foreign language forced subtitles - I don’t know about others, but it seems as though Mezzmo must/does pre-transcode the entire file before it plays, but it tends to bomb as the Roku seems to not keep alive (or something) and the video just sits in a “Queued” state forever.

Peter
02-23-2021, 11:11 AM
Transcoding text subtitle files is a very light process, it is taking a text file and adding tags for the webVTT format so CPU load should be almost non-existent. In the case of transcoding subtitles the video file content is not touched, this is different to burning subtitles. The 4k profile uses hls as the default transcoding format the same as the Roku Streaming Player profile, this allows seeking to any point in the file without requiring the whole file to be transcoded first but the drawback is that it can be slow to start playing especially on higher resolution files. The entire file is not transcoded in this case but Mezzmo does wait for several segments of the file to be available before streaming. We also have the Roku Streaming Player (Mkv) profile which uses Matroska as the default transcoding format and not hls but the downside of this is that seeking is not available when transcoding on the fly.

hsbrown2
02-23-2021, 01:50 PM
It looks like mpeg2 is supported on Roku at this time, with Roku firmware 9 or later (not discoverable on their dev site, it seems). Some MKVs have this in the container. I can disable transcoding and force it to send mpeg2, but I get a narrow green stripe on the right-hand side of the screen, any ideas?

Honestly, I'm not sure what the problem is, all I can really say for sure is that with certain content (and I can't find rhyme or reason why other than subtitles seem to cause the problem every time) the Roku seems to freeze waiting for the content, and things never start playing, and Mezzmo stops transcoding and leaves the transcode job as queued - although I've now enabled finish in the background, so maybe that will make it complete and eventually be watchable (since the choices are either external subtitles in webvtt or burn in). I just bought the 4k Roku, and I have a Roku TV (not 4k) and a streaming stick (also not 4k), and the two older ones have a lot of issues. I've been able to reduce the transcoding by adding the support for Dolby Digital and DTS, to the RokuStreamingPlayer.prf so maybe that's all that's needed. This profile might need an update, as these audio formats are supported on any Roku firmware version 8 or higher, and both the stick and the TV can convert to stereo if need be.

Peter
02-23-2021, 03:55 PM
We have tried adding mpeg support but there are issues with mpeg on the Roku. One of the issues was that seeking was not available when playing mpeg content.

hsbrown2
03-01-2021, 04:00 AM
More Roku stuff...

If I have a video with Dolby Digital EX Mezzmo seems to transcode, but if I turn off transcoding, the video plays just fine. At least I *suspect* it is due to the Dolby Digital EX, as that is the only variable that seems to be different. What seems unusual to me as well is that the video has 2 audio tracks, and getting the ffmpeg info from Mezzmo looks like it reports them both as 5.1 (I believe DDEX is 6.1?).

Stream #0:1(eng): Audio: truehd, 48000 Hz, 5.1(side), s32 (24 bit) (default)
Metadata:
title : Surround 5.1
BPS-eng : 3325274
DURATION-eng : 00:56:06.405000000
NUMBER_OF_FRAMES-eng: 4039686
NUMBER_OF_BYTES-eng: 1399277692
SOURCE_ID-eng : 001100
_STATISTICS_WRITING_APP-eng: MakeMKV v1.15.4 win(x64-release)
_STATISTICS_WRITING_DATE_UTC-eng: 2021-02-25 03:17:42
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
Stream #0:2(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 640 kb/s
Metadata:
title : Surround 5.1
BPS-eng : 640000
DURATION-eng : 00:56:06.432000000
NUMBER_OF_FRAMES-eng: 105201
NUMBER_OF_BYTES-eng: 269314560
SOURCE_ID-eng : 001100
_STATISTICS_WRITING_APP-eng: MakeMKV v1.15.4 win(x64-release)
_STATISTICS_WRITING_DATE_UTC-eng: 2021-02-25 03:17:42
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID

The Roku (or the Mezzmo app on the Roku?) seems to be aware that the TrueHD (set to preferred audio stream, if the matters) and EX exist, but I'm guessing it can't handle TrueHD and selects the EX audio, playing it just fine - but again, if I enable transcoding to the device, it just automatically starts transcoding. Any ideas?

Peter
03-01-2021, 09:34 AM
When comparing the file to the device profile Mezzmo will use the first audio track so the file does not match and will be transcoded. You can change this in the properties of the file by selecting the second audio track on the Video tab and Mezzmo will use this to compare to the device profile. The Roku may not be able to play the first audio track so it selects the second one.

hsbrown2
03-01-2021, 09:59 AM
If the preferred audio track is unsupported, Mezzmo will always transcode that track if transcoding is on, even if the second (or other tracks) *are* supported? I would sort of expect the behavior to first see if any audio tracks are supported without transcoding, and then transcode as a last resort. Is that behavior configurable at all? It wouldn't be terrible, but it seems like Mezzmo transcodes to stereo, at least with the Roku, not AC3 (which is fully supported).

What about E-AC3 (Dolby Digital Plus)? The Roku seems to handle it fine, and ffmpeg handles it differently than AC3, but I don't see any specific settings in any device profiles for it. Experimentally I added it to a movie (mkvextract-->ffmpeg-->mkvmerge), and it seems to downmix to stereo just fine on the Roku side - but I'm not sure how Mezzmo handles it on the back end, and whether or not it will send it to all Roku devices without transcoding.

I know this may be a Roku thing, but even when transcoding is disabled, I can't select any other audio tracks in the app even though I know they are supported, and I suspect the same may be true for external subtitles (although I haven't tested that yet). Is this something I am missing?

Cheers!

Peter
03-01-2021, 02:15 PM
Mezzmo cannot get feedback from the device as to whether a file is supported so it is not possible to try playing the file with multiple audio tracks then transcode if it does not play. For the Roku AC3 is not supported in mpegts which is the default transcoding format so the audio is always transcoded to stereo.

For E-AC3, Mezzmo will read the codec name from the ffmpeg information and check if it matches the supported codecs for that container in the profile. You can edit the profile to add eac3 if that is the codec name reported by ffmpeg.

I think selecting other audio tracks only works if they are the same codec type. I have tested selecting audio tracks in the past with multiple stereo audio tracks. External subtitles will not allow selecting other tracks while the video is playing because Mezzmo only lists one external subtitle track.

hsbrown2
03-06-2021, 02:11 PM
"Mezzmo cannot get feedback from the device as to whether a file is supported so it is not possible to try playing the file with multiple audio tracks then transcode if it does not play. For the Roku AC3 is not supported in mpegts which is the default transcoding format so the audio is always transcoded to stereo."

Got it. I'm slowly coming to the conclusion that the Roku isn't *really* designed for personal media collections, as much as it is designed to be an aggregate device for a plethora of online streaming services. While this could be a slippery slope with customers whose private collections contain director commentary tracks (which seem to most often be ac3), although Mezzmo can't get feedback from the device I would think it might be possible/plausible to evaluate the device profile and the available audio tracks, and if one is supported, play that, and avoid transcoding if one of the available tracks is supported (unless of course it is required for other reasons). Although this may be pointless, largely. Transcoding is fine - unless it's transcoding DTS down to stereo, which seems to cause all sort of problems for me.

"For E-AC3, Mezzmo will read the codec name from the ffmpeg information and check if it matches the supported codecs for that container in the profile. You can edit the profile to add eac3 if that is the codec name reported by ffmpeg."

OK, that makes sense. It does show as eac3, but I'm unsure if setting the default (preferred) track to the eac3 audio will stop it from transcoding. It doesn't have (what i would call) a dictionary reference, i.e. eac3 doesn't translate to "Dolby Digital Plus" when I look at the properties of the audio track in Mezzmo, so I wasn't sure is adding a format container for it would do anything.

"I think selecting other audio tracks only works if they are the same codec type. I have tested selecting audio tracks in the past with multiple stereo audio tracks. External subtitles will not allow selecting other tracks while the video is playing because Mezzmo only lists one external subtitle track."

Understood. This a small pain, though. If there are "forced" subtitles, and closed captioning style subtitles, both external, you can't have a choice of either/or. I'm not sure I'm down with burning in forced subs. Do you folks have a recommendation?

ftanner
03-07-2021, 03:29 AM
Mezzmo cannot get feedback from the device as to whether a file is supported so it is not possible to try playing the file with multiple audio tracks then transcode if it does not play. For the Roku AC3 is not supported in mpegts which is the default transcoding format so the audio is always transcoded to stereo.

For E-AC3, Mezzmo will read the codec name from the ffmpeg information and check if it matches the supported codecs for that container in the profile. You can edit the profile to add eac3 if that is the codec name reported by ffmpeg.

I think selecting other audio tracks only works if they are the same codec type. I have tested selecting audio tracks in the past with multiple stereo audio tracks. External subtitles will not allow selecting other tracks while the video is playing because Mezzmo only lists one external subtitle track.

As someone who is switching devices, over time, from Roku to nVidia Shield, does Mezzmo get feedback from those devices?

Peter
03-09-2021, 09:43 AM
No, unfortunately there is no feedback from any device as to the supported formats and whether a file will play or not. Early DLNA specifications provided a mimetype list from devices but this was very general and did not specify codecs, bitrates and resolutions.

ftanner
03-15-2021, 03:53 AM
No, unfortunately there is no feedback from any device as to the supported formats and whether a file will play or not. Early DLNA specifications provided a mimetype list from devices but this was very general and did not specify codecs, bitrates and resolutions.

Sounds like it's time for an update to the DLNA spec.