Jump to content

Problem transcoding when source file is h.265


muzicman0

Recommended Posts

muzicman0

I am attaching the FFMPEG logs from when I tried to watch a UHD disc rip last night, as well as the embyserver logs (which I think is the right one).  I am using a Nvidia GTX 1660 and hardware acceleration.  I can reproduce this issue reliably, and I also see similar problems with other h.265 source files that are transcoded using Hardware acceleration.

NOTE: If I don't use Hardware acceleration, I do not see this, but that is not a long term option for me.

PROBLEM: Specifically with this video, at roughly time 00:01:32, the video will repeat the same thing over and over again (maybe 1 second of video, but that is a guess).  subtitles if enabled, I think continue, but not the video.  Audio also continues.  If I skip forward far enough, then it will play fine.  Another interesting observation is that the the 'time' that pops up when I move the mouse across the playback timeline is not correct.  If I put it on 00:02:00, it is roughly 40 seconds off, and jumps to 00:01:20 (ish).

OTHER PROBLEMS: Random time outs.

I archive a lot of Recorded TV into h.265, and we see issues with most of these as well.  I also had problems with another UHD disc (The Greatest Showman), but never seem to have issues with h.264 videos, or MPEG-2 stuff.  So it seems to only be h.265 encoded source videos.  Also never have problems when I don't encode, so I don't believe it is a decoding problem.

I updated the Nvidia driver to the latest this morning, and that did not fix the issue.

UPDATE: I tried a different application that can do hardware acceleration (JRiver), and it did not have the same issue.

embyserver-63731318396.txt ffmpeg-transcode-cb8a6890-97cf-4525-9737-0b62edb09656_1.txt

Edited by muzicman0
typo/update time stamp to correct
Link to comment
Share on other sites

Did you do all the encoding of these files?

If so what program did you use?

Link to comment
Share on other sites

muzicman0

The logs are a from a Bluray rip that was ripped using MakeMKV.  But I do encode some of the files we are having issues with using FFMPEG NVENC HEVC.  I can get you the full command line if you want, but it does appear to be unrelated since it happens on at least 2 commercial UHD disc rips.

Link to comment
Share on other sites

I ask because your ffmpeg log file shows these a few times

 [truehd @ 000001669afc0b40] End of stream indicated.

>> ThrottleByStreamBufferSize: Playback position unknown

That looks suspect to me from a quick glance but @softworkz could better tell if that has any meaning or if he sees anything else in the logs.

Link to comment
Share on other sites

muzicman0

Thanks.  I also realized that it may be a decoding problem, since the only time hardware decoding would happen (I assume), is when I am encoding.  Is there any way to turn off Hardware decoding, but leave encoding active?  Just to test?

Link to comment
Share on other sites

Yes, switch to ADVANCED in HW transcoding in the web admin and you should see two different sections.

It should make sense when in ADVANCED mode.  If not just ask.

Link to comment
Share on other sites

muzicman0

Perfect.  So it does appear to be the decoder.  Biggest problem is, even though I enabled the Intel HW acceleration for decoding h.265, my CPU is still getting hammered (while still leaving hardware encoding on - Intel i7-4790k 4.0 Ghz).  I have a GTX 1050 laying around not being used, when I get back home, I may try adding that and using it for decoding to see if it works.  The new GPU architecture on the GTX 1660/RTX line is sooooo much better on the h.265 encoding side I don't want to pull it completely.

If there is any testing you want me to do in the mean time to see if it can be fixed in code, I am happy to help.

Link to comment
Share on other sites

UHD files are tough in general for transcoding.

I try to avoid that on my system by keeping 4K in it's own library and I only grant access to this library for people who can direct play the media.  If they can't direct play it then they have to use the normal version I have in my regular Movies library.

This also solves HDR to SDR color space issues transcoding as well.

  • Like 1
Link to comment
Share on other sites

muzicman0

Understood.  The encoding really isn't too bad with the Nvidia GPU I have, just have to get the decoding working better.  I can do 2 copies if needed, but that would be my last resort.

Link to comment
Share on other sites

muzicman0

Also, keep in mind the archived TV isn't UHD, I encode that with whatever the native resolution was, so either 720p60, or 1080p30 (1080i deinterlaced).

Link to comment
Share on other sites

muzicman0

Thought I found a solution using the GTX 1660, but turns out that the DX11 decoder doesn't actually decode in hardware, so it ended up decoding on the CPU.  I'll try the other GPU when I get home.

Link to comment
Share on other sites

  • 3 weeks later...
muzicman0

So I finally got home (long trip that turned into an even longer trip!), and installed the GTX1050 as a secondary card just to handle the h.265 decoding, but it has the same issue as the GTX 1050.  If I leave it at software decoding, there is no issues at all.  Very frustrating.  I may finally have to look at upgrading my 4th Gen intel CPU to see if some of the newer Intel decoders will work (the Intel 4600 on my i7-4790k doesn't seem to have a h.265 decoder - not that that's surprising!).

Link to comment
Share on other sites

muzicman0

I just did another test, verifying that an alternate media player was using HW accelerated decoding, and it plays the file fine.  

Link to comment
Share on other sites

muzicman0

Here is the latest FFMPEG log.

I notice a ton of these:

09:57:43.348 [graph 0 input from stream 0:4 @ 00000231d1495f00] filter context - w: 3840 h: 2160 fmt: 28, incoming frame - w: 1920 h: 1080 fmt: 28 pts_time: 51.968
09:57:43.348 [graph 0 input from stream 0:4 @ 00000231d1495f00] Changing video frame properties on the fly is not supported by all filters.
 
The file is UHD as far as I know.  It is a UHD disc rip.

ffmpeg-transcode-50252630-cd7a-4f32-874d-3ebae3729bf2_1.txt

Link to comment
Share on other sites

You can't really compare a media player with hardware decoding to a server application that is encoding with hardware for another application to decode. It's just two different workflows.

Try turning off the subtitles and see how that compares.

Link to comment
Share on other sites

muzicman0
22 minutes ago, Luke said:

Try turning off the subtitles and see how that compares.

With subs off, I don't see this issue as well.  What does that mean?

Link to comment
Share on other sites

muzicman0

It seems that unchecking 'Allow subtitle extraction on the fly' has fixed the issue.  I'll keep an eye on it.

Link to comment
Share on other sites

muzicman0

nope, I take it back...after a reboot, the problem re-appeared.  Do you have to restart Emby Server to have hardware acceleration settings take effect?

Link to comment
Share on other sites

Just now, muzicman0 said:

nope, I take it back...after a reboot, the problem re-appeared.  Do you have to restart Emby Server to have hardware acceleration settings take effect?

That will have no effect on the two examples you have provided. Make sure to read the help text underneath the option to learn what it does.

Link to comment
Share on other sites

muzicman0

yeah, turning off subtitles also makes no difference.

 

So to recap, the only thing I can do to make this issue go away is to not use HW Acceleration for h.265 decoding.

Link to comment
Share on other sites

Just now, muzicman0 said:

yeah, turning off subtitles also makes no difference.

Turning off subtitles should make plenty difference. Did you read what i commented on? the option you were unchecking does not equal turning off subtitles.

Link to comment
Share on other sites

muzicman0
22 hours ago, Luke said:

You can't really compare a media player with hardware decoding to a server application that is encoding with hardware for another application to decode. It's just two different workflows.

Try turning off the subtitles and see how that compares.

The application I used to test was actually a server/client setup (JRiver MC).  Even without that, it does tell us something.  It clearly shows that the HW Decoding on the Nvidia GPU/Driver isn't completely broken, since it works in another application that utilizes FFMPEG to handle the decoding.  I am simply trying to narrow down where the problem is.

20 hours ago, Luke said:

That will have no effect on the two examples you have provided. Make sure to read the help text underneath the option to learn what it does.

I did read the text under that option, and it clearly states that it could cause playback options, which is why I tried disabling it.  Turned out it really didn't have an effect on this particular issue.

20 hours ago, Luke said:

Turning off subtitles should make plenty difference. Did you read what i commented on? the option you were unchecking does not equal turning off subtitles.

Plenty of difference in what?  My statement was regarding the issue I am seeing, and it made no difference.  I am understand that the Allow subtitle extraction...option doesn't turn off subtitles, however, when I did turn off subtitles (by setting them to 'off' in the actual player), the issue still occurs.

Link to comment
Share on other sites

Couple of things to clarify.  JRiver MC is nothing like Emby in functionality of decoding/changing/encoding (transcoding).  It doesn't do transcoding or streaming in any sense of what we consider streaming.  It does progressive downloads like we did 20 years ago.  It's a media center so the player running on a PC has the muscle to playback the different formats.  From this standpoint it's much closer to Emby Theater or Kodi in nature.  It can do some very limited transcoding of audio only for playing back audio on other devices.

The option "Allow subtitle extraction on the fly" doesn't apply because you aren't extracting the subs on the fly in your examples.

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