Jump to content

Almost all titles transcode to both HTPC and Roku


pclausen

Recommended Posts

pclausen

All my Roku and HTPC clients are hardwired at 1 Gbps.

 

All clients are set to allow max bitrate (30 Mbps for Roku 3 clients and 40 Mbps for HTPC clients)

 

On the server (running 3.0.5768.7) I have the clients profiles set to 1080p-40Mbps.

 

Yet, when I play titles on the Roku 3 clients, they transcode all titles.

 

Here's an examples from a Roku 3 connected to 1080p TV (audio is stereo):

Input #0, matroska,webm, from 'file:/media/TVShows/Orange Is the New Black/Season 2/2x13 - We Have Manners. We're Polite.mkv':
encoder         : libebml v1.3.0 + libmatroska v1.4.0
Duration: 01:32:09.57, start: 0.000000, bitrate: 10183 kb/s
Stream #0:0(eng): Video: h264 (High), yuv420p, 1920x1080, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
Stream #0:1(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s (default)
[libx264 @ 0x80b13b420] using SAR=1/1
[libx264 @ 0x80b13b420] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 @ 0x80b13b420] profile High, level 4.1
Output #0, hls, to '/var/db/emby-server/transcoding-temp/da245e3843f9d25aefcc7d4c88eb6119.m3u8':
encoder         : Lavf56.36.100
Stream #0:0: Video: h264 (libx264), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 10183 kb/s, 23.98 fps, 90k tbn, 23.98 tbc (default)
encoder         : Lavc56.41.100 libx264
Stream #0:1: Audio: aac, 48000 Hz, stereo, fltp, 128 kb/s (default)
encoder         : Lavc56.41.100 aac
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (dts (dca) -> aac (native))
Here are several examples from Roku 3 connected to AVR (audio is set to DD).  AVR is in turn connected to 1080p TV
Input #0, matroska,webm, from 'file:/media/TVShows/The Good Wife/Season 1/1x05 - Crash.mkv':
encoder         : libebml v0.7.8 + libmatroska v0.8.1
Duration: 00:43:27.86, start: 0.000000, bitrate: 3597 kb/s
Stream #0:0(eng): Video: h264 (High), yuv420p, 1280x720, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 20k tbn, 47.95 tbc (default)
Stream #0:1(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s (default)
[libx264 @ 0x80b13af20] using SAR=1/1
[libx264 @ 0x80b13af20] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 @ 0x80b13af20] profile High, level 4.1
encoder         : Lavf56.36.100
Stream #0:0: Video: h264 (libx264), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 3597 kb/s, 23.98 fps, 90k tbn, 23.98 tbc (default)
encoder         : Lavc56.41.100 libx264
Stream #0:1: Audio: aac, 48000 Hz, stereo, fltp, 128 kb/s (default)
encoder         : Lavc56.41.100 aac
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (ac3 (native) -> aac (native))
 
Input #0, matroska,webm, from 'file:/media/TVShows/Lost/Season 1/1x21 - The Greater Good.mkv':
encoder         : libebml v0.7.7 + libmatroska v0.8.1
Duration: 00:43:22.60, start: 0.000000, bitrate: 25191 kb/s
Stream #0:0: Video: h264 (High), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
Stream #0:1: Audio: flac, 48000 Hz, 5.1(side), s32 (24 bit) (default)
[libx264 @ 0x80b150920] using SAR=1/1
[libx264 @ 0x80b150920] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 @ 0x80b150920] profile High, level 4.1
Output #0, hls, to '/var/db/emby-server/transcoding-temp/2de5107cb0b50176ddb9a9000effe2b5.m3u8':
encoder         : Lavf56.36.100
Stream #0:0: Video: h264 (libx264), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 25191 kb/s, 23.98 fps, 90k tbn, 23.98 tbc (default)
encoder         : Lavc56.41.100 libx264
Stream #0:1: Audio: aac, 48000 Hz, stereo, fltp (24 bit), 128 kb/s (default)
encoder         : Lavc56.41.100 aac
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (flac (native) -> aac (native))
 
