oaubert / python-vlc

Python vlc bindings
GNU Lesser General Public License v2.1
391 stars 111 forks source link

vlc do not apply audio filters #124

Open albusrice opened 4 years ago

albusrice commented 4 years ago

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)
oaubert commented 4 years ago

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)

albusrice commented 4 years ago

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

oaubert commented 4 years ago

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