Anime4000 / IFME

Powerful x265 GUI Encoder
https://x265.github.io/
GNU General Public License v2.0
239 stars 53 forks source link

Question: Upgraded to IFE 7.5 #142

Closed canbonbon closed 6 years ago

canbonbon commented 6 years ago

Hello, I have now upgraded to 7.5 and use it only for x265 encoding. However, the media file size is much smaller for the same settings compared to IFE 6.4. Now is that due to more efficient encoding or do I need to tweak my settings. Here is an example: IFE 6.4: x265, Rate Control-Single Pass, Rate factor 24, bit depth-10 IFE 6.4: x265 (2.5+13), Rate Control-Single Pass, Rate factor 24, bit depth-10

The input is the same x264 file with size about 4Gb. The output file size for IFE 6.4 is 1.2 Gb vs IFE 7.5 is around 900 mb

Not 100% if I can really tell any difference in quality when I play the files. So wanted to ask you if this is due of more efficient encoding algorithm or do I need to tweak the settings more? like reducing the rate factor to say 18 for IFE 7.5? And finally when does Rate Factor becomes useless? like in say below 18, it will continue to increase the size but there won't be any other perceived gain. So if that is the case, then what would be that Rate factor number? It defaults at 24 when it starts. So is 20 the best number?

Thanks for the great effort, this is an amazing tool.

Anime4000 commented 6 years ago

different is IFME using different version of x265. I always use nightly builds x265 encoder to achieve more compress more quality CRF value from 0 (lossless) until 51 (lossy), I choose 24 just in the middle 0 ... 51 (total 52)

thefinaldegree commented 6 years ago

canbonbon, As well as what Anime4000 mentioned, remember to match your bit-depth to the original media. If you're starting with a 8-bit source and then encoding to 10-bit then you have wasted space in the new x265 files.

As for RF values, I suggest a dynamic approach based on your source. If your source is professional camera footage before compression, then you could go with 12-16 and retain much of the original quality (personally I'd still use 18 as it's good enough). If your source is video ripped from a BluRay disc, then you'd not want to go any lower than 16-18 as you won't see any difference. For DVD as the source, don't bother going lower than 22. Anything of less quality then it won't be worth re-encoding as you'll be losing data.

Anime4000 commented 6 years ago

If plan to down scale, for example, 4K (8) to 1080p (10), you can use 10bit as output.

CyborgGenos commented 6 years ago

Hi, please help me understand how to use this to convert files to 60fps. I've used MeGUI the past successfully to do this, however I failed at trying to get h265 to work. I stumbled upon IFME and tried converting a few Animé to h265 and I think the file size and quality trade is amazing. My only problem is I don't know how to use avisynth scripts here. On the YouTube video, it looked like it allowed you to add new encoding presets but I do not see that option available (I'm using v7.5 "Cosmic Housekeeping")

As a side note, I have a paid version of SVP 4 Pro and it would be nice if I could utilise it's functions in terms of providing the script. Couldn't seem to figure out how to do it though 😅

I also downloaded avisynth+ and followed the instructions to test it but it says there's an error with line 2 and nothing imports. I'm a bit of a noob so please tell me what I've done wrong

Btw, is there any way it can predict the estimated file size before encoding, that could be really useful. Thank you

Anime4000 commented 6 years ago

@CyborgGenos can you share us AviSynth script and error message? There are way to solve this issue.

File: imouto.avs

DirectShowSource("imouto.mkv").ConvertToYV12()
InterFrame(Cores=8, Preset="Medium", Tuning="Smooth", NewNum=60, NewDen=1, GPU=true)

32 bit plugins under Windows 64bit:

C:\Program Files (x86)\AviSynth+\plugins\InterFrame2.avsi
C:\Program Files (x86)\AviSynth+\plugins\svpflow1.dll
C:\Program Files (x86)\AviSynth+\plugins\svpflow2.dll

64 bit plugins under Windows 64bit:

C:\Program Files (x86)\AviSynth+\plugins64\InterFrame2.avsi
C:\Program Files (x86)\AviSynth+\plugins64\svpflow1.dll
C:\Program Files (x86)\AviSynth+\plugins64\svpflow2.dll

Since SVP have both bit, FFmpeg 32bit and 64bit can encode. If you add 32bit plugin into script file, you need tell IFME to use 32bit FFmpeg

CyborgGenos commented 6 years ago

Hi, thanks for the reply, here is the script I got from SVP 4 followed by the error I get:

This script was generated by SVP 4 Manager.

Check https://www.svp-team.com for more details.

SetMemoryMax(6000)

global threads=7

LoadPlugin("C:\Program Files (x86)\SVP 4\plugins64\svpflow1.dll") LoadPlugin("C:\Program Files (x86)\SVP 4\plugins64\svpflow2.dll")

SetFilterMTMode("DEFAULT_MT_MODE",2) SetFilterMTMode("SVSuper",1) SetFilterMTMode("SVAnalyse",1) SetFilterMTMode("ffdshow_source",3) ffdshow_source()

ConvertToYV12()

global crop_string = "" global resize_string = "" global super_params = "{scale:{up:0},gpu:1,rc:true}" global analyse_params = "{block:{w:32},main:{search:{coarse:{type:2,distance:-6,bad:{sad:2000,range:24}},type:2}},refine:[{thsad:250}]}" global smoothfps_params = "{gpuid:21,rate:{num:5,den:2},algo:2,scene:{}}"

global demo_mode=0 global stereo_type=0

########## BEGIN OF base.avs ##########

This file is a part of SmoothVideo Project (SVP) ver.4

This is NOT the full AVS script, all used variables are defined via

JScript code that generates the full script text.

function interpolate(clip src) { input = crop_string=="" ? src : eval("src."+crop_string) input = resize_string=="" ? input : eval("input."+resize_string)

#MT-MODE-1  #do not remove this line!

super=SVSuper(input, super_params)
vectors=SVAnalyse(super, analyse_params, src=input)
smooth=SVSmoothFps(input, super, vectors, smoothfps_params, mt=threads, src=src)

#MT-MODE-2  #do not remove this line!

return demo_mode==0 ? smooth : demo(input,smooth)

}

input=last

stereo_type==0 ? eval(""" interpolate(input)

""") : stereo_type==1 ? eval(""" lf = interpolate(input.crop(0,0,input.width/2,0)) rf = interpolate(input.crop(input.width/2,0,0,0)) StackHorizontal(lf, rf) """) : stereo_type==2 ? Eval(""" lf = interpolate(input.crop(0,0,0,input.height/2)) rf = interpolate(input.crop(0,input.height/2,0,0)) StackVertical(lf, rf)""") : input

########### END OF base.avs ###########

Prefetch(threads)

2017-11-01_225643

If you can just help me figure out how to encode my anime to x265 with my svp scripts, I would really appreciate it. The reason I want to use the SVP 4 script is because it is very well optimized for 60fps and produces very little artifacts compared to when I used interframe or even SVP 3.1.7 for that matter. Thank you

Anime4000 commented 6 years ago

try use non SVP bundle, using SVP from Program File is different

Anime4000 commented 6 years ago

Use AviSynth+ and follow this tutorial: https://github.com/Anime4000/IFME/wiki/AviSynth--Frame-Interpolation