This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

[BUG] 1920x1012 10bit YUV444 file wird in AviSynth falsch verarbeitet
#21
Quote:Das heisst -pix_fmt yuv420p10le beim ffmpeg Aufruf sagt nicht ffmpeg was es für eine Quelle liest, sondern was es für einen output an x264 piped?!?
Ja, da pix_fmt ist hier ein Parameter für das Outputformat. (Achtung, die Position von Parametern ist in FFmpeg wichtig!)

Cu Selur
Reply
#22
Die niedrige CPU-Auslastung bei mir hatte nichts mit avs2yuv64 zu tun. Bin nicht dahinter gestiegen was der Grund für die Limitierung ist, die GPU limitiert da im mode 0 von fft3dgpu noch lange nicht.
Hab mal ffmpeg, avs2yuv64 und Vapoursynth/Vspipe mit verschiedenen vielen MT threads mit meinem benchmark batchfile gegeneinander antreten lassen. Jede MT thread Einstellung wurde durch eine Wiederholungsmessung bestätigt und der höhere Wert gespeichert:

ffmpeg skript:
REM ### First 3 lines will be skipped when generating AVS/VPY script from this file. 2nd line must have vspipe/ffmpeg/avs2yuv64 call. Do not remove GOTO :EOF in 3rd line!
"%hybridFolderWin%\64bit\ffmpeg.exe" -y -loglevel fatal -noautorotate -nostdin -threads 8 -i "%cd%\%dynFileName%.avs" -an -sn -vf zscale=rangein=tv:range=tv -pix_fmt yuv420p10le -strict -1 -vsync 0 -f rawvideo - | "%hybridFolderWin%\64bit\x264.exe" --crf 19.00 --profile high10 --level 5.2 --ref 1 --no-mixed-refs --keyint 250 --min-keyint 0 --scenecut 40 --bframes 3 --b-bias 0 --b-pyramid normal --direct spatial --b-adapt 1 --sync-lookahead 16 --cplxblur 20.0 --qcomp 0.60 --qblur 0.50 --mbtree --rc-lookahead 10 --ipratio 1.40 --pbratio 1.30 --chroma-qp-offset 0 --qpmin 0 --qpmax 69 --qpstep 4 --partitions i4x4,i8x8,p8x8,b8x8 --8x8dct --me hex --merange 16 --mvrange -1 --subme 2 --cabac --trellis 0 --weightp 1 --aq-mode 1 --aq-strength 1.00 --vbv-maxrate 240000 --vbv-bufsize 720000 --nr 0 --deadzone-inter 21 --deadzone-intra 11 --cqm flat --threads 16 --sar 1:1 --deblock 0:0 --non-deterministic --range tv --colormatrix bt709 --demuxer raw --input-res 1920x1012 --input-csp i420 --input-range tv --input-depth 10 --fps 24/1 --output-depth 10 --output "%cd%\%dynFileName%.264" -
goto :EOF

ClearAutoloadDirs()
SetFilterMTMode("DEFAULT_MT_MODE", MT_MULTI_INSTANCE)
LoadPlugin("$$HYBRIDFOLDER$$\64bit\Avisynth\avisynthPlugins\LoadDll.dll")
LoadDLL("$$HYBRIDFOLDER$$\64bit\Avisynth\avisynthPlugins\d3d9.dll")
LoadPlugin("$$HYBRIDFOLDER$$\64bit\Avisynth\avisynthPlugins\LSMASHSource.dll")
LoadCPlugin("$$HYBRIDFOLDER$$\64bit\Avisynth\avisynthPlugins\ffms2.dll")
LoadPlugin("$$HYBRIDFOLDER$$\64bit\Avisynth\avisynthPlugins\FFT3dGPU.dll")
# loading source: $$SOURCEVID$$
# color sampling YV24@10, matrix: bt709, scantyp: progressive, luminance scale: limited
#####
LWLibavVideoSource("$$SOURCEVID$$",cache=false,format="YUV444P16", prefer_hw=0,repeat=true)
# FFVideoSource("$$SOURCEVID$$",colorspace="YV12")
#####
# current resolution:
# denoising using fft3dgpu
#####
# ConvertToYUY2(interlaced=false)
FFT3DGPU(bw=$$BW$$,bh=$$BH$$,plane=$$PLANE$$,mode=$$MODE$$,bordersize=$$BORDERSIZE$$,precision=$$PRECISION$$)
#####
# Dithering from 16 to 10bit for encoder
ConvertBits(10)
# adjust color to YV12 (color matrix: Rec709)
ConvertToYUV420()
#####
PreFetch($$MTTHREADS$$)
# setting output fps to 24.000fps
AssumeFPS(24,1)
#####
#  output: color sampling YUY2@10, matrix: bt709, scantyp: progressive, luminance scale: limited
return last

