LibVLCSharp - video scene filter as options

This forum is about all development around libVLC.
stefanisin
Blank Cone
Blank Cone
Posts: 11
Joined: 08 Feb 2019 15:18

LibVLCSharp - video scene filter as options

Postby stefanisin » 08 Feb 2019 15:43

Hello,
I am trying using LibVLCSharp.dll and LibVLCSharp.WinForms.dll in C#.
I want to use video scene filter to get image sequences, but it does not work.
Here is my code:

public LibVLC _libVLC;
public MediaPlayer _mp;

_libVLC = new LibVLC();
_mp = new MediaPlayer(_libVLC);
videoView1.MediaPlayer = _mp;

Media media = new Media(_libVLC, "dshow://", Media.FromType.FromLocation);
media.AddOption(":dshow-vdev=Decklink Video Capture");
media.AddOption(":dshow-adev=none");
media.AddOption(":dshow-size=1920x1080");
media.AddOption(":dshow-fps=25.000000");
media.AddOption(":aspect-ratio=16:9");
media.AddOption(":video-filter=scene");
media.AddOption(":scene-format=bmp");
media.AddOption(":scene-prefix=vlcsnap");
media.AddOption(":scene-ratio=3");
media.AddOption("--scene-path=C:\\");

_mp.Play(media);

I am able to open capture device, but i don't able to get image sequences.

I am able to do it by cmd command (see below) but I don't able to do it by LibVLCSharp
C:\Program Files (x86)\VideoLAN\VLC>vlc dshow:// --dshow-vdev="Decklink Video Capture" --dshow-adev="none" --dshow-chroma="UYVY" --dshow-size=1920x1080 --dshow-fps=25.000000 --video-filter=scene --scene-format=bmp --scene-prefix=vlcsnap --scene-ratio=3 --scene-path=D:\vlcsnap

Can anybody tell me what is wrong,why video-scene filter is not accepted as AddOption or there is any mistake.

Thank you very much

Radoslav

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

Re: LibVLCSharp - video scene filter as options

Postby mfkl » 09 Feb 2019 05:40

Hi,

Code: Select all

media.AddOption("--scene-path=C:\\");
Why use "--" instead of ":" like the previous calls?

We need your full logs

Code: Select all

_libVLC = new LibVLC("--verbose=2");
https://mfkl.github.io

stefanisin
Blank Cone
Blank Cone
Posts: 11
Joined: 08 Feb 2019 15:18

Re: LibVLCSharp - video scene filter as options

Postby stefanisin » 11 Feb 2019 12:41

Hello,
I tried also with ":",
Here is my current code ( I added your)

_libVLC = new LibVLC("--verbose=2");
_mp = new MediaPlayer(_libVLC);
videoView1.MediaPlayer = _mp;
// Redirect log output to the console
_libVLC.Log += (sender, e)
=> Console.WriteLine($"[{e.Level}] {e.Module}:{e.Message}");

Media media = new Media(_libVLC, "dshow://", Media.FromType.FromLocation);
media.AddOption(":dshow-vdev=Decklink Video Capture");
media.AddOption(":dshow-adev=none");
media.AddOption(":dshow-size=1920x1080");
media.AddOption(":dshow-fps=25.000000");
media.AddOption(":aspect-ratio=16:9");
media.AddOption(":video-filter=scene");
media.AddOption(":scene-format=bmp");
media.AddOption(":scene-prefix=vlcsnap");
media.AddOption(":scene-ratio=3");
media.AddOption(":scene-path=C:\\");

mp.Play(media);

and here is log from console:

stefanisin
Blank Cone
Blank Cone
Posts: 11
Joined: 08 Feb 2019 15:18

Re: LibVLCSharp - video scene filter as options

Postby stefanisin » 11 Feb 2019 12:45

[Debug] main:revision 3.0.6-0-g5803e85f73
[Debug] main:Copyright © 1996-2018 the VideoLAN team
[Debug] main:configured with ../extras/package/win32/../../../configure '--enable-update-check' '--enable-lua' '--enable-faad' '--enable-flac' '--enable-theora' '--enable-avcodec' '--enable-merge-ffmpeg' '--enable-dca' '--enable-mpc' '--enable-libass' '--enable-schroedinger' '--enable-realrtsp' '--enable-live555' '--enable-dvdread' '--enable-shout' '--enable-goom' '--enable-caca' '--enable-qt' '--enable-skins2' '--enable-sse' '--enable-mmx' '--enable-libcddb' '--enable-zvbi' '--disable-telx' '--enable-nls' '--host=i686-w64-mingw32' '--with-breakpad=https://win.crashes.videolan.org' 'host_alias=i686-w64-mingw32' 'PKG_CONFIG_LIBDIR=/home/jenkins/workspace/vlc-release/windows/vlc-release-win32-x86/contrib/i686-w64-mingw32/lib/pkgconfig'
[Debug] main:VLC media player - 3.0.6 Vetinari
[Debug] main:Creating an input for 'dshow://'
[Debug] main:using timeshift granularity of 50 MiB
[Debug] main:using timeshift path: C:\Users\daset\AppData\Local\Temp
[Debug] main:`dshow://' gives access `dshow' demux `any' path `'
[Debug] main:creating demux: access='dshow' demux='any' location='' file='(null)'
[Debug] main:looking for access_demux module matching "dshow": zd candidates
[Debug] dshow:dshow-vdev: Decklink Video Capture
[Debug] dshow:dshow-adev: none
[Debug] dshow:width x height 1920x1080
[Debug] dshow:found device: Decklink Video Capture
[Debug] dshow:asking for device: Decklink Video Capture
[Debug] dshow:found device: Blackmagic WDM Capture
[Debug] dshow:asked for Decklink Video Capture, binding to Decklink Video Capture
[Debug] dshow:using device: Decklink Video Capture
[Debug] dshow:EnumDeviceCaps: output pin: Capture
[Debug] dshow:EnumDeviceCaps: output pin: ~VANC

stefanisin
Blank Cone
Blank Cone
Posts: 11
Joined: 08 Feb 2019 15:18

Re: LibVLCSharp - video scene filter as options

Postby stefanisin » 11 Feb 2019 12:46

[Debug] dshow:EnumDeviceCaps: output pin: ~Timecode
[Debug] dshow:EnumDeviceCaps: trying pin Capture
[Debug] dshow:EnumDeviceCaps: input pin default format configured
[Debug] dshow:EnumDeviceCaps: input pin accepts chroma: UYVY, width:1920, height:1080, fps:25.000000
[Debug] dshow:CaptureFilter::JoinFilterGraph
[Debug] dshow:connecting filters
[Debug] dshow:CaptureFilter::EnumPins
[Debug] dshow:CapturePin::QueryDirection
[Debug] dshow:CapturePin::ConnectedTo [not connected]
[Debug] dshow:CapturePin::QueryPinInfo
[Debug] dshow:CaptureFilter::QueryFilterInfo
[Debug] dshow:CapturePin::QueryPinInfo
[Debug] dshow:CaptureFilter::EnumPins
[Debug] dshow:CapturePin::QueryDirection
[Debug] dshow:CapturePin::QueryDirection
[Debug] dshow:CapturePin::QueryAccept [OK] (width=1920, height=1080, chroma=UYVY, fps=25.000000)
[Debug] dshow:CapturePin::ReceiveConnection [OK]
[Debug] dshow:ConnectFilters: graph_builder2 available.
[Debug] dshow:CapturePin::NotifyAllocator
[Warning] dshow:ConnectFilters: No crossBar routes found (incompatible pin types)
[Debug] dshow:filters connected successfully !
[Debug] dshow:CapturePin::QueryPinInfo
[Debug] dshow:CaptureFilter::EnumPins
[Debug] dshow:CapturePin::QueryDirection
[Debug] dshow:CaptureFilter::EnumPins
[Debug] dshow:CapturePin::QueryDirection
[Debug] dshow:CapturePin::QueryPinInfo
[Debug] dshow:CaptureFilter::EnumPins
[Debug] dshow:CapturePin::QueryDirection
[Debug] dshow:CaptureFilter::EnumPins
[Debug] dshow:CapturePin::QueryDirection
[Debug] dshow:CapturePin::ConnectedTo [OK]
[Debug] dshow:CaptureFilter::SetSyncSource
[Debug] dshow:CaptureFilter::Pause
[Debug] dshow:CaptureFilter::Run
[Debug] main:selecting program id=0
[Debug] main:using access_demux module "dshow"
[Debug] main:looking for video decoder module matching "any": zd candidates
[Debug] main:using video decoder module "rawvideo"
[Debug] main:looking for meta reader module matching "any": zd candidates

stefanisin
Blank Cone
Blank Cone
Posts: 11
Joined: 08 Feb 2019 15:18

Re: LibVLCSharp - video scene filter as options

Postby stefanisin » 11 Feb 2019 12:47

[Debug] dshow:selected video pin accepts format: UYVY
[Debug] dshow:skipping audio device
[Debug] dshow:MEDIATYPE_Video
[Debug] dshow:Playing...
[Debug] main:no meta reader modules matched
[Debug] main:`dshow://' successfully opened
[Debug] main:Buffering 0%
[Debug] main:looking for text renderer module matching "any": zd candidates
[Debug] freetype:Using DWrite backend
[Debug] freetype:DWrite_GetFamily(): family name: Arial
[Debug] freetype:DWrite_ParseFamily(): using font at index 0 with weight 400 for bold: 0, italic: 0
[Debug] freetype:DWrite_ParseFamily(): using font at index 1 with weight 700 for bold: 1, italic: 0
[Debug] freetype:DWrite_ParseFamily(): using font at index 2 with weight 400 for bold: 0, italic: 1
[Debug] freetype:DWrite_ParseFamily(): using font at index 3 with weight 700 for bold: 1, italic: 1
[Debug] main:using text renderer module "freetype"
[Debug] main:looking for video converter module matching "any": zd candidates
[Debug] lua:Trying Lua scripts in d:\VB6_VisualStudio_Projects\VideoStreaming\libvlcsharp_by_videolan\libvlcsharp_WinForms\libvlcsharp_WinForms\bin\Debug\libvlc\win-x86\lua\meta\reader
[Debug] lua:Trying Lua playlist script d:\VB6_VisualStudio_Projects\VideoStreaming\libvlcsharp_by_videolan\libvlcsharp_WinForms\libvlcsharp_WinForms\bin\Debug\libvlc\win-x86\lua\meta\reader\filename.luac
[Debug] swscale:32x32 (32x32) chroma: YUVA -> 16x16 (16x16) chroma: RGBA with scaling using Bicubic (good quality)
[Debug] lua:Trying Lua scripts in C:\Users\daset\AppData\Roaming\vlc\lua\meta\reader

stefanisin
Blank Cone
Blank Cone
Posts: 11
Joined: 08 Feb 2019 15:18

Re: LibVLCSharp - video scene filter as options

Postby stefanisin » 11 Feb 2019 12:49

[Debug] main:Deinterlacing available
[Debug] main:deinterlace -1, mode auto, is_needed 0
[Debug] main:looking for vout window module matching "embed-hwnd,any": zd candidates
[Debug] main:using vout window module "drawable"
[Debug] main:looking for inhibit module matching "any": zd candidates
[Debug] main:looking for video converter module matching "any": zd candidates
[Debug] main:using inhibit module "inhibit"
[Debug] main:Opening vout display wrapper
[Debug] yuvp:YUVP to YUVA converter
[Debug] main:using video converter module "yuvp"
[Debug] main:using video converter module "swscale"
[Debug] main:VoutDisplayEvent 'resize' 1920x1080
[Debug] direct3d11:inclinometer not found. (hr=0x80070490)
[Debug] direct3d11:created video sub-window
[Debug] direct3d11:Vout EventThread running
[Debug] main:Buffering 13%
[Debug] direct3d11:creating Vout EventThread
[Debug] direct3d11:Created the D3D11 device type 1 level b000.
[Debug] direct3d11:Intel WDDM driver 10.18.10.3412
[Warning] direct3d11:could not get a IDXGISwapChain3
[Debug] direct3d11:Using pixel format YUVA for chroma UYVY
[Debug] main:VoutDisplayEvent 'resize' 1936x1479
[Debug] direct3d11:Win32VoutCreateWindow
[Debug] direct3d11:Direct3D11 resources created
[Debug] main:Buffering 26%
[Debug] direct3d11:Direct3D11 device adapter successfully initialized
[Debug] direct3d11:Direct3D11 Open Succeeded
[Debug] main:using vout display module "direct3d11"
[Debug] main:looking for video converter module matching "any": zd candidates
[Debug] main:looking for vout display module matching "any": zd candidates

stefanisin
Blank Cone
Blank Cone
Posts: 11
Joined: 08 Feb 2019 15:18

Re: LibVLCSharp - video scene filter as options

Postby stefanisin » 11 Feb 2019 12:49

[Debug] main:A filter to adapt decoder UYVY to display YUVA is needed
[Debug] main:Filter 'Swscale' (0A3B7558) appended to chain
[Debug] swscale:1920x1080 (1920x1080) chroma: UYVY -> 1920x1080 (1920x1080) chroma: YUVA with scaling using Bicubic (good quality)
[Debug] main:using video converter module "swscale"
[Debug] direct3d11:D3D11 pool succeed with 5 surfaces (1920x1080) context 0x0D743C58
[Debug] main:removing module "freetype"
[Debug] main:original format sz 1920x1080, of (0,0), vsz 1920x1080, 4cc UYVY, sar 3:4, msk r0x0 g0x0 b0x0
[Debug] main:looking for text renderer module matching "any": zd candidates
[Debug] freetype:Using DWrite backend
[Debug] freetype:DWrite_GetFamily(): family name: Arial
[Debug] main:VoutDisplayEvent 'resize' 322x243
[Debug] freetype:DWrite_ParseFamily(): using font at index 0 with weight 400 for bold: 0, italic: 0
[Debug] freetype:DWrite_ParseFamily(): using font at index 2 with weight 400 for bold: 0, italic: 1
[Debug] freetype:DWrite_ParseFamily(): using font at index 3 with weight 700 for bold: 1, italic: 1
[Debug] freetype:DWrite_ParseFamily(): using font at index 1 with weight 700 for bold: 1, italic: 0
[Debug] main:Received first picture
[Debug] direct3d11:Detected size change 322x241
[Debug] main:Buffering 40%
[Debug] main:Buffering 53%
[Debug] main:Buffering 66%
[Debug] main:Buffering 80%
[Debug] main:Buffering 93%
[Debug] main:Stream buffering done (320 ms in 319 ms)
[Debug] main:using text renderer module "freetype"
[Debug] main:Decoder wait done in 0 ms
[Debug] main:auto hiding mouse cursor
[Warning] drawable:unsupported control query 3
The thread 0x1ad0 has exited with code 0 (0x0).
[Debug] main:saving a free vout
[Debug] main:removing module "rawvideo"

stefanisin
Blank Cone
Blank Cone
Posts: 11
Joined: 08 Feb 2019 15:18

Re: LibVLCSharp - video scene filter as options

Postby stefanisin » 11 Feb 2019 12:50

[Debug] main:killing decoder fourcc `UYVY'
[Debug] main:reusing provided vout
[Debug] main:removing module "dshow"
[Debug] dshow:CaptureFilter::Pause
[Debug] dshow:CaptureFilter::Stop
[Debug] dshow:CapturePin::EndFlush
The thread 0x1b00 has exited with code 0 (0x0).
The thread 0x1394 has exited with code 0 (0x0).
The thread 0xd38 has exited with code 0 (0x0).
[Debug] dshow:releasing DirectShow
[Debug] dshow:DeleteDirectShowGraph: Removing capture filter
[Debug] dshow:CapturePin::QueryDirection
[Debug] dshow:CaptureFilter::EnumPins
[Debug] dshow:CapturePin::ConnectedTo [OK]
[Debug] dshow:CapturePin::Disconnect [OK]
[Debug] dshow:CaptureFilter::SetSyncSource
[Debug] dshow:DeleteDirectShowGraph: Removing filters
[Debug] dshow:CaptureFilter::JoinFilterGraph
[Debug] dshow:CaptureFilter::~CaptureFilter
[Debug] dshow:CaptureFilter::GetState 0
[Debug] dshow:CapturePin::~CapturePin
[Debug] dshow:DeleteDirectShowGraph: Removing device filter
[Debug] main:Program doesn't contain anymore ES
[Debug] main:removing module "directsound"
[Debug] main:destroying useless vout
[Debug] main:removing module "swscale"
[Debug] main:Filter 0A3B7558 removed from chain
[Debug] main:removing module "direct3d11"
[Debug] direct3d11:Direct3D11 resources destroyed
[Debug] direct3d11:Direct3D11 device adapter closed
[Error] direct3d11:SetThumbNailClip failed: 0x800706f4
[Debug] direct3d11:Win32 Vout EventThread terminating
[Debug] direct3d11:Win32VoutCloseWindow
[Debug] direct3d11:WinProc WM_DESTROY
[Debug] main:removing module "inhibit"
[Debug] main:removing module "freetype"
[Debug] main:removing module "yuvp"
[Debug] main:removing module "swscale"

stefanisin
Blank Cone
Blank Cone
Posts: 11
Joined: 08 Feb 2019 15:18

Re: LibVLCSharp - video scene filter as options

Postby stefanisin » 11 Feb 2019 13:13

Hello,

I have just found out that I have to configure video filter scene in

_libVLC = new LibVLC(new string[] {
"--video-filter=scene",
"--scene-format=bmp",
"--scene-prefix=vlcsnap",
"--scene-ratio=3",
"--scene-path=D:\\vlcsnap\\"
});

In this case, I am able to get image sequences.

I seems that this settings are ignored when I try to use AddOption to configure

media.AddOption(":video-filter=scene");
media.AddOption(":scene-format=bmp");
media.AddOption(":scene-prefix=vlcsnap");
media.AddOption(":scene-ratio=3");
media.AddOption(":scene-path=D:\\");

Radoslav


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 9 guests