本文介绍了未知的输入格式:"x11grab"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

人:

我在编译ffmpeg并在Linux中运行ffmpeg时遇到问题.

I have problems when i compile ffmpeg and run ffmpeg in linux.

我的环境:

1:ubuntu 17.10_x64_bit(我认为操作系统版本不是关键)

1: ubuntu 17.10_x64_bit(i don't think the os version is the key)

2:gcc(Ubuntu 6.3.0-19ubuntu1)6.3.0 20170618

2: gcc (Ubuntu 6.3.0-19ubuntu1) 6.3.0 20170618

3:ffmpeg开源代码:3.2

3: ffmpeg open source code:3.2

首先,我从ffmpeg 官方网站下载源代码.我用那里的说明来编译这个项目:

first, i download the source code from ffmpeg official site. I compile this project with there instructions:

./configure --prefix=/home/jjh/software/ffmpeg --enable-shared
make
make install

它工作正常,除了一些警告,没有任何错误,然后我运行:

and it worked without any error except some warning, then i run:

./ffmpeg -h

我确保它可以正常工作并输出.

i make sure that it works and output normally.

但是我想用ffmpeg抓屏.所以我用这种结构(o):

but i want use ffmpeg to grabbing screen. so i use this construction(o):

ffmpeg -f x11grab -video_size cif -framerate 25 -i :0.0 /tmp/out.mpg

然后输出错误:

Unknown input format: 'x11grab'

我想使用--enable-x11grab选项btw重新编译该项目,因此很多解决方案告诉我这一点.但是当我添加此选项时,出现一些错误:

i want to re-compile this project with --enable-x11grab option, btw , so many solution tell me to to this. but when i add this option, i get some errors:

Invalid option --enable-x11grab

有人说我应该安装一些库:

some people says that i should install some libs:

libxfixes-dev
sudo apt-get install libxext-dev

所以我安装了这些库,但是它总是显示此错误.请帮助我.

so i installed these libs, but it always show this error. pls help me.

推荐答案

我相信在此版本的ffmpeg中已弃用 x11grab ,尽管他们只将其写入到 Changelog 中版本3.3.

I believe x11grab is deprecated in this version of ffmpeg, though they only write this to Changelog in version 3.3.

如果您拖动ffmpeg的git版本并检查 git log ,则可以在2017年3月15日左右看到几次提交,分别是 5ed4644d6d 4fef648d10 和其他,删除旧的 x11grab 引用.

If you drag a git version of ffmpeg and check git log, you can see several commits around Mar 15 2017, 5ed4644d6d 4fef648d10 and others, which remove legacy x11grab references.

在ffmpeg(高于3.2)中, x11grab 的替代方法称为 xcbgrab ,可以使用-enable-libxcb 构建.

The alternative of x11grab is called xcbgrab in ffmpeg (higher than 3.2), that can be built with --enable-libxcb.

这篇关于未知的输入格式:"x11grab"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-29 03:49