Picture – Slidetalk https://slidetalk.net slidetalk Thu, 22 Jul 2021 12:24:09 +0000 en-US hourly 1 https://wordpress.org/?v=6.4.3 https://slidetalk.net/wp-content/uploads/2021/07/cropped-favicon-32x32.png Picture – Slidetalk https://slidetalk.net 32 32 The picture is superimposed on the video https://slidetalk.net/the-picture-is-superimposed-on-the-video/ https://slidetalk.net/the-picture-is-superimposed-on-the-video/#respond Thu, 22 Jul 2021 12:19:45 +0000 https://slidetalk.net/?p=90 overlay – allows you to overlay one stream on top of another. You can also use a picture as a …

The post The picture is superimposed on the video appeared first on Slidetalk.

]]>
avconv -i video.mkv -i logo.png -filter_complex overlay=x=10:y=main_h-overlay_h-10 -q 1 out.mkv

overlay – allows you to overlay one stream on top of another. You can also use a picture as a stream. In the example above, we set the logo to be indented to the left and bottom by ten pixels. To calculate the bottom margin, we subtract the height of the superimposed stream from the height of the main stream and additionally subtract the offset itself.

With this example, we can demonstrate the use of several filters together. To separate the filter list, use “;”.

avconv -i in1.avi -i in2.avi -filter_complex "[1:v]scale=w=iw/3:h=ih/3[v_small];[0:v][v_small]overlay=x=main_w-overlay_w-main_w/20:y=main_h-overlay_h-main_w/20" -q 1 out.avi

Take the second image, reduce it three times and place it in the lower right corner, making an indent from the edge equal horizontally and vertically to one twentieth of the width of this image.

P.S. I would like to say at the end that the final version was very different from how everything was seen at the beginning. Last but not least, this was influenced by many bugs, even in the most recent version. A version from the 0.8 branch is offered as a stable version, but, unfortunately, many interesting features are missing there. On the other hand, avconv from the 0.9 branch is very unstable and managed, in seemingly tested places, on some input files to eat up all the RAM in a few seconds and hang the server. Of course, memory usage can be limited to the current user, but this still does not solve the problem, since avconv crashes anyway. Sometimes individual clips from the video sequence disappeared, in some cases the time on the audio track and video sequence unexpectedly diverged – you had to look for other tools and other ways to perform the same tasks.

UPD: Add one picture to sound:

ffmpeg -r 1 -loop 1 -i aa.jpg -i aa.mp4 -acodec copy -vcodec mjpeg -t 326 -q 1 -y a.mp4

Who does not have avconv 0.9 on the system
1) clone git and configure

git clone git://git.libav.org/libav.git; ./configure

2) It is better to specify compilation in several threads to make it faster. Install it is better not to do so that later you do not have to restore anything in the system.

make -j 8

If there are no codecs:

./configure --help

And there just see what --enabled e.g. ./configure --enable-vdpau

The post The picture is superimposed on the video appeared first on Slidetalk.

]]>
https://slidetalk.net/the-picture-is-superimposed-on-the-video/feed/ 0