查看可用设备:
ffmpeg -hide_banner -devices
Devices:
D. = Demuxing supported
.E = Muxing supported
--
DE alsa ALSA audio output
DE fbdev Linux framebuffer
D lavfi Libavfilter virtual input device
E opengl OpenGL output
DE oss OSS (Open Sound System) playback
E sdl,sdl2 SDL2 output device
DE video4linux2,v4l2 Video4Linux2 output device
D x11grab X11 screen capture, using XCB
ffmpeg在linux下桌面图形的时候,通常是用x11grab设备采集桌面图像:
ffmpeg -h demuxer=x11grab
ffmpeg version N-100131-g0639f5c Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-44)
configuration: --prefix=/usr/local/ffmpeg --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libx264 --enable-libx265 --enable-filter=delogo --enable-debug --disable-optimizations --enable-opengl --enable-libspeex --enable-libopus --enable-libmp3lame --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --host-cflags= --host-ldflags=
libavutil 56. 61.100 / 56. 61.100
libavcodec 58.114.100 / 58.114.100
libavformat 58. 64.100 / 58. 64.100
libavdevice 58. 11.103 / 58. 11.103
libavfilter 7. 91.100 / 7. 91.100
libswscale 5. 8.100 / 5. 8.100
libswresample 3. 8.100 / 3. 8.100
libpostproc 55. 8.100 / 55. 8.100
Demuxer x11grab [X11 screen capture, using XCB]:
xcbgrab indev AVOptions:
-x <int> .D........ Initial x coordinate. (from 0 to INT_MAX) (default 0)
-y <int> .D........ Initial y coordinate. (from 0 to INT_MAX) (default 0)
-grab_x <int> .D........ Initial x coordinate. (from 0 to INT_MAX) (default 0)
-grab_y <int> .D........ Initial y coordinate. (from 0 to INT_MAX) (default 0)
-video_size <image_size> .D........ A string describing frame size, such as 640x480 or hd720.
-framerate <string> .D........ (default "ntsc")
-draw_mouse <int> .D........ Draw the mouse pointer. (from 0 to 1) (default 1)
-follow_mouse <int> .D........ Move the grabbing region when the mouse pointer reaches within specified amount of pixels to the edge of region. (from -1 to INT_MAX) (default 0)
centered -1 .D........ Keep the mouse pointer at the center of grabbing region when following.
-show_region <int> .D........ Show the grabbing region. (from 0 to 1) (default 0)
-region_border <int> .D........ Set the region border thickness. (from 1 to 128) (default 3)
-select_region <boolean> .D........ Select the grabbing region graphically using the pointer. (default false)
发现云服务器没有音视频输入输出设备,就此作罢。