Hey, I'm really struggling with a problem using FFMPEG (Also tried using SoX).
Basically what I'm currently doing is taking the first second of audio and cross fading it with another track (Last 1 second of it) and then I recombine that crossfaded track with the original track minus the first second.
I currently convert some AAC audio to a WAV and then cut it.
The problem is when it plays when it hits that point where they recombine theres a click/pop.
This is the crossfad filter I do, I don't use acrossfade because it sometimes it just produces no audio for some reason
This is the filter I run on the remaining audioCode:[0:a]atrim=end=1,asetpts=PTS-STARTPTS[0a]; [1:a]atrim=end=1,asetpts=PTS-STARTPTS[1a]; [0a]afade=in:d=1[final0a]; [1a]afade=out:d=1[final1a]; [final1a][final0a]amix=duration=longest:dropout_transition=0[a]
I've tried doing exact sample cuts, as well as SoX but both end up causing the audio pop/click when its played back to back.Code:[0:a]atrim=start=1,asetpts=PTS-STARTPTS[a]
Greatly appreciate any help, I'm completely clueless why its not playing back like the original, I assume I'm missing some samples in between the two audio files but when I cut exactly using the samples that shouldn't really happen?
Edit: It seems when I concat the audio it removes the click/pop but if I do it when its attached to video it doesn't. If I treat the audio separately concat and then merge with the concat video then I get some desync.
Edit2: Think I got it all working now, for some reason the -r 60 option was causing my issues I think, removing it and doing in the complex filter fps=fps=60 to adjust the framerate to be constant seems to have fixed the audio issue click/pop and desync.
Edit3: Still getting some audio desync actually.
Edit4: Figured it out, turns out atrim=end=1 time ends up not cutting a second of audio in my situation for some reason, it drops essentially 1 audio frame (1/48000)
So now I can trim videos using trim but I have to do atrim=end_sample=(SR*Time) in order to get it all to sync up correctly.
+ Reply to Thread
Results 1 to 1 of 1
-
Last edited by Silco; 17th Oct 2020 at 08:21.
Similar Threads
-
Cutting some stubborn videos with ffmpeg
By mpegnup in forum Newbie / General discussionsReplies: 16Last Post: 3rd Apr 2020, 10:25 -
ffmpeg cutting: how to get negative start time?
By Luke M in forum EditingReplies: 1Last Post: 25th Jul 2018, 11:00 -
FFmpeg cutting/joining findings
By Budman1 in forum EditingReplies: 4Last Post: 11th Jul 2018, 00:25 -
Cutting a video with FFMPEG in the same format/quality?
By Unknown01 in forum Newbie / General discussionsReplies: 3Last Post: 22nd Dec 2016, 02:14 -
problem with ffmpeg - cutting video and merging audio tracks
By yakov in forum EditingReplies: 0Last Post: 23rd Mar 2016, 12:00