How do I create a frame-by-frame video scrubber?

0 favourites
  • 2 posts
From the Asset Store
Selection frame like in RTS games, works both on mobile and desktop devices.
  • I am looking to create a video scrubber in Construct 3 that can load a very short (1 or 2 second long) video then scrub through the video frame-by-frame. So far I am able to do the following:

    1. Load a video to the Video Plugin using the File Chooser plugin.

    2. Play the video immediately upon load.

    When I add events to set the playback time, it seems to seek to a random time in the future, usually 2 seconds or so, rather than incrementing a single frame at a time.

    Is Video.setPlaybackTime() not accurate enough to advance a single frame?

    ALTERNATIVE APPROACH

    If the approach above doesn't work, does anyone know if there is a way to save the frames of an encoded video to a bunch of sprite frames completely client-side? I know this can be done on a server in php or Node.js, but I don't want to bog down my server with a bunch of video conversion requests.

    I also don't want to go to Unity3d to write code for this.

    Thank you so much for your help!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Eureka! I have tried 3 approaches. The last two both work correctly:

    Non-working approach: try to seek to a time, then play a video frame, pausing at that frame.

    I'm assuming that the reason this approach doesn't work it that due to the way video encoding works it is impossible to seek to an individual frame.

    Working Approach #1 - Snapshot live camera feed by capturing a frame every 0.1 seconds from UserMedia.takeSnapshot() action. Save this to a frame in a sprite.

    Working Approach #2 - Snapshot a video from the Camera Roll by playing a video with the video object and taking a System.snapshot() every 0.1 seconds. Save this snapshot to a frame in a sprite.

    Please note that Working Approaches #1 and #2 above only run properly if your device can save the snapshots quickly enough. This works great on my phone and iPad, but doesn't work at all on my 2013 Macbook Air.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)