Hi videohelper's , i am struggling to get start with 16bit (High_bit_depth) encoding but it is not working correctly in 10bit . i am getting all green picture with the double width/1440 but height/480 remain same after encoding (it is my first time i am trying learn but cant figure it out ), please can someone point me to the right direction, how this should be done ?
I am using MeGUI with Avisynth Plus
this was script for starting test
I was excepting normal picture just with more bits pixel , my result is in 10bit but looks terrible . which tool i use to do this High bit-depth encoding ?Code:Loadplugin("C:\Users\Mod\Downloads\ffms2-6e0d654+a9fe004-ffmpeg-1e4d049\ffms2.dll") FFVideoSource("C:\Users\jo\Video\Jasmine Sandlas Ft. DJ Flow - White Hill .mp4", fpsnum=25, fpsden=1, track=-1, cache=true ,seekmode=1, enable10bithack=true, resizer="spline", threads=1) Dither_Convert_8_to_16() smdegrain(tr=3, slices=true, lsb_in=true, lsb=true, lsb_out=true, mode=0, Always_MdegrainN=true ) GradFun3(thr=0.35, radius=12, elast=3.00, mask=3, mode=0, smode=0, debug=0, lsb=true, lsb_in=true, staticnoise=False, thrc=0.35, radiusc=12, elastc=3.00, y=3, u=3, v=3) LinearResize(720,480,kernel="spline36",mode=0, Lsb_in=true, Lsb_out=true) Dither_out(bigendian=False)
Any help would be much appreciated ,TIA.
+ Reply to Thread
Results 1 to 30 of 31
-
-
I haven't done it using MeGUI but I see two possible problems:
1.) You use ffvideosource with 10 bit hack. So this will output 10/16 bit. In the line below you use Dither_Convert_8_to_16() but that function only makes sense with 8 bit input.
In general, that doesn't make sense with AviSynth+. If you use latest vanilla ffms2 it should use its native high bitdepth formats without a hack. Then for incompatible filters you can convert back to using some special AviSynth+ filters. http://avisynth.nl/index.php/ConvertStacked
2.) Look into MeGUI log. How is it opening/piping the AviSynth script with/to x264? It is likely it doesn't detect that it's dealing with high bitdepth. Maybe it's easier to just do it from the command-line.
And remove all smdegrain, GradFun3 and LinearResize for testing until you have figured high bitdepth out. Walk before you run.Last edited by sneaker; 1st Jun 2017 at 17:21.
-
Dither_out outputs 16bit. I don't think x264 knows how to decode 16bit video, only 10bit.
AVS+ has the ConvertBits function (its wiki page is currently empty - my fault - see this post) which can output 10bit for you.
EDIT I forgot to mention ConvertFromStacked. It converts from Stack16 to true 16-bit.Code:# <Stack16 here...> #Dither_out(bigendian=False) ## disable this line ConvertFromStacked ConvertBits(10, dither=0) ## 0=dither ON, -1=dither OFF
Code:--demuxer <string> - auto, raw, y4m, avs, lavf --input-csp <string> Specify input colorspace format for raw input - valid csps for `raw' demuxer: i420, yv12, nv12, nv21, i422, yv16, nv16, i444, yv24, bgr, bgra, rgb - valid csps for `lavf' demuxer: yuv420p, yuyv422, rgb24, bgr24, yuv422p, yuv444p, yuv410p, yuv411p, gray, monow, monob, pal8, yuvj420p, yuvj422p, yuvj444p, xvmcmc, xvmcidct, uyvy422, uyyvyy411, bgr8, bgr4, bgr4_byte, rgb8, rgb4, rgb4_byte, nv12, nv21, argb, rgba, abgr, bgra, gray16be, gray16le, yuv440p, yuvj440p, yuva420p, vdpau_h264, vdpau_mpeg1, vdpau_mpeg2, vdpau_wmv3, vdpau_vc1, rgb48be, rgb48le, rgb565be, rgb565le, rgb555be, rgb555le, bgr565be, bgr565le, bgr555be, bgr555le, vaapi_moco, vaapi_idct, vaapi_vld, yuv420p16le, /* 16bit */ yuv420p16be, yuv422p16le, yuv422p16be, yuv444p16le, yuv444p16be, vdpau_mpeg4, dxva2_vld, rgb444le, rgb444be, bgr444le, bgr444be, ya8, bgr48be, bgr48le, yuv420p9be, yuv420p9le, yuv420p10be, yuv420p10le, /* 10bit */ yuv422p10be, yuv422p10le, yuv444p9be, yuv444p9le, yuv444p10be, yuv444p10le, yuv422p9be, yuv422p9le, vda_vld, gbrp, gbrp9be, gbrp9le, gbrp10be, gbrp10le, gbrp16be, gbrp16le, yuva422p, yuva444p, yuva420p9be, yuva420p9le, yuva422p9be, yuva422p9le, yuva444p9be, yuva444p9le, yuva420p10be, yuva420p10le, yuva422p10be, yuva422p10le, yuva444p10be, yuva444p10le, yuva420p16be, yuva420p16le, yuva422p16be, yuva422p16le, yuva444p16be, yuva444p16le, vdpau, xyz12le, xyz12be, nv16, nv20le, nv20be, rgba64be, rgba64le, bgra64be, bgra64le, yvyu422, vda, ya16be, ya16le, gbrap, gbrap16be, gbrap16le, qsv, mmal, d3d11va_vld
Last edited by raffriff42; 2nd Jun 2017 at 08:53. Reason: forgot ConvertFromStacked
-
Yes, for raw input. If MeGUI uses y4m piping but with a piping software that cannot detect high bitdepth AviSynth+ formats it won't work. And then you need to have the script output in AviSynth+'s native high bitdepth format, of course, not the hacked kind. If MeGUI lets x264 open the script directly it should also work with native output (but then needs same 32 bit / 64 bit for avs+ and x264). Need to see the log to understand what MeGUI is doing exactly.
Also, don't expect preview to look normal. -
Quote neaker
Hi sneaker thanks for repling, alright might be something else then if not MeGUI. As i'm beginerer on this HBD track i m trying to give it spark btw script is a dummy for test will improve it hopefuly. MeGUI\tools\x264\x264-10bit this is part of process if i m not wrong i read it on doom9 somewhere cant refrence to any post(i'm sure there's many available) but thanks you for time you took appreciate it.
Hello raffriff42, thank you mate for much detail (myabe it's megui megui can't output native-10bit) .
But i'm sorry i can't get Convert-Bits(16) to work i get this error http://prntscr.com/ff0s1l but without ConvertBits() it is working fine that's reason i had to use Dither_Out() (on my win7-x64 i Installed Avisynth+1576 installer and override it with the letest Avs+ r2489" AvisynthPlus-r2489-MT\x64\system\devil.dll + Avisynth.dll > system32 and from AvisynthPlus-r2489-MT\x86\AvisynthPlus-r2489-MT\system\Devil.dll + Avisynth.Dll >syswow64) avisynth+ working fine but no idea why it is not ConvertBits Function.
Anyway i was searching for 4:2:0 to 4:2:2 upconversion and found this from doom9 and i this could be part of my script to start it up, but still there is more to understand and learn
got it from here : http://prntscr.com/ff0ywq
Code:#Convert to Stack16 for processing Dither_Convert_8_to_16() #Convert to 4:2:2 (if interlaced, SeperateFields and Weave must be used) #SeparateFields() w = Width()/2 h = Height()/2 u = UToY8().Dither_resize16(w, h, kernel="spline36", src_left=0, u=1, v=1) v = VToY8().Dither_resize16(w, h, kernel="spline36", src_left=0, u=1, v=1) YToUV(u, v, last) #Weave() #Convert to 10-bit and output Dither_quantize(10,reducerange=true) Dither_out()
Code:avs2yuv -raw -csp I422 output.avs - | ffmpeg -y -f rawvideo -pix_fmt yuv422p10le -s 720x480 -r 23.976 -i - -c:v v210 output.mkv
i am trying to extend the above script
Code:global MeGUI_darx = 4 global MeGUI_dary = 3 Setmemorymax(1024) LoadPlugin("C:\Program Files (x86)\MeGUI-2715-32\tools\dgindex\DGDecode.dll") DGDecode_mpeg2source("C:\Users\Mod\Videos\VTS_01_2be.d2v", cpu=4, info=3) LoadPlugin("C:\Program Files (x86)\MeGUI-2715-32\tools\avisynth_plugin\ColorMatrix.dll") ColorMatrix(hints=true, threads=0) Dither_convert_8_to_16() w = Width()/2 h = Height()/2 u = UToY8().Dither_resize16(w, h, kernel="spline36", src_left=0, u=1, v=1) v = VToY8().Dither_resize16(w, h, kernel="spline36", src_left=0, u=1, v=1) YToUV(u, v, last) smdegrain(tr=2, thsad=300, Lsb_in=true, Lsb=true, Lsb_out=true,mode=0,slices=true) Gradfun3(lsb_in=true,lsb=true,mode=0) LinearResize(720,480, kernel="spline36",mode=0, lsb_in=true, lsb_out=true) Dither_quantize(10,reducerange=true) Dither_out()
Code:avs2yuv -raw -csp I422 output.avs - | ffmpeg -y -f rawvideo -pix_fmt yuv422p10le -s 720x480 -r 23.976 -i - -c:v v210 output.mkv
-
Stop. I don't even know where to start. You want way too much and your ideas are all over the place. Start with a very simple script. Just source and high bitdepth output and encode that. Once you have that working you can extend.
With latest AviSynth+, latest ffms2 and latest avs2pipemod it should look very simple:
AviSynth+ script:
Code:ffvideosource("input.mkv")
Code:avs2pipemod -y4mp "script.avs" | x264-10bit - --demuxer y4m -o "output.264"
Code:avs2pipemod64 -y4mp "script.avs" | x264-10bit - --demuxer y4m -o "output.264"
With
Code:avs2pipemod -info "script.avs"
About big file size: v210 "codec" is just uncompressed. You probably want -c:v libx264 or something like that but I can also warn you that zeranoe's ffmpeg builds only have 8 bit x264.Last edited by sneaker; 2nd Jun 2017 at 07:29.
-
-
Just a note, This may explain your error, but it's also possible AvisynthPlus was not installed correctly...
-
Hi raffriff42 thank you for the info will look into it .
Hi sneaker, now i tried as u told me to but still not working when i open .bat file it says avs2pipemod is not recognise as a internal or external command, operable program or batch file
I downloaded those two program avs2pipemod and latest ffms2
but i can't make .bat command line as i am beginner have no clue please help me specify avs2pipemod command. I have created a folder on Desktop where i got ffms2 and avspipemod + x264-10bit and i saved a script in the same folder ( files in folder http://prntscr.com/ff61ql ) now i want to clear do i have to install anything else? or this is it. now next step is to right an correct command for test encoding( i couldn't get this work for myself tried already ) hopefully sneaker or raffriff42 and others will help me on it.
i get an error 'avs2pipemod is not recognise http://prntscr.com/ff6ead any clue this is a command avs2pipemod - y4mp=10:11 Tashan_src.avs | x264-10bit - --demuxer y4m -o output.h264 maybe not correct -
It looks like your problem is a path issue
The command prompt (directory level) is open at c:\users\mod , but avs2pipemod is in a different directory
You can specify full directory paths in your scripts and command lines, or setup environment variables (so you can call exe's from anywhere)
Or to begin with , it might be easier at first - if everything is in the same folder, then open a command prompt in that directory level (in windows explorer, if the directory is open, hold right mouse click => open command window here ) . For you , that would be the "10-bit starting test" folder -
sweet poisondeathray , that's what it was i had to keep in my user folder
http://prntscr.com/ff6vav
i am beginner just started walking in this, will learn surely big thanks poisondeathray u point at the main issue which have solved the error now it is working http://prntscr.com/ff6tyo -
yea sneaker got it working now (thank you poisondeathray for pointing at directory) ,
here is an working command .
Code:avs2pipemod -y4mp "title00.mkv.avs"| x264-10bit - --demuxer y4m -o "output.h264"
Code:# Set DAR in encoder to 4 : 3. The following line is for automatic signalling global MeGUI_darx = 4 global MeGUI_dary = 3 LoadPlugin("C:\Program Files (x86)\MeGUI-2715-32\tools\ffms\ffms2.dll") FFVideoSource("C:\Video\DVDVolume\title00.mkv", fpsnum=24000, fpsden=1001, threads=1) Dither_Convert_8_to_16() Dither_Resize16(720,480) Dither_out()
-
That script should not be working with with command line. Latest AviSynth+/ffms2 work with native AviSynth+ high bitdepth formats (which aren't used for DVDs as they are 8 bit) but dither tools only knows the native AviSynth 8 bit formats. avs2pipemod cannot detect the hacked high bitdepth format that dither tools uses and thus tells x264 it is sending 8 bit data.
Or is AviSynth+ able to deal with dither tools somehow? Maybe I need to test it... -
it is working mate check here http://prntscr.com/ff7d48 but result are all green (i wasn't clear about dvd shouldn't be processed) so only Blu_ray or HD material should be used , and please can u post a script to start test for avs2pipemod to read the 10bit hack.
thanks sneaker for getting back -
Yes, that's what I meant and expected by "not working".
No, it was just a note I wanted to make. And most HD (incl. Blu-ray except UltraHD Blu-Ray) is only 8 bit as well.
Bottom line: the source bitdepth shouldn't matter, the output will always be wrong with your combination of avs+ and avs2pipemod and that command-line.
Just remove all the dither tools stuff. It just messes things up and is not needed. It's mostly useful for vanilla AviSynth, not AviSynth+. Try the native tools of AviSynth+.
http://avisynth.nl/index.php/AviSynth%2B
I guess something like this should do (did not test it):
Code:ffvideosource("source.mkv") ConvertBits(10) #only for non-10-bit-sources like DVD, Blu-Ray (except UltraHD), ... BicubicResize(720, 480)
If you want to use filters that use the non-native, hacked high bitdepth format convert to hacked format before the filter and back to native AviSynth+ format afterwards:
http://avisynth.nl/index.php/ConvertStackedLast edited by sneaker; 2nd Jun 2017 at 15:15.
-
Last edited by BÌG•bµdd; 2nd Jun 2017 at 19:23. Reason: der was an extra line in script converttorgb24
-
Don't convert to 8 bit at the end if you want to output 10 bit. Not every software can read 10 bit but avs2pipemod->x264 can do it.
From what I understand the latest SMDegrain script and components can now use native high bitdepth format of AviSynth+. So simply:
Code:ffvideosource("source.mkv") ConvertBits(16) SMDegrain() BicubicResize(720, 480) ConvertBits(10)
-
i get this error http://prntscr.com/ffe4zg with a script here is an link to source can u give it shot (i think color planar change before mdegrain)
videohttps://mega.nz/#!0CxXBZqb!o-b3wMwC3BxM5J5Nj2Xu-B9NmRNQ-4d84bRmNUWZYnU -
Get the latest plugins and try again:
https://github.com/pinterf/masktools/releases/latest
( https://github.com/pinterf/mvtools/releases/latest ) -
thanks sneaker for plugin DL, btw i got another error now http://prntscr.com/fffhkv any idea
-
Please try latest avs+ (I can't test right now). Either way this should just affect the preview?
-
Ok, I tested it and got the same error. It seems MeGUI isn't ready yet for AviSynth+ high bitdepth.
There is a workaround, though. AddCode:ConvertBits(16) ConvertToDoubleWidth()
Last edited by sneaker; 3rd Jun 2017 at 12:46.
-
alright sneaker thanks for testing but that's no good na then how should i encode Dither out to correct x264-10bit (mean no green screen).
so what about avs2yuv Codec [color=red]-c:v v210[.color] which other codec version can be used which use bitrate limit ?
Code:avs2yuv -raw -csp I422 "C:\new\output.avs" - | ffmpeg -y -f rawvideo -pix_fmt yuv422p10le -s 720x480 -r 23.976 -i - -c:v v210 output.mkv
Code:Dither_convert_8_to_16() #Convert to 4:2:2 (if interlaced, SeperateFields and Weave must be used) #SeparateFields() w = Width()/2 h = Height()/2 u = UToY8().Dither_resize16(w, h, kernel="spline36", src_left=0, u=1, v=1) v = VToY8().Dither_resize16(w, h, kernel="spline36", src_left=0, u=1, v=1) YToUV(u, v, last) #Weave() #Convert to 10-bit and output Dither_quantize(10,reducerange=true) Dither_out()
-
I thought you were already successful with the command-line?
Code:avs2pipemod -y4mp "script.avs" | x264-10bit - --demuxer y4m -o "output.264"
Code:avs2pipemod -rawvideo "script.avs" | x264 - --input-csp i422 --input-depth 10 --input-res 720x480 -o "output.264"
-
yes i was success in running this one but the result was green. with my above script
Code:avs2pipemod -y4mp "C:\new\output.avs" | x264-10bit - --demuxer y4m -o "output.264"
Code:avs2pipemod -rawvideo "C:\new\output.avs" | x264-10bit - --input-csp i422 --input-depth 10 --input-res 720x480 -o "output.264"
-
Code:
avs2pipemod -rawvideo "script.avs" | x264 - --input-csp i422 --input-depth 10 --input-res 720x480 --output-csp i422 -o "output.264"
https://pastebin.com/5C1M7SeB -
great this one works perfect, thanks again sneaker
Code:avs2pipemod -rawvideo "C:\new\output.avs" | x264-10bit - --input-csp i422 --input-depth 10 --input-res 720x480 --output-csp i422 -o "output.264"
-
--sar for aspect ratio, e.g. "--sar 40:33" for NTSC DVD with 16:9 display aspect ratio.
[Attachment 41804 - Click to enlarge]
--crf to control quality/bitrate, --bitrate if you need a specific bitrate (ideally with 2 passes). I recommend --crf, e.g. "--crf 18". -
great , sneaker u r very good on it , thanks lot mate now all good to start with Dither_out . happy dayz
avs2pipemod -rawvideo "C:\new\output.avs" | x264-10bit - --sar 10:11 --crf 18 --input-csp i422 --input-depth 10 --input-res 720x480 --fps 23.976 --output-csp i422 -o "output.264" -
and sorry could u please write me this command with 2pass with bitrate around 3000s to 4000kbps just to see test output of 2 pass. thank you
Code:avs2pipemod -rawvideo "C:\new\output.avs" | x264-10bit - --sar 10:11 --crf 18 --input-csp i422 --input-depth 10 --input-res 720x480 --fps 23.976 --output-csp i422 -o "output.264"
Last edited by BÌG•bµdd; 3rd Jun 2017 at 16:08. Reason: mistyped some words
Similar Threads
-
How to play 10bit videos and be sure to get true 10bit color on the screen?
By flashandpan007 in forum Software PlayingReplies: 6Last Post: 7th Apr 2017, 18:02 -
x264 10bit timecode error
By knightplex in forum Video ConversionReplies: 1Last Post: 9th Nov 2016, 12:57 -
FFMPEG x265 10bit and virtualdub x265 10bit settings
By lilycarolyn in forum Video ConversionReplies: 11Last Post: 6th Jun 2016, 13:44 -
DVD to x264 10bit help
By Mildragon in forum Video ConversionReplies: 7Last Post: 12th Dec 2015, 02:30 -
How do I convert 1080p 10bit mkv's to 720p 10bit?
By fighuass in forum Video ConversionReplies: 6Last Post: 19th Nov 2015, 01:34