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?
ffserver has been a problematic program to maintain due to its use of internal APIs, which complicated the recent cleanups to the libavformat library, and block further cleanups and improvements which are desired by API users and will be easier to maintain.
As a simple test, just run the following two command lines where INPUTFILE is some file which you can decode with ffmpeg: ffserver -f doc/ffserver. conf & ffmpeg -i INPUTFILE http://localhost:8090/feed1.ffm At this point you should be able to go to your Windows machine and fire up Windows Media Player (WMP).
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!
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؟
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With