Ffmpeg: Streaming Server Sederhana: Difference between revisions

From OnnoCenterWiki
Jump to navigationJump to search
Onnowpurbo (talk | contribs)
New page: Sumber: http://www.organicdesign.co.nz/Simple_video_streaming_with_ffserver Simple video streaming with ffserver In this example we use the Logitech QuickCam Express web camera to stream...
 
Onnowpurbo (talk | contribs)
No edit summary
 
Line 1: Line 1:
Sumber: http://www.organicdesign.co.nz/Simple_video_streaming_with_ffserver
Sumber: http://www.organicdesign.co.nz/Simple_video_streaming_with_ffserver


Simple video streaming with ffserver


In this example we use the Logitech QuickCam Express web camera to stream video to web page using ffserver
Dalam contoh ini kita menggunakan Logitech QuickCam Express web camera untuk men-stream video ke halaman web menggunakan ffserver


ffserver is part of the ffmpeg package.
ffserver adalah bagian dari paket ffmpeg.


  apt-get -y install ffmpeg
  apt-get -y install ffmpeg




ffserver creates a network socket that is available from client machines to view the video. Once started, you attach an ffmpeg process to the server to do the encoding. Configuration of ffserver is done via the /etc/ffserver.conf file.
ffserver akan membuat soket network yang akan tersedia bagi mesin client untuk melihat video.
Jika dijalankan, kita dapat menempelkan proses ffmpeg ke server untuk melakukan encoding.
Konfigurasi server ffserver dilakukan melalui file /etc/ffserver.conf


Typical ffserver.conf file
Contoh file ffserver.conf


Line 46: Line 46:




To get things going, start the server
Untuk menjalankan server


  ffserver &
  ffserver &




Attach the ffmpeg process to do the encoding. This is done via a loopback socket.
Untuk menempelkan proses ffmpeg untuk melakukan encoding dapat dilakukan melalui soket loopback


Line 58: Line 57:




Parameters are
Parameter yang digunakan


     -r - rate in frames per second
     -r - rate in frames per second
Line 66: Line 65:
     Lastly the loopback socket  
     Lastly the loopback socket  


Now you should be able to browse to the server address (or localhost if it's the same machine) and see some live video.
Sekarang kita dapat browse ke server address (atau localhost kalau di mesin yang sama) dan melihat video live.


  http://localhost/test.swf  
  http://localhost/test.swf  


The name of the file will be as defined in the <Stream> section above.  
Nama file di definisikan di bagian <Stream> .  





Latest revision as of 08:26, 25 June 2014

Sumber: http://www.organicdesign.co.nz/Simple_video_streaming_with_ffserver


Dalam contoh ini kita menggunakan Logitech QuickCam Express web camera untuk men-stream video ke halaman web menggunakan ffserver

ffserver adalah bagian dari paket ffmpeg.

apt-get -y install ffmpeg


ffserver akan membuat soket network yang akan tersedia bagi mesin client untuk melihat video. Jika dijalankan, kita dapat menempelkan proses ffmpeg ke server untuk melakukan encoding. Konfigurasi server ffserver dilakukan melalui file /etc/ffserver.conf

Contoh file ffserver.conf


Port 8090 
# bind to all IPs aliased or not 
BindAddress 0.0.0.0 
# max number of simultaneous clients 
MaxClients 1000 
# max bandwidth per-client (kb/s) 
MaxBandwidth 10000 
# Suppress that if you want to launch ffserver as a daemon. 
NoDaemon 

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

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


Untuk menjalankan server

ffserver &


Untuk menempelkan proses ffmpeg untuk melakukan encoding dapat dilakukan melalui soket loopback


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


Parameter yang digunakan

   -r - rate in frames per second
   -s size in pixels width x height (width must be a multiple of 16) and should match the values in the above config file.
   -f gets input from the video4linux driver
   -i is the v4l device (if this is not present refer to Logitech QuickCam Express)
   Lastly the loopback socket 

Sekarang kita dapat browse ke server address (atau localhost kalau di mesin yang sama) dan melihat video live.

http://localhost/test.swf 

Nama file di definisikan di bagian <Stream> .


Referensi