Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

API question: How to get current volume level (detect silence in video)? #658

Open
AqlaSolutions opened this issue Jul 23, 2020 · 7 comments

Comments

@AqlaSolutions
Copy link

I wish to control video playback speed depending on if there is a voice or silence in video. Is it possible to detect silent moments with vlcdotnet?

@mfkl
Copy link
Contributor

mfkl commented Jul 23, 2020

I don't think so.

You could use the SetAudioCallbacks from LVS, and do some processing on the raw buffers to find that out though it doesn't seem ideal.

@jeremyVignelles
Copy link
Collaborator

I'm replying here for Vlc.DotNet, but that's true for all libvlc bindings.

The only way I can think of is highly theoretical : Using audio callbacks to get the raw audio data and analyze that to see if it there is audio. If you're doing that "on-the-fly", I'm not sure how you could sync it with the video afterwards.

Another way in libvlc would be to create an audio filter plugin (probably in C or C++) that detects silence/audio, but that's quite hard to do.

Otherwise, look into ffmpeg or NAudio to see if something is doable there.

@AqlaSolutions
Copy link
Author

Are there any examples on using SetAudioCallbacks to analyze raw audio data?

@mfkl
Copy link
Contributor

mfkl commented Jul 23, 2020

@AqlaSolutions
Copy link
Author

AqlaSolutions commented Jul 23, 2020

But I don't see a way to access SetAudioCallbacks from VLC DotNet

@mfkl
Copy link
Contributor

mfkl commented Jul 23, 2020

that's why I mentioned libvlcsharp.

@AqlaSolutions
Copy link
Author

AqlaSolutions commented Jul 23, 2020

It seems that NAudio with this code perfectly fit my intentions. Syncing timestamps with VLC is very doable.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants