dynamic stream recording

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

dynamic stream recording

Milian Wolff
Hey all,

I've found an article from ~5 years ago documenting dynamic pipelines which
seem to be the suggested way of enabling/disabling recording at runtime, cf.:

https://coaxion.net/blog/2014/01/gstreamer-dynamic-pipelines/
https://github.com/sdroege/gst-snippets/blob/
217ae015aaddfe3f7aa66ffc936ce93401fca04e/dynamic-tee-vsink.c

Is this still the recommended way of doing things? For a novice, it is
extremely difficult to follow - the code is complex and apparently requires
manual setup of the pipeline, which is unfortunate - the flexibility of
`gst_parse_launch` has helped me a lot so far.

As an alternative to the above dynamic-tee-vsink approach, I just experimented
with using an output-selector instead. That is in theory much simpler, but it
has multiple other problems, most notably one cannot change the location of a
downstream filesink e.g.

So, does one have to bite the bullet and implement the complex dynamic-tee-
vsink.c logic?

Thanks
--
Milian Wolff | [hidden email] | Senior Software Engineer
KDAB (Deutschland) GmbH, a KDAB Group company
Tel: +49-30-521325470
KDAB - The Qt, C++ and OpenGL Experts
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: dynamic stream recording

Tim Müller
On Tue, 2019-11-26 at 17:39 +0100, Milian Wolff wrote:

Hi Milian,

> Is this still the recommended way of doing things? For a novice, it
> is extremely difficult to follow - the code is complex and apparently
> requires  manual setup of the pipeline, which is unfortunate - the
> flexibility of `gst_parse_launch` has helped me a lot so far.

I think by and large this is still correct, but it depends a bit on
what exactly you want to do.

Can you describe your goals/requirements? There are many types of
'dynamic' stream recording.

gst_parse_launch() just doesn't work very well for dynamic things.
Having
said that, you can still use helpers like
gst_parse_bin_from_description(),
which are like gst_parse_launch() but  give you a bin / pipeline part
instead of a full top-level pipeline. So you can use it for branches
for example.

If you provide more specific info we might be able to point you to more
specific examples.

Cheers
 Tim

--
Tim Müller, Centricular Ltd - http://www.centricular.com

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: dynamic stream recording

Milian Wolff
On Mittwoch, 27. November 2019 08:55:12 CET Tim Müller wrote:
> On Tue, 2019-11-26 at 17:39 +0100, Milian Wolff wrote:
>
> Hi Milian,

Hey Tim!

> > Is this still the recommended way of doing things? For a novice, it
> > is extremely difficult to follow - the code is complex and apparently
> > requires  manual setup of the pipeline, which is unfortunate - the
> > flexibility of `gst_parse_launch` has helped me a lot so far.
>
> I think by and large this is still correct, but it depends a bit on
> what exactly you want to do.
>
> Can you describe your goals/requirements? There are many types of
> 'dynamic' stream recording.
Will do, see below.

> gst_parse_launch() just doesn't work very well for dynamic things.
> Having
> said that, you can still use helpers like
> gst_parse_bin_from_description(),
> which are like gst_parse_launch() but  give you a bin / pipeline part
> instead of a full top-level pipeline. So you can use it for branches
> for example.

Great, that's exactly the kind of method I was looking for. May I suggest that
a link to gst_parse_bin_from_description is added to gst_parse_launch?

> If you provide more specific info we might be able to point you to more
> specific examples.

I have an X shaped pipeline: two sources a) and b) , a video mixer in the
center, and then two outputs c) and d):

Center:

```
    glvideomixer name=m ! tee name=t
```

Source a) is essentially the video camera:

```
    rpicamsrc preview=false ! \
        video/x-raw,format=RGBA,width=320,height=240,framerate=25/1 ! \
        glupload ! m.
```

Source b) is a dynamic overlay image from another sensor source:

```
    appsrc name=overlaysrc blocksize=307200 stream-type=0 ! \
        rawvideoparse format=rgba width=320 height=240 frame-size=307200
framerate=25/1 ! \
        video/x-raw,format=RGBA,width=320,height=240,framerate=25/1 ! \
        glupload ! m.
```

Sink c) is the live preview:

```
    t. ! queue name=display_queue ! qmlglsink name=sink
```

Sink d) is the record branch:

```
    t. ! queue name=record_queue ! glcolorconvert ! gldownload ! \
        video/x-raw,format=ARGB ! videoconvert ! \
        omxh264enc control-rate=1 target-bitrate=1145000 ! \
        video/x-h264,profile=baseline ! h264parse ! avimux ! \
        filesink location=test.avi
```

Initially I was hoping I could create this pipeline just once and then
selectively enable/disable the record branch.

What I'll try next is to only create the record branch once but connect/
disconnect it dynamically to the tee as needed. Afaik while the record branch
is disconnected and thus not PLAYING, I should be able to change the
filesink's location property too - right?

Thanks

--
Milian Wolff | [hidden email] | Senior Software Engineer
KDAB (Deutschland) GmbH, a KDAB Group company
Tel: +49-30-521325470
KDAB - The Qt, C++ and OpenGL Experts
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: dynamic stream recording

Milian Wolff
In reply to this post by Milian Wolff
On Dienstag, 26. November 2019 17:39:07 CET Milian Wolff wrote:

> Hey all,
>
> I've found an article from ~5 years ago documenting dynamic pipelines which
> seem to be the suggested way of enabling/disabling recording at runtime,
> cf.:
>
> https://coaxion.net/blog/2014/01/gstreamer-dynamic-pipelines/
> https://github.com/sdroege/gst-snippets/blob/
> 217ae015aaddfe3f7aa66ffc936ce93401fca04e/dynamic-tee-vsink.c
>
> Is this still the recommended way of doing things?
Hmm, I just ran the example code against gstreamer 1.16-1 (on archlinux if
that matters) and it doesn't seem to work. All I get is a black video sink
after some time.

Running the pipeline manually without tee works fine:

gst-launch-1.0 filesrc location=test.mp4 ! decodebin ! videoconvert ! queue !
videoconvert ! autovideosink

Can someone check if the example code needs to be adapted?

--
Milian Wolff | [hidden email] | Senior Software Engineer
KDAB (Deutschland) GmbH, a KDAB Group company
Tel: +49-30-521325470
KDAB - The Qt, C++ and OpenGL Experts
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: dynamic stream recording

Milian Wolff
In reply to this post by Milian Wolff
On Mittwoch, 27. November 2019 10:05:51 CET Milian Wolff wrote:

> On Mittwoch, 27. November 2019 08:55:12 CET Tim Müller wrote:
> > On Tue, 2019-11-26 at 17:39 +0100, Milian Wolff wrote:
> >
> > Hi Milian,
>
> Hey Tim!
>
> > > Is this still the recommended way of doing things? For a novice, it
> > > is extremely difficult to follow - the code is complex and apparently
> > > requires  manual setup of the pipeline, which is unfortunate - the
> > > flexibility of `gst_parse_launch` has helped me a lot so far.
> >
> > I think by and large this is still correct, but it depends a bit on
> > what exactly you want to do.
> >
> > Can you describe your goals/requirements? There are many types of
> > 'dynamic' stream recording.
>
> Will do, see below.
>
> > gst_parse_launch() just doesn't work very well for dynamic things.
> > Having
> > said that, you can still use helpers like
> > gst_parse_bin_from_description(),
> > which are like gst_parse_launch() but  give you a bin / pipeline part
> > instead of a full top-level pipeline. So you can use it for branches
> > for example.
>
> Great, that's exactly the kind of method I was looking for. May I suggest
> that a link to gst_parse_bin_from_description is added to gst_parse_launch?
FTR, I have now implemented the dynamic pipeline logic and it works like a
charm. The rough outline is as follows:

a) gst_parse_launch to build the "main" pipeline that should be always running
with a tee at the place where recording can be hooked in dynamically

b) To enable recording, use gst_parse_bin_from_description to build the
recording branch, then gst_bin_add it to the previously created pipeline and
gst_pad_link the sink of my record branch with a new src pad from the tee
element, cf. the first branch within `tick_cb` in `dynamic-tee-vsink.c`.

Then it's important to also gst_element_set_state the newly added recording
branch to GST_STATE_PLAYING, otherwise the whole pipeline gets blocked. This
is missing from `dynamic-tee-vsink.c` but even adding it doesn't fix the
"black screen" problem for me when trying it out locally...

d) To stop recording we use the gst_pad_add_probe trick (cf. second branch in
`tick_cb` in `dynamic-tee-vsink.c`) and then in the callback we ref our
branch, unlink the pad, set the state to null, remove the branch from the
pipeline and then finally unref the branch and the request pad.

