W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2015

Re: [whatwg] VIDEO and pitchAdjustment

From: Yay295 <yay295@gmail.com>
Date: Thu, 27 Aug 2015 14:30:43 -0600
Message-ID: <CAH+HUia+qDA31zoZEuv5Yf44s5Wb-n_Pn2XKj4LHDVppkdoByQ@mail.gmail.com>
To: Garrett Smith <dhtmlkitchen@gmail.com>
Cc: WHAT Working Group <whatwg@lists.whatwg.org>
On Thu, Aug 27, 2015 at 12:02 PM, Garrett Smith <dhtmlkitchen@gmail.com>
wrote:

> Negative playbackRate, to watch videos backwards, currently crashes
> Safari 8; Firefox 40 says "not implemented". I think it would be
> entertaining for example, to watch things like cars uncrashing. Should
> this work? And if so, shouldn't audio match the video speed for
> backwards playing? I think "yes, and yes."
>

It would be much easier to re-encode the videos in reverse and provide two
versions of the video. Videos are made to be played in one direction, and
they use this assumption to improve their compression efficiency.
Basically, videos have two different types of frames; let's call them Full
frames and Partial frames. A Full frame contains all of the information
that a stand-alone image would have. If a video had only a single Full
frame, it would be able to display that image and show it for the length of
the video (incidentally, this is what a WebP image is). Partial frames, on
the other hand, do NOT have enough information to produce a full image.
They merely contain the information representing the difference between the
previous frame and the current frame. This obviously saves a lot of space
if the frames are similar. A video will contain a mixture of Full frames
and Partial frames, with many more Partial frames than Full frames (ex. 1
Full frame followed by 10 seconds of Partial frames (~240 partial frames)).
What this means is that when you play a video in the proper direction, it
must first decode a Full frame, but then it only has to decode Partial
frames (until the next Full frame). However, if you try to play a video in
reverse, it must decode a Full frame and ALL of the Partial frames up to
the current frame before it can display the current frame. To display the
frame before that, it must decode all of those frames again, and so on for
every frame of the video. You could of course store the decoded frames in
memory, but that will take a lot of space. 240 uncompressed frames at 720p
is over half a gigabyte of information. It's just not practical.
Received on Thursday, 27 August 2015 20:31:11 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:34 UTC