Compress SWF Online — Free File Size Reducer

Compress SWF files by re-encoding their embedded video with the FLV1 (Sorenson Spark) codec and audio with MP3 via libmp3lame, reducing file size while keeping the output in the SWF container. Ideal for shrinking legacy Flash animations and interactive content that still need to play in SWF-compatible environments.

FFmpeg Command

Copy this command to run the same conversion locally with FFmpeg on your desktop. Download FFmpeg

Free — no uploads, no signups. Your files never leave your browser.

Estimated output:

Conversion Complete!

Download

How It Works

SWF files can contain vector graphics, ActionScript, and embedded media streams — this tool targets the compressed media streams inside the SWF container. FFmpeg re-encodes the video track using the FLV1 (Sorenson Spark) codec, which is the native video codec for SWF and Flash Video, at a configurable quality level (default q:v 5 on a 1–10 scale where lower is better). Audio is re-encoded using libmp3lame at 128k bitrate, which matches the MP3 audio format historically embedded in SWF files. The result is a smaller SWF file with recompressed media streams. Note that pure vector graphics and ActionScript logic within the SWF are not touched by FFmpeg — only the rasterized video and audio streams are recompressed.

What Each Flag Does

Flag What it does
ffmpeg Invokes the FFmpeg tool, which is running here as a WebAssembly binary (FFmpeg.wasm) entirely within your browser — no data is sent to a server.
-i input.swf Specifies the input SWF file. FFmpeg demuxes the SWF container, extracting any embedded FLV1 video and MP3 or AAC audio streams for re-encoding.
-c:v flv1 Sets the output video codec to FLV1 (Sorenson Spark), which is the native video codec for the SWF container and the only video codec reliably supported by FFmpeg's SWF muxer. The video stream is re-encoded from scratch, not copied.
-q:v 5 Sets the FLV1 video encoder's quantizer quality level to 5 on a scale of 1 (best quality, largest file) to 10 (worst quality, smallest file). A value of 5 provides a balanced compression ratio with moderate quality loss compared to the original.
-c:a libmp3lame Re-encodes the audio stream using the LAME MP3 encoder, producing the MP3 audio format that SWF containers natively support. This ensures the compressed audio is compatible with SWF players.
-b:a 128k Sets the MP3 audio bitrate to 128 kilobits per second, a standard quality level for stereo audio in Flash content. Lower values like 96k or 64k will reduce file size further at the cost of audio fidelity.
output.swf The filename for the compressed output file. The .swf extension tells FFmpeg to use its SWF muxer, wrapping the re-encoded FLV1 video and MP3 audio back into a valid SWF container.

Common Use Cases

  • Reducing the file size of legacy Flash-based e-learning modules so they can be hosted on bandwidth-limited servers or archived more efficiently
  • Shrinking SWF banner advertisements with embedded video to meet file size limits imposed by ad networks or publishing platforms
  • Compressing SWF game or interactive content that includes embedded video cutscenes before archival or redistribution
  • Optimizing SWF animations that were exported at maximum quality from Adobe Animate or legacy Flash CS tools to reduce load times on older intranet systems
  • Preprocessing large SWF video files before converting them to more modern formats, making intermediate steps faster
  • Archiving a collection of SWF multimedia files with reduced storage footprint while preserving the original SWF container format for compatibility

Frequently Asked Questions

FFmpeg only processes the encoded video and audio streams embedded within the SWF container — it does not parse, modify, or re-encode ActionScript bytecode or the SWF's native vector drawing commands. However, because SWF is a complex binary format, re-muxing through FFmpeg may strip or alter container-level metadata and structure that some interactive elements rely on. If your SWF is primarily vector-based animation or an interactive application, test the output carefully, as behavior may differ from the original.
The -q:v parameter controls the quantizer scale for the FLV1 (Sorenson Spark) video encoder, where 1 is the highest quality (largest file) and 10 is the lowest quality (smallest file). The default of 5 strikes a balance between visible quality and file size reduction. For archival purposes you might use q:v 2–3, while for maximum compression where some quality loss is acceptable, q:v 7–9 will produce significantly smaller files. Unlike bitrate-based encoding, q:v uses variable bitrate, so the actual file size depends on content complexity.
FLV1 (Sorenson Spark) and MP3 are the codecs natively supported within the SWF container format as recognized by FFmpeg's SWF muxer. The SWF specification historically supported these codecs, and FFmpeg's SWF output implementation defaults to FLV1 for video and libmp3lame for audio to ensure the output remains a valid, playable SWF file. Using H.264 or other modern codecs would produce an invalid or unplayable SWF, since the container specification and most SWF players do not support them.
File size reduction depends heavily on the content and the quality settings of the original SWF. If the original was exported at maximum quality (q:v 1 or very high bitrate), recompressing at q:v 5 with 128k audio can yield 30–60% size reduction. If the original was already highly compressed, gains will be modest and you risk noticeable quality degradation. SWFs that are primarily vector graphics with little embedded video content will see minimal compression benefit, since FFmpeg cannot compress the vector and ActionScript portions.
Replace the -b:a 128k value with a lower bitrate such as -b:a 96k or -b:a 64k to reduce the size of the MP3 audio stream embedded in the output SWF. For example: ffmpeg -i input.swf -c:v flv1 -q:v 5 -c:a libmp3lame -b:a 64k output.swf. At 64k the audio will be noticeably lower quality, so 96k is usually a better compromise for speech-heavy content like e-learning narration.
The displayed command processes a single file, but you can batch process on the command line using a shell loop. On Linux or macOS: for f in *.swf; do ffmpeg -i "$f" -c:v flv1 -q:v 5 -c:a libmp3lame -b:a 128k "compressed_$f"; done. On Windows PowerShell: Get-ChildItem *.swf | ForEach-Object { ffmpeg -i $_.Name -c:v flv1 -q:v 5 -c:a libmp3lame -b:a 128k ("compressed_" + $_.Name) }. This is especially useful for compressing a large archive of legacy Flash content.

Technical Notes

SWF is a legacy Adobe Flash container format that bundles vector graphics, ActionScript, and optionally rasterized video and audio streams. FFmpeg's SWF muxer supports FLV1 (Sorenson Spark, a precursor to H.263) for video and MP3 via libmp3lame for audio — these are the only codecs reliably supported in the output SWF container. The FLV1 codec uses a quantizer-based quality scale (-q:v 1–10) rather than a fixed bitrate, so output file size will vary with scene complexity. This compression is inherently lossy — each re-encode of the video stream introduces generation loss, so if the source SWF was already compressed with FLV1, a second compression pass will further reduce quality. Metadata support in SWF is minimal; FFmpeg will not preserve Flash-specific metadata tags or SWF header properties like frame rate or display dimensions beyond what it can parse. The SWF format has no support for subtitles, chapters, transparency in video streams, or multiple audio tracks, so none of these are preserved or generated. Because Flash Player support was discontinued by Adobe and major browsers in 2020, SWF playback requires dedicated legacy players like Ruffle or standalone projectors — this tool does not affect that compatibility, only the media stream quality within the file.

Related Tools