Bug 511402 - Audio tracks being replaced
Summary: Audio tracks being replaced
Status: RESOLVED FIXED
Alias: None
Product: kdenlive
Classification: Applications
Component: Timeline & Editing (other bugs)
Version First Reported In: 25.08.2
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Jean-Baptiste Mardelle
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2025-10-31 00:02 UTC by NavyEOD_24
Modified: 2025-11-18 08:01 UTC (History)
1 user (show)

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


Attachments
Image of clip monitor showing all three audio streams. (400.85 KB, image/png)
2025-10-31 00:02 UTC, NavyEOD_24
Details

Note You need to log in before you can comment on or make changes to this bug.
Description NavyEOD_24 2025-10-31 00:02:45 UTC
Created attachment 186348 [details]
Image of clip monitor showing all three audio streams.

SUMMARY
During editing, kdenlive will recognize all three audio streams in my footage. I can place them down in the timeline and do whatever I want with them. When I save and exit, opening it later, audio stream 2 has been replaced with all content within audio stream 3, essentially duplicating itself. Audio track 2 is no longer in the timeline, all instances of it (except for one slowed down section for some reason) are replaced by stream 3. When I pull out the footage to try and replace it, there's a high chance it will be placed into the timeline with stream 2 replaced by stream 3. It's rare that footage I drop into the timeline has all 3 audio streams.

STEPS TO REPRODUCE
1. Import footage into kdenlive
2. Drop footage into timeline, edit, save and exit
3. Open the .kdenlive file to edit again

OBSERVED RESULT
Audio stream 2 is completely replaced by stream 3.

EXPECTED RESULT
Stream 2 is untouched, placed in its original position.

SOFTWARE/OS VERSIONS
Windows 11
kdenlive 25.08.2, also affects 25.08

ADDITIONAL INFORMATION
All three streams are still in the source footage and can be seen by kdenlive, as the clip monitor can display all three tracks. I have not changed any settings from my prior projects in kdenlive and only updated the software to the latest version where the bug still persists. I've linked the KDE forum I created asking if this was a bug for extra screenshots since I can only submit one here. If I need to obtain any other information such as crash logs or backup files please let me know and I'll do my best to get them. I'm also unsure of what component this would go under, so if this does not belong in the "Project Bin & Import" category I apologize. I was struggling between this and the "Timeline & Editing" category so I'm taking a shot in the dark.

I cannot share my source clips like my last bug report. Seeing as the source footage is nearly 4 hours long and even one segment of footage is almost half an hour I don't have any cloud space that could store that footage. If there is a service I can use to share them with you let me know. I will, however, share every other clip in the bin that doesn't eat up space on my Google Drive. I've shared that link with you and a link to an unlisted video showing the error below. I can't explain well through text and it's better for you to have some visual proof to see if any sort of cross-referencing or developer knowledge checking will work and lead to a faster conclusion.

https://youtu.be/eX4xOOTy4Qk
https://drive.google.com/drive/folders/1C1bNK41glwRYW3KKI9hHn5XpsiU4dZxH?usp=sharing
https://discuss.kde.org/t/audio-tracks-being-replaced/41148
Comment 1 NavyEOD_24 2025-10-31 00:24:12 UTC
I went ahead and rendered the original video so you could hear me talking. Thought it'd be better than trying to guess what I was saying at a specific time.
https://youtu.be/Iue6iEy41Wc
Comment 2 NavyEOD_24 2025-11-04 18:05:08 UTC
Hello KDE, I've got some new information! I did some testing with the audio tracks from pure random chance while talking with a friend about editors (completely unrelated to this) and wanted to see if this bug occurred with other audio tracks. In the video below, I opened the same .kdenlive editing file as the original post and took a section from the source footage. When I placed it this way in the timeline, V1/A1/2/3, as I always usually do, the bug occurs, as I expected. When I place it in a different way, V2/A2/3/4, the bug happens again but this time with stream 1 from the source footage overtaking stream 2 instead of stream 3 replacing stream 2. The last configuration, V3/A3/4/5, the bug does not happen. I tried this multiple times, both in the video and after to confirm this as a solution and it works. I'm unsure as to why A1 and A2 are corrupted in such a way, but if this is a permanent solution to this problem then I'll be relieved that I don't have to remake my video.

I also went ahead and played the footage in both placements on the timeline to show what happens when you play the replaced sections. As one would expect, the bugged clip is much louder seeing as the tracks are duplicated on the timeline.

https://youtu.be/X6AbfRpxmQc

I'll keep you all updated. If the bug happens again but with the different configuration of V3/A3/4/5, I'll post it again here. If not and I do render the video perfectly, I'll send a reply saying that this was a solution. Hopefully this is enough, as I know this bug is extremely strange (or maybe not, I'm no software developer xD), so if you need anything please contact me.
Comment 3 NavyEOD_24 2025-11-06 22:10:30 UTC
Hello KDE Team, I've done some more experimenting and I've discovered that the final method, placing my footage into V3/A3/4/5 works. I do ungroup it and move the footage to V1 since it's easier, but it doesn't cause bugs and my audio doesn't get replaced by doing this action. Whatever is causing this only occurs whenever the audio is moved, not video. I've been able to edit, save, close, reopen and render my project without the bug reoccurring.
Comment 4 emohr 2025-11-09 10:02:02 UTC
Thank you for the detailed report. 
Watching closely your video https://youtu.be/X6AbfRpxmQc I see that only after you release the clip in the timeline on V1 or V2 it changes audio stream.

