Monday, September 23, 2024

Re: Using ffmpeg to record x11 screen & audio

On Sat, Sep 21, 2024 at 2:50 PM Thomas Frohwein <tfrohwein@fastmail.com> wrote:
>
> On Fri, Sep 20, 2024 at 10:47:42PM -0700, patrick keshishian wrote:
> > Hi folks,
> >
> > Attempting to do a screen capture (x11) including audio; say chrome is
> > playing a video clip and I want to capture a portion of the screen
> > along with the audio.
> >
> > Quick search shows following example:
> >
> > ffmpeg -f x11grab -probesize 32M -thread_queue_size 32 -i :0 \
> > -f sndio -thread_queue_size 32 -i snd/0 \
> > -codec:v libx264rgb -crf 0 -preset ultrafast \
> > -codec:a pcm_s16le \
> > raw.mkv
> >
> > Unfortunately, play back of raw.mkv file using ffplay, there is no
> > audible audio.
>
> You need to use the monitoring stream to capture audio produced by
> applications. See here how to set it up:
>
> https://www.openbsd.org/faq/faq13.html#recordmon
>
> In the script I use to not hand-type all the ffmpeg syntax, I have this:
>
> -f sndio -i snd/1.mon
>
> (in your case likely snd/0.mon after setting it up)

Thanks for the pointer! Worked as you & the FAQ explained.
--patrick

No comments:

Post a Comment