Convert Y4M to SWF — Free Online Tool
Convert Y4M (YUV4MPEG2) uncompressed video files to SWF (Shockwave Flash) format using FFmpeg's FLV1 (Sorenson Spark) video codec and MP3 audio encoding. This tool is ideal for taking lossless intermediate video and packaging it into a Flash-compatible container for legacy web animation or multimedia playback pipelines.
to
FFmpeg Command
Copy this command to run the same conversion locally with FFmpeg on your desktop. Download FFmpeg
Drop your Y4M file here
or click to browse
Free — no uploads, no signups. Your files never leave your browser.
Settings
Note: Browser-based encoding uses approximate quality targets. For precise CRF compression, copy the FFmpeg command above and run it on your desktop.
Estimated output:
Conversion Complete!
DownloadHow It Works
Y4M is a raw, uncompressed video format that stores every frame as full YUV planar pixel data with no compression — it is large by design, serving as a pristine intermediate between encoding steps. During this conversion, FFmpeg reads each uncompressed YUV frame and re-encodes it using the FLV1 codec (also known as Sorenson Spark), a lossy DCT-based codec similar in design to early MPEG-4 Part 2. Because Y4M files typically carry no audio track, the MP3 audio stream (encoded via libmp3lame) will either be sourced from a companion audio input or result in a silent or absent audio track. The output SWF container wraps the FLV1 video bitstream in Adobe Flash's file structure, which Flash Player and SWF-compatible renderers expect. This is a full re-encode — not a remux — because Y4M's rawvideo codec is entirely incompatible with SWF's supported codec set.
What Each Flag Does
| Flag | What it does |
|---|---|
ffmpeg
|
Invokes the FFmpeg binary — the open-source multimedia processing engine that powers this conversion both in the browser (via FFmpeg.wasm) and on the desktop CLI. |
-i input.y4m
|
Specifies the input file in Y4M (YUV4MPEG2) format. FFmpeg reads the Y4M header to determine frame dimensions, frame rate, and chroma subsampling (typically YUV 4:2:0), then streams the raw uncompressed frames into the encoding pipeline. |
-c:v flv1
|
Sets the video codec to FLV1 (Sorenson Spark), the primary lossy video codec supported inside the SWF container. This triggers a full re-encode of every raw Y4M frame using H.263-based DCT compression. |
-c:a libmp3lame
|
Specifies the LAME MP3 encoder for the audio stream. Since Y4M carries no audio, this flag is preparatory — it would encode any audio source present into MP3, which is the default and most widely supported audio format within SWF files. |
-q:v 5
|
Sets the FLV1 video quality on a scale of 1 (highest quality, largest file) to 10 (lowest quality, smallest file). A value of 5 is a balanced default; reduce this to 1 or 2 for visually closer results to the lossless Y4M source, at the cost of a larger SWF output file. |
-b:a 128k
|
Sets the MP3 audio bitrate to 128 kilobits per second, a standard quality level for voice and general audio content in legacy Flash applications. Increase to 192k or 256k if the SWF will carry music or high-fidelity audio. |
output.swf
|
Defines the output filename and tells FFmpeg to write the result in SWF (Small Web Format) container structure, wrapping the FLV1 video and MP3 audio streams in the Adobe Flash file format expected by Flash Player and SWF-compatible emulators. |
Common Use Cases
- Archiving old Flash-based animations by first processing them through a Y4M intermediate and then re-packaging the result back into SWF for legacy Flash Player testing environments
- Delivering losslessly-rendered video content (e.g., from Blender or Kdenlive exported as Y4M) into a legacy Flash-based e-learning or kiosk system that only accepts SWF video
- Converting Y4M output from video synthesis or generative art tools into SWF format for embedding in Adobe Animate or legacy ActionScript-based interactive projects
- Re-encoding raw Y4M test sequences into SWF to evaluate FLV1 codec quality degradation for video codec research or QA testing pipelines
- Producing SWF video assets from uncompressed Y4M sources for use in legacy Flash-based digital signage or presentation software that predates HTML5 video support
- Preparing Y4M content captured from frame-accurate video tools for distribution on platforms or intranet portals that still serve embedded SWF content
Frequently Asked Questions
Yes — this is an inherently lossy conversion. Y4M stores raw, uncompressed YUV pixel data, so every frame is a perfect representation of the source. The FLV1 (Sorenson Spark) codec used in SWF is a lossy DCT codec, comparable in quality to older MPEG-4 codecs. At the default quality setting of -q:v 5 (on a scale of 1–10, where 1 is best), you will see compression artifacts, particularly in high-motion scenes or areas with fine detail. Lowering the value to 1 or 2 will significantly improve quality at the cost of a larger file.
Y4M is a video-only format — it has no audio track by design. This means the output SWF file will contain no audio unless you explicitly provide a separate audio input in a more advanced FFmpeg command. The default command includes -c:a libmp3lame and -b:a 128k flags, but with no audio source, FFmpeg will either skip the audio stream or warn that no audio is available. If you need audio in the SWF, you would need to supply an additional audio file using a second -i flag.
Y4M stores every video frame as raw, uncompressed YUV data, making files extremely large — a few seconds of HD video can occupy several gigabytes. The FLV1 codec in SWF applies aggressive inter-frame compression (predicting changes between frames rather than storing each one independently), which typically reduces file size by 50x to 200x or more compared to the uncompressed source. This size reduction is the direct consequence of the lossy encoding step.
Native browser support for SWF was dropped by all major browsers by 2021 following Adobe's end-of-life of Flash Player. However, SWF files can still be played using standalone tools such as Ruffle (a Flash emulator written in WebAssembly), Adobe Flash Player projector (the standalone desktop version), or legacy browsers with Flash plugins in isolated environments. For most modern use cases, converting to MP4 or WebM would be a more practical choice.
To improve video quality, lower the -q:v value — for example, replace -q:v 5 with -q:v 1 for the highest quality FLV1 output. Alternatively, you can switch the video codec to MJPEG by replacing -c:v flv1 with -c:v mjpeg, which is also supported in SWF and may produce better visual fidelity for still-heavy or low-motion content. For audio, replace -b:a 128k with -b:a 192k or -b:a 256k for a higher-quality MP3 stream, or switch to -c:a aac if your SWF target player supports AAC.
Yes — on Linux or macOS, you can use a shell loop: for f in *.y4m; do ffmpeg -i "$f" -c:v flv1 -c:a libmp3lame -q:v 5 -b:a 128k "${f%.y4m}.swf"; done. On Windows Command Prompt, use: for %f in (*.y4m) do ffmpeg -i "%f" -c:v flv1 -c:a libmp3lame -q:v 5 -b:a 128k "%~nf.swf". This is especially useful for processing large Y4M files over 1GB, which exceed the browser tool's file size limit but work fine on the desktop FFmpeg CLI.
Technical Notes
Y4M files use a simple line-based header followed by raw YUV planar frames, most commonly in YUV 4:2:0 chroma subsampling. FFmpeg reads this without any decoding overhead. The FLV1 codec (Sorenson Spark) in the SWF container is a modified H.263-based codec and does not support B-frames or advanced entropy coding, making it less efficient than modern codecs like H.264 or VP9 at equivalent quality levels. The -q:v parameter in FFmpeg for FLV1 is a global quality scale (VBR), not a CRF — lower integers yield higher bitrates and better quality. SWF does not support metadata chapters, subtitle streams, or multiple audio tracks, so none of these are preserved (and Y4M carries none of them anyway). A significant limitation is that SWF's FLV1 video stream has practical resolution caps — very high resolutions (e.g., 4K Y4M sources) may produce non-compliant or unplayable SWF files. For best compatibility, downscale large Y4M sources to 1280x720 or lower before conversion using the -vf scale= filter. Additionally, Flash Player historically required specific frame rate multiples and audio sample rates (typically 44100 Hz), so mismatched source parameters in the Y4M header may require explicit -r and -ar flags in the command.