Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid MIT-MAGIC-COOKIE-1 Cannot open display :0.0+0,0 #357

Open
ni3mm4nd opened this issue Mar 11, 2021 · 3 comments
Open

Invalid MIT-MAGIC-COOKIE-1 Cannot open display :0.0+0,0 #357

ni3mm4nd opened this issue Mar 11, 2021 · 3 comments

Comments

@ni3mm4nd
Copy link

ni3mm4nd commented Mar 11, 2021

Hello

I wanted to cast my screen but I'm getting error below:

$ echo $DISPLAY
:1
$ 
$ mkchromecast --video --screencast --resolution 720p
Mkchromecast v0.3.8.1
Starting Video Cast Process...
 * Serving Flask app "mkchromecast.video" (lazy loading)
PID of main process: 2026858
 * Environment: production
PID of streaming process: 2026861
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
 * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
 
List of Devices Available in Network:
-------------------------------------

Index   Types   Friendly Name 
=====   =====   ============= 
0 	Gcast 	MIBOX3
 
Casting to first device shown above!
Select devices by using the -s flag.
 
MIBOX3
 
 
Information about  MIBOX3
 
DeviceStatus(friendly_name='MIBOX3', model_name='MIBOX3', manufacturer='Unknown manufacturer', uuid=UUID('4f7a9f95-e654-3871-0f35-3ee111e7d0e8'), cast_type='cast')
 
Status of device  MIBOX3
 
CastStatus(is_active_input=True, is_stand_by=False, volume_level=0.20000000298023224, volume_muted=False, app_id=None, display_name=None, namespaces=[], session_id=None, transport_id=None, status_text='', icon_url=None)
 
The IP of MIBOX3 is: 192.168.88.169
Your local IP is: 192.168.88.207
 
The media type string used is: video/mp4
 
Cast media controller status
 
CastStatus(is_active_input=True, is_stand_by=False, volume_level=0.20000000298023224, volume_muted=False, app_id=None, display_name=None, namespaces=[], session_id=None, transport_id=None, status_text='', icon_url=None)
 
Remember to open pavucontrol and select the mkchromecast sink.

Ctrl-C to kill the Application at any Time

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
Invalid MIT-MAGIC-COOKIE-1 key[x11grab @ 0x563dd3fd9980] Cannot open display :0.0+0,0, error 1.
:0.0+0,0: Input/output error
192.168.88.169 - - [11/Mar/2021 20:12:33] "GET /stream HTTP/1.1" 200 -

Unfortunately I didn't find any flag to correctly set right display which is not :0.0 which is I guess somewhere hardcoded.

@Onion2222
Copy link

same problem

@BlueDrink9
Copy link

The git version seems to have an option to fix this.

parser.add_argument(

@develeon
Copy link

I get the same on version:
mkchromecast v0.3.8.1

x11grab works:
ffmpeg -video_size 1920x1080 -framerate 30 -f x11grab -i :1 -c:v libx264 -qp 0 -preset ultrafast capture.mkv

Tried mkchromecast:
Added firewall rule : sudo ufw allow 5000

xhost  + 
DISPLAY=:1 mkchromecast -s --control --notifications \
--video --screencast \
--resolution 1080p \
--encoder-backend ffmpeg \ 
--command 'ffmpeg -f lavfi -i anullsrc -f x11grab -r 25 -s 1920x1080 -i :0.0+0,0 -vcodec libx264 -preset ultrafast -tune zerolatency -maxrate 10000k -bufsize 20000k -pix_fmt yuv420p -g 60 -f mp4 -max_muxing_queue_size 9999 -movflags frag_keyframe+empty_moov pipe:1'

But fails with Invalid MIT-MAGIC-COOKIE-1 as well :

ffmpeg version 4.2.7-0ubuntu0.1 Copyright (c) 2000-2022 the FFmpeg developers
                                                                               built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
                                                                                                                                 configuration: --prefix=/usr --extra-version=0ubuntu0.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
                                                                                          Invalid MIT-MAGIC-COOKIE-1 key[x11grab @ 0x55c73d111980] Cannot open display :0.0+0,0, error 1.
:0.0+0,0: Input/output error
192.168.54.8 - - [11/Jan/2024 22:02:09] "GET /stream HTTP/1.1" 200 -

Seems DISPLAY is hardcoded, 'Cannot open display :0.0+0,0, error 1' ^

echo $DISPLAY
:1

And --display seems not to be an invalid cli-argument:

mkchromecast: error: unrecognized arguments: --display

Others encoders give blank/dark screen and or 'default media Receiver' with tray option.

Seems best workaround is using chrome browser casting by now :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants