python-vlc Stream from Capture Device with DirectShow

This forum is about all development around libVLC.
genetica
New Cone
New Cone
Posts: 3
Joined: 01 Jul 2016 14:44

python-vlc Stream from Capture Device with DirectShow

Postby genetica » 01 Jul 2016 15:21

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?

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: python-vlc Stream from Capture Device with DirectShow

Postby Jean-Baptiste Kempf » 03 Jul 2016 11:55

Did you try adding the ":" before dshow-vdev?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

genetica
New Cone
New Cone
Posts: 3
Joined: 01 Jul 2016 14:44

Re: python-vlc Stream from Capture Device with DirectShow

Postby genetica » 04 Jul 2016 17:11

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?

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: python-vlc Stream from Capture Device with DirectShow

Postby Jean-Baptiste Kempf » 04 Jul 2016 18:27

missing " " around the device name?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

genetica
New Cone
New Cone
Posts: 3
Joined: 01 Jul 2016 14:44

Re: python-vlc Stream from Capture Device with DirectShow

Postby genetica » 05 Jul 2016 07:57

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.

hakao
New Cone
New Cone
Posts: 2
Joined: 18 Mar 2021 20:13

Re: python-vlc Stream from Capture Device with DirectShow

Postby hakao » 18 Mar 2021 20:18

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


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 10 guests