Crop decoded data intensively

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

Crop decoded data intensively

llama
Hello,

I need advise in such scenario.
I got rtspsrc stream mainly like this :

rtspsrc - > .... -> videocrop -> .... -> flvmux ->.... rtmpsink
alsasrc-> ...............-> faac ->............----^

Rtspsrc  fps=25/1.
And i need to change for my reason videocrop properties for every processed frame - 25 times per second.  
I need that to preserve correct timestamp  even if i change caps for videocrop so that it does not affect other stream branches to synchronize on sync.

As i had no experience on changing caps so intensively, maybe someone knows what result i could get and what may occur. Do  i have to change stream playing state to stop and that to play or i can change tham on a fly ? Is there possible some choppy video playback ?

Any thoughts or advise is welcome!

Thanks in advance!

 
Reply | Threaded
Open this post in threaded view
|

Re: Crop decoded data intensively

llama
After a while of googling i found out that i will have to block videocrop pads close to this way :

gst_pad_set_blocked (pad, TRUE);
 g_object_set (videocrop, "left", hcrop, "top", vcrop, NULL);
gst_pad_set_blocked (pad, FALSE);

So, if that is the only way to change cropping region, how it affects buffer timestamps. Damage ?!
If it brakes correct timestamps, is it possible to preserve timestamp before crop and add to buffer before pushing on src pad ?  
Reply | Threaded
Open this post in threaded view
|

Re: Crop decoded data intensively

Nicolas Dufresne-5
Le vendredi 07 avril 2017 à 09:16 -0700, LC a écrit :
> After a while of googling i found out that i will have to block
> videocrop
> pads close to this way : 
>
> gst_pad_set_blocked (pad, TRUE);
>  g_object_set (videocrop, "left", hcrop, "top", vcrop, NULL);
> gst_pad_set_blocked (pad, FALSE);

This is GStreamer 0.10 API, which is not supported anymore. In 1.0+ you
should use a probe. In this case, a data probe is sufficient, you can
safely change the properties in the probe callback as long as you don't
have a queue (or anything with a thread) between the pad you probe and
the videocrop element. Make sure to maintain the same output size if
you care about performance.

Changing the crop region has no impact on the timestamp.

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

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

Re: Crop decoded data intensively

llama
Ahh,

Based on 0.1 sample i understood that if i need to change element properties i block the sink pad.
But if i use 1.0 supported callbacks, than do i have to use data callback, because i need to change crop properties possibly to each frame ?
Reply | Threaded
Open this post in threaded view
|

Re: Crop decoded data intensively

Arjen Veenhuizen
If your crop dimensions change every frame (and need to be frame-accurate), then this can be difficult. See also my post from a while back.