Go Back    Forum > Digital Video > Video Project Help > Edit Video, Audio

Reply
 
LinkBack Thread Tools
  #1  
01-12-2024, 05:13 AM
jnielsen jnielsen is offline
Free Member
 
Join Date: Nov 2015
Posts: 53
Thanked 10 Times in 8 Posts
I am capturing to MPG2 and AVI files form VHS PAL.
I then use Megui and an Avisynth script to deinterlace and scale to HD, square pixels and 50 fps and convert to MP4. Avisynth v. 2.60

However when I capture I get som strange jitter in the first 1 sek. I want to cut out the first 1-2 sec. of the video. I then tried the "Trim" command in Avisynth
Trim(100, 0)
It works. It cuts the first 100 frames. Hovever the audio is not cut. It just starts later and is then 2 sec. out of sync. The videos total length is also the same, because it add still frames at the end to make space for the 2 sec. extra audio.
I tried the Trim command with pad = false or true, no difference
Trim(100, 0, pad=false)
I tried to add the trim command in the start of the script after <input>, same result, audio is not trimmed.
I tried to cut the audio separately
AudioTrim(2, 0)
I then get the message
Error in AviSynth script:
AudioTrim: Cannot trim if there is no audio.


<input>
AssumeTFF() # BFF for MiniDV
ConvertToYV12(interlaced=true)
QTGMC( Preset="Faster" )
# SelectEven() # Add this line to keep original frame rate, leave it out for smoother doubled frame rate
Crop(12,4,-12,-12) # left, top, right, bottom
AddBorders(12,8,12,8) # left, top, right, bottom
# Levels(16, 1, 235, 0, 255, coring=false)
# LimitedSharpenFaster()
Trim(100, 0)
# AudioTrim(2, 0)
spline36resize(960,720)

http://avisynth.nl/index.php/Trim

How can I trim both video and audio?
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Ads / Sponsors
 
Join Date: ∞
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
01-12-2024, 11:00 PM
PliableFoe PliableFoe is offline
Free Member
 
Join Date: Jan 2024
Posts: 2
Thanked 0 Times in 0 Posts
i am having this exact same issue with the trim function. my source is a FFV1 .avi with PCM audio. i'm trying to trim out 3 sections from a large video and join them together and include the matching trimmed audio as well. my script looks very similar to yours and i've tried the same things. tried pad=false, no change, and tried trimming before and after deinterlacing, and it never touches the audio and just muxes it over as is.
Reply With Quote
  #3  
01-13-2024, 07:12 PM
PliableFoe PliableFoe is offline
Free Member
 
Join Date: Jan 2024
Posts: 2
Thanked 0 Times in 0 Posts
ive been trying to dig into this more but haven't found much as to why trim won't also trim audio. i'm using ffms2 as input with atrack=-1. staxrip sees the audio track but doesn't make any edits even though i have trims set.

i did find that if i open staxrip directly and load in my source file, ffmpeg opens up a window and demuxes the file and makes a .wav file in the temp folder. i can then make my trims within staxrip, adjust the operators to ++ so it cuts audio and then encode into something on ultrafast settings because i'm just after audio.

i then copy/paste the trim code from staxrip into avisynth and proceed as usual and mux in the separately created audio as the last step. not ideal, but it doesn't take much extra time and i've found it to be an ok work around for now.
Reply With Quote
  #4  
01-13-2024, 07:55 PM
traal traal is offline
Free Member
 
Join Date: Jan 2016
Posts: 398
Thanked 75 Times in 68 Posts
I wonder if the input file is malformed and that's why:

Quote:
Originally Posted by jnielsen View Post
when I capture I get som strange jitter in the first 1 sek.
What software are you using to capture?

You might pass it through ffmpeg first and see if it works better in avisynth.

Code:
ffmpeg -i infile.avi -acodec copy -vcodec copy outfile.avi
Reply With Quote
Reply




Tags
avisynth, megui, trim

Similar Threads
Thread Thread Starter Forum Replies Last Post
Avisynth+ QTGMC audio out of sync Nik92 Restore, Filter, Improve Quality 11 02-05-2023 08:40 PM
Avisynth audio sync errors av_123 Restore, Filter, Improve Quality 0 11-02-2020 04:48 PM
JVC SR-MV45 distorted audio when playing linear audio on SLP tapes? ChunkDaMan Capture, Record, Transfer 17 08-12-2019 04:55 PM
Advantages of Avisynth vs. Avisynth+ (plus)? homefire Restore, Filter, Improve Quality 4 07-02-2019 06:54 PM
Anamorph output checkbox gone in MeGUI 2774? jnielsen Restore, Filter, Improve Quality 5 02-04-2018 12:48 AM




 
All times are GMT -5. The time now is 11:44 PM