smplayer-dev / smplayer

Free Media Player for Windows, Linux and Mac OS with YouTube support.
https://smplayer.info
GNU General Public License v2.0
665 stars 94 forks source link

Issue with -wid XXX option #858

Closed SebastienPi closed 10 months ago

SebastienPi commented 10 months ago

For months, I can not use SMplayer: crash or black screen depending on the selected output driver.

Example with x11, SMplayer produces the command line, screen is black and I see planty of errors: /usr/bin/mplayer -noquiet -slave -identify -nofs -lavdopts threads=2 -sub-fuzziness 1 -vo x11, -zoom -framedrop -dr -nodouble -nomouseinput -input nodefault-bindings:conf=/dev/null -nokeepaspect -wid 67108910 -monitorpixelaspect 1 -osdlevel 0 -subfont-osd-scale 0 -progbar-align 80 -ass -embeddedfonts -ass-line-spacing 0 -ass-font-scale 1 -ass-force-style 'PlayResX=512,PlayResY=320,Name=Default,Fontname=DejaVu Sans,Fontsize=20,PrimaryColour=&H00ffffff,BackColour=&H00000000,OutlineColour=&H00000000,Bold=0,Italic=0,Alignment=2,BorderStyle=1,Outline=0.7,Shadow=0,MarginL=20,MarginR=20,MarginV=8' -subcp UTF-8 -alang 'jpn,jp,eng,en,fre,en' -slang 'fre,fr' -subpos 100 -volume 100 -cache 4096 -vf-add screenshot=/home/s-s/.config/smplayer/screenshots//shot -noslices -af-add scaletempo /home/s-s/MyFile.mp4 =>


libavformat version 60.3.100 (external)
libavformat file format detected.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f1058fe41e0]Protocol name not provided, cannot determine if input is local or a network protocol, buffers and access patterns cannot be configured optimally without knowing the protocol
ID_VIDEO_ID=0
[lavf] stream 0: video (h264), -vid 0
ID_AUDIO_ID=0
[lavf] stream 1: audio (aac), -aid 0, -alang und
VIDEO:  [H264]  1280x720  24bpp  23.976 fps  737.8 kbps (90.1 kbyte/s)
Opening video filter: [ass auto=1]
[ass] auto-open
Opening video filter: [screenshot=/home/s-s/.config/smplayer/screenshots//shot]
[ass] libass API version: 0x1701000
[ass] libass source: tarball: 0.17.1
[ass] Shaper: FriBidi 1.0.12 (SIMPLE) HarfBuzz-ng 8.2.0 (COMPLEX)
[ass] Using font provider fontconfig
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 60.3.100 (external)
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
ID_VIDEO_CODEC=ffh264
Clip info:
 major_brand: isom
ID_CLIP_INFO_NAME0=major_brand
ID_CLIP_INFO_VALUE0=isom
 minor_version: 512
ID_CLIP_INFO_NAME1=minor_version
ID_CLIP_INFO_VALUE1=512
 compatible_brands: isomiso2avc1mp41
ID_CLIP_INFO_NAME2=compatible_brands
ID_CLIP_INFO_VALUE2=isomiso2avc1mp41
 encoder: Lavf57.71.100
ID_CLIP_INFO_NAME3=encoder
ID_CLIP_INFO_VALUE3=Lavf57.71.100
ID_CLIP_INFO_N=4
Load subtitles in /home/s-s/
ID_FILENAME=/home/s-s/MyFile.mp4
ID_DEMUXER=lavfpref
ID_VIDEO_FORMAT=H264
ID_VIDEO_BITRATE=737808
ID_VIDEO_WIDTH=1280
ID_VIDEO_HEIGHT=720
ID_VIDEO_FPS=23.976
ID_VIDEO_ASPECT=0.0000
ID_AUDIO_FORMAT=MP4A
ID_AUDIO_BITRATE=243152
ID_AUDIO_RATE=44100
ID_AUDIO_NCH=2
ID_START_TIME=-0.02
ID_LENGTH=1425.05
ID_SEEKABLE=1
ID_CHAPTERS=0
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
[aac @ 0x7f105879dee0]Multiple frames in a packet.
AUDIO: 44100 Hz, 2 ch, floatle, 243.2 kbit/8.62% (ratio: 30394->352800)
ID_AUDIO_BITRATE=243152
ID_AUDIO_RATE=44100
ID_AUDIO_NCH=2
Selected audio codec: [ffaac] afm: ffmpeg (FFmpeg AAC (MPEG-2/MPEG-4 Audio))
==========================================================================
AO: [alsa] 48000Hz 2ch floatle (4 bytes per sample)
ID_AUDIO_CODEC=ffaac
Starting playback...
[aac @ 0x7f105879dee0]channel element 0.0 duplicate
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
ID_VIDEO_ASPECT=1.7778
[swscaler @ 0x7f10592df080]using unscaled yuv420p -> rgb24 special converter
VO: [x11] 1280x720 => 1280x720 Planar YV12  [zoom]
X11 error: BadWindow (invalid Window parameter)
X11 error: BadWindow (invalid Window parameter)
X11 error: BadWindow (invalid Window parameter)
X11 error: BadDrawable (invalid Pixmap or Window parameter)
[… then I stop it because I can not see anything]
MPlayer interrupted by signal 2 in module: sleep_timer
ID_SIGNAL=2

MPlayer interrupted by signal 2 in module: enable_cache
ID_SIGNAL=2
X11 error: BadDrawable (invalid Pixmap or Window parameter)
X Error of failed request:  BadGC (invalid GC parameter)  1.0% 0 0 52% 
  Major opcode of failed request:  60 (X_FreeGC)
  Resource id in failed request:  0x6400002
  Serial number of failed request:  278
  Current serial number in output stream:  281

With default driver, I have another issue, it crashes immediately: /usr/bin/mplayer -noquiet -slave -identify -nofs -lavdopts threads=2 -sub-fuzziness 1 -framedrop -dr -nodouble -nomouseinput -input nodefault-bindings:conf=/dev/null -nokeepaspect -wid 67108910 -monitorpixelaspect 1 -osdlevel 0 -subfont-osd-scale 0 -progbar-align 80 -ass -embeddedfonts -ass-line-spacing 0 -ass-font-scale 1 -ass-force-style 'PlayResX=512,PlayResY=320,Name=Default,Fontname=DejaVu Sans,Fontsize=20,PrimaryColour=&H00ffffff,BackColour=&H00000000,OutlineColour=&H00000000,Bold=0,Italic=0,Alignment=2,BorderStyle=1,Outline=0.7,Shadow=0,MarginL=20,MarginR=20,MarginV=8' -subcp UTF-8 -alang 'jpn,jp,eng,en,fre,en' -slang 'fre,fr' -subpos 100 -volume 100 -cache 4096 -vf-add screenshot=/home/s-s/.config/smplayer/screenshots//shot -noslices -af-add scaletempo /home/s-s/MyFile.mp4


Cache fill:  0.00% (0 bytes)   

libavformat version 60.3.100 (external)
libavformat file format detected.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f0ec18851e0]Protocol name not provided, cannot determine if input is local or a network protocol, buffers and access patterns cannot be configured optimally without knowing the protocol
ID_VIDEO_ID=0
[lavf] stream 0: video (h264), -vid 0
ID_AUDIO_ID=0
[lavf] stream 1: audio (aac), -aid 0, -alang und
VIDEO:  [H264]  1280x720  24bpp  23.976 fps  737.8 kbps (90.1 kbyte/s)
Opening video filter: [ass auto=1]
Couldn't open video filter 'ass'.
ASS: cannot add video filter
Opening video filter: [screenshot=/home/s-s/.config/smplayer/screenshots//shot]
[ass] libass API version: 0x1701000
[ass] libass source: tarball: 0.17.1
[ass] Shaper: FriBidi 1.0.12 (SIMPLE) HarfBuzz-ng 8.2.0 (COMPLEX)
[ass] Using font provider fontconfig
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 60.3.100 (external)
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
ID_VIDEO_CODEC=ffh264
Clip info:
 major_brand: isom
ID_CLIP_INFO_NAME0=major_brand
ID_CLIP_INFO_VALUE0=isom
 minor_version: 512
ID_CLIP_INFO_NAME1=minor_version
ID_CLIP_INFO_VALUE1=512
 compatible_brands: isomiso2avc1mp41
ID_CLIP_INFO_NAME2=compatible_brands
ID_CLIP_INFO_VALUE2=isomiso2avc1mp41
 encoder: Lavf57.71.100
ID_CLIP_INFO_NAME3=encoder
ID_CLIP_INFO_VALUE3=Lavf57.71.100
ID_CLIP_INFO_N=4
Load subtitles in /home/s-s/
ID_FILENAME=/home/s-s/MyFile.mp4
ID_DEMUXER=lavfpref
ID_VIDEO_FORMAT=H264
ID_VIDEO_BITRATE=737808
ID_VIDEO_WIDTH=1280
ID_VIDEO_HEIGHT=720
ID_VIDEO_FPS=23.976
ID_VIDEO_ASPECT=0.0000
ID_AUDIO_FORMAT=MP4A
ID_AUDIO_BITRATE=243152
ID_AUDIO_RATE=44100
ID_AUDIO_NCH=2
ID_START_TIME=-0.02
ID_LENGTH=1425.05
ID_SEEKABLE=1
ID_CHAPTERS=0
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
[aac @ 0x7f0ec103eee0]Multiple frames in a packet.
AUDIO: 44100 Hz, 2 ch, floatle, 243.2 kbit/8.62% (ratio: 30394->352800)
ID_AUDIO_BITRATE=243152
ID_AUDIO_RATE=44100
ID_AUDIO_NCH=2
Selected audio codec: [ffaac] afm: ffmpeg (FFmpeg AAC (MPEG-2/MPEG-4 Audio))
==========================================================================
AO: [alsa] 48000Hz 2ch floatle (4 bytes per sample)
ID_AUDIO_CODEC=ffaac
Starting playback...
[aac @ 0x7f0ec103eee0]channel element 0.0 duplicate
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
ID_VIDEO_ASPECT=1.7778
[swscaler @ 0x7f0ec193a080]using unscaled yuv420p -> rgb24 special converter
VO: [vdpau] 1280x720 => 1280x720 Planar YV12 
X11 error: BadWindow (invalid Window parameter)
X11 error: BadWindow (invalid Window parameter)
X11 error: BadDrawable (invalid Pixmap or Window parameter)
X11 error: BadWindow (invalid Window parameter)
X11 error: BadDrawable (invalid Pixmap or Window parameter)
X11 error: BadWindow (invalid Window parameter)
X11 error: BadDrawable (invalid Pixmap or Window parameter)
X11 error: BadWindow (invalid Window parameter)

X11 error: BadDrawable (invalid Pixmap or Window parameter)
X11 error: BadDrawable (invalid Pixmap or Window parameter)
X11 error: BadWindow (invalid Window parameter)
X11 error: BadWindow (invalid Window parameter)
X11 error: BadDrawable (invalid Pixmap or Window parameter)
X11 error: BadWindow (invalid Window parameter)

X11 error: BadDrawable (invalid Pixmap or Window parameter)
X11 error: BadDrawable (invalid Pixmap or Window parameter)
X11 error: BadWindow (invalid Window parameter)
X11 error: BadWindow (invalid Window parameter)
X11 error: BadDrawable (invalid Pixmap or Window parameter)
X11 error: BadWindow (invalid Window parameter)

X11 error: BadDrawable (invalid Pixmap or Window parameter)
X11 error: BadDrawable (invalid Pixmap or Window parameter)
X11 error: BadWindow (invalid Window parameter)
X11 error: BadWindow (invalid Window parameter)
X11 error: BadDrawable (invalid Pixmap or Window parameter)
X11 error: BadWindow (invalid Window parameter)
[vdpau] Error when calling vdp_presentation_queue_display: An invalid handle value was provided. Either the handle does not exist at all, or refers to an object of an incorrect type.

X11 error: BadWindow (invalid Window parameter)
X11 error: BadDrawable (invalid Pixmap or Window parameter)
X11 error: BadWindow (invalid Window parameter)

MPlayer interrupted by signal 11 in module: flip_page
ID_SIGNAL=11
- MPlayer crashed by bad usage of CPU/FPU/RAM.
  Recompile MPlayer with --enable-debug and make a 'gdb' backtrace and
  disassembly. Details in DOCS/HTML/en/bugreports_what.html#bugreports_crash.
- MPlayer crashed. This shouldn't happen.
  It can be a bug in the MPlayer code _or_ in your drivers _or_ in your
  gcc version. If you think it's MPlayer's fault, please read
  DOCS/HTML/en/bugreports.html and follow the instructions there. We can't and
  won't help unless you provide this information when reporting a possible bug.
Parent process disappeared, exiting cache process.

In all cases, remove “-wid XXX” makes mplayer to work again. Is there a way to remove that option?

To Reproduce Not sure why it happens here / how to reproduce.

Expected behavior No crash and see my video in SMplayer interface.

Your Enviroment

Version :

smplayer-dev commented 10 months ago

The option '-wid' is what makes the video display within SMPlayer. Without that option, the video will appear in a separate window. You can remove that option by enabling the "Run mplayer in its own window" option in Preferences -> Advanced -> MPlayer.

SebastienPi commented 10 months ago

The option '-wid' is what makes the video display within SMPlayer. Without that option, the video will appear in a separate window. You can remove that option by enabling the "Run mplayer in its own window" option in Preferences -> Advanced -> MPlayer.

As you say, without that option, the video is in a separate window. So it is not really what I want. I prefer, of course, to have the video inside SMPlayer :).