Which was the last Kdenlive version without this issue?
Do you have a short MKV file with 3 audio streams which cause this issue so I can test?
Comment 5 Jean-Baptiste Mardelle 2025-11-14 11:45:12 UTC
Thanks for your report. I cannot reproduce the problem with the sample clip I have (video with 4 audio streams). Could you please test using this file in your project to see if the problem also happens ? The file is 64Mo, so not too large.

https://files.kde.org/kdenlive/media-samples/1080i60_SMPTE_8CH.mov

Thanks in advance for your feedback
Comment 6 NavyEOD_24 2025-11-16 07:46:47 UTC
Hello, emohr and Jean! I apologize for the late reply, I got a burst of motivation to finish the video with this bug and finally got done. Sadly it's not all good news, as I've returned with some hopefully useful information. When I was watching the rendered result, everything except for a couple minutes in the beginning of the video played as I expected it would. To see if I had accidentally caused an error or replaced an audio track by accident I opened the file again, noticing that all of audio track 3 was replaced with audio track 4. This *only affected the source streams* from where I got the footage from, not other clips or audio.

This makes me think it may be something with that particular source clip, however I opened a backup file to see if I could recover the work and found that everything was back in its original position. Something that confuses me is whenever I saved this backup as two completely different files, both files were bugged and had their audio tracks replaced. I'm not sure if it *is* my source clip or if it's something with melt. I'll leave that deduction to the professionals.
 
To answer your question, emohr, this bug started happening in 25.08 randomly one day whenever I was using it for this video. I didn't change any settings nor did I activate some weird audio merging option. I opened it, saw that the tracks were bugged out, then updated to 25.08.2 to see if it fixed itself. It did not. 25.08.2 still has this bug. I'll try doing a clean install and then seeing if that also works. As I'm writing this I'm getting a small snippet from the problematic source clip for you to mess around with and see if there's a problem with it or something else entirely. When I post this message it is still in the process of uploading the video into the gbGoogle Drive folder found both at the bottom of the original post and this reply.

Jean, when I experimented with the footage you gave me nothing happened to the audio streams. I rendered it, saved it, closed it, changed it again, saved it and reopened it once more. Nothing bugged out from what I saw. This was on a new save file. On the save file for my video, though, the moment I drop your clip into the timeline audio streams are being replaced. I've included a couple pictures of the issue, one as soon as I drop it in and moving it up and down on the timeline along with another one before it's dropped into the timeline. You can see kdenlive is already replacing the streams before I let go of my mouse. They're named "jeanclip" for their prefixes.

Overall, what I can take away from this experience is that whenever I save in A1/2/3, the tracks will replace themselves. Whenever I render in A3/4/5, the tracks will replace themselves when I open the file after the render is completed, assuming that I close kdenlive after the render has finished. Maybe a fresh install will help and I will report back with what I gather if anything at all.

Thank you for your patience and I hope this helps you out.

Regards,

https://drive.google.com/drive/folders/1C1bNK41glwRYW3KKI9hHn5XpsiU4dZxH?usp=sharing
Comment 7 Jean-Baptiste Mardelle 2025-11-16 09:43:14 UTC
Thanks a lot for the project files! I can now reproduce with your project, so will look into it and hopefully this can be solved for the upcoming 25.12.0 release!
Comment 8 NavyEOD_24 2025-11-16 17:36:20 UTC
(In reply to Jean-Baptiste Mardelle from comment #7)
> Thanks a lot for the project files! I can now reproduce with your project,
> so will look into it and hopefully this can be solved for the upcoming
> 25.12.0 release!

I'm glad you were able to reproduce the bug I was encountering, and I'm glad to be of assistance! Very excited for 25.12 if this bug does get fixed in time for the upcoming release.
Comment 9 Jean-Baptiste Mardelle 2025-11-18 08:01:31 UTC
Git commit a8a09fadf2aa014ff860bc9f7c9980cd355fc63d by Jean-Baptiste Mardelle.
Committed on 18/11/2025 at 08:01.
Pushed by mardelle into branch 'release/25.12'.

Fix storing of audio stream index can lead to stream confusion in timeline
FIXED-IN: 25.12.0

M  +67   -56   src/bin/projectclip.cpp
M  +5    -3    src/bin/projectclip.h
M  +13   -4    src/timeline2/model/clipmodel.cpp
M  +9    -0    src/timeline2/model/clipmodel.hpp
M  +2    -1    src/timeline2/model/timelinemodel.cpp

https://invent.kde.org/multimedia/kdenlive/-/commit/a8a09fadf2aa014ff860bc9f7c9980cd355fc63d