Buffering video file in memory

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

Buffering video file in memory

Mikl
Hello,

I have a "small" video files. About 30-50 Mb

It is my use case to seek back and forward around one of the frames multiply times. Like you are finding best focus using microscope. And then move to next frame to seek around it.

Pipeline is this 1 video and 4 subtitles:
video: filesrc ! matroskademux ! queue ! jpegdec ! videoconvert ! appsink
subtitles: filesrc ! matroskademux ! queue ! appsink

I see some delay, caused my hard disk IO operations. Because in our time even 100 Mb is not a big deal, i want to load it in a memory.

My question is:
Can i modify my pipeline so, it will buffer complete file in a memory (better on a fly when loading frames) and latter perform seek from a memory?

Otherwise, i need to make an internal buffer in my app.

Mikl
Reply | Threaded
Open this post in threaded view
|

Re: Buffering video file in memory

Sebastian Dröge-3
On Fri, 2016-11-04 at 01:55 -0700, Mikl wrote:

> Hello,
>
> I have a "small" video files. About 30-50 Mb
>
> It is my use case to seek back and forward around one of the frames multiply
> times. Like you are finding best focus using microscope. And then move to
> next frame to seek around it.
>
> Pipeline is this 1 video and 4 subtitles:
> video: filesrc ! matroskademux ! queue ! jpegdec ! videoconvert ! appsink
> subtitles: filesrc ! matroskademux ! queue ! appsink
>
> I see some delay, caused my hard disk IO operations. Because in our time
> even 100 Mb is not a big deal, i want to load it in a memory.
>
> My question is:
> *Can i modify my pipeline so, it will buffer complete file in a memory
> (better on a fly when loading frames) and latter perform seek from a
> memory?*
>
> Otherwise, i need to make an internal buffer in my app.
You could use the queue2 or downloadbuffer elements after the
filesrc. By either storing in memory, or using a file on e.g. a tmpfs.

--
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 (949 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Buffering video file in memory

Mikl

Hello, Sebastian


Thank you for reply.


As i understand, queue2 queue + downloadbuffer. Correct? So, i can use one or another with the same result?


How i should work with this elements?

If i just put any of this component in pipeline after filesrc, i can not make seek anymore. It is directly failed.


-Do i need to give him a time: change to PLAY and wait for "GstCacheDownloadComplete" on a bus?

-How to set limits: when i set max-size-time  to 0(0=disable, it is crashing.

-Do i need to set temp-template? Isn't it the same as buffering to file? I will not have same IO delay?


Best regards, Michael.