Page 1 of 1

python-vlc Stream from Capture Device with DirectShow

Posted: 01 Jul 2016 15:21
by genetica
Good day,

I would like to stream a video from my capture device with directshow. When using the VLC Player I can go
> Media > Stream... > Capture Device:
Capture mode = DirectShow
Video device name = Datapath VisionSD4+1S 01
> Stream > Play
The player will then display the video feed.

I tried the basic:

Code: Select all

import vlc i = vlc.Instance() p = i.media_player_new() m = i.media_new('dshow://', 'dshow-vdev=Datapath VisionSD4+1S 01', 'dshow-adev=none', 'live-caching=300') p.set_media(m) p.play()
p.play() return 0 with an error:

Code: Select all

0005>>> a000000005a9e00] main input error: Your input can't be opened [00000000005a9e00] main input error: VLC is unable to open the MRL 'dshow://'.
I have tried it in various other ways but receive the same error. Any ideas?

How can I grab the video frames into an array for post processing?

Please assist?

Re: python-vlc Stream from Capture Device with DirectShow

Posted: 03 Jul 2016 11:55
by Jean-Baptiste Kempf
Did you try adding the ":" before dshow-vdev?

Re: python-vlc Stream from Capture Device with DirectShow

Posted: 04 Jul 2016 17:11
by genetica
Yes I have tried almost all configuration, such as using the add_option or '--' addition. Is there a way that I can check what is going wrong?

Re: python-vlc Stream from Capture Device with DirectShow

Posted: 04 Jul 2016 18:27
by Jean-Baptiste Kempf
missing " " around the device name?

Re: python-vlc Stream from Capture Device with DirectShow

Posted: 05 Jul 2016 07:57
by genetica
No, same error, I played around with the various combination as well. A note, when I create the instance I receive a

Code: Select all

Warning: option --plugin-path no longer exists.

Re: python-vlc Stream from Capture Device with DirectShow

Posted: 18 Mar 2021 20:18
by hakao
Hello
I am trying to stream http audio,
When I use play() it also plays captured audio from my speakers.
There is an option in windows VLCPlayer aplication, "stream" instead of "play". Is there any at python?

This is my code:

Code: Select all

import vlc #define VLC instance instance = vlc.Instance("--sout '#transcode{vcodec=none,acodec=mp3,ab=128,channels=2,samplerate=44100}:std{access=http,mux=mp3,dst=:8080}' :no-sout-all :sout-keep") #Define VLC media transcoder = instance.media_player_new() media=instance.media_new('dshow://','dshow-vdev=None' ,'dshow-adev=', 'live-caching=30') #Set player media transcoder.set_media(media) #Play the media transcoder.play() while 1: pass