Http Media Streaming Server

I developed an application for streaming video with a RED5 media server (RTMP). Instead of RTMP, you need to stream live video over HTTP.

Any open source HTTP server?

Is there any open source server that supports both RTMP and HTTP?

Thanks in advance.

+6
source share
3 answers

First of all, HTTP and RTMP are different protocols. You will not use RTMP inside HTTP. (Although you can do this to solve the tunneling).

There are several ways to stream HTTP. Such as HLS, DASH, Smooth and Progresive Download. If you need to stream to iOS (iPad, iPhone, Apple TV), you will need to use HLS.

Like arcyqwerty said. Any HTTP server can serve HTTP streams. But before you start, you need to prepare your media files and manifest files.

Here are some links that are very important for reading HLS (HTTP Live Streaming):

How about open source servers. I know them:

Or you can do as I do and use GStreamer for segmentation and manifest. And finally, I use Nginx only for their maintenance.

I hope I helped you a little.

+8
source

Any HTTP server that can serve files (apache, nginx, IIS, etc.) can "transfer" media via HTTP. Therefore, if you want, you can save RED5 for RTMP and configure the HTTP server to work with the same files.

You can look in the Basics of multimedia streaming - HTTP vs RTMP for protocol information

Adding the nginx-rtmp module to nginx may be what you are looking for if you need a solution for a single product

https://github.com/arut/nginx-rtmp-module

+2
source

I use this and it works correctly. (Ubuntu 12.04 TLS server)

Step by step:

sudo apt-get install build-essential libpcre3 libpcre3-dev libssl-dev wget http://nginx.org/download/nginx-1.6.0.tar.gz wget https://github.com/arut/nginx-rtmp-module/archive/master.zip tar -zxvf nginx-1.6.0.tar.gz unzip master.zip cd nginx-1.6.0 ./configure --with-http_ssl_module --add-module=../nginx-rtmp-module-master --with-http_flv_module --with-http_mp4_module make sudo make install sudo /usr/local/nginx/sbin/nginx -s stop sudo /usr/local/nginx/sbin/nginx 

NGINX configuration: (/usr/local/nginx/conf/nginx.conf)

 #user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } rtmp { server { listen 1935; chunk_size 4000; # video on demand for flv files application vod { play /var/flvs; } # video on demand for mp4 files application vod2 { play /var/mp4s; } } } http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; gzip on; server { listen 80; server_name 192.168.52.16; #charset koi8-r; #access_log logs/host.access.log main; # This URL provides RTMP statistics in XML location /stat { rtmp_stat all; rtmp_stat_stylesheet stat.xsl; } location /stat.xsl { # XML stylesheet to view RTMP stats. # Copy stat.xsl wherever you want # and put the full directory path here root /var/www/; } location /hls { # Serve HLS fragments types { application/vnd.apple.mpegurl m3u8; video/mp2t ts; } alias /tmp/app; expires -1; } # location /hds { # f4f; # Use the HDS handler to manage requests # # serve content from the following location # alias /var/www/video; # } location /video { mp4; flv; mp4_buffer_size 4M; mp4_max_buffer_size 10M; } location / { root html; index index.html index.htm; } error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # proxy the PHP s to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP s to FastCGI server listening on 127.0.0.1:9000 # #location ~ \.php$ { # root html; # fastcgi_pass 127.0.0.1:9000; # fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; # include fastcgi_params; #} # deny access to .htaccess files, if Apache document root # concurs with nginx one # #location ~ /\.ht { # deny all; #} } } 

Save the configuration file and:

 sudo /usr/local/nginx/sbin/nginx -s stop sudo /usr/local/nginx/sbin/nginx 

Next ... Create two directories:

 mkdir /var/flvs mkdir /var/mp4s 

You need to copy the mp4 file to the mp4s directory. For example: sample.mp4

Finaly

 sudo /usr/local/nginx/sbin/nginx -s stop sudo /usr/local/nginx/sbin/nginx 

Try:

 rtmp://your_server_ip/vod2/sample.mp4 

(suppose you are using a VLC media player)

or html code

 <html> <head> <title>RTMP Video</title> <!-- flowplayer javascript component --> <script src="http://releases.flowplayer.org/js/flowplayer-3.2.12.min.js"></script> </head> <body> <div id="player" style="width:644px;height:480;margin:0 auto;text-align:center"> <img src="images/background.jpg" height="480" width="644" /></div> <script> $f("player", "http://releases.flowplayer.org/swf/flowplayer-3.2.16.swf", { clip: { url: 'sample.mp4', scaling: 'fit', provider: 'hddn' }, plugins: { hddn: { url: "swf/flowplayer.rtmp-3.2.13.swf", // netConnectionUrl defines where the streams are found netConnectionUrl: 'rtmp://your_server_ip:1935/vod2/' } }, canvas: { backgroundGradient: 'none' } }); </script> </body> </html> 
0
source

Source: https://habr.com/ru/post/959305/


All Articles