Input #0, matroska,webm, from 'file:/media/TVShows/Homeland/Season 5/5x04 - Why Is This Night Different.mkv':
encoder         : libebml v1.3.3 + libmatroska v1.4.4
Duration: 00:48:47.51, start: 0.000000, bitrate: 5153 kb/s
Stream #0:0: Subtitle: subrip (default)
BPS             : 79
BPS-eng         : 79
DURATION        : 00:48:42.918000000
DURATION-eng    : 00:48:42.918000000
NUMBER_OF_FRAMES: 755
NUMBER_OF_FRAMES-eng: 755
NUMBER_OF_BYTES : 29215
NUMBER_OF_BYTES-eng: 29215
STATISTICS_WRITING_APP: mkvmerge v8.5.1 ('Where you lead I will follow') 64bit
STATISTICS_WRITING_APP-eng: mkvmerge v8.5.1 ('Where you lead I will follow') 64bit
STATISTICS_WRITING_DATE_UTC: 2015-10-25 23:37:39
STATISTICS_WRITING_DATE_UTC-eng: 2015-10-25 23:37:39
STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:1(eng): Video: h264 (High), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 2k tbc (default)
BPS             : 4767811
BPS-eng         : 4767811
DURATION        : 00:48:47.508000000
DURATION-eng    : 00:48:47.508000000
NUMBER_OF_FRAMES: 70190
NUMBER_OF_FRAMES-eng: 70190
NUMBER_OF_BYTES : 1744725668
NUMBER_OF_BYTES-eng: 1744725668
STATISTICS_WRITING_APP: mkvmerge v8.5.1 ('Where you lead I will follow') 64bit
STATISTICS_WRITING_APP-eng: mkvmerge v8.5.1 ('Where you lead I will follow') 64bit
STATISTICS_WRITING_DATE_UTC: 2015-10-25 23:37:39
STATISTICS_WRITING_DATE_UTC-eng: 2015-10-25 23:37:39
STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:2(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s (default)
BPS             : 384000
BPS-eng         : 384000
DURATION        : 00:48:47.488000000
DURATION-eng    : 00:48:47.488000000
NUMBER_OF_FRAMES: 91484
NUMBER_OF_FRAMES-eng: 91484
NUMBER_OF_BYTES : 140519424
NUMBER_OF_BYTES-eng: 140519424
STATISTICS_WRITING_APP: mkvmerge v8.5.1 ('Where you lead I will follow') 64bit
STATISTICS_WRITING_APP-eng: mkvmerge v8.5.1 ('Where you lead I will follow') 64bit
STATISTICS_WRITING_DATE_UTC: 2015-10-25 23:37:39
STATISTICS_WRITING_DATE_UTC-eng: 2015-10-25 23:37:39
STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
[libx264 @ 0x80b13c320] using SAR=1/1
[libx264 @ 0x80b13c320] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 @ 0x80b13c320] profile High, level 4.1
Output #0, hls, to '/var/db/emby-server/transcoding-temp/ebf1dcfcd0604c814436c4ef532313ce.m3u8':
encoder         : Lavf56.36.100
Stream #0:0: Video: h264 (libx264), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 5153 kb/s, 23.98 fps, 90k tbn, 23.98 tbc (default)
encoder         : Lavc56.41.100 libx264
Stream #0:1: Audio: aac, 48000 Hz, stereo, fltp, 128 kb/s (default)
encoder         : Lavc56.41.100 aac
Stream #0:1 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:2 -> #0:1 (ac3 (native) -> aac (native))
 
And finally, here's a HTPC connected to AVR (audio is 7.1) and AVR is connected to 4k TV.
Input #0, matroska,webm, from 'file:/media/Blu-Ray/3 Days to Kill (2014)/3 Days to Kill.mkv':
encoder         : libebml v0.7.9 + libmatroska v0.8.1
Duration: 01:57:40.05, start: 0.000000, bitrate: 14989 kb/s
Stream #0:0: Video: h264 (High), yuv420p, 1920x808, SAR 1:1 DAR 240:101, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
Stream #0:1(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s (default)
Stream #0:2(dut): Subtitle: subrip (default)
Stream #0:3(eng): Subtitle: subrip
[libx264 @ 0x80b15de20] using SAR=1/1
[libx264 @ 0x80b15de20] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 @ 0x80b15de20] profile High, level 4.1
encoder         : Lavf56.36.100
Stream #0:0: Video: h264 (libx264), yuv420p, 1920x808 [SAR 1:1 DAR 240:101], q=-1--1, 14989 kb/s, 23.98 fps, 90k tbn, 23.98 tbc (default)
encoder         : Lavc56.41.100 libx264
Stream #0:1: Audio: aac, 48000 Hz, stereo, fltp, 128 kb/s (default)
encoder         : Lavc56.41.100 aac
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (dts (dca) -> aac (native))
 
I have the following path substitutions defined on the server:
 
pathsubstitutions.PNG
 
My server is pretty beefy (FreeNAS with Emby plugin) with the following specs:
 
SuperMicro X10SRL-F | Xeon E5-1620 3.5GHz | Samsung 4x 16GB DDR4 ECC 2133 [M393A2G40DB0-COB]
2x LSI SAS9200-e8 | 1x LSI SAS9211-i8 | 4x 10 2TB RAID-Z2 + 1x 10 4TB RAID-Z2 = 50 disk 120TB pool
 
