Skip to content

Instantly share code, notes, and snippets.

@guicaulada
Created March 31, 2020 02:43
Show Gist options
  • Select an option

  • Save guicaulada/18bec9c85c8e7cb3e599dc43bb26b60f to your computer and use it in GitHub Desktop.

Select an option

Save guicaulada/18bec9c85c8e7cb3e599dc43bb26b60f to your computer and use it in GitHub Desktop.
Screen and audio streaming using vban, ffmpeg and mpv. Download vban from: https://github.com/quiniouben/vban
#!/usr/bin/bash
TARGET="${1:-127.0.0.1}"
PORT="${2:-6980}"
STREAM="${3:-vban_stream}"
BACKEND="${4:-pulseaudio}"
LOGLEVEL="${5:-1}"
vban_receptor -i $TARGET -p $PORT -s $STREAM -b $BACKEND -l $LOGLEVEL
#!/usr/bin/bash
TARGET="${1:-127.0.0.1}"
PORT="${2:-6980}"
STREAM="${3:-vban_stream}"
BACKEND="${4:-pulseaudio}"
LOGLEVEL="${5:-1}"
vban_emitter -i $TARGET -p $PORT -s $STREAM -b $BACKEND -l $LOGLEVEL
#!/usr/bin/bash
TARGET="${1:-127.0.0.1}"
PORT="${2:-6990}"
LOGLEVEL="${3:-all=no}"
mpv --msg-level=$LOGLEVEL --no-cache --untimed --no-demuxer-thread --video-sync=audio --vd-lavc-threads=1 udp://$TARGET:$PORT
#!/usr/bin/bash
TARGET="${1:-127.0.0.1}"
PORT="${2:-6990}"
LOGLEVEL="${3:-quiet}"
ffmpeg -loglevel $LOGLEVEL -f x11grab -s 1366x768 -framerate 60 -i :0.0 -vaapi_device /dev/dri/renderD128 -vf 'format=nv12,hwupload,scale_vaapi=w=1366:h=768' -c:v h264_vaapi -qp:v 26 -bf 0 -tune zerolatency -f mpegts udp://$TARGET:$PORT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment