Aegwyn11
4th May 2013, 04:03
I need to upconvert some 4:2:0 8-bit clips to 4:2:2 10-bit and want to do it with maximum fidelity.
I came up with a way using Dither tools, but for the 4:2:0 to 4:2:2 conversion, I'm not sure if this method is better due to the RGB conversion. Is this better, or would it be better to just do a straight ConvertToYV16 and avoid the RGB conversions?
FFVideoSource(input.mkv,fpsnum=60000,fpsden=1001)
#Convert to Stack16 for processing
Dither_convert_8_to_16()
#Convert to 4:2:2 10-bit
Dither_convert_yuv_to_rgb(matrix="709", output="rgb48y", lsb_in=true, interlaced=false)
ConvertToYV16()
r = SelectEvery (3, 0)
g = SelectEvery (3, 1)
b = SelectEvery (3, 2)
Dither_convert_rgb_to_yuv(r, g, b, matrix="709", lsb=true, mode=0, output="YV16", interlaced=false)
Dither_quantize(10,reducerange=true)
#Output
Dither_out()
#Example command to save as v210 MOV for BM Shuttle playback
#avs2yuv -raw -csp I422 output.avs - | ffmpeg -y -f rawvideo -pix_fmt yuv422p10le -s widthxheight -r framerate -i - -c:v v210 output.mov
I came up with a way using Dither tools, but for the 4:2:0 to 4:2:2 conversion, I'm not sure if this method is better due to the RGB conversion. Is this better, or would it be better to just do a straight ConvertToYV16 and avoid the RGB conversions?
FFVideoSource(input.mkv,fpsnum=60000,fpsden=1001)
#Convert to Stack16 for processing
Dither_convert_8_to_16()
#Convert to 4:2:2 10-bit
Dither_convert_yuv_to_rgb(matrix="709", output="rgb48y", lsb_in=true, interlaced=false)
ConvertToYV16()
r = SelectEvery (3, 0)
g = SelectEvery (3, 1)
b = SelectEvery (3, 2)
Dither_convert_rgb_to_yuv(r, g, b, matrix="709", lsb=true, mode=0, output="YV16", interlaced=false)
Dither_quantize(10,reducerange=true)
#Output
Dither_out()
#Example command to save as v210 MOV for BM Shuttle playback
#avs2yuv -raw -csp I422 output.avs - | ffmpeg -y -f rawvideo -pix_fmt yuv422p10le -s widthxheight -r framerate -i - -c:v v210 output.mov