ffmpeg Ergebnis: 15.08 fps
x1 FFT3DGPU(mode=0,bw=32,bh=32,precision=1,bordersize=1,plane=4) 10bit source ffmpeg
encoded 1730 frames, 14.87 fps, 4020.75 kb/s

x2 FFT3DGPU(mode=0,bw=32,bh=32,precision=1,bordersize=1,plane=4) 10bit source ffmpeg
encoded 1730 frames, 15.08 fps, 4020.80 kb/s

x3 FFT3DGPU(mode=0,bw=32,bh=32,precision=1,bordersize=1,plane=4) 10bit source ffmpeg
encoded 1730 frames, 15.04 fps, 4020.33 kb/s

x4 FFT3DGPU(mode=0,bw=32,bh=32,precision=1,bordersize=1,plane=4) 10bit source ffmpeg
encoded 1730 frames, 14.97 fps, 4020.91 kb/s

x5 FFT3DGPU(mode=0,bw=32,bh=32,precision=1,bordersize=1,plane=4) 10bit source ffmpeg
encoded 1730 frames, 14.98 fps, 4020.83 kb/s

x6 FFT3DGPU(mode=0,bw=32,bh=32,precision=1,bordersize=1,plane=4) 10bit source ffmpeg
encoded 1730 frames, 14.94 fps, 4020.88 kb/s

x7 FFT3DGPU(mode=0,bw=32,bh=32,precision=1,bordersize=1,plane=4) 10bit source ffmpeg
encoded 1730 frames, 14.90 fps, 4020.76 kb/s

x8 FFT3DGPU(mode=0,bw=32,bh=32,precision=1,bordersize=1,plane=4) 10bit source ffmpeg
encoded 1730 frames, 14.90 fps, 4020.69 kb/s


avs2yuv64 skript:
REM ### First 3 lines will be skipped when generating AVS/VPY script from this file. 2nd line must have vspipe/ffmpeg/avs2yuv64 call. Do not remove GOTO :EOF in 3rd line!
"%hybridFolderWin%\64bit\Avisynth\avs2yuv64.exe" "%cd%\%dynFileName%.avs" -depth 10 -o - | "%hybridFolderWin%\64bit\x264.exe" --crf 19.00 --profile high10 --level 5.2 --ref 1 --no-mixed-refs --keyint 250 --min-keyint 0 --scenecut 40 --bframes 3 --b-bias 0 --b-pyramid normal --direct spatial --b-adapt 1 --sync-lookahead 16 --cplxblur 20.0 --qcomp 0.60 --qblur 0.50 --mbtree --rc-lookahead 10 --ipratio 1.40 --pbratio 1.30 --chroma-qp-offset 0 --qpmin 0 --qpmax 69 --qpstep 4 --partitions i4x4,i8x8,p8x8,b8x8 --8x8dct --me hex --merange 16 --mvrange -1 --subme 2 --cabac --trellis 0 --weightp 1 --aq-mode 1 --aq-strength 1.00 --vbv-maxrate 240000 --vbv-bufsize 720000 --nr 0 --deadzone-inter 21 --deadzone-intra 11 --cqm flat --threads 16 --sar 1:1 --deblock 0:0 --non-deterministic --range tv --colormatrix bt709 --demuxer y4m  --input-range tv --fps 24/1 --output-csp i420 --output-depth 10 --output "%cd%\%dynFileName%.264" -
goto :EOF

ClearAutoloadDirs()
SetFilterMTMode("DEFAULT_MT_MODE", MT_MULTI_INSTANCE)
LoadPlugin("$$HYBRIDFOLDER$$\64bit\Avisynth\avisynthPlugins\LoadDll.dll")
LoadDLL("$$HYBRIDFOLDER$$\64bit\Avisynth\avisynthPlugins\d3d9.dll")
LoadPlugin("$$HYBRIDFOLDER$$\64bit\Avisynth\avisynthPlugins\LSMASHSource.dll")
LoadCPlugin("$$HYBRIDFOLDER$$\64bit\Avisynth\avisynthPlugins\ffms2.dll")
LoadPlugin("$$HYBRIDFOLDER$$\64bit\Avisynth\avisynthPlugins\FFT3dGPU.dll")
# loading source: $$SOURCEVID$$
# color sampling YV24@10, matrix: bt709, scantyp: progressive, luminance scale: limited
#####
LWLibavVideoSource("$$SOURCEVID$$",cache=false,format="YUV444P16", prefer_hw=0,repeat=true)
# FFVideoSource("$$SOURCEVID$$",colorspace="YV12")
#####
# current resolution:
# denoising using fft3dgpu
#####
# ConvertToYUY2(interlaced=false)
FFT3DGPU(bw=$$BW$$,bh=$$BH$$,plane=$$PLANE$$,mode=$$MODE$$,bordersize=$$BORDERSIZE$$,precision=$$PRECISION$$)
#####
# Dithering from 16 to 10bit for encoder
ConvertBits(10)
# adjust color to YV12 (color matrix: Rec709)
ConvertToYUV420()
#####
PreFetch($$MTTHREADS$$)
# setting output fps to 24.000fps
AssumeFPS(24,1)
#####
#  output: color sampling YUY2@10, matrix: bt709, scantyp: progressive, luminance scale: limited
return last

