How to change frame rate of the stream?

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

How to change frame rate of the stream?

sonntex
Input stream has 30 frames per 1 second fps. I want to discard 29 of 30 frames each second. How can I do that?

Pipe looks like:

std::string pipeline =
    "  appsrc name=src0 "
    "! vaapiparse_h264 "
    "! vaapidecode name=decoder0 "
    "! videorate "
    "!   video/x-raw,framerate=1/1 "
    "! videoscale "
    "!   video/x-raw,width=640,height=480 "
    "! vaapiencode_h264 name=encoder0 bitrate=512 keyframe-period=1 "
    "!   video/x-h264,profile=high,stream-format=avc,alignment=au "
    "! vaapiparse_h264 "
    "!   video/x-h264,alignment=nal "
    "! appsink name=sink0";

It makes my video stream slower in 30 times and does not discard frames as I want.

_______________________________________________
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 change frame rate of the stream?

Sebastian Dröge-3
On Fr, 2016-06-03 at 19:41 +0300, sonntex wrote:

> Input stream has 30 frames per 1 second fps. I want to discard 29 of
> 30 frames each second. How can I do that?
>
> Pipe looks like:
>
> std::string pipeline =
>     "  appsrc name=src0 "
>     "! vaapiparse_h264 "
>     "! vaapidecode name=decoder0 "
>     "! videorate "
>     "!   video/x-raw,framerate=1/1 "
>     "! videoscale "
>     "!   video/x-raw,width=640,height=480 "
>     "! vaapiencode_h264 name=encoder0 bitrate=512 keyframe-period=1 "
>     "!   video/x-h264,profile=high,stream-format=avc,alignment=au "
>     "! vaapiparse_h264 "
>     "!   video/x-h264,alignment=nal "
>     "! appsink name=sink0";
>
> It makes my video stream slower in 30 times and does not discard
> frames as I want.
If you have a framerate of 30/1 before the videorate (enforce with a
capsfilter to be sure), then after the videorate you should have 1/1
and all other frames should be dropped.

Which version of GStreamer and gstreamer-vaapi is this? Can you try
with the latest? Also please try if the problem still exists when
replacing the vaapi elements with software based ones.


If all that does not help, please try to provide an as simple as
possible testcase for reproducing this problem.

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

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

Re: How to change frame rate of the stream?

sonntex
In reply to this post by sonntex
> Which version of GStreamer and gstreamer-vaapi is this?

I use gentoo and gstreamer 1.8.1_pre from poly-c overlay and gst-plugins-vaapi 0.7.0 from gentoo official portage.

sonntex@work ~ $ eix -I gst-plugins-vaapi
[I] media-plugins/gst-plugins-vaapi
     Available versions:  (1.0) ~0.6.1 0.7.0
       {+X +drm opengl wayland ABI_MIPS="n32 n64 o32" ABI_PPC="32 64" ABI_S390="32 64" ABI_X86="32 64 x32"}
     Installed versions:  0.7.0(1.0)(10:36:37 PM 04/21/2016)(drm -X -opengl -wayland ABI_MIPS="-n32 -n64 -o32" ABI_PPC="-32 -64" ABI_S390="-32 -64" ABI_X86="64 -32 -x32")
     Homepage:            https://github.com/01org/gstreamer-vaapi
     Description:         Hardware accelerated video decoding through VA-API plugin

sonntex@work ~ $ eix -I gstreamer
[I] media-libs/gstreamer
     Available versions: 
     (0.10) 0.10.36-r2
     (1.0)  1.4.5 1.6.3 ~1.8.0_pre^m[1] (~)1.8.1_pre^m[1]
       {+caps +introspection nls +orc test ABI_MIPS="n32 n64 o32" ABI_PPC="32 64" ABI_S390="32 64" ABI_X86="32 64 x32"}
     Installed versions:  1.8.1_pre(1.0)^m[1](08:54:03 PM 04/21/2016)(caps introspection nls orc -test ABI_MIPS="-n32 -n64 -o32" ABI_PPC="-32 -64" ABI_S390="-32 -64" ABI_X86="64 -32 -x32")
     Homepage:            http://gstreamer.freedesktop.org/
     Description:         Open source multimedia framework

[1] "poly-c" /var/lib/layman/poly-c
sonntex@work ~ $

> Can you try with the latest?

Or do you mean that I have to test this problem on the latest master of gst-plugins-vaapi?

> Also please try if the problem still exists when replacing the vaapi elements with software based ones.

Yes, all work good with software based elements.

Pipe looks like:

std::string pipeline =
  "  appsrc name=src0 "
  "! h264parse "
  "! avdec_h264 name=decoder0 "
  "! videorate "
  "!   video/x-raw,framerate=1/1 "
  "! videoscale "
  "!   video/x-raw,width=640,height=480 "
  "! x264enc name=encoder0 bitrate=512 keyframe-period=1 "
  "!   video/x-h264,profile=high,stream-format=avc,alignment=au "
  "! h264parse "
  "!   video/x-h264,alignment=nal "
  "! appsink name=sink0";

_______________________________________________
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 change frame rate of the stream?

sonntex
In reply to this post by sonntex
I found that gst-plugins-vaapi works good if stream from the camera does not have b-frames.

_______________________________________________
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 change frame rate of the stream?

Sebastian Dröge-3
In reply to this post by sonntex
On Mo, 2016-06-06 at 14:26 +0300, sonntex wrote:
> work good with software based elements.

Please try again with gstreamer-vaapi 1.8 and if the problem still
exists please report a bug here:
https://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer&component=gstreamer-vaapi

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (968 bytes) Download Attachment