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
  • 相关阅读:
    软件工程阅读笔记02
    软件工程阅读笔记01
    四则运算二
    第十七周学习进度条
    个人总结以及建议
    写api接口神器--带你5分钟了解swagger
    nginx的配置和基本参数说明
    larval 使用redis做缓存
    Laravel——缓存使用
    开启redis-server提示 # Creating Server TCP listening socket *:6379: bind: Address already in use--解决方法
  • 原文地址:https://www.cnblogs.com/yasepix/p/14519311.html
Copyright © 2011-2022 走看看