This question already has answers here:
Is it possible to play HTML5 video in reverse?
(6 answers)
Closed 10 days ago.
I want to reverse the video once it is played and play again in reverse.
I have tried using playbackrate as -1. But it is not working , the playback rate value -1 is not supported.
Playing a video in reverse is non-trivial in general, because many codecs rely on information from previous frames (when playing forward) to decode the current frame; when playing in reverse they'd need to seek around to find the required information.
You'd be better off making a version of the video that is a ping-pong loop by itself (i.e. one copy of the video in forward and one in reverse), and just loop that.
Related
I've noticed that this is a common problem. I know there are similar question like mine but i haven't found an answer yet.
My problem is that i want to loop a video but every time it loops it stutters, freezes about half a second at the beginning of each loop. The video is short, about 6 seconds.
I wonder if this can be done with JavaScript.
I had the same problem. .mp4 was pausing on frame 1 for a few frames then the loop continued. I removed the audio track of the .mp4 during encoding. It worked seamlessly after that. Even though I had 'muted' set, it did not play smoothly until the audio track was removed altogether.
For example, for YouTube videos I can get the current volume value with
localStorage["yt-player-volume"]
But, is there a way to determine how loud (the loudness that I actually hear) the sound playing is in a web browser via JavaScript?
I have limited knowledge on JS/JQuery but I am wondering if you can detect the end of a HTML5 video and then Play the video in reverse and then play it from the start so basically an endless loop playing forwards and then backwards?
Using JQuery/Javascript
Streaming video codecs are optimised to be played forward so, while there is a playbackRate property of HTML5 video which you might be able to use to reverse the playback of your video (try setting it to -1), the result is probably not going to be particularly satisfactory.
A better approach would be to create an additional video at the encoding stage which runs in reverse. You could then use the video's ended event to toggle the source back and forward between the forward and reversed videos.
Or as Ken, has helpfully suggested in the comments, create a single video in which the sequence is played forward and then in reverse. You can then set the video to loop and you've got what you're after.
Just for your reference, the w3 have quite a handy example which allows you to explore in real time the various methods, properties and events available in HTML5 video.
When I'm doing a seekTo on a video I get a quick flash of some frames preceding the actual time I'm seeking to. Even if the video was paused prior to seek operation. It doesn't look smooth, to say at least. Is there a way to avoid such behavior? Can't it simply instantly jump to a time specified in seekTo()?
Ok, there is the way - make more key frames per second. And if you are working with a series of small clips combined into one YouTube video, put big gaps between them (2 second long each, at least).
Is there a way to change the playback speed of audio in the browser? What is best to accomplish this task, html5 audio, or flash, or something else? Are there any specific libraries that would help with this?
Use the Web Audio API.
In the following code I answered your other question.
best way to loop audio in the browser?
Modify the code in my answer above as follows for a playback speed example.
Right below
source.loop = loopOnOff;
add
source.playbackRate.value = 1; // change number to between 0.10 to 10 (or larger/smaller) to test.
You can also run the html audio tag through the web audio api and add effects processing.
Interesting question there,
HTMl5 will have player speed control will have speed control..
A couple of noteworthy upcoming features are playbackRate and defaultPlaybackRate. As you can probably imagine, these fellas let us alter the speed and direction of playback. This functionality could be used for fast-forward and rewind functions or perhaps to allow users to tweak the playback speed so they can fit more podcasts into their day.
audio.playbackRate returns 1 at normal speed and acts as a multiple that is applied to the rate of playback. For example, setting playbackRate to 2 would double the speed, while setting it to -1 would play the media backwards.
audio.defaultPlaybackRate is the rate at which the audio will play after you pause and restart the media (or issue any event for that matter).
Flash Player may help( but it will be customized one you may create, with stream buffer, you need to define the player speed once buffer has the content to play.
Sound easy but will take a lot effort,
Refer VLC opesource for better Idea, its documented with ffmpeg which works with Audio,
and works with client software, in browser ti will be heavy, refer Just to have idea.
I hope this may help :)