查看: 1467|回复: 0

[评测分享] 【树莓派5 测评】 + 13.视频推流功能测试(zmj)

[复制链接]
  • TA的每日心情
    奋斗
    3 天前
  • 签到天数: 250 天

    连续签到: 1 天

    [LV.8]以坛为家I

    发表于 2024-4-30 16:41:30 | 显示全部楼层 |阅读模式
    分享到:
    【树莓派5 测评】 + 13.视频推流功能测试(zmj)
    树莓派5 的USB摄像头(UVC)借助mjpg-streamer实现网页监控推流十分便捷(电脑、手机均可以正常访问)。
    ---------------------------以下为正文---------------------------
    1.        mjpg-streamer下载及编译
    下载编译流程如下:
    1. //------mjpg-streamer
    2. //---下载
    3. git clone https://github.com/jacksonliam/mjpg-streamer.git
    4. cd mjpg-streamer
    5. cd mjpg-streamer-experimental
    6. gcc -v
    7. //---依赖项/依赖库的安装
    8. sudo apt install cmake
    9. sudo apt-get install -y cmake libjpeg62-turbo-dev
    10. //---编译安装mjpg-streamer(需要sudo权限才能安装)
    11. sudo apt install cmake
    12. make all
    13. sudo make install  
    14. //---测试指令
    15. sudo /usr/local/bin/mjpg_streamer -i "input_uvc.so -d /dev/video0 -r 1280x720 -y" -o "output_http.so"
    16. 部分测试配置(自动)如下所示:
    17.         设备:/dev/video0
    18.         分辨率:1280*720(720P)
    19.         帧率:1帧/秒(此种情况下节省网络带宽,降低CPU占用率)
    20.         格式:YUYV
    21.         端口:8080
    22. //---访问方式(PC端和手机端均OK,IP地址是:192.168.5.177):
    23. http://192.168.5.177:8080/?action=stream
    复制代码
    2.        测试结果
    最终呈现效果是网页端实时刷新(1帧/秒)摄像头结果,同一局域网内在PC端和手机端均能正常查看推流效果。
    1. //---测试指令
    2. sudo /usr/local/bin/mjpg_streamer -i "input_uvc.so -d /dev/video0 -r 1280x720 -y" -o "output_http.so"
    3. 部分测试配置(自动)如下所示:
    4.         设备:/dev/video0
    5.         分辨率:1280*720(720P)
    6.         帧率:1帧/秒(此种情况下节省网络带宽,降低CPU占用率)
    7.         格式:YUYV
    8.         端口:8080
    9. //---访问方式(PC端和手机端均OK):
    10. A.家中IP地址是:192.168.1.103
    11. http://192.168.1.103:8080/?action=stream
    12. B.单位IP地址是:192.168.7.25
    13. http://192.168.1.103:8080/?action=stream

    14. //------测试Log
    15. zhaomeijing@raspberrypi5:~/workspace/09_uvc/mjpg-streamer/mjpg-streamer-experimental$ \
    16. > ./mjpg_streamer -h
    17. -----------------------------------------------------------------------
    18. Usage: ./mjpg_streamer
    19.   -i | --input "<input-plugin.so> [parameters]"
    20.   -o | --output "<output-plugin.so> [parameters]"
    21. [-h | --help ]........: display this help
    22. [-v | --version ].....: display version information
    23. [-b | --background]...: fork to the background, daemon mode
    24. -----------------------------------------------------------------------
    25. Example #1:
    26. To open an UVC webcam "/dev/video1" and stream it via HTTP:
    27.   ./mjpg_streamer -i "input_uvc.so -d /dev/video1" -o "output_http.so"
    28. -----------------------------------------------------------------------
    29. Example #2:
    30. To open an UVC webcam and stream via HTTP port 8090:
    31.   ./mjpg_streamer -i "input_uvc.so" -o "output_http.so -p 8090"
    32. -----------------------------------------------------------------------
    33. Example #3:
    34. To get help for a certain input plugin:
    35.   ./mjpg_streamer -i "input_uvc.so --help"
    36. -----------------------------------------------------------------------
    37. In case the modules (=plugins) can not be found:
    38. * Set the default search path for the modules with:
    39.    export LD_LIBRARY_PATH=/path/to/plugins,
    40. * or put the plugins into the "/lib/" or "/usr/lib" folder,
    41. * or instead of just providing the plugin file name, use a complete
    42.    path and filename:
    43.    ./mjpg_streamer -i "/path/to/modules/input_uvc.so"
    44. -----------------------------------------------------------------------
    45. zhaomeijing@raspberrypi5:~/workspace/09_uvc/mjpg-streamer/mjpg-streamer-experimental$ \
    46. > sudo /usr/local/bin/mjpg_streamer -i "input_uvc.so -d /dev/video0 -r 1280x720 -y" -o "output_http.so"
    47. MJPG Streamer Version: git rev: 310b29f4a94c46652b20c4b7b6e5cf24e532af39
    48. i: Using V4L2 device.: /dev/video0
    49. i: Desired Resolution: 1280 x 720
    50. i: Frames Per Second.: -1
    51. i: Format............: YUYV
    52. i: JPEG Quality......: 80
    53. i: TV-Norm...........: DEFAULT
    54. UVCIOC_CTRL_ADD - Error at Pan (relative): Inappropriate ioctl for device (25)
    55. UVCIOC_CTRL_ADD - Error at Tilt (relative): Inappropriate ioctl for device (25)
    56. UVCIOC_CTRL_ADD - Error at Pan Reset: Inappropriate ioctl for device (25)
    57. UVCIOC_CTRL_ADD - Error at Tilt Reset: Inappropriate ioctl for device (25)
    58. UVCIOC_CTRL_ADD - Error at Pan/tilt Reset: Inappropriate ioctl for device (25)
    59. UVCIOC_CTRL_ADD - Error at Focus (absolute): Inappropriate ioctl for device (25)
    60. UVCIOC_CTRL_MAP - Error at Pan (relative): Inappropriate ioctl for device (25)
    61. UVCIOC_CTRL_MAP - Error at Tilt (relative): Inappropriate ioctl for device (25)
    62. UVCIOC_CTRL_MAP - Error at Pan Reset: Inappropriate ioctl for device (25)
    63. UVCIOC_CTRL_MAP - Error at Tilt Reset: Inappropriate ioctl for device (25)
    64. UVCIOC_CTRL_MAP - Error at Pan/tilt Reset: Inappropriate ioctl for device (25)
    65. UVCIOC_CTRL_MAP - Error at Focus (absolute): Inappropriate ioctl for device (25)
    66. UVCIOC_CTRL_MAP - Error at LED1 Mode: Inappropriate ioctl for device (25)
    67. UVCIOC_CTRL_MAP - Error at LED1 Frequency: Inappropriate ioctl for device (25)
    68. UVCIOC_CTRL_MAP - Error at Disable video processing: Inappropriate ioctl for device (25)
    69. UVCIOC_CTRL_MAP - Error at Raw bits per pixel: Inappropriate ioctl for device (25)
    70. o: www-folder-path......: disabled
    71. o: HTTP TCP port........: 8080
    72. o: HTTP Listen Address..: (null)
    73. o: username:password....: disabled
    74. o: commands.............: enabled
    75. ^[^Csetting signal to stop //手动Ctrl+C退出//
    76. i: cleaning up resources allocated by input thread
    77. o: cleaning up resources allocated by server thread #00
    78. force cancellation of threads and cleanup resources
    79. done
    80. zhaomeijing@raspberrypi5:~/workspace/09_uvc/mjpg-streamer/mjpg-streamer-experimental$
    复制代码
    //------测试结果:网页和手机均可以正常访问视频推流
    image-20240428202721015.png
    image-20240428202811519.png
    //------end

    回复

    使用道具 举报

    您需要登录后才可以回帖 注册/登录

    本版积分规则

    关闭

    站长推荐上一条 /4 下一条

    手机版|小黑屋|与非网

    GMT+8, 2024-11-23 18:19 , Processed in 0.122562 second(s), 18 queries , MemCache On.

    ICP经营许可证 苏B2-20140176  苏ICP备14012660号-2   苏州灵动帧格网络科技有限公司 版权所有.

    苏公网安备 32059002001037号

    Powered by Discuz! X3.4

    Copyright © 2001-2024, Tencent Cloud.