Bug 450449

Summary: The audio, when rendered with an animation, skips ahead so that it does not correctly correlate with the animation that it's supposed to sync with.
Product: [Applications] krita Reporter: artisticsinger2003
Component: AnimationAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: eoinoneill1991, halla, potattnoodle
Priority: NOR    
Version: 5.0.2   
Target Milestone: ---   
Platform: Compiled Sources   
OS: All   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description artisticsinger2003 2022-02-17 12:16:55 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. Create audio file (WAV or MPG3) then add to a new Krita Animation Document
2. Animate something with the audio 
3. Render animation into a video (MPEG4 File?)

OBSERVED RESULT
Instead of the audio that's attached to Frame 0 playing, the Audio from Frame 98 starts playing, meaning that the wrong part of the audio plays at the beginning of the rendered animation. I redid the audio file to make sure, but it seems that any audio I put in, when I render it, it just skips ahead even though it plays correctly in the program.

EXPECTED RESULT
The audio meant to play on Frame 0 playing, so that the audio and the animation correctly syncs up. 

SOFTWARE/OS VERSIONS
Windows: 11
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Eoin O'Neill 2022-02-17 23:57:48 UTC
I can confirm the bug. Audio is one of the next things we are going to be working on in Krita's animation system so this is actively being worked on. 

Thanks for taking the time to report the bug,
Eoin.
Comment 2 Emmet O'Neill 2022-12-29 22:56:40 UTC
*** Bug 463078 has been marked as a duplicate of this bug. ***
Comment 3 Dmitry Kazakov 2023-09-25 13:50:08 UTC
Git commit 0ed384a5dae0d99582f964c0061519769b7a0176 by Dmitry Kazakov.
Committed on 25/09/2023 at 15:46.
Pushed by dkazakov into branch 'master'.

Fix removal of duplicated frames in "Only Unique Frames" mode

The offset was applied incorrectly so the clean-up stage of the rendering
process removed incorrect files (basically, the files without the
normalizing offset)

The patch should also fix a possible offset issue between the video
and audio when rendering multiple times into the same folder
Related: bug 458997, bug 474679

M  +2    -2    libs/ui/KisAsyncAnimationFramesSavingRenderer.cpp
M  +1    -17   libs/ui/animation/KisAnimationRender.cpp
M  +0    -4    libs/ui/animation/KisAnimationRender.h
M  +13   -21   libs/ui/dialogs/KisAsyncAnimationFramesSaveDialog.cpp
M  +2    -2    libs/ui/dialogs/KisAsyncAnimationFramesSaveDialog.h

https://invent.kde.org/graphics/krita/-/commit/0ed384a5dae0d99582f964c0061519769b7a0176
Comment 4 Dmitry Kazakov 2023-09-25 13:50:29 UTC
Git commit 2fbd233de9554bb94a98fbf53cb14dc3e457fe5d by Dmitry Kazakov.
Committed on 25/09/2023 at 15:50.
Pushed by dkazakov into branch 'krita/5.2'.

Fix removal of duplicated frames in "Only Unique Frames" mode

The offset was applied incorrectly so the clean-up stage of the rendering
process removed incorrect files (basically, the files without the
normalizing offset)

The patch should also fix a possible offset issue between the video
and audio when rendering multiple times into the same folder
Related: bug 458997, bug 474679

M  +2    -2    libs/ui/KisAsyncAnimationFramesSavingRenderer.cpp
M  +1    -17   libs/ui/animation/KisAnimationRender.cpp
M  +0    -4    libs/ui/animation/KisAnimationRender.h
M  +13   -21   libs/ui/dialogs/KisAsyncAnimationFramesSaveDialog.cpp
M  +2    -2    libs/ui/dialogs/KisAsyncAnimationFramesSaveDialog.h

https://invent.kde.org/graphics/krita/-/commit/2fbd233de9554bb94a98fbf53cb14dc3e457fe5d