Jump to content

Roku Playback failing for MP4's


radeon

Recommended Posts

radeon

@@Luke, @@CBers, I thought i'd best create a separate thread to stop hijacking the main one and just post my hopeful findings!

 

After scanning through my library to test for unplayable films, I seem to have found something which may be the cause using the Media Info App.

 

Luke, when you retrieve the media info on the videos, is the "Encoded_Library" something you can collect?

 

I have found that all of those with:

 

Anamorphic = Yes

Encoded_Library= "x264 core 125 r2200 999b753"

 

or

 

Anamorphic = Yes

Encoded_Library=" x264 core 120 r2164 da19765"

 

dont play correctly. I get a blank black screen with just audio.

 

Is this something that can be checked for?

Edited by radeon
Link to comment
Share on other sites

Those aren't good detection schemes, unfortunately. Either we are missing information that is needed to determine if it can direct stream, or this is one of those files that looks like it should but then fails to do. For the latter, I do plan to add an automatic transcoding fallback when direct stream fails. In the meantime you may choose to fork the code, hack it for your personal usage, and then wait for either or both of these improvements.

Link to comment
Share on other sites

I found Roku to be very picky with playable media files. I am re-encoding all my movies slowly to support 2ch AAC Audio. This was a big killer for me as I have Roku 2 which only supports 2ch AAC audio and no bit streaming. Video is also picky. Take a look at this link. Once upon a time all my movies would direct stream via plex, then everything changed and my server was transcoding. I looked at the logs and found the audio was the culprit on almost all my movies and some video culprits

 

http://sdkdocs.roku.com/display/sdkdoc/Encoding+Guide

Edited by A8HTPC
Link to comment
Share on other sites

radeon

I found Roku to be very picky with playable media files. I am re-encoding all my movies slowly to support 2ch AAC Audio. This was a big killer for me as I have Roku 2 which only supports 2ch AAC audio and no bit streaming. Video is also picky. Take a look at this link. Once upon a time all my movies would direct stream via plex, then everything changed and my server was transcoding. I looked at the logs and found the audio was the culprit on almost all my movies and some video culprits

 

http://sdkdocs.roku.com/display/sdkdoc/Encoding+Guide

 

Thats the thing though, I dont mind the transcoding at all. The server is more than capable of it. Its just the mb3 app thinks the roku is capable of playing the file via direct stream and its wrong so im getting audio but no video. The mb3 roku app should be detecting this and making it transcode and isn't. A good 20% of my movies dont play on the roku app which is pretty disappointing, especially when it works fine on Plex (oh, i was just a little sick in my mouth!)

Link to comment
Share on other sites

radeon

Well, it isnt really, I dont like and probably never will like plex, imo mb3 kicks the crap out of it, my point was that my test just proves there is something I/we are missing in the detection to force the transcoding, it wasnt a dig at mb3 or you.

 

So if there is anything I can do to work it out then please let me know.

 

If it helps, i forked the code and forced it to think my box doesnt support anamorphic and in turn forces transcoding but the transcoded video still didnt play back. However, if i force it to transcode by lowering the quality settings in the global options of the app, its plays back fine.

Edited by radeon
Link to comment
Share on other sites

You gata do the guess work to find the answer right? trial and error, Investigations

 

You could probably use MediaInfo on the movies which play and don't play. Look at the specs of the video and figure out why it does or does not needs to be transcoded. Then figure out in the code why MB app is not telling the server to transcode.

Link to comment
Share on other sites

radeon

Yeah, I've been looking over the info in media info and i cant see anything other than the above that's different.

 

Take a look here: https://docs.google.com/spreadsheets/d/11e7v37xjo_hY1IXL03ybpwJ0QUgU93WUC1iC0GpHgNs/edit?usp=sharing

 

I've taken a couple of them and output the video details with media info. The bottom 3 The Bank Job, Adventureland and American Beauty all work fine, the rest dont.

 

Please spot the difference! :-D

Link to comment
Share on other sites

radeon

Ah! So, Just got plex on the go again and It may have just given the answer, using the rarflix client, the logging is quite handy and seems quite detailed, it seems to be to many reframes causing the issue.

7/9/14 20:48:33 : Media item optimized for streaming: 1
7/9/14 20:48:33 : Media item container: mp4
7/9/14 20:48:33 : Media item video codec: h264
7/9/14 20:48:33 : Media item audio codec: aac
7/9/14 20:48:33 : Media item subtitles: invalid
7/9/14 20:48:33 : Media item stereo codec: aac
7/9/14 20:48:33 : Media item surround codec: invalid
7/9/14 20:48:33 : Secondary audio stream selected: false
7/9/14 20:48:33 : Media item aspect ratio: 2.35
7/9/14 20:48:33 : videoCanDirectPlay: too many ReFrames: 12
7/9/14 20:48:33 : Can direct play = false

Having googled it, it comes up with a plex thread where a dev references the ReFrames for a similar reason. https://forums.plex.tv/index.php/topic/40578-roku-1-xds-needs-forced-transcode-on-1-file/

 

Here's a plex git issue on it too: https://github.com/plexinc/roku-client-public/issues/146

 

Is this something you can look the extract and handle as it appears to have been an issue we need to overcome.

  • Like 1
Link to comment
Share on other sites

radeon

Rarflix Source refrence:

    ' Support for ReFrames seems mixed. These numbers could be wrong, but
    ' there are reports that the Roku 1 can't handle more than 5 ReFrames,
    ' and testing has shown that the video is black beyond that point. The
    ' Roku 2 has been observed to play all the way up to 16 ReFrames, but
    ' on at least one test video there were noticeable artifacts as the
    ' number increased, starting with 8.
    if major >= 4 then
        ' upping this to 9 for now -- RR look into this later and set as a preference 
        GetGlobalAA().AddReplace("maxRefFrames", 9)
    else
        GetGlobalAA().AddReplace("maxRefFrames", 5)
    end if
Link to comment
Share on other sites

Thanks. we don't have ref frames data on the server yet, it's on my to do list. but if you look at the roku code you'll see that there is a check in place so that once it is added, it will work. i will try to get to it soon.

  • Like 1
Link to comment
Share on other sites

I know you guys are busy but just wanted to thank Radeon for tracking this info down, it was driving me bonkers why my sister n law was having trouble on her roku 2 with just a handful of my movies. They all had the high ref frames, I'll just wait it out as I don't feel like re-encoding for an outside user on my server. Hopefully this can be looked at soon. Thanks.

Link to comment
Share on other sites

Cheesegeezer

Have to agree with @@BAS and @@radeon

 

I keep trying the "official Roku app" but keep reverting back to Grant & Tikuf's Roku App, as that is stable and I can view all my media with that and have no problems.

Link to comment
Share on other sites

Sweet! Nice one Luke, I just picked up the dev mbs and noticed the release info, it seems to be extracting the refreams nicely now, however there seems to be a but in the roku client. Its unable to load the movie details with the following error coming up in the telnet console:

Wrong number of function parameters. (runtime error &hf1) in ...pkg:/source/VideoMetadata.brs(495)
495:         if videoStream <> invalid and videoStream.RefFrames <> invalid AND firstOf(videoStream.RefFrames, 0) > firstOf(GetGlo
balAA("maxRefFrames"), 0) then
Backtrace:
Function videocandirectplay(mediasource As Dynamic, audiostream As Dynamic, videostream As Dynamic, subtitlestream As Dynamic, opt
ions As Dynamic) As Boolean
   file/line: /tmp/plugin/BBAAAAWP6516/pkg:/source/VideoMetadata.brs(495)
Function getstreaminfo(mediasource As Object, options As Object) As Object
   file/line: /tmp/plugin/BBAAAAWP6516/pkg:/source/VideoMetadata.brs(302)
Function getplaybackstreaminfo(item As Dynamic, options As Dynamic) As Object
   file/line: /tmp/plugin/BBAAAAWP6516/pkg:/source/VideoMetadata.brs(240)
Function addvideoplaybackinfo(item As Dynamic, options As Dynamic) As Void
   file/line: /tmp/plugin/BBAAAAWP6516/pkg:/source/VideoMetadata.brs(110)
Function getfullitemmetadata(item As Dynamic, isforplayback As Boolean, options As Object) As Object
   file/line: /tmp/plugin/BBAAAAWP6516/pkg:/source/GeneralMetadata.brs(1084)
Function videogetmediadetails(content As Dynamic) As Void
   file/line: /tmp/plugin/BBAAAAWP6516/pkg:/source/VideoSpringboardScreen.brs(182)
Function sbrefresh() As Dynamic
   file/line: /tmp/plugin/BBAAAAWP6516/pkg:/source/BaseSpringboardScreen.brs(147)
Function sbshow() As Void
   file/line: /tmp/plugin/BBAAAAWP6516/pkg:/source/BaseSpringboardScreen.brs(104)
Function vccreatescreenforitem(context As Dynamic, contextindex As Dynamic, breadcrumbs As Dynamic) As Dynamic
   file/line: /tmp/plugin/BBAAAAWP6516/pkg:/source/ViewController.brs(1291)
Function gridhandlemessage(msg As Dynamic) As Boolean
   file/line: /tmp/plugin/BBAAAAWP6516/pkg:/source/GridScreen.brs(112)
Function vcshow() As Void
   file/line: /tmp/plugin/BBAAAAWP6516/pkg:/source/ViewController.brs(390)
Function main() As Void
   file/line: /tmp/plugin/BBAAAAWP6516/pkg:/source/appMain.brs(18)
Link to comment
Share on other sites

 

Sweet! Nice one Luke, I just picked up the dev mbs and noticed the release info, it seems to be extracting the refreams nicely now, however there seems to be a but in the roku client. Its unable to load the movie details with the following error coming up in the telnet console:

 

Scrap that, created a pull request with the fix to this issue, however, now the telnet console flags that the file needs to be transcoded but the issue persists even tho the video is transcoded. would the transcode definitely be reducing the refframes?

  • Like 1
Link to comment
Share on other sites

I've just taken one of the TS files in the mbs transcode directory and ran it up in plex and it confirms it cannot be directly played but unfortunately doest give me a reason as you why. Any ideas?

Link to comment
Share on other sites

Just trying to pinpoint the issue here now as the transcoding makes ZERO difference.

 

If anyone else might be able to help, here's media info from the transcoded TS file, plex left, mb right. There seems to be a whole lot missing from the MB file but no idea if that makes a difference? Surely the transcode would automatically be to the required spec of the roku/now tv boxes?

 

FnLg7JL.png

Edited by radeon
Link to comment
Share on other sites

So looking at the mbs dashboard, it seems mbs isnt bothering to actually transcode anything, its just changing the container:

 

MFDOERL.png

 

Is this a roku issue or a mbs issue then?

 

Anyone?

Link to comment
Share on other sites

Isn't the server being passed the clients details? I.e. that its a roku lt/now tv?  then off the back of that, seeing the the client requesting the media with high reframes and be doing a video transcode rather than a simple copy?

Link to comment
Share on other sites

If it helps

 

Plex Transcode CL

-threads "0" "-y" -segment_format "mpegts" -f "segment" -loglevel "quiet" -loglevel_plex "error" -map_metadata "-1" -progressurl "http://127.0.0.1:32400/video/:/transcode/session/1MH36H013974/progress" -vcodec "libx264" -crf "19" -maxrate "1261k" -bufsize "2522k" -vsi "0x0" -preset "veryfast" -x264opts cabac=0:8x8dct=1:bframes=0:subme=0:me_range=4:rc_lookahead=10:me=dia:no_chroma_me:8x8dct=0:partitions=none:bframes=3:cabac=1 -flags "-global_header" -segment_time "5" -segment_start_number "0" -force_key_frames "expr:gte(t,n_forced*5)" -map "0:0" "-sn" -acodec "aac" -strict "-2" -cutoff "15000" -ac "2" -map "0:1" -ab "92k" "media-%05d.ts" 

MB3 Transcode CL

 -loglevel debug -fflags +genpts -i file:"removed" -map_metadata -1 -threads 2 -map 0:0 -map 0:1 -map -0:s -codec:v:0 copy -bsf h264_mp4toannexb -copyts -flags -global_header -codec:a:0 copy -hls_time 7 -start_number 0 -hls_list_size 1440 -y "Y:\MediaBrowser\transcoding-temp\eb626a4bf00945d75434019674c1743e.m3u8"
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...