2

I want to combine 2 commands

  1. Merge a webcam capture and a desktop capture side-by-side:

    ffmpeg -f v4l2 -framerate 25 -video_size 640x480 -i /dev/video0 \
    -f x11grab -framerate 100 -video_size 1600x900 -i :0.0 \
    -filter_complex "[0:v]pad=iw:900:0:(oh-ih)/2[left];[left][1:v]hstack" \
    output.avi
    
  2. Create chunks of a duration from 1 video:

    ffmpeg -f video4linux2 -s vga -i /dev/video0 -f segment -segment_time 1 -strftime 1 '%Y-%m-%d_%H-%M-%S.ts'
    

What is the proper way of merging those 2 commands in order to have at the end chunks of a video comprised of those 2 videos?

0

1 Answer 1

3

Just combine them:

ffmpeg -f v4l2 -framerate 25 -video_size 640x480 -i /dev/video0 \
-f x11grab -framerate 100 -video_size 1600x900 -i :0.0 \
-filter_complex "[0:v]pad=iw:900:0:(oh-ih)/2[left];[left][1:v]hstack,format=yuv420p" \
-c:v libx264 -f segment -segment_time 1 -strftime 1 '%Y-%m-%d_%H-%M-%S.ts'
3
  • My webcam video looses its aspect ratio. How to solve the problem?
    – Uday Reddy
    Feb 3, 2019 at 12:39
  • @UdayReddy You should ask a new question on this site. Show your ffmpeg command and the complete log.
    – llogan
    Feb 4, 2019 at 17:44
  • I've posted my question(askubuntu.com/questions/1115811/…). See if you can help.
    – Uday Reddy
    Feb 5, 2019 at 12:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .