Convert Video to FLV Sorenson Spark with FFmpeg
This article provides a straightforward guide on how to transcode modern video files into the legacy Flash Video (FLV) format using FFmpeg. It covers the specific codec identifiers for Sorenson Spark (FLV1), essential audio pairings, and the exact command-line arguments needed to ensure compatibility with legacy Flash players and vintage embedded systems.
Understanding the Sorenson Spark Codec in FFmpeg
The Sorenson Spark codec (an implementation of Sorenson H.263) is
identified in FFmpeg under the encoder name flv (or
flv1). Because this is a legacy format, it requires
compatible color spaces and specific audio codecs to play back properly
in legacy environments.
The Basic Conversion Command
To convert an input video to FLV using Sorenson Spark video and MP3 audio, run the following command:
ffmpeg -i input.mp4 -c:v flv -c:a libmp3lame output.flv-c:v flv: Specifies the Sorenson Spark (FLV1) video encoder.-c:a libmp3lame: Encodes the audio to MP3, which is the most widely supported audio format for legacy FLV containers.
Recommended Production Command
Legacy decoders for Sorenson Spark are strict regarding pixel formats and audio sample rates. To ensure maximum compatibility across older systems, use this optimized command:
ffmpeg -i input.mp4 -c:v flv -b:v 1000k -pix_fmt yuv420p -c:a libmp3lame -ar 44100 -b:a 128k output.flvParameter Breakdown
-pix_fmt yuv420p: Forces standard YUV 4:2:0 chroma subsampling. Modern videos often use profiles or formats that will fail in legacy Flash decoders without this flag.-b:v 1000k: Sets the video bitrate to 1000 kbps. Adjust this value depending on your desired balance between file size and visual quality.-ar 44100: Resamples audio to 44.1 kHz. Legacy Flash video specifications strictly require audio sample rates of 11025 Hz, 22050 Hz, or 44100 Hz.-b:a 128k: Sets the audio bitrate to 128 kbps.
Alternative Legacy Audio Formats
If your target playback environment does not support MP3 within an FLV container, you can use alternative native Flash audio codecs:
Nellymoser Asao:
ffmpeg -i input.mp4 -c:v flv -c:a nellymoser -ar 44100 output.flvADPCM SWF:
ffmpeg -i input.mp4 -c:v flv -c:a adpcm_swf -ar 44100 output.flv