Skip to content
Chaos, Information Security & Other

Chaos, Information Security & Other

information security and more – Blog by Felix Bilstein

  • Home
  • Blog
  • About
  • Contact
  • Privacy & GDPR
  • Home
  • Linux
  • Using FFmpeg to record video and audio

Using FFmpeg to record video and audio

Posted on August 17, 2020February 24, 2021 By Felix No Comments on Using FFmpeg to record video and audio
Linux

Recording of your screen can be useful to record video conferences or streamed content. With FFmpeg you can record some video or audio of your screen!

Table of Contents

  • Installation
  • Running FFmpeg to record streamed content:
  • ALSA loopback
  • See also:

Installation

Install FFmpeg for your operating system, e.g. sudo apt install ffmpeg or if you are running gentoo Linux, do:

emerge -av pavucontrol ffmpeg

Then launch pavucontrol, start ffmpeg in your shell (just with some random parameters, only to see the third entry in the image below) and change the recording device in pavucontrol to monitor the audio from your device (third entry, Monitor of):

Running FFmpeg to record streamed content:

ffmpeg -video_size 1920x1080 -framerate 25 -f x11grab -i :0.0+0,+360 -f alsa -i default -ac 2 output.mkv

Ensure that you use the correct resolution and starting point (here: +0,+360). You can find the location on X using a system settings configurator or for example the nvidia display settings. Maybe choose pulse instead of alsa if it does not work:

ffmpeg -video_size 1920x1080 -framerate 25 -f x11grab -i :0.0+0,+360 -f pulse -i default -ac 2 output.mkv

Alternatively you can change the device from -i default to a specified device, e.g. hw0:0,0.

ALSA loopback

In case that you need an ALSA loopback device for further experiments, set this in your kernel: CONFIG_SND_ALOOP=m or CONFIG_SND_ALOOP=y.

See also:

[1] https://askubuntu.com/questions/682144/capturing-only-desktop-audio-with-ffmpeg
[2] https://wiki.debian.org/audio-loopback
[3] https://wiki.gentoo.org/wiki/ALSA
[4] https://raspberrypi.stackexchange.com/questions/49946/best-ffmpeg-configuration-for-recording-videoaudio-with-raspberrypi-and-usb-web

Tags: linux

Post navigation

❮ Previous Post: First entry
Next Post: Setting up a Gentoo VM for Linux Kernel Development ❯

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • Development
  • Exploitation
  • Forensics
    • Data Recovery
  • Linux
  • misc
  • Windows

Tags

data recovery development eclipse encryption exploitation forensics gentoo kernel linux luks lvm shellcode windows

Stay tuned:

Copyright © 2025 Chaos, Information Security & Other.

Theme: Oceanly by ScriptsTown