简体   繁体   English

用ffmpeg / ffserver流化webm

[英]Streaming webm with ffmpeg/ffserver

I'm attempting to cast my desktop screen to an ffserver and stream it as a webm. 我正在尝试将桌面屏幕投射到ffserver并将其作为webm流式传输。 I'm using the following ffserver configuration: 我正在使用以下ffserver配置:

<Feed feed1.ffm>               # This is the input feed where FFmpeg will send
   File ./feed1.ffm            # video stream.
   FileMaxSize 1G              # Maximum file size for buffering video
   ACL allow 127.0.0.1
   ACL allow localhost
</Feed>

<Stream test.webm>              # Output stream URL definition
   Feed feed1.ffm              # Feed from which to receive video
   Format webm

   # Audio settings
   AudioCodec vorbis
   AudioBitRate 64             # Audio bitrate

   # Video settings
   VideoCodec libvpx
   VideoSize 720x576           # Video resolution
   VideoFrameRate 25           # Video FPS

   AVOptionVideo cpu-used 10
   AVOptionVideo qmin 10
   AVOptionVideo qmax 42
   AVOptionVideo quality good
   AVOptionAudio flags +global_header
   PreRoll 15
   StartSendOnKey
   VideoBitRate 400            # Video bitrate
</Stream>

And the following command on my desktop: 然后在我的桌面上执行以下命令:

ffmpeg -f x11grab -r 25 -s 1280x800 -i :0.0 -f alsa -i pulse http://127.0.0.1:8090/feed1.ffm

With ffmpeg being version 2.4.2 and with libvpx enabled (latest on Arch). ffmpeg版本为2.4.2,并且启用了libvpx(Arch上的最新版本)。 I get the error: 我得到错误:

[libvpx @ 0x20a21a0] CQ level 0 must be between minimum and maximum quantizer value (10-42)

On the client side. 在客户端。 As far as I can tell from calling ffmpeg -h full there's no way of setting the cq-level, and setting qmin to 0 doesn't work (it ends up as 3 for some reason, I guess ffmpeg enforces a minimum). 据我从调用ffmpeg -h full知道的,无法设置cq级别,并且将qmin设置为0不起作用(由于某种原因,它最终变为3,我猜ffmpeg强制执行最小值)。

This configuration seems to have worked for others on the internet, but I can't see how if cq-level defaults 0. If anyone has any ideas I'd really appreciate it. 此配置似乎已经对Internet上的其他用户起作用,但是我看不出cq级别的默认值如何为0。如果有人有任何想法,我将非常感谢。

Add -c:v libvpx to your console syntax: -c:v libvpx添加到您的控制台语法中:

ffmpeg -f x11grab -r 25 -s 1280x800 -i :0.0 -c:v libvpx -f alsa -i pulse http://127.0.0.1:8090/feed1.ffm

Also I'd recommend reading the ffmpeg streaming guide 另外,我建议阅读ffmpeg流媒体指南

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

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