Jump to content

Roku fails to play large recorded files


cpeng

Recommended Posts

I'm having trouble with Roku playing large emby recorded files. I'm pretty sure its due to the size of the file (25 GiB)

 

My Setup is HDHomerun Prime, Ubuntu 18.10, Intel G5500, Roku Ultra 4670r set to playback at 4 Mpbs 720P. I use emby as the DVR.

 

I get a playback error pop up on roku after clicking to play the file. I only get this error with roku, chrome and ios apps work fine. See Picture for error

5e1c3345da2f3_200113002348_sch6s8327.jpg

 

 

The steps I took to come to the conclusion that the file size may be to blame is I first used ffmpeg to change the container and make sure the file is good with this command:

ffmpeg -i original.ts -codec copy output.mkv

That file gives the same error.

 

But if I shorten the video with this command it plays fine:

ffmpeg -i output.mkv -codec copy -t 3600 shoter.mkv

I sent a roku log at 3:38 am EST, or 12:38 am PST.

 

I have attached my server log, in which I just took out my domain.

roku play problem.txt

Edited by cpeng
Link to comment
Share on other sites

@@softworkz Is this the "recordings over 4 hours" problem?

 

I'm not sure, but the files can be played after converted and they are the same time length. I don't have problems with long recordings when the stream is H264 and therefore smaller file size. Also the files play fine while recording.

 

 

 

Hi there, please attach the complete emby server log. thanks.

 

Ok, I did a restart, tried to play the file twice, then another restart and here is the log. I submitted another bug report with roku at the same time. The only thing I changed in the log was my public domain.

embyserver-63714512041.txt

Edited by cpeng
Link to comment
Share on other sites

here is a media info for two files that won't play

 

cpeng@g5500_plex:/mnt/plexmedia/save$ mediainfo NFL\ Football\ 2020_01_12_15_30_00\ -\ Seattle\ Seahawks\ at\ Green\ Bay\ Packers.ts
General
ID                                       : 0 (0x0)
Complete name                            : NFL Football 2020_01_12_15_30_00 - Seattle Seahawks at Green Bay Packers.ts
Format                                   : MPEG-TS
File size                                : 18.4 GiB
Duration                                 : 3 h 59 min
Overall bit rate mode                    : Variable
Overall bit rate                         : 11.0 Mb/s
Movie name                               : NFL on FOX
Law rating                               : TV-PG (L)


