install ffserver for streaming with libx264 and mp3lame on ubuntu
2013-01-07 16:12
579 查看
In this article I want to explain how to install ffserver for streaming with libx264 and mp3lame on ubuntu 12.04 with clean process.
1) Download FFMpeg ( ffmpeg-0.6.6 )
2) Install libx264-dev, libmp3lame-dev, libasound2-dev from distribution repository
3) ./configure --enable-gpl --enable-libx264 --enable-libmp3lame and make
4) Use this as config file for ffserver and put it into doc directory as
ffserver.conf
Port 9090
BindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 10000
CustomLog -
NoDaemon
File /tmp/feed1.ffm
FileMaxSize 100M
ACL allow 127.0.0.1
Feed feed1.ffm
Format flv
#audio AudioBitRate 64
AudioChannels 1
AudioSampleRate 11025
AVOptionAudio flags +global_header
#video
VideoBitRate 256
VideoBufferSize 400
VideoFrameRate 25
VideoBitRateTolerance 100
VideoSize 704x480
VideoGopSize 12
AudioCodec libmp3lame
VideoCodec libx264
AVOptionVideo coder 0
AVOptionVideo bf 0
AVOptionVideo flags2 +mixed_refs+fastpskip
AVOptionVideo flags +loop
AVOptionVideo cmp +chroma
AVOptionVideo partitions +parti8x8+parti4x4+partp8x8+partb8x8
AVOptionVideo me_method hex
AVOptionVideo subq 7
AVOptionVideo me_range 16
AVOptionVideo g 250
AVOptionVideo keyint_min 10
AVOptionVideo sc_threshold 40
AVOptionVideo i_qfactor 0.71
AVOptionVideo b_strategy 1
AVOptionVideo qcomp 0.6
AVOptionVideo qmin 10
AVOptionVideo qmax 51
AVOptionVideo qdiff 4
AVOptionVideo refs 3
AVOptionVideo directpred 1
AVOptionVideo trellis 1
AVOptionVideo wpredp 0
AVOptionVideo flags +global_header
#NoAudio
#NoVideo
#VideoQMin 1
#VideoQMax 31
#Preroll 5
StartSendOnKey
Feed feed1.ffm
Format swf
#audio
AudioBitRate 64
AudioChannels 1
AudioSampleRate 11025
AVOptionAudio flags +global_header
#video
VideoBitRate 256
VideoBufferSize 400
VideoFrameRate 25
VideoBitRateTolerance 100
VideoSize 704x480
VideoGopSize 12
#NoAudio
#NoVideo
#VideoQMin 1
#VideoQMax 31
#Preroll 5
StartSendOnKey
Format status
# Only allow local people to get the status
ACL allow localhost
ACL allow 192.168.0.0 192.168.255.255
# Redirect index.html to the appropriate site
URL http://www.ffmpeg.org/
#this permit to obtain 2 streams, one for flv streaming (h264+mp3) and the other for swf streaming (flv+mp3)
5) Run ./ffserver -f doc/ffserver.conf
6) Now the source
Axis camera 232D+: use './ffmpeg -i rtsp://192.168.0.35/mpeg4/media.amp -f alsa -ac 2 -i hw:0,0 http://127.0.0.1:9090/feed1.ffm' command line for connect ffserver with axis camera video using pc sound card as sound input
Axis camera M-1031W: use './ffmpeg -i rtsp://192.168.0.95/axis-media/media.amp http://127.0.0.1:9090/feed1.ffm' command line for connect ffserver with axis camera video/sound
File: use this command line for streaming a file live './ffmpeg -i /home/dexmac/record.avi http://127.0.0.1:9090/feed1.ffm'
7) For live view use videolan (install it from ubuntu repository) with address http://127.0.0.1:9090/test1.flv or test1.swf, if you well done, you may see your stream
8) If you want to put this on line use flowplayer and follow my "streaming with flowplayer and ffserver" how-t
1) Download FFMpeg ( ffmpeg-0.6.6 )
2) Install libx264-dev, libmp3lame-dev, libasound2-dev from distribution repository
3) ./configure --enable-gpl --enable-libx264 --enable-libmp3lame and make
4) Use this as config file for ffserver and put it into doc directory as
ffserver.conf
Port 9090
BindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 10000
CustomLog -
NoDaemon
File /tmp/feed1.ffm
FileMaxSize 100M
ACL allow 127.0.0.1
Feed feed1.ffm
Format flv
#audio AudioBitRate 64
AudioChannels 1
AudioSampleRate 11025
AVOptionAudio flags +global_header
#video
VideoBitRate 256
VideoBufferSize 400
VideoFrameRate 25
VideoBitRateTolerance 100
VideoSize 704x480
VideoGopSize 12
AudioCodec libmp3lame
VideoCodec libx264
AVOptionVideo coder 0
AVOptionVideo bf 0
AVOptionVideo flags2 +mixed_refs+fastpskip
AVOptionVideo flags +loop
AVOptionVideo cmp +chroma
AVOptionVideo partitions +parti8x8+parti4x4+partp8x8+partb8x8
AVOptionVideo me_method hex
AVOptionVideo subq 7
AVOptionVideo me_range 16
AVOptionVideo g 250
AVOptionVideo keyint_min 10
AVOptionVideo sc_threshold 40
AVOptionVideo i_qfactor 0.71
AVOptionVideo b_strategy 1
AVOptionVideo qcomp 0.6
AVOptionVideo qmin 10
AVOptionVideo qmax 51
AVOptionVideo qdiff 4
AVOptionVideo refs 3
AVOptionVideo directpred 1
AVOptionVideo trellis 1
AVOptionVideo wpredp 0
AVOptionVideo flags +global_header
#NoAudio
#NoVideo
#VideoQMin 1
#VideoQMax 31
#Preroll 5
StartSendOnKey
Feed feed1.ffm
Format swf
#audio
AudioBitRate 64
AudioChannels 1
AudioSampleRate 11025
AVOptionAudio flags +global_header
#video
VideoBitRate 256
VideoBufferSize 400
VideoFrameRate 25
VideoBitRateTolerance 100
VideoSize 704x480
VideoGopSize 12
#NoAudio
#NoVideo
#VideoQMin 1
#VideoQMax 31
#Preroll 5
StartSendOnKey
Format status
# Only allow local people to get the status
ACL allow localhost
ACL allow 192.168.0.0 192.168.255.255
# Redirect index.html to the appropriate site
URL http://www.ffmpeg.org/
#this permit to obtain 2 streams, one for flv streaming (h264+mp3) and the other for swf streaming (flv+mp3)
5) Run ./ffserver -f doc/ffserver.conf
6) Now the source
Axis camera 232D+: use './ffmpeg -i rtsp://192.168.0.35/mpeg4/media.amp -f alsa -ac 2 -i hw:0,0 http://127.0.0.1:9090/feed1.ffm' command line for connect ffserver with axis camera video using pc sound card as sound input
Axis camera M-1031W: use './ffmpeg -i rtsp://192.168.0.95/axis-media/media.amp http://127.0.0.1:9090/feed1.ffm' command line for connect ffserver with axis camera video/sound
File: use this command line for streaming a file live './ffmpeg -i /home/dexmac/record.avi http://127.0.0.1:9090/feed1.ffm'
7) For live view use videolan (install it from ubuntu repository) with address http://127.0.0.1:9090/test1.flv or test1.swf, if you well done, you may see your stream
8) If you want to put this on line use flowplayer and follow my "streaming with flowplayer and ffserver" how-t
相关文章推荐
- Streaming media with ffserver
- 关于利用ffserver搭建RTSP服务的代码 Streaming with FFServer
- with ffmpeg to encode video for live streaming and for recording to files for on-demand playback
- Install and Run NATS Streaming Server
- Setting Up A PXE Install Server For Multiple Linux Distributions and WinPE On Debian Lenny
- libevent for echo server and client
- MS SQL错误:SQL Server failed with error code 0xc0000000 to spawn a thread to process a new login or connection. Check the SQL Server error log and the Windows event logs for information about possible related problems
- Xcode 安装不了文档,出现 Could not download and install iOS 8. The certificate for this server is invalid...
- C Socket Programming for Linux with a Server and Client Example Code
- C Socket Programming for Linux with a Server and Client Example Code
- Create XML Files Out Of SQL Server With SSIS And FOR XML Syntax
- When install ”matplotlib” with ”pip”, if you get the following error, it means the “freetype” and “png” libraries needed by matplotlib are not installed:
- libevent for echo server and client
- Useful rules for compatible with FF,safari and ie8
- Install Nginx with PHP5 and MySQL (LEMP) in Ubuntu 13.10 Server
- Issue 71 - pymssql - Undefined symbols on Mac, CentOS, Redhat with pre-compiled build - A fast MS SQL Server client library for Python directly using C API instead of ODBC. It is Python DB-API 2.0 compliant. Works on Linux, *BSD, Solaris, Mac OS X and Win
- Install windows server 2008 on ESXi 5.1, add to domain and config for remote desktop
- How to debug SceneLib with Eclipse and How to install SceneLib 1.0 on Ubuntu 10.04
- Java code for authenticating into SMTP server with Auth and TLS turned on..
- Streaming media with ffserver