Jump to content

Pre-Encoding vs Transcoding


VirulentPip

Recommended Posts

VirulentPip

Okay so my current set up would be to pre-encode to x265 10bit slow CQ 21 via distributed encoding of 3 PCs - i5 12600K (Emby Server), Ryzen 8 5800X (Gaming PC) and Ryzen 9 3900X (spare pc) on average this can take around 20-25 minutes per TV episode while also doing AC3 2.0 192Kbps and AC3 5.1 448Kbps -- This does of course mean lots of electricity usage. 

Storage:
1 x 12TB
1 x 10TB
3 x 8TB
7 x 6TB

I have a total of 20.10 "TiB" free across all drives (I have 4K Remuxes)

My energy bill will be going up in March and I'm starting to debate if the cost of doing these encodes will ultimately cost a lot more than storage will if I started storing raw data and then HW transcoding for remote streamers. 

Any and all suggestions will be welcome and appreciated :)
 

Edited by VirulentPip
Link to comment
Share on other sites

rbjtech

If 4K is your source, then why not just transcode on demand ?  

The i5 12600K has the excellent UHD770 QSV chip allowing for ~8-10 simultaneous 4K remux h265 dec to h264 enc @ 5-15Mbit/sec with tone mapping.

So unless you need more streams than this - then this is my recommendation - and is exactly what I use it for (95% of my sources are still 1080p tbh - in which case it's more like 30-40 potential streams..).

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

VirulentPip

Source is a lot of 1080p TV and films too. But it's getting time consuming encoding all the time to be able to get a quality to watch locally + remote stream it. When I get a new Blu-ray set to rip, looking at an avg 8-9hrs of encoding per 15 episode season, I used to not worry too much but like I say with the rising cost of energy I might as well just have the raw file and have it transcode.. Granted will end up needing more storage sooner this way. 

Link to comment
Share on other sites

rbjtech
1 minute ago, VirulentPip said:

Source is a lot of 1080p TV and films too. But it's getting time consuming encoding all the time to be able to get a quality to watch locally + remote stream it. When I get a new Blu-ray set to rip, looking at an avg 8-9hrs of encoding per 15 episode season, I used to not worry too much but like I say with the rising cost of energy I might as well just have the raw file and have it transcode.. Granted will end up needing more storage sooner this way. 

if your clients support it - it might be worth waiting for the AV1 and intel deeplink - which will allow your UHD770 to work in parallel with intels new dGPU's for AV1 h/w encoded media at 50% the bitrate/file size ...

 

Link to comment
Share on other sites

rbjtech
1 hour ago, VirulentPip said:

I wasn't aware many devices supported AV1 ?

true - not many at the moment.  from a streamer hardware -  just the 4K FireTV 4K Max but many will follow now that google/you tube uses it.  AV1 decode is doable on the shield etc in s/w - so there is a slow take up.  

I guess where I'm going is you don't want to spend a lot of time, money and effort converting your entire library to an out of date hevc codec ;)

 

 

  • Like 1
Link to comment
Share on other sites

lightsout
9 hours ago, rbjtech said:

If 4K is your source, then why not just transcode on demand ?  

The i5 12600K has the excellent UHD770 QSV chip allowing for ~8-10 simultaneous 4K remux h265 dec to h264 enc @ 5-15Mbit/sec with tone mapping.

So unless you need more streams than this - then this is my recommendation - and is exactly what I use it for (95% of my sources are still 1080p tbh - in which case it's more like 30-40 potential streams..).

This is really incredible, still hard for me to grasp that the iGpu has this ability, we were not long ago needing to buy gaming GPU's with madvr to tone map one stream ( I know madvr has more going on). Tempted to move to this platform thanks for the info.

Link to comment
Share on other sites

RanmaCanada

Unless you need the space, just encode on demand.  Seriously.  Also, instead of transcoding the audio to AC3, I would suggest OPUS as it's almost lossless, in that the human ear can't tell the difference.  Anything that I transcode goes to 384kb OPUS for 5.1 or 160 for stereo (sometimes as low as 128).  For the CRF, if you're doing TV, 20 should be about what you should be using as per these guidelines.  

  • Like 1
Link to comment
Share on other sites

rbjtech
8 hours ago, RanmaCanada said:

Unless you need the space, just encode on demand.  Seriously.  Also, instead of transcoding the audio to AC3, I would suggest OPUS as it's almost lossless, in that the human ear can't tell the difference.  Anything that I transcode goes to 384kb OPUS for 5.1 or 160 for stereo (sometimes as low as 128).  For the CRF, if you're doing TV, 20 should be about what you should be using as per these guidelines.  

To add to @RanmaCanada's point on Audio - I DO add an AAC 2.0 track myself to all my 1080p media and make it the default track - and for 4K Media, with the assumption that it will be played back on a 'reasonable' setup - I just move (or add if it's not available) a non-HD AC3 5.1 as the default Audio.   This then allows 4K to be played back without transcoding on a Browser (Edge) and 95% of clients as AC3 is now pretty standard.   As soon as you start involving HD Audio (which will be the 'default' track on 4K remuxes), without a client that natively supports it (limited to Shield etc) it will need to transcode the audio and in turn likely need to transcode the video as well.