But with a couple of clients playing back titles and with the server still going through some 60TB worth of material extracting chapter images (just converted to FreeNAS less than 24 hours ago), the server is getting hit hard from the overhead of all this transcoding.
 
transcode03.PNG
 
One user was skipping forward through her show (Roku 3) and it dropped her back out to the Roku 3 home screen and it took me a couple of tries to get her logged back into Emby to continue watching her show.
 
So any advice on how to prevent transcoding to prevent these types of issues when the server is busy doing other tasks would be greatly appreciated!
Edited by pclausen
Link to comment
Share on other sites

@@pclausen

 

In regards to the roku. Lets focus on this first. Have you tried emby blue neon on your roku? This is a custom themed version.

 

App: https://my.roku.com/account/add?channel=EmbyBlueNeon

Info: http://emby.media/community/index.php?/topic/24151-Theme:-blue-neon-night

 

Make sure to set your max bitrate to 30.0 in preferences for a roku3. Does this direct play more of your videos? Press OK on your roku remote while video is playing to see directplay or transcoding info directly.

 

It looks like the 5.1 dts/ac3 tracks are becoming 2.0 stereo aac because the roku cannot see a 5.1 compatible device connected to it via hdmi. Is this so? Is it just stereo? Are the roku system settings correct? Not emby settings. When setting up the roku, and chose an audio type are you sure this is set correctly? Use "auto-detect". :)

 

Your videos you list assume the client device will be able to play 5.1 audio streams. When they cant and only have stereo output detected this will cause transcoding. This is out of our control. Their setup is causing the transcoding. The 5.1 stream is downsampled to 2.0.

 

The only way you can really solve this is use two audio tracks for every video. Make the first audio track 2.0 channel stereo aac. The second audio track can be ac3 or dts in 5.1 channels. If the roku has a 5.1 surround device connected to it then the roku will choose the second audio track to play. If the roku is instead connected through stereo it plays the first audio track. This is the only way to direct play to 2.0/5.1 with the same video. If you are serious about wanting to solve your problem this is the only way.

Edited by speechles
Link to comment
Share on other sites

pclausen

Hi speechless,

 

I have seen your threads on the Blue Neon theme for Roku.  Have not had a chance to check it out yet, but will do so when I get a chance.

 

I have 3 Roku 3's.  The first one is connected via HDMI to a Samsung LCD display with stereo speakers.  So I can see why the server would have to transcode the audio to 2.0 from the 5.1 track.  That's the first example listed above.

 

However, the other 2 Roku 3's are connected the AVRs via HDMI that have 5.1 speaker systems attached to them.  I'll double check tonight, but I believe both of them have the audio set to DD unless the primary users of those changed the settings since I originally set them.  Assuming they are still set to DD, I'm not sure why Emby is transcoding those.  Those would be examples 2, 3 and 4 above.

 

But again, I'll double check the settings and go ahead and install Blue Neon theme on at least one of them to see if it makes a difference.

 

When transcoding audio from 5.1 to 2.0, I would think that would require very little CPU compared to transcoding video, or is that not the case?  The Xeon E5-1620 is a quad core CPU with a Passmark CPU score above 9,000, so it should not drop to its knees doing a simple audio transcode I would think.  Creating chapter images for my ~60TB of media just completed and took a little over 21 hours (about 1,700 full quality Blu-Ray / HD-DVD rips and 600 DVDs and about 9,000 TV episodes ranging from 480p to 1080p).  With that done, I'll see how things fare tonight when the users all get back into it.

 

Not sure I want to attempt to re-encode my collection to ensure that the first audio track is 2.0 channel stereo aac.  I don't mind transcoding taking place on the one Roku 3 connected directly via HDMI to a LCD display that supports nothing else, but I would like to eliminate transcoding on all the other systems.

 

Appreciate the feedback and I'll play with it some more tonight and also check out the Blue Neon theme.

Link to comment
Share on other sites

pclausen

So I installed the Roku thumbnails plugin and fired it off, and see the following in the log for just about all my titles:

 

2015-10-29 12:24:29.8172 Info - App: Profile: Roku Thumbnails, Path: /media/Blu-Ray/Forrest Gump (1994)/Forrest Gump.mkv, isEligibleForDirectPlay: False, isEligibleForDirectStream: True
2015-10-29 12:24:29.8172 Info - App: Profile: Roku Thumbnails, No direct play profiles found for Path: /media/Blu-Ray/Forrest Gump (1994)/Forrest Gump.mkv
2015-10-29 12:24:29.8172 Info - App: Bitrate exceeds DirectPlay limit
 
Under settings in the Roku plugin, I have "Max Streaming Bitrate" set to 30 Mbps to match the max allowed on the Roku 3 devices.  Should I bump this to 40 Mbps anyway and run it again?
Link to comment
Share on other sites

