Jump to content

1080p x265 HEVC Choppy on Emby Player (Roku & Android)


Go to solution Solved by speechles,

Recommended Posts

Posted (edited)

image.png.592a0efb4e68a9595ce5afd483c121ea.png

 

* Playing on the Roku Emby App, some 265 encoded files are super choppy.

* Same thing happens when playing on Android Emby App.

* However, if I use VLC player on my phone (using 3rd party player setting on Emby Android), it is perfectly smooth.  This leads me to believe something is wrong the Emby Player itself, on both Android and Roku, and not an issue with the server. 

* I've seen several people post about this same issue with 265 encoded files on the forums, but no particular resolution was found.

* I have included the server logs as well.

embyserver.txt

Edited by jbchang83
Fixing formatting
visproduction
Posted (edited)

Why does playback get stopped 4 times in the log, then the session removed,  1/2 second later try to start up again, 0.7 seconds later retrieve 6 photos from tmdb, 0.1 second after that, start playback again?  Is this expected? 

Log file lines 131 - 150

  1. JB, did you test the movie immediately, before any images could have time to download?
  2. Wouldn't it be a good idea to not allow image updates to happen, if the media starts to play.  Would this make playback smoother?
Edited by visproduction
Posted

I think I was stopping the video several times to try some different server settings.  None of which improved the choppiness (dropped frame rate?) so I reverted them.

But my main point is that if I used an external player (VLC ) with the emby android app instead of the built in emby player, it plays the videos buttery smooth.

I experience the same kind of choppiness viewing from emby android app (built in player) as with the emby Roku app.

Would it help if I posted logs without pausing the video?  Or with one playing from VLC (emby android) vs one playing from emby roku?

Posted

@visproductioni replied before I saw your last two questions.  I'm unfamiliar with the image update setting.  Where can I find this setting to disallow image update during playback?

I only have this choppiness issue with 265 files, never with 264 (so far).

Posted
9 hours ago, jbchang83 said:

This leads me to believe something is wrong the Emby Player itself

Hi.  Your examples are two completely different players on different platforms so that would not be the common thread.

Can you please explain exactly what you mean by "choppy"?

visproduction
Posted
5 minutes ago, jbchang83 said:

@visproductioni replied before I saw your last two questions.  I'm unfamiliar with the image update setting.  Where can I find this setting to disallow image update during playback?

I only have this choppiness issue with 265 files, never with 264 (so far).

Hmmm, Well since you said you actually stopped playback, then perhaps image download is not happening at the same time... so that may not be an issue.  There is no setting.  Maybe it's working fine.  Logs are better when they only cover one issue and not include clicking all over the place.. Ha!

Posted (edited)

@ebr sorry, my main complaint is that I believe there is an issue with the emby player.  I didn't know which category to post in as my issue occurs on both Roku and Android apps.

What I mean by choppy is that the video is not smooth.  Imagine playing a video game at 20fps instead of 60fps.  The video feels terrible to watch.

The emby android app has an external player setting.  If I enable that setting and use VLC player instead of emby built in player, the video frame rate is perfect.

Can I ask if the emby android app player and the Roku player are the same?  I believe they share the exact same problem.

 

 

Edited by jbchang83
Posted

Again, this issue only occurs with 265 encoded videos.  I have attached a screenshot of the details of one of the problematic videos here.

 

Screenshot_2025-01-12-08-02-19-33_44afb15bb7fddf0c82da86f25534e5f4~2.jpg

Posted
32 minutes ago, jbchang83 said:

there is an issue with the emby player.  ...Can I ask if the emby android app player and the Roku player are the same?

No, they are not.  That was my point.  On Roku we are using the Roku player provided by that device/OS and on Android we are using ExoPlayer provided by Google.  Completely different sharing really no similarities at all.

33 minutes ago, jbchang83 said:

Imagine playing a video game at 20fps instead of 60fps.

Your example is 23.976 so playing it at 60 could definitely result in frame stutter - depending on how good the display device is at accounting for that.

Is that what you are seeing?  Frame-rate/refresh rate mis-match?

What is the display?  What mode is it in?

Posted

I see, is it possible that the native Roku player just has trouble playing hevc codec then?  Do you have this issue if you are playing hevc on roku?  Am I on crazy pills?  I have 3 Roku TVs with the emby Roku app and they all experience the same issue, even my 2024 Roku TV.

Why does it work fine on VLC but not the emby players when they are all playing from the same emby server?  Don't get me wrong, I absolutely love the emby server and Roku app.  I want to help you guys find the problem so we can both benefit.

On Android, I tried auto frame rate, 60hz, and 120hz, and I still have the issue with the emby player.

For Roku, I don't know what settings I can adjust.  If you have any tips on settings I would love to know!

Screenshot_2025-01-12-08-24-15-60_44afb15bb7fddf0c82da86f25534e5f4.jpg

Posted (edited)

image.png.5eb979479676b0027ff81d7032ea4a87.png

I have had this happen before. I had used MKVToolNix GUI to fix the file.

Uncheck any tags, both global tags and tags so they are not recreated in the remuxed file. Leave the rest alone and remux the file. The remuxed file should now play without issue.

Since you have the issue on both Android and Roku it is an issue inside your file. When you remux the file MKVToolNix will optimize the file placing all the contents in the correct order to create a streaming friendly version. The reason VLC can play it correctly is it can see the entire file all at once and it can play as a file. Emby clients do not have access to the entire file. They must stream it over http. The file must be optimized for streaming to play efficiently. Please try to remux the file with MKVToolNIX GUI and then let us know if this solves the problem.

Edited by speechles
Posted

@speechlesi have not tried your solution yet, as that would be something of a final resort for me.  Also question, if I am using VLC through the emby android app, is it not "streaming" the file from the emby server?  I am not using VLC on the server itself.

@ebri have also just done some tests on Android with changing the video quality.  The problem occurs with "auto - direct" and all 1080p 60mbps to 4mbps.  Anything 720p and under is smooth...

  • Solution
Posted
4 minutes ago, jbchang83 said:

@speechlesi have not tried your solution yet, as that would be something of a final resort for me.  Also question, if I am using VLC through the emby android app, is it not "streaming" the file from the emby server?  I am not using VLC on the server itself.

@ebri have also just done some tests on Android with changing the video quality.  The problem occurs with "auto - direct" and all 1080p 60mbps to 4mbps.  Anything 720p and under is smooth...

When Emby asks the VLC player to play the file it is no longer streaming. Emby sends an intent/action which starts VLC with a link to the file you have asked to play. It is no longer really using Emby after this point. VLC takes over the playback entirely as a file. When VLC is done playing it must send back the progress/played states to Emby after you play so that Emby can update these. Otherwise using VLC you would have no resume or watched status updates.

When transcoding occurs it will create a streaming friendly version using an m3u8. It is no longer using the original file. That is why you notice it is smooth.

The issue is your file. Remux your file should be a quick process under a minute. Then test the file inside Emby using an Emby app and if it no longer has the issue this is your solution.

Conversely, in the Roku Emby app you can use the cog/gear during playback and select "Attempt Playback Correction" which will then repackage the file using an m3u8 and copy the streams. That will also fix the playback issue but must be done every time.

  • Like 1
Posted

@speechles Thank you for taking the time to explain.  I will try your solutions and report back later today!

  • Thanks 1
Posted

@speechlesi found in another one of your threads with someone posting about similar hevc problem that hitting "playback correction" *twice* would transcode to 264 and sure enough that worked.

I will test the remuxing the files later today as well.

Posted

@speechlesI tested removing the global tags with mkvtoolnix and remuxed original mp4 as mkv file and the video plays fine now.  Any downsides to removing these tags?

Posted
23 minutes ago, jbchang83 said:

@speechlesI tested removing the global tags with mkvtoolnix and remuxed original mp4 as mkv file and the video plays fine now.  Any downsides to removing these tags?

There is no downside to stripping out the tags. The global tags refer to the entire file. The tags refer to a certain stream. Neither are very useful unless you want to encode something exactly the way those are done. Then you could use those tags to see which program they used to encode with, which parameters they used, etc. Then you can encode something exactly the same way. For 99.999% of people the tags are just garbage and clutter that cause problems with playback.

Posted (edited)

@speechles I also just tested on a problematic video remuxing mp4 to mkv WITHOUT removing any tags and it also plays fine after on roku...?

Edited by jbchang83
Posted
2 minutes ago, jbchang83 said:

@speechles I also just tested on a problematic video remuxing mp4 to mkv WITHOUT removing any tags and it also plays fine after on roku...?

The MP4 container adds global tags as header data. The MKV container adds them as streams. Those tags might not be fully supported inside an MP4 container but are supported within an MKV container. Some players can work-around bad data, other plays will choke and stumble over it.

If this is something using DolbyVision you must keep them inside an MP4 container for the DolbyVision to trigger correctly. If the file is not DolbyVision you are safe to keep it as an MKV and get rid of the MP4.

  • Like 1
  • Agree 1
Posted

For posterity, here is my batch conversion solution which finds all videos with 265 in the title with mp4 extension, remuxes them to mkv & strips the tags, and deletes the original file.  Maybe someone will find it useful in the future.

~/Scripts/remux.sh:

 

#!/bin/bash
# converts mp4 to mkv without tags and deletes original file
# usage: bash remux.sh INPUT.mp4

input="${1}"
output="${input%.*}.mkv"
mkvmerge -o "${output}" "${input}"
mkvpropedit "${output}" --tags all:

# can comment this out if you don't want to delete original file
rm ${input}

 

find ~/Videos -iname '*265*.mp4' -execdir bash ~/Scripts/remux.sh {} \;

 

  • Like 1
  • Agree 1
  • Thanks 1
  • 4 weeks later...
Posted (edited)

I have similar problems with x265 mp4 files playing on Android TV app and web player. Stuttering throughout. Using MKVToolNix to remove the tags DOES solve the problem. 

Thank you @speechlesfor the info and @jbchang83for the confirmation!

But the majority of my movie library need to be remuxed this way. And it's not easy as they are all on a NAS. Is it a relatively easy fix for the Emby apps now that the cause is clear?

Edited by frankzhlew
Posted

You can prob SSH into your NAS and run the same script on them.  That's what I did on mine, and I have a UGREEN NAS that runs a customized Debian.

  • 11 months later...
mark19721964
Posted
On 1/12/2025 at 11:48 AM, speechles said:

image.png.5eb979479676b0027ff81d7032ea4a87.png

I have had this happen before. I had used MKVToolNix GUI to fix the file.

Uncheck any tags, both global tags and tags so they are not recreated in the remuxed file. Leave the rest alone and remux the file. The remuxed file should now play without issue.

Since you have the issue on both Android and Roku it is an issue inside your file. When you remux the file MKVToolNix will optimize the file placing all the contents in the correct order to create a streaming friendly version. The reason VLC can play it correctly is it can see the entire file all at once and it can play as a file. Emby clients do not have access to the entire file. They must stream it over http. The file must be optimized for streaming to play efficiently. Please try to remux the file with MKVToolNIX GUI and then let us know if this solves the problem.

I've rand into this EXACT freaking thing on Roku/Emby.... Plays perfectly fine on VLC, smooth, but Roku / Emby Direct play playback is stuttery (like it's using 1/2 the FPS) or something... remuxed through mkvtoolix always fixes it... I didn't even delete any of the tags in the past... Just merely remuxing it fixes it for me... the dread is not knowing which movies will do this until you finally play them....Example: It's not all HEVC /h265 movies, but when it happens it's always HEVC, just not all of them. Not sure what aspect of the particular file causes it. I just know remuxing it helps

jbchang83
Posted

For me, it seems to be a combination of mp4 or unoptimized mkv.

I created scripts that use mkvmerge for remuxing mp4s and mkclean to optimize mkvs.

My new discovery is that ffsubsync can extract and auto sync your subtitles if they are off.

Posted

Unfortunately, the Roku player has about zero tolerance for anything out of spec.  

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