环境 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. H - Knight Moves DFS

    A friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the sh ...

  2. 【原创干货】大数据Hadoop/Spark开发环境搭建

    已经自学了好几个月的大数据了,第一个月里自己通过看书.看视频.网上查资料也把hadoop(1.x.2.x).spark单机.伪分布式.集群都部署了一遍,但经历短暂的兴奋后,还是觉得不得门而入. 只有深 ...

  3. GNU的make命令、makefile编写

    makefile简介 makefile可实现工程的自动化编译,只需一个make命令即可一键完成.makefile定义了一些规则,指定哪些文件需要先编译.后编译.重新编译等. 一般的C或者C++程序,都 ...

  4. 关于vue切换用户,路由表不更新问题

    简介 我想很多同学在项目中可能会遇到类似的问题,然后一顿操作,发现结果不尽人意.于是查阅各种资料,走进很多坑(可能你阅读的这篇随笔也是个坑).接下来我所描述的是关于我使用不同权限的用户切换登陆后,需要 ...

  5. linux之cat 操作

    1.查看或创建 cat 1.txt #如果目录有这个文件则会打开查看,没有则会创建 2.压缩空白 cat 1.txt 我是第一行 我是第二 行 cat -bs 1.txt # 变成 cat 1.txt ...

  6. 来个干货——使用VS2019发布.NET Core程序并部署到IIS的最新教程

    使用VS2019发布.NET Core程序并部署到IIS,不管你是使用.NET Core开发的是Web API还是网站类的程序,如果你是部署到IIS,那么下面的内容都适合于你,不会将.NET Core ...

  7. 二进制部署kubernetes集群_kube-apiserver提示"watch chan error: etcdserver: mvcc: required revision has been compacted'

    查看kube-apiserver状态 [root@yxz-cluster01 ~]# systemctl status kube-apiserver -l ● kube-apiserver.servi ...

  8. fashion_mnist多分类训练,两种模型的保存与加载

    from tensorflow.python.keras.preprocessing.image import load_img,img_to_array from tensorflow.python ...

  9. docker(2)

    docker三大核心组件的概念 1镜像: Docker 镜像类似于虚拟机镜像,可以将它理解为一个只读的模板.例如,一个镜像可以包含一个基本的操作系统环境,里面仅安装了 Apache 应用程序(或用户需 ...

  10. 异常:由 spring-session pom 引发

    错误异常 Correct the classpath of your application so that it contains a single, compatible version of o ...