环境 Windows 10

大华rtsp直播 转 http请求m3u8

ffmpeg -rtsp_transport tcp -i "rtsp://账号:密码@IP:端口/cam/realmonitor?channel=1&subtype=0" -fflags flush_packets -max_delay 1 -an -flags -global_header -hls_time 1 -hls_list_size 3 -hls_wrap 3 -vcodec copy -s 216x384 -b 1024k -y C:/Users/lenovo/Downloads/live/nginx-1.12.2/nginx-1.12.2/html/channel101.m3u8

nginx.conf 中内容如下:

#user  nobody;
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       20000;
        server_name  localhost;

#charset koi8-r;

#access_log  logs/host.access.log  main;

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

location /hls {  
    types{  
    application/vnd.apple.mpegurl m3u8;  
    video/mp2t ts;  
    }  
    root html;  
    add_header Cache-Control no-cache;
        add_header Access-Control-Allow-Origin *;

}

#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;
    #    }
    #}

}

启动nginx 用vlc播放器播放 http://localhost:20000/channel101.m3u8

记录:通过ffmpeg rtsp转 http m3u8的更多相关文章

  1. FFmpeg RTSP流通过UDP传输问题

    我自己在使用SRS服务的Ingest功能时发现在读取一个网络摄像头的RTSP流时一直不成功, 具体分析后发现SRS在调用FFmpeg时出了问题: /usr/local/ffmpeg/bin/ffmpe ...

  2. 流媒体测试笔记记录之————解决问题video.js 播放m3u8格式的文件,根据官方的文档添加videojs-contrib-hls也不行的原因解决了

    详细代码Github:https://github.com/Tinywan/PHPSharedLibrary/tree/master/Tpl/Html5/VideoJS 想播放hls协议的就是m3u8 ...

  3. Windows平台下使用ffmpeg和segmenter实现m3u8直播点播

    1.安装windows media service 实现 流媒体服务器功能   2.windows media编码器 实现 直播推流   3.使用 vlc 将 mms://127.0.0.1/live ...

  4. ffmpeg+rtsp+dss

    1. push stream to dss ffmpeg -f mpegts -re -i film.v -c:v libx264 -s 352x288 -aspect 4:3 -b:v 300k - ...

  5. js --- ffmpeg rtsp 推流,websocket通信,cnavas 渲染

    首先选择正确的ffmpeg包 百度搜索ffmpeg官网,点击进入下图所示. 点击download,进入下载页面,选择window,window下面只有一个builds版本,如图红线部分圈出来的 点击b ...

  6. 工作记录--使用FFmpeg将一个视频文件中音频合成到另一个视频中

    由于工作需要,临时被老大吩咐去研究一个FFmpeg工具,通过linux命令行去将一个视频中的音频提取出来并合成到另一个视频中,最终的效果是要保证2个视频中的音频都在一个视频中播放. 但是本人对FFmp ...

  7. 如何下载某些 flash 在线视频 并使用ffmpeg下载分段并加密的m3u8视频流

    有些网站使用 flash 在线播放视频,不方便进行下载. 可以使用 Chrome 的 Developer Tools 模拟成 iOS 设备(通过修改 User Agent),然后取得 h.264 视频 ...

  8. 一个基于JRTPLIB的轻量级RTSP客户端(myRTSPClient)——解码篇:(一)用ffmpeg解码视频

    一.概述 myRTSPClient(RTSPClient)获取音视频数据之后,接下来的工作便是将音视频数据交给解码器去解码(ffmpeg),ffmpeg解码之后于是便有了呈现在终端用户(USER)面前 ...

  9. ffmpeg m3u8 转 MP4

    ffmpeg -i 你的m3u8地址 -acodec copy -vcodec copy -f mp4 output.mp4

随机推荐

  1. 不使用 if-elif 语句,如何优雅地判断某个数字所属的等级?

    偶然看到了 stackoverflow 上的一个问题,还挺有启发,故分享一下. 题目大意是:有从 A 到 F 的 5 个等级,现要判断某个数值(从 0 到 1 之间)所属的等级.举例,如数值 > ...

  2. F - Robot Motion 栈加BFS

    A robot has been programmed to follow the instructions in its path. Instructions for the next direct ...

  3. A - Chat Group Gym-101775A

    题目连接:https://codeforces.com/gym/101775/problem/A 题解:就是累加组合数 但是直接由K累加到N肯定会TLE ,所以我们不妨判断不能组成group的情况,即 ...

  4. Django开发文档-域用户集成登录

    项目概述: 一般在企业中,用户以WINDOWS的域用户统一的管理,所以以Django快速开发的应用,不得不集成AD域登录. 网上一般采用django-python3-ldap的库来做集成登录,但是本方 ...

  5. 【山外笔记-SVN命令】svnlook命令详解

    本文打印版问文件下载地址 [山外笔记-SVN命令]svnlook命令详解-打印版.pdf 一.命令简介 svnlook是检验Subversion版本库不同方面的命令行工具,不会对版本库有任何修改,只是 ...

  6. pytorch seq2seq模型中加入teacher_forcing机制

    在循环内加的teacher forcing机制,这种为目标确定的时候,可以这样加. 目标不确定,需要在循环外加. decoder.py 中的修改 """ 实现解码器 &q ...

  7. 用scrapy实现模拟登陆

    class Test1sSpider(scrapy.Spider): name = 'test1s' allowed_domains = ['yaozh.com'] start_urls = ['ht ...

  8. ambarella H2平台fpga捕捉卡驱动案例

    公司最近开发的一款产品用到了ambarella H2平台的一款Soc,众所周知ambarella的H2系列的Soc编码能力很强,最高可达4kp60,捕捉上没有用ambarella开发板推荐的几个捕捉卡 ...

  9. WebApi参数检查验证FluentValidation的使用方法

    右键打开NuGet程序包管理,进入浏览,搜索 FluentValidation,点击下载 在Model文件夹添加一个Person类进行校验 校验前,using需要引入相应的命名空间方可使用,Abstr ...

  10. [Qt] 打开Diskmgmt

    QProcess mOpenDiskMgmt; QString program = "cmd"; QStringList arguments; arguments << ...