12/28/2023 0 Comments Multiple vlc windows open![]() ![]() After we specified the input we want, we also made sure that PTS of that video starts from zero, using setpts filter with "setpts=PTS-STARTPTS". The stream specifier " " is telling ffmpeg to use the video stream from the first input. Then, we also tagged each ffmpeg input to be able to reference them later in the filter graph. Now, let's get back to the command line we've used and lets explain it line by line:įirst, we created a background for our output video, using nullsrc filter, which has the dimension of 640x480 pixels (4 videos of 320x240 pixels) and we tagged it with the name "base". The filter graph, for this particular case, looks something like this: What we need to do, in this tutorial, is to overlay 4 input videos on top of the blank background video. ![]() Also, pay a very close attention to the provided examples section. First of all get yourself familiar with the overlay filter and all of its options. Let's explain how exactly does this work, so you can create your own variants of overlay filter usage. You can see the final video at the following link: Detailed explanation ![]() The command line above, if written in the shell directly, should look like this of course:įfmpeg -i 1.avi -i 2.avi -i 3.avi -i 4.avi -filter_complex "nullsrc=size=640x480 setpts=PTS-STARTPTS, scale=320x240 setpts=PTS-STARTPTS, scale=320x240 setpts=PTS-STARTPTS, scale=320x240 setpts=PTS-STARTPTS, scale=320x240 overlay=shortest=1 overlay=shortest=1:x=320 overlay=shortest=1:y=240 overlay=shortest=1:x=320:y=240" -c:v libx264 output.mkv This can be done using the following ffmpeg command line (which we'll explain in detail): We can see one video, displaying 4 different inputs at the same time. An example of what we are going to achieve in this tutorial is displayed in the following screenshot: We can also use this feature to implement the mosaic video output, usually used in security surveillance systems. One of the great features of ffmpeg filtering library is the ability to create overlays, allowing users to put one video over another. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |