MP4 to APNG Converter

Loads an uploaded MP4 into a hidden <video> element, seeks to a set of evenly spaced timestamps across its duration, captures each resulting frame onto a canvas, and encodes the collected frames into a valid APNG file using this category's own chunk-level APNG encoder. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-26

Overview

Introduction

This tool builds a real Animated PNG from an uploaded MP4 video by sampling a set number of frames evenly across the clip and encoding them into a valid APNG chunk stream.

Everything happens locally: the video is decoded with your browser's own <video> element, and the resulting frames are compressed into APNG using this site's hand-written encoder.

What Is MP4 to APNG Converter?

A client-side video-to-APNG frame extractor and encoder. It plays no audio and doesn't attempt full video transcoding — it captures a fixed number of still frames and assembles them into a looping animated PNG.

MP4 is the most reliably supported input of this category's three video-import tools, since browsers ship a native MP4/H.264 demuxer and decoder almost universally.

How MP4 to APNG Converter Works

The uploaded file is assigned to a hidden <video> element's src as an object URL, and the tool waits for its loadedmetadata event to learn the real duration before validating the requested frame count against it.

For each of N evenly-spaced sample timestamps, the video's currentTime is set and the tool waits for the seeked event, then draws the current video frame to a canvas and reads it back as pixel data.

The collected frames, each given an equal delay derived from duration divided by frame count, are passed to the APNG encoder, which builds a real acTL/fcTL/fdAT chunk stream compressed with the browser's native DEFLATE implementation.

When To Use MP4 to APNG Converter

Use it to turn a short MP4 clip or screen recording into a shareable animated PNG that works anywhere a static <img> tag does.

It's handy for turning a few seconds of video into a compact looping preview or reaction image.

Features

Advantages

  • Runs entirely client-side; the uploaded video is never sent to a server.
  • Produces a genuinely valid APNG file, decodable by any standard PNG/APNG-aware viewer, not just this site's own tools.
  • MP4 is the most broadly browser-supported of this category's three video input formats, so this tool is the most reliable of the three to actually succeed.

Limitations

  • Videos longer than 30 seconds aren't supported — a real per-frame seek-and-capture pass doesn't scale well to long clips in-browser.
  • Only a fixed number of still frames are sampled; fast motion between sampled timestamps won't appear smoothly, unlike a true frame-by-frame video transcode.
  • Audio is always discarded, since APNG (like PNG) has no audio track.

Examples

Extract 10 frames from a 4-second clip

Input

A 4-second MP4, frame count 10

Output

A 10-frame APNG, each frame shown for 400ms

computeSampleTimestamps() divides the 4-second duration into 10 equal 400ms slices and samples the midpoint of each.

Video too long

Input

A 45-second MP4

Output

An error: videos longer than 30 seconds aren't supported

validateVideoExtractionParams() rejects the duration before any frames are sampled.

Best Practices & Notes

Best Practices

  • Use a higher frame count for videos with fast motion, and a lower count for slow, simple animations to keep the output file small.
  • Trim your source video to just the interesting portion before uploading, since only 30 seconds or less is supported.

Developer Notes

The pure lib functions (validateVideoExtractionParams, computeSampleTimestamps) only handle parameter validation and timestamp math — the actual video decode, canvas capture, and seek loop are DOM-only work that lives in the client component, which then hands the captured PixelBuffer frames to this category's shared apng-creator to build the final file.

MP4 to APNG Converter Use Cases

  • Turning a short screen recording into a shareable animated PNG
  • Converting a video meme or reaction clip into a loopable APNG
  • Building a lightweight animated preview from a longer video's most interesting moments

Common Mistakes

  • Requesting more frames than the video's motion actually needs, producing a needlessly large APNG file.
  • Uploading a video longer than 30 seconds and expecting it to be accepted.

Tips

  • Preview the extracted APNG before relying on it — if key motion was missed, try a higher frame count.
  • If the file won't load at all, re-encode it to a standard MP4/H.264 container with another tool first.

References

Frequently Asked Questions