The following pipeline works fine (you can see the time overlay increment over the image):
gst-launch-1.0 filesrc location = Toddy_Dog.jpg ! jpegdec ! imagefreeze ! video/x-raw,framerate=25/1 ! queue leaky=0 ! timeoverlay ! videoconvert ! ximagesink However if the queue is set to leak (leaky=2 for example), then the time overlay remains static (sometimes at 0, sometimes slightly above 0). gst-launch-1.0 filesrc location = Toddy_Dog.jpg ! jpegdec ! imagefreeze ! video/x-raw,framerate=25/1 ! queue leaky=2 ! timeoverlay ! videoconvert ! ximagesink If I set the ximagesink to not synch to the clock then it runs (the time overlay increments very fast though, and jumps a lot of values) gst-launch-1.0 filesrc location = Toddy_Dog.jpg ! jpegdec ! imagefreeze ! video/x-raw,framerate=25/1 ! queue leaky=2 ! timeoverlay ! videoconvert ! ximagesink sync=0 By setting the debug levels I can see that the problem is the imagefreeze increment the timestamp way too fast (it moves in increments corresponding to the fps, but it is not following the clock). It seems to me that it tries to push buffers as fast as it can, incrementing the timestamp by the fps interval each time, and since the queue leaks it manages to do it way faster than it should... leaky=2 0:00:02.896600487 1127 0x7f5d80002b70 DEBUG imagefreeze gstimagefreeze.c:799:gst_image_freeze_src_loop:<imagefreeze0:src> Pushing buffer resulted in ok 0:00:02.896627831 1127 0x7f5d80002b70 DEBUG imagefreeze gstimagefreeze.c:789:gst_image_freeze_src_loop:<imagefreeze0:src> Handling buffer with timestamp 0:05:31.240000000 0:00:02.896668265 1127 0x7f5d80002b70 LOG queue gstqueue.c:633:apply_buffer:<queue0> src position updated to 0:05:31.000000000 0:00:02.896695127 1127 0x7f5d80002b70 LOG queue gstqueue.c:538:update_time_level:<queue0> update src time 0:00:02.896713673 1127 0x7f5d80002b70 LOG queue gstqueue.c:547:update_time_level:<queue0> sink +0:05:31.240000000, src +0:05:31.000000000 0:00:02.896743225 1127 0x7f5d80002b70 LOG queue gstqueue.c:633:apply_buffer:<queue0> sink position updated to 0:05:31.280000000 0:00:02.896773253 1127 0x7f5d80002b70 LOG queue gstqueue.c:529:update_time_level:<queue0> update sink time 0:00:02.896791620 1127 0x7f5d80002b70 LOG queue gstqueue.c:547:update_time_level:<queue0> sink +0:05:31.280000000, src +0:05:31.000000000 0:00:02.896826545 1127 0x7f5d80002b70 DEBUG imagefreeze gstimagefreeze.c:799:gst_image_freeze_src_loop:<imagefreeze0:src> Pushing buffer resulted in ok 0:00:02.896852845 1127 0x7f5d80002b70 DEBUG imagefreeze gstimagefreeze.c:789:gst_image_freeze_src_loop:<imagefreeze0:src> Handling buffer with timestamp 0:05:31.280000000 0:00:02.896884538 1127 0x7f5d80002b70 LOG queue gstqueue.c:633:apply_buffer:<queue0> src position updated to 0:05:31.040000000 0:00:02.896920127 1127 0x7f5d80002b70 LOG queue gstqueue.c:538:update_time_level:<queue0> update src time 0:00:02.896938885 1127 0x7f5d80002b70 LOG queue gstqueue.c:547:update_time_level:<queue0> sink +0:05:31.280000000, src +0:05:31.040000000 0:00:02.896968525 1127 0x7f5d80002b70 LOG queue gstqueue.c:633:apply_buffer:<queue0> sink position updated to 0:05:31.320000000 0:00:02.896998602 1127 0x7f5d80002b70 LOG queue gstqueue.c:529:update_time_level:<queue0> update sink time 0:00:02.897017500 1127 0x7f5d80002b70 LOG queue gstqueue.c:547:update_time_level:<queue0> sink +0:05:31.320000000, src +0:05:31.040000000 0:00:02.897048260 1127 0x7f5d80002b70 DEBUG imagefreeze gstimagefreeze.c:799:gst_image_freeze_src_loop:<imagefreeze0:src> Pushing buffer resulted in ok 0:00:02.897078787 1127 0x7f5d80002b70 DEBUG imagefreeze gstimagefreeze.c:789:gst_image_freeze_src_loop:<imagefreeze0:src> Handling buffer with timestamp 0:05:31.320000000 0:00:02.897111776 1127 0x7f5d80002b70 LOG queue gstqueue.c:633:apply_buffer:<queue0> src position updated to 0:05:31.080000000 0:00:02.897143436 1127 0x7f5d80002b70 LOG queue gstqueue.c:538:update_time_level:<queue0> update src time 0:00:02.897162355 1127 0x7f5d80002b70 LOG queue gstqueue.c:547:update_time_level:<queue0> sink +0:05:31.320000000, src +0:05:31.080000000 0:00:02.897191707 1127 0x7f5d80002b70 LOG queue gstqueue.c:633:apply_buffer:<queue0> sink position updated to 0:05:31.360000000 0:00:02.897216889 1127 0x7f5d80002b70 LOG queue gstqueue.c:529:update_time_level:<queue0> update sink time 0:00:02.897239100 1127 0x7f5d80002b70 LOG queue gstqueue.c:547:update_time_level:<queue0> sink +0:05:31.360000000, src +0:05:31.080000000 leaky=0 0:00:02.431847454 1151 0x7f1b28002b70 DEBUG imagefreeze gstimagefreeze.c:799:gst_image_freeze_src_loop:<imagefreeze0:src> Pushing buffer resulted in ok 0:00:02.431942959 1151 0x7f1b28002b70 DEBUG imagefreeze gstimagefreeze.c:789:gst_image_freeze_src_loop:<imagefreeze0:src> Handling buffer with timestamp 0:00:02.160000000 0:00:02.435804127 1151 0x6d1140 LOG queue gstqueue.c:633:apply_buffer:<queue0> src position updated to 0:00:01.920000000 0:00:02.435882275 1151 0x6d1140 LOG queue gstqueue.c:538:update_time_level:<queue0> update src time 0:00:02.435904795 1151 0x6d1140 LOG queue gstqueue.c:547:update_time_level:<queue0> sink +0:00:02.160000000, src +0:00:01.920000000 0:00:02.436187015 1151 0x7f1b28002b70 LOG queue gstqueue.c:633:apply_buffer:<queue0> sink position updated to 0:00:02.200000000 0:00:02.436256229 1151 0x7f1b28002b70 LOG queue gstqueue.c:529:update_time_level:<queue0> update sink time 0:00:02.436286151 1151 0x7f1b28002b70 LOG queue gstqueue.c:547:update_time_level:<queue0> sink +0:00:02.200000000, src +0:00:01.920000000 0:00:02.436348700 1151 0x7f1b28002b70 DEBUG imagefreeze gstimagefreeze.c:799:gst_image_freeze_src_loop:<imagefreeze0:src> Pushing buffer resulted in ok 0:00:02.436399989 1151 0x7f1b28002b70 DEBUG imagefreeze gstimagefreeze.c:789:gst_image_freeze_src_loop:<imagefreeze0:src> Handling buffer with timestamp 0:00:02.200000000 0:00:02.440459636 1151 0x6d1140 LOG queue gstqueue.c:633:apply_buffer:<queue0> src position updated to 0:00:01.960000000 0:00:02.440537181 1151 0x6d1140 LOG queue gstqueue.c:538:update_time_level:<queue0> update src time 0:00:02.440555883 1151 0x6d1140 LOG queue gstqueue.c:547:update_time_level:<queue0> sink +0:00:02.200000000, src +0:00:01.960000000 0:00:02.440641952 1151 0x7f1b28002b70 LOG queue gstqueue.c:633:apply_buffer:<queue0> sink position updated to 0:00:02.240000000 0:00:02.440710638 1151 0x7f1b28002b70 LOG queue gstqueue.c:529:update_time_level:<queue0> update sink time 0:00:02.440740579 1151 0x7f1b28002b70 LOG queue gstqueue.c:547:update_time_level:<queue0> sink +0:00:02.240000000, src +0:00:01.960000000 0:00:02.440802398 1151 0x7f1b28002b70 DEBUG imagefreeze gstimagefreeze.c:799:gst_image_freeze_src_loop:<imagefreeze0:src> Pushing buffer resulted in ok 0:00:02.440850154 1151 0x7f1b28002b70 DEBUG imagefreeze gstimagefreeze.c:789:gst_image_freeze_src_loop:<imagefreeze0:src> Handling buffer with timestamp 0:00:02.240000000 0:00:02.444847291 1151 0x6d1140 LOG queue gstqueue.c:633:apply_buffer:<queue0> src position updated to 0:00:02.000000000 0:00:02.444959686 1151 0x6d1140 LOG queue gstqueue.c:538:update_time_level:<queue0> update src time 0:00:02.444983815 1151 0x6d1140 LOG queue gstqueue.c:547:update_time_level:<queue0> sink +0:00:02.240000000, src +0:00:02.000000000 0:00:02.445285033 1151 0x7f1b28002b70 LOG queue gstqueue.c:633:apply_buffer:<queue0> sink position updated to 0:00:02.280000000 0:00:02.445393011 1151 0x7f1b28002b70 LOG queue gstqueue.c:529:update_time_level:<queue0> update sink time 0:00:02.445426857 1151 0x7f1b28002b70 LOG queue gstqueue.c:547:update_time_level:<queue0> sink +0:00:02.280000000, src +0:00:02.000000000 Am I missing something or is this a bug? |
On Do, 2016-06-09 at 00:10 -0700, mariannasb wrote:
> > By setting the debug levels I can see that the problem is the imagefreeze > increment the timestamp way too fast (it moves in increments corresponding > to the fps, but it is not following the clock). > It seems to me that it tries to push buffers as fast as it can, incrementing > the timestamp by the fps interval each time, and since the queue leaks it > manages to do it way faster than it should... That's exactly the problem and how it is intended to work. If you need the input stream to be produced in real-time, you could add an identity element with sync=true before the leaky queue. leaky queues will generally only work in a meaningful way with live input. -- 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 |
Yes, I'm aware the example pipeline didn't make much sense (queue after imagefreeze).
The real pipeline I'm using is a lot more complex and uses the videomixer (which is quite dependent on the timestamps) so I was trying to break the problem down. Using an identity with synch=1 gives the expected result in this example, I will try a similar approach to my real problem and see if there is any progress. Thank you |
Free forum by Nabble | Edit this page |