python-vlc icon indicating copy to clipboard operation
python-vlc copied to clipboard

vlc do not apply audio filters

Open albusrice opened this issue 5 years ago • 3 comments

This code do not remove vocals from audio file. I did a test with the vlc application and the filter does work.

I've looked at the solutions given by you here and here. But it just doesn't work in python not sure why.

import vlc, time

sound = "01. Fairyland In Reality.mp3"
vlc_instance = vlc.Instance("--audio-filter=karaoke")
player = vlc.MediaPlayer(vlc_instance)

media = vlc_instance.media_new(sound)
player.set_media(media)

player.play()

time.sleep(1.5)
duration = player.get_length() / 1000
time.sleep(duration)

albusrice avatar Mar 29 '20 13:03 albusrice

Indeed, I see the same behaviour. Argument passing to the instance works though, since when you launch the vlc.py module as a script (with a movie filename as parameter), you can see that the marquee module is activated. Maybe you could ask this question on forum.videolan.org (ideally converting the code to C API, in order to validate that it comes from libvlc and not python bindings)

oaubert avatar Mar 30 '20 13:03 oaubert

I think there is an issue with the python bindings for audio, as I haven had any success with the audio filters that are being provide

albusrice avatar Apr 08 '20 11:04 albusrice

If you have the time and capacity, you should first try to reproduce your test using the C API directly, to be able to tell whether this issue is due to the bindings or lies in the libvlc API itself.

You can adapt the following C code (rename sample.txt to sample.c, compilation instructions are at the top): sample.txt

oaubert avatar Apr 08 '20 11:04 oaubert