I'm happy! While this isn't trivial, it's much simpler than `dynamic-tee-
vsink.c` which confused me initially due to it's dynamic nature of supporting
more than one dynamically added branch. I think adding a simpler scenario to
exemplify a more common "on/off" state for recording would be appreciated by
many?

Cheers
--
Milian Wolff | [hidden email] | Senior Software Engineer
KDAB (Deutschland) GmbH, a KDAB Group company
Tel: +49-30-521325470
KDAB - The Qt, C++ and OpenGL Experts
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: dynamic stream recording

Sebastian Dröge-3
In reply to this post by Milian Wolff
On Wed, 2019-11-27 at 12:53 +0100, Milian Wolff wrote:

> On Dienstag, 26. November 2019 17:39:07 CET Milian Wolff wrote:
> > Hey all,
> >
> > I've found an article from ~5 years ago documenting dynamic pipelines which
> > seem to be the suggested way of enabling/disabling recording at runtime,
> > cf.:
> >
> > https://coaxion.net/blog/2014/01/gstreamer-dynamic-pipelines/
> > https://github.com/sdroege/gst-snippets/blob/
> > 217ae015aaddfe3f7aa66ffc936ce93401fca04e/dynamic-tee-vsink.c
> >
> > Is this still the recommended way of doing things?
>
> Hmm, I just ran the example code against gstreamer 1.16-1 (on archlinux if
> that matters) and it doesn't seem to work. All I get is a black video sink
> after some time.
>
> Running the pipeline manually without tee works fine:
>
> gst-launch-1.0 filesrc location=test.mp4 ! decodebin ! videoconvert ! queue !
> videoconvert ! autovideosink
>
> Can someone check if the example code needs to be adapted?
(I wrote the code in question)

The example code should still be correct and back then it was working
correctly. I can confirm that there's a problem though: changing the
timeout to 1s causes various critical warnings and green video frames
here. I'll debug that in one of the next days but expect there to be
some bug inside GStreamer that was introduced since I last tried it.

--
Sebastian Dröge, Centricular Ltd · https://www.centricular.com

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (981 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: dynamic stream recording

Milian Wolff
On Freitag, 29. November 2019 08:53:02 CET Sebastian Dröge wrote:

> On Wed, 2019-11-27 at 12:53 +0100, Milian Wolff wrote:
> > On Dienstag, 26. November 2019 17:39:07 CET Milian Wolff wrote:
> > > Hey all,
> > >
> > > I've found an article from ~5 years ago documenting dynamic pipelines
> > > which
> > > seem to be the suggested way of enabling/disabling recording at runtime,
> > > cf.:
> > >
> > > https://coaxion.net/blog/2014/01/gstreamer-dynamic-pipelines/
> > > https://github.com/sdroege/gst-snippets/blob/
> > > 217ae015aaddfe3f7aa66ffc936ce93401fca04e/dynamic-tee-vsink.c
> > >
> > > Is this still the recommended way of doing things?
> >
> > Hmm, I just ran the example code against gstreamer 1.16-1 (on archlinux if
> > that matters) and it doesn't seem to work. All I get is a black video sink
> > after some time.
> >
> > Running the pipeline manually without tee works fine:
> >
> > gst-launch-1.0 filesrc location=test.mp4 ! decodebin ! videoconvert !
> > queue ! videoconvert ! autovideosink
> >
> > Can someone check if the example code needs to be adapted?
>
> (I wrote the code in question)
>
> The example code should still be correct and back then it was working
> correctly. I can confirm that there's a problem though: changing the
> timeout to 1s causes various critical warnings and green video frames
> here. I'll debug that in one of the next days but expect there to be
> some bug inside GStreamer that was introduced since I last tried it.
Great! Thanks for looking into this. One thing I note is that you aren't
setting the state of the newly added branch to PLAYING, isn't that also
required? It was required for me at least in my code that adds a branch for
recording to a filesink.

But as I said, I tried adding that to your example yet it didn't solve the
black-screen issue for me.

Cheers

--
Milian Wolff | [hidden email] | Senior Software Engineer
KDAB (Deutschland) GmbH, a KDAB Group company
Tel: +49-30-521325470
KDAB - The Qt, C++ and OpenGL Experts
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: dynamic stream recording

Sebastian Dröge-3
Hi Milian,

On Fri, 2019-11-29 at 11:25 +0100, Milian Wolff wrote:
>
> Great! Thanks for looking into this. One thing I note is that you aren't
> setting the state of the newly added branch to PLAYING, isn't that also
> required? It was required for me at least in my code that adds a branch for
> recording to a filesink.

The version I have here is doing that in line 151/152/153 and that's
also in the git repository. However it was not doing that inside
pad_added_cb(), and that is indeed missing and must be added.

Without doing that it won't work all the time at least.

> But as I said, I tried adding that to your example yet it didn't solve the
> black-screen issue for me.

It works fine for me after doing the above, which is now also in the
git repo. Are you maybe using any special decoder instead of the one of
gst-libav?

But I actually misread: I thought you were talking about the dynamic-
filter.c example. That's the one where I get a green video if I reduce
the timeout to one second.

--
Sebastian Dröge, Centricular Ltd · https://www.centricular.com

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (981 bytes) Download Attachment
Roy
Reply | Threaded
Open this post in threaded view
|

How to install gstreamer 1.0 badplugin for opencv?

Roy
In reply to this post by Tim Müller

On a Ubuntu 18.04 machine I am trying to use opencv 4.1.2 facedetect in a gstreamer 1.14.5 pipeline but unfortunately the plugin is not installed.

I downloaded the gstreamer bad plugin code and tried to build using meson The size of the so files created does not look right.

How do I install the opencv plugin?

(cv) roy@hp:~$ cat /proc/version
Linux version 5.0.0-36-generic (buildd@lgw01-amd64-060) (gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)) #39~18.04.1-Ubuntu SMP Tue Nov 12 11:09:50 UTC 2019

(cv) roy@hp:~$ which gst-inspect-1.0 
/usr/bin/gst-inspect-1.0

(cv) roy@hp:~$ gst-inspect-1.0 --version
gst-inspect-1.0 version 1.14.5
GStreamer 1.14.5
https://launchpad.net/distros/ubuntu/+source/gstreamer1.0

(cv) roy@hp:~$ gst-inspect-1.0 facedetect
No such element or plugin 'facedetect'

(cv) roy@hp:~$ python
Python 3.6.9 (default, Nov  7 2019, 10:44:02) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> print(cv2.__version__)
4.1.2
>>> exit()

(cv) roy@hp:~$ ls -l /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstopen*
-rw-r--r-- 1 root root  39752 Jul  4 02:16 /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstopenal.so
-rw-r--r-- 1 root root  23376 Jul  4 02:16 /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstopenexr.so
-rw-r--r-- 1 root root  81896 Jul  4 02:16 /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstopenglmixers.so
-rw-r--r-- 1 root root 253048 Jul  3 09:19 /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstopengl.so
-rw-r--r-- 1 root root  48328 Jul  4 02:16 /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstopenjpeg.so
-rw-r--r-- 1 root root  27368 Jul  4 02:16 /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstopenmpt.so

(cv) roy@hp:~$ ls -l gst-plugins-bad-1.14.5/gst-libs/gst/opencv/
total 84
-rw-r--r-- 1 roy roy  6395 Mar 23  2018 gstopencvutils.cpp
-rw-r--r-- 1 roy roy  1700 Mar 23  2018 gstopencvutils.h
-rw-r--r-- 1 roy roy  8871 Mar 23  2018 gstopencvvideofilter.cpp
-rw-r--r-- 1 roy roy  4559 Mar 23  2018 gstopencvvideofilter.h
-rw-r--r-- 1 roy roy   746 Mar 23  2018 Makefile.am
-rw-r--r-- 1 roy roy 38511 May 29  2019 Makefile.in
-rw-r--r-- 1 roy roy   775 Mar 23  2018 meson.build
-rw-r--r-- 1 roy roy  1082 Mar 23  2018 opencv-prelude.h

(cv) roy@hp:~$ ls -l gst-plugins-bad-1.14.5/build/gst-libs/gst/opencv/
total 0
lrwxrwxrwx 1 roy roy 21 Nov 30 08:50 libgstopencv-1.0.so -> libgstopencv-1.0.so.0
lrwxrwxrwx 1 roy roy 28 Nov 30 08:50 libgstopencv-1.0.so.0 -> libgstopencv-1.0.so.0.1405.0

(cv) roy@hp:~$ 

I even tried

(cv) roy@hp:~$ sudo apt install libgstreamer-plugins-bad1.0-dev 
(cv) roy@hp:~$ gst-inspect-1.0 facedetect No such element or plugin 'facedetect'

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to install gstreamer 1.0 badplugin for opencv?

yair
hi roy
i suggest trying gst-build project. 
from my little experience it offers the best experience in diving into gstreamer compiling. 
it will d/l and compile by default almost everything in the gsteamersphere
check/edit meson_options.txt

get to a state where you have opencv headers in your path. 
  export LD_LIBRARY_PATH=/opt/gst/x64/lib/x86_64-linux-gnu/:/opt/opencv/lib 
 
i try to keep my dot files as clean as possible
and have an alias to a gstEnv script that assigns gstreamer environment vars to the specific terminal i work at. 
export PKG_CONFIG_PATH=/opt/gst/x64/lib/x86_64-linux
export GST_PLUGIN_PATH=/opt/gst/plugins/
export GSTREAMER_1_0_root_x86_64=/opt/gst/x64/
export PATH=$PATH:/opt/gst/x64/bin:/opt/opencv/

gst-build has chroot mode for developing
`printenv | grep gst` is your friend. 


btw, how do you get those fancy markdown in your posts ..



On Sat, Nov 30, 2019 at 11:07 PM Roy <[hidden email]> wrote:

On a Ubuntu 18.04 machine I am trying to use opencv 4.1.2 facedetect in a gstreamer 1.14.5 pipeline but unfortunately the plugin is not installed.

I downloaded the gstreamer bad plugin code and tried to build using meson The size of the so files created does not look right.

How do I install the opencv plugin?

(cv) roy@hp:~$ cat /proc/version
Linux version 5.0.0-36-generic (buildd@lgw01-amd64-060) (gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)) #39~18.04.1-Ubuntu SMP Tue Nov 12 11:09:50 UTC 2019

(cv) roy@hp:~$ which gst-inspect-1.0 
/usr/bin/gst-inspect-1.0

(cv) roy@hp:~$ gst-inspect-1.0 --version
gst-inspect-1.0 version 1.14.5
GStreamer 1.14.5
https://launchpad.net/distros/ubuntu/+source/gstreamer1.0

(cv) roy@hp:~$ gst-inspect-1.0 facedetect
No such element or plugin 'facedetect'

(cv) roy@hp:~$ python
Python 3.6.9 (default, Nov  7 2019, 10:44:02) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> print(cv2.__version__)
4.1.2
>>> exit()

(cv) roy@hp:~$ ls -l /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstopen*
-rw-r--r-- 1 root root  39752 Jul  4 02:16 /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstopenal.so
-rw-r--r-- 1 root root  23376 Jul  4 02:16 /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstopenexr.so
-rw-r--r-- 1 root root  81896 Jul  4 02:16 /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstopenglmixers.so
-rw-r--r-- 1 root root 253048 Jul  3 09:19 /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstopengl.so
-rw-r--r-- 1 root root  48328 Jul  4 02:16 /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstopenjpeg.so
-rw-r--r-- 1 root root  27368 Jul  4 02:16 /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstopenmpt.so

(cv) roy@hp:~$ ls -l gst-plugins-bad-1.14.5/gst-libs/gst/opencv/
total 84
-rw-r--r-- 1 roy roy  6395 Mar 23  2018 gstopencvutils.cpp
-rw-r--r-- 1 roy roy  1700 Mar 23  2018 gstopencvutils.h
-rw-r--r-- 1 roy roy  8871 Mar 23  2018 gstopencvvideofilter.cpp
-rw-r--r-- 1 roy roy  4559 Mar 23  2018 gstopencvvideofilter.h
-rw-r--r-- 1 roy roy   746 Mar 23  2018 Makefile.am
-rw-r--r-- 1 roy roy 38511 May 29  2019 Makefile.in
-rw-r--r-- 1 roy roy   775 Mar 23  2018 meson.build
-rw-r--r-- 1 roy roy  1082 Mar 23  2018 opencv-prelude.h

(cv) roy@hp:~$ ls -l gst-plugins-bad-1.14.5/build/gst-libs/gst/opencv/
total 0
lrwxrwxrwx 1 roy roy 21 Nov 30 08:50 libgstopencv-1.0.so -> libgstopencv-1.0.so.0
lrwxrwxrwx 1 roy roy 28 Nov 30 08:50 libgstopencv-1.0.so.0 -> libgstopencv-1.0.so.0.1405.0

(cv) roy@hp:~$ 

I even tried

(cv) roy@hp:~$ sudo apt install libgstreamer-plugins-bad1.0-dev 
(cv) roy@hp:~$ gst-inspect-1.0 facedetect No such element or plugin 'facedetect'
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to install gstreamer 1.0 badplugin for opencv?

yair
headers=libraries

and what i wrote is assumption, havnt tried the opencv stuff yet. 
meson is interesting build system, see `meson configure`. 
and i think it mostly looks to find lib/pkgconfig/opencv4.pc

On Sun, Dec 1, 2019 at 11:46 PM Yair Reshef <[hidden email]> wrote:
hi roy
i suggest trying gst-build project. 
from my little experience it offers the best experience in diving into gstreamer compiling. 
it will d/l and compile by default almost everything in the gsteamersphere
check/edit meson_options.txt

get to a state where you have opencv headers in your path. 
  export LD_LIBRARY_PATH=/opt/gst/x64/lib/x86_64-linux-gnu/:/opt/opencv/lib 
 
i try to keep my dot files as clean as possible
and have an alias to a gstEnv script that assigns gstreamer environment vars to the specific terminal i work at. 
export PKG_CONFIG_PATH=/opt/gst/x64/lib/x86_64-linux
export GST_PLUGIN_PATH=/opt/gst/plugins/
export GSTREAMER_1_0_root_x86_64=/opt/gst/x64/
export PATH=$PATH:/opt/gst/x64/bin:/opt/opencv/

gst-build has chroot mode for developing
`printenv | grep gst` is your friend. 


btw, how do you get those fancy markdown in your posts ..



On Sat, Nov 30, 2019 at 11:07 PM Roy <[hidden email]> wrote:

On a Ubuntu 18.04 machine I am trying to use opencv 4.1.2 facedetect in a gstreamer 1.14.5 pipeline but unfortunately the plugin is not installed.

I downloaded the gstreamer bad plugin code and tried to build using meson The size of the so files created does not look right.

How do I install the opencv plugin?

(cv) roy@hp:~$ cat /proc/version
Linux version 5.0.0-36-generic (buildd@lgw01-amd64-060) (gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)) #39~18.04.1-Ubuntu SMP Tue Nov 12 11:09:50 UTC 2019

(cv) roy@hp:~$ which gst-inspect-1.0 
/usr/bin/gst-inspect-1.0

(cv) roy@hp:~$ gst-inspect-1.0 --version
gst-inspect-1.0 version 1.14.5
GStreamer 1.14.5
https://launchpad.net/distros/ubuntu/+source/gstreamer1.0

(cv) roy@hp:~$ gst-inspect-1.0 facedetect
No such element or plugin 'facedetect'

(cv) roy@hp:~$ python
Python 3.6.9 (default, Nov  7 2019, 10:44:02) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> print(cv2.__version__)
4.1.2
>>> exit()

(cv) roy@hp:~$ ls -l /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstopen*
-rw-r--r-- 1 root root  39752 Jul  4 02:16 /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstopenal.so
-rw-r--r-- 1 root root  23376 Jul  4 02:16 /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstopenexr.so
-rw-r--r-- 1 root root  81896 Jul  4 02:16 /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstopenglmixers.so
-rw-r--r-- 1 root root 253048 Jul  3 09:19 /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstopengl.so
-rw-r--r-- 1 root root  48328 Jul  4 02:16 /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstopenjpeg.so
-rw-r--r-- 1 root root  27368 Jul  4 02:16 /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstopenmpt.so

(cv) roy@hp:~$ ls -l gst-plugins-bad-1.14.5/gst-libs/gst/opencv/
total 84
-rw-r--r-- 1 roy roy  6395 Mar 23  2018 gstopencvutils.cpp
-rw-r--r-- 1 roy roy  1700 Mar 23  2018 gstopencvutils.h
-rw-r--r-- 1 roy roy  8871 Mar 23  2018 gstopencvvideofilter.cpp
-rw-r--r-- 1 roy roy  4559 Mar 23  2018 gstopencvvideofilter.h
-rw-r--r-- 1 roy roy   746 Mar 23  2018 Makefile.am
-rw-r--r-- 1 roy roy 38511 May 29  2019 Makefile.in
-rw-r--r-- 1 roy roy   775 Mar 23  2018 meson.build
-rw-r--r-- 1 roy roy  1082 Mar 23  2018 opencv-prelude.h

(cv) roy@hp:~$ ls -l gst-plugins-bad-1.14.5/build/gst-libs/gst/opencv/
total 0
lrwxrwxrwx 1 roy roy 21 Nov 30 08:50 libgstopencv-1.0.so -> libgstopencv-1.0.so.0
lrwxrwxrwx 1 roy roy 28 Nov 30 08:50 libgstopencv-1.0.so.0 -> libgstopencv-1.0.so.0.1405.0

(cv) roy@hp:~$ 

I even tried

(cv) roy@hp:~$ sudo apt install libgstreamer-plugins-bad1.0-dev 
(cv) roy@hp:~$ gst-inspect-1.0 facedetect No such element or plugin 'facedetect'
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: dynamic stream recording

Milian Wolff
In reply to this post by Sebastian Dröge-3
On Saturday, November 30, 2019 7:33:36 AM CET Sebastian Dröge wrote:

> Hi Milian,
>
> On Fri, 2019-11-29 at 11:25 +0100, Milian Wolff wrote:
> > Great! Thanks for looking into this. One thing I note is that you aren't
> > setting the state of the newly added branch to PLAYING, isn't that also
> > required? It was required for me at least in my code that adds a branch
> > for
> > recording to a filesink.
>
> The version I have here is doing that in line 151/152/153 and that's
> also in the git repository. However it was not doing that inside
> pad_added_cb(), and that is indeed missing and must be added.
Ah, gst_element_sync_state_with_parent should take care of that in tick_cb,
right? I was looking for an explicit call to gst_element_set_state.

> Without doing that it won't work all the time at least.
>
> > But as I said, I tried adding that to your example yet it didn't solve the
> > black-screen issue for me.
>
> It works fine for me after doing the above, which is now also in the
> git repo. Are you maybe using any special decoder instead of the one of
> gst-libav?
>
> But I actually misread: I thought you were talking about the dynamic-
> filter.c example. That's the one where I get a green video if I reduce
> the timeout to one second.
I'm just trying dynamic-tee-vsink with any mp4 file I have around, all just
show a black screen for me. Here's a debug log, note how the state goes to
PAUSED which would explain the black screen:

```
0:00:03.079231484 1534397 0x56550c158400 INFO        GST_ELEMENT_PADS
gstelement.c:668:gst_element_add_pad:<tee0> adding pad 'src_1'
0:00:03.079316601 1534397 0x56550c158400 INFO     GST_ELEMENT_FACTORY
gstelementfactory.c:361:gst_element_factory_create: creating element "queue"
0:00:03.079479602 1534397 0x56550c158400 INFO        GST_ELEMENT_PADS
gstelement.c:668:gst_element_add_pad:<GstQueue@0x7fd6a0059900> adding pad
'sink'
0:00:03.079535811 1534397 0x56550c158400 INFO        GST_ELEMENT_PADS
gstelement.c:668:gst_element_add_pad:<GstQueue@0x7fd6a0059900> adding pad
'src'
0:00:03.079583988 1534397 0x56550c158400 INFO     GST_ELEMENT_FACTORY
gstelementfactory.c:361:gst_element_factory_create: creating element
"videoconvert"
0:00:03.079642633 1534397 0x56550c158400 INFO        GST_ELEMENT_PADS
gstelement.c:668:gst_element_add_pad:<GstBaseTransform@0x56550c2d68d0> adding
pad 'sink'
0:00:03.079697209 1534397 0x56550c158400 INFO        GST_ELEMENT_PADS
gstelement.c:668:gst_element_add_pad:<GstBaseTransform@0x56550c2d68d0> adding
pad 'src'
0:00:03.080384513 1534397 0x56550c158400 INFO      GST_PLUGIN_LOADING
gstplugin.c:902:_priv_gst_plugin_load_file_for_registry: plugin "/usr/lib/
gstreamer-1.0/libgstautodetect.so" loaded
0:00:03.080418382 1534397 0x56550c158400 INFO     GST_ELEMENT_FACTORY
gstelementfactory.c:361:gst_element_factory_create: creating element
"autovideosink"
0:00:03.080566363 1534397 0x56550c158400 INFO        GST_ELEMENT_PADS
gstelement.c:668:gst_element_add_pad:<autovideosink0> adding pad 'sink'
0:00:03.080596157 1534397 0x56550c158400 INFO     GST_ELEMENT_FACTORY
gstelementfactory.c:358:gst_element_factory_create: creating element
"fakesink" named "fake-video-sink"
0:00:03.080633376 1534397 0x56550c158400 INFO        GST_ELEMENT_PADS
gstelement.c:668:gst_element_add_pad:<GstBaseSink@0x56550c3f1550> adding pad
'sink'
0:00:03.080688605 1534397 0x56550c158400 INFO        GST_ELEMENT_PADS
gstelement.c:915:gst_element_get_static_pad: found pad fake-video-sink:sink
0:00:03.080715730 1534397 0x56550c158400 INFO                GST_PADS
gstpad.c:2377:gst_pad_link_prepare: trying to link sink:proxypad5 and fake-
video-sink:sink
0:00:03.080740623 1534397 0x56550c158400 INFO                GST_PADS
gstpad.c:2585:gst_pad_link_full: linked sink:proxypad5 and fake-video-
sink:sink, successful
0:00:03.080758683 1534397 0x56550c158400 INFO               GST_EVENT
gstevent.c:1579:gst_event_new_reconfigure: creating reconfigure event
0:00:03.080837028 1534397 0x56550c158400 INFO        GST_ELEMENT_PADS
gstutils.c:1771:gst_element_link_pads_full: trying to link element queue1:
(any) to element videoconvert1:(any)
0:00:03.080863671 1534397 0x56550c158400 INFO                GST_PADS
gstutils.c:1034:gst_pad_check_link: trying to link queue1:src and
videoconvert1:sink
0:00:03.080891803 1534397 0x56550c158400 INFO                GST_PADS
gstpad.c:4237:gst_pad_peer_query:<queue1:sink> pad has no peer
0:00:03.080921761 1534397 0x56550c158400 INFO                GST_PADS
gstpad.c:4237:gst_pad_peer_query:<videoconvert1:src> pad has no peer
0:00:03.082849923 1534397 0x56550c158400 INFO                GST_PADS
gstutils.c:1587:prepare_link_maybe_ghosting: queue1 and videoconvert1 in same
bin, no need for ghost pads
0:00:03.082867188 1534397 0x56550c158400 INFO                GST_PADS
gstpad.c:2377:gst_pad_link_prepare: trying to link queue1:src and
videoconvert1:sink
0:00:03.082875755 1534397 0x56550c158400 INFO                GST_PADS
gstpad.c:4237:gst_pad_peer_query:<queue1:sink> pad has no peer
0:00:03.082884546 1534397 0x56550c158400 INFO                GST_PADS
gstpad.c:4237:gst_pad_peer_query:<videoconvert1:src> pad has no peer
0:00:03.083682518 1534397 0x56550c158400 INFO                GST_PADS
gstpad.c:2585:gst_pad_link_full: linked queue1:src and videoconvert1:sink,
successful
0:00:03.083690544 1534397 0x56550c158400 INFO               GST_EVENT
gstevent.c:1579:gst_event_new_reconfigure: creating reconfigure event
0:00:03.083697092 1534397 0x56550c158400 INFO               GST_EVENT
gstpad.c:5812:gst_pad_send_event_unchecked:<queue1:src> Received event on
flushing pad. Discarding
0:00:03.083709121 1534397 0x56550c158400 INFO        GST_ELEMENT_PADS
gstutils.c:1771:gst_element_link_pads_full: trying to link element
videoconvert1:(any) to element autovideosink0:(any)
0:00:03.083721242 1534397 0x56550c158400 INFO                GST_PADS
gstutils.c:1034:gst_pad_check_link: trying to link videoconvert1:src and
autovideosink0:sink
0:00:03.083731411 1534397 0x56550c158400 INFO                GST_PADS
gstpad.c:4237:gst_pad_peer_query:<queue1:sink> pad has no peer
0:00:03.084522246 1534397 0x56550c158400 INFO                GST_PADS
gstutils.c:1587:prepare_link_maybe_ghosting: videoconvert1 and autovideosink0
in same bin, no need for ghost pads
0:00:03.084534493 1534397 0x56550c158400 INFO                GST_PADS
gstpad.c:2377:gst_pad_link_prepare: trying to link videoconvert1:src and
autovideosink0:sink
0:00:03.084542572 1534397 0x56550c158400 INFO                GST_PADS
gstpad.c:4237:gst_pad_peer_query:<queue1:sink> pad has no peer
0:00:03.085335895 1534397 0x56550c158400 INFO                GST_PADS
gstpad.c:2585:gst_pad_link_full: linked videoconvert1:src and
autovideosink0:sink, successful
0:00:03.085343724 1534397 0x56550c158400 INFO               GST_EVENT
gstevent.c:1579:gst_event_new_reconfigure: creating reconfigure event
0:00:03.085350140 1534397 0x56550c158400 INFO               GST_EVENT
gstpad.c:5812:gst_pad_send_event_unchecked:<videoconvert1:src> Received event
on flushing pad. Discarding
0:00:03.085364687 1534397 0x56550c158400 INFO              GST_STATES
gstelement.c:2647:gst_element_continue_state:<queue1> committing state from
NULL to READY, pending PLAYING, next PAUSED
0:00:03.085376262 1534397 0x56550c158400 INFO              GST_STATES
gstelement.c:2575:_priv_gst_element_state_changed:<queue1> notifying about
state-changed NULL to READY (PLAYING pending)
0:00:03.085395201 1534397 0x56550c158400 INFO              GST_STATES
gstelement.c:2655:gst_element_continue_state:<queue1> continue state change
READY to PAUSED, final PLAYING
0:00:03.085411380 1534397 0x56550c158400 INFO                    task
gsttask.c:453:gst_task_set_lock: setting stream lock 0x56550c3cb190 on task
0x56550c3d4290
0:00:03.085420021 1534397 0x56550c158400 INFO                GST_PADS
gstpad.c:6159:gst_pad_start_task:<queue1:src> created task 0x56550c3d4290
0:00:03.085439479 1534397 0x56550c158400 INFO              GST_STATES
gstelement.c:2647:gst_element_continue_state:<queue1> committing state from
READY to PAUSED, pending PLAYING, next PLAYING
0:00:03.085447826 1534397 0x56550c158400 INFO              GST_STATES
gstelement.c:2575:_priv_gst_element_state_changed:<queue1> notifying about
state-changed READY to PAUSED (PLAYING pending)
0:00:03.085456012 1534397 0x56550c158400 INFO              GST_STATES
gstelement.c:2655:gst_element_continue_state:<queue1> continue state change
PAUSED to PLAYING, final PLAYING
0:00:03.085462277 1534397 0x56550c158400 INFO              GST_STATES
gstelement.c:2675:gst_element_continue_state:<queue1> completed state change
to PLAYING
0:00:03.085471943 1534397 0x56550c158400 INFO              GST_STATES
gstelement.c:2575:_priv_gst_element_state_changed:<queue1> notifying about
state-changed PAUSED to PLAYING (VOID_PENDING pending)
0:00:03.085485041 1534397 0x56550c158400 INFO              GST_STATES
gstelement.c:2647:gst_element_continue_state:<videoconvert1> committing state
from NULL to READY, pending PLAYING, next PAUSED
0:00:03.085493188 1534397 0x56550c158400 INFO              GST_STATES
gstelement.c:2575:_priv_gst_element_state_changed:<videoconvert1> notifying
about state-changed NULL to READY (PLAYING pending)
0:00:03.085502576 1534397 0x56550c158400 INFO              GST_STATES
gstelement.c:2655:gst_element_continue_state:<videoconvert1> continue state
change READY to PAUSED, final PLAYING
0:00:03.085514953 1534397 0x56550c158400 INFO              GST_STATES
gstelement.c:2647:gst_element_continue_state:<videoconvert1> committing state
from READY to PAUSED, pending PLAYING, next PLAYING
0:00:03.085523116 1534397 0x56550c158400 INFO              GST_STATES
gstelement.c:2575:_priv_gst_element_state_changed:<videoconvert1> notifying
about state-changed READY to PAUSED (PLAYING pending)
0:00:03.085532405 1534397 0x56550c158400 INFO              GST_STATES
gstelement.c:2655:gst_element_continue_state:<videoconvert1> continue state
change PAUSED to PLAYING, final PLAYING
0:00:03.085539554 1534397 0x56550c158400 INFO              GST_STATES
gstelement.c:2675:gst_element_continue_state:<videoconvert1> completed state
change to PLAYING
0:00:03.085547662 1534397 0x56550c158400 INFO              GST_STATES
gstelement.c:2575:_priv_gst_element_state_changed:<videoconvert1> notifying
about state-changed PAUSED to PLAYING (VOID_PENDING pending)
0:00:03.085559817 1534397 0x56550c158400 INFO              GST_STATES
gstelement.c:2675:gst_element_continue_state:<fake-video-sink> completed state
change to NULL
0:00:03.085571987 1534397 0x56550c158400 INFO        GST_ELEMENT_PADS
gstpad.c:2132:gst_pad_unlink: unlinking sink:proxypad5(0x56550c3dc570) and
fake-video-sink:sink(0x7fd6a005bcd0)
0:00:03.085581906 1534397 0x56550c158400 INFO        GST_ELEMENT_PADS
gstpad.c:2187:gst_pad_unlink: unlinked sink:proxypad5 and fake-video-sink:sink
0:00:03.085590247 1534397 0x56550c158400 INFO           GST_PARENTAGE
gstbin.c:1801:gst_bin_remove_func:<autovideosink0> removed child "fake-video-
sink"
0:00:03.085603414 1534397 0x56550c158400 INFO         GST_REFCOUNTING
gstelement.c:3251:gst_element_dispose:<fake-video-sink> 0x56550c3f1550 dispose
0:00:03.085611152 1534397 0x56550c158400 INFO        GST_ELEMENT_PADS
gstelement.c:784:gst_element_remove_pad:<fake-video-sink> removing pad 'sink'
0:00:03.085622744 1534397 0x56550c158400 INFO         GST_REFCOUNTING
gstelement.c:3296:gst_element_dispose:<fake-video-sink> 0x56550c3f1550 parent
class dispose
0:00:03.085631056 1534397 0x56550c158400 INFO         GST_REFCOUNTING
gstelement.c:3328:gst_element_finalize:<fake-video-sink> 0x56550c3f1550
finalize
0:00:03.085638498 1534397 0x56550c158400 INFO         GST_REFCOUNTING
gstelement.c:3333:gst_element_finalize:<fake-video-sink> 0x56550c3f1550
finalize parent
0:00:03.086019432 1534397 0x56550c158400 INFO     GST_ELEMENT_FACTORY
gstelementfactory.c:358:gst_element_factory_create: creating element
"vaapisink" named "autovideosink0-actual-sink-vaapi"
0:00:03.086184883 1534397 0x56550c158400 INFO        GST_ELEMENT_PADS
gstelement.c:668:gst_element_add_pad:<GstBaseSink@0x56550c3fd600> adding pad
'sink'
0:00:03.086200457 1534397 0x56550c158400 INFO        GST_ELEMENT_PADS
gstelement.c:915:gst_element_get_static_pad: found pad (null):sink
0:00:03.086220514 1534397 0x56550c158400 INFO        GST_ELEMENT_PADS
gstelement.c:915:gst_element_get_static_pad: found pad autovideosink0-actual-
sink-vaapi:sink
0:00:03.086236575 1534397 0x56550c158400 INFO                GST_PADS
gstpad.c:4237:gst_pad_peer_query:<autovideosink0-actual-sink-vaapi:sink> pad
has no peer
0:00:03.086244674 1534397 0x56550c158400 INFO             GST_CONTEXT
gstvaapivideocontext.c:150:context_pad_query:<autovideosink0-actual-sink-
vaapi:sink> context pad peer query failed
0:00:03.087108827 1534397 0x56550c158400 INFO                   vaapi
gstvaapiutils.c:94:gst_vaapi_log: VA-API version 1.5.0
0:00:03.087256530 1534397 0x56550c158400 INFO                   vaapi
gstvaapiutils.c:94:gst_vaapi_log: va_getDriverName() returns 0
0:00:03.087270818 1534397 0x56550c158400 INFO                   vaapi
gstvaapiutils.c:94:gst_vaapi_log: Trying to open /usr/lib/dri/
i965_drv_video.so
0:00:03.087290622 1534397 0x56550c158400 INFO                   vaapi
gstvaapiutils.c:94:gst_vaapi_log: Found init function __vaDriverInit_1_3
0:00:03.087630048 1534397 0x56550c158400 INFO                   vaapi
gstvaapiutils.c:94:gst_vaapi_log: va_openDriver() returns 0
0:00:03.087648585 1534397 0x56550c158400 INFO                   vaapi
gstvaapiutils.c:121:vaapi_initialize: VA-API version 1.5
0:00:03.087660289 1534397 0x56550c158400 INFO            vaapidisplay
gstvaapidisplay.c:906:gst_vaapi_display_create:<vaapidisplayglx1> new display
addr=0x56550c3d4410
0:00:03.087681051 1534397 0x56550c158400 INFO               vaapisink
gstvaapipluginbase.c:55:plugin_set_display:<autovideosink0-actual-sink-vaapi>
set display <vaapidisplayglx1>
0:00:03.087702747 1534397 0x56550c158400 INFO             GST_CONTEXT
gstvaapivideocontext.c:311:gst_vaapi_video_context_propagate:<autovideosink0-
actual-sink-vaapi> posting `have-context' (0x56550c3e3520) message with
display <vaapidisplayglx1>
0:00:03.087722298 1534397 0x56550c158400 INFO               vaapisink
gstvaapisink.c:1232:gst_vaapisink_display_changed: created VA/GLX display
0x56550c3d4410
0:00:03.089485440 1534397 0x56550c158400 INFO              GST_STATES
gstelement.c:2675:gst_element_continue_state:<autovideosink0-actual-sink-
vaapi> completed state change to READY
0:00:03.089503227 1534397 0x56550c158400 INFO              GST_STATES
gstelement.c:2575:_priv_gst_element_state_changed:<autovideosink0-actual-sink-
vaapi> notifying about state-changed NULL to READY (VOID_PENDING pending)
0:00:03.089527384 1534397 0x56550c158400 INFO              GST_STATES
gstelement.c:2675:gst_element_continue_state:<autovideosink0-actual-sink-
vaapi> completed state change to NULL
0:00:03.089537722 1534397 0x56550c158400 INFO              GST_STATES
gstelement.c:2575:_priv_gst_element_state_changed:<autovideosink0-actual-sink-
vaapi> notifying about state-changed READY to NULL (VOID_PENDING pending)
0:00:03.089878840 1534397 0x56550c158400 INFO               vaapisink
gstvaapipluginbase.c:55:plugin_set_display:<autovideosink0-actual-sink-vaapi>
set display <vaapidisplayglx0>
0:00:03.089902575 1534397 0x56550c158400 INFO        GST_ELEMENT_PADS
gstelement.c:915:gst_element_get_static_pad: found pad autovideosink0-actual-
sink-vaapi:sink
0:00:03.089915842 1534397 0x56550c158400 INFO                GST_PADS
gstpad.c:2377:gst_pad_link_prepare: trying to link sink:proxypad5 and
autovideosink0-actual-sink-vaapi:sink
0:00:03.089926275 1534397 0x56550c158400 INFO                GST_PADS
gstpad.c:2585:gst_pad_link_full: linked sink:proxypad5 and autovideosink0-
actual-sink-vaapi:sink, successful
0:00:03.089933751 1534397 0x56550c158400 INFO               GST_EVENT
gstevent.c:1579:gst_event_new_reconfigure: creating reconfigure event
0:00:03.089952031 1534397 0x56550c158400 INFO              GST_STATES
gstbin.c:2503:gst_bin_element_set_state:<autovideosink0-actual-sink-vaapi>
current NULL pending VOID_PENDING, desired next READY
0:00:03.090802207 1534397 0x56550c158400 INFO              GST_STATES
gstelement.c:2675:gst_element_continue_state:<autovideosink0-actual-sink-
vaapi> completed state change to READY
0:00:03.090816364 1534397 0x56550c158400 INFO              GST_STATES
gstelement.c:2575:_priv_gst_element_state_changed:<autovideosink0-actual-sink-
vaapi> notifying about state-changed NULL to READY (VOID_PENDING pending)
0:00:03.090831961 1534397 0x56550c158400 INFO              GST_STATES
gstbin.c:2952:gst_bin_change_state_func:<autovideosink0> child
'autovideosink0-actual-sink-vaapi' changed state to 2(READY) successfully
0:00:03.090843969 1534397 0x56550c158400 INFO              GST_STATES
gstelement.c:2647:gst_element_continue_state:<autovideosink0> committing state
from NULL to READY, pending PLAYING, next PAUSED
0:00:03.090851371 1534397 0x56550c158400 INFO              GST_STATES
gstelement.c:2575:_priv_gst_element_state_changed:<autovideosink0> notifying
about state-changed NULL to READY (PLAYING pending)
0:00:03.090861524 1534397 0x56550c158400 INFO              GST_STATES
gstelement.c:2655:gst_element_continue_state:<autovideosink0> continue state
change READY to PAUSED, final PLAYING
0:00:03.090874793 1534397 0x56550c158400 INFO              GST_STATES
gstbin.c:2503:gst_bin_element_set_state:<autovideosink0-actual-sink-vaapi>
current READY pending VOID_PENDING, desired next PAUSED
0:00:03.090887096 1534397 0x56550c158400 INFO              GST_STATES
gstelement.c:2575:_priv_gst_element_state_changed:<pipeline0> notifying about
state-changed PAUSED to PAUSED (PAUSED pending)
0:00:03.090901159 1534397 0x56550c158400 INFO              GST_STATES
gstbin.c:2959:gst_bin_change_state_func:<autovideosink0> child
'autovideosink0-actual-sink-vaapi' is changing state asynchronously to PAUSED
0:00:03.090915481 1534397 0x56550c158400 INFO        GST_ELEMENT_PADS
gstelement.c:915:gst_element_get_static_pad: found pad queue1:sink
0:00:03.090927587 1534397 0x56550c158400 INFO                GST_PADS
gstpad.c:2377:gst_pad_link_prepare: trying to link tee0:src_1 and queue1:sink
0:00:03.091541584 1534397 0x56550c158400 INFO                GST_PADS
gstpad.c:2585:gst_pad_link_full: linked tee0:src_1 and queue1:sink, successful
0:00:03.091552972 1534397 0x56550c158400 INFO               GST_EVENT
gstevent.c:1579:gst_event_new_reconfigure: creating reconfigure event
added
0:00:03.107264973 1534397 0x7fd6a807c770 INFO             vaapidecode
gstvaapidecode.c:360:gst_vaapidecode_update_src_caps:<vaapidecode0> new src
caps = video/x-raw(memory:VASurface), format=(string)NV12, width=(int)1280,
height=(int)800, interlace-mode=(string)progressive, multiview-
mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/
right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-
aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1
0:00:03.107447247 1534397 0x7fd6a005d630 INFO           basetransform
gstbasetransform.c:1317:gst_base_transform_setcaps:<capsfilter1> reuse caps
0:00:03.115024568 1534397 0x7fd6a005d630 INFO           basetransform
gstbasetransform.c:1317:gst_base_transform_setcaps:<vaapipostproc0> reuse caps
0:00:03.115209353 1534397 0x7fd6a005d630 INFO           basetransform
gstbasetransform.c:1317:gst_base_transform_setcaps:<videoconvert0> reuse caps
0:00:03.115387051 1534397 0x7fd6981a0450 INFO           basetransform
gstbasetransform.c:1317:gst_base_transform_setcaps:<videoconvert1> reuse caps
0:00:03.115489630 1534397 0x7fd6981a0450 INFO               GST_EVENT
gstevent.c:820:gst_event_new_caps: creating caps event video/x-
raw(memory:VASurface), format=(string)NV12, width=(int)1280, height=(int)800,
interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-
flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/
left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-
ratio=(fraction)1/1, framerate=(fraction)30/1
0:00:03.118500325 1534397 0x7fd6a807c770 INFO           basetransform
gstbasetransform.c:1317:gst_base_transform_setcaps:<capsfilter0> reuse caps
```
--
Milian Wolff | [hidden email] | Senior Software Engineer
KDAB (Deutschland) GmbH, a KDAB Group company
Tel: +49-30-521325470
KDAB - The Qt, C++ and OpenGL Experts
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: dynamic stream recording

Sebastian Dröge-3
On Mon, 2019-12-02 at 11:54 +0100, Milian Wolff wrote:

> On Saturday, November 30, 2019 7:33:36 AM CET Sebastian Dröge wrote:
> > Hi Milian,
> >
> > On Fri, 2019-11-29 at 11:25 +0100, Milian Wolff wrote:
> > > Great! Thanks for looking into this. One thing I note is that you
> > > aren't
> > > setting the state of the newly added branch to PLAYING, isn't
> > > that also
> > > required? It was required for me at least in my code that adds a
> > > branch
> > > for
> > > recording to a filesink.
> >
> > The version I have here is doing that in line 151/152/153 and
> > that's
> > also in the git repository. However it was not doing that inside
> > pad_added_cb(), and that is indeed missing and must be added.
>
> Ah, gst_element_sync_state_with_parent should take care of that in
> tick_cb, right? I was looking for an explicit call to
> gst_element_set_state.
Correct

> > Without doing that it won't work all the time at least.
> >
> > > But as I said, I tried adding that to your example yet it didn't
> > > solve the
> > > black-screen issue for me.
> >
> > It works fine for me after doing the above, which is now also in
> > the
> > git repo. Are you maybe using any special decoder instead of the
> > one of
> > gst-libav?
> >
> > But I actually misread: I thought you were talking about the
> > dynamic-
> > filter.c example. That's the one where I get a green video if I
> > reduce
> > the timeout to one second.
>
> I'm just trying dynamic-tee-vsink with any mp4 file I have around,
> all just show a black screen for me. Here's a debug log, note how the
> state goes to PAUSED which would explain the black screen:
I see you're using vaapisink and probably also the vaapi decoders.
Please try again with some other sink and decoder, I wouldn't be
surprised if the problem simply disappears then.

