需要合并例如 3 个有声/无声视频,并将 mp3 中的音轨添加到没有声音的视频(之前已知有声视频):
melt 1.mp4 2sound.mp4 -mix 30 -mixer luma 3.mp4 -mix 30 -mixer luma -track music.mp3
添加的音轨 (music.mp3) 必须为 1 和 3 视频的 100% 音量,以及 30% 的音量与内置音轨 2sound.mp4 混合。那有可能吗?
You can use the "volume" filter to animate the volume of the music track. You just need to know the frame when the clip with sound start and stops. You can use the mix transition to blend the audio of the two tracks.
For example, if 2sound.mp4 starts at 500 and ends at 1000, the command would be:
melt 1.mp4 2sound.mp4 -mix 30 -mixer luma 3.mp4 -mix 30 -mixer luma -track music.mp3 -filter volume level=0=0;500=-12;1000=0 -transition mix
In this example, the level is set to 0db for the first 500 frames (during 1.mp4), -12db for frames 500-1000 (during 2sound.mp4) and then back to 0dB during 3.mp4.
Volume filter documentation: https://www.mltframework.org/plugins/FilterVolume/
Mix transition documentation: https://www.mltframework.org/plugins/TransitionMix/