LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Playing the video in Reverse

Solved!
Go to solution

Hi Everyone,

      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.

 

Thanks

Elancheran

"Timshel"
Download All
0 Kudos
Message 1 of 4
(2,371 Views)

Hi Elancheran,

 

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 4
(2,343 Views)
Solution
Accepted by Elancheran55

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).

 

Bob Schor

Message 3 of 4
(2,319 Views)

Thank you both, I wrote the entire video in reverse and alternated between the videos according to the requirement

"Timshel"
0 Kudos
Message 4 of 4
(2,286 Views)