1

Im using tricks from following link and able to record audio into file Record a program's output with PulseAudio

I have been tweaking commands and trying to stream bytes to a UDP server. This is what i have got so far which does not work

parec -d sink_name.monitor | ffmpeg -re -ac 1 -f s16le -ar 16000  -i - - | ffmpeg -re -i - -f mpegts udp://localhost:20001
  1. First command provides the audio stream
  2. This command is partially used to store stream in .mp3 file refer-ffmpeg -ac 1 -f s16le -ar 44100 -i - test.mp3
  3. This should redirect stream to UDP - from ffmpeg -ac 1 -f s16le -ar 44100 -i - test.mp3

I could use some help here. Thanks in advance!

NotABot
  • 151

1 Answers1

0

After tweaking around the existing command I figured it out-

parec --format=s16le -d sink_name.monitor | lame -r -a --quiet -b 18 -B 18 - | ffmpeg -re -i - -f s16le udp://localhost:20001

All three commands explained below -

  1. First command accesses the audio from sound cards and streams to 2nd command in s16le PCM format
  2. Second, lame changes bit rate to 18 kbps
  3. Third, ffmpeg streams live to udp server
NotABot
  • 151