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.

Hybrid converted video loses 5 seconds compared to original..?
#1
    I am deinterlacing a NTSC 720x480 DV AVI 29.97fps video with its 4:3 appropriate aspect ratio PAR into a 640x480 square pixel Bob 59.94fps .MKV.  Later I intend to upscale in Topaz Starlight Mini.

It seems to have done an OK job visually, but the resulting video is 5 seconds shorter than the original. 
The 5 seconds seems to have been cut from the first 20 seconds of the video (not a gradual loss of time). The 1st 20 seconds of the original video is a kind of lead in black video. The scene first fades in at 0:21 in the original, but in the converted video, it fades in at 0:16. So obviously the 5 sceonds is somehow cut from the first part of the AVI video. 

The original has no audio track, nor subtitle track. I've tried a few options in Hybrid. The Config > Input > Ffmpeg vsync handling: passthrough, cfr, vfr, those 3 produce a video which is 13:56 seconds long when it should be 14:01.  I also tried 'drop' which didn't work.

Any ideas how to fix this 5 second drop ?

I am using Hybrid latest version, just downloaded it yesterday.
2025.27.07.1


Attached Files Thumbnail(s)
           
Reply
#2
To be frank, I would have expected a loss of 12 seconds and 14ms not 5ms, since the short Mediainfo output (detailed output is preferable), states that the Time Code of the first frame is at "00;00;12;14" and I assume that translates to 12 seconds and 14ms.
So Hybrid will probably ignore it. (doesn't make any sense to add a delay to a video only stream)
My guess is that the delay is shortened by the source filter that is used which tries to be clever,... Angel
Since you did not read the sticky and share proper details, I can't really say what Hybrid is doing.
Maybe using another source filter i.e. Avisource in case you have a 64bit vfw decoder installed for your input on your system, which change things.

Since I think that extending a video only stream by using a delay makes no sense, I will not write any code to tackle this.
If you really want a longer stream you could write custom code to add additional frames, before the current start frame after deinterlacing and let Hybrid know that you changed the length,...

Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
#3
Sorry about the log,  I now have learned how to create one (attached).

I turned Avisynth on,  same 13:56 result.  (image attached)


Info:

Input: NTSC DV AVI 720×480, 29.97i, BFF, no audio.

Base: no trims; start=00:00:00.000, end full length.
Config → Input:
Ignore delay from input: OFF
Fix positive/negative delays: OFF (both)
FFmpeg vsync handling: drop (also tested: cfr/passthrough/vfr/ → same 13:56 result, drop didn't work either)
Filtering → Vapoursynth → Misc → Source:
Prefer LWLibAVSource over FFmpegSource2: ON (or, if testing AVS: “Always use Avisynth” + AviSource)
(De-)Interlace/Telecine (VS):
Input scan type (detected): bottom field first
Auto deinterlace handling: QTGMC (Vapoursynth)
QTGMC: Bob ON, Preset Slower, Source matching 2xrefined, EZKeepGrain 1.00
Crop/Resize: Resize 640×480, PAR → Square Pixel (1:1).
Video encoder/container: FFV1 lossless → MKV.
Observed: Output 13:56; original 14:01. Fade-in @ 0:21 source, 0:16 output.


Attached Files Thumbnail(s)
   

.zip   HybridDebugOutput.zip (Size: 169,02 KB / Downloads: 7)
Reply
#4
The Vapoursynth script used:
# Imports
import vapoursynth as vs
# getting Vapoursynth core
import ctypes
import sys
import os
core = vs.core
# Import scripts folder
scriptPath = 'C:/Program Files/Hybrid/64bit/vsscripts'
sys.path.insert(0, os.path.abspath(scriptPath))
# Loading Support Files
Dllref = ctypes.windll.LoadLibrary("C:/Program Files/Hybrid/64bit/vsfilters/Support/libfftw3f-3.dll")
# loading plugins
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DenoiseFilter/ZSmooth/zsmooth.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DenoiseFilter/KNLMeansCL/vsnlm_cuda.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/GrainFilter/AddGrain/AddGrain.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DenoiseFilter/NEO_FFT3DFilter/neo-fft3d.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DenoiseFilter/DFTTest/DFTTest.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/Support/EEDI3m.dll")# vsQTGMC
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/ResizeFilter/nnedi3/vsznedi3.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/Support/libmvtools.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/Support/fmtconv.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DeinterlaceFilter/Bwdif/Bwdif.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/Support/akarin.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/LSMASHSource.dll")
# Import scripts
import qtgmc
import validate
# Source: 'C:\Users\Topaz\Documents\Genesis 2021\Genesis Ep 05.avi'
# Current color space: YUV411P8, bit depth: 8, resolution: 720x480, frame rate: 29.97fps, scanorder: bottom field first, yuv luminance scale: limited, matrix: 470bg, format: DV
# Loading C:\Users\Topaz\Documents\Genesis 2021\Genesis Ep 05.avi using LWLibavSource
clip = core.lsmas.LWLibavSource(source="C:/Users/Topaz/Documents/Genesis 2021/Genesis Ep 05.avi", format="YUV411P8", stream_index=0, cache=0, prefer_hw=0)
frame = clip.get_frame(0)
# setting color matrix to 470bg.
clip = core.std.SetFrameProps(clip, _Matrix=vs.MATRIX_BT470_BG)
# setting color transfer (vs.TRANSFER_BT601), if it is not set.
if validate.transferIsInvalid(clip):
  clip = core.std.SetFrameProps(clip=clip, _Transfer=vs.TRANSFER_BT601)
# setting color primaries info (to vs.PRIMARIES_BT470_BG), if it is not set.
if validate.primariesIsInvalid(clip):
  clip = core.std.SetFrameProps(clip=clip, _Primaries=vs.PRIMARIES_BT470_BG)
# setting color range to TV (limited) range.
clip = core.std.SetFrameProps(clip=clip, _ColorRange=vs.RANGE_LIMITED)
# making sure frame rate is set to 29.97fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
# making sure the detected scan type is set (detected: bottom field first)
clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_BOTTOM) # bff
# adjusting color space from YUV411P8 to YUV444P16 for vsQTGMC
clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P16, range_s="limited")
# Deinterlacing using QTGMC
clip = qtgmc.QTGMC(Input=clip, Preset="Slower", InputType=0, TFF=False, TR2=1, SourceMatch=3, Lossless=2, EZKeepGrain=1.00, NoisePreset="Slow", MatchPreset="Slow", MatchPreset2="Slow", Denoiser="KNLMeansCL") # new fps: 59.94
# Making sure content is preceived as frame based
clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # progressive
# Resizing using 10 - bicubic spline
clip = core.fmtc.resample(clip=clip, kernel="spline16", w=640, h=480, interlaced=False, interlacedd=False) # resolution 640x480 before YUV444P16 after YUV444P16
# adjusting output color from: YUV444P16 to YUV422P8 for FFV1Model
clip = core.resize.Bicubic(clip=clip, format=vs.YUV422P8, range_s="limited", dither_type="error_diffusion")
# set output frame rate to 59.94fps (progressive)
clip = core.std.AssumeFPS(clip=clip, fpsnum=60000, fpsden=1001)
# output
clip.set_output()
AviSource can't be used since there is no 64bit vfw handler for VIDC.dvsd on your system, only:
vidc.i420
  vidc.iyuv
  vidc.mrle
  vidc.msvc
  vidc.uyvy
  vidc.yuy2
  vidc.yvu9
  vidc.yvyu

=> Aside from manually adding frames in a custom section there is nothing you can do about this.
Hybrid does not, and will not support adding delays though time codes, especially not on video only files, where delay makes no sense.
Can't say whether any other tool supports such delays.

=> Hybrid is probably not the right tool for you / your files.

Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)