Is there anyone who can successfully run real time streaming with ffserver?
Asked Answered
C

2

14

I hope to stream my video camera and audio mic. using ffserver.

ffserver says it could do such, but I just can't find any working source?

If someone knows, could you please show me how it's done?

Constipation answered 24/5, 2016 at 2:7 Comment(0)
P
18

Please refer to following links:


Following is configuration of my test env:

ffserver configuration [/etc/ffserver.conf]

HttpPort 8090 
RtspPort 5554
HttpBindAddress 0.0.0.0 
MaxClients 1000 
MaxBandwidth 10000 
NoDaemon 

<Feed feed1.ffm> 
File /tmp/feed1.ffm 
FileMaxSize 5M 
</Feed> 

<Stream test.mpeg4>
Feed feed1.ffm
Format rtp
VideoCodec mpeg4
VideoFrameRate 15
VideoBufferSize 80000
VideoBitRate 100
VideoQMin 1
VideoQMax 5
VideoSize 352x288
PreRoll 0
Noaudio
</Stream>

Run ffserver like following:

ffserver -d

Start video capture from web camera:

ffmpeg -r 25 -s 352x288 -f video4linux2 -i /dev/video0 http://localhost:8090/feed1.ffm

Now you can play your stream using any rtsp client. In my example I use ffplay:

ffplay "rtsp://localhost:5554/test.mpeg4

I just tested this configuration on my laptop. And it works fine!

Pleione answered 24/5, 2016 at 10:20 Comment(5)
Thank you for answering me. It would be look idiot, I don't know well. But, that's http, not rtsp. I hope to see case of useing rtsp port.Constipation
It works! You feed to http and contact to rtsp for playing. I thought it should be fed to rtsp. Thank you so much.Constipation
I'm sorry to bother you. But,, did't you test with audio?Constipation
You have to add audio codec parameters to ffserver configuration file. And add input to ffmpeg (-f alsa -i pulse). Should work!Pleione
I'm trying like this "AudioCodec aac \ AudioBitRate 32 \ AudioSampleRate 44100 \ AVOptionAudio flags +global_header" changing codecs and option but it doesn't work..Constipation
P
2

I also try this for video and audio but neither the video nor the sound could be established.

HttpPort 8090 
RtspPort 8554
HttpBindAddress 0.0.0.0 
MaxClients 1000 
MaxBandwidth 10000 
NoDefaults

<Feed feed1.ffm> 
    File /tmp/feed1.ffm 
    FileMaxSize 5M
    ACL allow 127.0.0.1
</Feed> 

<Stream test>
    Feed feed1.ffm
    Format rtp

    #VideoCodec libx264
    #VideoFrameRate 25
    #VideoBufferSize 80000
    VideoBitRate 4000
    VideoSize 1920x1080

    AudioCodec aac
    Strict -2
    AudioBitRate 8000
    AudioChannels 2
    AudioSampleRate 44100
    AVOptionAudio flags +global_header

</Stream>

But by adding the "Noaudio", only the video is playing. How to fix the problem؟

Peeling answered 14/1, 2020 at 14:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.