Mozaic: Choose audio source

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Mozaic: Choose audio source

Grégory S
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
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Mozaic: Choose audio source

Gyan
On Tue, Jun 13, 2017 at 8:29 PM, Grégory S <[hidden email]> wrote:

>
> 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.
>

Add    -map    to select the audio e.g.    -map 1:a    to select the audio
from the 2nd input.

Add   -af apad    to extend the selected audio with silence indefinitely.

Add    -shortest    to stop muxing when the video stream ends.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Mozaic: Choose audio source

Gyan
You will have to label the final overlay output e.g. [v] and then map it as
well    -map "[v]"
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".