[gst-devel] video analysis tool

alberto colombo albx79 at gmail.com
Wed Aug 23 19:42:33 CEST 2006


hello

I'm working on a computer vision project and I need to build a video
analysis tool. For the moment, I will have to to a simple mean-shift
tracker, however it's going to expand a lot.

Anyway, I decided to use gstreamer (both because it looks the right tool
and because I was advised so by people from vlc-devel!). Basically, what
I need to do is open an avi or mpeg file (for now, but possibly a live
stream in the future), step through each frame, do my analysis on the
image and paint the output over the frame.

My first attempt was to use playbin to do all the dirty stuff, and then
send "seek" events to step frame by frame:

void MainWindow::on_button_next_frame_clicked()
{
    ...
    gst_element_seek(play, 1.0, GST_FORMAT_DEFAULT, 
                 GstSeekFlags(GST_SEEK_FLAG_FLUSH|
GST_SEEK_FLAG_ACCURATE),
                 GST_SEEK_TYPE_SET, pos+1,
                 GST_SEEK_TYPE_NONE, -1 );
}

However, this code doesn't work: the video position does not change. So
I tried with

void MainWindow::on_button_next_frame_clicked()
{
    ...
    gst_element_seek(play, 1.0, GST_FORMAT_TIME, 
                     GstSeekFlags(GST_SEEK_FLAG_FLUSH|
GST_SEEK_FLAG_ACCURATE),
                     GST_SEEK_TYPE_SET, pos+1000*1000*1000/25,
                     GST_SEEK_TYPE_NONE, -1 );
}

But it seeks too fast: every click advances by about 1/12 seconds,
instead of 1/25. (By the way, doing a non-flushing seek hangs the
application, looks like a deadlock because the CPU is 0%).

Can anyone explain why? Most important, is this the right approach to
the problem, or shall I write a plugin and put it somewhere between the
decoding and the displaying elements?

Thank you very much
alberto
-- 
ICQ#: 319420338





More information about the gstreamer-devel mailing list