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.

Method to adjust color temperature?
#11
Hi Selur,

I installed the dev version you sent me, but it appears interlace handling is broken. I tried importing interlaced FFV1 and v210 at 30fps interlaced and they both output 15fps files (which playback at half speed). I tried x265 and SVT-HVEC with interlace enabled and auto-deinterlace handling set to off. Audio is set to ignore. All other settings default (except quality quantization strength).

Log file can be found here (can't attach it for some reason): https://drive.google.com/file/d/1P8JqFBf...sp=sharing

I also found that if I export as MP4 instead of MKV, there is no interlace flag set. It comes out as progressive 30fps.

Change Temperature seems to work OK though & it's fast! Thanks for figuring out a way to implement it!

Let me know if you need any more information.

Thanks!
Reply
#12
About the fps:
# Imports
import vapoursynth as vs
# getting Vapoursynth core
core = vs.core
# Loading Plugins
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
# source: 'K:\RAW\XXXXXXXXXXXX.mov'
# current color space: YUV422P10, bit depth: 10, resolution: 1920x1080, fps: 30, color matrix: 709, yuv luminance scale: limited, scanorder: top field first
# Loading K:\RAW\XXXXXXXXXXXX.mov using LibavSMASHSource
clip = core.lsmas.LibavSMASHSource(source="K:/RAW/XXXXXXXXXXXX.mov")
# Setting detected color matrix (709).
clip = core.std.SetFrameProps(clip, _Matrix=1)
# Setting color transfer info (709), when it is not set
clip = clip if not core.text.FrameProps(clip,'_Transfer') else core.std.SetFrameProps(clip, _Transfer=1)
# Setting color primaries info (BT.709), when it is not set
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 30
clip = core.std.AssumeFPS(clip=clip, fpsnum=30, fpsden=1)
clip = core.std.SetFrameProp(clip=clip, prop="_FieldBased", intval=2) # tff
# cutting from frame 0 to 1297  - WARNING: This might cause synch issues
clip = core.std.Trim(clip=clip, first=0, last=1297)
# adjusting output color from: YUV422P10 to YUV420P10 for SvtHevcModel
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, range_s="limited")
# set output frame rate to 30fps (top field first)
clip = core.std.AssumeFPS(clip=clip, fpsnum=30, fpsden=1)
# Output
clip.set_output()
looks fine, issue is probably with the interlacing and the muxing call:
"C:\Program Files\Hybrid\64bit\mkvmerge.exe" --ui-language en -o "C:\VIDEO\2023-11-23@02_54_20_6510__04.mkv" --global-tags "C:\VIDEO\mkvtags_2023-11-23@02_54_20_6510__04.xml" -d 0 --default-track 0:yes --track-name 0:"2023-07-15 21:41:37 UTC" --language 0:en --default-duration "0:30/1i" --aspect-ratio-factor 0:1/1 --no-chapters --compression -1:none --forced-track 0:yes --field-order 0:1 --no-audio --no-subtitles "C:\VIDEO\asdf_1_2023-11-23@02_54_20_6510_02.265" --track-order 0:1
instead of
--default-duration "0:30/1i"
one probably has to use "0:60/1i" (this seems to change every few years, I remember having to switch between these values before,...)
As a workaround, enable "Filtering->Speed Change->Change speed" and set it to "60fps" (= 2x input frame rate).

Regarding mp4 and interlacing: Does it work if you use FFmpeg as muxer (Config->Containers->MP4->FFmpeg instead of MP4Box)?

Cu Selur

