开源免费O2OA办公:如何搭建流媒体服务器(rtmp+ffmgp)

news/2024/7/20 22:08:10 标签: github, java, android, ios

1. 安装nginx

下载 nginx 1.7.11.3 Gryphon
下载链接: nginx-win.ecsds.eu/download/ng…

解压到 D:\ffmpgtest\nginx目录

 

2. 下载 nginx-rtmp-module

下载链接:github.com/arut/nginx-…

解压后到nginx目录下

image.png

 

image.png

 

配置文件 conf\nginx-win.conf 内容如下:

#user  nobody;
# multiple workers works !
worker_processes  2;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  8192;
    # max value 32768, nginx recycling connections+registry optimization = 
    #   this.value * 20 = max concurrent connections currently tested with one worker
    #   C1000K should be possible depending there is enough ram/cpu power
    # multi_accept on;
}

rtmp {
    server {
        listen 1935;
        chunk_size 4000;
        application live {
             live on;
 
             # record first 1K of stream
             record all;
             record_path /tmp/av;
             record_max_size 1K;
 
             # append current timestamp to each flv
             record_unique on;
 
             # publish only from localhost
             allow publish 127.0.0.1;
             deny publish all;
 
             #allow play all;
        }
    }
}


http {
    #include      /nginx/conf/naxsi_core.rules;
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr:$remote_port - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

#     # loadbalancing PHP
#     upstream myLoadBalancer {
#         server 127.0.0.1:9001 weight=1 fail_timeout=5;
#         server 127.0.0.1:9002 weight=1 fail_timeout=5;
#         server 127.0.0.1:9003 weight=1 fail_timeout=5;
#         server 127.0.0.1:9004 weight=1 fail_timeout=5;
#         server 127.0.0.1:9005 weight=1 fail_timeout=5;
#         server 127.0.0.1:9006 weight=1 fail_timeout=5;
#         server 127.0.0.1:9007 weight=1 fail_timeout=5;
#         server 127.0.0.1:9008 weight=1 fail_timeout=5;
#         server 127.0.0.1:9009 weight=1 fail_timeout=5;
#         server 127.0.0.1:9010 weight=1 fail_timeout=5;
#         least_conn;
#     }

    sendfile        off;
    #tcp_nopush     on;

    server_names_hash_bucket_size 128;

## Start: Timeouts ##
    client_body_timeout   10;
    client_header_timeout 10;
    keepalive_timeout     30;
    send_timeout          10;
    keepalive_requests    10;
## End: Timeouts ##

    #gzip  on;

    server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        ## Caching Static Files, put before first location
        #location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
        #    expires 14d;
        #    add_header Vary Accept-Encoding;
        #}

# For Naxsi remove the single # line for learn mode, or the ## lines for full WAF mode
        location / {
            #include    /nginx/conf/mysite.rules; # see also http block naxsi include line
            ##SecRulesEnabled;
              ##DeniedUrl "/RequestDenied";
              ##CheckRule "$SQL >= 8" BLOCK;
              ##CheckRule "$RFI >= 8" BLOCK;
              ##CheckRule "$TRAVERSAL >= 4" BLOCK;
              ##CheckRule "$XSS >= 8" BLOCK;
            root   html;
            index  index.html index.htm;
        }

        location /stat {
            rtmp_stat all;
            rtmp_stat_stylesheet stat.xsl;
        }
        location /stat.xsl {
            root nginx-rtmp-module/;
        }
        location /control {
            rtmp_control all;
        }

# For Naxsi remove the ## lines for full WAF mode, redirect location block used by naxsi
        ##location /RequestDenied {
        ##    return 412;
        ##}

## Lua examples !
#         location /robots.txt {
#           rewrite_by_lua '
#             if ngx.var.http_host ~= "localhost" then
#               return ngx.exec("/robots_disallow.txt");
#             end
#           ';
#         }

        #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; # single backend process
        #    fastcgi_pass   myLoadBalancer; # or multiple, see example above
        #    fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME  $document_root$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 spdy;
    #    server_name  localhost;

    #    ssl                  on;
    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

    #    ssl_session_timeout  5m;

    #    ssl_prefer_server_ciphers On;
    #    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    #    ssl_ciphers ECDH+AESGCM:ECDH+AES256:ECDH+AES128:ECDH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!eNULL:!MD5:!DSS:!EXP:!ADH:!LOW:!MEDIUM;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

}
复制代码

