LukeSmithxyz / LARBS

Luke's Auto-Rice Bootstrapping Scripts: Installation Scripts for My Arch Linux Meta-Distribution
GNU General Public License v3.0
2.02k stars 797 forks source link

cant record using dmenurecord using 2 monitors #541

Open thecodsman opened 7 months ago

thecodsman commented 7 months ago

When I select screencast it doesnt work. This is the output when I start it from the terminal:

ffmpeg version n6.0 Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 13.2.1 (GCC) 20230801
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray
--enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libjxl --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpl --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-version3 --enable-vulkan
  libavutil      58.  2.100 / 58.  2.100
  libavcodec     60.  3.100 / 60.  3.100
  libavformat    60.  3.100 / 60.  3.100
  libavdevice    60.  1.100 / 60.  1.100
  libavfilter     9.  3.100 /  9.  3.100
  libswscale      7.  1.100 /  7.  1.100
  libswresample   4. 10.100 /  4. 10.100
  libpostproc    57.  1.100 / 57.  1.100
[xcbgrab indev @ 0x55c2adc63540] Unable to parse option value "2560x1440
1920x1080" as image size
[xcbgrab indev @ 0x55c2adc63540] Error setting option video_size to value 2560x1440
1920x1080.
:0: Invalid argument

Ideally it would just prompt for which screen it records.

smoorg commented 4 months ago

Clearly you added wrong resolution, see man ffmpeg and search for X11 grabbing. There are bunch of examples with resolution.

X11 grabbing
       Grab the X11 display with ffmpeg via

               ffmpeg -f x11grab -video_size cif -framerate 25 -i :0.0 /tmp/out.mpg

       0.0 is display.screen number of your X11 server, same as the DISPLAY environment variable.

               ffmpeg -f x11grab -video_size cif -framerate 25 -i :0.0+10,20 /tmp/out.mpg

       0.0 is display.screen number of your X11 server, same as the DISPLAY environment variable. 10  is  the  x-offset  and  20  the
       y-offset for the grabbing.

If you need partial screen picker without a sound here's my script for that purpose. In case of adding sound you would have to tinker it yourself, I purposefully ignored that part. You have to install slop to make it work though. It works best if you bind it to certain keyboard shortut as you run script again to stop recording.