If I recall, this means the videos have to be the same height and have the same encoding. Run ffmpeg using the numbers from -geometry: ffmpeg -f x11grab -videosize 1600x900 -framerate 50 -i :0.0+129,57 -vf formatyuv420p output.mp4. One thing about using hstack taken from the ffmpeg filter documentation:Īll streams must be of same pixel format and of same height Setting shortest=1 will make it the length of the shortest video stream instead.Īfter that, we just map the video stream created from hstack to the output file and you're good to go.
By default, it will be the length of the longest video stream. The inputs option indicates how many video streams are being used as inputs (defaults to 2) and the shortest option indicates how long the output video stream will be.
We are taking the video streams from the two inputs and passing them into the hstack filter. For example to compute the CRC of the input audio converted to PCM unsigned 8-bit and the input video converted to MPEG-2 video, use the command: ffmpeg -i INPUT -c:a pcmu8 -c:v mpeg2video -f crc. You'll see we are passing in two videos as inputs with the -i option, video1.mp4 and video2.mp4. You can select the output format of each frame with ffmpeg by specifying the audio and video codec and format. ffmpeg reads from an arbitrary number of input files (which can be regular files, pipes, network streams, grabbing devices, etc. It can also convert between arbitrary sample rates and resize video on the fly with a high quality polyphase filter. Enter fullscreen mode Exit fullscreen mode DESCRIPTION ffmpeg is a very fast video and audio converter that can also grab from a live audio/video source.