| Summary: | Kdenlive + OBS audio corruption bug [2021] | ||
|---|---|---|---|
| Product: | [Applications] kdenlive | Reporter: | katastic <ckatko> |
| Component: | Project Bin & Import | Assignee: | Jean-Baptiste Mardelle <jb> |
| Status: | RESOLVED WORKSFORME | ||
| Severity: | normal | CC: | berndmj, fritzibaby, j77xa3sl |
| Priority: | NOR | Keywords: | triaged |
| Version First Reported In: | 20.12.0 | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Other | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | Kdenlive + OBS audio preview corruption bug.png | ||
|
Description
katastic
2021-02-14 06:48:29 UTC
- It appears to be FINE when RENDERED, only the PREVIEW is affected. Another poster with the same issue. https://forum.kde.org/viewtopic.php?f=265&t=169978&p=442879#p442879 > playback is out of sync with audio and playback is like speedup twice or three time Identical to issue reported here: https://forum.kde.org/viewtopic.php?t=169978 I assume the NVENC H.264 file is the issue. Can you export out of OBS with another codec? How many audio channels do you use? Can you try without the MKV container? @emohr I have an x264 encoded video file. Same issue. Issue still present in Nightly build 21.03.70 Created attachment 136219 [details]
Kdenlive + OBS audio preview corruption bug.png
I see on the YouTube video that the clip job for preview is still running (in the project bin) while you playback. Let the job finishing before you playback. Still the same issue.
This also affected a bluray rip of the movie Hot Rod. I let the preview rendering run and it still did it. Not OBS. Not NVENC. Could you upload a short portion (ca. 1.5min) of the video that I can check if this preview stutter happens on Windows as well? Do you are on Linux? I THINK I FOUND THE ISSUE, as well as a WORKAROUND for users:
- It affects MKV files of significant length. Chopping Hot Rod down to a 1 minute clip (of the affected region) removed the issue. But more importantly:
- Converting the files to MP4 format __removes the issue__
ffmpeg -i [myfile] -c copy -map 0 [output.mp4]
[the -map 0 switch is for keeping multiple audio tracks]
- Tested on both the Hot Rod movie bluray as well one of my affected OBS recordings
So as far as I can tell, using MP4 files prevents the bug from occurring.
Here is the ffprobe output of the BREAKING version of the Hot Rod movie:
-----------------------------------------------------------------------------
ffmpeg version N-100410-gcd821c18dc Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 9.3-win32 (GCC) 20200320
configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --disable-w32threads --enable-pthreads --enable-iconv --enable-zlib --enable-libxml2 --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-opencl --enable-libvmaf --enable-vulkan --enable-libvorbis --enable-amf --enable-libaom --enable-avisynth --enable-libdav1d --enable-libdavs2 --enable-ffnvcodec --enable-cuda-llvm --enable-libglslang --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvpx --enable-libwebp --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --enable-libvidstab --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-libs=-lgomp
libavutil 56. 62.100 / 56. 62.100
libavcodec 58.115.102 / 58.115.102
libavformat 58. 65.100 / 58. 65.100
libavdevice 58. 11.103 / 58. 11.103
libavfilter 7. 93.100 / 7. 93.100
libswscale 5. 8.100 / 5. 8.100
libswresample 3. 8.100 / 3. 8.100
libpostproc 55. 8.100 / 55. 8.100
Input #0, matroska,webm, from 'Hot.Rod.2007.1080p.BluRay.DTS.x264-ETRG.mkv':
Metadata:
encoder : libebml v1.3.3 + libmatroska v1.4.4
creation_time : 2016-06-29T19:51:54.000000Z
Duration: 01:27:56.15, start: 0.000000, bitrate: 7371 kb/s
Chapter #0:0: start 0.000000, end 512.845000
Metadata:
title : Chapter 1
Chapter #0:1: start 512.845000, end 938.062000
Metadata:
title : Chapter 2
Chapter #0:2: start 938.062000, end 1444.276000
Metadata:
title : Chapter 3
Chapter #0:3: start 1444.276000, end 2003.042000
Metadata:
title : Chapter 4
Chapter #0:4: start 2003.042000, end 2456.745000
Metadata:
title : Chapter 5
Chapter #0:5: start 2456.745000, end 2971.843000
Metadata:
title : Chapter 6
Chapter #0:6: start 2971.843000, end 3441.396000
Metadata:
title : Chapter 7
Chapter #0:7: start 3441.396000, end 3952.782000
Metadata:
title : Chapter 8
Chapter #0:8: start 3952.782000, end 4438.809000
Metadata:
title : Chapter 9
Chapter #0:9: start 4438.809000, end 4982.894000
Metadata:
title : Chapter 10
Chapter #0:10: start 4982.894000, end 5276.150000
Metadata:
title : Chapter 11
Stream #0:0: Video: h264 (High), yuv420p(progressive), 1920x832 [SAR 1:1 DAR 30:13], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
Metadata:
BPS : 5860624
BPS-eng : 5860624
DURATION : 01:27:56.146000000
DURATION-eng : 01:27:56.146000000
NUMBER_OF_FRAMES: 126501
NUMBER_OF_FRAMES-eng: 126501
NUMBER_OF_BYTES : 3865188624
NUMBER_OF_BYTES-eng: 3865188624
_STATISTICS_WRITING_APP: mkvmerge v9.2.0 ('Photograph') 64bit
_STATISTICS_WRITING_APP-eng: mkvmerge v9.2.0 ('Photograph') 64bit
_STATISTICS_WRITING_DATE_UTC: 2016-06-29 19:51:54
_STATISTICS_WRITING_DATE_UTC-eng: 2016-06-29 19:51:54
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:1(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s (default)
Metadata:
title : Surround Sound
BPS : 1508999
BPS-eng : 1508999
DURATION : 01:27:56.150000000
DURATION-eng : 01:27:56.150000000
NUMBER_OF_FRAMES: 494639
NUMBER_OF_FRAMES-eng: 494639
NUMBER_OF_BYTES : 995213668
NUMBER_OF_BYTES-eng: 995213668
_STATISTICS_WRITING_APP: mkvmerge v9.2.0 ('Photograph') 64bit
_STATISTICS_WRITING_APP-eng: mkvmerge v9.2.0 ('Photograph') 64bit
_STATISTICS_WRITING_DATE_UTC: 2016-06-29 19:51:54
_STATISTICS_WRITING_DATE_UTC-eng: 2016-06-29 19:51:54
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
I simply converted using ffmpeg with "-c copy" to MP4 and now the output:
-----------------------------------------------------------------------------
ffprobe version N-100410-gcd821c18dc Copyright (c) 2007-2020 the FFmpeg developers
built with gcc 9.3-win32 (GCC) 20200320
configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --disable-w32threads --enable-pthreads --enable-iconv --enable-zlib --enable-libxml2 --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-opencl --enable-libvmaf --enable-vulkan --enable-libvorbis --enable-amf --enable-libaom --enable-avisynth --enable-libdav1d --enable-libdavs2 --enable-ffnvcodec --enable-cuda-llvm --enable-libglslang --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvpx --enable-libwebp --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --enable-libvidstab --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-libs=-lgomp
libavutil 56. 62.100 / 56. 62.100
libavcodec 58.115.102 / 58.115.102
libavformat 58. 65.100 / 58. 65.100
libavdevice 58. 11.103 / 58. 11.103
libavfilter 7. 93.100 / 7. 93.100
libswscale 5. 8.100 / 5. 8.100
libswresample 3. 8.100 / 3. 8.100
libpostproc 55. 8.100 / 55. 8.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'output2-full.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.65.100
Duration: 01:27:56.15, start: 0.000000, bitrate: 7380 kb/s
Chapter #0:0: start 0.000000, end 512.845000
Metadata:
title : Chapter 1
Chapter #0:1: start 512.845000, end 938.062000
Metadata:
title : Chapter 2
Chapter #0:2: start 938.062000, end 1444.276000
Metadata:
title : Chapter 3
Chapter #0:3: start 1444.276000, end 2003.042000
Metadata:
title : Chapter 4
Chapter #0:4: start 2003.042000, end 2456.745000
Metadata:
title : Chapter 5
Chapter #0:5: start 2456.745000, end 2971.843000
Metadata:
title : Chapter 6
Chapter #0:6: start 2971.843000, end 3441.396000
Metadata:
title : Chapter 7
Chapter #0:7: start 3441.396000, end 3952.782000
Metadata:
title : Chapter 8
Chapter #0:8: start 3952.782000, end 4438.809000
Metadata:
title : Chapter 9
Chapter #0:9: start 4438.809000, end 4982.894000
Metadata:
title : Chapter 10
Chapter #0:10: start 4982.894000, end 5276.150000
Metadata:
title : Chapter 11
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x832 [SAR 1:1 DAR 30:13], 5860 kb/s, 23.98 fps, 23.98 tbr, 16k tbn, 47.95 tbc (default)
Metadata:
handler_name : VideoHandler
vendor_id : [0][0][0][0]
Stream #0:1(eng): Audio: dts (DTS) (mp4a / 0x6134706D), 48000 Hz, 5.1(side), fltp, 1536 kb/s (default)
Metadata:
handler_name : SoundHandler
vendor_id : [0][0][0][0]
Stream #0:2(eng): Data: bin_data (text / 0x74786574)
Metadata:
handler_name : SubtitleHandler
Unsupported codec with id 100359 for input stream 2
I cannot exhaustively say it doesn't break. But I keep flipping through it and nothing is breaking so far.
Output for my OBS recordings:
-----------------------------------------------------------------------------
Original MKV file ffprobe
libavutil 56. 62.100 / 56. 62.100
libavcodec 58.115.102 / 58.115.102
libavformat 58. 65.100 / 58. 65.100
libavdevice 58. 11.103 / 58. 11.103
libavfilter 7. 93.100 / 7. 93.100
libswscale 5. 8.100 / 5. 8.100
libswresample 3. 8.100 / 3. 8.100
libpostproc 55. 8.100 / 55. 8.100
Input #0, matroska,webm, from '2021-03-04 18-51-20.mkv':
Metadata:
ENCODER : Lavf58.29.100
Duration: 01:38:47.63, start: 0.000000, bitrate: 5170 kb/s
Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 1k tbn, 60 tbc (default)
Metadata:
DURATION : 01:38:47.633000000
Stream #0:1: Audio: aac (LC), 48000 Hz, stereo, fltp (default)
Metadata:
title : Track1
DURATION : 01:38:47.552000000
Stream #0:2: Audio: aac (LC), 48000 Hz, stereo, fltp (default)
Metadata:
title : Track2
DURATION : 01:38:47.552000000
Stream #0:3: Audio: aac (LC), 48000 Hz, stereo, fltp (default)
Metadata:
title : Track3
DURATION : 01:38:47.552000000
New version using -c copy -map 0 to mp4 [NOTE: -map 0 is required for multiple audio tracks to move over]
-----------------------------------------------------------------------------
libavutil 56. 62.100 / 56. 62.100
libavcodec 58.115.102 / 58.115.102
libavformat 58. 65.100 / 58. 65.100
libavdevice 58. 11.103 / 58. 11.103
libavfilter 7. 93.100 / 7. 93.100
libswscale 5. 8.100 / 5. 8.100
libswresample 3. 8.100 / 3. 8.100
libpostproc 55. 8.100 / 55. 8.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '2021-03-04 18-51-20B.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.65.100
Duration: 01:38:47.63, start: 0.000000, bitrate: 5174 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 4681 kb/s, 30 fps, 30 tbr, 16k tbn, 60 tbc (default)
Metadata:
handler_name : VideoHandler
vendor_id : [0][0][0][0]
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 161 kb/s (default)
Metadata:
handler_name : SoundHandler
vendor_id : [0][0][0][0]
Stream #0:2(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 160 kb/s (default)
Metadata:
handler_name : SoundHandler
vendor_id : [0][0][0][0]
Stream #0:3(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 157 kb/s (default)
Metadata:
handler_name : SoundHandler
vendor_id : [0][0][0][0]
- For those that don't know, converting to MP4 from MKV does not change or re-encode the data so it will not make it "lossy" or recompressed. The only trick there is remembering -map 0 for multi-track recordings or it will only copy the first audio track. - It's also possible for OBS users that the OBS "remux" command [File -> Remux Recordings] will do this same conversion without requiring you to install ffmpeg or understand how to use command prompt. Oh, I missed a previous comment. This affects WINDOWS. Hi and thank you for your patience. Your bug report was for a version of Kdenlive that is at least four years old. Can you please check whether this issue still exists in the latest version 24.12.0? If yes, please update this report to reflect the new version and set the status to CONFIRMED. If it works now like you expect it would, you may change the status of this report to RESOLVED - FIXED. At any rate, this report will be closed if there is no activity for the next 30 days. ๐๐งน โ ๏ธ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME. For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging. Thank you for helping us make KDE software even better for everyone! ๐๐งน This bug has been in NEEDSINFO status with no change for at least 30 days. Closing as RESOLVED WORKSFORME. |