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.
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)
=> 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')
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
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
I really appreciate the detailed response, thanks to you I've been able to figure it all out! Upon viewing the Vapoursynth Preview I noticed the total frame count was 4 frames shorter than what VirtualDub/Premiere reports, and after running my source through ffprobe I discovered it had four duplicate frames, each one of them within the range I was testing the encode on :| . After accounting for the removal of those in my audio stream everything works as expected.
=> no clue, how those relate to each other, but the code itself seems correct.
Apologies for the confusion, this job at line 46236 was a separate one used to verify that the error was not isolated to just the 534-2911 portion of the source.
Quote:Looking at the Vapoursynth script (line 73432+):
It does not include any cuts.
This was just me forgetting to input the cut frames, whoops.
It appears that for some reason there was a 167ms offset in the source that carried over to the transcode. Getting rid of it fixed this particular issue.
Quote:since selecting != applying and to be sure there is no confusion the selection state is not saved.
Ohhh, got it, guess I should've looked closer at that help panel haha.
Quote:
Quote: Wrote:Override PAR to 8x9 (also doesn't save)
Yes, that is a source specific setting, so it doesn't make sense to save this.
Isn't the purpose of the "Overwrite Input PAR" in the Misc tab to nullify whatever the source says the PAR should be in the Base tab and replace it with whatever value is there? Or am I just misinterpreting its function?
Quote: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.
Oh interesting, I had assumed it would treat the external audio the same as the temp wav that's created from the source when cutting or transcoding, good to know! Though in that case what's the point of the "Don't cut external audio" option in the Misc audio settings if Hybrid can't cut it?
Also sorry to go off on a bit of a tangent to the original question, but for each of the other previews on Base, Crop/Resize, Audio, and Chapter I get an error message saying:
Quote:Aborting, since playback is not audio only, but according to mplayer, there is no video present!
I tried troubleshooting it using this thread and testing mplayer itself, but unless I'm mistaken (which is certainly quite likely) it seems that mplayer does in fact recognize that there's a video stream present.
Microsoft Windows [Version 10.0.26200.7462]
(c) Microsoft Corporation. All rights reserved.
C:\Users\dusti>"C:\Program Files\Hybrid\mplayer.exe" -v -msglevel identify=6 -demuxer mkv -vo null -ao null -frames 0 "A:\Users\dusti\Videos\8mm Tapes\RAW\2025-12-20_MtVernon_avsync2.mkv"
'"C:\Program Files\Hybrid\mplayer.exe"' is not recognized as an internal or external command,
operable program or batch file.
Is there an additional codec I need to install for this or something? This technically isn't necessary for my current workflow but I suppose it'd be nice to have working. Let me know if you need another debug file for that.
Quote:Oh interesting, I had assumed it would treat the external audio the same as the temp wav that's created from the source when cutting or transcoding, good to know! Though in that case what's the point of the "Don't cut external audio" option in the Misc audio settings if Hybrid can't cut it?
Just checked, worked fine here. (totally I forgot I rewrote that)
My guess is you added the audio stream to the audio queue before setting the cut.
When I load the video, set the cut, add the audio, everything seems to work fine here.
Quote: but unless I'm mistaken (which is certainly quite likely) it seems that mplayer does in fact recognize that there's a video stream present.
Yes, it assumes there is a video stream, MPlayer can't handle the video:
Cannot find codec matching selected -vo and video format 0x544D5948.
Video: no video
Problem developement on mplayer stopped a few years ago.
Since those Previews use MPlayer they don't work.
Quote:Isn't the purpose of the "Overwrite Input PAR" in the Misc tab to nullify whatever the source says the PAR should be in the Base tab and replace it with whatever value is there? Or am I just misinterpreting its function?
Your are correct, totally forgot I rewrote that.
=> fixed it by renaming the parameter names and the connections, uploaded a new dev
Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.