FedoraForum.org - Fedora Support Forums and Community
Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2010
    Location
    The Netherlands
    Age
    46
    Posts
    250

    ffmpeg fails, Cannot open display :0.0, error 1.

    The ffmpeg command that I was using a lot before, in the previous Fedora releases, does not work any more.
    SOURCE: https://trac.ffmpeg.org/wiki/Capture/Desktop
    Code:
    ffmpeg -video_size 1920x1080 -framerate 30 -f x11grab -i :0.0 -c:v libx264 -qp 0 -preset ultrafast capture.mkv
    It fails with the following message:
    Code:
    Invalid MIT-MAGIC-COOKIE-1 key[x11grab @ 0x5558eb7d5240] Cannot open display :0.0, error 1.
    :0.0: Input/output error
    What is going on? How to fix this?

    Code:
    [boris@E7440 ~]$ ffmpeg -video_size 1920x1080 -framerate 30 -f x11grab -i :0.0 -c:v libx264 -qp 0 -preset ultrafast capture.mkv
    ffmpeg version 3.1.10 Copyright (c) 2000-2017 the FFmpeg developers
      built with gcc 6.4.1 (GCC) 20170727 (Red Hat 6.4.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 -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic' --extra-ldflags='-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld' --enable-bzlib --disable-crystalhd --enable-fontconfig --enable-frei0r --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libcdio --enable-indev=jack --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmp3lame --enable-nvenc --extra-cflags=-I/usr/include/nvenc --enable-openal --enable-opencl --enable-opengl --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-libmfx --enable-runtime-cpudetect
      libavutil      55. 28.100 / 55. 28.100
      libavcodec     57. 48.101 / 57. 48.101
      libavformat    57. 41.100 / 57. 41.100
      libavdevice    57.  0.101 / 57.  0.101
      libavfilter     6. 47.100 /  6. 47.100
      libavresample   3.  0.  0 /  3.  0.  0
      libswscale      4.  1.100 /  4.  1.100
      libswresample   2.  1.100 /  2.  1.100
      libpostproc    54.  0.100 / 54.  0.100
    Invalid MIT-MAGIC-COOKIE-1 key[x11grab @ 0x5558eb7d5240] Cannot open display :0.0, error 1.
    :0.0: Input/output error
    [boris@E7440 ~]$
    Last edited by blnlx; 9th September 2017 at 11:27 PM.
    Fedora25.GNOME@Dell_Latitude_E7440
    Fedora24.MATE@HP_Compaq_DC7100

  2. #2
    Join Date
    Oct 2011
    Posts
    1,612

    Re: ffmpeg fails, Cannot open display :0.0, error 1.

    Log in into "Gnome on Xorg" session, or try some workaround like "xhost +".

  3. #3
    Join Date
    Jun 2005
    Location
    Montreal, Que, Canada
    Posts
    4,482

    Re: ffmpeg fails, Cannot open display :0.0, error 1.

    Fedora supports to versions of GNOME. Wayland and X11.
    After choosing or entering your logon name, there is a gear icon that appears
    choose gnome-xorg
    and continue with your logon.
    Leslie in Montreal

    Interesting web sites list
    http://forums.fedoraforum.org/showth...40#post1697840

  4. #4
    Join Date
    Jan 2010
    Location
    The Netherlands
    Age
    46
    Posts
    250

    Re: ffmpeg fails, Cannot open display :0.0, error 1.

    I tried both "Gnome on Xorg" and "Gnome Classic", still the same message is displayed.
    Fedora25.GNOME@Dell_Latitude_E7440
    Fedora24.MATE@HP_Compaq_DC7100

  5. #5
    Join Date
    Oct 2011
    Posts
    1,612

    Re: ffmpeg fails, Cannot open display :0.0, error 1.

    Are you actually using the display specified?

    Code:
    $ echo $DISPLAY

  6. #6
    bob's Avatar
    bob is online now Administrator (yeah, back again)
    Join Date
    Jul 2004
    Location
    Colton, NY; Junction of Heaven & Earth (also Routes 56 & 68).
    Age
    72
    Posts
    23,338

    Re: ffmpeg fails, Cannot open display :0.0, error 1.

    Linux & Beer - That TOTALLY Computes!
    Registered Linux User #362651


    Don't use any of my solutions on working computers or near small children.

  7. #7
    Join Date
    Jan 2010
    Location
    The Netherlands
    Age
    46
    Posts
    250

    Re: ffmpeg fails, Cannot open display :0.0, error 1.

    Quote Originally Posted by srakitnican
    Are you actually using the display specified?

    Code:
    $ echo $DISPLAY
    Thank you, that was really helpful.

    Code:
    [boris@E7440 ~]$ echo $DISPLAY
    :1
    [boris@E7440 ~]$
    It works now...

    Code:
    [boris@E7440 ~]$ ffmpeg -video_size 1920x1080 -framerate 30 -f x11grab -i :1 -c:v libx264 -qp 0 -preset ultrafast capture.mkv
    ffmpeg version 3.1.10 Copyright (c) 2000-2017 the FFmpeg developers
      built with gcc 6.4.1 (GCC) 20170727 (Red Hat 6.4.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 -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic' --extra-ldflags='-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld' --enable-bzlib --disable-crystalhd --enable-fontconfig --enable-frei0r --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libcdio --enable-indev=jack --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmp3lame --enable-nvenc --extra-cflags=-I/usr/include/nvenc --enable-openal --enable-opencl --enable-opengl --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-libmfx --enable-runtime-cpudetect
      libavutil      55. 28.100 / 55. 28.100
      libavcodec     57. 48.101 / 57. 48.101
      libavformat    57. 41.100 / 57. 41.100
      libavdevice    57.  0.101 / 57.  0.101
      libavfilter     6. 47.100 /  6. 47.100
      libavresample   3.  0.  0 /  3.  0.  0
      libswscale      4.  1.100 /  4.  1.100
      libswresample   2.  1.100 /  2.  1.100
      libpostproc    54.  0.100 / 54.  0.100
    [x11grab @ 0x559882062240] Stream #0: not enough frames to estimate rate; consider increasing probesize
    Input #0, x11grab, from ':1':
      Duration: N/A, start: 1505036793.110097, bitrate: N/A
        Stream #0:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 1920x1080, 30 fps, 1000k tbr, 1000k tbn, 1000k tbc
    No pixel format specified, yuv444p for H.264 encoding chosen.
    Use -pix_fmt yuv420p for compatibility with outdated media players.
    [libx264 @ 0x55988206b720] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
    [libx264 @ 0x55988206b720] profile High 4:4:4 Predictive, level 4.0, 4:4:4 8-bit
    [libx264 @ 0x55988206b720] 264 - core 148 r2708 86b7198 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=0 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=0 chroma_qp_offset=0 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=cqp mbtree=0 qp=0
    [matroska @ 0x559882069f60] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
    Output #0, matroska, to 'capture.mkv':
      Metadata:
        encoder         : Lavf57.41.100
        Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuv444p, 1920x1080, q=-1--1, 30 fps, 1k tbn, 30 tbc
        Metadata:
          encoder         : Lavc57.48.101 libx264
        Side data:
          cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream mapping:
      Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
    Press [q] to stop, [?] for help
    Past duration 0.653297 too large
    frame=  149 fps= 30 q=-1.0 Lsize=    3074kB time=00:00:06.83 bitrate=3685.4kbits/s dup=0 drop=56 speed=1.39x
    Fedora25.GNOME@Dell_Latitude_E7440
    Fedora24.MATE@HP_Compaq_DC7100

Similar Threads

  1. Capture audio with ffmpeg, /dev/dsp and oss fails
    By logictox in forum Using Fedora
    Replies: 1
    Last Post: 11th October 2009, 08:11 PM
  2. ssh -X fail with Error: Can't open display:
    By powah in forum Servers & Networking
    Replies: 3
    Last Post: 8th January 2009, 11:13 PM
  3. "Can't open display" Error when running X applications remotely
    By TsanChung in forum Security and Privacy
    Replies: 1
    Last Post: 8th August 2008, 01:22 AM
  4. Xdmx cannot open display error
    By nitao in forum Using Fedora
    Replies: 1
    Last Post: 4th January 2008, 09:54 AM
  5. FC5 - "Cannot open display" error
    By rapsball4 in forum EOL (End Of Life) Versions
    Replies: 2
    Last Post: 15th June 2006, 02:17 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •