1
votes

I have a requirement to stream contents of an audio file which is constantly being updated using ffmpeg to another computer on the same LAN. I have downloaded ffmpeg static builds for Windows. I understand the way to specify destination IP address and port number in the 'ffmpeg' command. But i cannot figure out how to specify the file name that is to be streamed. How to go about it?

There is no condition on the format of the audio file. It could be of any format.

1
Can you explain how you are using FFMPEG for streaming? Show us the command you have so far?Brad
i used the command "ffmpeg -re -f lavfi -i aevalsrc="sin(400*2*PI*t)" -ar 8000 -f mulaw -f rtp rtp://10.14.35.23:1234" for streaming at the sender. For playing the received data, i used "ffplay rtp://10.14.35.24:1234". This was to generate an audio and then send. What if i already have an audio file (not necessarily WAV file)? How to stream it?Vigo

1 Answers

1
votes

WAV-file is not the best tool to buffer encoded data for further streaming.

I would prefer to use ffserver. The idea is that ffmpeg encodes stream and uploads it onto ffserver's "feed file", and clients (e.g. your "remote computer") are getting the stream (it may be the same stream in different formats) from ffserver by http or rtsp (rtp).

Just add audio stream there, connect ffmpeg to its feed and connect that remote computer to the stream:

  • Define single stream in ffserver.conf:

    <Stream audio.sdp>
    Feed feed1.ffm
    Format rtp
    
    NoVideo
    AudioCodec libmp3lame
    AudioBitRate 64
    AudioSampleRate 22050
    </Stream>
    

or AVI (MPEGTS, FLV, whatever)

    <Stream audio.avi>
    Feed feed1.ffm
    Format avi
    ...
  • start audio encoding/uploading to the server:

    ffmpeg -i [Your source] http://localhost:[ffserver's port]/feed1.ffm
    
  • start getting rtp (avi, etc) stream on that "remote computer".