Getting dshow device stream with libVLC

This forum is about all development around libVLC.
FL53
Blank Cone
Blank Cone
Posts: 39
Joined: 09 Mar 2018 17:58

Getting dshow device stream with libVLC

Postby FL53 » 19 Nov 2018 17:23

Hi,

I am trying to get a video stream from a device (a webcam with specific format). I can get the stream using VLC but not through libVLC.
Command line in VLC is :

Code: Select all

vlc dshow:// :dshow-vdev="MyDevice" :dshow-adev=none :dshow-size=200x400 :dshow-chroma=YUYV
Same options in libVLC fail to get the stream.
Any idea ? Did someone encounter the same issue ?

Best regards

mfkl
Developer
Developer
Posts: 739
Joined: 13 Jun 2017 10:41

Re: Getting dshow device stream with libVLC

Postby mfkl » 21 Nov 2018 04:48

Hey,

Can you share your code that interacts with libvlc as well as logs please?

Maybe this helps https://forum.videolan.org/viewtopic.ph ... 84#p333431
https://mfkl.github.io

FL53
Blank Cone
Blank Cone
Posts: 39
Joined: 09 Mar 2018 17:58

Re: Getting dshow device stream with libVLC

Postby FL53 » 28 Nov 2018 15:04

Hi,

I didn't see your post before :( ... Thank you for the link, I will try that this afternoon and give you feedback. This sounds good ! I've already used the add_option method but not with the params given in the thread.
Regards

FL53
Blank Cone
Blank Cone
Posts: 39
Joined: 09 Mar 2018 17:58

Re: Getting dshow device stream with libVLC

Postby FL53 » 28 Nov 2018 17:12

I tried and I can get the dshow device without any problem now!
I tried to add option to the media using quotes since my device name has space in its name but it is not working if so (libvlc_media_add_option(m_media, ":dshow-vdev=\"my device has spaces in its name\""); will fail)

Working code is below (be careful to use libvlc_media_new_location instead of libvlc_media_new_path):

Code: Select all

m_media = libvlc_media_new_location(m_vlc, "dshow://"); libvlc_media_add_option(m_media, ":dshow-vdev=my device has spaces in its name"); libvlc_media_add_option(m_media, ":dshow-adev=none");
Is it possible to limit the latency to display the image using a parameter/option ? I can get the image but with an annoying delay for my purpose ?

mfkl
Developer
Developer
Posts: 739
Joined: 13 Jun 2017 10:41

Re: Getting dshow device stream with libVLC

Postby mfkl » 29 Nov 2018 04:09

try

Code: Select all

--dshow-tuner-frequency=<integer>
Otherwise check https://wiki.videolan.org/VLC_command-line_help/
https://mfkl.github.io

FL53
Blank Cone
Blank Cone
Posts: 39
Joined: 09 Mar 2018 17:58

Re: Getting dshow device stream with libVLC

Postby FL53 » 29 Nov 2018 11:19

I may not understand but tuner-frequency seems to be for tuner device, I was thinking more of an option to limit buffering. I tried with videoInput lib (which is not as complete as libVLC but I would like to compare) and I can get the images really quickly. My device is an IR webcam and I would like to get the data asap to display the image (and maybe, in the future, process it).

Moreover, ther is another issue I though I could fix alone: it seems conversion is not done properly : dshow device is registrated as providing YUY2 format but resulting image is green ( black are too much black, white too much white :) and it should be grey), any idea to fix that ? I am still searching for a way to correct this and found an image which illustrates my issue (even if my webcam is used under Windows 10, not Android).

mfkl
Developer
Developer
Posts: 739
Joined: 13 Jun 2017 10:41

Re: Getting dshow device stream with libVLC

Postby mfkl » 03 Dec 2018 02:39

I don't know
https://mfkl.github.io


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 14 guests