Using ffmpeg we can do conversion from one format to another. Install ffmpeg http://jonhall.info/how_to/setup_and_use_ffmpeg_on_windows . (follow this link, no need to work on both 32 bit and 64 bit, just do for 64 bit and create bat file for ffplay as well)
The command to play live stream is
ffplay rtmps://stream-delta.dropcam.com/nexus/a203d89605a4454a94caed1b16024f79
The command to save live stream on local system is (duration 10 seconds ) -
ffmpeg -i rtmps://stream-delta.dropcam.com/nexus/a203d89605a4454a94caed1b16024f79 -r 5 -t 10 C:\Users\chitode\Downloads\test.mp4
The formats supported by setbox are HLS, rtsp, mss (Microsoft Smooth Streaming). Hence we need to convert rtmp to either of these formats.
I tried to use “Nimble streamer” but its giving permission errors while installing
2. Rtmp to rtsp can be done using wowza. I have started to look into will inform the update soon.
3. I haven’t worked on mss yet.
I will work on the conversion part on weekend.
Some use full links
So I installed on my fedora 23 (64bit) machine and it works well (my home linux is also fc 23-64 and works well).
I’d recommend to use fc 23-64.
Please see bottom of this email about the issue I currently have, help me!
(1) ffmpeg
rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm
dnf install ffmpeg
(2) nginx: should install from source to use rtmp module
· openssl:
wget http://www.openssl.org/source/openssl-1.0.2f.tar.gz
cd openssl-1.0.2f
./Configure linux-x86_64 --prefix=/usr
make; sudo make install
· pcre
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.40.tar.gz
./configure; make; sudo make install
· zlib
wget http://zlib.net/zlib-1.2.11.tar.gz
./configure; make; sudo make install
· Finally nginx
wget http://nginx.org/download/nginx-1.11.9.tar.gz
./configure --add-module=../nginx-rtmp-module-master --with-http_ssl_module
make; sudo make install
(3) Nginx setup
· sudo mkdir /tmp/HLS
· sudo mkdir /tmp/HLS/cam
o You will see files in /tmp/HLS/cam/nest once you start nginx.
· cd /usr/local/nginx/conf/ and sudo vi nginx.conf and add followings:
rtmp {
server {
listen 1935;
allow play all;
chunk_size 4000;
# video on demand for flv files
application cam {
allow play all;
live on;
hls on;
hls_nested on;
hls_path /tmp/HLS/cam;
hls_fragment 10s;
exec_static ffmpeg -i rtmps://stream-delta.dropcam.com/nexus/a203d89605a4454a94caed1b16024f79 -c:v libx264 -an -f flv rtmp://localhost:1935/cam/nest;
}
# video on demand for mp4 files
application vod {
allow play all;
play /home/yjpark/www/nginx/mp4s;
}
application hls {
live on;
hls on;
hls_path /tmp/HLS;
}
}
}
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 8090;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /home/yjpark/www/nginx/html;
index index.html index.htm;
}
#creates the http-location for our full-resolution (desktop) HLS stream - "http://my-ip/cam/nest/index.m3u8"
location /cam {
types {
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
alias /tmp/HLS/cam;
add_header Cache-Control no-cache;
}
#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 scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts 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's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
}
(4) check http ports
sudo semanage port -l | grep http_port_t
http_port_t tcp 8090, 80, 81, 443, 488, 8008, 8009, 8443, 9000
pegasus_http_port_t tcp 5988
If you don’t see
sudo semanage port -a -t http_port_t -p tcp 8090
(5) start nginx
sudo /usr/local/nginx/sbin/nginx
(6) if you change any config, restart nginx by:
sudo /usr/local/nginx/sbin/nginx -s stop
sudo /usr/local/nginx/sbin/nginx
(7) Play with rtmp
Open VLC and give rtmp://yjpark-linux-02.hq.k.grp:1935/cam/nest.
(8) Play with hls
http://yjpark-linux-02.hq.k.grp:8090/cam/nest/index.m3u8
Now, VLC still complains about index.m3u8 and ts files.
Can anyone help me while I’m working on something else?