Home/News | About | Download | Documentation | Forum | Bug Reports | Contact | Donations | Consulting | Projects | Legal | Security | FATE


This forum has not been maintained for a long time and will probably get deleted in the near future.
For faster responses to your questions, please use StackOverflow instead and tag your questions with "FFmpeg".
If you need a backup of the posts from this forum, please contact me directly.

overlay video in realtime, output to one file

Discussions about problems encountered using ffmpeg.
Forum rules
FFmpeg is in a state of perpetual development and we do not currently have the person power to backport fixes to official releases. As such, if you wish to query or report a bug, you must try with the latest development branch revision of FFmpeg to confirm the issue still exists. The latest FFmpeg can be downloaded from here: http://www.ffmpeg.org/download.html

overlay video in realtime, output to one file

Postby Sweptr » Wed May 03, 2017 6:10 pm

Hi. I need to overlay desktop with video from webcam.
My current attempt is like this - which works but I would like to get rid of the delay from fffplay.


Code: Select all
    ffplay /dev/video0 &
    ffmpeg -video_size 1920x1060 -framerate 60 -f x11grab -i :0.0+0,0 -f alsa -ac 2 -i pulse -acodec aac -strict experimental output.flv

/Sweptr
Sweptr
 
Posts: 3
Joined: Sun Oct 27, 2013 9:14 am

Re: overlay video in realtime, output to one file

Postby llogan » Wed May 03, 2017 10:38 pm

You could use overlay filter instead. Basic example:

Code: Select all
ffmpeg -f x11grab -video_size 1920x1060 -i :0.0 -f v4l2 -i /dev/video0 -f alsa -channels 2 -i pulse -filter_complex "[0][1]overlay" output

You don't need "-strict" unless your ffmpeg is old.
Get an answer more quickly by providing your actual ffmpeg command and the complete console output. Use the code button to format your command and output or your question will be ignored.
llogan
 
Posts: 2337
Joined: Fri Jan 25, 2013 9:47 pm
Location: Alaska

Re: overlay video in realtime, output to one file

Postby Sweptr » Sat May 20, 2017 1:52 am

Thankyou. :D How do I now mark this thread as solved.?
Also - how do I in your example above map 2 microphones to separate channels.?
Sweptr
 
Posts: 3
Joined: Sun Oct 27, 2013 9:14 am

Re: overlay video in realtime, output to one file

Postby llogan » Tue May 23, 2017 7:18 pm

Sweptr wrote:Thankyou. :D How do I now mark this thread as solved.?

You can edit the title of your first post in this thread if you feel like it.
Sweptr wrote:Also - how do I in your example above map 2 microphones to separate channels.?

There are several ways to do this. One method is to use amerge:
Code: Select all
ffmpeg -f x11grab -video_size 1920x1060 -i :0.0 -f v4l2 -i /dev/video0 -f alsa -i mic1 -f alsa -i mic2 -filter_complex "[0:v][1:v]overlay[v];[2:a][3:a]amerge=inputs=2[a]" -map "[v]" -map "[a]" output

You will of course have to use the proper inputs instead of my examples of "mic1" and "mic2". See:
https://ffmpeg.org/ffmpeg-devices.html#alsa
https://trac.ffmpeg.org/wiki/Capture/ALSA
Get an answer more quickly by providing your actual ffmpeg command and the complete console output. Use the code button to format your command and output or your question will be ignored.
llogan
 
Posts: 2337
Joined: Fri Jan 25, 2013 9:47 pm
Location: Alaska


Return to ffmpeg

Who is online

Users browsing this forum: Bing [Bot] and 6 guests