Closed voor closed 8 years ago
It's probably worth noting I have a fairly large screen setup:
➜ ~ xrandr
Screen 0: minimum 8 x 8, current 4480 x 1440, maximum 16384 x 16384
DVI-I-0 disconnected (normal left inverted right x axis y axis)
DVI-I-1 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected 1920x1080+2560+0 (normal left inverted right x axis y axis) 509mm x 286mm
1920x1080 60.00*+
1680x1050 59.95
1440x900 59.89
1280x1024 75.02 60.02
1280x960 60.00
1280x720 60.00
1024x768 75.03 70.07 60.00
800x600 75.00 72.19 60.32 56.25
640x480 75.00 72.81 59.94
DP-0 disconnected (normal left inverted right x axis y axis)
DVI-D-0 disconnected (normal left inverted right x axis y axis)
DP-1 connected primary 2560x1440+0+0 (normal left inverted right x axis y axis) 598mm x 336mm
2560x1440 59.95*+ 144.00 120.00 99.95 84.98 23.97
Okay, I think I figured out the problem. Since it's showing 1820x1080 first in my xrandr, this line in genffcom is causing problems:
xrandr --current | grep '*' | uniq | awk '{print $1}' | cut -d 'x' -f1)
Since on my box that'll return:
➜ ~ xrandr --current | grep '*' | uniq | awk '{print $1}' | cut -d 'x' -f1
1920
2560
Except that's just my first monitor, there's a second monitor that is larger (2560x1440)
Okay, that was not the problem, but just to be safe I went ahead and created a version that will utilize the first line of xrandr to get the max x and max y.
Definitely nothing even related to screencast that I can gather, just running this command alone:
➜ ~ ffmpeg -f x11grab -s 4480x1440 -r 8 -i :0.0+0,0 -c:v ffvhuff -an -y /tmp/silentcast/temp.mkv
ffmpeg version 2.6.3 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 5.1.1 (GCC) 20150422 (Red Hat 5.1.1-1)
configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-frei0r --enable-gnutls --enable-ladspa --enable-libass --enable-libcdio --enable-libdc1394 --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopencv --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
libavutil 54. 20.100 / 54. 20.100
libavcodec 56. 26.100 / 56. 26.100
libavformat 56. 25.101 / 56. 25.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 11.102 / 5. 11.102
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
Invalid MIT-MAGIC-COOKIE-1 key[x11grab @ 0xdb3de0] Cannot open display :0.0+0,0, error 1.
:0.0+0,0: Input/output error
Is causing the error.
I just upgraded to Fedora 22 and found that DISPLAY=:1
so try this
fmpeg -f x11grab -s 4480x1440 -r 8 -i :1.0+0,0 -c:v ffvhuff -an -y /tmp/silentcast/temp.mkv
@dereke :+1: Thank you, that fixed the problem. I issued a pull request with the necessary changes for this to work in Fedora 22!
@dereke and @voor. Thanks, I've merged the pull request, but wouldn't it be better to use '${DISPLAY:-\:0.0}
instead of '${DISPLAY:-\:0}'.0
?
Doesn't your code produce an extra .0
at the end whenever DISPLAY
is defined?
Or, is it that DISPLAY
is defined as simply :1
in Fedora 22? For Arch Linux with XFCE on my single monitor system, it's coming up as :0.0
. So, your code would put :0.0.0
into the ffmpeg
command.
Yeah, it's just coming up as :1
in Fedora 22. Everything works fine with the change you're suggesting in Fedora 22.
I put another pull request to make that fix, #20
@voor Thanks for your work. Since I can't work on multi-monitors, can you test something out (and if it works, fix the code for me)? I was wondering why the $DISPLAY variable used to be like :0.0 (and still is on my system). I discovered the first number was because there could be more than one keyboard/mouse/monitor hooked up to the same computer. The 2nd number would be if there was more than one monitor hooked to a single "display". On your system, the display is :1. Can you test if :1.0, :1.1, :1.2 record different monitors?
I re-opened the issue just until you reply that you look at how ffmpeg handles the part of the display after the "dot". Also, can you see if there's a way to tell what monitor a window is on?
It actually works fine with just $DISPLAY :1
, at least for the interior of windows.
That first "blip" in the above one is the silentcast window getting recorded for the first frame.
Here is with transparent areas
Yes - I knew that because your code works. But, I'm trying to see if it can be tweaked to solve multi-monitor issues. I don't have more than one monitor. Do you? If you do, can you check what happens if you try :1.0, :1.1, and :1.2? I'm thinking that :1.0 will record the 1st monitor and :1.1 will record the 2nd one. Unless it starts counting from 1 like the display does, then it would be :1.1 for 1st and :1.2 for 2nd. Do you have 2 monitors?
I have two monitors, and both of those gifs were recorded on the second monitor.
And if you look at the text scrolling by, they're both still :1
, I'm not entirely sure what the .1
notation is for, is there documentation on X11 about it?
So, do you mean "as is" it automatically records from the correct monitor when recording a window? What about full screen?
Looking at http://askubuntu.com/questions/432255/what-is-display-environment-variable you'd think the .1
would actually be the 2nd screen, but Fedora must just be stretching the screen across, or something, because anything involving the .1 is causing problems (at least on Fedora):
[x11grab @ 0x1fa4de0] Cannot open display :1.1+0,0, error 6.
:1.1+0,0: Input/output error
Ok, that's why I was asking. I had also found a video showing that to record the 2nd screen you just treat it as though it was an extension of the first screen. I think it's ffmpeg doing that. I'm assuming your display is always :1 regardless of which monitor you're on. I was under the impression those with multi-monitors were having issues. Does Silentcast always work for you regardless of which monitor you try to record? Both fullscreen and windows?
If it seems to work all the time, can you try something different than you usually do. I assume you usually start Silentcast from the same monitor you want to record, which makes a lot of sense. I'm thinking those with issues may be starting Silentcast from monitor 2 then trying to record monitor 1 or vise-versa. Can you try that as well?
I don't always open it from the same monitor I want to record. Fullscreen always records both monitors, although I usually only want to record a specific area of a single monitor instead of a full monitor, so that hasn't been much of a problem.
Thanks. I will close this issue again. It's working better than I thought on multi-monitors, but there needs to be a way to select an entire monitor without selecting the other. That's a different issue, so I'll close this one.
Using Gnome 3.16 in Fedora 22
The ensuing popup states
temp.mkv not found, so can't generate anything from it