0

Im trying to get two 1080p videos side by side, Wanting the two scaled to 720p and combined both as 1080p

ive tried using the below code . it works fine when using the lower resolution but when i try to make it go higher it gets all mixed up

any tips

ffmpeg -i video.avi -i video2.avi -filter_complex "nullsrc=size=720x288 [base]; [0:v] setpts=PTS-STARTPTS, scale=360x288 [left]; [1:v] setpts=PTS-STARTPTS, scale=360x288 [right]; [base][left] overlay=shortest=1 [tmp1]; [tmp1][right] overlay=shortest=1:x=360:y=0" -c:v libx264 -f flv "rtmp://192.168.1.1/live/videocrop"

3
  • when i try to make it go higher it gets all mixed up --> how do you change the command?
    – Gyan
    May 7, 2019 at 12:59
  • by changing nullsrc=size=720x288 and the two scale=360x288 but guessing im doing it wrong lol any ideas how to get it higher resolution per video May 7, 2019 at 13:10
  • Eg. ffmpeg -i video.avi -i video2.avi -filter_complex "nullsrc=size=1920x1080 [base]; [0:v] setpts=PTS-STARTPTS, scale=1280x720 [left]; [1:v] setpts=PTS-STARTPTS, scale=1280x720 [right]; [base][left] overlay=shortest=1 [tmp1]; [tmp1][right] overlay=shortest=1:x=360:y=0" -c:v libx264 -f flv "rtmp://192.168.1.1/live/videocrop" May 7, 2019 at 13:15

1 Answer 1

1

Just use hstack:

ffmpeg -i video.avi -i video2.avi -filter_complex "[0:v] setpts=PTS-STARTPTS, scale=360x288 [left]; [1:v] setpts=PTS-STARTPTS, scale=360x288 [right]; [left][right]hstack=inputs=2" -c:v libx264 -f flv rtmp://192.168.1.1/live/videocrop
4
  • thanks that works, Now just run into this problem lol trac.ffmpeg.org/ticket/7547 May 8, 2019 at 11:22
  • @rodreguoussmith I'm assuming your build uses --enable-librtmp. The native FFmpeg RTMP implementation apparently is not affected by that bug. You may have to re-complile without --enable-librtmp to be able to use the native RTMP.
    – llogan
    May 8, 2019 at 17:15
  • thanks yeah seems that annoying bug is doing it, are there any other protocols that could do the same job besides RTMP May 8, 2019 at 20:52
  • @rodreguoussmith I'm not sure. I never got interested in streaming protocols. I suggest trying the native RTMP implementation before anything else.
    – llogan
    May 8, 2019 at 21:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.