u2takey / ffmpeg-go

golang binding for ffmpeg
Apache License 2.0
1.67k stars 167 forks source link

Overwrite audio at offset #51

Open jamra opened 2 years ago

jamra commented 2 years ago

I'm trying to overwrite the audio at a specific offset to provide commentary. I've been struggling with the correct way to do this with ffmpeg, but found some use of atrim:


ffmpeg -y -i original.flac -i replacement.flac \
  -filter_complex "[0]atrim=0:2[Apre];[0]atrim=5,asetpts=PTS-STARTPTS[Apost];\
                   [Apre][1][Apost]concat=n=3:v=0:a=1" out.flac

I was wondering if you could help me find a way to do this with this or if perhaps there is a better way.