To add silence at the beginning when ffmpeg combines video and audio

Asked 2 years ago, Updated 2 years ago, 99 views

On Android, ffmpeg, run the following command to combine audio into the video:

ffmpeg-hide_banner-y-imovie.mp4-ibgm.aac-vcodec copy-acodec copy-bsf:aac_adtstoascout.mp4

At that time, I want the sound to start after 3 seconds from the beginning of the video, but I don't know how to do it.From the beginning, you should prepare a 3-second silence at the beginning of the audio, but depending on the conditions, I would like to avoid preparing two types of silence.

I look forward to your kind cooperation.

android ffmpeg

2022-09-30 16:59

1 Answers

It is good to use -itsoffset, but when used with -acodec copy, the delay does not seem to work.So,

ffmpeg-y-imovie.mp4-itsoffset 00:00:03-ibgm.aac-vcodec copy-bsf:aac_adttoasc-async1-strict-2 out.mp4

Then, after 3 seconds, the audio starts playing, and -async1 records the audio stream offset value.Also, for AAC, -strict-2 must be specified.

--From user9156's comments


2022-09-30 16:59

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.