avs2yuv64 Ergebnis: 15.82 fps
x1 FFT3DGPU(mode=0,bw=32,bh=32,precision=1,bordersize=1,plane=4) 10bit source avs2yuv64
encoded 1730 frames, 15.50 fps, 4020.42 kb/s

x2 FFT3DGPU(mode=0,bw=32,bh=32,precision=1,bordersize=1,plane=4) 10bit source avs2yuv64
encoded 1730 frames, 15.76 fps, 4020.51 kb/s

x3 FFT3DGPU(mode=0,bw=32,bh=32,precision=1,bordersize=1,plane=4) 10bit source avs2yuv64
encoded 1730 frames, 15.82 fps, 4020.50 kb/s

x4 FFT3DGPU(mode=0,bw=32,bh=32,precision=1,bordersize=1,plane=4) 10bit source avs2yuv64
encoded 1730 frames, 15.70 fps, 4020.85 kb/s

x5 FFT3DGPU(mode=0,bw=32,bh=32,precision=1,bordersize=1,plane=4) 10bit source avs2yuv64
encoded 1730 frames, 15.65 fps, 4020.69 kb/s

x6 FFT3DGPU(mode=0,bw=32,bh=32,precision=1,bordersize=1,plane=4) 10bit source avs2yuv64
encoded 1730 frames, 15.69 fps, 4020.78 kb/s

x7 FFT3DGPU(mode=0,bw=32,bh=32,precision=1,bordersize=1,plane=4) 10bit source avs2yuv64
encoded 1730 frames, 15.68 fps, 4020.87 kb/s

x8 FFT3DGPU(mode=0,bw=32,bh=32,precision=1,bordersize=1,plane=4) 10bit source avs2yuv64
encoded 1730 frames, 15.65 fps, 4020.56 kb/s


vspipe / VapourSynth skript:
REM ### First 3 lines will be skipped when generating AVS/VPY script from this file. 2nd line must have vspipe/ffmpeg call. Do not remove GOTO :EOF in 3rd line!
"%hybridFolderWin%\64bit\Vapoursynth\vspipe.exe" "%cd%\%dynFileName%.vpy" - -c y4m | "%hybridFolderWin%\64bit\x264.exe" --crf 19.00 --profile high10 --level 5.2 --ref 1 --no-mixed-refs --keyint 250 --min-keyint 0 --scenecut 40 --bframes 3 --b-bias 0 --b-pyramid normal --direct spatial --b-adapt 1 --sync-lookahead 12 --cplxblur 20.0 --qcomp 0.60 --qblur 0.50 --mbtree --rc-lookahead 10 --ipratio 1.40 --pbratio 1.30 --chroma-qp-offset 0 --qpmin 0 --qpmax 69 --qpstep 4 --partitions i4x4,i8x8,p8x8,b8x8 --8x8dct --me hex --merange 16 --mvrange -1 --subme 2 --cabac --trellis 0 --weightp 1 --aq-mode 1 --aq-strength 1.00 --vbv-maxrate 240000 --vbv-bufsize 720000 --nr 0 --deadzone-inter 21 --deadzone-intra 11 --cqm flat --threads auto --sar 1:1 --deblock 0:0 --non-deterministic --range tv --colormatrix bt709 --demuxer y4m --input-range tv --fps 24/1 --output-csp i420 --output-depth 10 --output "%cd%\%dynFileName%.264" -
goto :EOF

# Imports
import vapoursynth as vs
# getting Vapoursynth core
import ctypes
# Loading Support Files
Dllref = ctypes.windll.LoadLibrary("$$HYBRIDFOLDER_VS$$/64bit/vsfilters/Support/libfftw3f-3.dll")
Dllref = ctypes.windll.LoadLibrary("$$HYBRIDFOLDER_VS$$/64bit/Avisynth/avisynthPlugins/d3d9.dll")
# getting Vapoursynth core
core = vs.core

# Limit thread count
core.num_threads = $$MTTHREADS$$

# Loading Plugins
core.std.LoadPlugin(path="$$HYBRIDFOLDER_VS$$/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
core.std.LoadPlugin(path="$$HYBRIDFOLDER_VS$$/64bit/vsfilters/SourceFilter/FFMS2/ffms2.dll")
core.avs.LoadPlugin(path="$$HYBRIDFOLDER_VS$$/64bit/Avisynth/avisynthPlugins/LoadDll.dll")
core.avs.LoadPlugin(path="$$HYBRIDFOLDER_VS$$/64bit/Avisynth/avisynthPlugins/FFT3dGPU.dll")

# LOADING SOURCE VIA LSMASH OR FFINDEX
clip = core.lsmas.LWLibavSource(source="$$SOURCEVID_VS$$", format="YUV444P10", cache=0, prefer_hw=0)

# Setting color matrix to 709.
clip = core.std.SetFrameProps(clip, _Matrix=1)
clip = clip if not core.text.FrameProps(clip,'_Transfer') else core.std.SetFrameProps(clip, _Transfer=1)
clip = clip if not core.text.FrameProps(clip,'_Primaries') else core.std.SetFrameProps(clip, _Primaries=1)

# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)

# making sure frame rate is set to 24
clip = core.std.AssumeFPS(clip=clip, fpsnum=24, fpsden=1)

# Execute fft3dGPU
clip = core.avs.fft3dGPU(c1=clip,bw=$$BW$$,bh=$$BH$$,plane=$$PLANE$$,mode=$$MODE$$,bordersize=$$BORDERSIZE$$,precision=$$PRECISION$$)

# Resizing using bicubic spline16
# clip = core.fmtc.resample(clip=clip, kernel="spline16", w=1920, h=1080, interlaced=False, interlacedd=False)

# adjusting output color from: YUV444P10 to YUV420P10 for x264Model
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, range_s="limited")

# set output frame rate to 24.000fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=24, fpsden=1)

# Output
clip.set_output()

Ergebnis vspipe/VapourSynth: 15.91 fps
x2 core.avs.fft3dGPU(mode=0,bw=32,bh=32,precision=1,bordersize=1,plane=4) 10bit source vspipe
encoded 1730 frames, 15.90 fps, 4010.25 kb/s

x4 core.avs.fft3dGPU(mode=0,bw=32,bh=32,precision=1,bordersize=1,plane=4) 10bit source vspipe
encoded 1730 frames, 15.90 fps, 4010.27 kb/s

x6 core.avs.fft3dGPU(mode=0,bw=32,bh=32,precision=1,bordersize=1,plane=4) 10bit source vspipe
encoded 1730 frames, 15.89 fps, 4010.29 kb/s

x8 core.avs.fft3dGPU(mode=0,bw=32,bh=32,precision=1,bordersize=1,plane=4) 10bit source vspipe
encoded 1730 frames, 15.89 fps, 4010.33 kb/s

x10 core.avs.fft3dGPU(mode=0,bw=32,bh=32,precision=1,bordersize=1,plane=4) 10bit source vspipe
encoded 1730 frames, 15.91 fps, 4010.36 kb/s

x12 core.avs.fft3dGPU(mode=0,bw=32,bh=32,precision=1,bordersize=1,plane=4) 10bit source vspipe
encoded 1730 frames, 15.90 fps, 4010.21 kb/s

x14 core.avs.fft3dGPU(mode=0,bw=32,bh=32,precision=1,bordersize=1,plane=4) 10bit source vspipe
encoded 1730 frames, 15.88 fps, 4010.30 kb/s

x16 core.avs.fft3dGPU(mode=0,bw=32,bh=32,precision=1,bordersize=1,plane=4) 10bit source vspipe
encoded 1730 frames, 15.88 fps, 4010.30 kb/s

-> Avs2yuv ist bei mir auch 4,9% schneller als ffmpeg, aber irgendwas limitiert hier. Normalerweise ist auch VapourSynth mehr als 5,5% schneller als ffmpeg.

Mir ist aufgefallen, dass distributor() nicht von Hybrid ins AVS-skript eingefügt wird, egal ob er unter filtering->avisynth->misc->script->miscellaneous aktiv ist oder nicht.
Reply
#23
Quote:Mir ist aufgefallen, dass distributor() nicht von Hybrid ins AVS-skript eingefügt wird,
AviSynthMT nutzt SetMTMode&Distributor
AviSynth+ nutzt SetFilterMTMode&Prefetch
-> distributor() nutzen macht keinen Sinn.

