Jump to content

How to convert media , retaining the original resolution?


Go to solution Solved by visproduction,

Recommended Posts

Posted

Hello guys, i have a media folder and want it to convert to save space but preserve size , its mostly 4k content.

I want to preserve the resolution, i am ok with loosing minimum quality. Or any better suggestion.

Whats the best settings i can use?

FrostByte
Posted

You can try remuxing your files to start with by eliminating any unwanted audio, subtitles, etc tracks.  This would be the quickest option and still preserve the quality of the things you keep. 

If you still want to go smaller, then reencoding may be your only option.  Handbrake is a commonly used option, but reencoding 4K to 4K can be slow.

Posted

Is 4k to 4k achievable using emby convert? 

 

Posted
1 hour ago, DarKni8 said:

Is 4k to 4k achievable using emby convert? 

 

Hi, yes it is.

Posted
4 hours ago, DarKni8 said:

 

Whats the best settings i can use?

It depends on what the goal is. But I would try using the original quality options.

Posted
Just now, Luke said:

Hi, yes it is.

In your experience, how should i proceed with this file format and fields.

image.png.1881a214e52e9528a41d6f1e8b7d5c3b.png

Posted

Personally I would do this outside of Emby before you ever add the content to your library.  Part of curating the media so to speak.

What I'd recommend as one tool to look at is sickbeard mp4 automator which has a name you can ignore. It can do a lot from fetching meta data, pulling subtitles down, interfacing with multiple different programs many people likely use as well as the "core".  I personally use a modified version of the core part of the program which is a wrapper around ffmpeg that you can use to setup specific criteria.  For example I have my config set to create 2 channel audio if it doesn't exist, keep other audio tracks in English only. Discard all subtitle tracks if audio is in English or keep only English tracks if audio is different than English.  The I have it setup to deinterlace video as needed take any video codec and convert it to 8 bit HEVC using the compression level I find a good balance between not being able to tell it's been modified with 30-40% space saving (video alone) to 50-60% savings but quality IMHO is blown.  So I compress down to where I can just notice it then back up a notch or two.

The above is for non 4K.  I never got the settings where I like them to use for both 4K and and 1080 media but never tried that much to be honest.  I didn't want to hack it to death with if 4K logic.  So what I did is install a 2nd/3rd copy in a different folders and setup the config for these. I cheated. :) So two ways to process 4K video depending on color space & HDR vs SDR.  SDR gets processed just like the 1080 for subs & audio but I don't touch the video if HEVC 8 bit.  Otherwise this gets processed as well.

4K HDR same as above this time it's using 10 bit files for basic processing but then I create a 1080p version as well from it.  I can then optionally use it or not depending if I have it already in 1080.

The toolkit above can fetch srt subs, so if I need/want the sub but it's a graphical format it gets removed if an SRT is found.
All files use the MKV container.  So my library is 99%+ MKV, H.265, 2 channel AAC, optional English subs, English subs if not English audio.

 https://github.com/mdhiggins/sickbeard_mp4_automator 

