ammen99 / wf-recorder

MIT License
850 stars 63 forks source link

Application provided invalid, non monotonically increasing dts to muxer in stream #254

Closed entailz closed 6 months ago

entailz commented 6 months ago

Application provided invalid, non monotonically increasing dts to muxer in stream Currently using Hyprland (wl-roots based compositor).

wf-recorder -x yuv420p -g "$(slurp)" --audio=bluez_output.A4_77_F3_F3_83_24.1.monitor -f test.mkv

This error only occurs if I select a smaller area on the screen with slurp, it doesnt occur if i select a larger portion of the screen. Similarly, recording fullscreen works fine.

John-Paul-R commented 6 months ago

note, even when I don't specify a region (just select a single output; one of three), I still encounter this issue.

John-Paul-R commented 6 months ago

So, interestingly, when I specify a framerate of either 30000/1001 as suggested in https://github.com/rigaya/NVEnc/issues/57#issuecomment-405879201 (or 60000/1001, but no integer value I've tried (30, 60, 100)), via the -r argument, the "non monotonically" errors go away.

I still have a zwlr_screencopy_frame_v1@5: error 1: invalid buffer format error, however (currently running on the recreate-on-format-change branch (bf17503987995b4335ffc7764a5d04e0502e8328). On playback, the video seems to have its full duration, but I stop seeing new frames (eyeballing it) quite early on in the recording (if at all?).


`for context, my full original logs` ```  ~/pkg_builing/wf-recorder  recreate-on-format-change  ./build/wf-recorder -f $(xdg-user-dir VIDEOS)/$(date +'%Y-%m-%d_%H-%M-%S.mp4') -g "$(slurp)"  神22s Detected output based on geometry: DP-1 selected region 273,293 1149x768 Setting codec option: crf=20 Setting codec option: preset=ultrafast Setting codec option: tune=zerolatency Using video filter: null [libx264 @ 0x77eba80021c0] using SAR=1/1 [libx264 @ 0x77eba80021c0] MB rate (3456000000) > level limit (16711680) [libx264 @ 0x77eba80021c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 [libx264 @ 0x77eba80021c0] profile Constrained Baseline, level 6.2, 4:2:0, 8-bit [libx264 @ 0x77eba80021c0] 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=12 lookahead_threads=12 sliced_threads=1 slices=12 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/johnp/Videos/2024-03-06_20-49-05.mp4': Stream #0:0: Video: h264, yuv420p(pc), 1148x768 [SAR 1:1 DAR 287:192], q=2-31 Side data: cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A zwlr_screencopy_frame_v1@14: error 1: invalid buffer format [mp4 @ 0x77eba8000e80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 7186 >= 927 [libx264 @ 0x77eba80021c0] frame I:1 Avg QP:17.00 size:102935 [libx264 @ 0x77eba80021c0] frame P:9 Avg QP:18.33 size: 968 [libx264 @ 0x77eba80021c0] mb I I16..4: 100.0% 0.0% 0.0% [libx264 @ 0x77eba80021c0] mb P I16..4: 1.0% 0.0% 0.0% P16..4: 2.8% 0.0% 0.0% 0.0% 0.0% skip:96.2% [libx264 @ 0x77eba80021c0] coded y,uvDC,uvAC intra: 24.0% 22.1% 20.6% inter: 0.9% 0.6% 0.1% [libx264 @ 0x77eba80021c0] i16 v,h,dc,p: 41% 44% 14% 0% [libx264 @ 0x77eba80021c0] i8c dc,h,v,p: 75% 16% 9% 0% [libx264 @ 0x77eba80021c0] kb/s:89317600.00 ```
`and my new logs (with -r 30000/1001)` ```  ~/pkg_builing/wf-recorder  recreate-on-format-change  ./build/wf-recorder -f $(xdg-user-dir VIDEOS)/$(date +'%Y-%m-%d_%H-%M-%S.mp4') -g "$(slurp)" -r 30000/1001  神29ms Detected output based on geometry: DP-1 selected region 243,398 1007x414 Setting codec option: crf=20 Setting codec option: preset=ultrafast Setting codec option: tune=zerolatency Framerate: 30000 Using video filter: fps=30000 [libx264 @ 0x7c62500021c0] using SAR=1/1 [libx264 @ 0x7c62500021c0] MB rate (49140000) > level limit (16711680) [libx264 @ 0x7c62500021c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 [libx264 @ 0x7c62500021c0] profile Constrained Baseline, level 6.2, 4:2:0, 8-bit [libx264 @ 0x7c62500021c0] 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=6 lookahead_threads=6 sliced_threads=1 slices=6 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/johnp/Videos/2024-03-06_20-51-41.mp4': Stream #0:0: Video: h264, yuv420p(pc), 1006x414 [SAR 1:1 DAR 503:207], q=2-31 Side data: cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A zwlr_screencopy_frame_v1@14: error 1: invalid buffer format Error while feeding the filtergraph! [libx264 @ 0x7c62500021c0] frame I:8 Avg QP:11.75 size: 95918 [libx264 @ 0x7c62500021c0] frame P:1783 Avg QP:14.19 size: 74 [libx264 @ 0x7c62500021c0] mb I I16..4: 100.0% 0.0% 0.0% [libx264 @ 0x7c62500021c0] mb P I16..4: 0.0% 0.0% 0.0% P16..4: 0.0% 0.0% 0.0% 0.0% 0.0% skip:100.0% [libx264 @ 0x7c62500021c0] coded y,uvDC,uvAC intra: 35.4% 34.1% 33.0% inter: 0.0% 0.0% 0.0% [libx264 @ 0x7c62500021c0] i16 v,h,dc,p: 38% 44% 17% 1% [libx264 @ 0x7c62500021c0] i8c dc,h,v,p: 62% 23% 14% 1% [libx264 @ 0x7c62500021c0] kb/s:120400.13 ^Czsh: killed ./build/wf-recorder -f $(xdg-user-dir VIDEOS)/$(date +'%Y-%m-%d_%H-%M-%S.mp4' ```
John-Paul-R commented 6 months ago

Oh, I just realized that is not getting parsed as an expression at all. (at least, that's not how it displays)

Detected output based on geometry: DP-1
selected region 477,436 302x225
Setting codec option: crf=20
Setting codec option: preset=ultrafast
Setting codec option: tune=zerolatency
Framerate: 30000
Using video filter: fps=30000

At this point, I suspect me jumping to conclusions will do more harm than good, as I'm out of my wheelhouse. Here are some more complete logs with WAYLAND_DEBUG=1, exact command, and system info:

entailz commented 6 months ago

wf-recorder doesn't close immediately if I record fullscreen. the smaller the size of geometry, the sooner it crashes. for example, if I select a small region with slurp wf-recorder closes almost immediately with non monotomically increasing dts to muxer in stream error, however if I select a larger region it takes slightly longer to error out.

Here are some `WAYLAND_DEBUG=1` logs: ``` [3656971.667] -> zwlr_screencopy_manager_v1@6.capture_output_region(new id zwlr_screencopy_frame_v1@13, 1, wl_output@8, 1173, 217, 1147, 1072) Setting codec option: crf=20 Setting codec option: preset=ultrafast Setting codec option: tune=zerolatency Using video filter: null [3656975.521] wl_display@1.delete_id(12) [3656975.534] zwlr_screencopy_frame_v1@13.buffer(875709016, 1147, 1072, 4588) [3656975.574] -> wl_shm@3.create_pool(new id wl_shm_pool@12, fd 5, 4918336) [3656975.582] -> wl_shm_pool@12.create_buffer(new id wl_buffer@15, 0, 1147, 1072, 4588, 875709016) [3656975.587] -> wl_shm_pool@12.destroy() [3656975.591] -> zwlr_screencopy_frame_v1@13.copy_with_damage(wl_buffer@15) [3656975.595] zwlr_screencopy_frame_v1@13.linux_dmabuf(875713112, 1147, 1072) [3656975.599] zwlr_screencopy_frame_v1@13.buffer_done() [libx264 @ 0x7c88a4002180] using SAR=1/1 [libx264 @ 0x7c88a4002180] MB rate (4824000000) > level limit (16711680) [3656983.743] wl_display@1.delete_id(12) [3656983.753] zwlr_screencopy_frame_v1@13.flags(0) [3656983.757] zwlr_screencopy_frame_v1@13.damage(0, 0, 1147, 1072) [3656983.761] zwlr_screencopy_frame_v1@13.ready(0, 16938, 18575604) [3656983.767] -> zwlr_screencopy_frame_v1@13.destroy() [3656983.772] -> zwlr_screencopy_manager_v1@6.capture_output_region(new id zwlr_screencopy_frame_v1@12, 1, wl_output@8, 1173, 217, 1147, 1072) [libx264 @ 0x7c88a4002180] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 [3656987.469] wl_display@1.delete_id(13) [3656987.481] zwlr_screencopy_frame_v1@12.buffer(875709016, 1147, 1072, 4588) [3656987.528] -> wl_shm@3.create_pool(new id wl_shm_pool@13, fd 5, 4918336) [3656987.536] -> wl_shm_pool@13.create_buffer(new id wl_buffer@16, 0, 1147, 1072, 4588, 875709016) [3656987.540] -> wl_shm_pool@13.destroy() [3656987.544] -> zwlr_screencopy_frame_v1@12.copy_with_damage(wl_buffer@16) [3656987.548] zwlr_screencopy_frame_v1@12.linux_dmabuf(875713112, 1147, 1072) [3656987.552] zwlr_screencopy_frame_v1@12.buffer_done() [3656996.619] wl_display@1.delete_id(13) [3656996.642] zwlr_screencopy_frame_v1@12.flags(0) [3656996.649] zwlr_screencopy_frame_v1@12.damage(0, 0, 1147, 1072) [3656996.655] zwlr_screencopy_frame_v1@12.ready(0, 16938, 31360267) [3656996.660] -> zwlr_screencopy_frame_v1@12.destroy() [3656996.666] -> zwlr_screencopy_manager_v1@6.capture_output_region(new id zwlr_screencopy_frame_v1@13, 1, wl_output@8, 1173, 217, 1147, 1072) [3657000.972] wl_display@1.delete_id(12) [3657000.996] zwlr_screencopy_frame_v1@13.buffer(875709016, 1147, 1072, 4588) [3657001.202] -> wl_shm@3.create_pool(new id wl_shm_pool@12, fd 5, 4918336) [3657001.211] -> wl_shm_pool@12.create_buffer(new id wl_buffer@17, 0, 1147, 1072, 4588, 875709016) [3657001.216] -> wl_shm_pool@12.destroy() [3657001.221] -> zwlr_screencopy_frame_v1@13.copy_with_damage(wl_buffer@17) [3657001.225] zwlr_screencopy_frame_v1@13.linux_dmabuf(875713112, 1147, 1072) [3657001.229] zwlr_screencopy_frame_v1@13.buffer_done() [libx264 @ 0x7c88a4002180] profile Constrained Baseline, level 6.2, 4:2:0, 8-bit [libx264 @ 0x7c88a4002180] 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=12 lookahead_threads=12 sliced_threads=1 slices=12 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 Setting codec option: crf=20 Setting codec option: preset=ultrafast Setting codec option: tune=zerolatency Choosing sample format fltp for audio codec aac Output #0, matroska, to 'yeah.mkv': Stream #0:0: Video: h264, yuv420p(pc), 1146x1072 [SAR 1:1 DAR 573:536], q=2-31 Side data: cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A Stream #0:1: Audio: aac (LC), 48000 Hz, stereo, fltp, 128 kb/s Using PulseAudio device: alsa_output.usb-Corsair_CORSAIR_HS70_Pro_Wireless_Gaming_Headset-00.analog-stereo.monitor [3657015.643] wl_display@1.delete_id(12) [3657015.664] zwlr_screencopy_frame_v1@13.flags(0) [3657015.671] zwlr_screencopy_frame_v1@13.damage(0, 0, 1147, 1072) [3657015.679] zwlr_screencopy_frame_v1@13.ready(0, 16938, 49385905) [3657015.686] -> zwlr_screencopy_frame_v1@13.destroy() [3657015.693] -> zwlr_screencopy_manager_v1@6.capture_output_region(new id zwlr_screencopy_frame_v1@12, 1, wl_output@8, 1173, 217, 1147, 1072) [3657020.107] wl_display@1.delete_id(13) [3657020.119] zwlr_screencopy_frame_v1@12.buffer(875709016, 1147, 1072, 4588) [3657020.162] -> wl_shm@3.create_pool(new id wl_shm_pool@13, fd 10, 4918336) [3657020.169] -> wl_shm_pool@13.create_buffer(new id wl_buffer@18, 0, 1147, 1072, 4588, 875709016) [3657020.173] -> wl_shm_pool@13.destroy() [3657020.176] -> zwlr_screencopy_frame_v1@12.copy_with_damage(wl_buffer@18) [3657020.179] zwlr_screencopy_frame_v1@12.linux_dmabuf(875713112, 1147, 1072) [3657020.182] zwlr_screencopy_frame_v1@12.buffer_done() [3657028.126] wl_display@1.delete_id(13) [3657028.150] zwlr_screencopy_frame_v1@12.flags(0) [3657028.158] zwlr_screencopy_frame_v1@12.damage(0, 0, 1147, 1072) [3657028.165] zwlr_screencopy_frame_v1@12.ready(0, 16938, 62510900) [3657028.175] -> zwlr_screencopy_frame_v1@12.destroy() [3657028.182] -> zwlr_screencopy_manager_v1@6.capture_output_region(new id zwlr_screencopy_frame_v1@13, 1, wl_output@8, 1173, 217, 1147, 1072) [3657034.371] wl_display@1.delete_id(12) [3657034.389] zwlr_screencopy_frame_v1@13.buffer(875709016, 1147, 1072, 4588) [3657034.438] -> wl_shm@3.create_pool(new id wl_shm_pool@12, fd 10, 4918336) [3657034.445] -> wl_shm_pool@12.create_buffer(new id wl_buffer@19, 0, 1147, 1072, 4588, 875709016) [3657034.450] -> wl_shm_pool@12.destroy() [3657034.454] -> zwlr_screencopy_frame_v1@13.copy_with_damage(wl_buffer@19) [3657034.458] zwlr_screencopy_frame_v1@13.linux_dmabuf(875713112, 1147, 1072) [3657034.462] zwlr_screencopy_frame_v1@13.buffer_done() [3657047.558] wl_display@1.delete_id(12) [3657047.580] zwlr_screencopy_frame_v1@13.flags(0) [3657047.586] zwlr_screencopy_frame_v1@13.damage(0, 0, 1147, 1072) [3657047.593] zwlr_screencopy_frame_v1@13.ready(0, 16938, 80361704) [3657047.600] -> zwlr_screencopy_frame_v1@13.destroy() [3657047.607] -> zwlr_screencopy_manager_v1@6.capture_output_region(new id zwlr_screencopy_frame_v1@12, 1, wl_output@8, 1173, 217, 1147, 1072) [3657052.572] wl_display@1.delete_id(13) [3657052.586] zwlr_screencopy_frame_v1@12.buffer(875709016, 1147, 1072, 4588) [3657052.594] -> zwlr_screencopy_frame_v1@12.copy_with_damage(wl_buffer@14) [3657052.599] zwlr_screencopy_frame_v1@12.linux_dmabuf(875713112, 1147, 1072) [3657052.605] zwlr_screencopy_frame_v1@12.buffer_done() [3657061.272] zwlr_screencopy_frame_v1@12.flags(0) [3657061.287] zwlr_screencopy_frame_v1@12.damage(0, 0, 1147, 1072) [3657061.293] zwlr_screencopy_frame_v1@12.ready(0, 16938, 98703220) [3657061.300] -> zwlr_screencopy_frame_v1@12.destroy() [3657061.306] -> zwlr_screencopy_manager_v1@6.capture_output_region(new id zwlr_screencopy_frame_v1@13, 1, wl_output@8, 1173, 217, 1147, 1072) [3657064.034] wl_display@1.delete_id(12) [3657064.046] zwlr_screencopy_frame_v1@13.buffer(875709016, 1147, 1072, 4588) [3657064.052] -> zwlr_screencopy_frame_v1@13.copy_with_damage(wl_buffer@15) [3657064.057] zwlr_screencopy_frame_v1@13.linux_dmabuf(875713112, 1147, 1072) [3657064.061] zwlr_screencopy_frame_v1@13.buffer_done() [3657072.456] zwlr_screencopy_frame_v1@13.flags(0) [3657072.471] zwlr_screencopy_frame_v1@13.damage(0, 0, 1147, 1072) [3657072.475] zwlr_screencopy_frame_v1@13.ready(0, 16938, 109807301) [3657072.480] -> zwlr_screencopy_frame_v1@13.destroy() [3657072.485] -> zwlr_screencopy_manager_v1@6.capture_output_region(new id zwlr_screencopy_frame_v1@12, 1, wl_output@8, 1173, 217, 1147, 1072) [3657074.137] wl_display@1.delete_id(13) [3657074.148] zwlr_screencopy_frame_v1@12.buffer(875709016, 1147, 1072, 4588) [3657074.153] -> zwlr_screencopy_frame_v1@12.copy_with_damage(wl_buffer@16) [3657074.158] zwlr_screencopy_frame_v1@12.linux_dmabuf(875713112, 1147, 1072) [3657074.161] zwlr_screencopy_frame_v1@12.buffer_done() [3657078.911] zwlr_screencopy_frame_v1@12.flags(0) [3657078.925] zwlr_screencopy_frame_v1@12.damage(0, 0, 1147, 1072) [3657078.929] zwlr_screencopy_frame_v1@12.ready(0, 16938, 116139141) [3657078.936] -> zwlr_screencopy_frame_v1@12.destroy() [3657078.942] -> zwlr_screencopy_manager_v1@6.capture_output_region(new id zwlr_screencopy_frame_v1@13, 1, wl_output@8, 1173, 217, 1147, 1072) [3657081.460] wl_display@1.delete_id(12) [3657081.471] zwlr_screencopy_frame_v1@13.buffer(875709016, 1147, 1072, 4588) [3657081.476] -> zwlr_screencopy_frame_v1@13.copy_with_damage(wl_buffer@17) [3657081.482] zwlr_screencopy_frame_v1@13.linux_dmabuf(875713112, 1147, 1072) [3657081.487] zwlr_screencopy_frame_v1@13.buffer_done() [3657090.941] zwlr_screencopy_frame_v1@13.flags(0) [3657090.958] zwlr_screencopy_frame_v1@13.damage(0, 0, 1147, 1072) [3657090.965] zwlr_screencopy_frame_v1@13.ready(0, 16938, 127821834) [3657090.972] -> zwlr_screencopy_frame_v1@13.destroy() [3657090.979] -> zwlr_screencopy_manager_v1@6.capture_output_region(new id zwlr_screencopy_frame_v1@12, 1, wl_output@8, 1173, 217, 1147, 1072) [3657093.457] wl_display@1.delete_id(13) [3657093.493] zwlr_screencopy_frame_v1@12.buffer(875709016, 1147, 1072, 4588) [3657093.501] -> zwlr_screencopy_frame_v1@12.copy_with_damage(wl_buffer@18) [3657093.506] zwlr_screencopy_frame_v1@12.linux_dmabuf(875713112, 1147, 1072) [3657093.511] zwlr_screencopy_frame_v1@12.buffer_done() [3657102.897] zwlr_screencopy_frame_v1@12.flags(0) [3657102.917] zwlr_screencopy_frame_v1@12.damage(0, 0, 1147, 1072) [3657102.925] zwlr_screencopy_frame_v1@12.ready(0, 16938, 139944547) [3657102.932] -> zwlr_screencopy_frame_v1@12.destroy() [3657102.938] -> zwlr_screencopy_manager_v1@6.capture_output_region(new id zwlr_screencopy_frame_v1@13, 1, wl_output@8, 1173, 217, 1147, 1072) [3657104.986] wl_display@1.delete_id(12) [3657105.002] zwlr_screencopy_frame_v1@13.buffer(875709016, 1147, 1072, 4588) [3657105.011] -> zwlr_screencopy_frame_v1@13.copy_with_damage(wl_buffer@19) [3657105.017] zwlr_screencopy_frame_v1@13.linux_dmabuf(875713112, 1147, 1072) [3657105.022] zwlr_screencopy_frame_v1@13.buffer_done() [3657115.288] zwlr_screencopy_frame_v1@13.flags(0) [3657115.304] zwlr_screencopy_frame_v1@13.damage(0, 0, 1147, 1072) [3657115.309] zwlr_screencopy_frame_v1@13.ready(0, 16938, 152297804) [3657115.314] -> zwlr_screencopy_frame_v1@13.destroy() [3657115.320] -> zwlr_screencopy_manager_v1@6.capture_output_region(new id zwlr_screencopy_frame_v1@12, 1, wl_output@8, 1173, 217, 1147, 1072) [3657118.078] wl_display@1.delete_id(13) [3657118.093] zwlr_screencopy_frame_v1@12.buffer(875709016, 1147, 1072, 4588) [3657118.101] -> zwlr_screencopy_frame_v1@12.copy_with_damage(wl_buffer@14) [3657118.107] zwlr_screencopy_frame_v1@12.linux_dmabuf(875713112, 1147, 1072) [3657118.112] zwlr_screencopy_frame_v1@12.buffer_done() [3657127.286] zwlr_screencopy_frame_v1@12.flags(0) [3657127.301] zwlr_screencopy_frame_v1@12.damage(0, 0, 1147, 1072) [3657127.305] zwlr_screencopy_frame_v1@12.ready(0, 16938, 164543279) [3657127.309] -> zwlr_screencopy_frame_v1@12.destroy() [3657127.313] -> zwlr_screencopy_manager_v1@6.capture_output_region(new id zwlr_screencopy_frame_v1@13, 1, wl_output@8, 1173, 217, 1147, 1072) [3657128.938] wl_display@1.delete_id(12) [3657128.947] zwlr_screencopy_frame_v1@13.buffer(875709016, 1147, 1072, 4588) [3657128.952] -> zwlr_screencopy_frame_v1@13.copy_with_damage(wl_buffer@15) [3657128.956] zwlr_screencopy_frame_v1@13.linux_dmabuf(875713112, 1147, 1072) [3657128.961] zwlr_screencopy_frame_v1@13.buffer_done() [3657135.372] zwlr_screencopy_frame_v1@13.flags(0) [3657135.390] zwlr_screencopy_frame_v1@13.damage(0, 0, 1147, 1072) [3657135.396] zwlr_screencopy_frame_v1@13.ready(0, 16938, 172766808) [3657135.404] -> zwlr_screencopy_frame_v1@13.destroy() [3657135.410] -> zwlr_screencopy_manager_v1@6.capture_output_region(new id zwlr_screencopy_frame_v1@12, 1, wl_output@8, 1173, 217, 1147, 1072) [3657140.343] wl_display@1.delete_id(13) [3657140.357] zwlr_screencopy_frame_v1@12.buffer(875709016, 1147, 1072, 4588) [3657140.365] -> zwlr_screencopy_frame_v1@12.copy_with_damage(wl_buffer@16) [3657140.372] zwlr_screencopy_frame_v1@12.linux_dmabuf(875713112, 1147, 1072) [3657140.376] zwlr_screencopy_frame_v1@12.buffer_done() [3657144.877] zwlr_screencopy_frame_v1@12.flags(0) [3657144.884] zwlr_screencopy_frame_v1@12.damage(0, 0, 1147, 1072) [3657144.888] zwlr_screencopy_frame_v1@12.ready(0, 16938, 182261447) [3657144.894] -> zwlr_screencopy_frame_v1@12.destroy() [3657144.898] -> zwlr_screencopy_manager_v1@6.capture_output_region(new id zwlr_screencopy_frame_v1@13, 1, wl_output@8, 1173, 217, 1147, 1072) [3657146.908] wl_display@1.delete_id(12) [3657146.920] zwlr_screencopy_frame_v1@13.buffer(875709016, 1147, 1072, 4588) [3657146.927] -> zwlr_screencopy_frame_v1@13.copy_with_damage(wl_buffer@17) [3657146.931] zwlr_screencopy_frame_v1@13.linux_dmabuf(875713112, 1147, 1072) [3657146.934] zwlr_screencopy_frame_v1@13.buffer_done() [3657157.368] zwlr_screencopy_frame_v1@13.flags(0) [3657157.384] zwlr_screencopy_frame_v1@13.damage(0, 0, 1147, 1072) [3657157.389] zwlr_screencopy_frame_v1@13.ready(0, 16938, 194361433) [3657157.393] -> zwlr_screencopy_frame_v1@13.destroy() [3657157.398] -> zwlr_screencopy_manager_v1@6.capture_output_region(new id zwlr_screencopy_frame_v1@12, 1, wl_output@8, 1173, 217, 1147, 1072) [3657159.551] wl_display@1.delete_id(13) [3657159.564] zwlr_screencopy_frame_v1@12.buffer(875709016, 1147, 1072, 4588) [3657159.570] -> zwlr_screencopy_frame_v1@12.copy_with_damage(wl_buffer@18) [3657159.574] zwlr_screencopy_frame_v1@12.linux_dmabuf(875713112, 1147, 1072) [3657159.577] zwlr_screencopy_frame_v1@12.buffer_done() [3657163.597] zwlr_screencopy_frame_v1@12.flags(0) [3657163.610] zwlr_screencopy_frame_v1@12.damage(0, 0, 1147, 1072) [3657163.616] zwlr_screencopy_frame_v1@12.ready(0, 16938, 200805408) [3657163.621] -> zwlr_screencopy_frame_v1@12.destroy() [3657163.626] -> zwlr_screencopy_manager_v1@6.capture_output_region(new id zwlr_screencopy_frame_v1@13, 1, wl_output@8, 1173, 217, 1147, 1072) [3657165.875] wl_display@1.delete_id(12) [3657165.887] zwlr_screencopy_frame_v1@13.buffer(875709016, 1147, 1072, 4588) [3657165.896] -> zwlr_screencopy_frame_v1@13.copy_with_damage(wl_buffer@19) [3657165.900] zwlr_screencopy_frame_v1@13.linux_dmabuf(875713112, 1147, 1072) [3657165.903] zwlr_screencopy_frame_v1@13.buffer_done() [3657169.738] zwlr_screencopy_frame_v1@13.flags(0) [3657169.752] zwlr_screencopy_frame_v1@13.damage(0, 0, 1147, 1072) [3657169.759] zwlr_screencopy_frame_v1@13.ready(0, 16938, 206748817) [3657169.764] -> zwlr_screencopy_frame_v1@13.destroy() [3657169.775] -> zwlr_screencopy_manager_v1@6.capture_output_region(new id zwlr_screencopy_frame_v1@12, 1, wl_output@8, 1173, 217, 1147, 1072) [3657171.742] wl_display@1.delete_id(13) [3657171.754] zwlr_screencopy_frame_v1@12.buffer(875709016, 1147, 1072, 4588) [3657171.761] -> zwlr_screencopy_frame_v1@12.copy_with_damage(wl_buffer@14) [3657171.767] zwlr_screencopy_frame_v1@12.linux_dmabuf(875713112, 1147, 1072) [3657171.771] zwlr_screencopy_frame_v1@12.buffer_done() [3657181.626] zwlr_screencopy_frame_v1@12.flags(0) [3657181.642] zwlr_screencopy_frame_v1@12.damage(0, 0, 1147, 1072) [3657181.646] zwlr_screencopy_frame_v1@12.ready(0, 16938, 218748819) [3657181.651] -> zwlr_screencopy_frame_v1@12.destroy() [3657181.656] -> zwlr_screencopy_manager_v1@6.capture_output_region(new id zwlr_screencopy_frame_v1@13, 1, wl_output@8, 1173, 217, 1147, 1072) [3657183.494] wl_display@1.delete_id(12) [3657183.503] zwlr_screencopy_frame_v1@13.buffer(875709016, 1147, 1072, 4588) [3657183.509] -> zwlr_screencopy_frame_v1@13.copy_with_damage(wl_buffer@15) [3657183.513] zwlr_screencopy_frame_v1@13.linux_dmabuf(875713112, 1147, 1072) [3657183.517] zwlr_screencopy_frame_v1@13.buffer_done() [3657189.555] zwlr_screencopy_frame_v1@13.flags(0) [3657189.575] zwlr_screencopy_frame_v1@13.damage(0, 0, 1147, 1072) [3657189.583] zwlr_screencopy_frame_v1@13.ready(0, 16938, 226809122) [3657189.592] -> zwlr_screencopy_frame_v1@13.destroy() [3657189.599] -> zwlr_screencopy_manager_v1@6.capture_output_region(new id zwlr_screencopy_frame_v1@12, 1, wl_output@8, 1173, 217, 1147, 1072) [3657193.439] wl_display@1.delete_id(13) [3657193.453] zwlr_screencopy_frame_v1@12.buffer(875709016, 1147, 1072, 4588) [3657193.460] -> zwlr_screencopy_frame_v1@12.copy_with_damage(wl_buffer@16) [3657193.466] zwlr_screencopy_frame_v1@12.linux_dmabuf(875713112, 1147, 1072) [3657193.471] zwlr_screencopy_frame_v1@12.buffer_done() [3657200.285] zwlr_screencopy_frame_v1@12.flags(0) [3657200.297] zwlr_screencopy_frame_v1@12.damage(0, 0, 1147, 1072) [3657200.300] zwlr_screencopy_frame_v1@12.ready(0, 16938, 237574837) [3657200.306] -> zwlr_screencopy_frame_v1@12.destroy() [3657200.311] -> zwlr_screencopy_manager_v1@6.capture_output_region(new id zwlr_screencopy_frame_v1@13, 1, wl_output@8, 1173, 217, 1147, 1072) [3657200.347] wl_display@1.delete_id(12) [3657200.354] zwlr_screencopy_frame_v1@13.buffer(875708993, 1147, 1072, 4588) [3657200.360] -> zwlr_screencopy_frame_v1@13.copy_with_damage(wl_buffer@17) [3657200.365] zwlr_screencopy_frame_v1@13.linux_dmabuf(875713112, 1147, 1072) [3657200.370] zwlr_screencopy_frame_v1@13.buffer_done() [3657200.437] wl_display@1.error(zwlr_screencopy_frame_v1@13, 1, "invalid buffer format") zwlr_screencopy_frame_v1@13: error 1: invalid buffer format [matroska @ 0x7c88a4000e00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 231 >= 188 [libx264 @ 0x7c88a4002180] frame I:1 Avg QP:17.00 size:147765 [libx264 @ 0x7c88a4002180] frame P:21 Avg QP:25.62 size: 30161 [libx264 @ 0x7c88a4002180] mb I I16..4: 100.0% 0.0% 0.0% [libx264 @ 0x7c88a4002180] mb P I16..4: 5.2% 0.0% 0.0% P16..4: 10.4% 0.0% 0.0% 0.0% 0.0% skip:84.5% [libx264 @ 0x7c88a4002180] coded y,uvDC,uvAC intra: 54.7% 53.9% 48.0% inter: 6.5% 5.8% 4.9% [libx264 @ 0x7c88a4002180] i16 v,h,dc,p: 50% 31% 15% 4% [libx264 @ 0x7c88a4002180] i8c dc,h,v,p: 56% 22% 19% 3% [libx264 @ 0x7c88a4002180] kb/s:284051264.00 [aac @ 0x7c88a57b3dc0] Qavg: 41054.492 ```
entailz commented 6 months ago

I tried -r 30000/1001 as you suggested above, same results as you.

soreau commented 6 months ago

I'm not able to reproduce this bug. Could it possibly have something to do with the libav/ffmpeg version that wf-recorder is using?

John-Paul-R commented 6 months ago

maybe? running ffmpeg yields:

ffmpeg version n6.1.1 Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 13.2.1 (GCC) 20230801
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-frei0r --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libharfbuzz --enable-libiec61883 --enable-libjack --enable-libjxl --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libplacebo --enable-libpulse --enable-librav1e --enable-librsvg --enable-librubberband --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpl --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-vapoursynth --enable-version3 --enable-vulkan
  libavutil      58. 29.100 / 58. 29.100
  libavcodec     60. 31.102 / 60. 31.102
  libavformat    60. 16.100 / 60. 16.100
  libavdevice    60.  3.100 / 60.  3.100
  libavfilter     9. 12.100 /  9. 12.100
  libswscale      7.  5.100 /  7.  5.100
  libswresample   4. 12.100 /  4. 12.100
  libpostproc    57.  3.100 / 57.  3.100
soreau commented 6 months ago

Here I have ffmpeg version N-111822-g8028b8260e because I built it, with the following options: configuration: --enable-muxer=rtsp --enable-libmp3lame --enable-libvorbis --enable-libx265 --enable-libx264 --enable-encoder=libx264rgb --enable-encoder=flac --enable-libmp3lame --enable-gpl --enable-libvpx --enable-vaapi --enable-libopus --enable-libdrm --enable-vulkan --enable-libdrm --enable-libpulse

John-Paul-R commented 6 months ago

Alright, I've built ffmpeg from https://github.com/FFmpeg/FFmpeg/commit/8028b8260e6d0a4a469529ec5c5d504782a5f875, with those options.

Is there a way to make my locally-built wf-recorder target that locally built instance of ffmpeg? (I'd like to avoid mangling existing installs if possible) I'm quite unfamiliar with... well, frankly the entire build ecosystem, and I appear to be looking in the wrong places for info.

soreau commented 6 months ago

You should point PKG_CONFIG_PATH to the location of all the relevant .pc files when running meson to build wf-recorder, such as $prefix/lib/pkgconfig/, where $prefix is the prefix you used when installing ffmpeg. Then, you will want to set LD_LIBRARY_PATH to $prefix/lib/ when running wf-recorder.

John-Paul-R commented 6 months ago

all right, ran

#ffmpeg dir
./configure --enable-muxer=rtsp --enable-libmp3lame --enable-libvorbis --enable-libx265 --enable-libx264 --enable-encoder=libx264rgb --enable-encoder=flac --enable-libmp3lame --enable-gpl --enable-libvpx --enable-vaapi --enable-libopus --enable-libdrm --enable-vulkan --enable-libdrm --enable-libpulse --disable-doc --prefix=/home/johnp/pkg_builing/bin
make
make install
#wf-recorder dir
export PKG_CONFIG_PATH="/home/johnp/pkg_builing/bin/lib/pkgconfig/"
export LD_LIBRARY_PATH="/home/johnp/pkg_builing/bin/lib/"
meson build --prefix=/home/johnp/pkg_building/bin --buildtype=release
ninja -C build
./build/wf-recorder -f ./test.mp4

and received identical results. (I include the steps because I'm not 100% sure how to verify the version wf-recorder is using at any given time)

soreau commented 6 months ago

I wonder if this has something to do with the refresh rate of the output or maybe variable refresh rates. Can everyone interested say what refresh rate they're using and whether or not they use a monitor with VRR enabled?

John-Paul-R commented 6 months ago

Sure, I've mostly been attempting to record on a 3440x1440@99.99800 display with vrr: 0. Though I also encounter the error on my other monitors.

`hyprctl monitors` output ``` Monitor DP-1 (ID 0): 3440x1440@99.99800 at 0x0 description: Viewteck Co., Ltd. GN34CB make: Viewteck Co., Ltd. model: GN34CB serial: active workspace: 3 (3) special workspace: 0 () reserved: 0 0 46 0 scale: 1.00 transform: 0 focused: yes dpmsStatus: 1 vrr: 0 activelyTearing: false Monitor HDMI-A-1 (ID 1): 2560x1080@60.00000 at 440x-1080 description: LG Electronics LG ULTRAWIDE 0x0001A1FB make: LG Electronics model: LG ULTRAWIDE serial: 0x0001A1FB active workspace: 13 (13) special workspace: 0 () reserved: 0 40 0 0 scale: 1.00 transform: 0 focused: no dpmsStatus: 1 vrr: 0 activelyTearing: false Monitor Unknown-1 (ID 2): 1600x900@59.97800 at -1600x0 description: Dell Inc. DELL ST2010 U840M93D08YS make: Dell Inc. model: DELL ST2010 serial: U840M93D08YS active workspace: 21 (21) special workspace: 0 () reserved: 0 40 0 0 scale: 1.00 transform: 0 focused: no dpmsStatus: 1 vrr: 0 activelyTearing: false ```

(E: incidentally, recording whole displays at a time, with the rate reported by hyprctl monitors specified explicitly via -r does not resolve the zwlr_screencopy_frame_v1@5: error 1: invalid buffer format error (it does prevent the "non monotonically", errors, same as providing the other rates))

soreau commented 6 months ago

Does --no-dmabuf help at all?

John-Paul-R commented 6 months ago

It does not appear to have any effect. log w/ WAYLAND_DEBUG=1

(E: ditto for --no-damage, while I'm at it.) (Also note, I'm heading off to sleep, so my next response will likely be delayed, relative to the others. Ty for all the help investigating today!)

entailz commented 6 months ago
Here are my ffmpeg configuration flags: ``` --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-frei0r --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libharfbuzz --enable-libiec61883 --enable-libjack --enable-libjxl --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libplacebo --enable-libpulse --enable-librav1e --enable-librsvg --enable-librubberband --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpl --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-vapoursynth --enable-version3 --enable-vulkan libavutil 58. 29.100 / 58. 29.100 libavcodec 60. 31.102 / 60. 31.102 libavformat 60. 16.100 / 60. 16.100 libavdevice 60. 3.100 / 60. 3.100 libavfilter 9. 12.100 / 9. 12.100 libswscale 7. 5.100 / 7. 5.100 libswresample 4. 12.100 / 4. 12.100 libpostproc 57. 3.100 / 57. 3.100 ```
ammen99 commented 6 months ago

@entailz I just got to this issue and looked at your WAYLAND_DEBUG log, seems like this is a duplicate of #250

entailz commented 6 months ago

@ammen99 thanks! fixed for me.

John-Paul-R commented 6 months ago

The most recent 2 commits from #251 resolved the issue for me as well. Thanks!