Jump to content

x265 playback on rpi2 vs chromecast


rinn2883

Recommended Posts

rinn2883

Hi

 

I need some help trying to figure out a problem.

Testing a rpi 2 and a chromecast over the wifi on a remote network (so not the LAN of the server).

 

x264 playing works on both.

x265 playing/casting to chromecast works.

 

x265 playing on the rpi 2 stutters all the time (its unwatchable).

 

I set the force transcode to 480p and above.

 

Speedtest shows my wireless download to be 40 mpbs, so I set video Quality to 10 mbps.

 

I also increased the kodi buffer.

advancedsettings.xml

<advancedsettings>

<cache>

<buffermode>1</buffermode>

<memorysize>41943040</memorysize>

<readfactor>30</readfactor>

</cache>

</advancedsettings>

 

I need some help tweaking the settings on the pi. Since with the chromecast is working perfectly.

Link to comment
Share on other sites

Can you please attach ffmpeg logs from both sessions so that we can compare? Thanks.

Link to comment
Share on other sites

rinn2883

Also tried with the browser (chrome) on my phone (google nexus 5x). And it is playing nicely.
It was still set to transcode to 6mpbs so I will upload both files.

 

I did a full database reset on the pi just to be sure.. Playing an the pi was stuttering and the audio went out about 10 seconds in.

And stuttering i mean to the point that its not really playing anymore  :D

 

Should i also check Hi10p transcode and try again?

media-info.txt

chromecast2-ffmpeg.txt

Nexus5x-ffmpeg1.txt

Nexus5x-ffmpeg2.txt

RPI2-ffmpeg.txt

Link to comment
Share on other sites

rinn2883

No the server is at home. It is a intel NUC i5 running windows 10.

 

So i have my server runnning emby at home. And im at the gf house with the pi/chromecast. Using the emby for android app and casting to the chromecast it plays perfectly. Then I switch to the pi running openelec with the emby for kodi app and it stutters massively and even the audio went out. I tried with my phone via the browser and it plays just so see if it is a network issue or not.

 

Since both the phone and the chromecast work i dont think its a network problem.

Link to comment
Share on other sites

rinn2883

Tried some more on the phone. It is not a 100%.

On the phone it stops completely and buffers, on the pi it stutters.

 

Setting the transcoding to auto on the phone seems to make it worse...

 

I started at 10 mpbs and had to go all the way down to 2mpbs to play a episode without buffering.

 

It is over the wifi, but speedtest on my phone shows +- 40 mpbs download and 20 mpbs upload. At home where the server is, I have 200 mbps download and also 20 mpbs upload.

 

Maybe the chromecast auto configuration is setting it to 2mbps and that is why it is working perfect for the chromecast?

Link to comment
Share on other sites

I think what you probably need to do is set the bitrate setting. We do our best to detect an appropriate value but it is not guaranteed to be a perfect measurement.

 

Keep in mind also despite speedtests, there could be ISP throttling occurring on either end.

Link to comment
Share on other sites

rinn2883

Ok, but 2 things:

 

1) The chromecast auto detection works, I didn't have to change any settings for the chromecast. shouldn't it work for the web app/emby for kodi?
2) On the rpi when I set it to 6mpbs x264 plays perfectly (most of my movies are still x264, tv shows are x265 HEVC 10 bit) and the tv shows are the ones not playing/stuttering.

Link to comment
Share on other sites

Angelblue05

There is no auto detection in Emby for Kodi. Did you try to enable force transcoding for x265 content in the addon settings?

 

 

Sent from my iPhone using Tapatalk

Link to comment
Share on other sites

rinn2883

Yes, 

I set force transcode to "480p and above".

Should i also check "force Hi10p" since it is HEVC x265 10 bit? 

I didn't check it since I think it is a special extension of x264, but I don't really know anything about video formats / codecs.

Edited by rinn2883
Link to comment
Share on other sites

rinn2883

Im going over the log file from what i can tell there is a difference in the container format and the audio it is transcoding to:

 

Chromecast
==========
C:\Users\jdamme\AppData\Roaming\Emby-Server\ffmpeg\20170308\ffmpeg.exe
-f matroska
-codec:0 hevc
-codec:1 aac
-i file:"T:\tv-shows\iZombie\Season 3\iZombie.S03E01.1080p.mkv"
-map 0:0
-map 0:1
-map -0:s
-codec:v:0 libx264
-force_key_frames "expr:gte(t,n_forced*5)"
-vf "scale=trunc(min(max(iw\,ih*dar)\,1920)/2)*2:trunc(ow/dar/2)*2"
-copyts
-avoid_negative_ts disabled
-start_at_zero
-pix_fmt yuv420p
-preset superfast
-crf 23
-maxrate 3240034
-bufsize 6480068
-profile:v high
-level 4.1
-x264opts:0 subme=0:me_range=4:rc_lookahead=10:me=dia:no_chroma_me:8x8dct=0:partitions=none
-vsync -1
-map_metadata -1
-map_chapters -1
-threads 0
-codec:a:0 copy
-y "C:\Users\jdamme\AppData\Roaming\Emby-Server\transcoding-temp\a2e7042a9807b2ec388b702766b26272.mkv"
 
RPI2
=====
C:\Users\jdamme\AppData\Roaming\Emby-Server\ffmpeg\20170308\ffmpeg.exe
-f matroska
-codec:0 hevc
-codec:1 aac
-i file:"T:\tv-shows\iZombie\Season 3\iZombie.S03E01.1080p.mkv"
-map_metadata -1
-map_chapters -1
-threads 0
-map 0:0
-map 0:1
-map -0:s
-codec:v:0 libx264
-pix_fmt yuv420p
-preset veryfast
-crf 23
-maxrate 3240034
-bufsize 6480068
-x264opts:0 subme=0:me_range=4:rc_lookahead=10:me=dia:no_chroma_me:8x8dct=0:partitions=none
-force_key_frames "expr:gte(t,n_forced*3)"
-vf "scale=trunc(min(max(iw\,ih*dar)\,1920)/2)*2:trunc(ow/dar/2)*2"
-copyts
-vsync -1
-codec:a:0 ac3
-ac 6
-ab 384000
-f segment
-max_delay 5000000
-avoid_negative_ts disabled
-start_at_zero
-segment_time 3
-individual_header_trailer 0
-segment_format mpegts
-segment_list_type m3u8
-segment_start_number 0
-segment_list "C:\Users\jdamme\AppData\Roaming\Emby-Server\transcoding-temp\6ab2b5aee8297793daa17a267efc7337.m3u8"
-y "C:\Users\jdamme\AppData\Roaming\Emby-Server\transcoding-temp\6ab2b5aee8297793daa17a267efc7337%d.ts"
Link to comment
Share on other sites

rinn2883

Break time at work  :)

 

I made some more logs using a laptop (chrome set to auto, perfect playback) and another phone (chrome set to auto and 5mpbs, both perfect playback).

 

From what I can see the only difference between all the logs

 

1) All other logs contain "-profile:v high",  "-level 4.1". Those flags are missing in the rpi log.

2) All other logs contain "-codec:a:0 copy". In rpi log this is "-codec:a:0 ac3 -ac 6 -ab 384000"
 
Or am I looking at completely the wrong stuff  :lol:
 
I will try some other stuff when i get time like testing rpi with wired connection at gf house and maybe take it to work to test in my break.
Link to comment
Share on other sites

rinn2883

Openelec doens't have a browser in the official repository, so I need to look for a decent one.

 

Yesterday I tried RPI with wired connection at my home (so on the same LAN as the emby server) and it worked just fine.

 

1) I will try a wired WAN connection at the gf, then I can say for certain it is a wifi problem or not.

 

2) Try with the ideaal bitrate. I tried before with 6mpbs (x264 played while x265 did not), looking at some of my media, 4 mpbs should be more then enough so I will try again.

    If x264 plays good with a set bitrate of 4 mbps but transcoded x265 does not, we can compare the logs.

 

I will report back

Link to comment
Share on other sites

rinn2883

OK did some more testing at the gf's house, but did not have time to do the wired test. I will try and do it friday.

1) Where can I find logs for when it plays x264? So that I can see the difference.

 

2) Still using this advancedsettings.xml

 

<advancedsettings>
<cache>
<buffermode>1</buffermode>
<memorysize>41943040</memorysize>      // 40 mb
<readfactor>30</readfactor>
</cache>
</advancedsettings>

 

Is this settings file ok for a rpi2? I read the description of readfactor but don't really know what value to take.

This is the recommend file for hardware with 1GB RAM.

 

<advancedsettings>
<cache>
<buffermode>1</buffermode>
<memorysize>139460608</memorysize> // 133 mb
<readfactor>20</readfactor>
</cache>
</advancedsettings>

 

3) Set the bitrate to 3.2 mpbs in emby for kodi.

 

Following results:

Playing movie1 x264 (2500 kbps) : No problemo.
 

Playing show1 x265 (1620 kbps) : Played better then before but it does a lot more buffering compared to x264.

                                                       After ~2 mins it jittered and didn't recover. Pausing and restarting just froze the image, while audio was working.

 

Playing show2 x265 (1408 kbps) : Sometimes a very small jitter, but overall played ok over 5 mins.

                                                       After 5 mins the subtitles began to go out of sync.

 

Playing show3 x264 (2442 kbps): No problemo over ~ 5 mins.

 

Playing show4 x265 (1563 kbps): No problemo!! just like show2 the subtitles began to go out of sync. Pausing and restarting did not fix it.
                                                     Stopping and starting fixed the subtitles and after a while they go out of sync again. I watched the entire episode  :)

 

It this point I felt really stupid, that it was just the bitrate that was causing problems.

Playing show x265: Just like show1 it did a lot of buffering. After ~1 min it started to stutter and didn't recover.

                                I tried 4 times but never got it to play for more then a minute.

 

Took out my phone like 30 seconds later, set it to 4mpbs. Show5 played without a problem.. So I think it is more then a connection/bitrate problem after all.

 

From what I can tell playing x265 on the rpi, it does a lot more buffering etc compared to x264, is this normal? The bitrates of the x265 files are lower?

I'm puzzled why sometimes it works, other times not, but playing on multiple devices on the same connection with different results seem to indicate it is not a connection problem.

 

I will attach some info about the files and ffmpeg logs.

data.zip

Edited by rinn2883
Link to comment
Share on other sites

rinn2883

What?

The whole topic is about when playing x265 via chromecast it works perfectly, while on rpi2 it does not.

 

I use the phone as a reference to indicate that it is not just a network problem, cause all 3 devices are on the same wifi and only the rpi gives problems.

 

And I need some help figuring out why the rpi2 gives problems.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...