Jump to content

Why is transcoding so slow?


crusher11

Recommended Posts

crusher11

Tried watching Whisky Galore! tonight, but it's unwatchable. It starts out transcoding at a healthy 50fps and within a few minutes drops to 23fps, which is lower than the playback speed. Why isn't it keeping up? I assume my LG TV just can't play VC1? The LG app doesn't actually report a transcode reason.

Either way it should be able to transcode at a much higher frame rate than that, surely? It starts out perfectly fine. I'm running the server on a DS1819+.

embyserver.txt ffmpeg-transcode-31c7ae71-6473-4045-8e3c-82586e55dc40_1.txt ffmpeg-transcode-9108fe4a-3200-4e1c-b5da-7d392934c6d5_1.txt ffmpeg-transcode-316d3ab5-b1eb-4c8a-b7cb-706e9b83ccce_1.txt ffmpeg-transcode-49825cc3-ad03-4eb9-878e-faaade0d1005_1.txt ffmpeg-transcode-8ef319a0-c9b6-4300-b562-216a895f4e0b_1.txt ffmpeg-transcode-67e5ae22-386d-48a9-8fe6-253d1a3bd5e6_1.txt ffmpeg-transcode-984dc271-4ed1-47c8-bd04-88d8f2de3bf0_1.txt

Edited by crusher11
Link to comment
Share on other sites

crusher11

But why would it start at 50fps and then drop to 23fps over 10-20 minutes? That makes no sense.

And how am I supposed to watch anything if it can't transcode it?

 

Link to comment
Share on other sites

crusher11

And in fact, having just gone through and filtered for VC1-encoded files, I see plenty of movies I've previously watched with no problems whatsoever.

 

Link to comment
Share on other sites

1 hour ago, crusher11 said:

 

And how am I supposed to watch anything if it can't transcode it?

 

Play using an Emby app that can direct play the vc1 without transcoding, such as Emby Theater for windows desktop, android, etc.

Or check out our convert feature to convert it to a more streaming friendly format.

Link to comment
Share on other sites

crusher11
2 hours ago, crusher11 said:

And in fact, having just gone through and filtered for VC1-encoded files, I see plenty of movies I've previously watched with no problems whatsoever.

 

@Luke

Link to comment
Share on other sites

I already gave you the answer. Vc1 is considerably slower to decode than other video codecs. Just because you might have some that perform a little better doesn't change that.

Link to comment
Share on other sites

crusher11

"It's a slower codec" is not the answer if it works fine every single other time. 

Something is either different about this specific file, or this specific attempt at playing it. Perhaps a newer version of Emby is less efficient somehow. Perhaps something else is going on with my NAS. But it's not nothing. 

Link to comment
Share on other sites

rbjtech

The complexity of the scenes makes a big difference to the encoding rate - usually when a film starts, it's slow moving static images = high fps. If it then moves into fast paced action, it slows down as it tries to maintain quality (at the cost of cpu/complexity/compression) at the same bitrate.  That is how encoding works.

If your cpu can't keep up - then pre-convert the VC1 to another codec, get a faster cpu that allows on the fly transcoding of VC1 or add hw that supports VC1 decoding.

You can see the effect yourself by opening your own ffmpeg logs - if the 'speed=' is less that 1.0 - then the transcode rate is lower than your playback speed, so it will buffer.   You will see the first ~60 seconds of the film being much higher than 1.0 - then it drops below 1.0 as it starts trying to transcode complex moving scenes.

Edited by rbjtech
Link to comment
Share on other sites

crusher11

It dropped below playback rate on the opening credits of Whisky Galore, but managed to transcode the entirety of Doctor Zhivago... 

Link to comment
Share on other sites

Change the transcoding parameters to make for faster transcoding.  The h264 encoding settings can be adjusted to make it faster but less quality. With a slower processor you have to decide what is more important. Suffer loss of quality but get much faster transcoding and no buffering. Or get better quality and slower transcoding and occasional buffering. With VC1 that codec is process heavy. That means it might take 3-5x as much CPU as transcoding mpeg4->h264 especially during high motion scenes. You have to decide where the "sweet spot" is by adapting those encoding settings to fit your experience you want. We cannot decide how grainy a video is acceptable to you. You do not want to use "Auto" as you already know how that handles things. Changing the CRF to 25 or 28 will help too.

 

Edited by speechles
  • Agree 1
