How to control the position and playback speed of video in XNA format?

I am developing a game for Windows in C # using Visual Studio 2010 and XNA 4.0 . I would like to be able to set and change the playback position of the HD video, as well as play the video in reverse order, depending on user input.

It's hard for me to find where to start. The XNA class videoPlayer does not provide these types of functions. I read that XNA DirectShow is now outdated and slow when using HD video.

I don’t quite understand how I can use or implement tools like ffmpeg with my project. It seems that some people had similar questions and solutions were posted, but without any particular details. They are lower.

  • Interact with core DX functionality.

  • write a C ++ managed shell for ffmpeg interaction.

  • write mpeg decoder.

I'm not sure what would be better and where to start. Thanks!

+4
source share
1 answer

The VideoPlayer class has a "PlayPosition" property that you must play with.

Otherwise (and I don’t know how big your video file is and for how long) try a sequence of images and animate the current sequence of images and control it with user input. Of course, working with image sequences will lead to a very complex sound reversal (if there is sound), etc.

And last but not least, you can see if you can understand anything from this mpeg decoder here: https://www.box.com/shared/ojzfv0qzfx

Something else that might help with the mpeg extension: http://chrisa.wordpress.com/2007/11/21/decoding-mpeg2-information/

0
source

Source: https://habr.com/ru/post/1444019/


All Articles