FAQ  •  Register  •  Login

Roku Transcoding

<<

atc98092

User avatar

DLNA master

Posts: 5436

Joined: Fri Aug 17, 2012 10:22 pm

Location: Washington (the state)

Post Fri May 23, 2014 10:22 pm

Roku Transcoding

I'm trying to fine tune the Roku Media Player profile. Since the RMP will support Dolby Digital and DTS within MKV containers without transcoding, I wanted to try something. I added this Video section as the very first one in the Transcoding section. I want my Blu-Ray rips with HD audio as the first audio track to get their audio transcoded to AC-3.
  Code:
<Video targetContainer="mpegts" targetVCodec="h264" maxVBitrate="12000" targetACodec="ac3">
            <Matches container="matroska" aCodec="dts-hd" />
            <Matches container="matroska" aCodec="truehd" />
         </Video>


I then changed the MKV line in the next section to:
  Code:
<Video targetContainer="mpegts" targetVCodec="h264"> <!-- maxVBitrate="12000" targetACodec="ac3"> -->
...
<Matches container="matroska" vCodec="mpeg2video" />
...


You can see I took out the maxVBitrate and target ACodec.

Now, what I am expecting is that a DVD rip with MPEG video (almost all of them) will get the video transcoded to MPEG-TS, while the AC-3 or DTS audio passes through. If I have a BD rip, it will also transcode the video to -TS, but only passthrough the audio if it is not an HD stream. However, the DVD portion seems to work fine but my BD rips have no sound. :? Am I putting the sections in the incorrect order, of am I missing something else? :(
Dan

LG NANO85 4K TV, Samsung JU7100 4K TV, Sony BDP-S3500, Sharp 4K Roku TV, Insignia Roku TV, Roku Ultra, Premiere and Stick, Nvidia Shield, Yamaha RX-V583 AVR.
Primary server: AMD Ryzen 5 5600GT, 32 gig ram, Windows 11 Pro, 22 TB hard drive space | Test server: Intel i5-6400, 16 gig ram, Windows 10 Pro

HOWTO: Enable debug logging HOWTO: Identify media file contents
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Sat May 24, 2014 12:48 pm

Re: Roku Transcoding

Post ffmpeg -i of the file and detailed log of pllaying the file.
<<

atc98092

User avatar

DLNA master

Posts: 5436

Joined: Fri Aug 17, 2012 10:22 pm

Location: Washington (the state)

Post Sun May 25, 2014 7:24 pm

Re: Roku Transcoding

zip wrote:Post ffmpeg -i of the file and detailed log of pllaying the file.


Log attached. Media info also. Video will load and play, but no audio. My AV receiver shows PCM in the window as the audio, but that's what it usually shows when no stream is received. Other videos will immediately show DD or DTS as the stream loads.
Attachments
ffmpeg.txt
(5.4 KiB) Downloaded 603 times
log.zip
(30.87 KiB) Downloaded 459 times
Dan

LG NANO85 4K TV, Samsung JU7100 4K TV, Sony BDP-S3500, Sharp 4K Roku TV, Insignia Roku TV, Roku Ultra, Premiere and Stick, Nvidia Shield, Yamaha RX-V583 AVR.
Primary server: AMD Ryzen 5 5600GT, 32 gig ram, Windows 11 Pro, 22 TB hard drive space | Test server: Intel i5-6400, 16 gig ram, Windows 10 Pro

HOWTO: Enable debug logging HOWTO: Identify media file contents
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Sun May 25, 2014 8:36 pm

Re: Roku Transcoding

The ffmpeg command is right, it copies both video and audio. It might be related to this ffmpeg ticket, which should now be fixed: http://trac.ffmpeg.org/ticket/1398

So try to get the latest FFmpeg and try to play with that.
<<

atc98092

User avatar

DLNA master

Posts: 5436

Joined: Fri Aug 17, 2012 10:22 pm

Location: Washington (the state)

Post Mon May 26, 2014 1:42 am

Re: Roku Transcoding

zip wrote:The ffmpeg command is right, it copies both video and audio. It might be related to this ffmpeg ticket, which should now be fixed: http://trac.ffmpeg.org/ticket/1398

So try to get the latest FFmpeg and try to play with that.


Yep, that fixed it. Now my HD movies will stream the DTS core. I'm going to have to put the MaxBitrate back in, because the Roku can't handle more than about 12000 bps. :lol:
Dan

LG NANO85 4K TV, Samsung JU7100 4K TV, Sony BDP-S3500, Sharp 4K Roku TV, Insignia Roku TV, Roku Ultra, Premiere and Stick, Nvidia Shield, Yamaha RX-V583 AVR.
Primary server: AMD Ryzen 5 5600GT, 32 gig ram, Windows 11 Pro, 22 TB hard drive space | Test server: Intel i5-6400, 16 gig ram, Windows 10 Pro

HOWTO: Enable debug logging HOWTO: Identify media file contents
<<

atc98092

User avatar

DLNA master

Posts: 5436

Joined: Fri Aug 17, 2012 10:22 pm

Location: Washington (the state)

Post Sat May 31, 2014 11:04 pm

Re: Roku Transcoding

Still on my test server: I added the MaxBitRate back in at 12000, but still encounter some buffering. However, I think that's the PC power being too little to handle the transcoding fast enough. Also, since even though I have a number of DVD rips with DTS audio, the AC-3 track is always detected first and that's what gets passed through. So I re-ripped a DVD with only a DTS track, to make sure the Roku passes through like they claim. Yes, it does.

So, I offer a refinement to the Roku Media Player profile. This will transcode any HD video file with HD audio to Dolby Digital sound, and cap the video bit rate at 12000 kbps, about the max a Roku 2 can handle. A Roku 3 might tolerate a bit higher. Also, for MPEG-2 video (virtually all DVD rips) the default audio codec will be passed through (DD or DTS).

  Code:
<Transcoding>
         <Video targetContainer="mpegts" targetVCodec="h264" maxVBitrate="12000" targetACodec="ac3">
            <Matches container="matroska" aCodec="dts-hd" />
            <Matches container="matroska" aCodec="truehd" />
            <Matches container="matroska" aCodec="flac" />
         </Video>
         <Video targetContainer="mpegts" targetVCodec="h264" maxVBitrate="12000" >
            <Matches container="asf" />
            <Matches container="mpegvideo" />
            <Matches container="mpeg" />
            <Matches container="mpegts" />
            <Matches container="matroska" vCodec="mpeg2video" />
            <Matches container="avi" />
            <Matches container="flv" />
            <Matches container="wtv" />
            <Matches container="ogg" />
            <Matches container="3gp" />
            <Matches container="rtp" />
            <Matches container="rtsp" />
            <Matches container="rm" />
         </Video>
         <Video targetContainer="mpegts" targetACodec="ac3" aBitrate="320">
            <Matches container="matroska" aCodec="vorbis" />
            <Matches container="ogg" vCodec="mpeg4" />
            <Matches container="mp4" aCodec="lpcm" />
         </Video>
         <Video targetContainer="mpegts">
            <Matches container="matroska" vCodec="h264" />
            <Matches container="flv" vCodec="h264" />
         </Video>
         <Video targetContainer="asf" targetVCodec="wmv2" targetACodec="wmav2" maxVBitrate="15360" forceStereo="true">
            <Matches container="*" vCodec="mpeg2video" />
            <Matches container="*" vCodec="dvvideo" />
            <Matches container="wtv" />
            <Matches container="ogg" />
            <Matches container="flv" />
            <Matches container="rm" />
         </Video>
         <Audio targetContainer="mp3">
            <Matches container="*" />
         </Audio>
      </Transcoding>


Remember that this requires a newer version of FFMPEG than what is packaged with Serviio. I downloaded a new version dated April 27, 2014
Dan

LG NANO85 4K TV, Samsung JU7100 4K TV, Sony BDP-S3500, Sharp 4K Roku TV, Insignia Roku TV, Roku Ultra, Premiere and Stick, Nvidia Shield, Yamaha RX-V583 AVR.
Primary server: AMD Ryzen 5 5600GT, 32 gig ram, Windows 11 Pro, 22 TB hard drive space | Test server: Intel i5-6400, 16 gig ram, Windows 10 Pro

HOWTO: Enable debug logging HOWTO: Identify media file contents
<<

patters

User avatar

DLNA master

Posts: 1282

Joined: Sat Oct 09, 2010 3:51 pm

Location: London, UK

Post Sun Jun 22, 2014 12:38 pm

Re: Roku Transcoding

I've been looking through this profile while hacking in support for hardware encoding for Synology DS214Play. There's lots of matching further down the profile that will never get used. I've read up about the Roku format support and I think this would be a better approximation. I've commented so you can see the design intent:
  Code:
      <Transcoding>
         <!-- Transcode if H.264 level is too high -->
         <Video targetContainer="mpegts" targetVCodec="h264" maxVBitrate="12000" forceVTranscoding="true" targetACodec="ac3" aBitrate="320">
         <!-- for no surround passthrough <Video targetContainer="mpegts" targetVCodec="h264" maxVBitrate="12000" forceVTranscoding="true" targetACodec="aac" aBitrate="128" forceStereo="true"> -->
            <Matches container="*" vCodec="h264" profile="high_10" />
            <Matches container="*" vCodec="h264" profile="high" levelGreaterThan="4.1" />
            <Matches container="*" vCodec="h264" profile="main" levelGreaterThan="4.1" />
         </Video>      
         <!-- Remux audio and video streams - for DivX/Xvid in AVI/Matroska -->
         <Video targetContainer="mpegts">
            <Matches container="*" vCodec="mpeg4" aCodec="aac" />
            <Matches container="*" vCodec="msmpeg4" aCodec="aac" />
            <!-- for no surround passthrough comment out the following two lines -->
            <Matches container="*" vCodec="mpeg4" aCodec="ac3" />
            <Matches container="*" vCodec="msmpeg4" aCodec="ac3" />
         </Video>      
         <!-- Remux video stream, transcode audio only - for DivX/Xvid in AVI/Matroska -->
         <Video targetContainer="mpegts" targetACodec="aac" aBitrate="128">
            <Matches container="*" vCodec="mpeg4" aCodec="mp3" />
            <Matches container="*" vCodec="msmpeg4" aCodec="mp3" />
            <!-- for no surround passthrough uncomment the following two lines -->
            <!-- <Matches container="*" vCodec="mpeg4" aCodec="ac3" /> -->
            <!-- <Matches container="*" vCodec="msmpeg4" aCodec="ac3" /> -->
         </Video>      
         <!-- Remux supported audio, transcode H.264 video if bitrate is too high, transcode non-H.264 video -->
         <Video targetContainer="mpegts" targetVCodec="h264" maxVBitrate="12000">
            <!-- for no surround passthrough comment out the following four lines -->
            <Matches container="*" vCodec="h264" aCodec="ac3" />
            <Matches container="*" vCodec="h264" aCodec="dca" />
            <Matches container="*" vCodec="mpeg2video" aCodec="ac3" />
            <Matches container="*" vCodec="mpeg2video" aCodec="dca" />
            <!-- comment the following line if you have files with 5.1ch AAC, Roku only supports 2 channel AAC -->
            <Matches container="*" vCodec="h264" aCodec="aac" />
         </Video>
         <!-- Transcode all audio, transcode H.264 video if bitrate is too high, transcode all other video -->
         <Video targetContainer="mpegts" targetVCodec="h264" maxVBitrate="12000" targetACodec="ac3" aBitrate="320">
         <!-- for no surround passthrough <Video targetContainer="mpegts" targetVCodec="h264" maxVBitrate="12000" targetACodec="aac" aBitrate="128" forceStereo="true"> -->
            <Matches container="*" />
         </Video>
         <Audio targetContainer="mp3">
            <Matches container="*" />
         </Audio>
      </Transcoding>


Can someone try it out? Surround sound passthrough is assumed, but you can comment this out and force two channel AAC only if you're using an old TV for instance. I'm particularly interested whether AVI files will play like this. I found this guide which suggested that they only needed video remuxing. However, that was assuming MP4 container, not mpegts.
LG OLED55B8PLA | PS4 Pro | Xbox One S | Synology DS214play
Serviio 2.1 package for Synology NAS - with limited hardware transcoding support!
<<

atc98092

User avatar

DLNA master

Posts: 5436

Joined: Fri Aug 17, 2012 10:22 pm

Location: Washington (the state)

Post Sun Jun 22, 2014 11:34 pm

Re: Roku Transcoding

Patters:

I'll be happy to play with it, but it will be a little bit. I have to fly out tomorrow morning to DC and won't be back until Friday. Then Sat/Sun I play sound engineer at my church, so it will likely be at least a week before I get the time.

I appreciate the effort you've made. I have no doubt there's a bunch of unnecessary coding in there, but since everything I have on my server, as well as online sources, play perfectly I wasn't going to give it much thought. I'm still a little green at figuring out everything that goes into a transcoding profile, but I'll get the hang of it! :lol:
Dan

LG NANO85 4K TV, Samsung JU7100 4K TV, Sony BDP-S3500, Sharp 4K Roku TV, Insignia Roku TV, Roku Ultra, Premiere and Stick, Nvidia Shield, Yamaha RX-V583 AVR.
Primary server: AMD Ryzen 5 5600GT, 32 gig ram, Windows 11 Pro, 22 TB hard drive space | Test server: Intel i5-6400, 16 gig ram, Windows 10 Pro

HOWTO: Enable debug logging HOWTO: Identify media file contents
<<

atc98092

User avatar

DLNA master

Posts: 5436

Joined: Fri Aug 17, 2012 10:22 pm

Location: Washington (the state)

Post Sat Jun 28, 2014 12:43 am

Re: Roku Transcoding

OK, copied your code onto my test server. Everything plays, but here's a couple of notes. I didn't leave any running for more than a few minutes, so I could test various containers. Buffering may be related to insufficient CPU on my test server

MKV Containers:
Blu-Ray rip, DD TrueHD: plays with AC-3 audio out, some videos had no buffering, but some did.
Blu-Ray rip, DTS Master Audio: plays with DTS standard audio, didn't notice any buffering.
DVD rip (MPEG2 video, DD audio): no issues

AVI container, DVD rip, no issues

WMV container, DVD rip, no issues

MP4 container, DVD and BD rips, various video and audio: no issues

M2TS container, BD rip: would not finish loading.
Dan

LG NANO85 4K TV, Samsung JU7100 4K TV, Sony BDP-S3500, Sharp 4K Roku TV, Insignia Roku TV, Roku Ultra, Premiere and Stick, Nvidia Shield, Yamaha RX-V583 AVR.
Primary server: AMD Ryzen 5 5600GT, 32 gig ram, Windows 11 Pro, 22 TB hard drive space | Test server: Intel i5-6400, 16 gig ram, Windows 10 Pro

HOWTO: Enable debug logging HOWTO: Identify media file contents

Return to Transcoding

Who is online

Users browsing this forum: No registered users and 24 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.