# Remote Controller Spring Application **Repository Path**: ma4567/remote-controller-spring-application ## Basic Information - **Project Name**: Remote Controller Spring Application - **Description**: Remote Controller的后端部分 - **Primary Language**: Java - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 0 - **Created**: 2024-11-01 - **Last Updated**: 2024-12-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: Java, Spring, SpringBoot ## README 一、运行 1.idea打开 2.构建maven环境 3.运行 二、关于ffmpeg和nginx 1.nginx模块需求:nginx-http-flv-module和rtmp 2.java内重定向ffmpeg输出会阻塞线程,即使在子线程内重定向也会阻塞。若ffmpeg报错则进VideoRequest.VideoSourceRequest.java复制ffmpeg命令在命令行内启动,不要在java内启动。 三、点个star https://gitee.com/ma4567/remote-controller-spring-application a512413895@outlook.com nginx配置↓(复制到nginx.conf内): #user root; 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; } 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 rc.local; #charset koi8-r; #access_log logs/host.access.log main; location / { root html; index index.html index.htm; flv_live on; chunked_transfer_encoding on; #open 'Transfer-Encoding: chunked' response add_header 'Access-Control-Allow-Credentials' 'true'; #add additional HTTP header add_header 'Access-Control-Allow-Origin' '*'; #add additional HTTP header add_header Access-Control-Allow-Headers X-Requested-With; add_header Access-Control-Allow-Methods GET,POST,OPTIONS; add_header 'Cache-Control' 'no-cache'; proxy_pass http://localhost:9998; # Spring Boot应用程序端口 proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } location /live { flv_live on; } location /flv { add_header 'Access-Control-Allow-Origin' '*'; flv_live on; chunked_transfer_encoding on; } #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; #} } # another virtual host using mix of IP-, name-, and port-based configuration # #server { # listen 8000; # listen somename:8080; # server_name somename alias another.alias; # location / { # root html; # index index.html index.htm; # } #} # HTTPS server # #server { # listen 443 ssl; # server_name localhost; # ssl_certificate cert.pem; # ssl_certificate_key cert.key; # ssl_session_cache shared:SSL:1m; # ssl_session_timeout 5m; # ssl_ciphers HIGH:!aNULL:!MD5; # ssl_prefer_server_ciphers on; # location / { # root html; # index index.html index.htm; # } #} } rtmp { server { listen 1935; chunk_size 4000; application live { live on; allow play all; } } }