I have a pipeline that decodes from a 4K 25fps mp4 file. I would like to increase playback speed like 2x. I have achieved this by using ‘videorate rate’ element. But as far as I understand it is dropping frames to adjust speed. I have no experience and technical background about this topic so I am just wondering If I can decode 50 fps - decoding original frames not duplicating or dropping - from a 25 fps video source since I have the video file recorded. Or do I need to use interpolation to achieve it. If that is the case how can I do that in gstreamer.
For playback purpose, its best to use a seek event with the desired rate.
If you do need to change the rate faster, consider using instant rate switching, which is a relatively new mode. Following this tutorial, use the seek flag
GST_SEEK_FLAG_INSTANT_RATE_CHANGE. When this complete, you will be able to adjust the rate by sending instant rate event (see gst_event_new_instant_rate_change_request() which can be sent just like seek event assuming you have setup the right trick mode).
Thank you very much for your answer.
I could make it work with the tutorial you have provided. But I would like to ask some questions. I am new to gstreamer and cannot understand the documentation exactly.
- How instant rate changing is different?
- How does changing playback speed with seek event works exactly. I am not sure if it speeds the whole pipeline using original frames or is it skipping frames or dropping frames, what is under the hood?
Thank you for your time.
I understand now.
Thank you very much I appreciate your help.