zoukankan      html  css  js  c++  java
  • RTSP流和USB摄像头转MJPEG使用VLC

    测试环境:

           系统: Ubuntu14.04 LTS Desktop

           设备:海康IP摄像头和USB摄像头

    1、需要先安装vlc包,命令行运行

    sudo apt-get update
    sudo apt-get install vlc

    2、安装完成后,使用cvlc工具,在命令行运行(注:测试环境的海康摄像头IP 10.0.10.64  ,  rtsp的端口 554 ,   关闭了http basic 验证)

    cvlc -R rtsp://10.0.10.64:554/Streaming/Channels/101 --sout "#transcode{vcodec=mjpg,vb=25,scale=1.0,fps=10,acodec=none}:standard{access=http{mime=multipart/x-mixed-replace; boundary=7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=:8888/videostream.cgi}"

    运行返回

    VLC media player 2.1.6 Rincewind (revision 2.1.6-0-gea01d28)
    [0x1d8dff8] dummy interface: using the dummy interface module...
    [mjpeg @ 0x7f39b8015320] removing common factors from framerate
    [mjpeg @ 0x7f39b86cb220] removing common factors from framerate
    [0x7f39b00009b8] main input error: ES_OUT_RESET_PCR called

    现在可以在浏览器中访问 http://localhost:8888/videostream.cgi

    3、使用USB摄像头,在命令行运行(注:这里使用的USB摄像头系统设备名称为 video0)

    cvlc --no-audio v4l2:///dev/video0 --v4l2-width 1920 --v4l2-height 1080 --v4l2-chroma h264 --v4l2-fps 30 --v4l2-hflip 1 --v4l2-vflip 1 --sout "#transcode{vcodec=mjpg,vb=25,scale=1.0,fps=10,acodec=none}:standard{access=http{mime=multipart/x-mixed-replace; boundary=7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=:8554/videostream.cgi}"

    运行返回

    VLC media player 2.1.6 Rincewind (revision 2.1.6-0-gea01d28)
    Warning: option --v4l2-fps no longer exists.
    [0x113e878] dummy interface: using the dummy interface module...
    [mjpeg @ 0x7f75b001a680] removing common factors from framerate
    [mjpeg @ 0x7f75b00bccc0] removing common factors from framerate

    现在可以在浏览器中访问 http://localhost:8554/videostream.cgi

  • 相关阅读:
    linux中文字体
    连接数据库服务器端的几个常见错误
    分布式部署下的报表调用 API调用 权限问题以及性能方案
    报表在IBM AIX系统下resin部署
    ASP.Net与JSP如何共享Session值
    async与await
    从小程序到小程序云开发
    什么是 FOUC(无样式内容闪烁)?你如何来避免 FOUC?
    微信小程序知识云开发
    变量的解构赋值
  • 原文地址:https://www.cnblogs.com/Jim-william/p/6258811.html
Copyright © 2011-2022 走看看