[Tutor] 2.7.3 Popen argument issues

Ray Jones crawlzone at gmail.com
Sun Aug 26 13:55:47 CEST 2012


On 08/25/2012 10:19 PM, eryksun wrote:
> On Sat, Aug 25, 2012 at 11:02 PM, eryksun <eryksun at gmail.com> wrote:
>> out_file = "testing.avi"
>> out_ip = "127.0.0.1"
>> out_port = "11300"
>> dst_file = '"transcode{vb=400}:std{access=file,mux=avi,dst=%s}"' % out_file
>> dst_http = '"std{access=http,mux=mpjpeg,dst=%s:%s}"' % (out_ip, out_port)
>> sout = "'#duplicate{dst=%s,dst=%s}'" % (dst_file, dst_http)
>>
>> cmd = "vlc http://%s:%s -I dummy --sout %s" % (ip, port, sout)
>>
>> p = subprocess.Popen(cmd.split())
> Wow... That was silly of me. Don't use split(). It would split up
> arguments that have internal spaces. Just build the list.
>
> sout = "#duplicate{dst=%s,dst=%s}" % (dst_file, dst_http)
>
> cmd = ["vlc", "http://%s:%s" % (ip, port), "-I", "dummy", "--sout", sout]
> p = subprocess.Popen(cmd)
[0x8d42554] stream_out_standard stream out error: no mux specified or
found by extension
[0x8d42134] main stream output error: stream chain failed for
`standard{mux="",access=""#duplicate{dst="transcode{vb=400}",dst="std{access=file,mux=avi,dst=testing.avi}",dst="std{access=http,mux=mpjpeg,dst=localhost:11300}"}""}'


Notice the addition of `standard{mux="",access='' ' before the
`#duplicate' . I think --sout adds a default combination if it doesn't
find a proper argument. Unfortunately, I know a bit less about vlc
command line arguments than I do about Python's generation of those
arguments.... ;)

I had originally patched together the vlc command line from examples on
the web. I think I'll go back and refamiliarize myself with vlc's
command line and see if I can interweave my new understanding of how
Python creates arguments with some further vlc knowledge.

Thanks a bunch for the help. If you get an epiphany, I'm always open to
suggestions.... ;)


Ray


More information about the Tutor mailing list