If so, please create an issue against gstreamer-vaapi for this.


The problem I was debugging in the filter example was this one here:
https://gitlab.freedesktop.org/gstreamer/gstreamer/merge_requests/329

--
Sebastian Dröge, Centricular Ltd · https://www.centricular.com

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (981 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: dynamic stream recording

Milian Wolff
On Montag, 2. Dezember 2019 14:08:20 CET Sebastian Dröge wrote:

> On Mon, 2019-12-02 at 11:54 +0100, Milian Wolff wrote:
> > On Saturday, November 30, 2019 7:33:36 AM CET Sebastian Dröge wrote:
> > > Hi Milian,
> > >
> > > On Fri, 2019-11-29 at 11:25 +0100, Milian Wolff wrote:
> > > > Great! Thanks for looking into this. One thing I note is that you
> > > > aren't
> > > > setting the state of the newly added branch to PLAYING, isn't
> > > > that also
> > > > required? It was required for me at least in my code that adds a
> > > > branch
> > > > for
> > > > recording to a filesink.
> > >
> > > The version I have here is doing that in line 151/152/153 and
> > > that's
> > > also in the git repository. However it was not doing that inside
> > > pad_added_cb(), and that is indeed missing and must be added.
> >
> > Ah, gst_element_sync_state_with_parent should take care of that in
> > tick_cb, right? I was looking for an explicit call to
> > gst_element_set_state.
>
> Correct
>
> > > Without doing that it won't work all the time at least.
> > >
> > > > But as I said, I tried adding that to your example yet it didn't
> > > > solve the
> > > > black-screen issue for me.
> > >
> > > It works fine for me after doing the above, which is now also in
> > > the
> > > git repo. Are you maybe using any special decoder instead of the
> > > one of
> > > gst-libav?
> > >
> > > But I actually misread: I thought you were talking about the
> > > dynamic-
> > > filter.c example. That's the one where I get a green video if I
> > > reduce
> > > the timeout to one second.
> >
> > I'm just trying dynamic-tee-vsink with any mp4 file I have around,
> > all just show a black screen for me. Here's a debug log, note how the
>
> > state goes to PAUSED which would explain the black screen:
> I see you're using vaapisink and probably also the vaapi decoders.
> Please try again with some other sink and decoder, I wouldn't be
> surprised if the problem simply disappears then.
Indeed, removing gstreamer-vaapi to force a different decoder "helps", but
obviously that's not desired since using the hardware decoder should work just
fine (and does, when using it stand-alone).

> If so, please create an issue against gstreamer-vaapi for this.

Done: https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/issues/201
 
> The problem I was debugging in the filter example was this one here:
> https://gitlab.freedesktop.org/gstreamer/gstreamer/merge_requests/329


--
Milian Wolff | [hidden email] | Senior Software Engineer
KDAB (Deutschland) GmbH, a KDAB Group company
Tel: +49-30-521325470
KDAB - The Qt, C++ and OpenGL Experts
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: dynamic stream recording

Sebastian Dröge-3
On Mon, 2019-12-02 at 15:16 +0100, Milian Wolff wrote:
>
> Indeed, removing gstreamer-vaapi to force a different decoder
> "helps", but obviously that's not desired since using the hardware
> decoder should work just fine (and does, when using it stand-alone).

Yeah, it needs to be fixed. It's a common problem with gstreamer-vaapi
that it doesn't work whenever you try to do something more complicated
with it.

> > If so, please create an issue against gstreamer-vaapi for this.
>
> Done:
> https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/issues/201

Thanks!

--
Sebastian Dröge, Centricular Ltd · https://www.centricular.com


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (981 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: dynamic stream recording

gotsring
In reply to this post by Milian Wolff
It's been a while, but do you happen to have code for a working example that
you'd be willing to share?

I have created a program based off of the same blog post (kudos to Sebastian
Dröge) that dynamically links/unlinks a recording branch. It mostly works,
but it fails every now and then when unlinking, and there are some other
workarounds that I think might be unnecessary, like offsetting the timestamp
for new recording files so files start at time 0.



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel