| 
		
	
	
	
		
	Posts: 10Threads: 1
 Joined: Apr 2020
 
	
	
		Hi, 
I know this is a new feature that may have bugs, but I can't seem to make this work at all and don't see it mentioned here. The cut support option never cuts audio for me. I'm recording VHS tapes, which have a lot of stuff at the beginning and end that I want to remove, so I was hoping I could use the cut feature for this. Unfortunately what seems to happen every time I try to use cut, is that the audio file is the same audio file, but only the video is cut. 
 
That is the audio starts at the beginning of the input, regardless of where the video is. Is this a known bug? I'm using Huffyuv compressed video with PCM audio (if it matters).
 
I did try and search the forums, but I can't see this mentioned anywhere else.
 
Thanks for great software    
	
	
	
		
	Posts: 12.047Threads: 65
 Joined: May 2017
 
	
	
		Are you just cutting or are you also converting the audio to another format?Some details and a debug output level 9 of the job creation might help.
 Can't try to reproduce and fix the issue if I don't know that you are doing.
 
 Cu Selur
 
----Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
 
 
	
	
	
		
	Posts: 12.047Threads: 65
 Joined: May 2017
 
	
	
		I did a 'blind-test' trying to reproduce the issue without really knowing what you did,.. 
What I did:
 create a 60 seconds avi(huffyuv/pcm file) using ffmpeg.
Start Hybrid
enable 'Config->Cut Support'
load the 60secondsHuffHD.avi file into Hybrid
set 'x264->Base->General Settings->Encoding mode' to 'constatn rate factor (1-pass)' and applied 'x264->base->Restriction Settings->Preset->ultrafast'
set 'Base->Processing->Cut->start' to '00:00:10.000' and 'Base->Processing->Cut->end' to '00:00:50.000'
set 'Base->Processing->Audio' to 'custom'
enabled 'Audio->Base->Audio Encoding Options'
set 'Audio->Base->Audio Encoding Options'
pressed 'Audio->Base->Add current' (to add the audio settings to the audio queue)
set an output file (test.mp4 under Base->Output file)
pressed 'Base->Add to queue'
disabled 'Jobs->queue->Minimize job command line' to look at the calls.
 
First the audio extraction call:
 ffmpeg -y -threads 8 -i "E:\Test\60secondsHuffHD.avi" -map 0:1 -vn -sn -ss 00:00:10.000 -t 00:00:40.000 -ac 6 -ar 48000 -acodec pcm_s16le -f wav -map_metadata -1 -metadata encoding_tool="Hybrid 2020.04.04.1" "E:\Temp\iId_2_aid_0_DELAY_-53ms_07_53_04_9410_01.wav"
properly set the cut times. 
then the video encoding call:
 ffmpeg -y -loglevel fatal -noautorotate -nostdin -threads 8 -i "E:\test\60secondsHuffHD.avi" -map 0:0 -an -sn -ss 00:00:10.000 -t 00:00:40.000 -vf zscale=rangein=tv:range=tv -pix_fmt yuv420p -vsync 0  -f rawvideo - | x264 --preset ultrafast --crf 18.00 --profile high --level 4.1 --scenecut 0 --sync-lookahead 24 --vbv-maxrate 62500 --vbv-bufsize 78125 --sar 1:1 --non-deterministic --range tv --colormatrix bt709 --demuxer raw --input-res 1920x1080 --input-csp i420 --input-range tv --input-depth 8 --fps 24000/1001 --output-depth 8 --output "E:\Temp\07_53_04_9410_04.264" -
which also properly set the cut times.
 
-> Without detailed information what you are doing I can't reproduce the issue.
 
Cu Selur
	
----Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
 
 
	
	
	
		
	Posts: 10Threads: 1
 Joined: Apr 2020
 
	
	
		I have the settings stored as default. So I'm only:
 1. adding the video file
 2. Setting my crop (14 on all sides, then letter boxed)
 3. Adding audio to queue.
 4. Setting my cut
 5. setting output file.
 6. Clicking the "man at work" to start the job.
 
 
 >Are you just cutting or are you also converting the audio to another format?
 
 The audio is PCM 48khz, and I'm changing it to AAC 192kbps 44100khz.
 
 >Some details and a debug output level 9 of the job creation might help.
 
 attached!
 
 I think everything's in the debug log, but if you want to know anything else let me know!
 
	
	
	
		
	Posts: 12.047Threads: 65
 Joined: May 2017
 
	
	
		You didn't attach a debug output,... thus the steps don't help since they are not detailed enough to make anything of them without the debug output,..
	 
----Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
 
 
	
	
	
		
	Posts: 10Threads: 1
 Joined: Apr 2020
 
	
	
		 (05.04.2020, 14:45)Selur Wrote:  You didn't attach a debug output,... thus the steps don't help since they are not detailed enough to make anything of them without the debug output,.. 
Attempt 2....
 
EDIT: The attach isn't working for some reason. Here's a firefox send link: https://send.firefox.com/download/5a7391...9x8Ic3U8Ng 
	
	
	
		
	Posts: 12.047Threads: 65
 Joined: May 2017
 
	
	
		That one worked: 
Looking at the audio extraction call:
 "C:\PROGRA~1\Hybrid\64bit\ffmpeg.exe" -y -threads 8 -i "C:\Users\kevin\Desktop\VHS project\FINALLY CAPTURING FOLDER\Input files\Friends final setup RAW.avi" -map 0:1 -vn -sn -ss 00:01:00.000 -t 00:19:00.000 -ac 2 -ar 48000 -acodec pcm_s16le -f wav -map_metadata -1 -metadata encoding_tool="Hybrid 2020.02.19.1" "C:\Users\kevin\AppData\Local\Temp\iId_1_aid_0_DELAY_-43ms_13_21_42_4010_01.wav"
Audio should get cut. 
The Vapoursynth script:
 # Importsimport os
 import sys
 import ctypes
 # Loading Support Files
 Dllref = ctypes.windll.LoadLibrary("C:/Program Files/Hybrid/64bit/vsfilters/Support/libfftw3f-3.dll")
 import vapoursynth as vs
 core = vs.get_core()
 # Import scripts folder
 scriptPath = 'C:/Program Files/Hybrid/64bit/vsscripts'
 sys.path.append(os.path.abspath(scriptPath))
 # Loading Plugins
 core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DenoiseFilter/CTMF/CTMF.dll")
 core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DenoiseFilter/VagueDenoiser/VagueDenoiser.dll")
 core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DenoiseFilter/FluxSmooth/libfluxsmooth.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/FFT3DFilter/fft3dfilter.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/EEDI3.dll")
 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/temporalsoften.dll")
 core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/Support/scenechange.dll")
 core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/Support/fmtconv.dll")
 core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/SourceFilter/FFMS2/ffms2.dll")
 # Import scripts
 import mvsfunc
 import havsfunc
 # Loading source using FFMS2
 clip = core.ffms2.Source(source="C:/Users/kevin/Desktop/VHSPRO~1/FINALL~1/INPUTF~1/FRIEND~1.AVI",cachefile="C:/Users/kevin/AppData/Local/Temp/13_21_42_4010.ffindex",format=vs.YUV422P8,alpha=False)
 # making sure input color matrix is set as 470bg
 clip = core.resize.Point(clip, matrix_in_s="470bg",range_s="limited")
 # making sure frame rate is set to 25
 clip = core.std.AssumeFPS(clip, fpsnum=25, fpsden=1)
 # Setting color range to TV (limited) range.
 clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
 # cutting from 1500 with 30000 frames - WARNING: This might cause synch issues
 clip = core.std.Trim(clip=clip, first=1500, length=28500)
 # setting field order to what QTGMC should assume
 clip = core.std.SetFrameProp(clip=clip, prop="_FieldBased", intval=2)
 # Deinterlacing using QTGMC
 clip = havsfunc.QTGMC(Input=clip, Preset="Faster", TFF=True, InputType=0, TR2=0, Sharpness=1.0, SourceMatch=3, Lossless=2)
 # make sure content is preceived as frame based
 clip = core.std.SetFieldBased(clip, 0)
 clip = clip[::2]
 # cropping the video to 692x548
 clip = core.std.CropRel(clip=clip, left=14, right=14, top=14, bottom=14)
 # removing grain using STPresso
 clip = havsfunc.STPresso(clp=clip)
 # denoising using VagueDenoiser
 clip = core.vd.VagueDenoiser(clip=clip, threshold=5.00, nsteps=6)
 # deringing using HQDeringmod
 clip = havsfunc.HQDeringmod(clip, nrmode=2, darkthr=3.0)
 # letterboxing to 720x576
 # Letterbox
 clip = core.std.AddBorders(clip=clip, left=14, right=14, top=14, bottom=14)
 # adjusting output color from: YUV422P8 to YUV420P8 for x264Model (i420)
 clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, range_s="limited")
 # Output
 clip.set_output()
Looks fine.
 
BUT,... 
Hybrid doesn't support cutting when Vapoursynth is used atm.   
-> I'll look whether I can add a quick 'hack' for this.
 
Cu Selur
	
----Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
 
 
	
	
	
		
	Posts: 12.047Threads: 65
 Joined: May 2017
 
	
		
		
		05.04.2020, 16:08 
(This post was last modified: 05.04.2020, 16:56 by Selur.)
		
	 
		Just looked at it again, I already added cut support to Vapoursynth: # cutting from 1500 with 30000 frames - WARNING: This might cause synch issuesclip = core.std.Trim(clip=clip, first=1500, length=28500)
So according to the debug output, the cut should work. 
Video is cut in the Vapoursynth script. 
Audio is cut upon extraction and that extracted audio is the audio which gets reencoded:
 "C:\PROGRA~1\Hybrid\64bit\ffmpeg.exe" -y -threads 8 -i "C:\Users\kevin\AppData\Local\Temp\iId_1_aid_0_DELAY_-43ms_13_21_42_4010_01.wav" -strict -2 -ab 192000 -ac 2 -channel_layout stereo -ar 48000 "C:\Users\kevin\AppData\Local\Temp\iId_1_aid_0_DELAY_-43ms_13_21_42_4010_02.aac"
Cu Selur
 
ps.: didn't implement it for Avisynth
	
----Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
 
 
	
	
	
		
	Posts: 10Threads: 1
 Joined: Apr 2020
 
	
	
		Well it's completely out of sync? It's hard to say exactly how much, but we're talking minutes.
	 
	
	
	
		
	Posts: 12.047Threads: 65
 Joined: May 2017
 
	
		
		
		05.04.2020, 17:38 
(This post was last modified: 05.04.2020, 17:38 by Selur.)
		
	 
		No clue why it would be out of sync that much unless your source if vfr or either the audio or video decoder has issues with the source.I don't see any indication in the log where the problem could be.
 -> this and similar effects is why the whole cutting support is marked as *experimental*
 I don't see a way to fix it in Hybrid.
 
 Cu Selur
 
----Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
 
 |