Bug 404082 - small non-linear audio out-of-sync after rendering
Summary: small non-linear audio out-of-sync after rendering
Status: REPORTED
Alias: None
Product: kdenlive
Classification: Applications
Component: Video Display & Export (show other bugs)
Version: 20.12.2
Platform: Ubuntu Linux
: NOR major
Target Milestone: ---
Assignee: Jean-Baptiste Mardelle
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-08 08:33 UTC by ITicDigger
Modified: 2021-12-29 11:26 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
fritzibaby: timeline_corruption+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ITicDigger 2019-02-08 08:33:23 UTC
SUMMARY
When editing titles that should appear rhythmically to the music video and sound are synchronous, but after rendering and playback in the player you can see a small desynchronization of about 0.5 seconds. And it is not constant, some titles appear on time, some lag behind.

This behavior is observed in all players that I tried: SMPlayer, Parole, MPV, and som windows players on other PC with Windows.
The strange thing is that if you import the rendered video into a new project in Kdenlive, it plays correctly and synchronously, as well as during editing.
			
I tried to render video in all formats from General, Lossless, OldTV - always the same - out of sync. 
I tried the minimum and maximum quality-the same. 
Tried to delete from the project everything except this fragment-the same.
I tried to use other versions of Kdenlive (appimage) older and the latest.

The fragment consists of PCM wav audio (1 minute), about 10 standard title clips (made in kdenlive editor) and three short video clips of 4 seconds each.

OBSERVED RESULT
audio out of sync

EXPECTED RESULT
sync

SOFTWARE/OS VERSIONS
UbuntuStudio 18.04.1
Kdenlive 18.12.0 appimage (and other appimage versions)
ADDITIONAL INFORMATION
Found exactly the same problem from 2017 https://forum.kde.org/viewtopic.php?f=265&t=151277
Comment 1 ITicDigger 2019-02-08 15:02:05 UTC
input audio track:
Format                                   : Wave
File size                                : 10.1 MiB
Duration                                 : 40 s 0 ms
Overall bit rate mode                    : Constant
Overall bit rate                         : 2 117 kb/s
Encoded date                             : 2019-01-31 21:59:51
Encoding settings                        : A=PCM,F=44100,W=24,M=stereo,T=libsndfile-1.0.28
Producer_Reference                       : ZZ---Ardour1:5.12215951957693141

Audio
Format                                   : PCM
Format settings                          : Little / Signed
Codec ID                                 : 1
Duration                                 : 40 s 0 ms
Bit rate mode                            : Constant
Bit rate                                 : 2 117 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 44.1 kHz
Bit depth                                : 24 bits
Stream size                              : 10.1 MiB (100%)

input video tracks (from one camera)

General
Format                                   : QuickTime
Format/Info                              : Original Apple specifications
File size                                : 36.4 MiB
Duration                                 : 29 s 0 ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 10.5 Mb/s
Encoded date                             : UTC 2019-01-13 17:07:40
Tagged date                              : UTC 2019-01-13 17:07:40
Writing library                          : pana

Video
ID                                       : 1
Format                                   : JPEG
Codec ID                                 : jpeg
Duration                                 : 29 s 0 ms
Bit rate mode                            : Variable
Bit rate                                 : 10.3 Mb/s
Width                                    : 848 pixels
Height                                   : 480 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 30.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.841
Stream size                              : 35.5 MiB (98%)
Language                                 : English
Encoded date                             : UTC 2019-01-13 17:07:40
Tagged date                              : UTC 2019-01-13 17:07:40

Audio
ID                                       : 2
Format                                   : PCM
Format settings                          : Big / Signed
Codec ID                                 : twos
Duration                                 : 29 s 0 ms
Bit rate mode                            : Constant
Bit rate                                 : 256 kb/s
Channel(s)                               : 1 channel
Sampling rate                            : 16.0 kHz
Bit depth                                : 16 bits
Stream size                              : 906 KiB (2%)
Language                                 : English
Encoded date                             : UTC 2019-01-13 17:07:40
Tagged date                              : UTC 2019-01-13 17:07:40
Comment 2 emohr 2019-02-11 19:15:24 UTC
What I see are 2 different audio sampling rates and bit depth: 
- 44.1kHz should be 16bit as it is CD-Audio (24bit is not standard) 
- and the other is 16kHz and 16bit. 

Just a guess change the 44.1kHz to 16bit in Ardour and try again.
Comment 3 ITicDigger 2019-02-13 17:05:48 UTC
Exported from Ardour audio track with 16 Bit, 44.1 kHz. To simplify the situation removed from the project video and left only audio with 16 Bit, 44.1 kHz and normal clips titles made in kdenlive. Render-all the same as before the changes. It's useless.
Comment 4 emohr 2019-02-17 17:35:18 UTC
Added to issue#12 https://invent.kde.org/kde/kdenlive/issues/12
Comment 5 inFlowia Lab. 2020-03-23 21:34:42 UTC
Kdenlive 19.12.3-appimage on UbuntuStudio 19. Π•he same problem still happens. Constantly, in each project I shift the track with the music exactly 8 frames to the right, then on the rendered video the synchronization becomes good. Usually this desync is not noticeable until it comes to the end credits, where they should go rhythmically with the music.
Comment 6 emohr 2020-03-24 16:50:44 UTC
Stupid question: Do you have as local decimal separator a comma? If so change the OS setting local decimal separator to dot. Try again.
Comment 7 inFlowia Lab. 2020-03-24 19:11:16 UTC
(In reply to emohr from comment #6)
> Stupid question: Do you have as local decimal separator a comma? If so
> change the OS setting local decimal separator to dot. Try again.

Yes, decimal separator - is comma.
Was try change separator to dot - all the same.
I forgot to point out that unlike the author of the post, I have a linear desynchronization.
Comment 8 emohr 2021-03-05 18:17:45 UTC
This should be fixed with a fix in MLT.

Please try with the current Kdenlive AppImage version 20.12.2  https://download.kde.org/stable/kdenlive/20.12/linux/
Comment 9 ITicDigger 2021-03-06 20:32:34 UTC
(In reply to emohr from comment #8)
I tried it. Unfortunately, nothing has changed. Although no, to be precise, it has changed a little: if earlier I shifted the audio track for perfect synchronization by 8 frames to the right, now, I do it by 4 frames.
Comment 10 Bug Janitor Service 2021-03-21 04:33:40 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!