Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mlt + kdenlive: sound crackling issue #811

Open
SpidFightFR opened this issue Jul 7, 2022 · 22 comments
Open

mlt + kdenlive: sound crackling issue #811

SpidFightFR opened this issue Jul 7, 2022 · 22 comments

Comments

@SpidFightFR
Copy link

Hello everyone, i have a little issue with MLT and kdenlive.
When i render a video, the audio seems to be crackling, it also happens when i run the mlt command without using kdenlive.

How can i fix that issue ? Is it linked to a wrong configuration ?

Here's my hardware specs:

hardware specs
- CPU: Ryzen 5 2600
- RAM: 16Gb
- GPU: Nvidia GTX 1060
Software versions
- Linux kernel version: 5.18.9-zen1-1-zen
- mlt version: 7.8.0-1
- kdenlive version: latest git version

Thank you for your help !

@bmatherly
Copy link
Member

Does the crackling happen for all source clips, or just from a specific source? Crackling audio is a common problem for source clips that are variable frame rate. OBS and other screen capture programs often create VRF unless they are configured properly.

@frdbr
Copy link

frdbr commented Jul 7, 2022

What version of Kdenlive are you using? I've seen issues with crackling happening with flac files, is your audio flac?

@bmatherly
Copy link
Member

I've seen issues with crackling happening with flac files, is your audio flac?
This FLAC issue is still unresolved.
#741

@SpidFightFR
Copy link
Author

Does the crackling happen for all source clips, or just from a specific source? Crackling audio is a common problem for source clips that are variable frame rate. OBS and other screen capture programs often create VRF unless they are configured properly.

@bmatherly The base clips are intact, that's where i'm confused.
At first i thought it was a problem with OBS, but the obs output files don't have this issue. Same for the music files and sounds files.

@SpidFightFR
Copy link
Author

SpidFightFR commented Jul 7, 2022

What version of Kdenlive are you using? I've seen issues with crackling happening with flac files, is your audio flac?

@frdbr the version i use for kdenlive is the latest git version (i use the kdenlive-git AUR package apparently it's the version 22.07.70.r16280-1 according to the AUR, but i'm not sure).

Also that issue wasn't on the windows version of Kdenlive, it happened when i switched to linux (it happens with the Linux version).

As for flac files, i don't use flac files.

@frdbr
Copy link

frdbr commented Jul 7, 2022

What version of Kdenlive are you using? I've seen issues with crackling happening with flac files, is your audio flac?

@frdbr the version i use for kdenlive is the latest git version (i use the kdenlive-git AUR package apparently it's the version 22.07.70.r16280-1 according to the AUR, but i'm not sure).

Try to see if you can reproduce this using the AppImage and let us know.

Also that issue wasn't on the windows version of Kdenlive, it happened when i switched to linux (it happens with the Linux version).

Can you share a sample of your footage so I can try to reproduce?

As for flac files, i don't use flac files.

Good!

@SpidFightFR
Copy link
Author

Can you share a sample of your footage so I can try to reproduce?

Hey, thanks for your response, well, i can't really share the sample since i use multiple source files that are dispatched in my pc.

Fortunately, it doesn't depend on the footage itself, it happens with every "heavy" editing i try to make: with video, music, and at least a transform or a transition (or both), at the same time.
The quick video i showed you is just an example, but it happens at the beginning of the video too (the music has artifacts at the very begging for a few seconds)...

Sorry if it didn't answered your question...! 😅

@SpidFightFR
Copy link
Author

SpidFightFR commented Jul 7, 2022

Try to see if you can reproduce this using the AppImage and let us know.

I tried to launch an Appimage version of Kdenlive, and it doesn't seem to work, maybe because i'm using wayland.

It says core dumped

@evertvorster
Copy link

Have reported this to Kdenlive's bug tracker, thinking it was a kdenlive bug.
The crackling was not noticeable on 25fps video and flac audio, but when I started using 60fps video, the crackling became audible and annoying.
Here is an example video where you can hear the crackle.
https://youtu.be/ywQ5Sclv6-M

This is with kdenlive and mlt both pulled from git master and built from source on Arch Linux on 2023-03-04
System information:
Operating System: Arch Linux
KDE Plasma Version: 5.27.2
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8
Kernel Version: 6.2.2-AMD-znver2 (64-bit)
Graphics Platform: X11
Processors: 8 × AMD Ryzen 7 4700U with Radeon Graphics
Memory: 36.9 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Manufacturer: LENOVO
Product Name: 20T8001JUS
System Version: ThinkPad E15 Gen 2

@bmatherly
Copy link
Member

Have reported this to Kdenlive's bug tracker, thinking it was a kdenlive bug.

Is your source clip variable frame rate?

@evertvorster
Copy link

Hi Brian.
I captured the source clip with OBS studio.
Here are the sound settings:
image

And here are the video settings:
image

I hope this helps.

