gpt4 book ai didi

ffmpeg - 无法让 ffmpeg 流式传输网络摄像头

转载 作者:行者123 更新时间:2023-12-04 23:15:06 25 4
gpt4 key购买 nike

关闭。这个问题不符合 Stack Overflow guidelines 。它目前不接受答案。












这个问题似乎与 help center 定义的范围内的编程无关。


4年前关闭。







Improve this question




我有一个安装了 ffmpeg 和 microsoft hd3000 cam 的 rapsberry
我运行以下命令:
ffserver -f/etc/ffserver.conf & ffmpeg -framerate 21 -re -f video4linux2 -i/dev/video0 -f alsa -i sysdefault:CARD=HD3000 http://localhost:8090/feed1.ffm

我得到以下信息:

/etc/ffserver.conf:164: Setting default value for video bit rate tolerance = 16000. Use NoDefaults to disable it.
/etc/ffserver.conf:164: Setting default value for video rate control equation = tex^qComp. Use NoDefaults to disable it.
/etc/ffserver.conf:164: Setting default value for video max rate = 6229744. Use NoDefaults to disable it.
/etc/ffserver.conf:219: Setting default value for audio sample rate = 22050. Use NoDefaults to disable it.
/etc/ffserver.conf:219: Setting default value for audio channel count = 1. Use NoDefaults to disable it.
/etc/ffserver.conf:219: Setting default value for video bit rate tolerance = 64000. Use NoDefaults to disable it.
/etc/ffserver.conf:219: Setting default value for video rate control equation = tex^qComp. Use NoDefaults to disable it.
/etc/ffserver.conf:219: Setting default value for video max rate = 6369328. Use NoDefaults to disable it.
bind(port 8090): Address already in use
Wed Nov 29 13:17:49 2017 Could not start server
[video4linux2,v4l2 @ 0x1a35630] The driver changed the time per frame from 1/21 to 1/10
Input #0, video4linux2,v4l2, from '/dev/video0':
Duration: N/A, start: 12116.079136, bitrate: 147456 kb/s
Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1280x720, 147456 kb/s, 10 fps, 10 tbr, 1000k tbn, 1000k tbc
Guessed Channel Layout for Input Stream #1.0 : stereo
Input #1, alsa, from 'sysdefault:CARD=HD3000':
Duration: N/A, start: 1511961469.424072, bitrate: 1536 kb/s
Stream #1:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
[tcp @ 0x1a44160] Connection to tcp://localhost:8090 failed (Connection refused), trying next address
Wed Nov 29 13:17:49 2017 127.0.0.1 - - [GET] "/feed1.ffm HTTP/1.1" 200 4175
[tcp @ 0x1a63ca0] Connection to tcp://localhost:8090 failed (Connection refused), trying next address
[mpeg1video @ 0x1a6ecb0] bitrate tolerance 21333 too small for bitrate 64000, overriding
[mpeg1video @ 0x1a6ecb0] MPEG-1/2 does not support 3/1 fps
Stream mapping:
Stream #1:0 -> #0:0 (pcm_s16le (native) -> mp2 (native))
Stream #0:0 -> #0:1 (rawvideo (native) -> mpeg1video (native))
Stream #1:0 -> #0:2 (pcm_s16le (native) -> wmav2 (native))
Stream #0:0 -> #0:3 (rawvideo (native) -> msmpeg4v3 (msmpeg4))
Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height
Wed Nov 29 13:17:49 2017 127.0.0.1 - - [POST] "/feed1.ffm HTTP/1.1" 200 0
[2]+ Exit 1 ffserver -f /etc/ffserver.conf

我使用默认的/etc/ffserver.conf。
我似乎无法弄清楚是什么问题。

最佳答案

MPEG-1/2 does not support 3/1 fps



这是导致失败的错误。尽管您将帧速率设置为 21,但网络摄像头似乎正在改变它。

来自 ffmpeg一边你有两个选择:
  • 使用 mpeg1video 以外的其他编码器/mpeg2video可以支持任意帧速率,或
  • 如果您想继续使用 mpeg1video-r和/或 -vsync正确处理输出帧速率的选项。

  • 请注意 ffserver计划很快从 FFmpeg 中删除。您可能想找到一个替代方案。

    关于ffmpeg - 无法让 ffmpeg 流式传输网络摄像头,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47553933/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com