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

Video delay, and visualisations (and playback speed) #750

Open
RJVB opened this issue Jul 9, 2024 · 5 comments
Open

Video delay, and visualisations (and playback speed) #750

RJVB opened this issue Jul 9, 2024 · 5 comments

Comments

@RJVB
Copy link
Contributor

RJVB commented Jul 9, 2024

I just noticed that visualisations do not take the configured delay into account, causing a noticeable lag when listening over my BT speaker. It's a nice speaker for the place it's in (Klipsch The One Mk2) but it uses the basic audio codec, so I have to set a "video delay" (it's actually a transport delay of course) of +0.3 seconds.

More importantly, I wonder if there's something that can be done to improve the experience at the beginning.

  • In videos where the sound track plays at frame 0 it sounds as if a tiny bit of sound gets lost when first starting the video
  • Curiously, the video always starts first

That latter symptom is something I cannot really get my head around when the correct transport has been set, and if I were to guess I'd say that this initial bit of "silent movie" is actually longer than those 0.3 seconds.

EDIT: something strange goes on when reducing playback speed, regardless of whether this is done keeping the audio pitch constant or not. At 0.75x speed I need to configure a transport delay of about 0.1 seconds only, and at 0.5x it has to be set to 0.
It looks like speeding up the playback doesn't require changing the transport delay though of course it becomes increasingly difficult to detect sync issues.

@RJVB RJVB changed the title Video delay, and visualisations Video delay, and visualisations (and playback speed) Jul 11, 2024
@zaps166
Copy link
Owner

zaps166 commented Jul 11, 2024

Bluetooth speakers has variable audio latency - depends on codec and on signal strength - low signal might increase latency because of larger buffer to prevent audio stuttering (and also can lower the bitrate).

Use cable whenever possible (many BT speakers has JACK input). With cable you're always full quality, lowest and fixed latencies and you can see your "signal" range.

Visualizations doesn't respect video latency - I don't want to buffer it there and complicate things. It's not video anyway 😄

About playback speed - I don't know, but I think when speed is too low, the latency doesn't matter that much. When speed is too high, you should still hear the latency. Also rubberband filter has latency, but it should be implicitly added to video delay.

@RJVB
Copy link
Contributor Author

RJVB commented Jul 12, 2024

Use cable whenever possible (many BT speakers has JACK input). With cable you're always full quality, lowest and fixed latencies and you can see your "signal" range.

Well, DOH, but a cable isn't always feasible, is it. Can't just span one the middle of a (kitchen) table across the space to where my speaker sits...

Visualizations doesn't respect video latency - I don't want to buffer it there and complicate things. It's not video anyway 😄

For visualisations it's one thing, for the FFT spectrum another, IMHO. I don't know how you implemented the former, but I suspect you have to buffer for the latter anyway.

About playback speed - I don't know, but I think when speed is too low, the latency doesn't matter that much.

I don't see how that could make sense, unless the slowing down introduces its own delay w.r.t. the audio. Which might be the case since there is indeed a noticeable sync problem when I play the audio of a slowed-down video over the builtin speakers.

When speed is too high, you should still hear the latency. Also rubberband filter has latency, but it should be implicitly added to video delay.

Is the rubberband filter always in the loop, with just an on/off switch to determine whether it does something to pitch? Because that noticeable sync problem mentioned above is there whether I keep audio pitch constant or not.

I think I had actually noticed it before, as the slowed-down playback isn't as helpful in figuring out what musicians are doing with their hands (which is what I hoped to use the constant-pitch feature for).

I'm attaching the audio/video sync test I use - and just FWIW: visualisations and FFT appear to be completely out of sync with the audio for me.

Audio.Video.Sync.Test.60.FPS.mp4

@zaps166
Copy link
Owner

zaps166 commented Jul 12, 2024

For me this video plays perfect in QMPlay2 regardless of keep pitch and playback speed (using PC's sound card and pipewire).

Is the rubberband filter always in the loop, with just an on/off switch to determine whether it does something to pitch?

Rubberband filter is running only when your playback speed != 1.0 and you have keep pich enabled. Otherwise it's unused, resources are freed.

visualisations and FFT appear to be completely out of sync with the audio for me.

How about video? As I told before - video delay parameter doesn't work in visualizations .

For visualisations it's one thing, for the FFT spectrum another, IMHO.

What do you mean? The only buffer there is to grab enough samples to display and/or calculate FFT. They should display at same time (I mean some milliseconds doesn't matter like 1-2x screen refresh rate or so).

@RJVB
Copy link
Contributor Author

RJVB commented Jul 12, 2024 via email

@RJVB
Copy link
Contributor Author

RJVB commented Jul 13, 2024 via email

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

2 participants