Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
![]() |
|
Thread Tools | Search this Thread | Display Modes |
![]() |
#1 | Link |
Registered User
Join Date: Apr 2014
Posts: 3
|
Best x265 quality/filesize settings (reencode for archive)
I have DJI Pocket2 camera. Recordings from 1080p@30fps to 2160@60fps. Bitrate from camera is ~80 mb/s. I need to compress this with maximum quality to file size ratio (limited NAS storage).
Encoding speed is not so important for me because I use queue and Xeon E5 2696v3 (Haswell 18 cores 36 threads) is doing well too. I tryed to use SVT-HEVC and SVT-AV1 but they are blurry and dont have CRF mode (only CQP mode which i think is not best for visual quality/filesize purposes). As for now I use x265 veryslow + opus 96kbps with original resolution (1080-2160) and frame rate (30-60). crf 28 - for not important videos (like unboxing, or conversations with people) crf 24 - for more quality videos (like sea or nature or zoo). on my 32'' monitor 2k resolution I cant see any differences, so need help What settings I should I use for best visual quality/filesize ratio source files from my dji camerф are: ideo ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : High@L5 Format settings : CABAC / 1 Ref Frames Format settings, CABAC : Yes Format settings, Reference fra : 1 frame Format settings, GOP : M=1, N=30 Codec ID : avc1 Codec ID/Info : Advanced Video Coding Duration : 2 min 50 s Bit rate mode : Variable Bit rate : 50.0 Mb/s Width : 2 720 pixels Height : 1 530 pixels Display aspect ratio : 16:9 Frame rate mode : Constant Frame rate : 29.970 (30000/1001) FPS Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.401 Stream size : 1 017 MiB (100%) Title : DJI.AVC Language : English Encoded date : UTC 2022-03-03 16:01:15 Tagged date : UTC 2022-03-03 16:01:15 Color range : Limited Color primaries : BT.709 Transfer characteristics : BT.709 Matrix coefficients : BT.709 Codec configuration box : avcC Should I use 10 bit if video from DJI is 8bit yuv 4:2:0? I tryed to use aq-mode 3 instead of 1 (default) but bitrate insanely grows. So what is better: aq-mode 1 crf 24 8bit (94mbyte) or aq-mode 3 crf 30 10bit (97mbyte)? Should I somehow tune veryslow preset? (set more than 3 ref frames and 4 b-frames)? Maybe aom-av1? But 0.5 fps speed is very slow even for me((( Last edited by Dave_Scream; 7th March 2022 at 11:34. |
![]() |
![]() |
![]() |
#2 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,584
|
personally I would:
a. use way lower crf values (around 12) for important stuff and probably not go below 22 for anything that I want to keep. b. make sure look at the content in native resolution before deciding on crf (most players should allow to also display content unresized). c. use preset slow. d. look into filtering. Often some light denoising/degain can same tons of data rate, if using Avisynth/Vapoursynth isn't an option even using the noise reduction options of x265 might be worth using e. regarding aq-mode, prefer mode 3 over 1. Regarding av1, I would recommend reading https://forum.doom9.org/showthread.php?t=183907 and using aomenc. Cu Selur |
![]() |
![]() |
![]() |
#5 | Link | ||
Registered User
Join Date: Apr 2014
Posts: 3
|
Quote:
Im using veryslow preset (got 2.3fps): Quote:
Code:
x265 --input - --output-depth 8 --y4m --profile main10 --limit-modes --no-early-skip --rskip 0 --no-open-gop --opt-ref-list-length-pps --lookahead-slices 0 --crf 18.00 --opt-qp-pps --cbqpoffs -2 --crqpoffs -2 --qpfile GENERATED_QP_FILE --limit-refs 0 --ssim-rd --psy-rd 2.50 --rdoq-level 2 --psy-rdoq 10.00 --aq-mode 3 --no-cutree --deblock=-1:-1 --limit-sao --no-repeat-headers --range limited --colormatrix unknown --output "C:\temp\DJI_0837_x265_crf18_veryslow_aq3_opus96.265" For my 4TB Nas storage acceptable bitrate for video archive is around 8-15mbit/s and want to find optimal settings for this. I just want to use power and unlimited time of my PC to increase compress ratio for my DJI camera and mobile phone videos. Because I have limited storage. Another question is that I think no need to resize video to 1080p (lost information). Better to use original resolution and frame rate and use acceptable CRF for my acceptable bitrate. Last edited by Dave_Scream; 7th March 2022 at 18:16. |
||
![]() |
![]() |
![]() |
#6 | Link | |
Registered User
Join Date: May 2009
Posts: 345
|
Quote:
We know that AV1 is a mess with it not implementing switches and some versions being single threaded, etc. Veryslow on x265 will still be faster than AV1 if AV1 is being dumb, which it has been every time I've tried to use it haha. |
|
![]() |
![]() |
![]() |
#7 | Link | |
Registered User
Join Date: Apr 2014
Posts: 3
|
Quote:
Selur as author of so powerful Hybrid, what free codec you think is optimal for now to use for encodings in terms of quality to size ratio (and not deadly slow as 0.5 fps on 18 cores CPU)? |
|
![]() |
![]() |
![]() |
#8 | Link | |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,584
|
Quote:
Since you aim for "best visual quality/filesize ratio" while you want a lower file size any lossless are near lossless formats are not interessting. So the choice is either H.264, H.265 or AV-1. So looking at the encoders for those formats: For H.264: x264 is the only choice that makes sense. For H.265: x265 or gpu based encoding can make sense, but since it's for archiving while minimizing file size I would definitly go for x265. For AV1: I would go for aomenc, it's way slower than rav1e and stv-av1, but it simply beats them in quality. Personally I like aomenc and the resulty you can get if you tweak the settings, but atm. I wouldn't recommend it for archival of content that I want to edit, since I'm not sure how hardware decoding support and support in NLEs is looking at the near future. Paired with that its really rather slow I wouldn't recommend it atm. for archiving. I see that AV1 will probably stay as a format used for streaming, but likely not for broadcasting which probably will restrict the speed of hardware decoding support for it. (especially if it's not 4:2:0 content) I would probably be more leaned towards av1 if aomenc was faster. ![]() VVC also seems interessting, but atm. it's not really main stream user friendly and really slow. Since you are aiming for HD and higher resolutions I would recommend H.265 over H.264 since in my book it clearly wins over H.264 when it comes to HD+ resolutions also it's general supported profile had 10bit in it which helps with banding. -> At the current time I would recommend x265 and looking into filtering (light deblocking, denoising/degrain are usually a must in my book if reducing the bit rate is a goal). Important: When encoding non-anime/cartoon content especially make sure not to overfilter when aiming to archive content. Cu Selur Last edited by Selur; 7th March 2022 at 18:41. |
|
![]() |
![]() |
![]() |
#9 | Link |
Moderator
![]() Join Date: Jan 2006
Location: Portland, OR
Posts: 4,984
|
In general, it's really hard to make comparisons >1080p on a 1080p monitor. Your best bet is to use a player that can zoom in to a center cut at 1:1 pixels and examine those.
If you've not done visual quality comparisons, those detailed command line parameters are all really premature, and why your bitrate is so high. I'd start with something simple like this. Code:
--preset slower --profile main --level-idc 5.0 --crf 21 Going through your command line parameters: Code:
--output-depth 8 --y4m --profile main10 Code:
--no-open-gop Code:
--limit-modes --no-early-skip --limit-refs 0 Code:
--rskip 0 Code:
--opt-ref-list-length-pps --opt-qp-pps Code:
--lookahead-slices 0 Code:
--cbqpoffs -2 --crqpoffs -2 Code:
--ssim-rd Code:
--psy-rd 2.50 --rdoq-level 2 --psy-rdoq 10.00 Code:
--aq-mode 3 Code:
--no-cutree Code:
--deblock=-1:-1 Code:
--limit-sao If you still want to use SAO for some reason, you can also use --selective-sao 2 to increase encoding speed a bit. |
![]() |
![]() |
![]() |
#10 | Link | |||||
Lost my old account :(
Join Date: Jul 2017
Posts: 360
|
Quote:
Quote:
Quote:
Quote:
Quote:
My 2 cents is to start with preset 'slower' (but hey if you find 'veryslow' usable go ahead, but you are in the relm of diminishing returns) and try to find out an combination of aq-mode, sao & crf value that you are happy with. In my experience when using under crf 20(ish) aq-mode 1 and no-sao is preferred in most cases, when going for a lot of compression (crf20-30) feel free to play with aq-mode 3 or 4, and sao/selective-sao. I also assume that compression is more important than seeking etc, so you can also set --keyint fps*10 --min-keyint fps. Using main10 is also something that you might wanna try as well (I personally only use main10 with x265, regardless of if the source is 8bit or not). As for all the other tuning that can be done... I'm gonna stay out of that, as it can be a rabit hole of pros & cons and can be dependent on a myriad of factors. |
|||||
![]() |
![]() |
![]() |
#11 | Link |
Pig on the wing
Join Date: Mar 2002
Location: Finland
Posts: 5,817
|
Definitely --main10 and --no-sao. --preset slower --crf 16 --aq-mode 1 --rskip 2 --rskip-edge-threshold 2 will already give a nice basis for everything else, CRF 18 for the less important content. --ctu 32 on top of that in my opinion, I've found out that CTU 64 sometimes causes issues with flat backgrounds.
__________________
And if the band you're in starts playing different tunes I'll see you on the dark side of the Moon... |
![]() |
![]() |
![]() |
#12 | Link | |||||
Moderator
![]() Join Date: Jan 2006
Location: Portland, OR
Posts: 4,984
|
Quote:
Quote:
Quote:
Quote:
Quote:
|
|||||
![]() |
![]() |
![]() |
#13 | Link | |
Lost my old account :(
Join Date: Jul 2017
Posts: 360
|
Quote:
Last edited by excellentswordfight; 8th March 2022 at 22:50. |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|