w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How can I use ffmpeg to stream over http

The best way to put a video available on the web, is:

1 - Transcode the video with the ffmpeg. Recommended with h264, why? Only PC browsers (except Opera) support it, is much more efficient h264 or VP8 (livpx). The call to ffmpeg should be:

  h264

ffmpeg -i input -vcodec libx264 -acodec libfaac out.mp4 

vp8

ffmpeg -i input -vcodec libvpx -acodec vorbis out.webm 

Theora

ffmpeg -i input -acodec vorbis -vcodec libtheroa out.ogg 

 

2 - Install a web server like Apache or Nginx Lighttpd

sudo apt-get install lighttpd 

3 - Link www folder with the folder out with ffmpeg ln -ls

sudo ln -ls / var / www /   / home / your_user /
path_to_out_ffmpeg 

Your method is wrong because when you have stopped ffmpeg your contents aren't avaliable. It method is only avaliable for live video.





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.