Bug 447348 - Kdenlive Motion Tracker DaSIAM OpenCV error
Summary: Kdenlive Motion Tracker DaSIAM OpenCV error
Status: RESOLVED FIXED
Alias: None
Product: kdenlive
Classification: Applications
Component: Video Effects & Transitions (show other bugs)
Version: 21.12.0
Platform: Flatpak Linux
: NOR normal
Target Milestone: ---
Assignee: Vincent PINON
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-21 16:48 UTC by kdedk
Modified: 2021-12-27 07:39 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:
fritzibaby: timeline_corruption+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kdedk 2021-12-21 16:48:39 UTC
SUMMARY
Using DaSIAM algorithm (Motion Tracking) does not work and an OpenCV error message occurs.

STEPS TO REPRODUCE
1. Install Kdenlive on Ubuntu 20.04 using Flatpak.
2. Download the files from https://docs.kdenlive.org/en/effects_and_compositions/effect_groups/alpha_manipulation/motion_tracker.html?highlight=motion%20tracker#id2 and save them in ~/.var/app/org.kde.kdenlive/data/kdenlive/opencvmodels 
3. Open a video clip and add the Motion Tracker effect.
4. Select something to follow (at the beginning of the clip or not.)
5. Choose DaSIAM Tracker Algorithm.
6. Click on Analyse.

OBSERVED RESULT

1. Error message: "Failed to filter source." with a button to show log informations. If I click that:


    Current Frame:          1, percentage:          0
    terminate called after throwing an instance of 'cv::Exception'
      what():  OpenCV(4.5.4) /run/build/opencv/modules/video/src/tracking/tracker_dasiamrpn.cpp:437: error: (-213:The function/feature is not implemented) to use GOTURN, the tracking module needs to be built with opencv_dnn ! in function 'create'




EXPECTED RESULT

The Track got analysed, resulting in keyframes.


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Ubuntu 20.04 with Flatpak 
(available in About System)
KDE Plasma Version: ?
KDE Frameworks Version: ?
Qt Version: ?

ADDITIONAL INFORMATION
Comment 1 kdedk 2021-12-21 17:19:17 UTC
sha256sum ~/.var/app/org.kde.kdenlive/data/kdenlive/opencvmodels/*
d85b03e2aeded6cc9be945dfdc3ed6b8f4151f101e485037b6c5d5b36a6c4204  ~/.var/app/org.kde.kdenlive/data/kdenlive/opencvmodels/dasiamrpn_kernel_cls1.onnx
082c85d231b88b97a1b2a50e73b640a332c5d98d7c1d80b5da9ab534fa7a9e5b  ~/.var/app/org.kde.kdenlive/data/kdenlive/opencvmodels/dasiamrpn_kernel_r1.onnx
e88370b85cbad914a5eb414d9d9e0820f87fd0cd89b65205a766174206c35719  ~/.var/app/org.kde.kdenlive/data/kdenlive/opencvmodels/dasiamrpn_model.onnx
Comment 2 emohr 2021-12-25 13:26:11 UTC
I'm not a Linux specialist but do you have stored the 3 files in the correct directory? It should be in $HOME/.local/share/kdenlive/opencvmodels.
Comment 3 kdedk 2021-12-26 07:59:37 UTC
I'm using Flatpak for installing and using Kdenlive. Flatpak using a sandbox and saves the applications data at different places than a "normal" installation.
~/.config/... => ~/.var/app/org.kde.kdenlive/config/...
~/.cache/... => ~/.var/app/org.kde.kdenlive/cache/...
~/.local/share/... => ~/.var/app/org.kde.kdenlive/data/...

If I delete the folder ~/.var/app/org.kde.kdenlive/data/kdenlive/opencvmodels, the error message "Required model files for DaSiam Tracker not found in models folder. Check our wiki for instructions." appears, even if the files are in  $HOME/.local/share/kdenlive/opencvmodels.
If I add the folder again, this error message disappears and the "Failed to filter source." message reappears. 
This confirms that the data is at the right place if it is in the .var/app/... location because it is recognised by the application.
Comment 4 emohr 2021-12-26 13:21:45 UTC
Thank you for the detailed explanation. I informed the devs about the issue.
Comment 5 Julius Künzel 2021-12-26 15:03:20 UTC
Thanks for your report! I tried to fix this with https://github.com/flathub/org.kde.kdenlive/pull/163 
The update will be available on Flathub at the earliest in 4-5 hours (there might be another update earlier that is NOT related)

Please install the update and let us know whether it fixes the problem.
Comment 6 kdedk 2021-12-27 07:39:45 UTC
Now it is working! 🥳🎉
Thank you for fixing the problem.