Cut is off by a few frames, and audio gets offset - dkpanda - 23.12.2025
Hybrid Windows rev 2025.11.09.1
Whenever I attempt to transcode a range of video using frame selection it always includes a few extra frames at the tail end of the source, while also seemingly temporally compressing it so that over the course of the video once an equivalent amount of frames in the source and transcode have played they become out of sync. The frame ranges themselves have been selected quite precisely and verified in both VirtualDub and Premiere Pro, so I'm certain I'm inputting the correct in and out points. No speed change settings are enabled to my knowledge.
Additionally, upon transcoding said videos the audio becomes out of sync, starting around five frames too late.
Step-by-step:
- Open Hybrid
- Load file (for reference it's encoded in HUFFYUV, 720x480 29.97fps w/PCM audio)
- Set x265 preset to veryslow (not sure why this doesn't save w/profiles)
- Override PAR to 8x9 (also doesn't save)
- Add current audio stream
- Input start & end frames 534-2911
- Set output path
- Add to queue & start
I tried to cut a shorter source clip via MKVToolNix as a sample but somehow the transcode of that resulted in a video track that was double the length of the specified range, but let me know if you'd like the original file as a sample and I can PM it. In the meantime I've attached an image detailing the issue.
As a secondary issue that may or may not be related, Hybrid refuses to cut audio that is added from an external file (required as I had to resync some parts), where the job went straight to the "create" step without first "extracting audio as pcm/wav using ffmpeg" as it would with audio attached to the video file. This resulted in me having to mux the source clip and the resynced audio in MKVToolNix and then putting that new file into Hybrid, which allowed it to be cut (though the aforementioned offset issue remains in the Hybrid transcode)
RE: Cut is off by a few frames, and audio gets offset - Selur - 23.12.2025
Looking at the Vapoursynth script (line 46236+):
# 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/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/libllvmexpr.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DenoiseFilter/ZSmooth/zsmooth.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/LSMASHSource.dll")
# Import scripts
import qtgmc
import validate
# Source: 'A:\Users\dusti\Videos\8mm Tapes\RAW\2025-12-20_MtVernon01.avi'
# Current color space: YUV422P8, bit depth: 8, resolution: 720x480, frame rate: 29.97fps, scanorder: bottom field first, yuv luminance scale: limited, matrix: 470bg, format: hymt
# Loading A:\Users\dusti\Videos\8mm Tapes\RAW\2025-12-20_MtVernon01.avi using LWLibavSource
clip = core.lsmas.LWLibavSource(source="A:/Users/dusti/Videos/8mm Tapes/RAW/2025-12-20_MtVernon01.avi", format="YUV422P8", 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
# cutting from frame 3746 to 19987 - WARNING: This might cause synch issues
clip = core.std.Trim(clip=clip, first=3746, last=19987)
# Deinterlacing using QTGMC
clip = qtgmc.QTGMC(clip, Preset="Fast", TFF=False)# new fps: 29.97
# Making sure content is preceived as frame based
clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # progressive
clip = clip[::2] # selecting previously even frames
# adjusting output color from: YUV422P8 to YUV420P10 for x265Model
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10)
# set output frame rate to 29.97fps (progressive)
clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
# output
clip.set_output()
The cut is:
clip = core.std.Trim(clip=clip, first=3746, last=19987)
that is nowhere near:
Quote:Input start & end frames 534-2911
=> no clue, how those relate to each other, but the code itself seems correct.
Looking at the Vapoursynth script (line 73432+):
# 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/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/libllvmexpr.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DenoiseFilter/ZSmooth/zsmooth.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/LSMASHSource.dll")
# Import scripts
import qtgmc
import validate
# Source: 'A:\Users\dusti\Videos\8mm Tapes\RAW\2025-12-20_MtVernon01.avi'
# Current color space: YUV422P8, bit depth: 8, resolution: 720x480, frame rate: 29.97fps, scanorder: bottom field first, yuv luminance scale: limited, matrix: 470bg, format: hymt
# Loading A:\Users\dusti\Videos\8mm Tapes\RAW\2025-12-20_MtVernon01.avi using LWLibavSource
clip = core.lsmas.LWLibavSource(source="A:/Users/dusti/Videos/8mm Tapes/RAW/2025-12-20_MtVernon01.avi", format="YUV422P8", 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
# Deinterlacing using QTGMC
clip = qtgmc.QTGMC(clip, Preset="Fast", TFF=False)# new fps: 29.97
# Making sure content is preceived as frame based
clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # progressive
clip = clip[::2] # selecting previously even frames
# adjusting output color from: YUV422P8 to YUV420P10 for x265Model
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10)
# set output frame rate to 29.97fps (progressive)
clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
# output
clip.set_output()
It does not include any cuts.
Okay, in line 138958+:
# 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/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/libllvmexpr.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DenoiseFilter/ZSmooth/zsmooth.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/LSMASHSource.dll")
# Import scripts
import qtgmc
import validate
# Source: 'A:\Users\dusti\Videos\8mm Tapes\RAW\2025-12-20_MtVernon_avsync2.mkv'
# Current color space: YUV422P8, bit depth: 8, resolution: 720x480, frame rate: 29.97fps, scanorder: bottom field first, yuv luminance scale: limited, matrix: 470bg, format: hymt
# Loading A:\Users\dusti\Videos\8mm Tapes\RAW\2025-12-20_MtVernon_avsync2.mkv using LWLibavSource
clip = core.lsmas.LWLibavSource(source="A:/Users/dusti/Videos/8mm Tapes/RAW/2025-12-20_MtVernon_avsync2.mkv", format="YUV422P8", 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
# cutting from frame 534 to 2910 - WARNING: This might cause synch issues
clip = core.std.Trim(clip=clip, first=534, last=2910)
# Deinterlacing using QTGMC
clip = qtgmc.QTGMC(clip, Preset="Fast", TFF=False)# new fps: 29.97
# Making sure content is preceived as frame based
clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # progressive
clip = clip[::2] # selecting previously even frames
# adjusting output color from: YUV422P8 to YUV420P10 for x265Model
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10)
# set output frame rate to 29.97fps (progressive)
clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
# output
clip.set_output()
the cut you mentioned is used. first=534, last=2910
Depening on your needs you might want to adjust this by one frames. (no clue how the video cut could be off 'a few frames')
Looking at the audio processing for that job.
2025.12.21 - 22:29:04_Windows 11 Version 25H2 (64bit)_2025.11.09.1 - level 9: addSelection(6): A:\Users\dusti\Videos\8mm Tapes\RAW\2025-12-20_MtVernon01.avi
2025.12.21 - 22:29:04_Windows 11 Version 25H2 (64bit)_2025.11.09.1 - level 9: set selection,..
2025.12.21 - 22:29:04_Windows 11 Version 25H2 (64bit)_2025.11.09.1 - level 9: cutStartTime: 17.81781782
2025.12.21 - 22:29:04_Windows 11 Version 25H2 (64bit)_2025.11.09.1 - level 9: cutEndTime: 97.13046380
2025.12.21 - 22:29:04_Windows 11 Version 25H2 (64bit)_2025.11.09.1 - level 9: selectionStartTime: 0.00000000
2025.12.21 - 22:29:04_Windows 11 Version 25H2 (64bit)_2025.11.09.1 - level 9: selectionEndTime: 7440.70700000
2025.12.21 - 22:29:04_Windows 11 Version 25H2 (64bit)_2025.11.09.1 - level 9: getStartAndEnd(cutStartTime: 17.8178, cutEndTime: 97.1305, selectionStartTime: 0, selectionEndTime: 7440.71, ...)
2025.12.21 - 22:29:04_Windows 11 Version 25H2 (64bit)_2025.11.09.1 - level 9: startTime: 17.81781782
2025.12.21 - 22:29:04_Windows 11 Version 25H2 (64bit)_2025.11.09.1 - level 9: endTime: 97.13046380
2025.12.21 - 22:29:04_Windows 11 Version 25H2 (64bit)_2025.11.09.1 - level 9: -> startTime: 17.8178, endTime: 97.1305
2025.12.21 - 22:29:04_Windows 11 Version 25H2 (64bit)_2025.11.09.1 - level 9: matchesChapter: false
2025.12.21 - 22:29:04_Windows 11 Version 25H2 (64bit)_2025.11.09.1 - level 9: addSelection(8)
2025.12.21 - 22:29:04_Windows 11 Version 25H2 (64bit)_2025.11.09.1 - level 9: addStartEnd - start: 17.8178, end: 97.1305, length: 7440.58
2025.12.21 - 22:29:04_Windows 11 Version 25H2 (64bit)_2025.11.09.1 - level 9: inputLength: 7440.57900000
2025.12.21 - 22:29:04_Windows 11 Version 25H2 (64bit)_2025.11.09.1 - level 9: end: 97.13046380
ffmpeg -y -threads 8 -i "A:\Users\dusti\Videos\8mm Tapes\RAW\2025-12-20_MtVernon_avsync2.mkv" -map 0:1 -vn -sn -ss 00:00:17.817 -t 00:01:19.312 -ac 1 -ar 48000 -acodec pcm_s16le -f wav -map_metadata -1 -metadata encoding_tool="Hybrid 2025.11.09.1" "C:\Users\dusti\AppData\Local\Temp\iId_3_aid_0_DELAY_167ms_2025-12-22@14_22_58_1510_01.wav"
Other than that, the processing seems fine.
Sadly I see no problem in how Hybrid processed the source, the video cut should be accurate, not too sure about the audio cut, but I expect ffmpeg to cut accurate for wav audio.
Quote: (not sure why this doesn't save w/profiles)
since selecting != applying and to be sure there is no confusion the selection state is not saved.
Quote:Override PAR to 8x9 (also doesn't save)
Yes, that is a source specific setting, so it doesn't make sense to save this.
Quote:As a secondary issue that may or may not be related, Hybrid refuses to cut audio that is added from an external file (required as I had to resync some p
It's not that it refuses it, it simply doesn't support this or know how to do it. Hybrid assumes that the external audio source matches the video source it should create.
Quote: The frame ranges themselves have been selected quite precisely and verified in both VirtualDub and Premiere Pro, so I'm certain I'm inputting the correct in and out points. No speed change settings are enabled to my knowledge.
You should use Hybrid to select the start and end points.
My suggestions are:
a. try other source filters (i.e. AviSource) and see whether that changes anything
b. verify the cut in the Vapoursynth Preview. VirtualDub and Premiere Pro might use different frame numbering and selection.
Vapoursynth assumes the first frame to be 0 and if you select 0-xy the trim will be 0 to (xy -1).
Other than that, if you see a mistake in the call or script I overlooked let me know.
Cu Selur
|