嘗試在 ffmpeg 中啟用 x11grab 時發生錯誤

嘗試在 ffmpeg 中啟用 x11grab 時發生錯誤

我正在嘗試設定 ffmpeg,這樣我就可以進行螢幕捕獲,並且只會收到一個又一個錯誤。然而,根本問題是我似乎無法啟用 x11grab。

在終端我已經這樣做了:

$ cd ffmpeg
$ ./configure --enable-gpl --enable-x11grab

我收到此錯誤:

ERROR: X11 not found

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
[email protected] mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.log" produced by configure as this will help
solving the problem.

據我所知,我擁有最新版本的 ffmpeg。

關於下一步要採取的步驟的建議?

編輯

ffmpeg -version給了我這個:

ffmpeg version 1.0
built on Oct 31 2012 15:46:24 with Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)
configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid
libavutil      51. 73.101 / 51. 73.101
libavcodec     54. 59.100 / 54. 59.100
libavformat    54. 29.104 / 54. 29.104
libavdevice    54.  2.101 / 54.  2.101
libavfilter     3. 17.100 /  3. 17.100
libswscale      2.  1.101 /  2.  1.101
libswresample   0. 15.100 /  0. 15.100
libpostproc    52.  0.100 / 52.  0.100

答案1

你正在嘗試的事情實際上是不可能的,或者可能不會給你想要的東西。

這個 GitHub 項目自述文件:

儘管它的名字,Mac OS X 中的大多數程式實際上並未使用 X(它使用稱為 Core Graphics 或 Quartz 的東西來代替)。即使您使用 x11grab 編譯 ffmpeg,您也只能錄製運行 X 的應用程序,例如 gimp 和wireshark。

所以,即使你用 編譯FFmpeg x11grab,你也無法捕捉螢幕。你安裝X石英,這將使您能夠啟用x11grab和編譯(至少我希望如此),但您的可能性將非常有限。

本質上,再次​​引用 Albert Veli 的話:

另一個選擇是實際詢問 ffmpeg 開發人員,他們是否可能在將來的某個時候實現「quartzgrab」格式選項。

在此之前,您可能需要使用 QuickTime 來錄製桌面,或查看其他桌面錄製工具,例如 Snapz Pro X。

答案2

已經很久沒有被問到了,可能沒有人會關心,但萬一有人偶然發現這個問題,完全有可能(到目前為止,我不知道當時是否是這樣)使用 ffmpeg 捕獲屏幕Mac OS X 使用“avfoundation "裝置.

若要取得可用來源的清單:

ffmpeg -f avfoundation -list_devices true -i“”

然後實際捕獲:

ffmpeg -f avfoundation -i "<螢幕裝置索引>:<音訊裝置索引>" <目標檔名>

來源:ffmpeg 維基

相關內容