简体   繁体   English

ffmpeg和ffserver,rc缓冲区下溢?

[英]ffmpeg and ffserver, rc buffer underflow?

I am attempting to write a simple streaming server for a project. 我正在尝试为项目编写一个简单的流服务器。 I have an AWS Linux machine that will be running ffserver . 我有一台将运行ffserver的AWS Linux计算机。 Curently, as it stands, my config file looks like the following: 就目前而言,我的配置文件如下所示:

#Server Configs
HTTPPort 8090
HTTPBindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 1000
CustomLog -

#Create a Status Page
<Stream stat.html>
Format status
ACL allow localhost
ACL allow 255.255.255.255 #Allow everyone to view status, for now
</Stream>

#Creates feed, only allow from self
<Feed feed1.ffm>
File /tmp/feed1.ffm
FileMaxSize 50M
ACL allow 127.0.0.1
ACL allow <MY_PERSONAL_COMPUTER'S_PUBLIC_IP_HERE>
</Feed>

#Creates stream, allow everyone
<Stream tagLive.mpg>
Format mpeg
Feed feed1.ffm
VideoFrameRate 30
VideoSize 640x480
AudioSampleRate 44100
</Stream>

I then am capturing my Webcam and sending it up to the server using the following command: 然后,我使用以下命令捕获网络摄像头并将其发送到服务器:

ffmpeg -f dshow 
       -i video="Webcam C170":audio="Microphone (Webcam C170)" 
       -b:v 1400k  
       -maxrate 2400k  
       -bufsize 1200k  
       -ab 64k  
       -s 640x480  
       -ac 1  
       -ar 44100  
       -y http://<AWS_SERVER_PUBLIC_DNS>:8090/feed1.ffm

When I run this however, I get the following output from my console: 但是,当我运行此命令时,将从控制台获得以下输出:

Guessed Channel Layout for  Input Stream #0.1 : stereo
Input #0, dshow, from 'video=Webcam C170:audio=Microphone (Webcam C170)':
  Duration: N/A, start: 12547.408000, bitrate: N/A
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 30 tbr, 10000k tbn, 30 tbc
    Stream #0:1: Audio: pcm_s16le, 44100 Hz, 2 channels, s16, 1411 kb/s
Output #0, ffm, to '<AWS_SERVER_PUBLIC_DNS>:8090/feed1.ffm':
  Metadata:
    creation_time   : 2017-04-26 14:55:27
    encoder         : Lavf57.25.100
    Stream #0:0: Audio: mp2, 44100 Hz, mono, s16, 64 kb/s
    Metadata:
      encoder         : Lavc57.24.102 mp2
    Stream #0:1: Video: mpeg1video, yuv420p, 640x480, q=2-31, 64 kb/s, 30 fps, 1000k tbn, 30 tbc
    Metadata:
      encoder         : Lavc57.24.102 mpeg1video
    Side data:
      unknown side data type 10 (24 bytes)
Stream mapping:
  Stream #0:1 -> #0:0 (pcm_s16le (native) -> mp2 (native))
  Stream #0:0 -> #0:1 (rawvideo (native) -> mpeg1video (native))
Press [q] to stop, [?] for help
[mpeg1video @ 02e95180] rc buffer underflow
[mpeg1video @ 02e95180] max bitrate possibly too small or try trellis with large lmax or increase qmax
[mpeg1video @ 02e95180] rc buffer underflow
[mpeg1video @ 02e95180] max bitrate possibly too small or try trellis with large lmax or increase qmax
[mpeg1video @ 02e95180] rc buffer underflow
[mpeg1video @ 02e95180] max bitrate possibly too small or try trellis with large lmax or increase qmax
[mpeg1video @ 02e95180] rc buffer underflow
[mpeg1video @ 02e95180] max bitrate possibly too small or try trellis with large lmax or increase qmax
[mpeg1video @ 02e95180] rc buffer underflow
[mpeg1video @ 02e95180] max bitrate possibly too small or try trellis with large lmax or increase qmax
[mpeg1video @ 02e95180] rc buffer underflow
[mpeg1video @ 02e95180] max bitrate possibly too small or try trellis with large lmax or increase qmax
[mpeg1video @ 02e95180] rc buffer underflow
[mpeg1video @ 02e95180] max bitrate possibly too small or try trellis with large lmax or increase qmax
[mpeg1video @ 02e95180] rc buffer underflow
[mpeg1video @ 02e95180] max bitrate possibly too small or try trellis with large lmax or increase qmax
[mpeg1video @ 02e95180] rc buffer underflowtime=00:00:01.13 bitrate= 404.8kbits/s dup=13 drop=0 speed=2.22x
[mpeg1video @ 02e95180] max bitrate possibly too small or try trellis with large lmax or increase qmax
[mpeg1video @ 02e95180] rc buffer underflow
[mpeg1video @ 02e95180] max bitrate possibly too small or try trellis with large lmax or increase qmax
[mpeg1video @ 02e95180] rc buffer underflowtime=00:00:01.63 bitrate= 361.1kbits/s dup=13 drop=0 speed=1.61x
[mpeg1video @ 02e95180] max bitrate possibly too small or try trellis with large lmax or increase qmax
[mpeg1video @ 02e95180] rc buffer underflowtime=00:00:02.13 bitrate= 368.6kbits/s dup=13 drop=0 speed= 1.4x
[mpeg1video @ 02e95180] max bitrate possibly too small or try trellis with large lmax or increase qmax
[mpeg1video @ 02e95180] rc buffer underflowtime=00:00:02.66 bitrate= 344.1kbits/s dup=13 drop=0 speed=1.32x
[mpeg1video @ 02e95180] max bitrate possibly too small or try trellis with large lmax or increase qmax
[mpeg1video @ 02e95180] rc buffer underflowtime=00:00:03.16 bitrate= 331.1kbits/s dup=13 drop=0 speed=1.25x
[mpeg1video @ 02e95180] max bitrate possibly too small or try trellis with large lmax or increase qmax
[mpeg1video @ 02e95180] rc buffer underflow
[mpeg1video @ 02e95180] max bitrate possibly too small or try trellis with large lmax or increase qmax
frame=  117 fps= 36 q=31.0 Lsize=     156kB time=00:00:03.86 bitrate= 330.5kbits/s dup=13 drop=0 speed= 1.2x
video:118kB audio:27kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 7.659440%
Exiting normally, received signal 2.

And on my viewer, I just get a black screen. 在我的查看器上,我只有一个黑屏。

Is there something I'm missing? 有什么我想念的吗? Searching lead to nothing on "increasing qmax" or anything similar to what ffmpeg complained about. 搜索不会导致“增加qmax”,也不会引起类似ffmpeg抱怨。 There have been questions asked here , but nothing has been done/answered. 已经有问题要问在这里 ,但什么也没有做/回答。

Thanks in advance 提前致谢

You can set qmax and qmin in the server config 您可以在服务器配置中设置qmax和qmin

<Stream test_3840.flv>
...
VideoQMin 1
VideoQMax 15
...
</Stream>

More details can be found in that answer https://stackoverflow.com/a/18566361/4010173 可以在该答案中找到更多详细信息https://stackoverflow.com/a/18566361/4010173

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM