FFmpeg X11 Grab Black Screen on Ubuntu Server












0














I've been trying to grab the output of a second display server with FFmpeg, however when I open the video in VLC on my PC it appears to be a black screen. I've tried both with FFmpeg from apt and one I build myself but they both get the same output.



Here's the command I used for the video:



ffmpeg -y -framerate 30 -f x11grab -video_size 1024x576 -i :1 -vcodec qtrle out.mov


And here's the output from 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.


and here's the xdpyinfo for the display:



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


If any more information (or a video sample) is required please let me know and I will get them to use.



Any help would be appreciated










share|improve this question






















  • There's no "X server" running in a headless Linux, I believe. If I'm right there's nothing to capture with the commands you used.
    – GabrielaGarcia
    Oct 26 '18 at 20:49










  • I start the server using tightvncserver, which starts the X server for me. I can see a desktop and GUI when connecting to it through VNC and I can take a screenshot with xwd -root -silent -display :1.0 | xwdtopnm |pnmtojpeg > screen.jpg
    – RetractedRedacted
    Oct 26 '18 at 20:59












  • Does ffplay show the display: ffplay -framerate 30 -f x11grab -video_size 1024x576 -i :1 ?
    – Gyan
    Oct 27 '18 at 5:18










  • No, FFplay also shows a black screen unfortunately
    – RetractedRedacted
    Oct 27 '18 at 6:24
















0














I've been trying to grab the output of a second display server with FFmpeg, however when I open the video in VLC on my PC it appears to be a black screen. I've tried both with FFmpeg from apt and one I build myself but they both get the same output.



Here's the command I used for the video:



ffmpeg -y -framerate 30 -f x11grab -video_size 1024x576 -i :1 -vcodec qtrle out.mov


And here's the output from 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.


and here's the xdpyinfo for the display:



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


If any more information (or a video sample) is required please let me know and I will get them to use.



Any help would be appreciated










share|improve this question






















  • There's no "X server" running in a headless Linux, I believe. If I'm right there's nothing to capture with the commands you used.
    – GabrielaGarcia
    Oct 26 '18 at 20:49










  • I start the server using tightvncserver, which starts the X server for me. I can see a desktop and GUI when connecting to it through VNC and I can take a screenshot with xwd -root -silent -display :1.0 | xwdtopnm |pnmtojpeg > screen.jpg
    – RetractedRedacted
    Oct 26 '18 at 20:59












  • Does ffplay show the display: ffplay -framerate 30 -f x11grab -video_size 1024x576 -i :1 ?
    – Gyan
    Oct 27 '18 at 5:18










  • No, FFplay also shows a black screen unfortunately
    – RetractedRedacted
    Oct 27 '18 at 6:24














0












0








0







I've been trying to grab the output of a second display server with FFmpeg, however when I open the video in VLC on my PC it appears to be a black screen. I've tried both with FFmpeg from apt and one I build myself but they both get the same output.



Here's the command I used for the video:



ffmpeg -y -framerate 30 -f x11grab -video_size 1024x576 -i :1 -vcodec qtrle out.mov


And here's the output from 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.


and here's the xdpyinfo for the display:



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


If any more information (or a video sample) is required please let me know and I will get them to use.



Any help would be appreciated










share|improve this question













I've been trying to grab the output of a second display server with FFmpeg, however when I open the video in VLC on my PC it appears to be a black screen. I've tried both with FFmpeg from apt and one I build myself but they both get the same output.



Here's the command I used for the video:



ffmpeg -y -framerate 30 -f x11grab -video_size 1024x576 -i :1 -vcodec qtrle out.mov


And here's the output from 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.


and here's the xdpyinfo for the display:



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


If any more information (or a video sample) is required please let me know and I will get them to use.



Any help would be appreciated







ubuntu ffmpeg xorg






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Oct 26 '18 at 20:45









RetractedRedactedRetractedRedacted

64




64












  • There's no "X server" running in a headless Linux, I believe. If I'm right there's nothing to capture with the commands you used.
    – GabrielaGarcia
    Oct 26 '18 at 20:49










  • I start the server using tightvncserver, which starts the X server for me. I can see a desktop and GUI when connecting to it through VNC and I can take a screenshot with xwd -root -silent -display :1.0 | xwdtopnm |pnmtojpeg > screen.jpg
    – RetractedRedacted
    Oct 26 '18 at 20:59












  • Does ffplay show the display: ffplay -framerate 30 -f x11grab -video_size 1024x576 -i :1 ?
    – Gyan
    Oct 27 '18 at 5:18










  • No, FFplay also shows a black screen unfortunately
    – RetractedRedacted
    Oct 27 '18 at 6:24


















  • There's no "X server" running in a headless Linux, I believe. If I'm right there's nothing to capture with the commands you used.
    – GabrielaGarcia
    Oct 26 '18 at 20:49










  • I start the server using tightvncserver, which starts the X server for me. I can see a desktop and GUI when connecting to it through VNC and I can take a screenshot with xwd -root -silent -display :1.0 | xwdtopnm |pnmtojpeg > screen.jpg
    – RetractedRedacted
    Oct 26 '18 at 20:59












  • Does ffplay show the display: ffplay -framerate 30 -f x11grab -video_size 1024x576 -i :1 ?
    – Gyan
    Oct 27 '18 at 5:18










  • No, FFplay also shows a black screen unfortunately
    – RetractedRedacted
    Oct 27 '18 at 6:24
















There's no "X server" running in a headless Linux, I believe. If I'm right there's nothing to capture with the commands you used.
– GabrielaGarcia
Oct 26 '18 at 20:49




There's no "X server" running in a headless Linux, I believe. If I'm right there's nothing to capture with the commands you used.
– GabrielaGarcia
Oct 26 '18 at 20:49












I start the server using tightvncserver, which starts the X server for me. I can see a desktop and GUI when connecting to it through VNC and I can take a screenshot with xwd -root -silent -display :1.0 | xwdtopnm |pnmtojpeg > screen.jpg
– RetractedRedacted
Oct 26 '18 at 20:59






I start the server using tightvncserver, which starts the X server for me. I can see a desktop and GUI when connecting to it through VNC and I can take a screenshot with xwd -root -silent -display :1.0 | xwdtopnm |pnmtojpeg > screen.jpg
– RetractedRedacted
Oct 26 '18 at 20:59














Does ffplay show the display: ffplay -framerate 30 -f x11grab -video_size 1024x576 -i :1 ?
– Gyan
Oct 27 '18 at 5:18




Does ffplay show the display: ffplay -framerate 30 -f x11grab -video_size 1024x576 -i :1 ?
– Gyan
Oct 27 '18 at 5:18












No, FFplay also shows a black screen unfortunately
– RetractedRedacted
Oct 27 '18 at 6:24




No, FFplay also shows a black screen unfortunately
– RetractedRedacted
Oct 27 '18 at 6:24










0






active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1370357%2fffmpeg-x11-grab-black-screen-on-ubuntu-server%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Super User!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1370357%2fffmpeg-x11-grab-black-screen-on-ubuntu-server%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

Mangá

Eduardo VII do Reino Unido