Ripping sound inbetween audio parts

Hello everyone,
I’m originally a Premiere Pro user. As I would do in Premiere, I remix the sound in order to obtain the desired length for a music (so that it fits my video). Except that in Kdenlive I have a problem where as soon as the playback reaches the junction between two parts, I get a “Rip” sound that ends up in the audio after rendering. However, if I run the same playback twice, I sometimes don’t get this sound (most of the time I do).

Unfortunately, it’s difficult for me to share the sound with you, but it’s similar to the “Rip” sound you hear when you move the timeline cursor backwards (except that it’s very brief).

(Kdenlive 24.12.01)

Welcome to the forum.

This is somehow a known issue which we don’t found a solution so far. What you can do is adding a audio transition to “hide” the “rip” sound.

Move the cursor to the edge of the clip and double click. Select the added video transition and hit delete.

Hello,
I’ve just tried your solution, but it doesn’t seem to work. When I add the transition effect, the “Rip” disappears, but if I press delete, it comes back.

Unless you’re hearing something different to what I’m thinking (I’d call it a click, or maybe scratch, rather than ‘rip’ - but that’s probably a tomayto/tomahto thing) - the problem is most probably just fundamental to what happens when you simply concatenate two random sets of audio samples that don’t end and start in ‘perfect’ (no signal, no DC bias) silence - and not so much a ‘bug’ in kdenlive per se (though there are commonly found audio processing bugs, especially in complex codecs, that can introduce this too).

When you do that sort of thing, there’s a pretty good chance of there being a discontinuity - the step from the last sample of the first set to the first sample of the following set is going to be some arbitrary pulse that injects some arbitrary set of frequencies at some arbitrary power level into the reconstruction of the audio those samples represent.

And you’ll hear that as a glitch in the transition between them.

So if you want to avoid that, you need to do one of a few options, depending on what end result you’re actually seeking.

  • if your audio is simply one thing ending and another separate thing starting, the simplest option is to make sure they start and end “silent”. Put a volume control keyframe on the first and/or last frame to make them fully silent at the junction.

  • if your audio should blend and merge from one to the next, use an audio transition, or overlap and fade them through the transition.

  • the other option is to use a DSP filter to minimise the glitch, but that’s not really the answer that fits this situation the best in general.

If you actually have control over the audio files before they are imported to kdenlive, then making sure they start and end cleanly will save you a lot of pain, but the above is what you need to do when you don’t and don’t want to separately clean them up.

1 Like

Hello,
The sound I hear is very different from the well-known “click” problem on KDE. Moreover, the sound changes a little sometimes, and even becomes inaudible sometimes, even though the sound track is the same. I don’t see how this could be due to the cutting of the music itself. I used to do this without any issues on Premiere.

I don’t know the “well known problem on KDE” to make that comparison, sorry - but I do know signal processing, and I do know that muting the first frame of audio when there is a transition glitch has always prevented this problem for me in kdenlive in simple cut transitions.

It’s possible that MLT (or even the system audio pipeline on whatever platform you’re on) exacerbates this in how it handles the transition, but it is a ‘classic’ problem with splicing audio streams. And with some advanced codecs, that don’t promise to remain bit-exact, yes, even cutting a contiguous track (but keeping both parts in the same encoding) is enough to introduce this sort of problem at the junction if the parts are decoded separately.

It’s also not impossible Premiere does something to mitigate it - but every mitigation strategy has some unwanted side effect in some situations. If you’re hearing something Special in this case, then you’re going to need to find a way to share it, otherwise it’s going to be hard to diagnose more than this.

This is mostly aimed at @ApprentiUnity and also whoever is listening (because this comes up several times a week in my feeds and needs to be better-known), although I start by quoting ron. I’m just backing ron up here.

TLDR don’t use words to describe audio (or video) problems. Words are bad at this. Record and upload it.

You’re right, the terminology is specific, but it is well-defined, so it is not a tamato/elephant thing, it really does matter which word we use to describe the thing.

Onomatopoeia may suffice, but generally it leads to as much confusion as it does assistance. Worse yet, is re-using a word someone read off the internet with the same effect, thinking that it describes their noise when it doesn’t. You end up trying to troubleshoot a crackle which is really a pop, which works as well as eating a tamato when it’s really an elephant (and not just a tomayto) :wink:

See also: graphics problems (is it a hitch, stutter, dropped frame, tearing, etc etc, people LOVE to get these wrong)

Of course, that’s really specific knowledge that people often don’t know which is why it’s generally easier to just record it and upload the wav. Literally recording a speaker with your phone is usually better than any single word.

And yes, audio should be cut at zero crossings or faded to 0 if that is not possible. Instant changes in amplitude (which is what happens when you join clips with non-zero crossings) are an infinitely high frequency sound for an infinitely low period of time, which we will hear as a high frequency sound for a low period of time, a single, high-frequency peak, which we call a ‘click’ - not a pop (that’s low frequency) or a crackle (that’s multiple peaks) or static (that’s multiple frequencies over time) or a ‘rip’, but a click… You get the idea :slight_smile:

I’m aware that some editors will do this for you and some might be just realising that (cross)fading has been covering this up. It’s still best-practice because garbage in garbage out is a thing, and because there is no way a machine can know the right place to cut it, otherwise. There are objectively correct options but the right one is subjective/artistic.

You should have no problem linking the sound from kdenlive to any audio recorder. If you’re on linux and you can hear it, it ain’t hard to record it.

If the mindless copypaste Gods are smiling upon us this will work:

pw-record soundglitch.wav --record --target=$(pw-dump|grep node.name -C10|grep kdenlive -A10|grep object.serial|sed -e 's/[^0-9]//g')  -P stream.capture.sink=true

(in defence of linux: there are also nice GUIs for doing this kind of thing. you don’t need the terminal. it’s just faster to copypaste one thing)

The problem for me is not to record the sound, but to upload it :slightly_smiling_face:. Which platform is the most convenient?

(Thx for the command btw)

I guess that’s a matter of personal use-case. For me it’d be youtube because it’s the next tab. I imagine that this is boomer af and I should admit that sharing media on the internet is definitely not my field of expertise :smiley:

(we.tl/t-6Pm554uiIZ)
The forum doesn’t let me use links. Just paste the link in your browser.
Available only for the next 7 days. The issue is at 2 seconds (around).

That worked!

Do you mean at the peak at sample 109879 in the left channel only? That doesn’t look like the kind of thing attributable to digital error at all. I don’t know this song, maybe that’s not it and that’s in the recording. Maybe it’s mixed in from elsewhere or a phone notification IDK. Nothing else stands out. :man_shrugging:

Uhm… isn’t this problem meant to be inbetween audio parts? Because that music doesn’t seem to stop in the middle :wink:

Hard to hear it when you don’t know the source material and it’s noisey already, but the spectrogram tells the story (look in the middle where I left the playhead):

So yeh it is that region I specified.

I still don’t really have enough info about the source material, to go on here. Is that song one clip that spans across two other clips and the audio glitch came from them? Or am I hearing a join between two clips with two parts of the song? It could be 100 things.

To be clear, I’m not trying to help solve this (although of course I will if I can!), I don’t know kdenlive’s audio stack well. I’m just trying to help you explain the problem so that someone can help.

The recording is made in a single take. I thought I’d explained it clearly, but in fact what you’re showing is the join between two parts of a single piece of music (to match the video). So I have this sound at the joint, which I can’t get rid of. In my opinion, it’s not linked to the audio itself because :

  1. Making the transition a few frames later preserves the sound (even if its frequency changes slightly)
  2. When I change the first audio, the sound frequency also changes at the join.

I’m confused, if this is how the song sounds without being cut, why is it cut?

I mean don’t get me wrong, if you cut it and join it in the same place it should be identical in output but … I feel like I’m missing something, and missing detail is what I’m trying to solve, here.

Do you maybe mean that this join is between two different, previously separate parts of the song?

Exactly, and so I’m trying to get rid of this sound at the joint.

You definitely need to cut at zero crossings for this. Otherwise you have like a 1 in 16777216 chance, that the bad thing I described above won’t happen.

It’s weird that it isn’t happening every time, but it’s also weird that it ever works at all really.

Edit: Musically/artistically speaking, you probably actually are going to need to make these clips overlap substantially and crossfade between them. Even if you get the errors from zero crossings out of the picture, it won’t necessarily sound nice to instantly cut from one part of the song to another.

This is the part that’s bothering me now. I had to come back to it.