It uses python and scripting so you have to dig in and RTFM.  It not a program you can copy/paste (don't ask me for my settings) as you need to adjust it for your use and equipment which is different than mine.  Speaking of equipment it will use GPUs like Emby does but since you aren't under pressure time wise you can do different style encodes like 2 pass, so you know where to allow extra bits, and no when lower amount of bits is ok.  You can also set limits or ceilings so that even fast scenes that need high level of bits can't overly spike or playback will be problematic on remotes systems if their playback buffer empties.

The last part of my setup is for DVR.  I run these through comskip set for me to never cut the into the movie/show but I have it cut and leave the sections.  I can then quickly check the front back and trim anything it missed very fast.  Then I move it to a sub folder when it gets put back together pulls the CC out and converts it to SRT.  Then it funnels it to when any 1080 media starts out.

That was the way things were but I'm planning on trying to redo this a completely different way when I can find time.

  • Like 3
FrostByte
Posted

You will always get a better result using tools that are designed for the job.  I spend a lot of time though curating my media to get the best playback experience.

 

  • Like 1
Posted
On 3/14/2022 at 12:14 PM, DarKni8 said:

In your experience, how should i proceed with this file format and fields.

image.png.1881a214e52e9528a41d6f1e8b7d5c3b.png

You could try using the convert feature to convert to hevc. You'll see some size savings with that. But be warned, if the devices you play on don't support hevc then it will require very costly transcoding on the fly.

Posted
12 hours ago, cayars said:

Personally I would do this outside of Emby before you ever add the content to your library.  Part of curating the media so to speak.

What I'd recommend as one tool to look at is sickbeard mp4 automator which has a name you can ignore. It can do a lot from fetching meta data, pulling subtitles down, interfacing with multiple different programs many people likely use as well as the "core".  I personally use a modified version of the core part of the program which is a wrapper around ffmpeg that you can use to setup specific criteria.  For example I have my config set to create 2 channel audio if it doesn't exist, keep other audio tracks in English only. Discard all subtitle tracks if audio is in English or keep only English tracks if audio is different than English.  The I have it setup to deinterlace video as needed take any video codec and convert it to 8 bit HEVC using the compression level I find a good balance between not being able to tell it's been modified with 30-40% space saving (video alone) to 50-60% savings but quality IMHO is blown.  So I compress down to where I can just notice it then back up a notch or two.

The above is for non 4K.  I never got the settings where I like them to use for both 4K and and 1080 media but never tried that much to be honest.  I didn't want to hack it to death with if 4K logic.  So what I did is install a 2nd/3rd copy in a different folders and setup the config for these. I cheated. :) So two ways to process 4K video depending on color space & HDR vs SDR.  SDR gets processed just like the 1080 for subs & audio but I don't touch the video if HEVC 8 bit.  Otherwise this gets processed as well.

4K HDR same as above this time it's using 10 bit files for basic processing but then I create a 1080p version as well from it.  I can then optionally use it or not depending if I have it already in 1080.

The toolkit above can fetch srt subs, so if I need/want the sub but it's a graphical format it gets removed if an SRT is found.
All files use the MKV container.  So my library is 99%+ MKV, H.265, 2 channel AAC, optional English subs, English subs if not English audio.

 https://github.com/mdhiggins/sickbeard_mp4_automator 

It uses python and scripting so you have to dig in and RTFM.  It not a program you can copy/paste (don't ask me for my settings) as you need to adjust it for your use and equipment which is different than mine.  Speaking of equipment it will use GPUs like Emby does but since you aren't under pressure time wise you can do different style encodes like 2 pass, so you know where to allow extra bits, and no when lower amount of bits is ok.  You can also set limits or ceilings so that even fast scenes that need high level of bits can't overly spike or playback will be problematic on remotes systems if their playback buffer empties.

The last part of my setup is for DVR.  I run these through comskip set for me to never cut the into the movie/show but I have it cut and leave the sections.  I can then quickly check the front back and trim anything it missed very fast.  Then I move it to a sub folder when it gets put back together pulls the CC out and converts it to SRT.  Then it funnels it to when any 1080 media starts out.

That was the way things were but I'm planning on trying to redo this a completely different way when I can find time.

I have one 2 TB drive for local,  I am going to try this thing on that. But since i have 4 TB on cloud I am totally relying on emby's capability to direct play. Hence you can see my post history where i am a little skeptical about emby's direct play capabilities.

Thanks for bringing this tool into light. :D

Posted
10 hours ago, Luke said:

You could try using the convert feature to convert to hevc. You'll see some size savings with that. But be warned, if the devices you play on don't support hevc then it will require very costly transcoding on the fly.

Yup I have tried converting this 4k h264 to 4k HEVC but was not able to do so! I though i am doing something wrong

  • Solution
visproduction
Posted (edited)

I agree with Cayars.  Any settings I mention here won't transfer perfectly to your setup.  You were asking for a general suggested bitrate to start.  So, here is something.

Using a calculator, based on my preferred quality of 1920 x 1080, 24fps, I get these bitrates:

4K - 30fps

  • Low action drama 9,000 kbps
  • Moderate action 10,600 kbps
  • High action 12,000 kbps

4K - 24 (or 23.976) fps

  • Low action drama 7,300
  • Moderate action 8,400
  • High action 9,600

These match similar settings for 1920 x 1080 at 24 fps

  • Low action drama 1,800
  • Moderate action 2,100
  • High action 2,400

I see some quantinization  and pixel blurring for movement for low action drama bitrates listed above, but it's very difficult to notice.  Moderate action clears it up almost perfectly and makes the facial textures have a excellent color detail.  High action is really only needed for fast movements, explosions.  It helps define the really small detail in rolling smoke type of scenes.  I also get better detail in all these settings because I set double the standard motion search range and set the Partition search settings, much higher than normal, which doubles the encoding time.

I don't use Emby to convert and I don't know what the equivilant settings for Emby profile and level would be. You would need to dig into the manual for those settings to decide what is best.  Emby combines a lot of these settings into the profile and level.  I use AVIDemux (avidemux.org).  You could also do every individual settings with ffmpeg.

My settings are probably around 90% of the way to the highest settings, which means you would need a fairly fast computer to handle 4K, at that level.  If you wanted to go higher, you could try reducing the Min / Max GOP size by 25% and increase the bitrate by 25%.  I think that would only really help fast action.  My I7 notebook usually takes around 5 hours to encode for a 1080P 2 hour show. Obviously, any change in the Emby profile and level will make a large effect on the quality of your end media copy.  So, these bit rate settings are only part of the story.

I use a constant bitrate, even though that is expensive for file size.  I don't like the idea that an occasional high bit rate that can come from a variable bit-rate can trigger encoding to start or cause buffering for remote viewing.

Other, higher than normal settings, I use to get the quality I like for h.264 are:

  1. Motion estimation search: 11 best
  2. Uneven Multi-hexagonal Search
  3. Motion sector search range for fast motion: 32
  4. Directed Prediction mode: Spatial
  5. Weighted prediction for B-Frames
  6. Partition search to include all 8x8 and 4x4 plus added 8x8, 8x16 16x8 P-Frame and B frame Intrapredicted Blocks - This adds about 100% more time to encode and I believe it helps with fast action, rolling smoke.
  7. Max reference and consecutive B frames: 3
  8. Adaptive B-frame decision: Optimal
  9. B-frames as reference: Non-strict
  10. I- frames GOP Minimum 24, Maximum 120
  11. i-frame threshold 40
  12. Analysis: Mixed References, Chrome Motion Estimation, Trellis Quanization - Always On, Fast Skip detection on P-Frames
    DCT Declination on P-Frames
  13. Quantization: standard and normal

I would prefer to have media saved in h.265, but I have not found a way to allow any user with a standard browser in Windows Chrome or Firefox to playback h.265 without some plug in and I don't want to encode any content on demand.  I don't have a server that can handle that. 

If anyone has any comments on these settings, I would like to hear them.

Hope that helps.

 

 



 

Edited by visproduction
  • Like 1
  • Thanks 1
Posted

Thats very well explained , i will have to go through it 5 to 6 times to undertake everything 😅...thank you..thank to all for their inputs i will try and make best use of it

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Posted

Let us know how you get on. Thanks.

  • Like 1

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