VideoHelp Forum
+ Reply to Thread
Results 1 to 12 of 12
Thread
  1. Chicken McNewblet
    Join Date
    Sep 2009
    Location
    United States
    Search Comp PM
    Hey guys, so I'm trying to do some screen recording on Xubuntu Linux 20.04 using a new laptop I bought. I'm trying to set this up as simple as possible, which in my case is setting the following command up as a simple alias:

    Code:
    ffmpeg -video_size 1920x1080 -framerate 24 -f x11grab -c:v h264_nvenc -qp 0 ~/Desktop/video.mp4
    However, I get the following message in response:

    Code:
    [NULL @ 0x5601c0bee900] Requested output format 'x11grab' is not a suitable output format
    Is there a different window manager I should be specifying on XFCE? If I type the following command:

    Code:
    ffmpeg -formats
    x11grab is listed as a decoder, so it's definitely present. Using that "-f x11grab" argument is what the ffmpeg documentation says to do. Anyone got any bright ideas?
    Quote Quote  
  2. Your missing an input parameter. FFmpeg needs the display number of the screen you want to capture.This should work.

    Code:
    ffmpeg -video_size 1920x1080 -framerate 24 -f x11grab -i :0.0 -c:v h264_nvenc -qp 0 ~/Desktop/video.mp4
    http://https://ffmpeg.org/ffmpeg-devices.html#x11grab
    Quote Quote  
  3. Chicken McNewblet
    Join Date
    Sep 2009
    Location
    United States
    Search Comp PM
    Originally Posted by jk50 View Post
    Your missing an input parameter. FFmpeg needs the display number of the screen you want to capture.This should work.

    Code:
    ffmpeg -video_size 1920x1080 -framerate 24 -f x11grab -i :0.0 -c:v h264_nvenc -qp 0 ~/Desktop/video.mp4
    http://https://ffmpeg.org/ffmpeg-devices.html#x11grab
    Nah I tried that, still get the same error.
    Quote Quote  
  4. Member
    Join Date
    Feb 2006
    Location
    United States
    Search Comp PM
    Originally Posted by CursedLemon View Post
    Originally Posted by jk50 View Post
    Your missing an input parameter. FFmpeg needs the display number of the screen you want to capture.This should work.

    Code:
    ffmpeg -video_size 1920x1080 -framerate 24 -f x11grab -i :0.0 -c:v h264_nvenc -qp 0 ~/Desktop/video.mp4
    http://https://ffmpeg.org/ffmpeg-devices.html#x11grab
    Nah I tried that, still get the same error.
    try ffmpeg -f x11grab -r 30 -i :0.0+x,y -f flv rtmp://url?
    - https://superuser.com/questions/709866/ffmpeg-x11grab-a-single-window
    Quote Quote  
  5. Chicken McNewblet
    Join Date
    Sep 2009
    Location
    United States
    Search Comp PM
    Originally Posted by october262 View Post
    Originally Posted by CursedLemon View Post
    Originally Posted by jk50 View Post
    Your missing an input parameter. FFmpeg needs the display number of the screen you want to capture.This should work.

    Code:
    ffmpeg -video_size 1920x1080 -framerate 24 -f x11grab -i :0.0 -c:v h264_nvenc -qp 0 ~/Desktop/video.mp4
    http://https://ffmpeg.org/ffmpeg-devices.html#x11grab
    Nah I tried that, still get the same error.
    try ffmpeg -f x11grab -r 30 -i :0.0+x,y -f flv rtmp://url?
    - https://superuser.com/questions/709866/ffmpeg-x11grab-a-single-window
    Still doesn't get past the x11grab part, also there's two uses of "-f" there?
    Quote Quote  
  6. Member
    Join Date
    Feb 2006
    Location
    United States
    Search Comp PM
    Originally Posted by CursedLemon View Post
    Originally Posted by october262 View Post
    Originally Posted by CursedLemon View Post
    Originally Posted by jk50 View Post
    Your missing an input parameter. FFmpeg needs the display number of the screen you want to capture.This should work.

    Code:
    ffmpeg -video_size 1920x1080 -framerate 24 -f x11grab -i :0.0 -c:v h264_nvenc -qp 0 ~/Desktop/video.mp4
    http://https://ffmpeg.org/ffmpeg-devices.html#x11grab
    Nah I tried that, still get the same error.
    try ffmpeg -f x11grab -r 30 -i :0.0+x,y -f flv rtmp://url?
    - https://superuser.com/questions/709866/ffmpeg-x11grab-a-single-window
    Still doesn't get past the x11grab part, also there's two uses of "-f" there?
    have you tried these ?? - https://trac.ffmpeg.org/wiki/Capture/Desktop
    Quote Quote  
  7. Chicken McNewblet
    Join Date
    Sep 2009
    Location
    United States
    Search Comp PM
    Originally Posted by october262 View Post
    Originally Posted by CursedLemon View Post
    Originally Posted by october262 View Post
    Originally Posted by CursedLemon View Post
    Originally Posted by jk50 View Post
    Your missing an input parameter. FFmpeg needs the display number of the screen you want to capture.This should work.

    Code:
    ffmpeg -video_size 1920x1080 -framerate 24 -f x11grab -i :0.0 -c:v h264_nvenc -qp 0 ~/Desktop/video.mp4
    http://https://ffmpeg.org/ffmpeg-devices.html#x11grab
    Nah I tried that, still get the same error.
    try ffmpeg -f x11grab -r 30 -i :0.0+x,y -f flv rtmp://url?
    - https://superuser.com/questions/709866/ffmpeg-x11grab-a-single-window
    Still doesn't get past the x11grab part, also there's two uses of "-f" there?
    have you tried these ?? - https://trac.ffmpeg.org/wiki/Capture/Desktop
    That's where I got my syntax from, it doesn't seem like there's any other mechanism for capturing your screen on Linux other than x11grab.
    Quote Quote  
  8. Member
    Join Date
    Feb 2006
    Location
    United States
    Search Comp PM
    Originally Posted by CursedLemon View Post
    Originally Posted by october262 View Post
    Originally Posted by CursedLemon View Post
    Originally Posted by october262 View Post
    Originally Posted by CursedLemon View Post
    Originally Posted by jk50 View Post
    Your missing an input parameter. FFmpeg needs the display number of the screen you want to capture.This should work.

    Code:
    ffmpeg -video_size 1920x1080 -framerate 24 -f x11grab -i :0.0 -c:v h264_nvenc -qp 0 ~/Desktop/video.mp4
    http://https://ffmpeg.org/ffmpeg-devices.html#x11grab
    Nah I tried that, still get the same error.
    try ffmpeg -f x11grab -r 30 -i :0.0+x,y -f flv rtmp://url?
    - https://superuser.com/questions/709866/ffmpeg-x11grab-a-single-window
    Still doesn't get past the x11grab part, also there's two uses of "-f" there?
    have you tried these ?? - https://trac.ffmpeg.org/wiki/Capture/Desktop
    That's where I got my syntax from, it doesn't seem like there's any other mechanism for capturing your screen on Linux other than x11grab.
    for this error - [NULL @ 0x5601c0bee900] Requested output format 'x11grab' is not a suitable output format
    in your first post, try this fix - https://rubenerd.com/recording-screens-with-ffmpeg/
    Quote Quote  
  9. Chicken McNewblet
    Join Date
    Sep 2009
    Location
    United States
    Search Comp PM
    Heeey I've actually made "progress", so this is the current command I'm running:

    Code:
    ffmpeg -framerate 24 -f x11grab -i :0.0 -c:v h264_nvenc -qp 20 ~/Desktop/video.mp4
    But now I'm getting this message: "Cannot load libcuda.so.1, Error while opening encoder for output stream #0.0 - maybe incorrect parameters such as bite_rate, rate, width or height"

    I don't see any bad parameters, does anyone else? Or is my syntax wrong yet again?
    Quote Quote  
  10. Member
    Join Date
    Feb 2006
    Location
    United States
    Search Comp PM
    Originally Posted by CursedLemon View Post
    Heeey I've actually made "progress", so this is the current command I'm running:

    Code:
    ffmpeg -framerate 24 -f x11grab -i :0.0 -c:v h264_nvenc -qp 20 ~/Desktop/video.mp4
    But now I'm getting this message: "Cannot load libcuda.so.1, Error while opening encoder for output stream #0.0 - maybe incorrect parameters such as bite_rate, rate, width or height"

    I don't see any bad parameters, does anyone else? Or is my syntax wrong yet again?
    for this - Cannot load libcuda.so.1, Error while opening encoder for output stream #0.0 - maybe incorrect parameters such as bite_rate, rate, width or height
    see here - https://stackoverflow.com/questions/13877031/error-while-opening-encoder-for-output-st...ect-parameters
    Quote Quote  
  11. Chicken McNewblet
    Join Date
    Sep 2009
    Location
    United States
    Search Comp PM
    I'm not trying to record audio at the moment and there's no audio stream present anyway, so that doesn't have an effect. Here's the full output:

    Code:
    master@lemonNITRO:~ $ ffmpeg -video_size 1920x1080 -framerate 24 -f x11grab -i :0.0 -acodec copy -c:v h264_nvenc -qp 20 ~/Desktop/recording.mp4
    ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers
      built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
      configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
      libavutil      56. 31.100 / 56. 31.100
      libavcodec     58. 54.100 / 58. 54.100
      libavformat    58. 29.100 / 58. 29.100
      libavdevice    58.  8.100 / 58.  8.100
      libavfilter     7. 57.100 /  7. 57.100
      libavresample   4.  0.  0 /  4.  0.  0
      libswscale      5.  5.100 /  5.  5.100
      libswresample   3.  5.100 /  3.  5.100
      libpostproc    55.  5.100 / 55.  5.100
    [x11grab @ 0x55f63c141840] Stream #0: not enough frames to estimate rate; consider increasing probesize
    Input #0, x11grab, from ':0.0':
      Duration: N/A, start: 1642797024.636254, bitrate: N/A
        Stream #0:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 1920x1080, 24 fps, 1000k tbr, 1000k tbn, 1000k tbc
    File '/home/master/Desktop/recording.mp4' already exists. Overwrite ? [y/N] y
    Stream mapping:
      Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (h264_nvenc))
    Press [q] to stop, [?] for help
    [h264_nvenc @ 0x55f63c14fc40] Cannot load libcuda.so.1
    Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
    Conversion failed!
    Kind of wondering what those tbr/tbc/tbn outputs are about.

    EDIT: Also, bgr0 pixel format?
    Last edited by CursedLemon; 21st Jan 2022 at 14:54.
    Quote Quote  
  12. Chicken McNewblet
    Join Date
    Sep 2009
    Location
    United States
    Search Comp PM
    Just tested recording with:

    Code:
    ffmpeg -video_size 1920x1080 -framerate 24 -f x11grab -i :0.0 -c:v libx264 -crf 20 ~/Desktop/recording.mp4
    It worked great, great quality and tiny file size. So the problem seems to be with initializing h264_nvenc. I'm running the mobile version of RTX3050, does that not have NVENC support?

    EDIT: IT DOESN'T
    Last edited by CursedLemon; 21st Jan 2022 at 15:21.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!