Bug 454983 - motion tracking doesn't work on Arch
Summary: motion tracking doesn't work on Arch
Status: RESOLVED DOWNSTREAM
Alias: None
Product: kdenlive
Classification: Applications
Component: Video Effects & Transitions (show other bugs)
Version: 22.12.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Vincent PINON
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-07 16:15 UTC by Guido
Modified: 2024-05-17 15:31 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Guido 2022-06-07 16:15:14 UTC
SUMMARY
motion tracking doesn't work on Arch 90% of time. occasionally some algoritm works but trying again fails.


STEPS TO REPRODUCE
1. download this example on Arch: https://www.dropbox.com/sh/799sn40ufdhwqvp/AAA-_q1x7MQ2Y3O3OfccqU6ra?dl=1
2. try to generate motion tracking


OBSERVED RESULT
motion tracking fails with this error:
Current Frame: 1, percentage: 0
animation initialized FAILED
Current Frame: 5, percentage: 2
Current Frame: 11, percentage: 4
Current Frame: 18, percentage: 7
Current Frame: 24, percentage: 10
Current Frame: 30, percentage: 13
Current Frame: 36, percentage: 15
Current Frame: 43, percentage: 18
Current Frame: 49, percentage: 21
Current Frame: 55, percentage: 24
Current Frame: 61, percentage: 26
Current Frame: 68, percentage: 29
Current Frame: 75, percentage: 33
Current Frame: 81, percentage: 35
Current Frame: 87, percentage: 38
Current Frame: 94, percentage: 41
Current Frame: 101, percentage: 44
Current Frame: 108, percentage: 47
Current Frame: 115, percentage: 50
Current Frame: 121, percentage: 53
Current Frame: 127, percentage: 55
Current Frame: 134, percentage: 59
Current Frame: 140, percentage: 61
Current Frame: 147, percentage: 64
Current Frame: 154, percentage: 67
Current Frame: 160, percentage: 70
Current Frame: 167, percentage: 73
Current Frame: 173, percentage: 76
Current Frame: 180, percentage: 79
Current Frame: 186, percentage: 81
Current Frame: 193, percentage: 85
Current Frame: 199, percentage: 87
Current Frame: 206, percentage: 90
Current Frame: 212, percentage: 93
Current Frame: 218, percentage: 96
Current Frame: 224, percentage: 98

EXPECTED RESULT
it should work


ADDITIONAL INFORMATION
I am trying to help Arch linux to have a fully functioning kdenlive and have stumbled upon this curious bug.
What I discovered:
1. motion tracking works perfectly with Appimage
2. motion tracking works perfectly if I install opencv from the cachyos repos. The only difference is that the package is compiled with optimisations:

#CPPFLAGS=""
CFLAGS="-march=x86-64-v3 -O3 -pipe -fno-plt -fexceptions \
-Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
-fstack-clash-protection -fcf-protection"
CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"

It seems that the problem is therefore in opencv. Is the one in the appimage compiled with special flags?
What advice can I give the Arch Linux developers to make motion tracking work?

I report the open bug on archlinux: https://bugs.archlinux.org/task/74957?project=1&string=kdenlive

Thank you very much.
Comment 1 Guido 2023-01-09 19:16:38 UTC
after some experiment I found that opencv compiled with -O3 works fine, but version 4.7 has problem with deSiam:

Current Frame:          1, percentage:          1
/usr/include/c++/12.2.0/bits/stl_vector.h:1123: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = float; _Alloc = std::allocator<float>; reference = float&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.
/usr/include/c++/12.2.0/bits/stl_vector.h:1123: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = float; _Alloc = std::allocator<float>; reference = float&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.
Comment 2 Guido 2024-05-17 15:31:49 UTC
It's an Arch-specific bug. In other distros it works.
For Arch (and derivatives) you can install opencv from KaOS, it works fine.