Skip to content

Instantly share code, notes, and snippets.

@krokodilerian
Created May 1, 2019 19:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krokodilerian/b2d324c449d99b29116949721f89267c to your computer and use it in GitHub Desktop.
Save krokodilerian/b2d324c449d99b29116949721f89267c to your computer and use it in GitHub Desktop.
#! /bin/bash
if [ -z "$2" ]; then
echo usage: $0 cam pres
exit 2
fi
ffmpeg -y -loglevel verbose \
-i "$1" -map '0:v0' \
-i "$2" -map '0:v1' \
-loop 1 -i './bg.png' \
-filter_complex "[1:1] asetpts=PTS-STARTPTS, channelmap=map=FL|FL [maina];
[v0:0] setpts=PTS-STARTPTS, scale=1024:576 [pres];
[v1:0] setpts=PTS-STARTPTS, scale=320:180 [cam];
[0:0] setsar=1/1, setpts=PTS-STARTPTS [bg];
[bg_c][pres] overlay=x=12:y=8:eof_action=endall [bg_pc];
[bg][cam] overlay=x=948:y=532:eof_action=endall [bg_c];
[bg_pc][maina] concat=n=1:v=1:a=1 [outv][outa]" \
-map '[outv]:v' -map '[outa]:a' \
-pix_fmt yuv420p \
-vcodec libx264 -threads 4 -preset veryfast -b:v 1000k -acodec aac -aq 80 -strict -2 \
-f flv rtmp://strm.ludost.net/st/test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment