Jump to content

Recommended Posts

Posted

Hey, i recently aquired a 4k monitor and wanted to check the differences ( coming from a 1080p monitor) but when i try 4k it will play the first few seconds, stutter for a couple seconds and then it just repeats itself. If i pause the video and let it "buffer" so to speak then it can play a bit longer but the stuttering will happen again depending on how long i wait to resume playing the video.

Added the latest server log, transcode file and a screenshot of my network activity as i was noticing the stutter. Tried with 7.1 audio and ac3 5.1 but didn't matter.

Got a ryzen 7 2700x and RTX 4070 in my pc and i use emby in a browser. Tried Firefox and Chrome but both had the same issue. Hope someone can help out.

 

 

Screenshot 2024-10-20 014002.png

embyserver.txt ffmpeg-transcode-a23d7054-5e07-40d1-906f-27064f11ae0a_1.txt

Posted

Your software encoder is too slow, only roughly 0.66 speed. Do you have premier which allows for hardware acceleration? You could also try playing with Emby Theater instead of your web browser.

Posted

Thanks for the quick reply! I do have premier. In the transcoding tabe the enable hardware acceleration when available is set to yes. I also checked in chrome to be sure that hardware acceleration is on which it is.

Hadn't heard of Emby Theater before so have not tried that.

Happy2Play
Posted
3 minutes ago, Jerren said:

In the transcoding tabe the enable hardware acceleration when available is set to yes.

What is shown on that page or if you change from Yes to Advanced as the log shows you have not Hardware and could be the TRUENAS config as you are running an older 4.8.1.0 server.

All Software.

>>>>>>  Selected Codecs
Decoder Automatic software decoder


Encoder x264
        Max Bitrate: 781 Mbit/s
        Color Formats: YUV420P, YUVJ420P, YUV422P, YUVJ422P, YUV444P, YUVJ444P, NV12, NV16, NV21, YUV420P10, YUV422P10, YUV444P10, NV20, GRAY8, GRAY10 - Bit Depths: 8, 10, 12, 14
        Profiles: Baseline Profile (Level 6.2), Main Profile (Level 6.2), High Profile (Level 6.2), High 10 Profile (Level 6.2), High 4:2:2 Profile (Level 6.2), High 4:4:4 Predictive Profile (Level 6.2)


>>>>>>  FindVideoEncoder - MediaType: h264, UseHardwareCodecs: True, HWA-Mode: Automatic
Info    Checking: 'x264'
Info    Check successful - selecting 'x264'

>>>>>>  FindVideoDecoder - MediaType: hevc, UseHardwareCodecs: True, HWA-Mode: Automatic
Info    Checking: 'Automatic software decoder'
Info    Check successful - selecting 'Automatic software decoder'

 

Probably need to see a server log from startup showing the hardware detect section and probably the hardware-detect log.

Posted

Since you said i was still on an older version of Emby i updated it to 4.8.10 and it runs smoothly now! Was able to play 2 full minutes without stutter, since i hadn't gotten that far before i stopped but here are the logs in case you still see something wrong. Wouldn't want to start watching a movie in a bit and then realize it stuttered again and have to make another post. So if you could check and let me know it all looks good i would really appreciate it! 

 

 

ffmpeg-remux-f68351ff-c7b9-4f98-b96e-112d667d2479_1.txt embyserver.txt hardware_detection-63865032430.txt

  • Thanks 1
Happy2Play
Posted (edited)

You got lucky this time as the same video did not throw a directplayerror and was able to copy video and convert audio.  But need to protentially troubleshoot your Hardware as it does not appear to be showing any available hardware for HWA.

@JerrenCan you show a screenshot of Transcoding-Enable hardware acceleration when available set to Advanced.  As I don't see the RTX 4070 in server or Hardware-Detect log.

Edited by Happy2Play
Posted (edited)

Ah ok. Well my NAS doesn't have a 4070, my pc does. My NAS has an i7-4770K and no gpu since if i recall correctly GPU passthrough wasn't a thing for Emby on Truenas Core. Also why does it need to transcode? It's a 4k file playing to a 4k monitor so it should be directplay right? Or am i missing something?

I did look into going towards Truenas Scale once but since it supposedly didn't have a performance impact i postponed it. Here's the Screenshot @Happy2Play

 

image.thumb.png.b84cb185da2fbf45d9f4e25cfc8baee1.png

Edited by Jerren
GrimReaper
Posted (edited)

You could use different browser (MS Edge, Thorium...) which would play those AC3 audio streams natively so no transcoding would be required. 

Ditto for Emby Theater. 

Edited by GrimReaper
Posted

I checked the stats for nerds thing and it showed directplay for the 4K video. Audio it did need to transcode but doesn't stutter on sound. So i'm curious if the stutter fix for the video playback was as simple as upgrading to the .10 version from .1 or if there's more to it.

Happy2Play
Posted

 

My understanding is that there is really know exactly why the player/client throws the DirectPlayError and the server just respond with making the media playable by transcoding.  So you need a client that is more tolerant to media conditions/issue but from a browser standpoint Emby has no control over their players.

Quote

&TranscodeReasons=AudioCodecNotSupported,DirectPlayError

Don't know the platform or the requirements to get HWA working but even if you did the 4770K would have limited capabilities with the igpu.

Posted

Yeah i looked around a bit and there was a forum where someone gave a rough estimate on what a cpu can do for transcoding. If your cpu had a score of 2000 in Passmark then it could do 1080p transcoding, 12 000 in Passmark was 4k SDR and 17 000 was good for 4k HDR. The 4770k has a score 7 k'ish so can do multiple 1080p streams at the same time ( found someone who managed to do 10 at the same time on that cpu). For 4k transcoding it's too weak. Been looking at upgrading my NAS with my current cpu and mobo and the 2700X that i currently run has a score of 17k + which would help for potential transcoding in the future.

 

I think maybe Emby was still on a 1080p monitor the first times i tried playing and when moving the browser window to the 4k monitor it was still under the assumption that it needed to transcode the 4k file to a 1080p resolution. Could be wrong but it's the only reason i can think off right now as to why it would want to even begin transcoding the 4k file. 

 

Does Emby have on option to enforce direct play somewhere?

Happy2Play
Posted
10 minutes ago, Jerren said:

I think maybe Emby was still on a 1080p monitor the first times i tried playing and when moving the browser window to the 4k monitor it was still under the assumption that it needed to transcode the 4k file to a 1080p resolution. Could be wrong but it's the only reason i can think off right now as to why it would want to even begin transcoding the 4k file.

No my understanding is it attempted to Direct Play but the Player threw an error and Emby just moved on to full transcode.  But I don't know if there is anything info actually available on hy especially for the Browser.  

If it were another client then some of them actually have their own logging that would provide additional info.

11 minutes ago, Jerren said:

Does Emby have on option to enforce direct play somewhere?

Yes/No yes there is an option per user to disable transcoding but if transcoding is required the media will not play or may have issue per the note on the settings.

image.png.9809a7fd15032f3281fcf685bc7c84b8.png

Posted (edited)
5 hours ago, Jerren said:

Yeah i looked around a bit and there was a forum where someone gave a rough estimate on what a cpu can do for transcoding. If your cpu had a score of 2000 in Passmark then it could do 1080p transcoding, 12 000 in Passmark was 4k SDR and 17 000 was good for 4k HDR. The 4770k has a score 7 k'ish so can do multiple 1080p streams at the same time ( found someone who managed to do 10 at the same time on that cpu). For 4k transcoding it's too weak. Been looking at upgrading my NAS with my current cpu and mobo and the 2700X that i currently run has a score of 17k + which would help for potential transcoding in the future.

 

I think maybe Emby was still on a 1080p monitor the first times i tried playing and when moving the browser window to the 4k monitor it was still under the assumption that it needed to transcode the 4k file to a 1080p resolution. Could be wrong but it's the only reason i can think off right now as to why it would want to even begin transcoding the 4k file. 

 

Does Emby have on option to enforce direct play somewhere?

The Guideline

Very roughly speaking, for a single full-transcode of a video, the following PassMark score requirements are a good guideline for the following average source file:

  • 4K HDR (50Mbps, 10-bit HEVC) file: 17000 PassMark score (being transcoded to 10Mbps 1080p)
  • 4K SDR (40Mbps, 8-bit HEVC) file: 12000 PassMark score (being transcoded to 10Mbps 1080p)
  • 1080p (10Mbps, H.264) file: 2000 PassMark score
  • 720p (4Mbps, H.264) file: 1500 PassMark score

The CPU Benchmark website is a good resource to see what sort of PassMark score a particular processor received.

Related Page: CPUbenchmark.net

It's originally from a Plex article dated 2019 but has been updated for 4K. Plex also uses a version of ffmpeg for transcoding so it should be roughly comparable. If memory serves me right, the test was only transcoding the video stream while copying one audio track. No subtitles were present in the test files. Tests were done using the Very Fast profile with only one playback stream being done on the server. It was sort of a "best case" test. I believe the files were served from SSD drives.

Multiple audio tracks, embedded subtitles (even if not used), other people on the system using CPU and IO resources will all come into play. Recent CPUs often handle hyperthreading differently if at all, since many newer CPUs from Intel have both P-core (performance core) and E-core (efficiency core) which can trip up transcoding big time if it has to wait for a process running on an E-Core to finish. Same with dynamically speed adjusted cores. Short of adjusting CPU affinity and/or locking ffmpeg to only run on specific cores you can end up with something like this (ffmpeg):
image.png

This doesn't even consider the color space used, the parameters used on the original encoding affecting the Group of Pictures (GOP) used together which affects the compression and how many bytes are needed to decode. Many files have poorly encoded streams requiring reading from different parts of a file. They could have inconsistent GOPs or missing peices from people editing or cutting commercials incorrectly. Short of having encoded all your own files in a consistent manner one file could be dramatically different from the next in CPU & IO resources needed to transcode it.

