View previous topic :: View next topic |
Author |
Message |
eeckwrk99 Apprentice
Joined: 14 Mar 2021 Posts: 246 Location: Gentoo forums
|
Posted: Thu Jan 23, 2025 1:41 pm Post subject: media-video/aegisub-3.4.2: audio not synced with subtitles |
|
|
Follow-up to [SOLVED] media-video/aegisub - no audio/video provider
I can now import videos just fine with media-video/aegisub-3.4.2:
Code: | % qlist -Iv media-video/aegisub
media-video/aegisub-3.4.2
% equery u aegisub
[ Legend : U - final flag setting for installation]
[ : I - package is installed with flag ]
[ Colors : set, unset ]
* Found these USE flags for media-video/aegisub-3.4.2:
U I
+ + alsa : Add support for media-libs/alsa-lib (Advanced Linux Sound Architecture)
- - debug : Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see
https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces
+ + fftw : Use FFTW library for computing Fourier transforms
+ + lua_single_target_luajit : Build for LuaJIT only
- - openal : Add support for the Open Audio Library
- - portaudio : Add support for the crossplatform portaudio audio API
+ + pulseaudio : Add sound server support via media-libs/libpulse (may be PulseAudio or PipeWire)
+ + spell : Add dictionary support
- - test : Enable dependencies and/or preparations necessary to run tests (usually controlled by FEATURES=test but can be toggled
independently)
+ + uchardet : Enable charset discovery via app-i18n/uchardet |
When importing the video, the audio track is automatically imported (via Settings > Video > "Automatically open audio when opening video"). The subs and the audio are completely out of sync for some reason, i.e. selecting a subtitle line in the grid and playing it with <S> or space bar doesn't match the audio at all.
Likewise, the audio is out of sync (late) when playing the video with <Ctrl+P>.
Occurs with any .mkv file I tried.
As stated in the previous thread, I don't have this problem with arch1t3cht fork (using Feature Release 12 AppImage), everything is synced as expected. Settings are read from $HOME/.aegisub directory with both programs.
The starting and ending times of subs on the audio waveform are identical with both 3.4.2 and arch1t3cht fork but the waveform itself is wrong on 3.4.2.
Image comparison
I'm using PulseAudio as "Audio Player" in Aegisub settings and PipeWire 1.2.7 system-wide:
Code: | % pactl info | rg "Server Name"
Server Name: PulseAudio (on PipeWire 1.2.7) |
Maybe this is an upstream issue? I couldn't find any similar issue on the GitHub repository though.
Just curious if someone ever experienced this and what I could try.
Thanks! |
|
Back to top |
|
|
eeckwrk99 Apprentice
Joined: 14 Mar 2021 Posts: 246 Location: Gentoo forums
|
Posted: Tue Jan 28, 2025 10:52 am Post subject: |
|
|
I've just tried on my Arch Linux install (same machine) with both 3.4.1 installed from extra repository and Git version installed from the AUR. I don't have the issue either with both.
Code: | % pacman -Qs aegisub
local/aegisub 3.4.1-1
A general-purpose subtitle editor with ASS/SSA support
% paru -Qm aegisub-git
aegisub-git 3.4.2.r71.dd48a1aec-1 |
I copied $HOME/.aegisub directory from my Gentoo install to make sure I was using the same settings. |
|
Back to top |
|
|
eeckwrk99 Apprentice
Joined: 14 Mar 2021 Posts: 246 Location: Gentoo forums
|
Posted: Thu Jan 30, 2025 2:12 pm Post subject: |
|
|
Tried to update media-libs/ffmpegsource (which, if I understand correctly, allows to load video and audio in Aegisub) from 2.40-r2 to 9999 since Arch uses 5.0, but it doesn't make any difference:
Code: | # emlop l media-libs/ffmpegsource
2025-01-16 22:43:40 20 media-libs/ffmpegsource-2.40-r2
2025-01-30 14:51:12 27 media-libs/ffmpegsource-9999 |
|
|
Back to top |
|
|
rab0171610 Guru
Joined: 24 Dec 2022 Posts: 468
|
Posted: Thu Jan 30, 2025 3:15 pm Post subject: |
|
|
Probably not super helpful as I don't use the program and cannot replicate the issue or provide a direct solution. That being said, when doing a quick search for "av sync issues aegisub" on Google it seems other people have had this issue . . . some of the posts are on Reddit. It might be worth a read if you haven't already encountered any of it. |
|
Back to top |
|
|
eeckwrk99 Apprentice
Joined: 14 Mar 2021 Posts: 246 Location: Gentoo forums
|
Posted: Thu Jan 30, 2025 3:49 pm Post subject: |
|
|
rab0171610 wrote: | Probably not super helpful as I don't use the program and cannot replicate the issue or provide a direct solution. That being said, when doing a quick search for "av sync issues aegisub" on Google it seems other people have had this issue . . . some of the posts are on Reddit. It might be worth a read if you haven't already encountered any of it. |
Yes, I also came across these reddit threads as I was looking for a solution.
Some users suggest re-encoding the problematic video(s), which doesn't make sense considering I don't have the issue with arch1t3cht fork on both my Gentoo and Arch installs, or with upstream version on my Arch Linux install. |
|
Back to top |
|
|
rab0171610 Guru
Joined: 24 Dec 2022 Posts: 468
|
Posted: Thu Jan 30, 2025 7:44 pm Post subject: |
|
|
Does the file play normally on the affected Gentoo machine in a media player like VLC without av sync problems?
Do you know if there is an audio delay (positive or negative) that is embedded in the .mkv files that is being respected during playback on VLC or the unaffected versions of aegisub? It appears from your waveform that the time is skewed or compressed in Gentoo which makes me wonder if accounting for or processing of an included delay or 'silence' could be the issue
I agree re-encoding videos seems extreme especially considering that it is only a problem on the installed Gentoo versions. However, I was intrigued by the commenter that removed the empty black frames from the beginning of the video, re-encoded the video+audio removing the audio delay and that the newly encoded file then played correctly in aegisub.
My only other guess would be a library version issue or an unknown configuration default for ffmpeg or other on your Gentoo machine. Comparing any related configs on both the Arch and Gentoo machines would be tedious. I guess on a positive note, you have alternatives in Gentoo that work until you can track down the cause.
If you manage to find a solution I would be curious to know what the cause of this issue is. It sounds just like the kind of strange anomalies I find myself experiencing sometimes. If all else fails, definitely file a bug report.
And completely irrelevant, but ever since they came out I have personally hated .mkv files and avoid them at all costs. |
|
Back to top |
|
|
eeckwrk99 Apprentice
Joined: 14 Mar 2021 Posts: 246 Location: Gentoo forums
|
Posted: Thu Jan 30, 2025 9:00 pm Post subject: |
|
|
rab0171610 wrote: | Does the file play normally on the affected Gentoo machine in a media player like VLC without av sync problems? |
Yes, no issue whatsoever with mpv:
Code: | % mpv --version
mpv --version
mpv 0.39.0 Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
libplacebo version: v7.349.0
FFmpeg version: 6.1.2
FFmpeg library versions:
libavcodec 60.31.102
libavdevice 60.3.100
libavfilter 9.12.100
libavformat 60.16.100
libavutil 58.29.100
libswresample 4.12.100
libswscale 7.5.100 |
rab0171610 wrote: | Do you know if there is an audio delay (positive or negative) that is embedded in the .mkv files that is being respected during playback on VLC or the unaffected versions of aegisub? It appears from your waveform that the time is skewed or compressed in Gentoo which makes me wonder if accounting for or processing of an included delay or 'silence' could be the issue |
Code: | % for f in $(fd -e .mkv "filename-pattern"); do mediainfo "${f}" | rg -i delay ; done
Delay relative to video : 9 ms
Delay relative to video : 9 ms
Delay relative to video : 9 ms
Delay relative to video : 9 ms
Delay relative to video : 9 ms
[...] |
I doubt it has anything to do with the issue though, I tried another MKV that doesn't have any "Delay relative to video" in metadata and I'm observing the same behavior (no delay with arch1t3cht fork, about 2.5 to 3 seconds delay with upstream 3.4.2).
rab0171610 wrote: | I agree re-encoding videos seems extreme especially considering that it is only a problem on the installed Gentoo versions. However, I was intrigued by the commenter that removed the empty black frames from the beginning of the video, re-encoded the video+audio removing the audio delay and that the newly encoded file then played correctly in aegisub. |
I'm getting the delay with some MKVs that have black frames at the beginning and some that don't, so I don't think this matter.
rab0171610 wrote: | My only other guess would be a library version issue or an unknown configuration default for ffmpeg or other on your Gentoo machine. Comparing any related configs on both the Arch and Gentoo machines would be tedious. I guess on a positive note, you have alternatives in Gentoo that work until you can track down the cause. |
That's what I'm thinking too, considering it works with arch1t3cht fork and on my Arch installs.
rab0171610 wrote: | If you manage to find a solution I would be curious to know what the cause of this issue is. It sounds just like the kind of strange anomalies I find myself experiencing sometimes. If all else fails, definitely file a bug report. |
Will do! Thank you for the different suggestions I'm not sure what to try next though.
rab0171610 wrote: | And completely irrelevant, but ever since they came out I have personally hated .mkv files and avoid them at all costs. |
Well, MKVs are just containers. If you want to add different audio / subtitles tracks, chapters, fonts and other attachments along with correct names, there is no alternative as far as I know. mkvtoolnix which provides mvkmerge, mkvextract and mkvpropedit is an amazing tool, I like it a lot.
I'll just stick with arch1t3cht fork for now. |
|
Back to top |
|
|
|