启动nginx服务器

在nginx目录启动服务

image.png

启动命令

nginx.exe -c conf\nginx-win.conf复制代码

 

3.下载ffmpeg

下载链接:ffmpeg.zeranoe.com/builds/win6…

解压到任意目录下,我自己放在了d盘的ffmpegtest目录下。

image.png

配置环境变量

image.png

好了,可以推送一个流了。

 

ffmpeg.exe  -re -i D:\WHYQ.mp4 -f flv -c copy -flvflags no_duration_filesize rtmp://localhost:1935/live/test复制代码

 

image.png

正在推送

 

推送完毕,VLC播放器先试一下。

image.png

推送,拉取都可以。

 

后面讲如何在o2的页面上嵌入流媒体播放器。

(转自公众号:浙江兰德网络)


作者:O2OA
链接:https://juejin.im/post/5f0828af6fb9a07e8646efca
来源:掘金
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。


http://www.niftyadmin.cn/n/953362.html

相关文章

O2OA开源免费办公平台:在PAAS平台上部署O2OA开发平台

一、镜像制作 1、将安装介质o2server-5.0.3-linux.zip上传至镜像制作服务器上。(上传目录为/paas/xxhpaas/moka/o2oa) 2、使用unzip命令解压安装包,参考命令:unzip o2server-5.0.3-linux.zip 3、制作DockerFile文件,文件内容如下&#xff…

一套开源免费的办公OA软件,会有什么样的线上办公功能?

1.手机随时随地办公 使用办公OA软件后,手机就是一个线上的移动应用库,除了最基础的移动打卡、日程安排、在线沟通这几个基本功能,还有任务分配、合同签署、在线会议、工作管理、论坛、邮件等功能等许多的办公应用,都是开箱即得。…

如何使用华为弹性云服务器部署O2OA V5?

使用华为云合作伙伴O2OA的邀请注册或者关联华为云账号后购买主机会更加优惠哦。 点击此处即可跳转华为云 购买ECS主机 登录华为云控制台 选择服务提供区域和主机 选择操作系统镜像和磁盘 网络配置 高级配置 确认配置 系统正在生成订单 支付订单后即完成ECS创建 查看服务器信息…

从OA系统到开源免费的OA系统,你需要了解什么?

一、OA系统是什么? 办公自动化(Office Automation,简称OA),是将计算机、通信等现代化技术运用到传统办公方式,进而形成的一种新型办公方式。 利用现代化设备和信息化技术实现办公的自动化,代替…

一套政务OA系统,助力高效线上办公

因为工作流程复杂,人民群众需求多样,政务工作中,政府工作人员虽然看似“轻松”,实际上堆积如山的加班和会议常常将工作进度拖垮,工作效率也常常为人诟病。 公文收文、公文发文、流转审批、任务管理、督查督办、会议管…

一部手机,一台电脑,能够比坐在办公室里办公能高效?

办公,真的一定要坐在办公室吗? 随着社会的发展,各行各业都展现出各自的职业特色,社会信息化普及更是推动了工种的多样化衍生,而工种的多样化又让移动办公开始风靡。 ​比如记者、编辑、翻译、导游、设计师、社区工作人…

选择OA,终极“避雷”方法来啦!

企业在选择OA时,看完产品介绍之后,接下来就会选择“在线试用”、“免费使用”等等试用机会。 最后试用了几家,发现使用起来功能也差不了多少,甚至都有点大同小异。虽然每一家都有各自标榜的特色、优点,但是从试用环节…

世界500强企业,电信行业龙头——缘何选择O2OA办公系统?

客户介绍: 中国移动通信集团有限公司(英文名称:China Mobile Communications Group Co.,Ltd,简称“中国移动”、“CMCC”或“中国移动通信”、“中移动”)是按照国家电信体制改革的总体部署,于2000年4月20…