Mix – Slidetalk https://slidetalk.net slidetalk Thu, 22 Jul 2021 13:23:10 +0000 en-US hourly 1 https://wordpress.org/?v=6.4.3 https://slidetalk.net/wp-content/uploads/2021/07/cropped-favicon-32x32.png Mix – 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
Arranging tracks from different files https://slidetalk.net/arranging-tracks-from-different-files/ https://slidetalk.net/arranging-tracks-from-different-files/#respond Thu, 22 Jul 2021 12:04:16 +0000 https://slidetalk.net/?p=85 -map – specifies the source track to be included in the output file (if no maps are specified, avconv will …

The post Arranging tracks from different files appeared first on Slidetalk.

]]>
avconv -i in1.mp4 -i in2.mp4 -map 0:a -map 1:v -y -q 1 out.mp4

-map – specifies the source track to be included in the output file (if no maps are specified, avconv will simply convert the first file to the output file format).
map 0: a – audio track from the first file (counting from zero).
-map 1: v – video track from the second.

New in version 0.9 -filter_complex

This option will determine the order of filters for complex (complex) operations.
Works fine with files when they have the same frame rate.

The filter is described by a line that looks something like this:
[in1] [in2] transform [out]

At the input, this is, in fact, the same thing that we write in -map, for example [0: a] [1: a] – the audio channels of the first and second clips.
At the output, we give a name to the newly created channel after the performed transformations, for example, mix_a. It can also be used in map in the future or as the name of the stream at the input of the next transformation.

By default, the transformation includes all incoming streams (or the first stream if the filter accepts only one), so they can be omitted. The resulting channel becomes the default channel for the resulting file, so in most cases, it can also be discarded.

Transformation operations can be conditionally divided into “generators” – they do not accept anything at the input, but only create a stream with specified properties, “filters” – take one stream as input and transform it and “mixers” – take several streams as input and connect them.

There may also be several streams at the output, for example, if the filter splits stereo into two mono tracks, they also need to be described with the [out1] [out2] list, etc.

The post Arranging tracks from different files appeared first on Slidetalk.

]]>
https://slidetalk.net/arranging-tracks-from-different-files/feed/ 0
An alternative way to mix audio tracks https://slidetalk.net/an-alternative-way-to-mix-audio-tracks/ https://slidetalk.net/an-alternative-way-to-mix-audio-tracks/#respond Tue, 22 Jun 2021 11:53:04 +0000 https://slidetalk.net/?p=82 There is a good, time-tested tool for processing audio, sox. Surprisingly, it managed to merge two audio tracks without any …

The post An alternative way to mix audio tracks appeared first on Slidetalk.

]]>
There is a good, time-tested tool for processing audio, sox. Surprisingly, it managed to merge two audio tracks without any surprises after a series of unstable results with avconv. For example, avconv can merge two tracks of the same time, and one of them exits before the other. Accordingly, when overdubbing, the sound can “move out” a lot, especially on long rollers.

sox -m in1.wav in2.wav out.wav

-m – an option specifying the mixing mode for input files. Without options, sox will simply concatenate the files, adding the second one after the first.

The post An alternative way to mix audio tracks appeared first on Slidetalk.

]]>
https://slidetalk.net/an-alternative-way-to-mix-audio-tracks/feed/ 0