Convert SWF to CAVS — Free Online Tool

Convert SWF (Shockwave Flash) files to CAVS format by re-encoding the embedded FLV1 or MJPEG video stream using H.264 (libx264) and transcoding the MP3 or AAC audio to AAC — producing a CAVS-compliant file suitable for Chinese broadcast and media workflows. This is especially useful for preserving legacy Flash content in a modern, standardized container.

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 are Flash containers that typically embed video using the FLV1 (Sorenson Spark) codec and audio using MP3 (libmp3lame). During this conversion, FFmpeg demuxes the SWF container, extracts the raw video and audio streams, and fully re-encodes the video using the H.264 (libx264) codec — since FLV1 is not compatible with CAVS output. Audio is transcoded to AAC regardless of whether it was already AAC, because the output container requires AAC-compliant encoding. The result is a CAVS file with H.264 video at CRF 23 quality and 128k AAC audio. Because both the video and audio must be re-encoded (not just remuxed), this conversion is computationally intensive and involves some quality loss relative to the original lossy source.

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.
-i input.swf Specifies the input SWF file. FFmpeg's SWF demuxer parses the Flash container to extract embedded video (typically FLV1 or MJPEG) and audio (typically MP3 or AAC) streams for re-encoding.
-c:v libx264 Re-encodes the video stream using the H.264 encoder (libx264), replacing the original FLV1 or MJPEG codec from the SWF with the modern, efficient H.264 codec required for CAVS output.
-c:a aac Transcodes the audio stream to AAC using FFmpeg's built-in AAC encoder. This is required for CAVS compatibility — even if the SWF already contained AAC audio, a fresh encode ensures proper compliance with the output container.
-crf 23 Sets the Constant Rate Factor for libx264 to 23, which is the default balanced quality level for H.264 encoding. Lower values (e.g., 18) produce higher quality and larger files; higher values (e.g., 28) produce smaller files with more compression artifacts.
-b:a 128k Sets the AAC audio bitrate to 128 kilobits per second, which is a standard quality level for stereo audio — sufficient for most speech and general-purpose content extracted from SWF files.
output.cavs Defines the output filename with the .cavs extension, which tells FFmpeg to write the re-encoded H.264 video and AAC audio into a CAVS-format container conforming to the Chinese Audio Video Standard.

Common Use Cases

  • Archiving legacy Flash animations or e-learning modules from the pre-HTML5 era into a CAVS format for Chinese broadcast or institutional media archives
  • Converting SWF-based promotional videos or product animations into CAVS for distribution on Chinese streaming or broadcast platforms that require this national standard
  • Migrating SWF video content from old Flash-based websites into a modern codec (H.264) packaged in a CAVS container for long-term preservation
  • Preparing SWF-derived video content for submission to Chinese government or state media systems that mandate CAVS-compliant file formats
  • Re-encoding SWF training or educational video exports into CAVS for playback on set-top boxes or hardware players used in China that support the CAVS standard
  • Extracting and re-encoding the video stream from interactive SWF files (stripping interactivity) into a linear CAVS video file for editing or broadcast use

Frequently Asked Questions

No. SWF files can contain ActionScript-driven interactivity, vector animations, and event-based content that are not video streams at all. FFmpeg can only extract and re-encode the actual video and audio media streams embedded inside the SWF. Interactive elements, vector graphics layers, and scripted behaviors are discarded entirely. The output CAVS file will only contain whatever linear video footage was encoded inside the SWF.
Despite the name 'Chinese Audio Video Standard,' the CAVS container format as handled by FFmpeg uses H.264 (libx264) for video encoding in practice, because native AVS video codec support in FFmpeg is limited and libx264 produces broadly compatible, high-quality output. The CAVS file extension and container structure conform to the Chinese standard, but the video codec used here is the widely supported H.264 encoder. This ensures reliable playback while maintaining format compliance.
Both the input SWF (using FLV1/Sorenson Spark video and MP3 audio) and the output CAVS (using H.264 video and AAC audio) are lossy formats, so this is a lossy-to-lossy transcode. The default CRF value of 23 for libx264 produces visually good quality for most content, but some generation loss is unavoidable since the video must be fully re-decoded and re-encoded. If the source SWF video was already heavily compressed, artifacts from the original FLV1 encoding may become more visible in the output.
Yes. The -crf flag controls H.264 video quality. Lower CRF values produce higher quality and larger files — for example, -crf 18 is near-visually lossless for most content, while -crf 28 produces smaller files with more visible compression. The default of -crf 23 is a balanced choice suitable for general use. You can also increase audio quality by changing -b:a 128k to a higher bitrate like -b:a 192k or -b:a 256k.
Yes, on your local desktop you can use a shell loop to batch process files. On Linux or macOS, run: for f in *.swf; do ffmpeg -i "$f" -c:v libx264 -c:a aac -crf 23 -b:a 128k "${f%.swf}.cavs"; done. On Windows Command Prompt, use: for %f in (*.swf) do ffmpeg -i "%f" -c:v libx264 -c:a aac -crf 23 -b:a 128k "%~nf.cavs". The browser-based tool processes one file at a time, but the displayed FFmpeg command is ideal for batch workflows on files over 1GB.
SWF files often use aggressive FLV1 compression optimized for web delivery at low bitrates, so the output CAVS file at CRF 23 with H.264 may actually be larger if the source was very low bitrate. Conversely, if the SWF contained high-quality video, H.264 at CRF 23 is more efficient than FLV1 and may produce a smaller file. File size is also affected by the duration of video content in the SWF — some SWF files contain very short clips or mostly non-video content, resulting in small outputs.

Technical Notes

SWF files present unique extraction challenges: not all SWF files contain traditional video streams, and those that do typically use FLV1 (Sorenson Spark H.263-derivative) or MJPEG video with MP3 or AAC audio. FFmpeg's SWF demuxer handles the extraction of these streams, but ActionScript, vector graphics, and interactivity are entirely outside FFmpeg's scope. The libx264 encoder at CRF 23 is well-suited to re-encoding the relatively low-resolution, low-bitrate video typical of SWF content. CAVS does not support subtitles, chapters, or multiple audio tracks, and neither does SWF, so no metadata of that kind is lost. However, any embedded SWF metadata (title, author tags) will not be transferred to the CAVS output. The CAVS format has limited playback support outside of China and specialized media systems, so if broad compatibility is your goal, consider outputting to MP4 instead. Processing time depends heavily on the video content length inside the SWF, not the SWF file size itself.

Related Tools