digitalFAQ.com Forum

digitalFAQ.com Forum (https://www.digitalfaq.com/forum/)
-   Edit Video, Audio (https://www.digitalfaq.com/forum/video-editing/)
-   -   Avisynth and MeGUI audio not trimmed? (https://www.digitalfaq.com/forum/video-editing/14003-avisynth-megui-audio.html)

jnielsen 01-12-2024 05:13 AM

Avisynth and MeGUI audio not trimmed?
 
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?

PliableFoe 01-12-2024 11:00 PM

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.

PliableFoe 01-13-2024 07:12 PM

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.

traal 01-13-2024 07:55 PM

I wonder if the input file is malformed and that's why:

Quote:

Originally Posted by jnielsen (Post 94113)
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


All times are GMT -5. The time now is 01:21 AM

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.