I have many questions about how to properly re-encode video for the best quality output. Yes I know, high enough quality = crf 18-22, preset slow, x265 or x264 or a high enough bitrate. But I'd like to get more nuanced than that on an actual frame by frame analysis.
1. Say I am going to crop the frame of a 4k video, should I only crop in even multiples of the aspect ratio? Like remove 90 pixels vertically, 160 pixels horizontally for example? Or should both crop values be multiples of say 16 depending on the macro-blocking of the original or output encoding?
2. If I've already committed to cropping, thus decoding the frame and reencoding, will additional filters, like lanzcos3 downscale to 1080p lower the quality of the video more than just cropping the edges and reencoding? If no other questions get answered, I'd really like to know this one!
3. When rescaling, will you get better results if you resize a certain percentage of the original, in other words is there any magic number, 50%?
4. If resampling the fps, say from 50fps, is there a difference between going with 25fps or 30fps; will it drop every other frame with 25fps, and do similar with 30fps or does it try to interpolate artificially generated frames when the change is not an integer, does this impact quality?
Also, recognizing that the type of media (action, animation, etc) matters; can anyone provide a rule of thumb for 4k vs 1080p bitrate parity? In theory 4k should be 4x larger however there is a sort of efficiency gained when encoding at such large resolutions... Is 2x the bitrate for 4k expected?
+ Reply to Thread
Results 1 to 8 of 8
-
-
You need to specify what your re-encoding source is (ex: Bluray vs compressed Internet video), why you want to crop, how much you care about the output filesize, why you want to change framerate, and maybe also how your content will be viewed.
Regarding resizing: You can typically resize video content to any ratio (ex: 1080p to 720p). With ratios beyond 2 some algorithms are not recommended. Upscaling is also not the same as downscaling. -
Perhaps some MediaInfo will help in this regard, (see below). I don't find the reason to crop relevant; but I would like to know if applying multiple filters, such as cropping and downscaling is worse for visible clarity of output than only cropping, CRF being equal. For example when using Avidemux to apply resize filters, there is a field that adjusts the crop to "nearest multiple of 16". What is the purpose of this exactly? Should I only crop with shared multiples of 16; i.e. (16x16)
9x16)? Does this have any impact on the resulting clarity for a given bitrate.
I suppose a better thing to ask is, do you know of any "Encoding Test Files"? like something with a lot of lines, color squares, in motion or whatever so one can see the difference between encoding variable outputs more easily?
General
Complete name : Privacy.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom (isom/iso2/avc1/mp41)
File size : 357 MiB
Duration : 1 min 21 s
Overall bit rate : 36.9 Mb/s
Writing application : Lavf57.25.100
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main@L5.2
Format settings : 2 Ref Frames
Format settings, CABAC : No
Format settings, Reference frames : 2 frames
Format settings, GOP : M=3, N=25
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 1 min 21 s
Bit rate : 36.7 Mb/s
Width : 3 840 pixels
Height : 2 160 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 50.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.088
Stream size : 355 MiB (99%)
Color range : Limited
Color primaries : BT.709
Matrix coefficients : BT.709
Codec configuration box : avcC
Audio
ID : 2
Format : AAC LC
Format/Info : Advanced Audio Codec Low Complexity
Codec ID : mp4a-40-2
Duration : 1 min 21 s
Duration_LastFrame : -13 ms
Bit rate mode : Constant
Bit rate : 197 kb/s
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 48.0 kHz
Frame rate : 46.875 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 1.90 MiB (1%)
Default : Yes
Alternate group : 1 -
Let's take this to it's logical extreme: resize you 3840x2160 video to 1x1 pixel. How is the quality compared to the original? So yes, downscaling reduces the quality. How much quality you lose depends on the sharpness and detail of the original, how much you downscale, and what downscaling algorithm you use. You have to decide for yourself on a case by case basis whether the cost is worth it to you.
-
Encoding resolution should be mod-16 ideally because codecs encode in blocks of 16x16. Mod-8 also works OK.
The main purpose of downsizing is to reduce the required bitrate. If your source is noisy, it has the positive effect of filtering out some noise, but you also lose detail.
If you only want to crop/mask, it may not actually be necessary to re-encode at all (it can be done at playback if your player supports it). -
Okay, understood. I think i will try mod-16 from now on. The main reason I wanted to downscale is to avoid upscaling - OCD prevents me from cropping perfect 3840x2160 (4K) to something like 3648x2052, therefore I am motivated to rescale. There's probably no rationality to such an impulse, but it does force me to ask a lot of questions.
If you have any experience with avidemux (I think its an ffmpeg front end of sorts), is it better to tinker with the advanced configurations or just go slow preset all the way?
As an aside for anyone reading, my experience with x265 is that it tends to blur and smooth and denoise much more than x264, whereas x264 can have blocking issues but keeps finer detail. Still not sure why that is, but when I want visual clarity on the granular level I still go with x264, otherwise stick with x265. -
in avidemux: use a preset with x264 High Profile, you then just need to set crf.
Similar Threads
-
What is difference between 1 pass encoding & 2 pass encoding
By Computerman1 in forum Video ConversionReplies: 18Last Post: 13th Jan 2019, 19:59 -
x264 benchmark? what mobile chipset to do more fast encoding x264 encoding?
By marcorocchini in forum Newbie / General discussionsReplies: 1Last Post: 21st Sep 2018, 23:06 -
Hardware encoding vs. software encoding
By Christopher2222 in forum Capturing and VCRReplies: 3Last Post: 29th Jan 2018, 11:35 -
Encoding problems - trying to replicate ZeeVee encoding.
By 1branchonthevine in forum Video ConversionReplies: 7Last Post: 10th Apr 2017, 18:03 -
DVDFlick Re-Encoding
By bolintx in forum Authoring (DVD)Replies: 22Last Post: 31st Jan 2016, 16:30