0
我試圖在python中將h264傳遞給vlc。在Popen中打開cvlc程序時遇到問題。這是代碼。在Python中通過Popen調用cvlc時出錯
self.vlc = subprocess.Popen([
"cvlc", "-vvv", "stream:///dev/stdin", "--sout \'#rtp{sdp=rtsp://:8554/}\' :demux=h264"
], stdin=subprocess.PIPE)
這是
vlc: unknown option or missing mandatory argument `--sout '#rtp{sdp=rtsp://:8554/}' :demux=h264'
我一直在試圖弄清楚這一點對於不同類型的字符串格式化的小時VLC錯誤。
有一個--sout參數,如[https:// wiki.videolan.org/Documentation:Streaming_HowTo/Command_Line_Examples/#RTSP_live_streaming),結果是子過程不能很好地處理參數中的空格。 [這原來是我的解決方案。](https://stackoverflow.com/questions/25655173/is-python-subprocess-popen-accept-space-in-path/25655627#25655627) –
shlex.split工程甚至更好,我發佈了工作代碼[在這裏](https://raspberrypi.stackexchange.com/questions/59512/raspberry-streaming-using-vlc-picamera-python/68806#68806)。感謝您的幫助,不要以爲我會以其他方式工作 –