I can’t reproduce it at all. Even if I deliberately cut at non-zero crossings, I clearly see it, like I honestly expected I immediately would in your wav. I can’t identify anything like that in yours, and I should, because they don’t disappear by magic and you didn’t do it by hand.

It is smack dab in the middle of a kick drum and a stack of other sounds which doesn’t help. It’s really hard to tell if anything I look at is part of the music, something to do with editing like not cutting on beats or zero crossings, some processing that hasn’t been mentioned, an actual bug, or what…

I do know that if I just cut somewhere vaguely on-beat and off-zero, it’s obvious; likewise, no combination of cutting that music on- or off-beat or on- or off-zero-crossing, can cause it to make that noise (or any unexpected sound). Compared to your recording and description, each of these things makes no sense, and together, they’re downright confusing.

It seems like yours isn’t cut on-beat, though. It seems like you cut it some distance in front of that kick drum (before which there is some sound playing, we have no idea what the sound is, so that might very well be what we are hearing). Either that, or the noise doesn’t occur inbetween parts as described, but well-before the end of the first part.

For your reference:
On the left:
Start of the audio glitch you’re hearing
End of that glitch
Start of the beat
(note: gaps between them all.)
(Not pictured: where, exactly, is the join?)
On the right:
A join at a non-zero crossing in a clip of mine
(like that which you supposedly have at least one of in your clip where that glitch is, and I can’t see it)

Forgive me if I’m mistaken about this, I’m trying to ascertain a near-infinite level of detail if the source material and the actions taken on it, from a few words and a picture, so I may be getting things twisted. It sure seems like you have multiple problems here - which would explain why you’re having trouble explaining ‘the’ problem even to a dev and to ron who clearly knows stuff about this. We’ve found at least one problem and probably another really big one, but still nothing that should explain intermittent behaviour aside from the bug Eugen mentioned and that wasn’t it because the workaround doesn’t work. So it seems you have three problems. So far.

If you want to clear it up more, you could show the two separate clips, separately (so we know what each separate part of the music sounded like before they were joined and glitched at the join, and then it’s possible to identify the glitch, and the join, too), you could show how it sounds when it doesn’t do this (in OP you said it sounds different sometimes; again this helps identify what sound is what), and you could show what happens when you do it with a sine wave in place of the music (to isolate the glitch itself from the content). I understand that might be fiddly so I’m trying to do sound with words and pictures for you.

One more thing before I stop talking your ear off: nobody’s asked yet - is this just this project, or do you see it with other projects doing the same thing?

NGL I just wanted to know what the heck a “rip” was meant to be so the other lads here could continue to figure it out with you, but I’ve kicked the hornet’s nest :smiley:

1 Like

Well, I for one am glad you followed up a bit more - because I took a quick peek at that file after your initial analysis - and honestly, I couldn’t hear any distinct glitch that wasn’t indistinguishable from the Artistic Licence that the rest of that track was taking.

The whole clip is basically just pink noise with a bunch of transient beats, that cuts between different motifs all over the place, so there’s plenty of masking going on for hearing any sort of finer detail. Especially if you don’t already have your ears tuned to the original uncut source material.

Even trying to find the precise point you were looking at, I couldn’t find any unfiltered discontinuity. Most of it seems to be hard low-passed at 16-18kHz. There were a few things that looked suspicious initially, but once you zoomed in close enough they were again indistinguishable from things happening ‘seemingly deliberately’ all over the place elsewhere.

I don’t know if that is in its own turn an artifact of how this segment was recorded … but between “it happens at about 2 seconds” and “yeah, I’m making arbitrary joins of clips cut in an editor working at video framerate granularity, is that A Problem”, I wasn’t feeling very worried there was going to be a bug revealed by this particular example.

If there actually is something more to this, I’m afraid I need to return to “pictures and clips showing the problem” can help explain it - but if you think it’s really a bug and want help debugging it, we need some actual short clips, a project file, and precise steps to reproduce it. There’s only so much you can be certain about from blurry super8 footage of ‘ufos’.

2 Likes

THIS. Thanks for saying it, I’m glad it wasn’t just me.

AHAHAHA perfect analogy.

Mmh. I meant double click between the clips then you get a transition between the clips. If this doesn’t work you have to make both clips end a bit shorter.

Then click on the video transition which then get red and you can hit delete so you only have the audio transition. See my screenshot.