I am trying to play the video in reverse by decrementing the frame number in IMAQ Read Frame function. Its working but the result is very choppy as every frame takes significant time to load, but when I just increment the frame number and play the video forward, its executing without any problem. I have attached the VI and info regarding the video, could you guys please let me know why I am having problem when I am trying to display the video in the reverse order.
Solved! Go to Solution.
usually with any "modern" video compression algorithm (like MJPEG, H264/265, …) one frame is composed from previous frames data with information about changed image parts (to put it in simple words).
So when you move forward through your video its rather easy to go from one frame to the next: just apply the information of "changed parts" to the last frame data. But going backwards needs to get also information from previous frames to be able to decode the actual frame: because of added overhead you will be slower then when playing in the "correct" direction…
And building on what Gerd said, what you could do is to extract the Images in reverse (as you did) and use it to construct a second AVI, which would write the last frame, then a "compressed" frame related to the difference between the last and next to last frame, then another "compressed" frame, etc. [Note by "compressed", I mean "whatever magic is built into the AVI or other video format that lets it be optimized for one-way playback"]. Basically, you create a second "reverse" video one frame at a time (so creation is slow, but playback is fast).