Würde generell auch mal antesten wie es aussieht, wenn LWLibavVideoSource mit preferHW=1 bzw. 2 oder DGDecNV genutzt wird.
Wie schnell ist denn bei Dir fft3dfilter?
Sehe da auch nicht bei der GPU sondern eher im Filter bzw. was er macht das Problem.
Nicht alles was man macht ist multithreading tauglich,...

Cu Selur
Reply
#24
Fällt mir ein: Zum Skript Benchmarking solltest Du vielleicht AvsMeter anstatt x264 verwenden. Smile
Kannst auch mal schauen ob es was bringt anstatt
SetFilterMTMode("DEFAULT_MT_MODE", MT_MULTI_INSTANCE
zu verwenden.
SetFilterMTMode("DEFAULT_MT_MODE", MT_SERIALIZED)
siehe: http://avisynth.nl/index.php/SetFilterMTMode
Reply
#25
Der verwendete MTMode hat bei non-plus avisynth teilweise auch nen Unterschied gemacht, weiß nicht wie das bei Avisynth+ ist.
EDIT: DGDecNV geht mangels Nvidia-HW nicht...

Hab mal das skript angehangen, welches ich aktuell verwende. Ist allerdings noch sehr quick 'n dirty, ich weiß nicht, ob man das checkt, wenn man's nicht selber geschrieben hat.
Generell kann man die Anzahl von threads in beliebigen Schritten ansteigen lassen und jede Messung mit einer bestimmten Anzahl von threads wird 1-x mal wiederholt (winner takes all prinzip).
Außerdem wird die CPU-Auslastung vor der Messung ermittelt, und nur gestartet, wenn diese unter 5% liegt.

Es ist ursprünglich für fft3dgpu geschrieben, vom Prinzip her kann man aber jede Art von AVS/VPS Skript benchen, die Werte in den AVS/VPS Skripten in $$GROSSBUCHSTABEN$$ werden automatisch ersetzt, wenn sie vom batchfile im AVS/VPY skript gefunden werden, wenn nicht dann nicht.
Die avs/vpy skripte müssen aber so modifiziert sein, dass in den ersten 3 Zeilen der Kommandozeilenaufruf für ffmpeg/vspipe/avs2yuv64 gefolgt von goto :EOF in der nächsten Zeile enthalten sein muß. Die ersten 3 Zeilen werden dann bei der dynamischen Generierung von skripten zum benchmarken einfach übersprungen.

Naja, wie gesagt, ich weiß nicht ob man das gleich kapiert, wie das funktioniert.
Kann auch mal fft3dfilter laufen lassen, aber ich vermute, dass der jedenfalls bei diesem video, wo aus irgendwelchen Gründen die CPU Auslastung beim encoding <50% ist, einen "unfairen" Vorteil hat.


Attached Files
.zip   LOOP_AVS_VPS_FILTER_X264_VERYFAST_10BIT.zip (Size: 26,52 KB / Downloads: 73)
Reply
#26
Kannst auch mal schauen, was passiert, wenn Du Prefetch auf X,0 setzt.
Man kann das Prefetch auch öfter im Skript aufrufen.

So mach mich mal ins Bett.

Cu Selur
Reply
#27
(08.05.2022, 21:09)Selur Wrote: Kannst auch mal schauen, was passiert, wenn Du Prefetch auf X,0 setzt.
Man kann das Prefetch auch öfter im Skript aufrufen.

So mach mich mal ins Bett.

Cu Selur

was genau bezweckt das nachgestellte 0?
Reply
#28
Das sorgt dafür, dass keine Frames gecached werden, was bei Filtern welche eh die Frames immer nur der Reihe nach abfragen eher hilft. Bei komplexeren Skripten bremst es aber.

Cu Selur
Reply
#29
Bin noch einer anderen Sache nachgegangen, die mir in Hybrid bei AviSynth usage aufgefallen ist.
Hat jetzt nichts mit fft3dgpu zu tun, sondern rein damit wie 10bit yuv444p10 files gehandelt werden.
Sowohl die 1080p version, als auch die 4K version des files, das ich häufiger gebencht habe wird nämlich - im Gegensatz zur Umsetzung in VapourSynth - immer als YUV444p16 file identifiziert und anschließend wird deswegen unnötigerweise converBits(10) und ConvertToYUV444() ausgeführt.

Hab hier mal die Version die der Hybrid AviSynth Umsetzung gebencht (wieder 3 Wiederholungsmessungen pro prefetch setting für bessere Genauigkeit):
REM ### First 3 lines will be skipped when generating AVS/VPY script from this file. 2nd line must have vspipe/ffmpeg/avs2yuv64 call. Do not remove GOTO :EOF in 3rd line!
"%hybridFolderWin%\64bit\Avisynth\avs2yuv64.exe" -depth 10 -nstdr "%cd%\%dynFileName%.avs" -o - | "%hybridFolderWin%\64bit\x264.exe" --crf 19.00 --profile high444 --level 5.2 --ref 1 --no-mixed-refs --keyint 250 --min-keyint 0 --scenecut 40 --bframes 3 --b-bias 0 --b-pyramid normal --direct spatial --b-adapt 1 --sync-lookahead 16 --cplxblur 20.0 --qcomp 0.60 --qblur 0.50 --mbtree --rc-lookahead 10 --ipratio 1.40 --pbratio 1.30 --chroma-qp-offset 0 --qpmin 0 --qpmax 69 --qpstep 4 --partitions i4x4,i8x8,p8x8,b8x8 --8x8dct --me hex --merange 16 --mvrange -1 --subme 2 --cabac --trellis 0 --weightp 1 --aq-mode 1 --aq-strength 1.00 --vbv-maxrate 240000 --vbv-bufsize 720000 --nr 0 --deadzone-inter 21 --deadzone-intra 11 --cqm flat --threads 16 --sar 1:1 --deblock 0:0 --non-deterministic --range tv --colormatrix bt709 --demuxer y4m --input-range tv --fps 24/1 --output-csp i444 --output-depth 10 --output "%cd%\%dynFileName%.264" -
goto :EOF

ClearAutoloadDirs()
SetFilterMTMode("DEFAULT_MT_MODE",MT_MULTI_INSTANCE)
SetFilterMTMode("FFT3dGPU",MT_MULTI_INSTANCE)
LoadPlugin("$$HYBRIDFOLDER$$\64bit\Avisynth\avisynthPlugins\LoadDll.dll")
LoadDLL("$$HYBRIDFOLDER$$\64bit\Avisynth\avisynthPlugins\d3d9.dll")
LoadPlugin("$$HYBRIDFOLDER$$\64bit\Avisynth\avisynthPlugins\LSMASHSource.dll")
# LoadCPlugin("$$HYBRIDFOLDER$$\64bit\Avisynth\avisynthPlugins\ffms2.dll")
LoadPlugin("$$HYBRIDFOLDER$$\64bit\Avisynth\avisynthPlugins\FFT3dGPU.dll")
# loading source: $$SOURCEVID$$
# color sampling YV24@10, matrix: bt709, scantyp: progressive, luminance scale: limited
#####
LWLibavVideoSource("$$SOURCEVID$$",cache=false,format="YUV444P16", prefer_hw=0,repeat=true)
# LWLibavVideoSource("$$SOURCEVID$$",cache=false,format="YUV444P10", prefer_hw=0,repeat=true)
# FFVideoSource("$$SOURCEVID$$",colorspace="YV12")
#####
# current resolution:

# scaling to 3840x2026
Spline16Resize(3840,2026)

# Converting from 16 to 10bit for encoder
ConvertBits(10)

# adjust color to YV24 (color matrix: Rec709)
ConvertToYUV444()
PreFetch($$DYNMEASUREVAR$$)

#####
# setting output fps to 24.000fps
AssumeFPS(24,1)
#####
#  output: color sampling YUY2@10, matrix: bt709, scantyp: progressive, luminance scale: limited
return last
--------------------------------------------------------------------------------

REPLACEMENTS:
$$SIGMA$$ replaced with '2.00'
$$BW$$ replaced with '32'
$$BH$$ replaced with '32'
$$BT$$ replaced with '3'
$$PLANE$$ replaced with '4'
$$MODE$$ replaced with '0'
$$PRECISION$$ replaced with '1'
$$BORDERSIZE$$ replaced with '1'
$$HYBRIDFOLDER$$ replaced with 'C:\Program Files\Hybrid'
$$HYBRIDFOLDER_VS$$ replaced with 'C:/Program Files/Hybrid'
$$SOURCEVID$$ replaced with 'C:\BENCH_AVS_VPS_FILTER\Hybrid YUV444P10 handling\cut_TGM_TLR2_IMAX_3840x2025_H265_YUV444_10BIT-thedigitaltheater.mkv'
$$SOURCEVID_VS$$ replaced with 'C:/BENCH_AVS_VPS_FILTER/Hybrid YUV444P10 handling/cut_TGM_TLR2_IMAX_3840x2025_H265_YUV444_10BIT-thedigitaltheater.mkv'
$$DYNMEASUREVAR$$ replaced dynamically [start,step,end] with '0,2,8'
$$DYNMEASUREVARGAP$$ replaced dynamically [start,step,end] with '0,2,8' +- gap of '+1'

--------------------------------------------------------------------------------

x0 convertbits(10)-ConvertToYUV444 - lsmash - avs2yuv - 4K YUV444P16 in YUV444P10 out 0-8T
encoded 1666 frames, 6.62 fps, 28606.15 kb/s

x2 convertbits(10)-ConvertToYUV444 - lsmash - avs2yuv - 4K YUV444P16 in YUV444P10 out 0-8T
encoded 1666 frames, 6.69 fps, 28607.94 kb/s

x4 convertbits(10)-ConvertToYUV444 - lsmash - avs2yuv - 4K YUV444P16 in YUV444P10 out 0-8T
encoded 1666 frames, 6.68 fps, 28612.34 kb/s

x6 convertbits(10)-ConvertToYUV444 - lsmash - avs2yuv - 4K YUV444P16 in YUV444P10 out 0-8T
encoded 1666 frames, 6.69 fps, 28609.66 kb/s

x8 convertbits(10)-ConvertToYUV444 - lsmash - avs2yuv - 4K YUV444P16 in YUV444P10 out 0-8T
encoded 1666 frames, 6.64 fps, 28607.28 kb/s

Und hier eine Variante, die der Umsetzung in VapourSynth entsprechen würde, bei welcher das file korrekt als YUV444P10 identifiziert wird, und die 2 zusätzlichen Umwandlungsschritte wegfallen:

REM ### First 3 lines will be skipped when generating AVS/VPY script from this file. 2nd line must have vspipe/ffmpeg/avs2yuv64 call. Do not remove GOTO :EOF in 3rd line!
"%hybridFolderWin%\64bit\Avisynth\avs2yuv64.exe" -depth 10 -nstdr "%cd%\%dynFileName%.avs" -o - | "%hybridFolderWin%\64bit\x264.exe" --crf 19.00 --profile high444 --level 5.2 --ref 1 --no-mixed-refs --keyint 250 --min-keyint 0 --scenecut 40 --bframes 3 --b-bias 0 --b-pyramid normal --direct spatial --b-adapt 1 --sync-lookahead 16 --cplxblur 20.0 --qcomp 0.60 --qblur 0.50 --mbtree --rc-lookahead 10 --ipratio 1.40 --pbratio 1.30 --chroma-qp-offset 0 --qpmin 0 --qpmax 69 --qpstep 4 --partitions i4x4,i8x8,p8x8,b8x8 --8x8dct --me hex --merange 16 --mvrange -1 --subme 2 --cabac --trellis 0 --weightp 1 --aq-mode 1 --aq-strength 1.00 --vbv-maxrate 240000 --vbv-bufsize 720000 --nr 0 --deadzone-inter 21 --deadzone-intra 11 --cqm flat --threads 16 --sar 1:1 --deblock 0:0 --non-deterministic --range tv --colormatrix bt709 --demuxer y4m --input-range tv --fps 24/1 --output-csp i444 --output-depth 10 --output "%cd%\%dynFileName%.264" -
goto :EOF

ClearAutoloadDirs()
SetFilterMTMode("DEFAULT_MT_MODE",MT_MULTI_INSTANCE)
SetFilterMTMode("FFT3dGPU",MT_MULTI_INSTANCE)
LoadPlugin("$$HYBRIDFOLDER$$\64bit\Avisynth\avisynthPlugins\LoadDll.dll")
LoadDLL("$$HYBRIDFOLDER$$\64bit\Avisynth\avisynthPlugins\d3d9.dll")
LoadPlugin("$$HYBRIDFOLDER$$\64bit\Avisynth\avisynthPlugins\LSMASHSource.dll")
LoadCPlugin("$$HYBRIDFOLDER$$\64bit\Avisynth\avisynthPlugins\ffms2.dll")
LoadPlugin("$$HYBRIDFOLDER$$\64bit\Avisynth\avisynthPlugins\FFT3dGPU.dll")
# loading source: $$SOURCEVID$$
# color sampling YV24@10, matrix: bt709, scantyp: progressive, luminance scale: limited
#####
# LWLibavVideoSource("$$SOURCEVID$$",cache=false,format="YUV444P16", prefer_hw=0,repeat=true)
LWLibavVideoSource("$$SOURCEVID$$",cache=false,format="YUV444P10", prefer_hw=0,repeat=true)
# FFVideoSource("$$SOURCEVID$$",colorspace="YV12")
#####
# current resolution:

# scaling to 3840x2026
Spline16Resize(3840,2026)

# Converting from 16 to 10bit for encoder
# ConvertBits(10)

# adjust color to YV24 (color matrix: Rec709)
# ConvertToYUV444()

PreFetch($$DYNMEASUREVAR$$)
#####
# setting output fps to 24.000fps
AssumeFPS(24,1)
#####
#  output: color sampling YUY2@10, matrix: bt709, scantyp: progressive, luminance scale: limited
return last
--------------------------------------------------------------------------------

REPLACEMENTS:
$$SIGMA$$ replaced with '2.00'
$$BW$$ replaced with '32'
$$BH$$ replaced with '32'
$$BT$$ replaced with '3'
$$PLANE$$ replaced with '4'
$$MODE$$ replaced with '0'
$$PRECISION$$ replaced with '1'
$$BORDERSIZE$$ replaced with '1'
$$HYBRIDFOLDER$$ replaced with 'C:\Program Files\Hybrid'
$$HYBRIDFOLDER_VS$$ replaced with 'C:/Program Files/Hybrid'
$$SOURCEVID$$ replaced with 'C:\BENCH_AVS_VPS_FILTER\Hybrid YUV444P10 handling\cut_TGM_TLR2_IMAX_3840x2025_H265_YUV444_10BIT-thedigitaltheater.mkv'
$$SOURCEVID_VS$$ replaced with 'C:/BENCH_AVS_VPS_FILTER/Hybrid YUV444P10 handling/cut_TGM_TLR2_IMAX_3840x2025_H265_YUV444_10BIT-thedigitaltheater.mkv'
$$DYNMEASUREVAR$$ replaced dynamically [start,step,end] with '0,2,8'
$$DYNMEASUREVARGAP$$ replaced dynamically [start,step,end] with '0,2,8' +- gap of '+1'

--------------------------------------------------------------------------------

x0 lsmash - avs2yuv - 4K YUV444P10 in YUV444P10 out 0-8T
encoded 1666 frames, 6.76 fps, 28592.31 kb/s

x2 lsmash - avs2yuv - 4K YUV444P10 in YUV444P10 out 0-8T
encoded 1666 frames, 6.79 fps, 28589.79 kb/s

x4 lsmash - avs2yuv - 4K YUV444P10 in YUV444P10 out 0-8T
encoded 1666 frames, 6.83 fps, 28592.18 kb/s

x6 lsmash - avs2yuv - 4K YUV444P10 in YUV444P10 out 0-8T
encoded 1666 frames, 6.79 fps, 28590.56 kb/s

x8 lsmash - avs2yuv - 4K YUV444P10 in YUV444P10 out 0-8T
encoded 1666 frames, 6.71 fps, 28591.17 kb/s

Sind 2.1% Unterschied bei den Bestwerten und jedes einzelne prefetch setting ist ebenfalls schneller.
Vermutlich wäre der Unterschied noch etwas deutlicher ausgefallen, hätte ich ein x264 preset verwendet, welches dazu führt, dass meine CPU beim encoding wirklich konstant mit 100% ausgelastet ist, aber das kostet bei 3 Wiederholungsmessungen auf ner lahmen CPU halt wieder jede Menge Zeit...

Ich weiß, hört sich auf den ersten Blick etwas pingelig an, aber sollte man in diesen Zeiten nicht versuchen jeden (Energie) Effizienzgewinn zu heben, der "auf der Straße" bzw. im Code liegt?  Undecided

Im Anhang nochmal die aktuellste Version des bench-batchfiles mit den dafür gemoddeten Skripten und Messergebnissen, falls du oder jemand anderes das auf seinem System nachvollziehen will.
Oder das ganze hier zusammen mit der entsprechenden YUV444P10 version des Videos: Link
Reply
#30
ConvertTo444() bei 4:4:4 Material sollte nichts machen. (muss ich mal drauf schauen, ist vermutlich nocht ein Artefakt was daher stammt, dass man theoretisch noch Avisynth MT nutzen kann)
Das YUV444P16 ist glaub ich noch ein überbleibsel daher, dass LWLibAVSource früher 8 und 16 bit ordentlich unterstützt hatte. (bei FFVideoSource tritt das meine ich nicht auf)
2,1% ist nicht gerade viel, erscheint mir vernachlässigbar,...

Cu Selur
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)