This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Audio "pops"/"ticks"/"crackling" at the beginning of clips

Tags: None
(comma "," separated)
Merlimau
Registered Member
Posts
986
Karma
8
I downloaded all files. Could you upload the Kdenlive project file as well. Then that’s more easy to reproduce. Let me know the timeline zone (in point/out point) I have to use to reproduce. At a first glance I see that your MP3 files have 320kb/s and mine 120 and 160kb/s only.
dhealey
Registered Member
Posts
17
Karma
0
Thanks. I've added the project file to the same dropbox folder. Here are the times for the items shown in the screenshot on the two tracks

A2

00:00:00:07 - 00:00:01:02
00:00:01:14 - 00:00:02:05
00:00:02:20 - 00:00:03:14
00:00:03:16 - 00:00:04:00
00:00:04:14 - 00:00:04:24
00:00:05:07 - 00:00:05:17
00:00:05:18 - 00:00:06:04
00:00:06:05 - 00:00:06:13

A7
00:00:00:14 - 00:00:05:21
Merlimau
Registered Member
Posts
986
Karma
8
Got it. I rendered the first 6:13 seconds. Yes there are clicks and distortions in the rendered file and I even hear it in Kdenlive's playback.

When I load the MP4 into Audition the MP4 is only 3sec long but it plays with the correct speed (?!). So I see at: 2.2:12sec, 2.2:14sec, 2.4:11ec, 2.4:14sec, 3.2sec clicks and distortion in Audition.

You have made customer project settings: 1920x800 12:5 (2.4:1) PAL at 25fps. Is that correct?
Let me investigate further.
dhealey
Registered Member
Posts
17
Karma
0
Yes I made a custom profile as you describe.
Merlimau
Registered Member
Posts
986
Karma
8
Disabling parallel processing for rendering gives less clicks and distortions in the rendered file.

I re-made the project as "pur" 1080p25 project but after rendering with the same clicks and distortions in the rendered file.
The same after MP3 rendering.

I assume it could be a concurrent process issue in the rendering part. I like to open an issue for this. Can I take your files and put it in the issue tracker?
dhealey
Registered Member
Posts
17
Karma
0
Merlimau wrote:Can I take your files and put it in the issue tracker?

Yes definitely! Thanks for taking the time to test this out, really appreciate it!
User avatar
ulatekh
Registered Member
Posts
5
Karma
0
I can reproduce this with a single .wav file. I recorded saying the numbers 1 through 5, and used kdenline cut them up into 5 sections. The first audio pop happens in the middle of "two". This is kdenlive 18.12.3 and mlt 6.12.0, as provided by Fedora Core 29, BTW. (Edit: Reproduced with latest mlt/kdenlive from git.)

Is providing this sample helpful, or do you have all the data you need to track down the problem?
It's kind of maddeningly easy to reproduce.
I'm trying to build debug versions of the needed tools (kdenlive_render and mlt, I think), but someone that knows the code better can probably find this in an instant.

Edit 1: listening closely to the source audio, at the point where the rendered audio pops loudly, it seems there's the *tiniest* sound that might qualify as a pop, but it's barely audible in the source, and it's getting magnified way out of proportion somehow in the rendered audio. Is the rendered audio getting converted to frequency-domain and back or something? I'm not sure why something that sounds like a tiny pop is somehow getting magnified so much.

Edit 2: Tested using latest mlt (from git on 7-Jul-2019) and kdenlive (from git on 13-Jul-2019). Popping artifact still present.
Where is the issue-tracker entry for this? I looked at recent changes to the kdenlive bugs at https://bugs.kde.org/ but didn't see it.
User avatar
ulatekh
Registered Member
Posts
5
Karma
0
I've made some progress on this bug. Hopefully the developers are listening.

I found two ways to make the problem go away. One, don't reuse the same source clip -- use a different copy of it. I repeated my "1 through 5" test, but with 4 hardlinks to the original sound file, and the loud pops went away. Two, arrange the edited clips in reverse order that they appear in the source clip, i.e. it became a "5 through 1" test.

So the issue appears to be related to reusing the same clip and seeking forward inside of it.

I'm trying my best to understand src/modules/avformat/producer_avformat.c, but it's not easy -- the flow of control is pretty wild, and the lack of strong encapsulation (e.g. mlt_frame_set_position() can set the "original_position" property, but it's also set in producer_avformat's producer_get_image() and producer_get_frame()) makes the data flow hard to understand. I really hope one of the developers that knows this code better can track down the problem using the above observations.

Meanwhile, I'm going to remake my dialog-oriented source clips (i.e. the .wav files I recorded with a microphone) so that the lines are embedded in the reverse order that I'm using them in my video, and see if the above observations work when put to the test.

Edit: I've redone several scenes in my video this morning, placing clips in the timeline in the reverse order they appear in the source audio file. No popping artifacts. Looks like I found a legitimate clue!
dhealey
Registered Member
Posts
17
Karma
0
ulatekh wrote:Where is the issue-tracker entry for this? I looked at recent changes to the kdenlive bugs at https://bugs.kde.org/ but didn't see it.


Hi,