The good news about adding/changing audio is it is very light vs re-encoding video - a few mins tops per film for TRUE-HD to AC3 for example - and in the case of the AC3 track already being there - it just needs a remux to re-position it.  You can't unfortunately just change it to the default track - in my experience, that has mixed results.

Edited by rbjtech
Link to comment
Share on other sites

rbjtech
12 hours ago, lightsout said:

This is really incredible, still hard for me to grasp that the iGpu has this ability, we were not long ago needing to buy gaming GPU's with madvr to tone map one stream ( I know madvr has more going on). Tempted to move to this platform thanks for the info.

There are also some exciting developments on coupling the iGPU with a dGPU using intel 'deep link' technology which is now available.  I'm not 100% sure if this only works on the intel ARC GPU's (A380 etc) (and 12th Gen+ CPU's) - but having the ability to run encoding/decoding in parallel on hardware with a 40% scaling looks impressive.  It may even scale to more than one dGPU - that would be very impressive.  SLI for transcoding - haha.

Just need to get my hands on an ARC GPU to test ... 

There is an intel white paper on it here actually - https://s3-us-west-2.amazonaws.com/near-me-oregon/instances/132/uploads/attachments/custom_attachment/file/17410/Unlocking_the_Power_of_Intel_Deep_Link_Technology_Part_1.pdf?X-Amz-Expires=600&X-Amz-Date=20220823T093526Z&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA4IMKIWYVKZ6JE7X7/20220823/us-west-2/s3/aws4_request&X-Amz-SignedHeaders=host&X-Amz-Signature=ff4d61a062957d13387c3dd70a5ee2d9b18e9407d42d284f4562393e7f865bd2

There are also some interesting performance metrics listed here - the 50x the speed for AV1 encoding vs software looks very interesting .. : - o

https://edc.intel.com/content/www/br/pt/products/performance/benchmarks/intel-arc-graphics/

 

Edited by rbjtech
Link to comment
Share on other sites

VirulentPip


Chose 6Mbps (1080p) as quality to see what it would look like for remote (as remote streams capped at 6Mbps) Not sure if need to create a help post for this or it's something that can be explained.. As you can see it's "Scale" is 720p and not 1080p 



image.png.411b008c0d387cdce89c8b3a8f928fb2.png

Link to comment
Share on other sites

rbjtech

6mbps for 1080p using h264 is considered too low - thus it is scaling to 720p.   I believe 8Mbit+ is the recommended 1080p h264 min bitrate, at that bitrate, it will not scale.

Edited by rbjtech
  • Thanks 1
Link to comment
Share on other sites

Happy2Play
2 minutes ago, justinrh said:

@VirulentPip What is that picture from?

The Diagnostics plugin adds User Sessions to Setting to present you with a layout like that for your users playback session.

  • Thanks 2
Link to comment
Share on other sites

Happy2Play
7 hours ago, VirulentPip said:


Chose 6Mbps (1080p) as quality to see what it would look like for remote (as remote streams capped at 6Mbps) Not sure if need to create a help post for this or it's something that can be explained.. As you can see it's "Scale" is 720p and not 1080p 



image.png.411b008c0d387cdce89c8b3a8f928fb2.png

That is the controversy of Playback quality as the resolution is irrelevant as scaling appears to be driven by bitrate.  So all quality resolutions should technically be removed.

If 1080p - 4Mbps is an option, then Emby should be honoring it, or options should be changed.

Some discussion here as I am confused by this also.

 

  • Agree 2
Link to comment
Share on other sites

lightsout
8 hours ago, VirulentPip said:


Chose 6Mbps (1080p) as quality to see what it would look like for remote (as remote streams capped at 6Mbps) Not sure if need to create a help post for this or it's something that can be explained.. As you can see it's "Scale" is 720p and not 1080p 



image.png.411b008c0d387cdce89c8b3a8f928fb2.png

I was testing a 4k UHD remux remotely as I recently added a GPU to my server. I have bandwidth capped at 5mbps as my upload is only 10mbps. The best I could get that scale box to say was like 720x404. Is this really the best that can be done at 5mbps, or is that number there meaning something else?

Link to comment
Share on other sites

justinrh
1 hour ago, Happy2Play said:

That is the controversy of Playback quality as the resolution is irrelevant as scaling appears to be driven by bitrate.  So all quality resolutions should technically be removed.

If 1080p - 4Mbps is an option, then Emby should be honoring it, or options should be changed.

This is EXACTLY right!  The settings don't make any sense.

Link to comment
Share on other sites

rbjtech

Encoding digital media is an extremely complex subject - infact there are huge forums dedicated to talking about the subject (doom9 etc).

The bottom line is emby is making a calculated decision on the best way to do the encoding - I agree the presentation of what 'options' are shown is technically 'incorrect' but I would much prefer a scaled up 720p end 'source' than a 1080p blocky/macro mess as it's starved of bitrate during action scenes.   

Remember all transcoded output is still h264 and while you 'can' get decent quality in a much lower bitrate than the 'suggested' 8Mbit/sec (multi-pass etc) - this is the 'threshold' that is commonly used for 'real-time' encoding h264 @ 1080p

Edited by rbjtech
  • Thanks 1
Link to comment
Share on other sites

  • 1 month later...
VirulentPip
On 23/08/2022 at 10:31, rbjtech said:

There are also some exciting developments on coupling the iGPU with a dGPU using intel 'deep link' technology which is now available.  I'm not 100% sure if this only works on the intel ARC GPU's (A380 etc) (and 12th Gen+ CPU's) - but having the ability to run encoding/decoding in parallel on hardware with a 40% scaling looks impressive.  It may even scale to more than one dGPU - that would be very impressive.  SLI for transcoding - haha.

Just need to get my hands on an ARC GPU to test ... 

There is an intel white paper on it here actually - https://s3-us-west-2.amazonaws.com/near-me-oregon/instances/132/uploads/attachments/custom_attachment/file/17410/Unlocking_the_Power_of_Intel_Deep_Link_Technology_Part_1.pdf?X-Amz-Expires=600&X-Amz-Date=20220823T093526Z&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA4IMKIWYVKZ6JE7X7/20220823/us-west-2/s3/aws4_request&X-Amz-SignedHeaders=host&X-Amz-Signature=ff4d61a062957d13387c3dd70a5ee2d9b18e9407d42d284f4562393e7f865bd2

There are also some interesting performance metrics listed here - the 50x the speed for AV1 encoding vs software looks very interesting .. : - o

https://edc.intel.com/content/www/br/pt/products/performance/benchmarks/intel-arc-graphics/

 

Did you ever get your hands on an ARC? I see that Ebuyer have the A380 for £149.99 thinking about getting one to test out HW AV1 encoding along with that hyper encoding deep link stuff. Even if I have to make my family members who watch remotely to buy the Firestick 4K Max haha

  • Thanks 1
Link to comment
Share on other sites

rbjtech
7 hours ago, VirulentPip said:

Did you ever get your hands on an ARC? I see that Ebuyer have the A380 for £149.99 thinking about getting one to test out HW AV1 encoding along with that hyper encoding deep link stuff. Even if I have to make my family members who watch remotely to buy the Firestick 4K Max haha

Ah ok - I wasn't aware they were available yet.  thanks.

tbh, I was waiting to see if the intel gen 13 cpu's included AV1 encode from the ARC, but was surprised to find out the other day that they are just re-using the UHD 770 in them :(  A real shame ..

I don't need the 3D stuff at all - so even at 'just' £150 - that is an expensive 'play' ..  I'll wait until the prices drop I think .. ;)

  • Like 1
Link to comment
Share on other sites

VirulentPip

Well after finding a sweet sport for AV1 setting around 300fps for 10bit. I then realised something which is pretty much going to make all this not worth it... Emby is decoding AV1 when needs to be transcoded in Software, there's no option for Hardware Decoding, am I missing something or is this not an option @Luke

Link to comment
Share on other sites

29 minutes ago, VirulentPip said:

Well after finding a sweet sport for AV1 setting around 300fps for 10bit. I then realised something which is pretty much going to make all this not worth it... Emby is decoding AV1 when needs to be transcoded in Software, there's no option for Hardware Decoding, am I missing something or is this not an option @Luke

Can we please look an at example? Thanks.

Link to comment
Share on other sites

rbjtech
44 minutes ago, VirulentPip said:

Strange thing is, the LG C1 meant to support AV1. It does.. But doesn't for the app I guess?
@SamES

AV1 (Video Decoder)
4K@60p, 10bit



image.thumb.png.aa73bf31d7c2adfaf7585299f87d03d3.png

ffmpeg-transcode-3e9649a8-6024-421e-be04-f25bd7e9f6b6_1.txt 76.02 kB · 1 download

Does the file direct play if you play it via a USB stick attached to the C1 ?

If yes, then emby should do the same and attempt a 'passthrough' ..

edit - after a very quick look, are you sure the C1 supports AV1 in h/w ?

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