@evertvorster
Copy link

Oh, this may be important too:
image

@bmatherly
Copy link
Member

I do not use OBS. So I do not know about the settings. Maybe a thread like this is helpful (there are many more out there):
https://obsproject.com/forum/threads/how-to-set-obs-to-record-in-constant-frame-rate.148781/

FFProbe is an easy way to see if your source clip is variable frame rate.

@evertvorster
Copy link

Here is the ffprobe output on the source footage: [evert@Evert XO Fighter]$ ffprobe 2023-03-03\ 00-13-18.mp4
ffprobe version n5.1.2 Copyright (c) 2007-2022 the FFmpeg developers
built with gcc 12.2.1 (GCC) 20230201
configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-version3 --enable-vulkan
libavutil 57. 28.100 / 57. 28.100
libavcodec 59. 37.100 / 59. 37.100
libavformat 59. 27.100 / 59. 27.100
libavdevice 59. 7.100 / 59. 7.100
libavfilter 8. 44.100 / 8. 44.100
libswscale 6. 7.100 / 6. 7.100
libswresample 4. 7.100 / 4. 7.100
libpostproc 56. 6.100 / 56. 6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '2023-03-03 00-13-18.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf59.27.100
Duration: 00:04:43.20, start: 0.000000, bitrate: 412 kb/s
Stream #0:00x1: Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 206 kb/s, 60 fps, 60 tbr, 15360 tbn (default)
Metadata:
handler_name : VideoHandler
vendor_id : [0][0][0][0]
Stream #0:10x2: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 193 kb/s (default)
Metadata:
handler_name : SoundHandler
vendor_id : [0][0][0][0]

@evertvorster
Copy link

For completeness, here is the mediainfo output:
mediainfo 2023-03-03\ 00-13-18.mp4
General
Complete name : 2023-03-03 00-13-18.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom (isom/iso2/avc1/mp41)
File size : 13.9 MiB
Duration : 4 min 43 s
Overall bit rate : 412 kb/s
Writing application : Lavf59.27.100

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.2
Format settings : CABAC / 4 Ref Frames
Format settings, CABAC : Yes
Format settings, Reference frames : 4 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 4 min 43 s
Source duration : 4 min 43 s
Bit rate : 195 kb/s
Maximum bit rate : 2 500 kb/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 60.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.002
Stream size : 6.59 MiB (47%)
Source stream size : 6.96 MiB (50%)
Writing library : x264 core 164 r3095 baee400
Encoding settings : cabac=1 / ref=1 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=2 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=12 / lookahead_threads=4 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=1 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=10 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Color range : Limited
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709
mdhd_Duration : 283200
Codec configuration box : avcC

Audio
ID : 2
Format : AAC LC
Format/Info : Advanced Audio Codec Low Complexity
Codec ID : mp4a-40-2
Duration : 4 min 43 s
Bit rate mode : Constant
Bit rate : 192 kb/s
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 48.0 kHz
Frame rate : 46.875 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 6.53 MiB (47%)
Title : simple_aac_recording
Default : Yes
Alternate group : 1

@frdbr
Copy link

frdbr commented Mar 7, 2023

In Kdenlive, we have seen reports about crackling when working with either FLAC files or in 60fps projects.

https://bugs.kde.org/show_bug.cgi?id=407346#c14

@bmatherly
Copy link
Member

In Kdenlive, we have seen reports about crackling when working with either FLAC files or in 60fps projects.

https://bugs.kde.org/show_bug.cgi?id=407346#c14

It would be good if someone could translate that bug report into the simplest possible melt command line. It should help to simplify the debugging.

@j-b-m
Copy link
Contributor

j-b-m commented Mar 8, 2023

Ok, so using the sample sine wav file provided in the Kdenlive bug report:
sine.flac

The problem can be reproduced using this melt command:
melt -profile atsc_1080p_60 sine.flac in=735 -consumer avformat:test1.wav

The resulting file has clear audio cracks at start. Using an atsc_1080p_25 profile I didn't get audio cracks

@bmatherly
Copy link
Member

Thanks. That is helpful. But it really belongs in #741. It seems this issue is becoming a duplicate of #741 - unless someone has a "crackling" problem that does not involve raw flac.

@SpidFightFR originally reported:

As for flac files, i don't use flac files.

That is why I kept the issue open and did not mark it as a duplicate.

@SpidFightFR or anyone else, can you provide a test case that reproduces crackling audio that does not involve FLAC files? If not, I will close this issue as duplicate.

@evertvorster
Copy link

Just tested with the latest mlt-git, and kdenlive-git, and on my system the problem is completely gone. Good job!

@luzpaz
Copy link
Contributor

luzpaz commented Jun 26, 2023

Is this ticket still relevant ?

@SpidFightFR
Copy link
Author

Hey lads, i still have this issue, but it seems to happen less when the volume is low... so perhaps i'll keep going that way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants