Convert Y4M to DVR — Free Online Tool
Convert Y4M (YUV4MPEG2) lossless uncompressed video files to DVR format using H.264 video encoding and AAC audio. This tool encodes your raw YUV frame data into a compressed DVR container suitable for digital video recorder playback and archival, running entirely in your browser with no file uploads.
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 completely uncompressed format that stores raw YUV color-space frame data with no interframe compression — every frame is stored in full. Converting to DVR requires actual encoding, not just remuxing, because DVR uses H.264 (libx264) for video compression. FFmpeg reads each raw YUV frame from the Y4M file and passes it through the x264 encoder, which applies spatial and temporal compression using techniques like motion estimation, DCT transforms, and B-frames. The result is a dramatically smaller file with lossy compression at CRF 23 (a perceptually balanced quality level). Since Y4M carries no audio stream by default, the AAC audio encoder is configured but will produce no audio track unless an audio source is explicitly added. The container is repackaged as DVR for compatibility with digital video recorder systems.
What Each Flag Does
| Flag | What it does |
|---|---|
ffmpeg
|
Invokes the FFmpeg binary — the open-source multimedia processing engine that performs the Y4M decoding and DVR encoding. In the browser, this runs as FFmpeg.wasm compiled to WebAssembly. |
-i input.y4m
|
Specifies the input Y4M file. FFmpeg reads the YUV4MPEG2 stream header to determine frame dimensions, frame rate, color space, and interlacing, then decodes each raw uncompressed YUV frame for encoding. |
-c:v libx264
|
Selects the libx264 encoder for the video stream, compressing the raw YUV frames from the Y4M source into H.264 using spatial and temporal compression — the default and most compatible video codec for DVR output. |
-c:a aac
|
Selects the AAC encoder for any audio stream. Since Y4M carries no audio, this flag has no effect on a pure Y4M input but ensures correct audio encoding if an audio stream is introduced during processing. |
-crf 23
|
Sets the Constant Rate Factor for H.264 encoding at 23, the libx264 default. This controls the quality-to-filesize tradeoff when compressing the uncompressed Y4M frames — lower values (e.g., 18) preserve more detail from the original raw video at larger file sizes. |
-b:a 128k
|
Sets the AAC audio bitrate to 128 kilobits per second, a standard quality level for broadcast audio. This is active only if an audio stream is present; for typical Y4M-only sources this flag is effectively dormant. |
output.dvr
|
Specifies the output filename and container format. The .dvr extension tells FFmpeg to write the H.264 video (and AAC audio if present) into a DVR-compatible container for use with digital video recorder systems. |
Common Use Cases
- Archiving lossless Y4M intermediate files captured from broadcast television into compact DVR format for long-term DVR system storage
- Converting raw YUV4MPEG2 output from video processing pipelines (such as those produced by tools like ffmpeg, libav, or VapourSynth) into DVR-compatible files for playback on set-top boxes or DVR hardware
- Compressing large uncompressed Y4M surveillance or security footage frames into DVR format to reduce storage overhead on recording systems
- Preparing Y4M test sequences used in video codec research or quality benchmarking for delivery to DVR-based review systems
- Converting Y4M files piped from video capture cards or frame grabbers into DVR format for integration with digital video recorder archives
- Reducing the massive file size of Y4M intermediates from video editing workflows into a manageable DVR format for client review on DVR-compatible players
Frequently Asked Questions
Yes — this conversion is inherently lossy. Y4M stores raw, uncompressed YUV frame data, meaning every pixel value is preserved exactly. DVR uses H.264 encoding (libx264) with a CRF of 23, which applies perceptual compression that discards visual information the encoder deems least noticeable. The default CRF 23 produces good visual quality for most content, but it is not mathematically identical to the source. If you need the highest possible quality, lower the CRF value (e.g., CRF 18) in the FFmpeg command.
Y4M stores uncompressed YUV data, meaning a single minute of 1080p video at 24fps can easily exceed several gigabytes. H.264 in DVR applies heavy spatial and temporal compression — encoding differences between frames rather than full frames — which typically reduces file size by 50x to 200x or more depending on content complexity. This dramatic reduction is entirely expected and is the primary reason DVR format is used for storage rather than Y4M.
No. Y4M is a video-only format with no audio support, so the source has no audio stream to encode. The FFmpeg command includes the AAC audio codec flag (-c:a aac) and bitrate flag (-b:a 128k) for completeness in case audio is piped or muxed in, but if the input Y4M carries no audio, the DVR output will contain only the H.264 video track with no audio stream.
Adjust the -crf value in the command to control H.264 quality. CRF 23 is the default and a reasonable balance. Lower values (e.g., -crf 18) produce higher quality and larger files, approaching visually lossless output. Higher values (e.g., -crf 28 or 36) reduce file size further at the cost of visible compression artifacts. For DVR surveillance archival where storage is critical, CRF 28–36 is common. For broadcast-quality preservation of Y4M content, CRF 18 or lower is recommended.
Yes. On Linux or macOS you can use a shell loop: `for f in *.y4m; do ffmpeg -i "$f" -c:v libx264 -c:a aac -crf 23 -b:a 128k "${f%.y4m}.dvr"; done`. On Windows Command Prompt, use `for %f in (*.y4m) do ffmpeg -i "%f" -c:v libx264 -c:a aac -crf 23 -b:a 128k "%~nf.dvr"`. The browser-based tool processes one file at a time, so the FFmpeg command is particularly valuable for batch workflows involving multiple Y4M files.
Yes. The DVR format supports both libx264 (H.264) and mjpeg as video codecs. To use MJPEG, replace `-c:v libx264 -crf 23` with `-c:v mjpeg -q:v 5` in the FFmpeg command (where -q:v ranges from 2 to 31, lower being higher quality). MJPEG encodes each frame independently with no interframe compression, which can be advantageous for DVR systems that need frame-accurate scrubbing, but results in significantly larger files than H.264 at equivalent visual quality.
Technical Notes
Y4M encodes video in planar YUV color space (commonly YUV 4:2:0, 4:2:2, or 4:4:4 depending on the source) with a simple line-based header per frame. When encoding to H.264 via libx264, FFmpeg reads the YUV plane data directly, which is highly efficient since x264 also operates natively in YUV color space — no colorspace conversion is needed in the typical 4:2:0 case. If your Y4M source uses 4:2:2 or 4:4:4 subsampling, note that the default libx264 output is 4:2:0, meaning chroma subsampling may be applied during encoding; use -pix_fmt yuv444p and -profile:v high444 if preserving full chroma resolution is critical. Y4M files carry no metadata beyond basic resolution, frame rate, and aspect ratio in the stream header — no chapter, subtitle, or multi-track audio metadata exists to be lost. The DVR container itself is proprietary and its internal structure varies by manufacturer, but FFmpeg's output is structured for broad compatibility. File sizes from this conversion will be dramatically smaller than the source Y4M, often by two orders of magnitude, because H.264 temporal compression is highly effective on the redundant frame sequences that uncompressed Y4M typically contains.