Created attachment 181540 [details] file with broken clip chain1 I posted on the forums and was advised to file a bug report: https://discuss.kde.org/t/saving-and-then-reopening-a-project-resulted-in-invalid-clip-chain-errors/34493/3 Sorry, not sure whether to put "compiled sources" or "gentoo packages". I installed from a gentoo ebuild (which compiles locally), not a bin-package. SUMMARY I saved a relatively simple project with two pairs of audio/video tracks each using one source mkv video. After I closed and reopened KDEnlive, one of the audio tracks was empty, and I received several "Invalid clip chain" messages, as displayed here: https://discuss-cdn.kde.org/uploads/default/original/3X/7/8/78a2a39a979ca328692b9fd27bf4f0c3f22010d7.png I've attached the STEPS TO REPRODUCE 1. 2. 3. OBSERVED RESULT EXPECTED RESULT SOFTWARE/OS VERSIONS Windows: macOS: (available in the Info Center app, or by running `kinfo` in a terminal window) Linux/KDE Plasma: KDE Plasma Version: KDE Frameworks Version: Qt Version: ADDITIONAL INFORMATION
Created attachment 181542 [details] last working backup
Created attachment 181543 [details] first broken backup
sorry, adding additional attachments seems to have submitted the bug and left my description incomplete. I have no real repro steps -- The audio was all working before I closed Kdenlive, and it didn't crash on close or open. I don't think I did anything particularly strange to trigger the bug, but if I had to guess, I did use File->Save a copy earlier when I wasn't sure if I was going to do harm in my next few edits. Please let me know if I can provide any more details! I have attached two backup files from my .local/share/kdenlive/.backup directories, one that is the last backup that can still be loaded without errors, and the other is the first backup that gives me chain errors. Thank you! Alex
Hi and thanks for your report. It is important to file bugs when such issues happen so that we have a chance to fix them. Could you first try upgrading to Kdenlive 25.04.1 ? I can open all your attached project files without warning with 25.04.1. A similar issue was fixed in this version, with automatic recovery of broken project files, so it might already be solved.
Hello! Thanks for looking into this. I used 25.04 to author the file, and that is when I first encountered the issue, but I later upgraded to 25.04.1 and am experiencing the same issue. For me, The tracks A1 and V1 are linked, but after the file loads A1 is blank, but V1 is fine. It adds the following text to my project notes automatically: "Errors found when opening project file (Tue May 20 14:31:54 2025) A1 00:04:26:18 Invalid clip (chain1) found and removed A1 00:04:30:07 Invalid clip (chain1) found and removed A1 00:04:32:21 Invalid clip (chain1) found and removed A1 00:04:34:24 Invalid clip (chain1) found and removed A1 00:04:40:02 Invalid clip (chain1) found and removed A1 00:04:41:00 Invalid clip (chain1) found and removed A1 00:04:43:16 Invalid clip (chain1) found and removed A1 00:04:46:05 Invalid clip (chain1) found and removed" I'm a developer myself, so if you'd like me to try to set breakpoints or anything like that, I'm happy to help. It's not clear to me what is invalid about chain1 from either the error messages or the kdenlive file itself. Do you know what it is complaining about? As I said, the source file is still present and intact, and the video is fine, so Kdenlive must be able to still find it.
Created attachment 181567 [details] proof of version
Thanks for your feedback. I was able to reproduce the problem by using replacement clips in your project. Will get back to you soon.
So the issue is that your clip followedCam.mkv is somehow tagged as video only (without audio). This can be fixed by opening the project file, and changing line 6338 (in the "<chain id="chain5..>" element, replacing <property name="kdenlive:clip_type">2</property> with <property name="kdenlive:clip_type">0</property> Now the question is how that happened. Do you remember doing something special with this clip, like replacing it, modifying the source?
ugh, sorry, I don't really remember. I know it was right before I added another clip to the project, so I might've dragged around the existing clips. I'm not sure. I tried diffing the last working backup and the first broken backup again and paying attention to properties around the clip_type, and I noticed that it seems to be removing the mute_on_pause property and adding a set.test.audio property. I don't know if that's relevant or not. If I remember anything that seems relevant, I'll definitely update this bug, but my best guess as to what I was doing when this broke is either some undo/redo operations or adding a new clip. Note that before I exited kdenlive I was still getting sound for those tracks, and it only broken when I reopened the file, so somehow the state in memory was different from the loaded state. I'm not sure that the current behavior of removing audio lips from a timeline/chain when it's marked audio-only is desirable; I'd guess that it would probably be better to load the existing clips and then show a warning about audio being added to a video-only file would be less destructive. Anyway, I'll try hand-editing that clip_type so I can continue working. If there's anything else I can do to test on my end, please let me know. Thank you!
Created attachment 181601 [details] xxdiff on problematic section
hey, so the manual edit you suggested worked (thanks!), but now that I'm back working on the file, I'm doing something a lot that might have something to do with the problem. I'm doing edits on a track that's below the main one, so I keep hiding and unhiding video tracks, as well as muting and unmuting audio tracks. Could that have something to do with tagging a track as video only? Just a thought....
Git commit 693da182e5c02a99a4e3c9209b3e1e94f19abf1f by Jean-Baptiste Mardelle. Committed on 23/05/2025 at 08:44. Pushed by mardelle into branch 'master'. On project load, if there is a clip mismatch (video only clip on audio track), check again the source clip. Improve error message in these cases. M +20 -5 src/timeline2/model/builders/meltBuilder.cpp M +9 -0 src/timeline2/model/clipmodel.cpp M +2 -0 src/timeline2/model/clipmodel.hpp M +8 -6 src/timeline2/model/timelinefunctions.cpp M +61 -24 src/timeline2/model/timelinemodel.cpp M +5 -3 src/timeline2/model/timelinemodel.hpp M +4 -2 src/timeline2/view/dialogs/clipdurationdialog.cpp M +1 -1 tests/modeltest.cpp https://invent.kde.org/multimedia/kdenlive/-/commit/693da182e5c02a99a4e3c9209b3e1e94f19abf1f
So I tried playing with track hide/mute but did not reproduce. Also I don't see how such incorrect clip tagging could have happened in the code. I implemented a workaround: when such case happens on project load, instead of directly removing the clips, we check again if the source clip really does not support audio. If it supports audio, we transparently fix the issue. Otherwise, the clip is removed but a more informative message will be shown: Removed clip clipname.mp4 without audio found in an audio track. I am leaving this issue opened a little more in case we find a way to reproduce
Git commit bc6fd5a4cc67730994ef0a37ed579a238cd8c15f by Jean-Baptiste Mardelle. Committed on 23/05/2025 at 09:58. Pushed by mardelle into branch 'master'. Better fix for projects with incompatible clip inserted in track M +34 -14 src/timeline2/model/builders/meltBuilder.cpp M +1 -0 src/timeline2/model/clipmodel.cpp M +1 -1 src/timeline2/model/timelinefunctions.cpp M +14 -49 src/timeline2/model/timelinemodel.cpp M +3 -3 src/timeline2/model/timelinemodel.hpp M +2 -1 src/timeline2/view/timelinecontroller.cpp https://invent.kde.org/multimedia/kdenlive/-/commit/bc6fd5a4cc67730994ef0a37ed579a238cd8c15f
sounds like much better behavior, thank you very much!