[FFmpeg-user] Replace part of the audio

Alexander Bieliaev alexanderb at callcabinet.com
Wed Feb 1 10:39:24 EET 2023


Thanks, it kinda worked for me, but it seems like it's dependent on the
length of the inserted audio. For example if I have a 2 minute audio and
try to replace some parts of it with audio that is 1 minute long, for the
first minute of the audio it works fine but if I try to replace parts above
1 minute it doesn't work. I guess it's because it tries to pick parts of
the audio above 1 minute, but it doesn't exist, because the audio is only 1
minute long. How can I replace any part of the audio with another audio
that starts playing from the beginning?

On Mon, Jan 23, 2023 at 10:26 AM Michael Koch <astroelectronic at t-online.de>
wrote:

> Am 22.01.2023 um 23:52 schrieb Reino Wijnsma:
> > Hello Michael,
> >
> > On 2023-01-22T18:50:20+0100, Michael Koch <astroelectronic at t-online.de>
> wrote:
> >> This command line works with asendcmd and astreamselect:
> >>
> >> ffmpeg -i audio1.wav -i audio2.wav -lavfi asendcmd="4 astreamselect map
> 1",asendcmd="6 astreamselect map 0",astreamselect=map=0 -y out.wav
> >>
> >>
> >> However with amix filter I have no idea what's the syntax for the
> string inside the string. It doesn't work.
> >>
> >> ffmpeg -i audio1.wav -i audio2.wav -lavfi asendcmd="4 amix weights '0
> 1'",amix=weights='1 0' -y out.wav
> > You've got your quotes all wrong. Always surround the complete
> filter-chain with double quotes and use single quotes for the individual
> filters.
> >
> > ffmpeg -i audio1.wav -i audio2.wav -lavfi "asendcmd='4 astreamselect map
> 1',asendcmd='6 astreamselect map 0',astreamselect=map=0" -y out.wav
> >
> > ffmpeg -i audio1.wav -i audio2.wav -lavfi "asendcmd='4 amix weights
> '\\\'0 1\\\',amix=weights='1 0'" -y out.wav
>
> Thank you!
>
> Michael
>
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
>

-- 
This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. 
If you have received this email in error please notify the system manager. 
Please note that any views or opinions presented in this email are solely 
those of the author and do not necessarily represent those of the company. 
Finally, the recipient should check this email and any attachments for the 
presence of viruses. The company accepts no liability for any damage caused 
by any virus transmitted by this email. 



More information about the ffmpeg-user mailing list