So, it may be more a mplayer bug. This option is useful. I am not in Wayland issue (https://trac.mplayerhq.hu/ticket/2411 & https://github.com/smplayer-dev/smplayer/issues/668) as far I understand. https://forum.qt.io/topic/58920/x11-error-when-running-embedded-mplayer-in-qwidget => this one talks about bad ID. It does not seem to be my case (not sure).

smplayer-dev commented 10 months ago

Do you have also the same problem if select another video output in preferences -> general? Does it work if you use mpv instead of mplayer?

SebastienPi commented 10 months ago

Not the sames issues:

I do not have mpv yet. Will try later. I will try to recompile mplayer before because I had some hardware issues (which leads to a lot of crashed) in August/September and mplayer was compiled in September.

About winId, is there a way to check that it is the right one? I did not see any log on it. https://github.com/search?q=repo%3Asmplayer-dev%2Fsmplayer+winId&type=code => https://doc.qt.io/qt-6/qwidget.html#winId => I saw that it can change. Not sure it is revelant…

SebastienPi commented 10 months ago

Nor mpv or recompile mplayer change anything. Log with mpv: mpv.log

Inside, I saw a vdpau error. I tried another file with another codec and got the same error with windows parameter. vdpau does not seem to be a cause.

Raza-0007 commented 10 months ago

@SebastienPi

I saw you post, I am not a Linux guy so I may not be able to help with you specific issue. But I read that you have been trying to resolve this issue for months, so I thought I should provide some general recommendations.

First, the recommended engine to use with smplayer is mpv. mplayer has not been in active development for a long while, they do release updates once in a while, but those are just to update codecs etc. mpv on the other hand is derived from mplayer code, and is being actively developed and maintained.

If you do insist on using mplayer, then start with the default smplayer profile. Everything should be on auto, especially hardware decoding needs to be auto or disabled.

If you switch to mpv, then again start with a default smplayer profile with everything on auto. For example, the hwdec vdpau that you used has been depreciated in mpv, and will give errors. Either use one of the actively developed hwdec or use auto so mpv can determine the best hwdec for your system.

Hopefully, the above steps will resolve your issue.

~Raza

SebastienPi commented 10 months ago

Hi @Raza-0007!

I only try to resolve it recently. I do not often watch videos, so I swiched to vlc :shushing_face:.

As I said in the previous comment: I tried mpv and got the same “invalid Window parameter”. Good idea to switch to default parameter:

SMPlayer selects mpv and it works. Same thing if I switch back to mplayer. You are right, I had a bad parameter somewhere. After play a bit with the conf, it looks like it is something around vdpau. I add some issue with my graphic card and change it two months ago. Thanks!