Jump to content

Transcoding/FFMPEG issues with 4K HEVC


Recommended Posts

Posted (edited)

Hey guys,

 

So I have a fresh headless install (roughly a week old) of Debian inside a VM that only runs Emby and Plex. Emby version 4.0.2.0. Users Jake and Angel. The media is hosted on the same physical machine (unRAID), but is on a mounted "network" drive. Read/write performance to the folder with the media is totally fine, like 250MB/s which is definitely sufficient for video playback.

 

The host machine has an i7 7700K (Kaby Lake) with all 8 threads allocated to the VM, no external GPU. There is 8GB of RAM allocated to this VM, and it doesn't seem to go above 75%. It's not swapping out to the hard disk.

 

When playing 4K HEVC videos to Windows in the Firefox or Chrome player, it stutters every couple seconds because the transcoder can't keep up. I've tried changing the playback settings to various values, from 120Mb/s 4K to 144p. CPU is maxed out, as expected, but can't maintain an FPS greater than the video FPS. When clicking to a different position in the video, 50% of the time it takes forever to start playback again (expected), and 50% of the time it just refuses to start back up.

 

The video file in question, Warcraft (2018) is an MKV encoded with HEVC at 4K. This issue happens with other 4K videos in the same format as well, such as Ready Player One, and The Incredibles 2. The given reason for transcoding is "container not supported". It's converting to H.264.

 

It plays fine locally, without Emby through VLC on the same computer. It plays fine in Plex for the most part (given proper buffering time).

 

After exiting playback, there are a number of FFMPEG processes running that seem to consume TONS of CPU time. See attached screenshot, there are no devices currently playing any media from either Emby or Plex at the time. Attached FFMPEG logs are in order from top to bottom in the GUI, starting at 1 and going to 4. In the screenshot, the Putty terminal is the server running Emby (using Glances, similar to Top). The Firefox window is the Emby GUI. Taken from the computer I'm watching from.

 

 

 

I guess my questions are as follows:

 

  1. Why is it transcoding in the first place?
  2. Can I prevent the transcoding by any means using the same player?
  3. Can I reduce the impact of the transcoding? Even if it means throwing a 10-series GPU in there and passing it through to the VM to use only for transcoding?
  4. The lingering FFMPEG processes consume way too much CPU, and affect other streams. Why is it running?
  5. Can I configure something to end the random FFMPEG processes that just don't die after any amount of time?

EDIT: Screenshot didn't post in line with the text, so it's now attached

emby-Log.txt

FFMPEG-Log1.txt

FFMPEG-Log2.txt

FFMPEG-Log3.txt

FFMPEG-Log4.txt

post-333785-0-33595700-1550712121_thumb.png

Edited by jdibs77
Posted

Hi. I can help you with these.

 

 

 

  1. Why is it transcoding in the first place?

Web browsers do not support HEVC. Firefox also does not support the mkv container.

 

 

 

  1. Can I prevent the transcoding by any means using the same player?

 

No, but we have many other apps that can direct play hevc, such as android, iOS, Emby Theater for Windows, and others.

  • Like 1
Posted

 

 

  1. Can I reduce the impact of the transcoding? Even if it means throwing a 10-series GPU in there and passing it through to the VM to use only for transcoding?

 

Yes offloading to GPU can definitely help, if you have one that can decode your 4K hevc content.

Posted

 

 

  1. The lingering FFMPEG processes consume way too much CPU, and affect other streams. Why is it running?
  2. Can I configure something to end the random FFMPEG processes that just don't die after any amount of time?

 

You don't need to do anything, they will close on their own. Can we please go over an example? thanks.

Posted

Hi. I can help you with these.

 

Web browsers do not support HEVC. Firefox also does not support the mkv container.

 

 

No, but we have many other apps that can direct play hevc, such as android, iOS, Emby Theater for Windows, and others.

 

Okay that's actually really good to know, I'll just start using Emby Theater then! And to resolve any issues with non-compatible clients, it looks like my next computer purchase is going to be a GTX 1030 to offload to. Thank you Luke, you're the bomb

Posted

Thanks for the feedback.

Posted (edited)

You don't need to do anything, they will close on their own. Can we please go over an example? thanks.

I may have been a little premature in this part with the ffmpeg processes. The top process in the screenshot (Warcraft 2018) stayed open indefinitely. I let it run for about 2 hours without doing any streaming from any devices, and it still didn't close. The other ones (including the "Ready Player One" process that's also using a ton of CPU) eventually did after about 30 minutes or so.

 

However, it looks like I wasn't only dealing with a transcoding performance issue on that file specifically. When playing locally on a separate machine through VLC that file seems to crash or not work at around the 1:30:00 mark and onward. So I'm pretty sure the abandoned ffmpeg process is due to that specific file having issues. Obviously I can't point the finger at Emby for having unexpected behavior when it's my own file that's apparently having issues!

 

I'm only mentioning it now because I wasn't able to find anything that mentioned that when looking for similar issues. So if anyone out there reads this, check and double check your media the entire way through! Obviously I don't expect the Emby team to care about it, but I'd be down with giving Emby permissions to sudo-kill processes if it's somehow become orphaned or can't otherwise be closed normally

Edited by jdibs77
Posted

That's interesting, thanks for the info !

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