zoukankan      html  css  js  c++  java
  • 超声和病理的web实现方案

    超声和病理的web实现方案

    1. 整体思路

    用推流的方式,从采集卡采集信息 -> ffmpeg -> nginx + rtmp -> 网页显示(现在需要flash插件,所以chrome版本不能太高)

    2. 具体软件

    Adobe Flash Player PPAPI for Chromium.7z
    ChromePortable_9669.com.rar
    ffmpeg.rar
    nginx-rtmp-win32-master.rar
    
    放在网盘ffmpeg目录下
    

    3. 实现步骤

    3.1 nginx需要有rtmp插件(百度一下)

    3.2 nginx的配置文件:

    worker_processes  1;
    
    error_log  logs/error.log debug;
    
    events {
        worker_connections  1024;
    }
    
    rtmp {
        server {
            listen 1935;
    
            application live {
                live on;
            }
    		
            application hls {
                live on;
                hls on;  
                hls_path temp/hls;  
                hls_fragment 8s;  
            }
            
                    chunk_size 4000;
    
            # TV mode: one publisher, many subscribers
            application wstv{
    
                # enable live streaming
                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 {
        server {
            listen      8080;
    		
            location / {
                root html;
            }
    		
            location /stat {
                rtmp_stat all;
                rtmp_stat_stylesheet stat.xsl;
            }
    
            location /stat.xsl {
                root html;
            }
    		
            location /hls {  
                #server hls fragments  
                types{  
                    application/vnd.apple.mpegurl m3u8;  
                    video/mp2t ts;  
                }  
                alias temp/hls;  
                expires -1;  
            }  
        }
    }
    
    

    3.3 拷一个ws2.avi文件到ffmpeg.exe目录下,执行下列命令

    ffmpeg -re -i ws2.avi -vcodec libx264 -acodec aac -f flv rtmp://localhost:1935/wstv/home

    3.4 测试一下rtmp正常么

    用vlc打开就可以看了
    rtmp://localhost:1935/wstv/home

    3.5 用chrome打开

    http://localhost:8080/
    
    爱书网:www.2ibook.com 一个优秀的视频教学网站,大学各专业的名师课程。免费,免费,免费。
    QQ群:762080163
  • 相关阅读:
    给jquery 添加触屏事件,上下左右 touchwipe插件
    node.js 安装运行
    CSS3 3D 盒子模型
    javascript 获取内联样式
    HTML5 离线存储应用案例
    swipe.js 轻松实现手机端滑动效果
    手机网页轮播切换,简易版
    多行文字垂直居中
    jquery实现简单轮播
    利用media query写响应式布局
  • 原文地址:https://www.cnblogs.com/yasepix/p/14519311.html
Copyright © 2011-2022 走看看