Bug 470313 - DaSIAM motion tracker assertion failed
Summary: DaSIAM motion tracker assertion failed
Status: REPORTED
Alias: None
Product: kdenlive
Classification: Applications
Component: Video Effects & Transitions (other bugs)
Version First Reported In: 23.04.1
Platform: Flatpak Linux
: NOR normal
Target Milestone: ---
Assignee: Jean-Baptiste Mardelle
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-26 20:50 UTC by PJ
Modified: 2023-06-22 10:39 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description PJ 2023-05-26 20:50:23 UTC
SUMMARY

DaSIAM motion tracker is not working. Can't analyze video.

STEPS TO REPRODUCE
1. Drag Motion Tracker to any video
2. Select DaSIAM as algorithm
3. Get "Failed to filter source" error when clicking Analyze

OBSERVED RESULT

Log:
Current Frame:          1, percentage:          0
/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.
/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.
/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.
/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.


EXPECTED RESULT

Get motion tracker keyframe positions

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Manjaro (flatpak version of Kdenlive)
KDE Frameworks Version: 5.106.0
Qt Version: 5.15.9 (built against 5.15.9)
MLT Version 7.15.0 

ADDITIONAL INFORMATION

sha1sum ~/.var/app/org.kde.kdenlive/data/kdenlive/opencvmodels/*
e9ccd270ce8059bdf7ed0d1845c03ef4a951ee0f  dasiamrpn_kernel_cls1.onnx
bb64620a54348657133eb28be2d3a2a8c76b84b3  dasiamrpn_kernel_r1.onnx
91b774fce7df4c0e4918469f0f482d9a27d0e2d4  dasiamrpn_model.onnx
Comment 1 Roger 2023-06-18 21:15:35 UTC
Wanted to comment that I'm experiencing exactly the same bug when using DaSIAM motion tracking. It seems to be happening on all videos. I even reopened a previous project where I used DaSIAM, reset the tracking, re-ran the algorithm, and it still fails. 

OS: POPOS
Kden Version: 23.04.2
Comment 2 Bernd 2023-06-19 14:22:04 UTC
I cannot confirm this (Pop!_OS 22.04 and Kdenlive 23.04.2 installed via kdenlive-stable ppa). DaSIAM properly tracked the object and created keyframes. Also works as designed with 23.04.1 appimage.
Can you share the video source here so I can try it with your material?
Comment 3 PJ 2023-06-20 14:45:43 UTC
Example video which fails:
https://download.pexels.com/vimeo/240988008/pexels-oscar-due-wang-857268.mp4?fps=23.98&width=4096

sha1sum pexels-oscar-due-wang-857268-4096x2160-24fps.mp4 
2951b87b3fecaffc9a8a547f59dc04a4075669d3  pexels-oscar-due-wang-857268-4096x2160-24fps.mp4

ffprobe -hide_banner pexels-oscar-due-wang-857268-4096x2160-24fps.mp4        
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'pexels-oscar-due-wang-857268-4096x2160-24fps.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42mp41isomavc1
    creation_time   : 2017-11-02T12:23:31.000000Z
  Duration: 00:00:26.79, start: 0.000000, bitrate: 18309 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 4096x2160 [SAR 1:1 DAR 256:135], 18060 kb/s, 23.98 fps, 23.98 tbr, 24k tbn (default)
    Metadata:
      creation_time   : 2017-11-02T12:23:31.000000Z
      handler_name    : L-SMASH Video Handler
      vendor_id       : [0][0][0][0]
      encoder         : AVC Coding
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 255 kb/s (default)
    Metadata:
      creation_time   : 2017-11-02T12:23:31.000000Z
      handler_name    : L-SMASH Audio Handler
      vendor_id       : [0][0][0][0]
Comment 4 Bernd 2023-06-20 15:06:39 UTC
(In reply to PJ from comment #3)
> Example video which fails:
> https://download.pexels.com/vimeo/240988008/pexels-oscar-due-wang-857268.
> mp4?fps=23.98&width=4096
> 
> sha1sum pexels-oscar-due-wang-857268-4096x2160-24fps.mp4 
> 2951b87b3fecaffc9a8a547f59dc04a4075669d3 
> pexels-oscar-due-wang-857268-4096x2160-24fps.mp4
> 
> ffprobe -hide_banner pexels-oscar-due-wang-857268-4096x2160-24fps.mp4        
> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
> 'pexels-oscar-due-wang-857268-4096x2160-24fps.mp4':
>   Metadata:
>     major_brand     : mp42
>     minor_version   : 0
>     compatible_brands: mp42mp41isomavc1
>     creation_time   : 2017-11-02T12:23:31.000000Z
>   Duration: 00:00:26.79, start: 0.000000, bitrate: 18309 kb/s
>   Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv,
> bt709, progressive), 4096x2160 [SAR 1:1 DAR 256:135], 18060 kb/s, 23.98 fps,
> 23.98 tbr, 24k tbn (default)
>     Metadata:
>       creation_time   : 2017-11-02T12:23:31.000000Z
>       handler_name    : L-SMASH Video Handler
>       vendor_id       : [0][0][0][0]
>       encoder         : AVC Coding
>   Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
> stereo, fltp, 255 kb/s (default)
>     Metadata:
>       creation_time   : 2017-11-02T12:23:31.000000Z
>       handler_name    : L-SMASH Audio Handler
>       vendor_id       : [0][0][0][0]

Downloaded the file from the link, ran DaSIAM and it works beautifully. Tell me what you want tracked and I'll send you the tracking data ;-)
Comment 5 PJ 2023-06-21 14:16:47 UTC
Might be related: https://github.com/opencv/opencv/issues/23323
The error seems to be the same. 

How OpenCV and/or OpenCV-Python is packaged into the flatpak version?

Found via https://invent.kde.org/multimedia/kdenlive/-/issues/1699
Comment 6 PJ 2023-06-21 14:38:27 UTC
AppImage https://ftp.funet.fi/pub/mirrors/ftp.kde.org/pub/kde/stable/kdenlive/23.04/linux/kdenlive-23.04.2-x86_64.AppImage works with DaSIAM. So something is different in flatpak version.
Comment 7 Bernd 2023-06-21 20:33:18 UTC
(In reply to PJ from comment #6)
> AppImage
> https://ftp.funet.fi/pub/mirrors/ftp.kde.org/pub/kde/stable/kdenlive/23.04/
> linux/kdenlive-23.04.2-x86_64.AppImage works with DaSIAM. So something is
> different in flatpak version.

Yep, flatpak versions of Kdenlive are having issues. Can this bug report be closed now?
Comment 8 PJ 2023-06-22 10:39:34 UTC
(In reply to Bernd from comment #7)
> Yep, flatpak versions of Kdenlive are having issues. Can this bug report be
> closed now?

If the issue is fixed in the flatpak version, then yes.