tiras muturi
tiras muturi

Reputation: 81

FFmpeg play audio stream on a browser

Hey guys i have a live stream that is served by the ffserver but i want the stream to be playable on a browser since i have a website and i also want to play the stream in an android app. Most importantly the android device.

i want if i type this on a browser then i can be able to listen to the stream there and then.

http://localhost:8090/test1.mp3

if i put the link in vlc am able to receive the stream.

Anyone with this workaround please assist me.

Upvotes: 2

Views: 1296

Answers (1)

tiras muturi
tiras muturi

Reputation: 81

This means that you are already good to go. if you put the link on a player in an android device you will be able to play the content of that stream. for you to stream it in a browser just install a web player and then put the source of the player to be your link ie http://yourffmpegserverip:8090/test1.mp3

NB

the ffserver should be running for you to be able to stream the content. you can simply

ffserver -f -d /etc/ffserver.conf

the location of my ffserver.conf is /etc/ffserver.conf

<Stream test1.mp3>
 Feed feed1.ffm
 format mp3
 #AudioCodec mp3
 AudioBitRate 256
 AudioChannels 2
 AudioSampleRate 44100
 NoVideo
</Stream>

if your stream is only audio only make sure that your stream block has the following

format mp3

i had used format is mp2 and some android devices could not play my stream. Right now its wonderful.

Upvotes: 1

Related Questions