Given:
- A video file (Video1)
- An audio file (Audio1)
- A background music (BGM) file (BGM1)
Task:
Create a new video file (OutputVideo) with the following
specifications:
a. Video Track: Identical to the video track of Video
b. Combination of Audio1 and BGM1: Overlay Phase: Audio1 and BGM1 (at 30% volume) play simultaneously for the duration of Audio1.
c. BGM Phase: BGM1 continues to play at 100% volume from the end of Audio1 until the end of Video1.
Constraints:
- OutputVideo should have the same duration as Video1.
Current ffmpeg command:
ffmpeg -y -i videoPath -i audioPath -i bgmPath -filter_complex "[2:a]aloop=loop=-1:size=2e9[bgm_repeated];[bgm_repeated]volume=0.3[bgm_low];[1:a][bgm_low]amix=inputs=2:duration=first[mixed];[2:a]volume=1[bgm_full];[2:a]atrim=start=%.2f:end=%.2f[bgm_trimmed];[mixed][bgm_trimmed]acrossfade=d=2:c1=tri:c2=exp[audio_mid];[bgm_full][audio_mid]concat=n=2:v=0:a=1[audio_final]" -map 0:v -map "[audio_final]" -c:v copy -shortest finalVideoPath
This doesn't seem to work.