Convert Y4M to 3GP — Free Online Tool

Convert Y4M (YUV4MPEG2) uncompressed video files to 3GP format using H.264 video encoding and AAC audio, producing mobile-optimized files suitable for 3G devices and low-bandwidth streaming. This conversion compresses raw, uncompressed YUV frames into a compact container designed for early mobile phones and streaming over constrained networks.

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

Y4M files store raw, uncompressed YUV4:2:0 video frames with no inter-frame compression — every pixel of every frame is stored in full. During conversion, FFmpeg reads these raw frames and encodes them using the libx264 H.264 encoder, applying temporal and spatial compression that dramatically reduces file size by encoding only the differences between frames. Since Y4M files carry no audio stream, the AAC audio encoder is initialized but will produce no output audio unless an additional audio source is provided. The special scale filter (trunc(iw/2)*2:trunc(ih/2)*2) ensures the output dimensions are divisible by 2, which is a hard requirement of the H.264 encoder used here. The resulting .3gp file wraps the H.264 stream in the 3GPP container, a profile of MPEG-4 Part 12 designed specifically for mobile delivery.

What Each Flag Does

Flag What it does
ffmpeg Invokes the FFmpeg multimedia processing tool. This is the same underlying engine that powers the in-browser conversion via FFmpeg.wasm — the command shown here is identical to what runs client-side and can be used directly in a terminal for files over 1GB.
-i input.y4m Specifies the input Y4M file. FFmpeg detects the YUV4MPEG2 format from the file header and reads the raw uncompressed YUV frames for encoding. Since Y4M is video-only, no audio stream is present in the input.
-c:v libx264 Selects the libx264 H.264 encoder to compress the raw YUV frames from the Y4M source. H.264 is the standard video codec for the 3GP container and provides the high compression ratios needed to reduce uncompressed YUV data to mobile-appropriate file sizes.
-c:a aac Specifies AAC as the audio codec for the 3GP output. Since Y4M carries no audio, this flag has no practical effect on this specific conversion, but it is included to ensure correct behavior if audio is added to the pipeline.
-crf 23 Sets the Constant Rate Factor for H.264 encoding to 23, which is the libx264 default and represents a balance between visual quality and file size. Given the lossless Y4M source, lowering this value (e.g., to 18) will preserve more detail at the cost of a larger 3GP file.
-b:a 64k Sets the AAC audio bitrate to 64 kilobits per second, a low bitrate appropriate for 3GP's mobile and low-bandwidth use case. This has no effect when converting from Y4M since there is no audio in the source.
-vf scale=trunc(iw/2)*2:trunc(ih/2)*2 Applies a video filter that rounds the output width and height down to the nearest even number. This is required because libx264 encoding with YUV 4:2:0 chroma subsampling cannot accept odd-numbered dimensions — a constraint that can arise with certain Y4M test sequences or custom-resolution source material.
output.3gp Defines the output filename and triggers FFmpeg to use the 3GP container format, which wraps the H.264 video stream in the 3GPP multimedia container designed for mobile devices and low-bandwidth streaming.

Common Use Cases

  • Distributing a lossless animation or video project rendered to Y4M (e.g., from Blender or a compositing pipeline) to older or low-end mobile devices that require 3GP playback support
  • Converting raw Y4M test sequences from video codec research or quality benchmarking pipelines into a small, shareable 3GP file for quick review on mobile
  • Archiving a final Y4M intermediate from a broadcast production workflow into a compact 3GP format for low-bandwidth distribution in regions with limited mobile connectivity
  • Preparing video content originally captured or processed in Y4M format for upload to platforms or messaging systems that historically required 3GP files from mobile devices
  • Reducing the enormous file size of uncompressed Y4M footage for storage or transfer when the target viewer is a mobile device or embedded player with limited codec support
  • Converting Y4M frames generated by video synthesis tools or signal generators into a 3GP format for testing mobile video playback behavior on legacy hardware or emulators

Frequently Asked Questions

Y4M stores every video frame as raw, uncompressed YUV pixel data — there is no inter-frame encoding, no motion compensation, and no entropy coding. A single second of 1080p Y4M footage can occupy several hundred megabytes. H.264, used in the output 3GP file, applies sophisticated compression including motion estimation, discrete cosine transforms, and entropy coding, typically achieving compression ratios of 100:1 or more relative to raw YUV data. The tradeoff is that this compression is lossy — once encoded to 3GP, you cannot recover the original uncompressed frames.
No. Y4M is a video-only format and carries no audio data whatsoever. The FFmpeg command includes AAC audio encoding flags, but since the input has no audio stream, the output 3GP file will also contain no audio track. If you need audio in the output, you would need to supply a separate audio file using an additional -i flag and mix it into the conversion command.
The filter -vf scale=trunc(iw/2)*2:trunc(ih/2)*2 ensures the output video width and height are both even numbers (divisible by 2). The libx264 H.264 encoder used here requires even dimensions for YUV 4:2:0 chroma subsampling to work correctly. If your Y4M source has odd dimensions — which can happen with certain test sequences or cropped content — omitting this filter would cause FFmpeg to throw an error and fail. If you know your source dimensions are already even, the filter is harmless but technically unnecessary.
The -crf 23 flag controls H.264 quality using Constant Rate Factor, where lower values produce better quality and larger files, and higher values produce smaller files with more compression artifacts. For Y4M source material, which is uncompressed and lossless, a CRF of 18 is often considered visually near-lossless for H.264. For aggressive size reduction suitable for 3G delivery, values between 28 and 35 are common. You can also adjust audio bitrate with -b:a, replacing 64k with values like 32k for smaller files or 128k for better audio fidelity.
Most modern Android and iOS devices can still play 3GP files, but the format is largely considered legacy. It was designed for 3G-era mobile phones with limited processing power and storage, and contemporary devices and streaming platforms now favor MP4 with H.264 or H.265. If your goal is mobile compatibility rather than specifically targeting 3G devices or legacy systems, converting the Y4M to MP4 instead of 3GP would give you a more universally supported file with identical codec quality.
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 64k -vf scale=trunc(iw/2)*2:trunc(ih/2)*2 "${f%.y4m}.3gp"; done. On Windows Command Prompt, use: for %f in (*.y4m) do ffmpeg -i "%f" -c:v libx264 -c:a aac -crf 23 -b:a 64k -vf scale=trunc(iw/2)*2:trunc(ih/2)*2 "%~nf.3gp". Be aware that Y4M files are very large, so batch processing may be disk I/O intensive — processing files sequentially rather than in parallel is advisable to avoid saturating storage throughput.

Technical Notes

Y4M encodes frames in planar YCbCr (typically 4:2:0) with a simple ASCII header per frame, making it trivially parseable but extremely large on disk. When encoding to 3GP via libx264, the chroma subsampling stays at 4:2:0, so no chroma information is lost in that conversion step — all quality loss comes from the H.264 temporal and spatial compression itself. The 3GP container (standardized as 3GPP TS 26.234) supports H.264 Baseline Profile, which is the profile most compatible with legacy mobile hardware; libx264 defaults to Main Profile, which may be incompatible with very old 3G handsets. If targeting extremely constrained legacy devices, you may want to add -profile:v baseline -level 3.0 to the command. Y4M files carry no color metadata beyond basic colorspace tags, and 3GP containers have limited metadata fields compared to MKV or MP4, so subtitle tracks, chapters, and rich metadata from upstream production workflows cannot be preserved in this output format. File sizes can be expected to drop by 98–99% or more compared to the input Y4M, depending on content complexity and the chosen CRF value.

Related Tools