Page 1 of 1

Question about playing DVB-T with subprocess in python

Posted: 16 Jun 2009 19:03
by BenWen
I am trying to play DVB-T with VLC, this is suppose to be a working command for VLC
dvb-t:// :dvb-frequency=593000 :dvb-bandwidth=6: program=530

I am using Python and want to use subprocess to run this command, here is my code

command = ':sout=#duplicate{dst=display,dst=std{access=file,dst=test.ts})'
vlc_path = r'C:\Program Files\VideoLAN\vlc\vlc.exe'
dvbprocess = subprocess.Popen([vlc_path, '-vvv', 'dvb-t:// :dvb-frequency=593000 :dvb-bandwidth=6 :program=503',command])


but if i execute this i will get this error
VLC cannot open MRL 'dvb-t:// :dvb-frequency=593000 :dvb-bandwidth=6 :program=503'

Does anyone know what wrong with my code. Thanks for your help and i will be appriciate to hearing from you.

Best regards,
Ben

Re: Question about playing DVB-T with subprocess in python

Posted: 17 Jun 2009 14:27
by CrapulaX
Does the entire command used directly in DOS console is working ?
Are you able to launch VLC with other commands using your script ( only an input file for instance) ?

May be the '//' is not well recognized ? Did you try using "..." instead of '...' ?

Re: Question about playing DVB-T with subprocess in python

Posted: 17 Jun 2009 17:59
by BenWen
This command is working in command line
vlc -vvv dvb-t:// :dvb-frequency=593000 :dvb-bandwidth=6 :program=503
i've tried "..." instead of '...' but it still not working.

Finally i found the way to solve. Python subprocess.popen not allow to open command with space inside it, so my command should like this :-)
subprocess.Popen([vlc_path, '-vvv', 'dvb-t://', ':dvb-frequency=593000', ':dvb-bandwidth=6', ':program=503'])


Best regards,
Ben