![]() movflags +faststart -f flv rtmp://url.to.ingestion. The watermark logo "video", ffmpeg index If your streams are of a different size the scaling/cropping might be required.įor testing purposes you can save into a file instead of sending to a server, just change " -f flv rtmp://url.to.rver/streamkey/etc" to for example test.movīreaking down the FFmpeg command line FFmpeg command line explained -loop 1 -i background_image.png As so we are not scaling them in any way as we don't need to. We are taking a couple of shortcuts here, one is that we know the resolution of the incoming streams (852x480) and that they fit nicely side by side on a Full HD background canvas. The resulting video is compressed to h264 format, tuned for low latency, key frames forced every 20 frame and encapsulated in flv for the rtmp ingestion. Add a second audio track to video In this example, I will add the audio1.mp3 as a second audio track to the video file. Last the video and audio are mapped to the output. ![]() ![]() Last the logo is placed in the middle.Ī dummy null audio (silence) is added to make some rtmp ingestion services happy with the stream (YouTube does not like a video only stream). The two video streams and are padded with a black border vertically aligned in the middle and horizontaly aligned on the left and right sides and overlayd on the background image. What the command does is load a background image (1920x1080) as video, two live streams as video and and a logo as video. c:v libx264 -pix_fmt yuv420p -tune zerolatency -crf 28 -x264-params keyint=20:scenecut=0 Since this involves compressing the file, it will take (much longer) than the. h264 video and aac audio compression: ffmpeg -i input1.mp4 -i input2.avi -c copy -map 1:v:0 -map 0:a:0 -shortest -c:v mpeg4 -c:a aac output.mp4. Overlay=x=(main_w-overlay_w)/2:y=(main_h-overlay_h)/2 If you want to convert (and compress) the file in one operation, you can use this one-liner to export an MP4 file with. The FFmpeg command used is (we will break down and explain everything!): ffmpeg We also add a null audio so that YouTube is happy with the stream. We specify the image background, two streams and a watermark image as inputs to FFmpeg, setup a filter to compose these. This is an example on how to combine two live webcam streams over a background image with a watermark/logo.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |