我一直在尝试使用FFmpeg来获取第二台显示服务器的输出,但是当我在PC上打开VLC中的视频时,它看起来像是黑屏。我已尝试使用apt的FFmpeg和我自己构建的但是它们都获得了相同的输出。
这是我用于视频的命令:
ffmpeg -y -framerate 30 -f x11grab -video_size 1024x576 -i :1 -vcodec qtrle out.mov
这是FFmpeg的输出
ffmpeg version N-92272-g0e9c01f Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609
configuration: --prefix=/home/nas/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/nas/ffmpeg_build/include --extra-ldflags=-L/home/nas/ffmpeg_build/lib --extra-libs='-lpthread -lm' --bindir=/home/nas/bin --enable-gpl --enable-libaom --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxcb --enable-nonfree
libavutil 56. 20.100 / 56. 20.100
libavcodec 58. 34.100 / 58. 34.100
libavformat 58. 19.102 / 58. 19.102
libavdevice 58. 4.106 / 58. 4.106
libavfilter 7. 38.100 / 7. 38.100
libswscale 5. 2.100 / 5. 2.100
libswresample 3. 2.100 / 3. 2.100
libpostproc 55. 2.100 / 55. 2.100
[x11grab @ 0x33a5a00] XFixes not available, cannot draw the mouse.
Input #0, x11grab, from ':1':
Duration: N/A, start: 1540586402.265804, bitrate: N/A
Stream #0:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 1024x576, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> qtrle (native))
Press [q] to stop, [?] for help
Output #0, mov, to 'out.mov':
Metadata:
encoder : Lavf58.19.102
Stream #0:0: Video: qtrle (rle / 0x20656C72), rgb24, 1024x576, q=2-31, 200 kb/s, 30 fps, 15360 tbn, 30 tbc
Metadata:
encoder : Lavc58.34.100 qtrle
frame= 260 fps= 30 q=-0.0 Lsize= 424kB time=00:00:08.63 bitrate= 402.7kbits/s speed=1.01x
video:423kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.432202%
Exiting normally, received signal 2.
这是显示的xdpyinfo:
name of display: :1
version number: 11.0
vendor string: AT&T Laboratories Cambridge
vendor release number: 3332
maximum request size: 4194300 bytes
motion buffer size: 256
bitmap unit, bit order, padding: 32, LSBFirst, 32
image byte order: LSBFirst
number of supported pixmap formats: 2
supported pixmap formats:
depth 1, bits_per_pixel 1, scanline_pad 32
depth 24, bits_per_pixel 32, scanline_pad 32
keycode range: minimum 8, maximum 255
focus: window 0x1800001, revert to Parent
number of extensions: 7
BIG-REQUESTS
MIT-SHM
MIT-SUNDRY-NONSTANDARD
SHAPE
SYNC
XC-MISC
XTEST
default screen number: 0
number of screens: 1
screen #0:
dimensions: 1024x576 pixels (347x195 millimeters)
resolution: 75x75 dots per inch
depths (1): 24
root window id: 0x25
depth of root window: 24 planes
number of colormaps: minimum 1, maximum 1
default colormap: 0x21
default number of colormap cells: 256
preallocated pixels: black 0, white 16777215
options: backing-store YES, save-unders YES
largest cursor: 1024x576
current input event mask: 0x4a0003
KeyPressMask KeyReleaseMask StructureNotifyMask
SubstructureNotifyMask PropertyChangeMask
number of visuals: 1
default visual id: 0x22
visual:
visual id: 0x22
class: TrueColor
depth: 24 planes
available colormap entries: 256 per subfield
red, green, blue masks: 0xff0000, 0xff00, 0xff
significant bits in color specification: 8 bits
如果需要更多信息(或视频样本),请告诉我,我会让他们使用。
任何帮助,将不胜感激
我相信,无头Linux中没有“X服务器”运行。如果我是对的,那么用你使用的命令就无法捕获。
—
GabrielaGarcia
我使用tightvncserver启动服务器,后者为我启动X服务器。通过VNC连接到桌面和GUI时,我可以看到桌面和GUI,我可以截取
—
RetractedRedacted
xwd -root -silent -display :1.0 | xwdtopnm |pnmtojpeg > screen.jpg
ffplay是否显示显示:
—
Gyan
ffplay -framerate 30 -f x11grab -video_size 1024x576 -i :1
?
不,FFplay也显示黑屏不幸
—
RetractedRedacted