Yeah I forgot to open a bug report. I've done it now though - https://bugs.kde.org/show_bug.cgi?id=410726 :)
Merlimau
Registered Member
Posts
986
Karma
8
ulatekh wrote:Edit: I've redone several scenes in my video this morning, placing clips in the timeline in the reverse order they appear in the source audio file. No popping artifacts. Looks like I found a legitimate clue!


Do I understod correct? You record different text phrases and save it in 1 wav file.
Load this wav file into Kdenlive and cutting it into the needed pieces of text phrases (at a silent point?) but let the order as you spoke it. Render this video: You get pops.

Re-arrange the text phrases on the timeline in a manner that is not the original spoken order. Render this version: You get no pops. Correct?

What project setting (1080p25fps?) and render settings do you use?

I assume Kdenlive doesn't cut the wave file on the zero-point of the sinus wave. If you cut the original wav lets say in Audacity at the zero-point and load this cutted wav files into Kdenlive it should not pop after rendering.

Or do you think something in MLT is wrong?
User avatar
ulatekh
Registered Member
Posts
5
Karma
0
Merlimau wrote:Do I understand correct?


Yes, and it would have been pretty easy for you to verify that.

Merlimau wrote:What project setting (1080p25fps?) and render settings do you use?


The last two projects I made were 24000/1001 fps and 448x256 video, and 23 fps and 1280x270 video.
I don't think it's dependent on project settings.
I always render to FFV1/FLAC or WAV.

Merlimau wrote:I assume Kdenlive doesn't cut the wave file on the zero-point of the sinus wave. If you cut the original wav lets say in Audacity at the zero-point and load this cutted wav files into Kdenlive it should not pop after rendering.

Or do you think something in MLT is wrong?


It happens even if I fade in/out on audio clips, so I think something is wrong in MLT (probably multiple things). I would be glad to help debug it, but there are practically no source-code comments, or any other human way to figure out how the code works. Lack of documentation in the presence of heavily multithreaded code is especially horrific.

I've got a scene in a new video I'm working on, that's reproducing it madly -- at this point, I have to stop work on the video and get this problem solved, or use a different open-source editor. This audio-popping problem is prevalent and debilitating.
adamapple
Registered Member
Posts
1
Karma
0
ulatekh wrote:I've got a scene in a new video I'm working on, that's reproducing it madly -- at this point, I have to stop work on the video and get this problem solved, or use a different open-source editor. This audio-popping problem is prevalent and debilitating.

Hey ulatekh - did you ever find a solution or hear from anyone else on this, or end up using a different editor? I've got a skit I'm mixing with two camera angles that goes back and forth pretty frequently, so audio is getting snipped several dozen times in just a few minutes and producing the popping noise with each one. Your idea of adding in a new copy of the audio with every transition is great for videos with fewer transitions - but not feasible for a project like this.
rumangerst
Registered Member
Posts
58
Karma
0
OS
I still have this issue, even with the MLT version that comes with the current Kdenlive version having fixed the bugs. I also managed to trigger another issue that might be related to all these audio problems:

1. I recorded ~200 mic captures, trimmed the start and end in Kdenlive, and and put them into the video at their appropriate place
2. I exported audio only (FLAC, ~23 min length) and post-processed it in Audacity (also to remove the pops and clicks)
3. I imported the Audacity output (FLAC) into a separate track (the original one set to muted), but then noticed that I had to make some changes there
4. I made changes in the Audacity output

Now, both the preview and render (!) occasionally show audio "lags" (just as if the preview is not rendering fast enough with multiple effects).

There was no other alternative to editing the original capture track, re-exporting it, and doing everything in Audacity all over again (which took like 6h). After finding out the that experimental multi-threading render (which is default for some reason for me) breaks clip speed, I finally had the render :z

This was not fun. :(

I hope the audio issues can be resolved in the future
leifa
Registered Member
Posts
7
Karma
0
I always have this issue with my videos. I just downloaded the latest version (20.12.1) and it still appears!
My workaround is to add a 1 frame audio fade in to every single audio clip, which is of course very annoying, but the clicks disappear.

To reproduce it: The audio file is an MP3 with 44100 Hz, video profile is 1504x846 at 15 FPS (but I am sure it also appeared on other video settings).
I just add the audio file to the time line and cut some parts out. Even though the cuts are at points with silence, I quite often hear a clicking sound at the cut.
Any there other info you need?

Is there any chance of this bug getting fixed any time soon? It is known for a long time now and super annoying!
dhealey
Registered Member
Posts
17
Karma
0
leifa wrote:I always have this issue with my videos. I just downloaded the latest version (20.12.1) and it still appears!
My workaround is to add a 1 frame audio fade in to every single audio clip, which is of course very annoying, but the clicks disappear.

To reproduce it: The audio file is an MP3 with 44100 Hz, video profile is 1504x846 at 15 FPS (but I am sure it also appeared on other video settings).
I just add the audio file to the time line and cut some parts out. Even though the cuts are at points with silence, I quite often hear a clicking sound at the cut.
Any there other info you need?

Is there any chance of this bug getting fixed any time soon? It is known for a long time now and super annoying!


Here's the bug tracker - https://bugs.kde.org/show_bug.cgi?id=410726

Please report your findings there.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]