1

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.

Vigo
  • 707
  • 4
  • 11
  • 29
  • Can you explain how you are using FFMPEG for streaming? Show us the command you have so far? – Brad Sep 23 '13 at 16:59
  • 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 Sep 24 '13 at 06:51

1 Answers1

1

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".

Vadim Kalinsky
  • 928
  • 8
  • 18
  • Thanks for the effort in giving a code snippet. Can i not stream it using ffmpeg static builds? So here audio.avi is the file name and do i need to just add this segment in ffserver.conf and get the streaming of an audio file working? – Vigo Sep 24 '13 at 06:56