Selur
30th June 2018, 22:33
I got an image:
and use this script:
# Imports
import os
import sys
import vapoursynth as vs
core = vs.get_core()
# Import scripts folder
scriptPath = 'G:/Hybrid/64bit/vsscripts'
sys.path.append(os.path.abspath(scriptPath))
# Loading Plugins
core.std.LoadPlugin(path="G:/Hybrid/64bit/vsfilters/SourceFilter/Imagemagick/libimwri.dll")
core.std.LoadPlugin(path="G:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
# Import scripts
import finesharp
# Loading C:\Users\Selur\Desktop\Test\Image sequence test.png using vsImageReader
clip = core.imwri.Read(["C:/Users/Selur/Desktop/Test/Image sequence test.png"])
clip = core.std.Loop(clip=clip, times=100)
# Input color space is assumed to be RGB24.
# making sure frame rate is set to 25/1
clip = core.std.AssumeFPS(clip, fpsnum=25, fpsden=1)
# Making sure input color range is set to PC (full) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=0)
# Input resolution is 1280x720.
# adjusting color space from RGB24 to YUV444P16 for FineSharp
clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P16, matrix_s="709")
# sharpening using FineSharp
clip = finesharp.sharpen(clip=clip)
# adjusting output color from: YUV444P16 to YUV420P8 for x264Model (i420)
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8)
which then encode with x264 using:
vspipe "H:\Temp\encodingTempSynthSkript_23_21_51_4410.vpy" - --y4m | x264 --crf 18.00 --profile high --level 4.1 --direct auto --sync-lookahead 27 --qcomp 0.5 --no-mbtree --partitions i4x4,p8x8,b8x8 --no-fast-pskip --subme 5 --trellis 0 --weightp 1 --aq-mode 0 --vbv-maxrate 62500 --vbv-bufsize 78125 --sar 1:1 --non-deterministic --range pc --colormatrix bt709 --demuxer y4m --input-csp yuvj420p --input-range pc --fps 25/1 --output-depth 8 --output "H:\Temp\23_21_51_4410_02.264" -
Problem is the contrast changed,
I also extended the script to compare it against the image sequence to confirm the problem.
-> seems like I'm doing something wrong, but I don't see where I go wrong.
When I just use:
# Imports
import vapoursynth as vs
core = vs.get_core()
# Loading Plugins
core.std.LoadPlugin(path="G:/Hybrid/64bit/vsfilters/SourceFilter/Imagemagick/libimwri.dll")
# Loading C:\Users\Selur\Desktop\Test\Image sequence test.png using vsImageReader
clip = core.imwri.Read(["C:/Users/Selur/Desktop/Test/Image sequence test.png"])
clip = core.std.Loop(clip=clip, times=100)
# Input color space is assumed to be RGB24.
# making sure frame rate is set to 25/1
clip = core.std.AssumeFPS(clip, fpsnum=25, fpsden=1)
# Making sure input color range is set to PC (full) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=0)
# Input resolution is 1280x720.
# adjusting output color from: RGB24 to YUV420P8 for x264Model (i420)
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, matrix_s="709")
# Output
clip.set_output()
So no finesharp and no RGB24 -> YUV4416 conversion, a similar problem occurs, but the contrast change isn't that prominent.
Does anyone see the problem/mistake?
Thanks!
Cu Selur
Ps.: uploaded the files I created and the source image to: https://drive.google.com/open?id=1mzyfc-ZjXsD77DtY7P7-1-XBTcCa0FVS
(using '--input-csp yuv420p' instead of '--input-csp yuvj420p' doesn't help either)
and use this script:
# Imports
import os
import sys
import vapoursynth as vs
core = vs.get_core()
# Import scripts folder
scriptPath = 'G:/Hybrid/64bit/vsscripts'
sys.path.append(os.path.abspath(scriptPath))
# Loading Plugins
core.std.LoadPlugin(path="G:/Hybrid/64bit/vsfilters/SourceFilter/Imagemagick/libimwri.dll")
core.std.LoadPlugin(path="G:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
# Import scripts
import finesharp
# Loading C:\Users\Selur\Desktop\Test\Image sequence test.png using vsImageReader
clip = core.imwri.Read(["C:/Users/Selur/Desktop/Test/Image sequence test.png"])
clip = core.std.Loop(clip=clip, times=100)
# Input color space is assumed to be RGB24.
# making sure frame rate is set to 25/1
clip = core.std.AssumeFPS(clip, fpsnum=25, fpsden=1)
# Making sure input color range is set to PC (full) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=0)
# Input resolution is 1280x720.
# adjusting color space from RGB24 to YUV444P16 for FineSharp
clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P16, matrix_s="709")
# sharpening using FineSharp
clip = finesharp.sharpen(clip=clip)
# adjusting output color from: YUV444P16 to YUV420P8 for x264Model (i420)
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8)
which then encode with x264 using:
vspipe "H:\Temp\encodingTempSynthSkript_23_21_51_4410.vpy" - --y4m | x264 --crf 18.00 --profile high --level 4.1 --direct auto --sync-lookahead 27 --qcomp 0.5 --no-mbtree --partitions i4x4,p8x8,b8x8 --no-fast-pskip --subme 5 --trellis 0 --weightp 1 --aq-mode 0 --vbv-maxrate 62500 --vbv-bufsize 78125 --sar 1:1 --non-deterministic --range pc --colormatrix bt709 --demuxer y4m --input-csp yuvj420p --input-range pc --fps 25/1 --output-depth 8 --output "H:\Temp\23_21_51_4410_02.264" -
Problem is the contrast changed,
I also extended the script to compare it against the image sequence to confirm the problem.
-> seems like I'm doing something wrong, but I don't see where I go wrong.
When I just use:
# Imports
import vapoursynth as vs
core = vs.get_core()
# Loading Plugins
core.std.LoadPlugin(path="G:/Hybrid/64bit/vsfilters/SourceFilter/Imagemagick/libimwri.dll")
# Loading C:\Users\Selur\Desktop\Test\Image sequence test.png using vsImageReader
clip = core.imwri.Read(["C:/Users/Selur/Desktop/Test/Image sequence test.png"])
clip = core.std.Loop(clip=clip, times=100)
# Input color space is assumed to be RGB24.
# making sure frame rate is set to 25/1
clip = core.std.AssumeFPS(clip, fpsnum=25, fpsden=1)
# Making sure input color range is set to PC (full) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=0)
# Input resolution is 1280x720.
# adjusting output color from: RGB24 to YUV420P8 for x264Model (i420)
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, matrix_s="709")
# Output
clip.set_output()
So no finesharp and no RGB24 -> YUV4416 conversion, a similar problem occurs, but the contrast change isn't that prominent.
Does anyone see the problem/mistake?
Thanks!
Cu Selur
Ps.: uploaded the files I created and the source image to: https://drive.google.com/open?id=1mzyfc-ZjXsD77DtY7P7-1-XBTcCa0FVS
(using '--input-csp yuv420p' instead of '--input-csp yuvj420p' doesn't help either)