Page 1 of 1

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

Posted: 18 Jan 2018 00:36
by calanor
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?

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

Posted: 18 Jan 2018 17:36
by Rémi Denis-Courmont
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.

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

Posted: 19 Jan 2018 11:32
by calanor
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

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

Posted: 19 Jan 2018 21:26
by Rémi Denis-Courmont
Audio bar graph is a very bad example of anything.

Already using TCP as an intra-process communication channel is such epic fail.

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

Posted: 21 Jan 2018 13:01
by calanor
Totally agree.

But could you keep sending commands via rc?

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

Posted: 21 Jan 2018 13:33
by Rémi Denis-Courmont
RC as in intra-process communication is also an epic fail.

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

Posted: 21 Jan 2018 16:35
by calanor
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.

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

Posted: 22 Jan 2018 09:29
by Jean-Baptiste Kempf
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?

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

Posted: 22 Jan 2018 11:53
by calanor
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)

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

Posted: 23 Jan 2018 18:30
by calanor
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