Four ways an old clip fails

Format by format

FormatContainer and codecsWhat breaksWhat the converter does
Pocket camera .AVIAVI, Motion JPEG, sound as pcm_u8, adpcm_ima_wav or adpcm_msPhone galleries do not open AVI. ADPCM sound plays silent.Decodes the JPEG frames, keeps the full-range colour flag, encodes H.264. Sound becomes AAC.
Pocket camera .MOVQuickTime, Motion JPEG or H.263, sound often adpcm_ima_qtADPCM sound plays silent. H.263 was dropped by modern players.Same path as AVI. Applies the rotation flag to the pixels.
JVC Everio .MODMPEG program stream, MPEG-2 at 720 x 480 or 720 x 576, AC-3No MPEG-2 player on iPhone. Interlaced. The 16:9 flag gets ignored.Deinterlaces, then resamples to square pixels: 720 x 480 becomes 854 x 480.
AVCHD .MTSMPEG transport stream, H.264, usually interlaced, AC-3iPhone Photos does not import it. Comb lines. AC-3 is silent on many phones.Deinterlaces at the same frame rate. Sound becomes AAC.
Early .3GP and .ASFH.263 or MPEG-4 Part 2 with AMR; WMV with WMAModern players dropped these codecs.Decodes and re-encodes both tracks.

All sound is re-encoded to AAC at 48 kHz stereo, 160 kb/s, whatever the source was. I wrote separate guides with tested ffmpeg commands for JVC MOD files, AVCHD, Kodak MOV, interlace lines and silent AVI sound. The rest of this page is about the engineering.

The pipeline

  1. Mount. A Web Worker mounts the file with Emscripten's WORKERFS. FFmpeg reads it in slices, so the source is never copied whole into memory. The worker contains no upload code. The 4.1 MB wasm file comes from the same origin as the page.
  2. Decode and filter. FFmpeg 7.1.3, compiled to WebAssembly, demuxes, decodes, deinterlaces and scales. It hands out I420 frames with square pixels.
  3. Encode video. Each frame is copied out of the wasm heap and passed to the browser's WebCodecs VideoEncoder. The output is H.264 with a keyframe every 60 frames.
  4. Encode audio. FFmpeg's native AAC encoder runs inside the wasm module.
  5. Mux. mp4-muxer, a JavaScript library, writes the MP4 into an ArrayBuffer with the index at the front. The page wraps it in a Blob for download.

Why the browser encodes the H.264

My FFmpeg build is LGPL. It is configured with --disable-gpl --disable-version3 --disable-nonfree. x264 is GPL, and FFmpeg has no H.264 encoder of its own, so the only encoder in the build is AAC. The browser already ships an H.264 encoder. The engine runs on one thread, and I did not want a software H.264 encoder on that thread.

The cost is that WebCodecs behaves differently in each browser. Safari's encoder produced no output in the default quality latency mode, so Safari gets realtime. Firefox ignored the row stride I passed with each frame. An 854 px wide picture with a stride of 864 came out sheared, and the job still reported success. I now repack every plane to stride equals width first. The encoder config tries High profile, then Main, then Baseline.

The worker pumps 8 frames per step and waits when the encoder queue is longer than 6. Deinterlacing uses yadif in send_frame mode. When the stream does not state its field order, idet runs first and yadif only touches frames detected as interlaced.

What I cut from FFmpeg

Memory limits

The wasm heap starts at 64 MB and may grow to 4 GB. It never shrinks, so every job gets a fresh worker that is terminated afterwards. The input stays on disk. The output does not: the whole MP4 sits in memory until it is finished. That is why the page caps the input at 500 MB on the free tier and 2 GB on the paid one. If the browser runs out of memory, the page says so and gives the file size. The picture can be at most 4096 px on each side.

What does not work yet

Price and free limits

Free: 3 conversions a day, files up to 500 MB, output at most 1280 px wide at two thirds of the full bitrate, and a small Camport mark in the bottom right corner. A one-time $6.99 purchase removes all four and raises the file limit to 2 GB. The daily counter is a date and a number in the browser's localStorage.

Open the video converter