muammar / mkchromecast

Cast macOS and Linux Audio/Video to your Google Cast and Sonos Devices
http://mkchromecast.com
Other
2.19k stars 136 forks source link

Dark screen w/ --screencast #380

Open ghost opened 2 years ago

ghost commented 2 years ago

For some reason, the cast is completely dark with --screencast for me

-y works, and ffmpeg/x11grab also works, i have no idea what's went wrong, maybe theres an unsupported codec somewhere? I'm using h.264 which is apparently supported

ffmpeg-related output (when run w/ mkchromecast --video --encoder-backend ffmpeg --resolution 1080p --screencast --display :0 --vcodec h.264):

[...]
:::ffmpeg::: command: ['ffmpeg', '-ac', '2', '-ar', '44100', '-frame_size', '2048', '-fragment_size', '2048', '-f', 'pulse', '-ac', '2', '-i', 'Mkchromecast.monitor', '-f', 'x11grab', '-r', '25', '-s', '1920x1080', '-i', ':0+0,0', '-vcodec', 'h.264', '-preset', 'veryfast', '-tune', 'zerolatency', '-maxrate', '10000k', '-bufsize', '20000k', '-pix_fmt', 'yuv420p', '-g', '60', '-f', 'mp4', '-movflags', 'frag_keyframe+empty_moov', '-ar', '44100', '-acodec', 'libvorbis', 'pipe:1'].

The media type string used is: video/mp4
PLAY command requested but no session is active.

Cast media controller status

CastStatus(is_active_input=False, is_stand_by=True, volume_level=0.14000000059604645, volume_muted=False, app_id='[...]', display_name='Default Media Receiver', namespaces=['urn:x-cast:com.google.cast.cac', 'urn:x-cast:com.google.cast.debugoverlay', 'urn:x-cast:com.google.cast.broadcast', 'urn:x-cast:com.google.cast.media'], session_id='[...]', transport_id='[...]', status_text='Default Media Receiver', icon_url='', volume_control_type='master')

ffmpeg version 4.4 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 11 (Solus)
  configuration: --enable-avresample --enable-gcrypt --enable-gnutls --enable-gpl --enable-libaom --enable-libass --enable-libbluray --enable-libcdio --enable-libdav1d --enable-libdrm --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librav1e --enable-librubberband --enable-libsmbclient --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libv4l2 --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-openal --enable-opengl --enable-sdl2 --enable-shared --enable-version3 --enable-vulkan --disable-debug --disable-static --disable-stripping --libdir=/usr/lib64 --prefix=/usr
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, pulse, from 'Mkchromecast.monitor':
  Duration: N/A, start: 1637826510.488934, bitrate: 1411 kb/s
  Stream #0:0: Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s16le (native) -> vorbis (libvorbis))
Press [q] to stop, [?] for help
Output #0, ogg, to 'pipe:':
  Metadata:
    encoder         : Lavf58.76.100
  Stream #0:0: Audio: vorbis, 32000 Hz, stereo, fltp, 128 kb/s
    Metadata:
      encoder         : Lavc58.134.100 libvorbis
192.168.2.100 - - [24/Nov/2021 23:48:30] "GET /stream HTTP/1.1" 200 -
pcastready ? _play_cast_ success bitrate=  70.8kbits/s speed=0.988x    
size=    2124kB time=00:02:43.45 bitrate= 106.5kbits/s speed=   1x     
size=    2156kB time=00:02:43.82 bitrate= 107.8kbits/s speed=   1x    
video:0kB audio:2130kB subtitle:0kB other streams:0kB global headers:4kB muxing overhead: 1.197840%

btw i ❤️ what you made here, keep it up y'all!

joaomiguelvieira commented 6 months ago

Same problem here...

Everything but the screencast works fine. However, I get a black screen when casting the entire desktop (mkchromecast --name tv_joao --control --notifications --video --screencast). The cursor does show sporadically, however.

Do you happen to know what may be the origin of this problem?

User8395 commented 2 weeks ago

Are you using Wayland?

joaomiguelvieira commented 1 week ago

Are you using Wayland?

Yes, indeed I was! Ended up using another solution, but - just out of curiosity - was that the problem? Is it now compatible with Wayland or the issue still persists?

User8395 commented 1 week ago

Are you using Wayland?

Yes, indeed I was! Ended up using another solution, but - just out of curiosity - was that the problem? Is it now compatible with Wayland or the issue still persists?

Wayland has been known to cause issues with anything related to screen sharing. If there is an option to use mkchromecast with pipewire, that should work.