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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 16th June 2017, 17:58   #1  |  Link
danfgtn
Registered User
 
Join Date: Dec 2016
Posts: 4
avisynth 10 bit conversion?

How to convert 10 bit inside avisynth and extract it so that it works?

This is my script, but I'm not sure what's wrong, that my videos come out like this.

https://i.imgur.com/rWAoCbg.png

My script

Code:
SetMemoryMax(1024)
SetMTMode(mode=3,threads=4)

FFVideoSource("C:\RMZ\RAW\avatar.mkv", threads=1, enable10bithack=false, colorspace="YV12")

SetMTMode(mode=2,threads=4)

Trim(18000, 20000)

TFM(order=-1, field=-1,mode=0,cthresh=8)
TDecimate(mode=1, cycleR=1, cycle=25, rate=24.000, hybrid=0)
AssumeFPS(24)
QTGMC(Preset="Medium", Sharpness=0, InputType=3, SourceMatch=3, FPSDivisor=1, ShowSettings=False, TR0=0, TR1=1, TR2=1, Rep0=0, Rep1=0, Rep2=0, RepChroma=false)

Dither_convert_8_to_16()
dfttest(Y=true, U=false, V=false, ftype=1, sigma=2, sigma2=2, lsb_in=true, lsb=true)
f3kdb(range=30, grainY=64, grainC=64, sample_mode=1, opt=-1, mt=true, input_depth=16, output_depth=16)
#DitherPost(mode=6) #Uncomment this filter to preview.
Dither_quantize(10, reducerange=true, mode=6) #Comment out this filter to preview.
Dither_Out() #Comment out this filter to preview.
danfgtn is offline   Reply With Quote
Old 27th June 2017, 23:33   #2  |  Link
FranceBB
FranceBB
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Germany
Posts: 198
First of all, Dither tool is a hack, 'cause 16bit is not officially supported by Avisynth.
Anyway, it works and I've been using it for a while.
You can use f3kdb to dither down to 10bit output, so Dither_quantize and Dither_Out are not needed.
Also, try to avoid using MT Mode, 'cause afaik it doesn't work reliably with Dither Tool.

Code:
FFVideoSource("C:\RMZ\RAW\avatar.mkv")

Trim(18000, 20000)

TFM(order=-1, field=-1,mode=0,cthresh=8)
TDecimate(mode=1, cycleR=1, cycle=25, rate=24.000, hybrid=0)
AssumeFPS(24)
QTGMC(Preset="Medium", Sharpness=0, InputType=3, SourceMatch=3, FPSDivisor=1, ShowSettings=False, TR0=0, TR1=1, TR2=1, Rep0=0, Rep1=0, Rep2=0, RepChroma=false)

Dither_convert_8_to_16()

dfttest(sigma=64, tbsize=1, lsb_in=true, lsb=true, Y=true, U=true, V=true, opt=3, dither=0)

f3kdb(range=15, Y=80, Cb=60, Cr=60, grainY=0, grainC=0, keep_tv_range=True, input_depth=16, output_depth=10)

There's another way to use 16bit in avisynth, which is using HDRCore (16bit interleave), while Dither Tool uses 16bit stack.
HDR Core is slightly faster but less supported.
Also please note that if you are using AVS Studio or VirtualDub for preview, you can't view 10/12/16bit footages, but you gotta encode them first.
In order to view if everything is working fine, just use output_depth=8 in f3kdb, check it in VirtualDub, then, if everything is working fine, change it back to 10 and encode with your favorite encoder (x264, x265 etc).
By the way, may I ask you what are you trying to achieve with TFM, Tdecimate, AssumeFPS and QTGMC? Is your source interlaced? Telecined? Both?

Last edited by FranceBB; 27th June 2017 at 23:37.
FranceBB is offline   Reply With Quote
Old 28th June 2017, 03:02   #3  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 890
Use AviSynth+ (r2506 is the latest, but this stuff has been around since last August/September), and after telling f3kdb to use output_depth=10 (and output_mode=2),
Code:
ConvertFromDoubleWidth(10)
Also requires that the receiving application has been updated to understand AviSynth+ giving it high bit depth pixel formats. FFmpeg, for example.
qyot27 is offline   Reply With Quote
Reply

Tags
10bit, avisynth

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 17:34.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.