Problems generating a file with sout in python
Posted: 13 Nov 2019 22:32
Good afternoon
I have the following code in python:
The problem I have is that in the end I can't generate the flac file. I don't know what mistake I am making. Could you help me. I have installed vlc 3.0.8 and python-vlc.
Thank you
I have the following code in python:
Code: Select all
import time
import vlc
def grabar_audio():
convertidor = "--sout=#transcode{acodec=flac,ab=320,channels=1,samplerate=16000}:std{access=file,mux=raw,dst='/home/eparionad/Descargas/audio.flac'} --run-time=40 --stop-time=40"
instancia = vlc.Instance(convertidor)
reproductor = instancia.media_player_new()
medios = instancia.media_new('http://198.15.86.218:9386/stream')
medios.get_mrl()
reproductor.set_media(medios)
reproductor.play()
time.sleep(40)
return medios
grabar_audio()
Thank you