Skip to content

Instantly share code, notes, and snippets.

@Myralllka
Last active April 10, 2024 13:04
Show Gist options
  • Save Myralllka/5bd585bf1ee430ac37f02398f510517a to your computer and use it in GitHub Desktop.
Save Myralllka/5bd585bf1ee430ac37f02398f510517a to your computer and use it in GitHub Desktop.
Screencast using gstreamer from 2024
#!/bin/sh
# get your audio device name by
# pactl list | grep -A2 'Source' | grep input
# The main difference from the original (https://gist.github.com/BOOtak/2550b1d2701ee18714a784e472ba6a54)
# is usage of the compositor instead of videomixer
# https://gstreamer.freedesktop.org/documentation/compositor/index.html?gi-language=c#compositor
gst-launch-1.0 -e \
compositor name=mix \
! videoconvert \
! x264enc \
! audiomix. \
ximagesrc startx=0 use-damage=0 \
! 'video/x-raw,framerate=30/1' \
! queue \
! mix. \
v4l2src \
! 'video/x-raw,framerate=30/1,width=320,height=240' \
! queue \
! mix. \
pulsesrc device="alsa_input.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp__source" \
! audioconvert \
! 'audio/x-raw,rate=44100,channels=2' \
! queue \
! voaacenc \
! audiomix. \
avimux name=audiomix \
! filesink sync=false location=test.avi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment