[FFmpeg-user] Mozaic: Choose audio source

Grégory S texel3d at gmail.com
Tue Jun 13 17:59:46 EEST 2017


Hi,

i develop a C++ application which generate a FFMpeg command to create a
mozaic of 3 videos.
The duration of each source videos can be different.
The exported video duration is equal to the longest source video (i have
acces to the information and i generate the command according to this
information).

This is an example of my actual generated command:
"ffmpeg.exe -i C:/temp/lego.mp4 -i C:/temp/blender.mp4 -i C:/temp/lego.mp4
-filter_complex "nullsrc=size=1920x1080 [base]; [0:v]
setpts=PTS-STARTPTS,scale=960x540 [upperleft]; [1:v] setpts=PTS-STARTPTS,
scale=960x540 [upperright]; [2:v] setpts=PTS-STARTPTS, scale=960x540
[lowerright]; [base][upperleft] overlay=eof_action=repeat [tmp1];
[tmp1][upperright] overlay=shortest=1:x=960 [tmp2]; [tmp2][lowerright]
overlay=eof_action=repeat:x=960:y=540" -sn -c:v libx264 -y
C:\temp\output.mkv"

Now i want to be able to select from which video source the sound will be
exported.
If the duration of the sound is shorter than the duration of the mozaic (if
it do not comes from the longest video), i want to have silence until the
end of the video.

How can i do that ?

Thanks


More information about the ffmpeg-user mailing list