Get picture size in video in video --sub-filter

This forum is about all development around libVLC.
calanor
Blank Cone
Blank Cone
Posts: 50
Joined: 08 May 2010 19:36

Get picture size in video in video --sub-filter

Postby calanor » 18 Jan 2018 00:36

I am trying to create a video filter type --sub-filter (or --sub-source) like marq.c or logo.c spu filter. I need to know the size of the image to calculate the size of the insertion in de Open callback function.

The problem is that (filter_t *) p_filter->fmt_in.video.i_width and p_filter->fmt_in.video.i_height return always 0 unlike using --video-filter that open callback function returns the correct values.

it is possible to get the size of the image for video sub-filter?

Rémi Denis-Courmont
Developer
Developer
Posts: 15265
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Get picture size in video in video --sub-filter

Postby Rémi Denis-Courmont » 18 Jan 2018 17:36

You cannot get the "size of the image" because no such thing exists.

It's entirely possible to have an SPU track without video tracks, changing video tracks, or multiple video tracks.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

calanor
Blank Cone
Blank Cone
Posts: 50
Joined: 08 May 2010 19:36

Re: Get picture size in video in video --sub-filter

Postby calanor » 19 Jan 2018 11:32

Tanks for your reply Rémi.
I can use a video-filter instead of a sub-source although it seems to consume more CPU resources.
My intention is that audiobargraph_v-barWidth and audobargraph_v-barHeight use a percent instead of the size in pixels because in most cases I do not know previously the size of the image.


And another question:

In some video-filter or spu like audiobargraph_v have a Callback to update params on the fly. Previously this was done sends params with tcp packets from audio-filter to video-filter through rc and I could change parameters from an external application by sending commands TCP to the rc. Later it was changed to use vlc variable Callback for send params form audio-fiter to video-filter (commit f2092cbf8 ). It's possible to send params on the fly from extenal app using the current varialbe callback?


Edit:
I see that with the latest git versions, --video-filter does not work and return the following error:
[00007f488cac1630] blend blend error: no matching alpha blending routine (chroma: YUVA -> VAOP)
[00007f488cb15fb0] audiobargraph_v filter error: failed to blend a picture
[00007f488cac1630] blend blend error: no matching alpha blending routine (chroma: YUVA -> VAOP)
[00007f488cb15fb0] audiobargraph_v filter error: failed to blend a picture
[00007f488cac1630] blend blend error: no matching alpha blending routine (chroma: YUVA -> VAOP)
[00007f488cb15fb0] audiobargraph_v filter error: failed to blend a picture
[0.....
work fine with --sub-source

Rémi Denis-Courmont
Developer
Developer
Posts: 15265
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Get picture size in video in video --sub-filter

Postby Rémi Denis-Courmont » 19 Jan 2018 21:26

Audio bar graph is a very bad example of anything.

Already using TCP as an intra-process communication channel is such epic fail.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

calanor
Blank Cone
Blank Cone
Posts: 50
Joined: 08 May 2010 19:36

Re: Get picture size in video in video --sub-filter

Postby calanor » 21 Jan 2018 13:01

Totally agree.

But could you keep sending commands via rc?

Rémi Denis-Courmont
Developer
Developer
Posts: 15265
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Get picture size in video in video --sub-filter

Postby Rémi Denis-Courmont » 21 Jan 2018 13:33

RC as in intra-process communication is also an epic fail.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

calanor
Blank Cone
Blank Cone
Posts: 50
Joined: 08 May 2010 19:36

Re: Get picture size in video in video --sub-filter

Postby calanor » 21 Jan 2018 16:35

Not for intra-process. Its for external control.
The problem of audiobargraph_v is that preconfigured height does not work well for streams with variable resolution as in the case of some rtps or adaptative streams type hls or dash.
How the internal control its inviable (see the original post) I had thought of an external control of barheight and barwidth.

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: Get picture size in video in video --sub-filter

Postby Jean-Baptiste Kempf » 22 Jan 2018 09:29

Not for intra-process. Its for external control.
The problem of audiobargraph_v is that preconfigured height does not work well for streams with variable resolution as in the case of some rtps or adaptative streams type hls or dash.
How the internal control its inviable (see the original post) I had thought of an external control of barheight and barwidth.
Can't the filter reconfigure itself?
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.

calanor
Blank Cone
Blank Cone
Posts: 50
Joined: 08 May 2010 19:36

Re: Get picture size in video in video --sub-filter

Postby calanor » 22 Jan 2018 11:53

How?
In sub-source I do not have the size of the image. In video-filter I have the size of the image but gives a blend error in my latest git compilation.

Code: Select all

blend blend error: no matching alpha blending routine (chroma: YUVA -> VAOP)

calanor
Blank Cone
Blank Cone
Posts: 50
Joined: 08 May 2010 19:36

Re: Get picture size in video in video --sub-filter

Postby calanor » 23 Jan 2018 18:30

News:
video-filter work well without the blend error if disable the hardware acceleration ( --avcodec-hw=none ) in case of Intel GPU.

Code: Select all

avcodec decoder: Using Intel i965 driver for Intel(R) Haswell Desktop - 1.8.3 for hardware decoding
In case of using Nvidia VDPAU Driver the video-filter work well even using hardware acceleration.

Code: Select all

avcodec decoder: Using G3DVL VDPAU Driver Shared Library version 1.0 for hardware decoding


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 3 guests