Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
create a "sound" server
#1
Hello,
I have a mic connected to my pi
and up until now - when I wanted to hear from the mic I have run this command
ffmpeg -ar 44100 -ac 1 -f alsa -i plughw:1,0 -f wav -listen 1 tcp://0.0.0.0:5002
then I have enter this url in vlc
tcp://10.0.0.1:5002
and I manage to hear
2 problems:
1. I had to connect to the pi (ssh) each time and run the command
2. when I shutdown the VLC , the ffmpeg went down and this is the error message I got:

av_interleaved_write_frame(): Broken pipe 682.1kbits/s speed=1.03x
Error writing trailer of tcp://0.0.0.0:5002: Broken pipe
size=   66181kB time=00:13:14.77 bitrate= 682.1kbits/s speed=1.03x
video:0kB audio:66181kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Conversion failed!
is there something I can do in order to make the ffmpeg stay online and "wait" for clients?

Thanks,
Reply
#2
You could perhaps start with the ffmpeg tcp procotol documentation. An example is given
Output:
ffmpeg -i input -f format tcp://hostname:port?listen ffplay tcp://hostname:port
It seems that your syntax for 'listen' is not correct and also that you could try listen=2 to allow multiple connections.
Reply
#3
Ok
but when I run with "2"
ffmpeg -ar 44100 -ac 1 -f alsa -i plughw:1,0 -f wav -listen 2 tcp://0.0.0.0:5002
I'm unable to connect and hear anything
when I change it back to "1"
I can hear the sound
Reply
#4
Is there any difference if you write tcp://0.0.0.0:5002?listen=2 instead of -listen 2 tcp://0.0.0.0:5002?
Reply
#5
same thing
ffmpeg -ar 44100 -ac 1 -f alsa -i plughw:1,0 -f wav tcp://0.0.0.0:5002?listen=2
It won't start - got stuck here
Guessed Channel Layout for Input Stream #0.0 : mono
Input #0, alsa, from 'plughw:1,0':
  Duration: N/A, start: 1664365143.171021, bitrate: 705 kb/s
    Stream #0:0: Audio: pcm_s16le, 44100 Hz, mono, s16, 705 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s16le (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to take the tar backup files form remote server to local server sivareddy 0 1,895 Jul-14-2021, 01:32 PM
Last Post: sivareddy

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020