Personally, I'd try and pad the suggestions at the bottom tier by 500 for 720 and 1080 to have a little extra CPU head space available.
You can always test encoding yourself via Emby with different profile settings to see what fps you get during transcode (test a few sources).  Then lookup the Passmark score for the machine you tested on.  Knowing the Passmark and FPS you get can help you determine what is needed (pad it).

One other thing to think about is how the speed of transcoding affects the startup time of playback. If you barely transcode at 1x the player is going to need to wait longer to receive anything vs a 2X or 3x speed of transcoding.  The sooner Emby server has the first part of the transcode, the sooner it can be sent to the client.  Same on anything trick play such as FF or jumping to a new part of the video that requires the transcoder to start again at the new point if not already processed.

Better yet, purchase/build something with QuickSync on the CPU so transcoding can be offloaded and not have to worry about it. :)

Edited by Carlo
Posted

Well my 2700x is from before Intel's P and E cores, not sure how it will do transcoding in the future but passing the 17k score marker does make me think it will be able to do much better then my currently used 4770k. To be clear i tend to use the personal pc hardware for my NAS when i upgrade my personal machine.

 

I thought maybe Emby would remember the machine it plays too and know to do directplay but it's checking each time as i assume it's supposed too. Tried a bunch of times with the same file last night and went to bed thinking it would always directplay that file but woke up, gave it a go and wanted to transcode again which is why i tried those options Happy screenshotted before to turn off the transcoding for a user. 4k playback goes smoothly as expected when it's directplay,. for some reason if i turn off audio transcoding then i just get no audio so i left that on. This could be a working solution but i would rather leave transcoding on in case my brother watches something on his phone. 4k in general is something i haven't dabbled with before.

Posted

In the client check the playback options:
image.png

Try turning off the remember feature and clear the saved tracks.
 

That may be the reason you are seeing it transcode if it didn't need to otherwise.

 

Posted

Oh no i guess i mis explained? The audio isn't an issue. Atleast i don't think it's an issue, directplay works when i turn of the allow transcode video option.

I just don't really want to turn that off as i don't need a 1080p stream to my phone if i want to watch family guy while waiting somewhere. Can't really find anything related to firefox or chrome either when it comes to 4k file playing.

It probably doesn't matter in comparison  but for example playing a 4k vid on youtube and checking that stats for nerds option, buffer health is between 6 and 11 seconds +- and no stutter. Not sure what else i can try.

Happy2Play
Posted
3 hours ago, Jerren said:

It probably doesn't matter in comparison  but for example playing a 4k vid on youtube and checking that stats for nerds option, buffer health is between 6 and 11 seconds +- and no stutter. Not sure what else i can try.

Sorry but I can almost guarantee you are not getting a 60Mpbs+ file from any online streaming provider.  So comparing to services that have optimized/multiple files at significantly lower bitrates can't really be a comparison.

Posted

Yeah that's what i figured but i want to try and help to figure out how to fix it and finding a different source for a 4k file was the first thing that came to mind.

If there's anything  i can try please let me know. Or if it's just not fixable then that's an answer too i guess. 

Happy2Play
Posted

In the end you can disable allow video transcoding to maybe bypass whatever the browser player is chocking on but may run into other playback issues per the note for the settings.

And 4K via old hardware will be challenging as it will not handle transcoding very well if at all.  But may want to look at a different client then a Browser also or even different browser as mentioned above.

 

Posted
On 10/20/2024 at 4:39 PM, Jerren said:

I checked the stats for nerds thing and it showed directplay for the 4K video. Audio it did need to transcode but doesn't stutter on sound. So i'm curious if the stutter fix for the video playback was as simple as upgrading to the .10 version from .1 or if there's more to it.

Hi, are you saying you're no longer having this issue?

Posted

I do still have the issue when using Chrome or Firefox. 

When i disallow the transcoding it does directplay as it should but i want to keep the transcoding functionality. That post was in relation to turning off transcoding on my user.

I'm not sure why emby does not get the info it needs to do directplay automatically. At first i thought it might be because i use firefox in multiple windows and across multiple screens, so it got some info confused. But when i tried Chrome which i used on the 4k monitor only and only have the 1 window off,  Emby still doesn't do it correctly.

Also kinda interesting is that sometimes after trying at the start, it would play that first file in directplay for a couple attemts before going back to trying to transcode it. 

For the moment i've installed Emby Theater as a workaround for 4k content but i would prefer being able to use the webgui as i've been doing on my pc for ages now.

Posted (edited)

Chrome and specially Firefox doesn't support many formats. You need Edge if you want the most support.

Basically you can forget about 4k HDR and so on in s browser unless you use Edge. Even then you need to buy a license in the Microsoft store to make it possible.

Edit: I mixed up h265 and .mkv. meant to say, Mkv tend to not be well supported on browsers as far as I can see

Edited by yocker
Posted

h265 playback works in most browsers with hardware acceleration enabled, no license required. You'll be limited to specific audio formats unless you use a browser with additional audio codec support like Chromium.

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