Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to play HTML5 video in reverse?

Can HTML5 <video> tag be played in reverse, or do I have to download 2 videos (forward and backward play)?

I'm looking for a solution that avoids a user from downloading 2 videos.

like image 900
Ish Avatar asked Mar 11 '11 19:03

Ish


People also ask

Is it possible to play video reverse?

Reverse video – here's how!Open Movie Studio and import your video. Open the Effects tab in the Media Pool and click on the video effect "Speed". Click on the "Reversed" button in the effects dialog. If you only want to play a section of the video in reverse, cut it to create a clip.

Can we play video in HTML5?

With the introduction of HTML5, you can now place videos directly into the page itself. This makes it possible to have videos play on pages that are designed for mobile devices, as plugins like Adobe Flash Player don't work on Android or iOS. The HTML <video> element is used to embed video in web documents.


2 Answers

Without even going into HTML5 or Javascript, many video formats are streaming formats that are designed to be played forward. Playing it backwards would require decoding the whole stream, storing each raw frame on the disk to avoid clobbering memory, then rendering the frames backwards.

At least one person actually tried that using mplayer, though, so it can be done, at least in principle.

like image 198
Frédéric Hamidi Avatar answered Sep 18 '22 15:09

Frédéric Hamidi


I managed to do it in an update method. Every frame I decrease video.currentTime to the time elapsed and so far it is the best result I managed to get.

like image 28
BaptisteB Avatar answered Sep 20 '22 15:09

BaptisteB