Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamically increasing/decreasing speed of a video in a windows forms application

I'm building a Windows Forms application in VS 2010 that smoothly increases or decreases the speed of a video playing back based on the speed of the user input.

I've tried several avenues..

1.) Using the AudioVideoPlayback DirectX class - I set the speed of the video, by setting the current position of the video, based on a timer.. and increased or decreased that value based on user input. While this worked on my PC, it lags a lot on our lower end target PC's. Can anyone think of a more efficient way to increase/decrease the speed of playback using this class?

2.) I've tried the Windows Media Player ActiveX control, and tried setting the rate/position dynamically, but this is extremely jumpy and laggy even on my development PC

3.) I've tried the Apple QuickTime Control 2.0 COM Component that comes with VS 2010, and it's also very laggy.

4.) I'm trying to figure out how to set the speed on the Shockwave Flash Object control, but haven't found that out yet

Can anyone suggest other avenues to explore? I just need to be able to increase/decrease the speed of video playback smoothly based on user input without lag. I don't care what format the video needs to be in, all videos can be converted to the required format.

Any help/ideas will be appreciated.

Thanks

like image 472
Greg Quinn Avatar asked Nov 13 '22 03:11

Greg Quinn


1 Answers

The ultimate way is to decode the Bitmaps from videos, and handle the frames yourself.

Try the CaptureNET example from DirectShow.NET. It allows you to capture bitmaps from each frame. After that, write your own playback control to handle the refresh rate.

like image 52
ncite Avatar answered Dec 25 '22 22:12

ncite