【问题标题】:Using raspivid and cvlc together with low framerates and full FOV将 raspivid 和 cvlc 与低帧率和全 FOV 一起使用
【发布时间】:2021-02-15 23:28:34
【问题描述】:

我有一个带有 OV5647 摄像头模块的 Raspberry Pi,我用它来流式传输视频。

raspivid 采用名为--mode, -md 的命令行参数,它提供了几种相机可以设置使用的模式。

Mode  Size      AR Frame rates    FOV    Binning
0   automatic
    selection
1   1920x1080  16:9     1-30fps  Partial None
2   2592x1944   4:3     1-15fps  Full    None
3   2592x1944   4:3 0.1666-1fps  Full    None
4   1296x972    4:3     1-42fps  Full    2x2
5   1296x730   16:9     1-49fps  Full    2x2
6    640x480    4:3  42.1-60fps  Full    2x2 plus skip
7    640x480    4:3  60.1-90fps  Full    2x2 plus skip

我宁愿拥有低帧率和良好的图像质量,而不是高 FPS。

对于高质量的视频,我想以全高清 1920x1080 流式传输,但是相机的模式 1 只给它一个部分 FOV,这会大大减少拍摄区域,我真的需要全 FOV。

我想选择模式2,以便我可以以 15 FPS 的全高清流式传输缩小的视频。

然而我不得不使用模式4,因为它给了我25 FPS的帧率。

问题如下:

raspivid -o - \
         -t 0 \
         -n \
         -hf -vf \
         -g 25 \
         -pf high \
         -md 4 \
         -fps 25 \
         -b 10000000 \
| cvlc -vvv \
    stream:///dev/stdin \
    --no-audio \
    --sout '#standard{access=http,mux=ts,dst=:8090}' \
    :demux=h264

此命令有效。它将相机设置为4 模式,使用25 的fps 并将视频传输到clvc

当我将模式设置为 2 并将 fps 降低到 15 时,这将不再起作用。

出于某种原因,cvlc 似乎期望帧速率为 25,并记录了很多警告

[73b02cf8] main mux warning: late buffer for mux input (17958)
[73b02cf8] main mux warning: late buffer for mux input (2025)
[73b02cf8] main mux warning: late buffer for mux input (14107)
[73b02cf8] main mux warning: late buffer for mux input (2890)
[73b02cf8] main mux warning: late buffer for mux input (20115)

开头还有一条信息性消息声称

[73b12410] main decoder debug: using packetizer module "h264"
[73e00568] main input debug: switching to sync mode
[73b088b8] h26x demux debug: using 25.00 fps

所以我假设我收到了那些 late buffer 警告,因为 raspivid 发送的帧数很少,并且编码器的数据不足。视频大约每 10 秒冻结一次,真的无法使用。当它移动时,它会加速。

我如何告诉 h264 编码器它应该以 15 FPS 输入输出而不是 25 FPS 工作?

【问题讨论】:

    标签: video-streaming frame-rate


    【解决方案1】:

    您可以通过将--h264-fps=15 添加到cvlc 来做到这一点。

    raspivid -o - \
             -t 0 \
             -n \
             -hf -vf \
             -g 15 \
             -pf high \
             -md 2 \
             -fps 15 \
             -br 55 \
             -ISO 800 \
             -ae 32,0x00,0x8080FF \
             -a 4 \
             -a "%Y-%m-%d %X" \
             -b 10000000 \
    | cvlc -vvv \
        stream:///dev/stdin \
        --no-audio \
        --demux=h264 \
        --h264-fps=15 \
        --sout '#standard{access=http,mux=ts,dst=:8090}'
    

    在 Raspberry Pi Zero 上,您必须将 force_turbo=1 添加到 \boot\config.txt,但不要设置 over_voltagearm_freq,因为这会使保修失效。如果没有force_turbo=1,设备将在流式传输几个小时后冻结。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-11-09
      • 1970-01-01
      • 2016-10-05
      • 2015-02-27
      相关资源
      最近更新 更多