ammen99 / wf-recorder

MIT License
854 stars 63 forks source link

After the desktop notifications disappear, wf-recorder encountered an error: error 1: invalid buffer format. #250

Closed MapoMagpie closed 6 months ago

MapoMagpie commented 7 months ago

https://github.com/ammen99/wf-recorder/assets/33853879/26e2aded-441c-45aa-892a-bb9d93626941

I use this command to capture the screen.

wf-recorder -g "$(slurp)" -r 30 -c libx264 -f ~/Videos/rec_$(date +"%Y%m%d_%H%M%S").mp4

When a certain program sends a notification, and after the notification disappears, wf-recorder throws an error: zwlr_screencopy_frame_v1@9: error 1: invalid buffer format. It seems that desktop notifications are affecting wf-recorder.

Logs:

selected region 1231,313 702x358
Setting codec option: crf=20
Setting codec option: preset=ultrafast
Setting codec option: tune=zerolatency
Framerate: 30
Using video filter: fps=30
[libx264 @ 0x75057c002180] using SAR=1/1
[libx264 @ 0x75057c002180] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x75057c002180] profile Constrained Baseline, level 3.0, 4:2:0, 8-bit
[libx264 @ 0x75057c002180] 264 - core 164 r3108 31e19f9 - H.264/MPEG-4 AVC codec - Copyleft 2003-2023 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=5 lookahead_threads=5 sliced_threads=1 slices=5 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=crf mbtree=0 crf=20.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
Output #0, mp4, to '/home/mapo-magpie/Videos/rec_20240210_225908.mp4':
  Stream #0:0: Video: h264, yuv420p(pc), 702x358 [SAR 1:1 DAR 351:179], q=2-31
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
zwlr_screencopy_frame_v1@9: error 1: invalid buffer format
^C[libx264 @ 0x75057c002180] frame I:2     Avg QP:12.00  size: 37816
[libx264 @ 0x75057c002180] frame P:391   Avg QP:11.01  size:  1262
[libx264 @ 0x75057c002180] mb I  I16..4: 100.0%  0.0%  0.0%
[libx264 @ 0x75057c002180] mb P  I16..4:  1.2%  0.0%  0.0%  P16..4: 14.6%  0.0%  0.0%  0.0%  0.0%    skip:84.1%
[libx264 @ 0x75057c002180] coded y,uvDC,uvAC intra: 39.3% 47.7% 21.2% inter: 5.1% 2.8% 0.4%
[libx264 @ 0x75057c002180] i16 v,h,dc,p: 38% 34% 18% 10%
[libx264 @ 0x75057c002180] i8c dc,h,v,p: 58% 16% 20%  7%
[libx264 @ 0x75057c002180] kb/s:347.47

neofetch:

                    /-                      mapo-magpie@mapo-magpie-master 
                   ooo:                     ------------------------------ 
                  yoooo/                    OS: ArcoLinux x86_64 
                 yooooooo                   Host: MS-7B89 1.0 
                yooooooooo                  Kernel: 6.7.4-arch1-1 
               yooooooooooo                 Uptime: 3 hours, 47 mins 
             .yooooooooooooo                Packages: 1559 (pacman) 
            .oooooooooooooooo               Shell: zsh 5.9 
           .oooooooarcoooooooo              Resolution: 2560x1440 
          .ooooooooo-oooooooooo             DE: Hyprland 
         .ooooooooo-  oooooooooo            WM: sway 
        :ooooooooo.    :ooooooooo           Theme: Arc-Dark [GTK2/3] 
       :ooooooooo.      :ooooooooo          Icons: Sardi-Arc [GTK2], a-candy-beauty-icon- 
      :oooarcooo         .oooarcooo         Terminal: foot 
     :ooooooooy           .ooooooooo        CPU: AMD Ryzen 5 3600 (12) @ 3.600GHz 
    :ooooooooo   /ooooooooooooooooooo       GPU: AMD ATI Radeon RX 5600 OEM/5600 XT / 570 
   :ooooooooo      .-ooooooooooooooooo.     Memory: 5283MiB / 32042MiB 

Notification servers: mako (Dunst also has the same issue.)

ammen99 commented 7 months ago

Could you run wf-recorder with WAYLAND_DEBUG=1 and attach the full log here (as a file or a pastebin)?

MapoMagpie commented 7 months ago

sure logs.zip

ammen99 commented 7 months ago

Ok, it seems like the compositor advertises a different buffer format for random reasons, but I guess this is not forbidden. I hope #251 fixes the problem.

MapoMagpie commented 7 months ago

Thanks, I will try to build and test it tomorrow.