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: Sep 2023
Posts: 27
|
Possible to reach visually transparent encodes of anime with 35-40% compression?
Hi
I have a lot of anime blu-ray, and using discs is a pain in the as* (personal opinion) + I like to just pick my favorite scenes (fighting anime) sometimes and watch them. For movies (live action I mean, not anime) BR, I just remux them. But for my anime, I quickly realized that it would take a ton of storage (like tens of Tb) if I were to just remux them with no encoding, because I have anime series that are tens or hundreds of episodes (bleach, DBZ etc. for example). Obviously I want to keep a very good image and the lossless audio. My question is quite simple: Despite the fact that encoding would result in losing, on paper, quality, is it though possible to achieve a visually transparent quality of my anime BR encodes (I guess ther's maybe a limit of what our eyes can perceive and the quality loss they can accept? Especially for less demanding "images" like anime (as opposed to live action movies)... all that compressing the files for like 35-40%? Encoding time is not really a concern (though i don't want to spend 4 hours encoding a single episode, 1 or 1h30 for a 22 min episode is my limit), as I have 2 PC and one of them have a 5950X and 64gb ram, and the other has a 7950X and 96gb of ram). Oh and it would be to watch on a 85" screen...so i'm not interested in doing mini encodes and alike. If not, what's the best type of quality I can hope knowing what I just said? Like 90% of the visual quality? (which is acceptable too) Thanks in advance Last edited by N'Cha; 18th September 2023 at 16:21. |
![]() |
![]() |
![]() |
#2 | Link |
Registered User
Join Date: Dec 2013
Posts: 314
|
Just try it. Do a CRF 18 preset slower encode of your average content and check if you are Ok with the quality, speed and rate.
Regarding your 85" screen, screen size is not relevant, view distance to screen size is relevant. If you are sitting really close you will start to see things even with a BR. |
![]() |
![]() |
![]() |
#3 | Link |
Registered User
Join Date: Sep 2023
Posts: 27
|
i was hoping answers beyond the "try it" (or else I wouldn't have created a post, I know I could try it. And what works with an anime and a specific episode, might not give me the same satisfaction with another episode or anime). My question is more geared toward "is it possible to do visually transparent while compressing roughly 30-40%.
About my view distance I like too be immersed so i'm like 3 meters (roughly 9.8 feet) from the screen (small living room anyway). |
![]() |
![]() |
![]() |
#4 | Link |
Registered User
Join Date: May 2009
Posts: 313
|
There is an whole topic about it in the forums. Yes it's old, but not much has changed since then sadly. But to get that low, you will probably have to move to AV1, as it compresses anime really well. I have no experience with VVC.
But honestly, build a nice media server and then put all your content on it in raw format. You'll be happier, and will use less money building it then you would in regards to electricity costs and time to encode the files. |
![]() |
![]() |
![]() |
#5 | Link |
ffx264/ffhevc author
Join Date: May 2007
Location: /dev/video0
Posts: 1,809
|
There is no silver bullet. It is nearly impossible to recommend settings for 35-40% compression as there are too many variables across different content. The best you can do is trial and error of various settings and find a "sweet spot" that is good enough but not perfect or spot on. You'd still have content that "doesn't fit", though.
__________________
TV: Samsung QE50Q60T AVR: Denon AVR-X1700H CD: Yamaha CD-S300 Tuner: TechniSat 143v3 BD: Samsung UBD-M8500 Speakers: Klipsch Reference Phono: Audio-Technica AT-LP120X Amp: Marantz PM6007 |
![]() |
![]() |
![]() |
#6 | Link |
Moderator
![]() Join Date: Jan 2006
Location: Portland, OR
Posts: 4,578
|
35-40% for animation content from Blu-ray is pretty straightforward, as Blu-ray's H.264 1 sec GOP and 3 B-frame max are pretty limiting compared to what long-GOP HEVC can do.
Anime can benefit from some different settings, as there is a lot of spatial redundancy and some extreme temporal redundancy. Try something like: --preset slower --tskip --tskip-fast --tu-inter-depth 4 --tu-intra-depth 4 --limit-tu --nr-inter 150 --selective-sao 2 With the big flat areas and sharp edges, the combination of tskip and min 4x4 TU size can squeeze a lot of bits out. And some temporal deadzoning as denoising can help remove some unintended temporal noise |
![]() |
![]() |
![]() |
#8 | Link |
Registered User
Join Date: Sep 2023
Posts: 27
|
Bframes=12 vs Bframes=16 and which encoder level?
Bframes 12 is enough for anime content or could I really benefit from bframes 16?
Was thinking either --bframes 12 --rc-lookahead 100 or --bframes 16 --rc-lookahead 120 And not sure if I should let the encoder set its level automatically (probably gonna end up being 5.0 if I let it on auto) or if I should set it to 4.1 knowing I aim at very high quality encode And should i set --no-open-gop or --open-gop for anime? (it's to be palyed from my HTPC or my shield or plex, not sure for the latter) What do you guys think? Thanks Last edited by N'Cha; 20th September 2023 at 10:44. |
![]() |
![]() |
![]() |
#9 | Link | |
Lost my old account :(
Join Date: Jul 2017
Posts: 318
|
Quote:
The reason why you would like to set level manually is cause that will set the proper vbv limits for that level, without specifing it will be unrestrictive. This can cause some playback issues on some devices or if you are doing in-home streaming on wifi etc (and this is why I always use it). The smaller the gop sice the bigger is the benefit of open-gop, so if you are going for a say 10s keyint, I dont think it will make a big differnce eitherway. But i have never seen any playback issues of using open-gop with hevc so I always keep it on (unless I encode for fixed gop streaming cases) as it is benifitial for compression. This is what I use for 1080p24 bluray anime titles, should be a decent starting point: --preset slow --profile main10 --level-idc 41 --keyint 240 --min-keyint 24 --rc-lookahead 96 --bframes 8 --psy-rd 1 --tskip --aq-mode 3 --selective-sao 2 if you want it to be "visually lossless", you can disable sao and increase psy-rd, but then you might not reach your compression goals. So i would play a bit with different crf, psy-rd and selective-sao values until you find what you are looking for. Last edited by excellentswordfight; 20th September 2023 at 21:01. |
|
![]() |
![]() |
![]() |
#10 | Link | |
Registered User
Join Date: Sep 2023
Posts: 27
|
Quote:
Last edited by N'Cha; 21st September 2023 at 07:57. |
|
![]() |
![]() |
![]() |
#11 | Link | |
Lost my old account :(
Join Date: Jul 2017
Posts: 318
|
Quote:
But you are right, you can absolutly do that instead as its so overwhelmingly common for hevc decoderc now days to support 5.1. But I still use the practice of always go for the lowest level as long as the framesize and max bitrate matches my target. |
|
![]() |
![]() |
![]() |
#13 | Link |
Registered User
Join Date: Sep 2023
Posts: 27
|
Problem: any profile i set/try (4.1, 5.0, 5.1) with main tier (even tried with high tier), it says "x265 [error]: frame rate is out of range for specified level" only if i remove the level i set to leave it on auto, it works...
I also get "deprecated pixel format used" for using --pix_fmt yuv420p10le EDIT: Strangely, if I remove --map 0 (which I need as i want to pass all audio and subtitles) it now works... but ineed to pass all streams with --map 0 so not a solution Last edited by N'Cha; 21st September 2023 at 10:09. |
![]() |
![]() |
![]() |
#14 | Link | |
Lost my old account :(
Join Date: Jul 2017
Posts: 318
|
Quote:
If piping input from ffmpeg to x265 this works just fine for 1080p24 8bit: "ffmpeg.exe" -i "input" -an -f yuv4mpegpipe -strict -1 - | "x265.exe" --y4m --profile main10 --level-idc 41 ... You dont actually need to convert it to 10bit before feeding x265, if you set profile main10 x265 will handle the conversion internally. Last edited by excellentswordfight; 21st September 2023 at 10:26. |
|
![]() |
![]() |
![]() |
#15 | Link |
Registered User
Join Date: Sep 2023
Posts: 27
|
I found the problem! There is an image embedded in the MKV (i kept the "attachment picture, i thought it was used to display automatically a thumbnail) on stream #0:5. That's why when I remove -map 0 it worked
How can I copy all the stream 0 (the video, all audios and subs) but remove only the attachement image? by default I used -map 0 I tested with mkvtoolnix removing the iamge, and now I get no error and the encoding starts, but a ffmpeg command would be more practical Stream #0:5: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 640x360, 90k tbr, 90k tbn (attached pic) Metadata: filename : cover.jpg mimetype : image/jpeg Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> hevc (libx265)) Stream #0:1 -> #0:1 (copy) Stream #0:2 -> #0:2 (copy) Stream #0:3 -> #0:3 (copy) Stream #0:4 -> #0:4 (copy) Stream #0:5 -> #0:5 (mjpeg (native) -> hevc (libx265)) Press [q] to stop, [?] for help [swscaler @ 0000020394192700] deprecated pixel format used, make sure you did set range correctly [swscaler @ 00000203943c0b80] deprecated pixel format used, make sure you did set range correctly [swscaler @ 00000203942b5800] deprecated pixel format used, make sure you did set range correctly [swscaler @ 00000203943c6a80] deprecated pixel format used, make sure you did set range correctly x265 [info]: HEVC encoder version 3.5+96-9c9ab68fc x265 [info]: build info [Windows][GCC 12.2.0][64 bit] 10bit x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 x265 [error]: frame rate is out of range for specified level [libx265 @ 0000020392748800] Cannot open libx265 encoder. [vost#0:5/libx265 @ 0000020393090cc0] Error initializing output stream: Error while opening encoder for output stream #0:5 - maybe incorrect parameters such as bit_rate, rate, width or height Conversion failed! Last edited by N'Cha; 21st September 2023 at 10:34. |
![]() |
![]() |
![]() |
#16 | Link | |
Lost my old account :(
Join Date: Jul 2017
Posts: 318
|
Quote:
Last edited by excellentswordfight; 21st September 2023 at 10:39. |
|
![]() |
![]() |
![]() |
#17 | Link | |
Registered User
Join Date: Sep 2023
Posts: 27
|
Quote:
What the purpose of attachement? I kept the attachment on all remuxes I did, i thought it was for displaying the image of the episode or movie on plex, kodi etc. Whoops Last edited by N'Cha; 21st September 2023 at 10:41. |
|
![]() |
![]() |
![]() |
#18 | Link | |
Lost my old account :(
Join Date: Jul 2017
Posts: 318
|
Quote:
If your target is plex, I woudlnt care for any type of image attachments etc, as plex has that feature built in and will populate covers etc automatically. Not sure how great it is with anime, but in my experience it does a great job with that in general. |
|
![]() |
![]() |
![]() |
#19 | Link |
Registered User
Join Date: Sep 2023
Posts: 27
|
well my target is my PC (it can read anything) but i also plan to buy a nvidia shield in a few months and to maybe use plex (not sure, as it would be hard to leave MPC-HC + Madvr)
Thanks for thelp p.s: I picket "level 5.0" (main) eventually, for the 25Mb/s and I guess nvidia shield can mange that without problem + i tested on my 3 years phone and it works + on USB on my 5 years old TV it works too, so I guess nowadays, it must be rare the devices that don't read HEVC and/or high than 4.1 level |
![]() |
![]() |
![]() |
#20 | Link | |
ffx264/ffhevc author
Join Date: May 2007
Location: /dev/video0
Posts: 1,809
|
Quote:
I have great experience with Kodi on the NV Shield. It can basically play anything, including HDR10. I haven't tried DoVi and HDR10+, though.
__________________
TV: Samsung QE50Q60T AVR: Denon AVR-X1700H CD: Yamaha CD-S300 Tuner: TechniSat 143v3 BD: Samsung UBD-M8500 Speakers: Klipsch Reference Phono: Audio-Technica AT-LP120X Amp: Marantz PM6007 |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|