How to reuse pipeline to read different mp4 files. Few questions.

Антон Шаров sharov_am at mail.ru
Mon Aug 7 12:45:03 UTC 2023


Hi.
 
I have following  pipeline filesrc ! decodebin ! appsink
By some condition I need to exctract some frame (cond. for now is exact frame number):
(here is code sample on C#)
 
  var fileSrc = readerPipe.GetByName("filesrc");
   fileSrc["location"] = videoFile; // new file to read from
 
   var appSink = (AppSink) readerPipe.GetByName("my_appsink");
   readerPipe.SetName($"file {videoFile} frame_stepper");
   var q = readerPipe.SetState(State.Playing);
   var step = 1;
   while (step < frameNumber)
        {
            appSink.PullSample();
            step++;
        }
 
The questions:
*  It seems that it doesn’t matter what video file is set, it will always read from first setuped file. How to reset pipeline to read from new file? Should I create new pipeline or can I reset given pipeline so it can read from given file?
*  What is the best and fastest pipeline to read frame-by-frame from file ? Maybe the one above is not goot,  maybe playbin + appsink is better?
​​​​​​​Thanks in advance.
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20230807/ec667b80/attachment.htm>


More information about the gstreamer-devel mailing list