New Roku Profiles

Issue #994 resolved
Dan created an issue

I am building multiple profiles to better match the capabilities of various models of Roku media players. Some support MPEG2 video while others don't. Newer boxes can handle high bitrate streaming, while older boxes are restricted to about 16 Mbps. Some support H.265, while all support H.264.

How large of a file can I attach here? I need assistance with certain HD files and want to provide a sample.

Comments (15)

  1. Dan reporter

    I tried attaching a file, but I don't see it. a one minute clip is 172MB, so maybe it wouldn't fit. It didn't give me an error though.

  2. Dan reporter

    OK, made it with a 10 second clip. This one has VC-1 video and TrueHD audio. When attempting to use applehttp, it loads and plays for about 5 seconds (it just begins playing the MGM lion roar), and then stops as if buffering but never continues. You can use the Chaneru profile for applehttp transcoding. This was on a Roku Stick, as well as a Roku TV. Using mpeg-ts, it will play for a while (much longer than this clip), and then stop with an unplayable error. On the Roku, all playback is using the Roku Media Player.

    Another group of videos (the Star Wars collection, h264 video and DTS-MA audio) applehttp will not even begin. FFMPEG loads then immediately stops with an error in the log (noted in the forum post). Using mpeg-ts it loads and begins to play. Depending on the bitrate I assign to the ac3 transcoding, it will play anywhere from 2 to 20 minutes. 640 Kbps seemed to be the best, but it still crashed. Either RMP reported an unplayable file, or the Roku itself crashed and rebooted. The videos are of course playable on other devices with no problem. My Sony BD player handles without transcoding, while the Samsung 4K TV requires the audio transcoded.

  3. Petr Nejedly repo owner

    would be good to have the star wars clip too. I can look at the immediate failure bug, not sure if I'll be able to do anything about the one that fails to play after a while (I assume ffmpeg doesn't crash for that one)

  4. Dan reporter

    Yes, Star Wars will begin to play. The profile I was using at first did not transcode video at all, only audio. It would quit playback (either error message or force the Roku to reboot) at 2% playback reliably. Usually just finish the opening crawl. By transcoding the video (using an extremely high max bitrate, so it wasn't working too hard), it would play from 15-20 minutes. But it still either errored out or crashed the player.

    This is the most recent profile I was using. Note that I have applehttp commented out, and have a maxVbitrate set at 36000. The vbitrate doesn't seem to make a difference.

    <Profile id="RokuTV" name="Roku TV (non 4K)" extendsProfileId="RokuMPApp"> <Detection> <UPnPSearch> </UPnPSearch> <HttpHeaders> <User-Agent>.Roku/5000X.</User-Agent> </HttpHeaders> </Detection> <MediaFormatProfiles> <MediaFormatProfile mime-type="video/mp4">AVC_MP4_MP_SD_AAC_MULT5</MediaFormatProfile> <MediaFormatProfile mime-type="video/mp4">AVC_MP4_MP_SD_MPEG1_L3</MediaFormatProfile> <MediaFormatProfile mime-type="video/mp4">AVC_MP4_MP_SD_AC3</MediaFormatProfile> <MediaFormatProfile mime-type="video/mp4">AVC_MP4_MP_HD_720p_AAC</MediaFormatProfile> <MediaFormatProfile mime-type="video/mp4">AVC_MP4_MP_HD_1080i_AAC</MediaFormatProfile> <MediaFormatProfile mime-type="video/mp4">AVC_MP4_HP_HD_AAC</MediaFormatProfile> <MediaFormatProfile mime-type="video/mp4">AVC_MP4_LPCM</MediaFormatProfile> <MediaFormatProfile mime-type="video/mp4">MPEG4_P2_MP4_ASP_AAC</MediaFormatProfile> <MediaFormatProfile mime-type="video/mp4">MPEG4_P2_MP4_SP_L6_AAC</MediaFormatProfile> <MediaFormatProfile mime-type="video/mp4">MPEG4_P2_MP4_NDSD</MediaFormatProfile> <MediaFormatProfile mime-type="audio/mpeg">MP3</MediaFormatProfile> </MediaFormatProfiles> <Transcoding> <!-- Remux video stream, transcode audio only --> <Video targetContainer="mpegts" targetVCodec="h264" maxVBitrate="36000" targetACodec="ac3" aBitrate="640" > <!--<Video targetContainer="applehttp" targetVCodec="h264" maxVBitrate="36000" targetACodec="aac" > --> <Matches container="" vCodec="h264" aCodec="truehd" /> <Matches container="" vCodec="h264" aCodec="dts-hd" /> <Matches container="" vCodec="vc1" /> <Matches container="" vCodec="h265"/> </Video> <!-- Transcode non-H.264 video or FLAC audio --> <Video targetContainer="mpegts" targetVCodec="h264" targetACodec="ac3" > <Matches container="" vCodec="wmv2"/> <Matches container="" aCodec="flac"/> <Matches container="avi" vCodec="mpeg1video"/> <!-- <Matches container="*" vCodec="h264" levelGreaterThan="4.1" /> --> </Video> <!-- transmux non-supported containers wtih MPEG2 or MP4 video and AC3 audio, which are supported by the Roku TV --> <Video targetContainer="mpegts" > <Matches container="wtv"/> <Matches container="avi" /> <Matches container="mpegvideo"/> <Matches container="mpeg"/> <!-- <Matches container="mpegts"/> --> </Video>

            <!--<Audio targetContainer="mp3">
                <Matches container="*" />
            </Audio> -->
        </Transcoding>
        <OnlineTranscoding>
            <Video targetContainer="mpegts"> <!-- dont transcode to ac3 -->
                <!--<Matches container="mp4" /> -->
                <Matches container="flv" vCodec="h264" />
                <Matches container="applehttp" vCodec="h264" />
            </Video>
        </OnlineTranscoding>
        <GenericTranscoding>
            <Video targetContainer="applehttp" targetVCodec="h264" targetACodec="ac3"/>
        </GenericTranscoding>
        <LimitImageResolution>false</LimitImageResolution>
    </Profile>
    
  5. Dan reporter

    One more thing to note. Using the same profile posted above for testing, I played Logan's Run on a Roku 4. This is a powerful 4K capable player. It also played for about 30-40 minutes (I wasn't watching it, just letting it run) before playback stopped with an unplayable error. I was hoping that it might have been hardware specific, but it seems that there's something about the way these files are being transcoded that the Roku doesn't like. If we can get applehttp to work, that might be the solution needed.

  6. Dan reporter

    Petr, one more thing. I believe it is absolutely related to the HD audio. I have another m2ts file with 1080 h264 video, but only ac3 audio. It is playing perfectly with no transcoding or audio or video.

    EDIT: I remuxed a file with TrueHD as the primary audio track, and made it #2, with the AC3 track as primary. It is playing perfectly without any transcoding. So the bottom line issue is when converting HD audio to standard AC3. So, is it an issue with ffmpeg, or is there a tweak we can do to the transcoding command line that can resolve it?

  7. Dan reporter

    Petr, I believe the solution will be transcoding to HLS. I am currently having issues with every HD video I have, even some that don't have HD audio. But as I mentioned on my forum past, Serviio is not building an ffmpeg command that works with applehttp. No idea what's going on. I thought I posted the ffmpeg command line that Serviio was using for applehttp, but can't find it, so I'll try it again and post the command line here.

  8. Dan reporter

    OK, here's the problem when trying to use hls. Here's the line from the debug log:

    Cannot get media info for transcoded file "Star Wars (1977).m2ts": AppleHttp video file Star Wars (1977).m2ts does not match any supported DLNA profile

    This is the transcoding line from the profile:

    <Video targetContainer="applehttp" targetVCodec="h264" targetACodec="ac3" aBitrate="512">

    I tried using both extendsProfileId="1" and extendsProfileId="RokuMPApp", but both give the same response.

    Here's what happens with using the Chaneru profile (also uses hls):

    DEBUG [ProcessExecutor] Starting C:\Program Files\Serviio\bin\..\lib\ffmpeg.exe -fflags +genpts -threads 0 -i C:\Users\Public\Videos\Star Wars (1977).m2ts -y -c:v copy -c🅰0 aac -b🅰0 192k -map 0:0 -map 0:1 -sn -f hls -hls_time 10 -hls_allow_cache 0 -hls_segment_filename C:\Windows\TEMP\Serviio\transcoding-temp-6c6586e8967d28416efc9948e6f9979a.stf\segment%05d.ts -hls_list_size 0 C:\Windows\TEMP\Serviio\transcoding-temp-6c6586e8967d28416efc9948e6f9979a.stf\playlist.m3u8 2017-02-03 07:27:33,209 WARN [ProcessExecutor] Process cmd has a return code of 1! This is a possible error. Detailed output follows. [aac @ 000000000301db80] Unsupported number of channels: 7

    Never noticed the unsupported channel number before. How do I get around that? I'm wondering if this is the key to all of it.

  9. Dan reporter

    Attached are the new Roku profiles. I did tweak them slightly from what I emailed you, so please use these. At this time, I did not use HLS as the transcoding method do to the lack of multichannel audio support. Once (if) you add that support to HLS transcoding, I will likely alter these so that trick play will function on the Roku players.

  10. Petr Nejedly repo owner

    These profiles extend from RokuMPApp but I don't have that one.

    Also, is it on purpose that the detection blocks are empty? Or ca I remove them?

  11. Dan reporter

    RokuMPApp is the name of the existing Roku profile. Notepad++ tells me the line is 2484, immediately after the Chaneru profile.

    Detection blocks are empty because at this time the Roku player doesn't identify itself with a model number, only "Roku Media Player". Roku Dale is considering exposing the model number. I suppose you could delete them for now, and we can add them in once (if) Roku broadcasts the proper player names. Although there's so many different versions of Roku player it might be too difficult to correctly identify them. I'm unfamiliar with exactly how detection might work. I know it accepts wildcards, but does it permit adding more than one detection line (i.e. can it identify more than one model number that might differ completely from the first one)?

  12. Log in to comment