What app is being used on your "HTPC" clients?

 

If it is transcoding, more than likely it is because your path substitutions aren't setup correctly.

Link to comment
Share on other sites

pclausen

Emby Theater on Windows 10 64-bit.

 

So the example title above that is transcoding is using the following path substitution (as per the screenshot):

From             To
/media/Blu-Ray   \\freenas\media\Blu-Ray

The From being the FreeNAS Emby plug-in where that maps to the Destination path from the Jail, which is setup as follows:

 

jailstorage.PNG

 

I have validated that the "To" path is accessible from the HTPC clients.

Edited by pclausen
Link to comment
Share on other sites

 

Emby theater on Windows 10 64-bit.

 

So the example title above that is transcoding is using the following path substitution (as per the screenshot):

From            To
/media/Blu-Ray \\freenas\media\Blu-Ray

 

Emby Theater will try to access the file directly and it will only stream through the server if it's not able to access it.

Link to comment
Share on other sites

pclausen

On the HTPC client, I can type in \\freenas\media\Blu-Ray and get a listing of movie folders like so:

 

htpcmediapath.PNG

 

Would that not indicate that the HTPC has access?

Link to comment
Share on other sites

if you grab the emby theater log it should say what path it was trying to use. also if you could show a screenshot of your path substitution setup that would be great.

Link to comment
Share on other sites

pclausen

What does your actual library setup look like?

 

For Movie media folders I have the following:

 

movielibrary.PNG

 

For my one TV media folder, I have this:

 

TVlibrary.PNG

Link to comment
Share on other sites

pclausen

if you grab the emby theater log it should say what path it was trying to use. also if you could show a screenshot of your path substitution setup that would be great.

 

Luke, I'll get you the Emby Theater log when I get home tonight.

 

Ebr, thanks for relinking the path substitution image!

Link to comment
Share on other sites

pclausen

I have not been able to get the HTPC to transcode tonight.  Everything has have played back has been direct stream.  Not sure why I was having the issue last night.  I did restart the Emby server plugin tonight before I got started, as well as the HTPC running Emby Theater.  I suppose that could have had something to do with it.

 

Also, on the Roku 3 connected to an AVR receiver via HDMI that had a 5.1 speaker system connected to it, it was indeed set to Stereo for the audio.  Once I changed it to Auto (DD/DTS) most of the titles that were transcoding last night no longer did.

 

However, some titles are still transcoding on that Roku unit.  Here's one example:

Input #0, matroska,webm, from 'file:/media/TVShows/Lost/Season 1/1x22 - Born To Run.mkv':
encoder         : libebml v0.7.7 + libmatroska v0.8.1
Duration: 00:43:22.60, start: 0.000000, bitrate: 25147 kb/s
Stream #0:0: Video: h264 (High), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
Stream #0:1: Audio: flac, 48000 Hz, 5.1(side), s32 (24 bit) (default)
encoder         : Lavc56.41.100 libx264
Stream #0:1: Audio: aac, 48000 Hz, stereo, fltp (24 bit), 128 kb/s (default)
encoder         : Lavc56.41.100 aac
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (flac (native) -> aac (native))

So the issue here appears to be that flac is being transcoded to aac.  The other Roku 3 that is connected to a Samsung 1080p panel that is stereo only is also transcoding the audio, which there is really no way around.  So with those 2 Roku's going, my Xeon E5-1620 v3 quad core CPU is pretty much spent as seen here:

 

dualroku3s.PNG

 

So with the 2 Roku's going, the HTPC is slow navigating the Emby server via Emby Theater and will even error out on occasion.

 

I don't want to dumb down my media quality, so I guess my choices are to ante up on the CPU in the server and invest in something like a Xeon E5-2630 v3 8 core that runs $685 ($435 net once I sell my E5-1620) or get rid of the Roku 3's in favor of a pair of Nvidia Shield's that will cost me a net of about $250 (assuming I can sell the Roku 3's for $75 a pop).  The Shield option also assumes that they will accept a direct stream even if what they are streaming to can only do 2.0 audio.

 

What would you do?

Edited by pclausen
Link to comment
Share on other sites

pclausen

So just for grins, I started playing back 3 Blu-Ray movies in my Chrome browser on my workstation, and sure enough, that totally maxed out the Emby server CPU and would not allow me to start a 4th movie and navigation through the library was awfully slow.

 

3concurrent.PNG

 

Before starting the test, I rebooted the entire FreeNAS server (not just the Emby jail).

 

I don't recall having these types of performance issues when I was running Emby on a windows server (linked to the FreeNAS server for the storage).  Users never complained about issues like this before.  I'll post over in the FreeNAS specific forum so see if they have any ideas what's going on.  I wouldn't think transcoding 3 1080p streams would be that big a deal, but maybe it is?

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...