arut / nginx-rtmp-module

NGINX-based Media Streaming Server
http://nginx-rtmp.blogspot.com
BSD 2-Clause "Simplified" License
13.35k stars 3.51k forks source link

RTSP stream to RTMP through ffmpeg stream not working #1353

Open solancer opened 5 years ago

solancer commented 5 years ago

I'm trying to convert a RTSP stream to RTMP through exec_pull inside RTMP application block. there are no errors but the stream doesn't work when I try to access it from VLC network stream.

Below is my configuration file.

user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
        worker_connections 768;
        # multi_accept on;
}

http {

        ##
        # Basic Settings
        ##

        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 65;
        types_hash_max_size 2048;
        # server_tokens off;

        # server_names_hash_bucket_size 64;
        # server_name_in_redirect off;

        include /etc/nginx/mime.types;
        default_type application/octet-stream;

        ##
        # SSL Settings
        ##

        ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
        ssl_prefer_server_ciphers on;

        ##
        # Logging Settings
        ##

        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;

        ##
        # Gzip Settings
        ##

        gzip on;

        # gzip_vary on;
        # gzip_proxied any;
        # gzip_comp_level 6;
        # gzip_buffers 16 8k;
        # gzip_http_version 1.1;
        # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

        ##
        # Virtual Host Configs
        ##

        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;
}

#mail {
#       # See sample authentication script at:
#       # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
#       # auth_http localhost/auth.php;
#       # pop3_capabilities "TOP" "USER";
#       # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
#       server {
#               listen     localhost:110;
#               protocol   pop3;
#               proxy      on;
#       }
#
#       server {
#               listen     localhost:143;
#               protocol   imap;
#               proxy      on;
#       }
#}

rtmp {
 exec_options on;
 access_log /var/log/nginx/rtmp_access.log;
 server {
       listen 8089;
       #notify_method get;
       application live {
           live on;
           exec_pull ffmpeg -i rtsp://10.x.x.x:8554/Stream1 -threads 2 -f flv -r 25 -s 1280x720 -an rtmp://localhost:8089/stream;
       }
   }
}
dio99 commented 2 years ago

hellu did u get this working ? im also trying to pull from rtsp and then to rtmp i also want it to be able to use dash or hls player that i get working when i use push and src feed from OBS but when i change to pull from rtsp i dont get it working

mikeydiamonds commented 1 year ago

Just refreshing this question in case someone found the magic config to transform rtsp from an IP camera.

dio99 commented 1 year ago

im using exec_static that seems working fine :)

Just refreshing this question in case someone found the magic config to transform rtsp from an IP camera.