Ps.: Attaching attachments should work fine if you zip them. Smile
Reply
#13
The problem is not with the muxing, it's with svt hevc in Hybrid.
Hybrid does not set '-interlaced-video'.
-> working on it.
Reply
#14
Okay, fixing svt-hevc interlaced encoding is problematic, since mediainfo still reports the output of the encoder video not as interlaced.
vspipe "G:\Output\encodingTempSynthSkript_2023-11-23@15_10_51_5910_0.vpy" - -c y4m  |  ffmpeg -y -loglevel fatal -noautorotate -nostdin -threads 8 -f yuv4mpegpipe -i - -an -sn -vf zscale=rangein=tv:range=tv -pix_fmt yuv420p10le -strict -1 -vsync 0 -top 1 -flags +ildct+ilme -f yuv4mpegpipe - | SvtHevcEncApp -q 18 -i stdin -fps-num 30000 -fps-denom 1001 -n 150 -profile 2  -interlaced-video 1 -b "G:\Output\ffmpeg_1_2023-11-23@15_10_51_5910_03.265"
is reported as:
Video
Count                                    : 381
Count of stream of this kind             : 1
Kind of stream                           : Video
Kind of stream                           : Video
Stream identifier                        : 0
Format                                   : HEVC
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format/Url                               : http://www.itu.int
Commercial name                          : HEVC
Format profile                           : Main 10@L3@Main
Internet media type                      : video/H265
Width                                    : 720
Width                                    : 720 pixels
Height                                   : 480
Height                                   : 480 pixels
Sampled_Width                            : 720
Sampled_Height                           : 480
Pixel aspect ratio                       : 1.000
Display aspect ratio                     : 1.500
Display aspect ratio                     : 3:2
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Chroma subsampling                       : 4:2:0
Bit depth                                : 10
Bit depth                                : 10 bits
which is why when muxed with MP4Box and FFmpeg the output is not flagged as interlaced.
Maybe I can find a workaround for FFmpeg.

Cu Selur
Reply
#15
Seems like svt-hevc does create not properly flagged hevc streams.
When using '-interlaced-video 1' does seem not properly flag the stream. (mkvmerge only adds a container flag which that signals interlacing.)
Additionally using '-separate-field 1', does only work with 8bit and even then it produces broken output.
=> not sure whether I'll look into it further or whether I should remove this broken interlaced support.

Cu Selur
Reply
#16
ffmpeg -y -loglevel fatal -noautorotate -nostdin -threads 8 -i "G:\TestClips&Co\files\interlaceAndTelecineSamples\interlaced\bff.m2v" -map 0:0 -an -sn -vf zscale=rangein=tv:range=tv -pix_fmt yuv420p10le -strict -1 -vsync 0 -top 1 -flags +ildct+ilme -f yuv4mpegpipe - | x265 --input - --output-depth 10 --y4m --profile main10 --limit-modes --no-early-skip --no-open-gop --opt-ref-list-length-pps --crf 18.00 --opt-qp-pps --cbqpoffs -2 --crqpoffs -2 --limit-refs 0 --ssim-rd --psy-rd 2.50 --rdoq-level 2 --psy-rdoq 10.00 --aq-mode 0 --deblock=-1:-1 --limit-sao --no-repeat-headers --interlace bff --range limited --colormatrix bt470bg --sar 8:9 --output "G:\Output\2023-11-23@15_58_44_6310_01.265"
also isn't detected as interlaced by mediainfo.
ffmpeg reports:
Stream #0:0: Video: hevc (Main 10), yuv420p10le(tv, bt470bg/unknown/unknown, top first), 720x480 [SAR 8:9 DAR 4:3], 25 fps, 29.97 tbr, 1200k tbn
but the encoding options is '--interlace bff '.

Okay, this will take a while.
Reply
#17
I did some testing and
  • fixed some problems with hevc interlaced muxing (when muxing to .mkv the frame rate should be okay now)
  • added a warning to the log, that the flagging will not be correct when using an .mp4 conainer.
  • disabled interlaced hevc muxing to .avi/.mov/.ts/.m2ts
send you a link to a dev version for testing.

Cu Selur

Ps.: I'm happy that av1 does not support interlacing, and I would advise against using hevc with interlaced encoding.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)