Jump to content

HEVC playback issue 1080p / stuttering / out-of-sync subs / sound distortion


Kwin

Recommended Posts

Hi there!
I'm runnin Emby 4.0.0.2 on a Intel NUC i5-7260U which I bought specifically for the purpose of transcoding properly, which my NAS just can't handle. x264 playback is just fine, no problems there. HEVC playback was a bit wonky on the previous versions ( QuickSync transcoding was a mess on h265 ) which crippled playback to a Chromecast, wouldn't even start playing.

Anyways, since 4.0 it seems to be running a lot smoother! As for the problem, here's the weird part...
I was playing a HEVC movie in Emby Theater ( on the same machine as Emby Server ) so it wasn't streaming over DLNA or over LAN/WAN. Dashboard confirmed that it was a Direct stream without any transcoding. Yet I experienced major issues with playback about 20min in. It starts with a few glitches, then sound distortions, then subtitles go out of sync ( tried both internal and external subs ) and finally playback starts to stutter every few seconds as if the server can't keep up ( what you'd usually see when transcoding is too slow ).

Going back into the menu and restarting/resuming play fixed it for about 20min before it started again. CPU, RAM load was fine, nothing bottlenecking as far as I could tell. I've tried turning subs on/off without any results.

This is the first time I'm experiencing playback issues on the server itself, i'm familiar with the usual DLNA (chromecast) issues i've had before or transcoding delays when streaming to a remote device, but this is new. I'm wondering if it's the server or a bad file that's causing this.. I don't know how to interpret the logs myself.

I was playing Triangle 2009 BluRay 10Bit 1080p DD5.1 H265     ( Both Emby Theater and Emby Server running on Win10 ). Playback/transcode/encode settings are left to default.

Hoping you could shed some light.

 

Edited by quintox
Link to comment
Share on other sites

Thanks for your quick reply! I'm afraid I don't have a ffmpeg log that can help. The latest is a few days older and didn't include info from the problematic stream. Unless it's still usefull?

 

Let me know and I'll upload the latest I can find.

Link to comment
Share on other sites

Can you recreate the problem again, and then attach all log files that were written to during that time period? Thanks !

Link to comment
Share on other sites

I think I found the problem.. don't think it was a playback issue. I had a tool installed that automatically transfers downloaded movies to my NAS, but it wasn't functioning as intended.
Instead of skipping existing files, it copied (overwrites) everything over 24/7 every 60sec between each completed transfer. I think it was roughly +/- 20min before the file transfer got to the movie Triangle ( alphabetic ).

I suppose the server/playback could be showing issues with subs, sound and glitchy video when the source file is being tampered with?

---------------

Only problems with playback I still have are when transcoding/playing in Firefox. I notice that high bitrate HEVC movies have sound stutters in Firefox ( AAC transcode ) but work fine in Chrome ( MP3 transcode ).
Theater shows no problem since it's a direct stream.

Checked server resources and neither CPU nor Ram were showing issues that they couldn't keep up. So it doesn't seem to be hardware related. I only experienced problems with high bitrate movies ( 14.000Kb/s ), a 3000Kb/s stream that I tried was working fine.

Edited by quintox
  • Like 1
Link to comment
Share on other sites

 

 

I suppose the server/playback could be showing issues with subs, sound and glitchy video when the source file is being tampered with?

 

Yes i'm sure all kinds of problems could occur.

Link to comment
Share on other sites

  • 4 weeks later...

Update:
The server has been working fine since my last problems that had to do with that darn media-transfer tool. Firefox keeps on stuttering as expected, but Emby theater and native android worked fine.

Yesterday I had problems though.. I was streaming a h265 movie to my Chromecast and it was being transcoded, about an hour in it started to stutter like crazy. After pauzing the stream for a bit and restarting, it resolved the issue for a few min. before starting again. So I figured it had to do with transcoding speeds, but in the dashboard it showed that it had a 1:50min buffer and Throttle was active. So I decided to turn off throttle and see if that would fix the issue, but it didn't.

It was transcoding at 30fps and server didn't have high load at all, so it doesn't seem to be hardware related. Strange that it worked fine the first hour and started having issues in the second hour of the movie.

I've added ffmpeg logs for the first hour and after i've restarted the stream to try and fix it. In the end I stopped trying/watching because I couldn't get it fixed.. 

ffmpeg_log.txt

ffmpeg_log_first-hour.txt

Edited by quintox
Link to comment
Share on other sites

Hi, can you try with another video and compare? Can you try lowering the chromecast quality setting before casting?

Link to comment
Share on other sites

Haven't had the time to try it yet, but isn't Emby supposed to do this automatically if it's set to auto?

Also, isn't this related to transcode rather then stream quality settings if h264 content has no playback issues?
If it was straining the CPU, wouldn't this prevent throttle to kick in? Logs show it's disabling/enabling throttle numerous times, indicating it's keeping ahead of playback just fine.

So, do you think it's a wireless connection issue instead? With an estimated "bitrate=5843.5kbits/s" (from the log) this seems unlikely as well, since the Chromecast2 supports 802.11 b/g/n/ac wifi. Wifi test measures at 180mbit at the location of the Chromecast.

I'm all for testing new video files, but this takes some time if it happens after an hour of playback :P I was hoping there are better ways to test this.. less time consuming.
I finished watching the same movie (Creed) yesterday on the server itself via Theater ( direct playback ) and had 0 issues. 

Link to comment
Share on other sites

Alright, I'll give it a try next weekend.

But can you shed some light on my other questions if you could?
How come this is only limited to 265(transcoded) content streamed to Chromecast on a local netwerk? Doesn't happen with 264 content. I'm just wondering how lowering the settings could potentially fix it.
If (lack of) netwerk bandwidth was the issue, then all content would suffer from this, and if the server isn't able to transcode quickly enough you'd see this in both the ffmpeg log and Windows taskmanagement.
If something is bottlenecking, you should be able to measure this somewhere.

So i'm ok with running a few tests with the settings, but I'm trying to understand how it works.

Edited by quintox
Link to comment
Share on other sites

  • 2 weeks later...

Hey,
So I got new reports from a friend who tried to watch H265 content remotely ( also by streaming to their chromecast ). Content was playing fine on their (android)phone, but started having issues when streaming to chromecast.H265 content was playing, but some files refused to start ( loading spinner visible and then just stops loading ). H264 content streamed without transcoding.

When I looked at the log I noticed that the troubled streams showed this at the bottom:
Conversion failed!

This happened on a movie and 1 specific episode on a TV show. The user managed to get the problematic episode to play after refreshing serveral times and switching to the next episode and back. Other episodes ( same codec ) worked fine. I've checked the files and they are pretty much the same, all episodes and movie have a bitrate of aprox 2700 kbps

I've attached the 2 logs.
 

Edited by quintox
Link to comment
Share on other sites

  • 3 weeks later...

@quitox - The upcoming beta has improved detection and handling of 10 Bit content.

 

I would be glad if you could retry once it's released.

Link to comment
Share on other sites

@quitox - The upcoming beta has improved detection and handling of 10 Bit content.

 

I would be glad if you could retry once it's released.

Great! I'll have a go once it's out. Any ETA on this beta version (or stable release)?

Link to comment
Share on other sites

  • 4 weeks later...

@quitox - The upcoming beta has improved detection and handling of 10 Bit content.

 

I would be glad if you could retry once it's released.

Hey,

So I received a new version last week ( 4.1.0.26 ) but it seems it made things worse.. now it's no longer limited to H265 content, but H264 content has issues as well.

 

H265 episodes won't start at all ( Conversion failed! )

H264 episodes started playing, but failed after a few minutes. Emby skipped to the next episode instantly. ( Conversion failed! )

 

Is there maybe a workarround for this? Like disabling QuickSync transcode or something? Atleast untill you figured out what the problem is, wether caused by software or hardware on my end, I don't really know what's causing these conversion errors.

 

H265 error:

Press [q] to stop, [?] for help
[Parsed_subtitles_3 @ 000002affa431080] Shaper: FriBidi 1.0.5 (SIMPLE) HarfBuzz-ng 2.0.2 (COMPLEX)
[Parsed_subtitles_3 @ 000002affa431080] Loading font file 'C:/Users/***/AppData/Roaming/Emby-Server/programdata/fonts/DroidSansFallback.ttf'
[Parsed_subtitles_3 @ 000002affa431080] Using font provider directwrite
[hwdownload @ 000002aff8507900] Invalid output format nv12 for hwframe download.
[Parsed_hwdownload_1 @ 000002affa432180] Failed to configure output pad on Parsed_hwdownload_1
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #0:0
[aac @ 000002aff82e9b40] Qavg: 51848.844
[aac @ 000002aff82e9b40] 2 frames left in the queue on closing
Conversion failed!

H264 error:


Setting throttle value to 100 ms
elapsed=00:02:11.56 frame= 6120 fps= 47 q=19.0 size=  101486kB time=00:06:54.88 bitrate=2003.9kbits/s throttle=100 speed=3.15x    
elapsed=00:02:12.10 frame= 6120 fps= 46 q=19.0 size=  101486kB time=00:06:55.03 bitrate=2003.1kbits/s throttle=100 speed=3.14x    
elapsed=00:02:12.65 frame= 6123 fps= 46 q=19.0 size=  101486kB time=00:06:55.10 bitrate=2002.8kbits/s throttle=100 speed=3.13x    
elapsed=00:02:13.20 frame= 6124 fps= 46 q=19.0 size=  101486kB time=00:06:55.22 bitrate=2002.2kbits/s throttle=100 speed=3.12x    
elapsed=00:02:13.74 frame= 6125 fps= 46 q=15.0 size=  103583kB time=00:06:55.35 bitrate=2042.9kbits/s throttle=100 speed=3.11x    
elapsed=00:02:14.29 frame= 6130 fps= 46 q=19.0 size=  103583kB time=00:06:55.35 bitrate=2042.9kbits/s throttle=100 speed=3.09x    
elapsed=00:02:14.84 frame= 6132 fps= 45 q=19.0 size=  103583kB time=00:06:55.46 bitrate=2042.4kbits/s throttle=100 speed=3.08x    
elapsed=00:02:15.38 frame= 6132 fps= 45 q=19.0 size=  103583kB time=00:06:55.61 bitrate=2041.7kbits/s throttle=100 speed=3.07x    
elapsed=00:02:15.93 frame= 6136 fps= 45 q=19.0 size=  103583kB time=00:06:55.65 bitrate=2041.5kbits/s throttle=100 speed=3.06x    
elapsed=00:02:16.48 frame= 6136 fps= 45 q=19.0 size=  103583kB time=00:06:55.80 bitrate=2040.7kbits/s throttle=100 speed=3.05x    
elapsed=00:02:17.02 frame= 6139 fps= 45 q=19.0 size=  103583kB time=00:06:55.86 bitrate=2040.4kbits/s throttle=100 speed=3.03x    
[AVHWFramesContext @ 000002389aac87c0] Error synchronizing the operation
[hwupload @ 000002389a63bf80] Failed to upload frame: -1313558101.
Error while filtering: Unknown error occurred
Failed to inject frame into filter network: Unknown error occurred
Error while processing the decoded data for stream #0:0
[aac @ 000002389a9ba180] Qavg: 208.664
[aac @ 000002389a9ba180] 2 frames left in the queue on closing
Conversion failed!

See attachments for full logs.

emby_h264_log.txt

emby_h265_log.txt

Edited by quintox
Link to comment
Share on other sites

Have you installed the latest Intel video drivers?

For some weird reason my NUC was on old (august 2018) drivers and thought it was up to date, intel uses its own update software but it fails to install/find the recent DCH drivers. I've manually updated to the latest driver for Iris Plus 640 ( DCH 26.20.100.6709 ), but unfortunately after testing the problem was still there.

Updating did not solve conversion issues ( server is running on a Intel Core i5-7260U ).

 

 

    Last message repeated 3 times
Stream mapping:
  Stream #0:0 (hevc_qsv) -> scale_qsv (graph 0)
  scale_qsv (graph 0) -> Stream #0:0 (h264_qsv)
  Stream #0:1 -> #0:1 (ac3 (native) -> aac (native))
T=0.062s
Press [q] to stop, [?] for help
[h264_qsv @ 000002781e6c4cc0] Current pixel format is unsupported
[h264_qsv @ 000002781e6c4cc0] some encoding parameters are not supported by the QSV runtime. Please double check the input parameters.
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
[aac @ 000002781e6c3f00] Qavg: 60338.617
[aac @ 000002781e6c3f00] 2 frames left in the queue on closing
Conversion failed!
Edited by Kwin
Link to comment
Share on other sites

I suppose you have to ask that question, but yes, obviously i've rebooted the machine :P

Intel moved from their old standard drivers to DCH drivers, both the driver as the display software has changed quite a bit. Since Intel Update Assistant wasn't able to find/install the GPU driver ( as mentioned in my previous post due to: https://www.intel.com/content/www/us/en/support/articles/000005469/graphics-drivers.html ) I had to manually install the driver via hardware devices, and that requires a reboot to make it work.

Both Windows device properties and Speccy indicate that the iGPU is running the latest version of drivers. See screenshot.
 

 

post-320029-0-98147800-1556541971_thumb.jpg

Link to comment
Share on other sites

Could you please post a full hardware detection log and a full ffmpeg transcoding log alongside a short description what's going wrong in that specific case.

 

Thanks.

Link to comment
Share on other sites

Kwin

Hey @@softworkz

Short description:
HEVC content ( not sure if limited to 10bit ) fails to play on Chromecast, resulting in conversion failures when transcoding.
I've just checked latest logs from a user, he tried to play a movie several times. In 1 instance the movie failed to transcode, resulting in a "conversion failed message", while the other succeeded (same movie file).

The main difference between the 2 are what is listed under "affected codecs", the one that succeeded lists 2 extra entities. I've checked with the user and he tried to play it on Chromecast first (didn't work) and then tried on Windows10 Chrome which did work.

I've attached logs for both streams and my hardware detection log  ( and 1 extra log for a failed stream from a different user with a different video file but also on Chromecast ).



P.S. Is there a way to change the title of this topic? "hevc playback issue 1080p / stuttering / out of sync subs / sound-distortion"  is no longer accurate. stuttering/subtitle/sound issues are no longer present, it's only H265 transcoding when streaming to Chromecast that's having issues now.

ffmpeg_h265_chromecast_failed.txt

ffmpeg_h265_win10-chrome_succeeded.txt

hardware_detection.txt

emby_h265_log.txt

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