Link to comment
Share on other sites

crusher11

Well I've had zero problems with Shadow of a Doubt, Topaz, Family Plot, Frenzy, Casablanca, 12 Monkeys, How the West Was Won, Doctor Zhivago, Cool Hand Luke, Bullitt, Risky Business, or Amadeus.

All of which would have been much more intensive than the opening credits of Whisky Galore!. Assuming they transcoded. They may not have, I don't know. Does my LG C6 support VC1? The LG Emby app doesn't report a transcode reason, ever, so it's a total guessing game. I don't remember noticing that those previous films were transcoding, but if it was error-free there's no reason I would have thought about it at all.

Link to comment
Share on other sites

It was either the subtitles or audio causing it to transcode if VC1 is supported. Once the subtitles or audio need to be converted so does the video because VC1 cannot be packaged into HLS. You may have to use the Emby server active devices on the dashboard to know what is really going on with playback.

But your best option is to set the h264 encoding preset to "superfast" and not use Auto. Then change the CRF to 28. See if that quality drop actually matters to you. You should never suffer buffering again.

Edited by speechles
Link to comment
Share on other sites

crusher11

Again, the LG app doesn't report a transcode reason, either in the dashboard or in stats for nerds. 

The audio is 24-bit PCM, which isn't supported. So that might be the only reason it transcoded, and my previous VC1 films all direct played which is why they had no issue. 

But I don't know if my TV supports VC1 or not. 

Link to comment
Share on other sites

Quote

the LG app doesn't report a transcode reason

It's resolved for the next update to the LG app.

Link to comment
Share on other sites

On 3/23/2021 at 4:13 PM, crusher11 said:

 

But I don't know if my TV supports VC1 or not. 

Yes it does, but it could be transcoding for other reasons due to subtitle format or audio format.

Link to comment
Share on other sites

rbjtech

The LG C6 supports VC1 - the file in question is within VC1 Advanced profile specs, but it does have a very high bitrate. (it's probably a raw rip from an HD-DVD).

If you copy the file to a USB stick and play with the native LG Player - does it play ?

If it does not, then the issue is the LG internal player cannot process it, thus emby cannot either so it tries to transcode it for you.

If it does play - then emby need to fix why it thinks it needs to be transcoded as it should direct play.

--

My advice, regardless of the above, is to re-encode it to h264/h265 - as while VC1 is supported on the LG - it is an old codec that has not been widely used since 2008 when HD-DVD disappeared. 

This will take a long time on old hardware, but you only need to do it once and then the resulting file becomes much more portable and future proof.   It is a high bitrate file, so it is very unlikely you will notice any quality difference if encoded with 'medium' type settings.  I did this to all my HD-DVD's years ago - as while I still have the disks, I have one drive that will play them so they are effectively junk as soon as the drive dies...

 

 

Edited by rbjtech
Link to comment
Share on other sites

13 hours ago, crusher11 said:

And my server is insisting on transcoding a DVD now.... 

If you play something not natively supported by the TV, then you'll see transcoding. There's no mystery here.

Link to comment
Share on other sites

Happy2Play
19 hours ago, crusher11 said:

And my server is insisting on transcoding a DVD now.... 

24 minutes ago, crusher11 said:

My TV supports DVDs.

Logs please.

Doesn't look like direct play is possible unless these specs are wrong.

Help library: [LG webOS TV] – Supported Video Playback | LG Canada

::: LG | webOS TV Developer :: AV Format on webOS TV 3.0 (lge.com)

The logs show transcoding do to video codec.

device protocol returned support

&VideoCodec=h264,h265,hevc&AudioCodec=ac3,eac3,aac,mp3

Logs only show video being converted

19:08:18.565 Stream mapping:
19:08:18.565   Stream #0:0 -> #0:0 (vc1 (native) -> h264 (libx264))
19:08:18.565   Stream #0:1 -> #0:1 (pcm_s24le (native) -> aac (native))

 

Link to comment
Share on other sites

  • 3 weeks later...
crusher11
On 3/25/2021 at 8:04 PM, rbjtech said:

If you copy the file to a USB stick and play with the native LG Player - does it play ?

Yes.

Link to comment
Share on other sites

rbjtech

ok - so the Emby Dev's need to see the logs to understand why your TV's capabilities are not being interpreted properly.

If you can play directly via a USB stick, then emby should be able to do exactly the same as it uses the exact same player.

 

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