Skip to content

Instantly share code, notes, and snippets.

@noseglid
Created April 30, 2015 08:43
Show Gist options
  • Save noseglid/97fa984ffa5fc6af2959 to your computer and use it in GitHub Desktop.
Save noseglid/97fa984ffa5fc6af2959 to your computer and use it in GitHub Desktop.
Fast forward using Locomote

A simple and effective way to achieve fast forward using the Locomote Video Player would be to modify timestamps before inserting them into the buffer. It can fairly easy be tested by adding the line

ts /= 2;

at row 345 in src/com/axis/rtspclient/FLVMux.as. This would play back the video twice the normal speed.

This is achieved by simply putting the timestamps closer together (above, each timestamp is divided by 2, hence that frame come in half the time it would at normal playback speed).

Some considerations:

  • While this work well for fast forward, it is unclear how it works for playing backwards. Locomote is at the mercy of the internal buffer of flash to achieve backwards playback (at any speed). This has not been tested.
  • Since the playback speed is set when adding the frame to the buffer, it may not change the playback speed instantaneously (depending on buffer time) when it is altered. To mitigate this, there may be a need for an internal buffer in the Locomote player. When playback speed changes, Locomote could clear the current flash buffer and use it internal buffer to put all those frames in again with timestamps matching the new playback speed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment