Bug 475472 - Spectacle fails to record a window with h264 in specific dimensions
Summary: Spectacle fails to record a window with h264 in specific dimensions
Status: RESOLVED DUPLICATE of bug 485733
Alias: None
Product: KPipeWire
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-11 15:28 UTC by iodreamify
Modified: 2024-10-29 14:23 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
journalctl (8.07 KB, text/x-log)
2023-10-11 15:28 UTC, iodreamify
Details

Note You need to log in before you can comment on or make changes to this bug.
Description iodreamify 2023-10-11 15:28:13 UTC
Created attachment 162224 [details]
journalctl

SUMMARY
It seems if the window's height is not divisible by 2 libx264 fails to record anything. At least that's the most prominent error in the log i could find.  No such issues occur with webm. I am not sure if this is a limitation of h264 but if it is Spectacle should at least throw an error in the gui why there is no resulting file at all. 


STEPS TO REPRODUCE
1. Open a window like Dolphin with the height dimension not divisible by 2
2. Select Dolphin's window for recording
3. Wait a few seconds and press finish recording

OBSERVED RESULT
No file is created and there is an error in the logs

EXPECTED RESULT
Recording works or Spectacle shows error

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.27.8
KDE Frameworks Version: 5.110.0
Qt Version: 5.15.11
Kernel Version: 6.1.56-1-lts (64-bit)
Graphics Platform: Wayland
Memory: 7,6 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 3000
Comment 1 Hector Martin 2023-10-28 08:03:26 UTC
It also fails if the height is not divisible by 2. This is a KPipeWire bug. It needs to pad dimensions to an even value. This is required by most codecs due to color subsampling (unless you use 4:4:4 mode, which should probably be offered for screen recording anyway).
Comment 2 Hector Martin 2023-10-28 08:21:25 UTC
* I meant also width there, not height (which is what the OP reported).
Comment 3 Hector Martin 2023-10-28 08:22:55 UTC
Reassigning to KPipeWire since I'm pretty sure that's where this should be handled.
Comment 4 Janne Grunau 2023-10-28 08:37:15 UTC
Just as a note, OpenH264 as proposed in https://bugs.kde.org/show_bug.cgi?id=476187 supports only 4:2:0 as encoder and decoder. The default should remain 4:2:0 for compatibility reasons.
The least bad option for the even width and height requirement for 4:2:0 is to duplicate the last column/row if width/height are odd.
Comment 5 Hector Martin 2023-10-28 16:18:11 UTC
Yes, 4:2:0 should be the default since a lot of decoders choke on 4:4:4 too. If offered, 4:4:4 should be an explicit opt-in for users that know their use case will handle it.
Comment 6 Noah Davis 2023-12-14 14:56:18 UTC
Can anyone reproduce this with the latest beta version? I am currently unable to.
Comment 7 iodreamify 2023-12-22 20:41:59 UTC
Can no longer reproduce it either. 

Although i'm suspiciously also getting the following errors: 

Dec 22 20:27:41 neon spectacle[3693]: [h264 @ 0x55e270372280] No support for codec h264 profile 77.
Dec 22 20:27:41 neon spectacle[3693]: [h264 @ 0x55e270372280] Failed setup for format vaapi_vld: hwaccel initialisation returned error.
Dec 22 20:27:47 neon kernel: ACPI: \_SB_.PCI0.PEG0.PEGP: failed to evaluate _DSM
Dec 22 20:27:48 neon kernel: acer_wmi: Unknown function number - 3 - 2
Dec 22 20:27:51 neon spectacle[3693]: libva info: VA-API version 1.14.0
Dec 22 20:27:51 neon spectacle[3693]: libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
Dec 22 20:27:51 neon spectacle[3693]: libva info: Found init function __vaDriverInit_1_14
Dec 22 20:27:51 neon spectacle[3693]: libva error: /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so init failed
Dec 22 20:27:51 neon spectacle[3693]: libva info: va_openDriver() returns 1
Dec 22 20:27:51 neon spectacle[3693]: libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
 

So i'm not even sure if i'm using a hw encoder.
Comment 8 Bug Janitor Service 2024-01-06 03:46:12 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 9 Bug Janitor Service 2024-01-21 03:45:33 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!
Comment 10 Honza 2024-10-29 09:29:03 UTC
The problem is still there - if the dimensions of the screencast area is not  divisible by 2, the Spectacle do not record anything with "Temporary file URL must be an existing local file". which is confusing, at least.

System: 
   Fedora 40, KDE Frameworks 6.7.0, Qt 6.7.2, Wayland, Spectacle 24.08.2

Console output:
  honzama@ws21:~$ spectacle --gui
  libva info: VA-API version 1.21.0
  libva info: Trying to open /usr/lib64/dri-nonfree/radeonsi_drv_video.so
  libva info: Trying to open /usr/lib64/dri-freeworld/radeonsi_drv_video.so
  libva info: Trying to open /usr/lib64/dri/radeonsi_drv_video.so
  libva info: Found init function __vaDriverInit_1_21
  libva info: va_openDriver() returns 0
  kpipewire_vaapi_logging: VAAPI: Mesa Gallium driver 24.1.7 for AMD Radeon Graphics (radeonsi, renoir, LLVM 18.1.6, DRM 3.59, 6.11.3-200.fc40.x86_64) in use for device "/dev/dri/renderD128"
  kpipewire_vaapi_logging: DRM device not found
  kpipewire_record_logging: Hardware encoding is not supported on this device.
  [libx264 @ 0x7f4e302339c0] -qscale is ignored, -crf is recommended.
  [libx264 @ 0x7f4e302339c0] width not divisible by 2 (315x237)
  kpipewire_record_logging: Could not open codec Generic error in an external library
  [libopenh264 @ 0x7f4e30235c80] Incorrect library version loaded
  kpipewire_record_logging: Could not open codec Encoder not found
  kpipewire_record_logging: No encoder could be created
  Failed to export video: Temporary file URL must be an existing local file
Comment 11 Nate Graham 2024-10-29 14:23:35 UTC
It's fixed with a change in KPipeWire that'll be released in Plasma 6.2.3.

*** This bug has been marked as a duplicate of bug 485733 ***