how to timestamp GstBuffer feeding to appsrc correctly to match GstGLVideoMixer needs

comicfans44 comicfans44 at gmail.com
Tue Aug 12 20:58:47 PDT 2014


I'm facing some problems when using 2+ appsrc and GstGLVideoMixer

my workflow use gstreamer to display frames, but the data rate is
neither deterministic nor stable, so I hope to configure pipeline
as "a. sink redisplay as early as possible" and "b. never drop frame ".
 seems sink.sync=false gives a sink.qos=false gives b, 
I also set appsrc caps to very high FPS but only push buffers at low rate.
appsrc.stream-type=GST_APP_STREAM_TYPE_STREAM  basesrc.do_timestamp=true
basesrc.is-live=true

if only one appsrc in pipeline, everything seems worked, the queue in 
appsrc
is empty almost all the time (check with 
gst_app_src_get_current_level_bytes)

but if more than one appsrc in pipeline,glvideomixer seems always sync by 
the slower appsrc buffer, leads the quicker appsrc queue quickly exploded .

I also tried to push data the same FPS as appsrc caps(use g_timeout_add 
callback ), found that if two appsrc have same FPS, worked (no queue 
explod),
if two appsrc have different FPS, higher fps appsrc queue still explod

as compare, 
videotestsrc ! fps=10 ! glvideomixer ! glimagesink videotestsrc ! fps=50 ! 
mixer. 
seems OK. (I also set different xpos,ypos to view the result)

so I came to the question:
1. how does the GstBaseSrc loop push wait until the next frame time ?
   does this happen in gst_base_src_do_sync->gst_base_src_wait
   ->gst_clock_id_wait route ? 

2. how  GstBaseSrc determine the waiting time to next call 
   basesr_class->create ? how can I lower it , or can it be  
   "as quickly as next buffer arrived"?
   
3. are appsrc and videotestsrc both worked as push mode source ? why appsrc
   pipeline queue exploded ? is the difference between g_timeout_add and 
   gst_clock_id_wait  , or basesrc.do-timestamp vs videotestsrc's 
timestamp?

4. different fps videotestsrc demo worked, I guess GstVideoAggregator keeps 
   lower fps buffer but refresh at highest fps buffer update, but how could 
I
   timestamp my buffer correctly to meet GstVideoAggregator needs ?

5. could the GstVideoAggregator implements  "sync" and "qos" property just 
   like sink ? makes it can refresh as quickly as possible and never drop ?
   if this is not GstVideoAggregator maked for, how could I extend it to 
   achive this goal ?

Thanks




More information about the gstreamer-devel mailing list