Video
ID                                       : 6983 (0x1B47)
Menu ID                                  : 11 (0xB)
Format                                   : MPEG Video
Format version                           : Version 2
Format profile                           : Main@High
Format settings                          : CustomMatrix / BVOP
Format settings, BVOP                    : Yes
Format settings, Matrix                  : Custom
Format settings, GOP                     : M=3, N=15
Codec ID                                 : 2
Duration                                 : 3 h 59 min
Bit rate mode                            : Variable
Bit rate                                 : 9 811 kb/s
Maximum bit rate                         : 25.0 Mb/s
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 59.940 (60000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.178
Stream size                              : 16.4 GiB (89%)


Audio #1
ID                                       : 6984 (0x1B48)
Menu ID                                  : 11 (0xB)
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Codec ID                                 : 129
Duration                                 : 3 h 59 min
Bit rate mode                            : Constant
Bit rate                                 : 448 kb/s
Channel(s)                               : 6 channels
Channel positions                        : Front: L C R, Side: L R, LFE
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Bit depth                                : 16 bits
Compression mode                         : Lossy
Delay relative to video                  : -734 ms
Stream size                              : 769 MiB (4%)
Language                                 : English
Service kind                             : Complete Main


Audio #2
ID                                       : 6985 (0x1B49)
Menu ID                                  : 11 (0xB)
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Codec ID                                 : 129
Duration                                 : 3 h 59 min
Bit rate mode                            : Constant
Bit rate                                 : 192 kb/s
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Bit depth                                : 16 bits
Compression mode                         : Lossy
Delay relative to video                  : -734 ms
Stream size                              : 329 MiB (2%)
Language                                 : Spanish
Service kind                             : Complete Main


Text #1
ID                                       : 6983 (0x1B47)-CC1
Menu ID                                  : 11 (0xB)
Format                                   : EIA-608
Muxing mode                              : A/53 / DTVCC Transport
Muxing mode, more info                   : Muxed in Video #1
Duration                                 : 3 h 59 min
Bit rate mode                            : Constant
Stream size                              : 0.00 Byte (0%)
CaptionServiceName                       : CC1


Text #2
ID                                       : 6983 (0x1B47)-1
Menu ID                                  : 11 (0xB)
Format                                   : EIA-708
Muxing mode                              : A/53 / DTVCC Transport
Muxing mode, more info                   : Muxed in Video #1
Duration                                 : 3 h 59 min
Bit rate mode                            : Constant
Stream size                              : 0.00 Byte (0%)
cpeng@g5500_plex:/mnt/plexmedia/save$ mediainfo test.mkv
General
Unique ID                                : 26200632750837810216794992662883560690 (0x13B60EEDE832F0398E26B6621DD76CF2)
Complete name                            : test.mkv
Format                                   : Matroska
Format version                           : Version 4 / Version 2
File size                                : 24.8 GiB
Duration                                 : 4 h 29 min
Overall bit rate mode                    : Variable
Overall bit rate                         : 13.1 Mb/s
Writing application                      : Lavf58.12.100
Writing library                          : Lavf58.12.100
ErrorDetectionType                       : Per level 1


Video
ID                                       : 1
Format                                   : MPEG Video
Format version                           : Version 2
Format profile                           : Main@High
Format settings                          : CustomMatrix / BVOP
Format settings, BVOP                    : Yes
Format settings, Matrix                  : Custom
Format settings, GOP                     : M=3, N=30
Format settings, picture structure       : Frame
Codec ID                                 : V_MPEG2
Codec ID/Info                            : MPEG 1 or 2 Video
Duration                                 : 4 h 29 min
Bit rate mode                            : Variable
Bit rate                                 : 12.5 Mb/s
Maximum bit rate                         : 25.0 Mb/s
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Active Format Description                : Pillarbox 4:3 image
Frame rate mode                          : Constant
Frame rate                               : 29.970 (30000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Interlaced
Scan order                               : Top Field First
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.201
Stream size                              : 23.6 GiB (95%)
Default                                  : Yes
Forced                                   : No
Color range                              : Limited


Audio
ID                                       : 2
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Codec ID                                 : A_AC3
Duration                                 : 4 h 29 min
Bit rate mode                            : Constant
Bit rate                                 : 384 kb/s
Channel(s)                               : 6 channels
Channel positions                        : Front: L C R, Side: L R, LFE
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Bit depth                                : 16 bits
Compression mode                         : Lossy
Delay relative to video                  : -1 s 218 ms
Stream size                              : 741 MiB (3%)
Language                                 : English
Service kind                             : Complete Main
Default                                  : Yes
Forced                                   : No
Link to comment
Share on other sites

Were BIF files created for the item or is it a 0byte BIF?

The Roku will only play up to the point the BIF was created and will exit after. If the initial BIF is 0byte size it will cause the playback error.

 

It sounds like the original file never got correct BIF. As you modify the file those modified files are getting corrected BIF. That may be what this is.

Edited by speechles
Link to comment
Share on other sites

Were BIF files created for the item or is it a 0byte BIF?

 

The Roku will only play up to the point the BIF was created and will exit after. If the initial BIF is 0byte size it will cause the playback error.

 

It sounds like the original file never got correct BIF. As you modify the file those modified files are getting corrected BIF. That may be what this is.

 

I'm not sure where to find the BIF files. I searched for it and it sounds as if they are not used anymore. If I use ffpmeg to copy the file that doesn't play to another container making a new file with the same streams and bit rates, the new file still doesn't play. If I compress the file (reduce the size) it plays, also if I shorten the file without compressing it will also play.

Link to comment
Share on other sites

So I was able to reproduce the behavior very easily. If I take a 10 second clip of a MPEG2 1080 i file with DTS audio (16 MB), use ffmpeg to concatenate the file with itself 5 times it will play just fine. If I concatentate it with itself 1440 times (~24 GB, 4 hours) it will error out on the roku.

 

Here are the commands I used:

 

First make the list

for i in {1..1440}; do echo "file 'test10s.mkv'">>list.txt; done

Then make the video

ffmpeg -f concat -i list -c copy testconcatlong.mkv
Link to comment
Share on other sites

If you force these to transcode, do they play?

 

The rokus are set to 4mbps so it has to be transcoded. These recordings did play on the roku while they were being recorded. The only thing that makes sense from my testing is once the files get over a certain size, somewhere between 10 GB and 25 GB they won't play on roku only. IOS and Chrome work fine.

Link to comment
Share on other sites

quick update: direct play works with a Roku, so it’s only when the file is transcoded that it won’t play.

Edited by cpeng
Link to comment
Share on other sites

quick update: direct play works with a Roku, so it’s only when the file is transcoded that’s it won’t play.

 

Okay, so that would indicate that this is not a Roku issue but something to do with how we are transcoding it...

 

@@softworkz thoughts?

Link to comment
Share on other sites

From the logs here it seems that the client loads the playlist but doesn't request any segment.

 

So it's most likely because it doesn't like the playlist.

 

We already know that it depends on the length of the video - which also affects the size of the playlist.

 

I wouldn't think that it's about the number of segments, but I could imagine that there's some hard limit for the size of a playlist.

Such kind of limit would make sense to prevent possible exploits, limit processing and memory usage and/or avoid hangs or delays in the application.

 

A limit of 4h is not likely intended, but there's something we need to consider: Emby generates and delivers HLS playlists in a rather unusual way: The URLs for each segment include a lot of parameters and can pretty long. I just did a test and it was 698 characters for each segment line.

 

Let's assume that my theory is right. That would mean that if our segment URLs would only be 100 characters long instead of 698, that would make a factor of

 

(698 + 15) / (100 + 15) = 6.2  (15 is the length of the '#EXTINF...' lines in-between)

 

And 4h * 6 ==> 24h

 

 

This calculation fits too good to be just a coincidence.

Link to comment
Share on other sites

For those who couldn't follow - what I mean what might have happened is

  • the Roku developers decided to introduce a limit for the size of hls playlist files
  • but what would be the right value for that?
  • They took 24h * 60 * 60 / 3 = 28800 segments
  • assumed a max length for URLs of 100 characters + 15 characters for the lines in-between
  • that  would make a limit of 3.3 MB for a playlist file

Just that with Emby, we're already reaching that limit with only 4h of video.

 

I could be wrong - that's why it's just a theory, but it would fit from the numbers at least.

Link to comment
Share on other sites

@@softworkz I follow your theory and it makes sense.So as a test I tried to transcode a 4 hr 4mbps file on Roku and it’s the same problem even though that file is ~7.5 GB. So yeah it’s not related to file size at all, seems to only matter on the length of the transcode. What threw me off was I didn’t understand how transcoding on the fly was different then direct play of a converted file.

 

If this is correct can it be fixed relatively easily? I’m willing to do any testing.

Link to comment
Share on other sites

If this is correct can it be fixed relatively easily? I’m willing to do any testing.

 

If you be willing to install a beta version, we could try something with the next beta.

Link to comment
Share on other sites

If you be willing to install a beta version, we could try something with the next beta.

 

That would be of the server, FYI.

Link to comment
Share on other sites

If you be willing to install a beta version, we could try something with the next beta.

 

Sure. If you can let me know in this thread when its in the beta I can run it.

 

 

That would be of the server, FYI.

 

I understand. Basically it sounds like the names of the trans coded files can be reduced in number of characters, or I guess alternatively the length of the transcoded segments could be increased in time.

Link to comment
Share on other sites

Sure. If you can let me know in this thread when its in the beta I can run it.

 

 

It might take a while until we get there. I'll let you know when there's something to test!

Link to comment
Share on other sites

  • 2 weeks later...
bcm00re

I used Emby's Convert feature on the AFC Championship game that I recorded a few weekends ago. It originally wouldn't play because it too long/big. Playing the converted file seemed to fix things -- except for my Roku 3 (4200X). On that device I still get the same error even when trying to play the converted file. I know the Roku 3 is older, but it was the flagship device back when I bought it and seems to fine for everything else. I know it doesn't have as much RAM/memory as some of my newer Rokus so I tried playing this on my older Roku Express (which has the same RAM/memory values) and it plays fine on it. I confirmed both devices are up to date and running the latest Roku software. I'll attach the log now...

Edited by bcm00re
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...