Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save gamanakis/95e8d1a6429c5a87dcd1699390536771 to your computer and use it in GitHub Desktop.
Save gamanakis/95e8d1a6429c5a87dcd1699390536771 to your computer and use it in GitHub Desktop.
Streaming audio output from Linux (Pulseaudio) to Windows
# Windows (receiver) side:
.\ffplay.exe -nodisp -ac 2 -acodec pcm_u8 -ar 48000 -analyzeduration 0 -probesize 32 -f u8 -i udp://0.0.0.0:18181?listen=1
# Linux (transmitter) side:
pactl load-module module-null-sink sink_name=remote
ffmpeg -f pulse -i "remote.monitor" -ac 2 -acodec pcm_u8 -ar 48000 -f u8 "udp://RECEIVER:18181"
pavucontrol # Change the default output to the Null sink or move single applications to this "output" device.
@gamanakis
Copy link
Author

gamanakis commented Mar 20, 2020

16bit uncompressed stream
Windows (receiver) side:

.\ffplay -nodisp -ac 2 -acodec pcm_s16le -ar 48000 -analyzeduration 0 -probesize 32 -f s16le -i udp://0.0.0.0:18181?listen=1

Linux (transmitter) side:

pactl load-module module-null-sink sink_name=remote
ffmpeg -f pulse -i "remote.monitor" -ac 2 -acodec pcm_s16le -ar 48000 -f s16le "udp://<RECEIVER'S IP ADDRESS>:18181"

@morin-zoom
Copy link

ffmpeg -fflags nobuffer -flags low_delay -f pulse -i "remote.monitor" -ac 2 -acodec pcm_s16le -ar 48000 -f s16le "udp://<RECEIVER'S IP ADDRESS>:18181"
no more lags ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment