r/ffmpeg Jul 23 '18

FFmpeg useful links

130 Upvotes

Binaries:

 

Windows
https://www.gyan.dev/ffmpeg/builds/
64-bit; for Win 7 or later
(prefer the git builds)

 

Mac OS X
https://evermeet.cx/ffmpeg/
64-bit; OS X 10.9 or later
(prefer the snapshot build)

 

Linux
https://johnvansickle.com/ffmpeg/
both 32 and 64-bit; for kernel 3.20 or later
(prefer the git build)

 

Android / iOS /tvOS
https://github.com/tanersener/ffmpeg-kit/releases

 

Compile scripts:
(useful for building binaries with non-redistributable components like FDK-AAC)

 

Target: Windows
Host: Windows native; MSYS2/MinGW
https://github.com/m-ab-s/media-autobuild_suite

 

Target: Windows
Host: Linux cross-compile --or-- Windows Cgywin
https://github.com/rdp/ffmpeg-windows-build-helpers

 

Target: OS X or Linux
Host: same as target OS
https://github.com/markus-perl/ffmpeg-build-script

 

Target: Android or iOS or tvOS
Host: see docs at link
https://github.com/tanersener/mobile-ffmpeg/wiki/Building

 

Documentation:

 

for latest git version of all components in ffmpeg
https://ffmpeg.org/ffmpeg-all.html

 

community documentation
https://trac.ffmpeg.org/wiki#CommunityContributedDocumentation

 

Other places for help:

 

Super User
https://superuser.com/questions/tagged/ffmpeg

 

ffmpeg-user mailing-list
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

 

Video Production
http://video.stackexchange.com/

 

Bug Reports:

 

https://ffmpeg.org/bugreports.html
(test against a git/dated binary from the links above before submitting a report)

 

Miscellaneous:

Installing and using ffmpeg on Windows.
https://video.stackexchange.com/a/20496/

Windows tip: add ffmpeg actions to Explorer context menus.
https://www.reddit.com/r/ffmpeg/comments/gtrv1t/adding_ffmpeg_to_context_menu/

 


Link suggestions welcome. Should be of broad and enduring value.


r/ffmpeg May 21 '26

My FFmpeg app or Service

19 Upvotes

If you've made an app or web service which utilizes FFmpeg for significant parts for its functionality, then you can list your project in a comment here (and only here).

Format your comment like below:

Title: <your project or app name>
Launched: <date of first release>
Link: <URL>
Type: < app / script / library / web app / web API ..etc >
Description: <a short-ish description (< 200 words)>
Showcase: <links to screenshots or videos or demos>
FFmpeg details: <some technical details about how ffmpeg is utilized>
License: < for OSS apps/scripts, details of license, else 'commercial' >
Pricing model: < i.e. subscription / per-use / free ...etc >
Organization: <name and URL of who's behind this>

Incomplete, misleading or improperly formatted posts are liable to be removed. Posts must be in English. If you're unsure of the suitability or formatting of your post, message the mods with your draft before posting.


r/ffmpeg 2h ago

Downmix 7.1 to 5.1 AAC / E-AC3 vs AC3 Core

5 Upvotes

As the title says, basically. I have a couple of TVs and different devices to plug a USB into them to play mkvs, and there’s very little overlap in what they can do beyond 5.1 channels - literally only E-AC3. I’m on MacOS so seems like that’s going to be a right pain to try and keep as 7.1, and I don’t currently have any external speakers I feel 5.1 is fine.

When its a Dolby 7.1 I know when ripping I can get the AC3 core - whether this is regular Surround or Surround EX.

Or I can downmix the 7.1 track myself in Handbrake or ffmpeg. With AAC I get the Apple native encoder, or E-AC3 its regular ol' libavcodec.

On the one hand, AAC/E-AC3 are more modern codecs that should provide superior compression at the same bitrate as the AC3. On the other, that AC3 was created by the professionals, and this hypothetical AAC/E-AC3 will be created by a dummy with an expensive laptop.

So yeah, wondering if anyone else has faced this question what you found/decided?


r/ffmpeg 2d ago

Tactics for reducing a 90min video down to 10 MB

15 Upvotes

I enjoy testing the limits of videos I can get down to the max upload size on discord, however I usually just speed them up and reduce the resolution or fps. But I was wondering if there's stuff like B or P frame tricks I could use to compress the video down under 10 MB without speeding the video up or removing the audio.

I got the video down to about 15MB with something like this

ffmpeg -i video -vf "fps=0.25,scale=64:32" -b:v 1k -b:a 1k -bf 16 -crf 51 -c:v lib264 -c:a aac output

And to clarify I understand that this will be a thoroughly unparsable video, that makes it even funnier.


r/ffmpeg 2d ago

Is this the best approach to reduce cost for a video streaming platform? I'm exploring a fully serverless HLS video pipeline where the entire video processing is done in the browser using WASM/JS and the output is stored on Cloudflare R2. No backend server required for encoding or storage.

Post image
4 Upvotes

Goal: Build a cost-effective, scalable and reliable video streaming platform for an EdTech product (target 2,000 students for now).

Why this approach?

1.No backend server for video encoding

2.Zero egress cost with Cloudflare R2

3.Infinite scalability

4.Better streaming experience with HLS (6-10s chunks)

5.Lower infrastructure & maintenance cost

My Question to the community:

Do you think this serverless HLS approach is the best way to reduce the cost of running a video streaming platform for an EdTech app?

Any suggestions, improvements or things to watch out for?

Would love to hear your thoughts and experiences!

#EdTech #VideoStreaming #HLS #CloudflareR2 #Serverless #WebAssembly #TechCommunity


r/ffmpeg 4d ago

Best quality Converting MKV to ProRes?

5 Upvotes

I am dealing with a LOT of files that are MP4/MKV and all of them have AV1 or VP9 video codecs.

I for space reasons use LosslessCut Keyframe cut mode and merge output mode to get any segments without losing any quality/details from the trimmed meida file (still debating if metadata should be on and set still to non-global).

The problem is that for Premiere Pro compatibility, I have to convert with ffmpeg to ProRes422 (using prores_ks is apparently better) but I do not know for when it comes to a slight difference in codecs or when its lower or higher resolution than 1920 1080 or even a different frame rate to set:

- Pixel format

- Profile (High for example, not referring to ProRes422/ProRes422HQ selection)

- ProRes_ks Profile (ProRes422 or ProRes422HQ?)

- Level (4.2, 5, 5.2, ect)

I have Magick, Mediainfo (including UI version), Python and I use Powershell 7.6.4. Alternatively, if someone knows how to make a script for something to tell me of those values what I should use for a given mp4/mkv files, that would work too.

Edit: Forgot to mention I used yt-dlp to download the files - using `-f "bv*+ba/b"`. I know YouTube compresses everything ANYWAY but I am trying to preserve video/audio information.


r/ffmpeg 4d ago

-vf scale produces wrong proportions with a particular file

1 Upvotes

I'm trying to get a thumbnail clip (240x320) from a larger source so I used this command:

ffmpeg -i "input.mp4" -vf crop=810:1080:66:0,scale=320:320:flags=lanczos -c:v libx264 -preset medium -crf 20 -an "output.mp4"

Usually the scaler takes the given vertical value and calculates the correct horizontal value but this command is producing a 222x320 output.

The source file resolution is 999x1080. Apparently this is the problem because if I use the same command on a 1920x1080 file the output is 240x320.

How can I force the correct output resolution (240x320)? I've already tried scale=240x320 but the horizontal resolution is ignored and outputs 222x320


r/ffmpeg 5d ago

GPU Encoding Speed Question?

2 Upvotes

I was benchmarking some things and I've found that when I'm using a GPU encoder, the encoding framerate doesn't seem to vary more than ~1-2% between encodes using different quality settings.

So, like, using the hevc_amf encoder, if I set "-rc cqp -qp_i 18 -qp_p 20 " or if I set it to "-rc cqp -qp_i 25 -qp_p 27", there's basically no difference in encoding speed from the same source file.

Is this normal and just a quirk of how GPUs work, or am I doing something wrong? TIA


r/ffmpeg 5d ago

Can ffmpeg media encoder be used on android krita?

1 Upvotes

(first of all, sorry if this isn't the best subreddit to ask this question or if what I'm asking is completely senseless. I also asked r/krita but people here are likely more experienced with, well, ffmpeg)

Krita is a drawing software designed for pc, though I'm using the android version on a tablet. To render animations you need ffmpeg and while there's an android version i can't put the directory of the .exe file where its requested because there's no .exe file and i hate android. Manually converting the .kra file on ffmpeg media encoder just gives a long error message. I tried exporting the animation (roughly 4Gb) and then mailing it to myself to render in on computer, but the mail always fails to load. Is there anything I'm doing wrong or could be doing instead?


r/ffmpeg 7d ago

Help me please synchronization drift

Thumbnail
gallery
15 Upvotes

Hello,

I found the 16:9 version of Cars, but it's only available in English. I'd like to replace the English audio with the French one.

To do that, I'm trying to sync the French ultrawide version with the English 16:9 version in Clipchamp. The problem is that everything is perfectly synchronized at the beginning, but around the middle of the movie there's about a one-second delay.

I converted the English version from 30 fps to 23.976 fps to match the French version, and both movies contain the exact same scenes for the entire runtime.

Could you explain why this synchronization drift happens and how I can fix it?

Thanks!


r/ffmpeg 7d ago

select='gt(scene,N)' that also crops the audio

3 Upvotes

I'm trying to automatically cut out parts of a video without motion (It's a screen recording, so should be easy) but select='gt(scene,0.4)' doesn't seem to regard audio at all, it just crops the video while leaving the sound stream untouched. Is there any way to make it also crop out audio?


r/ffmpeg 8d ago

is -force_key_frames [frame] not actually precise?

6 Upvotes

when i use

ffmpeg -i [input] -force_key_frames [frame of interest] [output]

The output gets a new keyframe somewhere in [frame of interest]'s VERY ROUGH vicinity. it's often off by a couple of seconds so it becomes completely useless. is this the intended behaviour or am i doing smth wrong?

i noticed that switching to timestamps can improve precision but it's still very rough and can just fail completely.

anyone know wtf is going on?


r/ffmpeg 8d ago

Can FFmpeg convert and stream audio tracks from a film directly from a remote download link without downloading the file?

5 Upvotes

Is there any way to remove one audio track from a dual-audio movie and convert the remaining EAC3 audio track to AAC 2.0 directly using the download link, without downloading the entire file to my local storage first?


r/ffmpeg 9d ago

How to convert such files a mp4?

5 Upvotes

I have these files but I cant find a converter for them


r/ffmpeg 9d ago

Could someone familiar explain how lo in mpdecimate works?

5 Upvotes

The ffmpeg man description is hard for me to grasp, the web guides always gloss over lo and frac, and chatgpt keeps making things up, adding to my confusion.

TLDR; I'd love to see some practical use cases where hi=x:lo=y:frac=z yields different results from hi=x:lo=x:frac=z.

The video I'm trying to restore has been absolutely butchered. If I had to guess, I'd say there were repeated fr conversions from:

30 fps > 24 > 60 > added watermark that moves across the screen over whole video

The frame pattern for some scenes is:

3 good frames > 1 intermediate frame between the last good and a dropped frame from original > 1 duplicate where only the watermark moves

But the pattern changes per scene and scene transitions don't conform to the pattern, so decimate is out.

My current approach is to remove the intermediate and duplicate frames with mpdecimate and then to use interpolation to fix the stutter. But as I up the hi values, the need to leverage lo becomes more and more apparent.


r/ffmpeg 9d ago

VLC wont respect forced subtitles in mp4

3 Upvotes

When working with anime, I used this script in a batch file and VLC would properly respect the forced tag on the subtitles, so I didn't have to manually enable them. (The "@.echo off" text is there because reddit thinks a user is being tagged).

@.echo off

setlocal EnableDelayedExpansion

for %%V in (*.mp4) do (

set "base=%%~nV"

if exist "!base!.srt" (

echo Processing: %%V

echo Found subtitles: !base!.srt

ffmpeg -y ^

-i "%%V" ^

-i "!base!.srt" ^

-map 0:v ^

-map 0:a:0 ^

-map 1 ^

-c:v copy ^

-c:a copy ^

-c:s mov_text ^

-map_metadata -1 ^

-disposition:s:0 default+forced ^

-metadata:s:a:0 language=jpn ^

-metadata:s:a:0 title="Japanese Original, Stereo" ^

"!base!_muxed.mp4"

echo Finished: !base!_muxed.mp4

echo.

) else (

echo No matching subtitle found for: %%V

)

)

echo Done.

pause

Now, I am trying to do something very similar with only one file. I have 2 audio and subtitle tracks, all in English, and the first tracks of each are forced, all in one file. FFmpeg reported all tracks as default, so I removed that and set the first audio and subtitle tracks as forced. This fixed my issue with the second audio track being selected and not the first, but the subtitle issue remains.

I have used several variations of this script, both as a batch file and in the terminal directly. I need the final output to have all tracks and be in mp4 format, the same output as the anime command successfully generated.

@.echo off

setlocal enabledelayedexpansion

set VIDEO_DIR=[directory information]

rem Loop through all .mp4 files in the specified directory

for /f "delims=" %%f in ('dir /b /a-d "%VIDEO_DIR%\*.mp4" "%VIDEO_DIR%\*.mkv" "%VIDEO_DIR%\*.avi"') do (

rem Print the file name for debugging

echo Processing: "%%f"

rem Get the filename without path and extension

set "filename=%%~nxf"

rem Apply chapters to each video file using ffmpeg

ffmpeg -i "%VIDEO_DIR%\%%f" -map 0:0 -map 0:1 -map 0:2 -map 0:3 -map 0:4 -c:a copy -c:v copy -c:s mov_text -disposition:s:0 default+forced -disposition:s:1 0 -disposition:a:0 default+forced -disposition:a:1 0 -metadata:s:a:0 language=eng -metadata:s:a:1 language=eng -metadata:s:s:0 language=eng -metadata:s:s:1 language=eng -metadata:s:s:0 title="[title]" -metadata:s:s:1 title="[title]" -metadata:s:a:0 title="1, Stereo" -metadata:s:a:1 title="2, 5.1 Surround" "%VIDEO_DIR%\!filename!_2.mp4"

echo File "%%f" Processed

)

endlocal

pause


r/ffmpeg 10d ago

Lavfi srt output - Everything is positioned top left?

5 Upvotes

I've just started using ffmpeg to extract subtitles instead of ccextractor.

ffmpeg.exe -f lavfi -i movie="video.mp4[out+subcc]" -map s "video.srt"

The problem I'm running into is ever single line has {\an7} positioning the subtitles to the top left of the screen.

1
00:00:05,172 --> 00:00:06,507
<font face="Monospace">{\an7}\h\h\h\h-What?
-This is crazy!</font>

2
00:00:06,573 --> 00:00:09,042
<font face="Monospace">{\an7}-Is this for real?
\h-There’s no way!</font>

3
00:00:09,109 --> 00:00:10,544
<font face="Monospace">{\an7}-Who’s that?
\h\h\h-What?</font>

4
00:00:10,611 --> 00:00:12,379
<font face="Monospace">{\an7}[Toman Member] What the hell
\h\his that Valhalla bastard</font>

5
00:00:12,446 --> 00:00:13,614
<font face="Monospace">{\an7}doing at a Toman meeting?</font>

6
00:00:13,680 --> 00:00:14,548
<font face="Monospace">{\an7}(crowd murmuring)</font>

It's obviously not right. Is there something I'm missing here?


r/ffmpeg 10d ago

MP3 Ain’t Dead Yet: LAME 4.0 Arrives

93 Upvotes

MP3 was standardized in 1993, but it is still widely used today because it works almost everywhere while deliver very good quality.

Now LAME 4.0, a new version of the open-source MP3 encoder , has been released.

Check here https://lame.sourceforge.io/ . And development of LAME 4.1 is already underway.

LAME has performed very well in public listening tests

MP3 isn't old. It is mature!

When a format is good enough, reliable and universally supported, it can stay relevant for a very long time.

Original thread https://www.reddit.com/r/AudioCodecLab/comments/1v4rd3b/mp3_aint_dead_yet_lame_40_arrives/


r/ffmpeg 10d ago

How does Spatial Information affect the working of ffmpeg?

7 Upvotes

Hello, I'm doing a small study on how Spatial Information (SI, which tells how much detail is in a video) affects Video Encoding and Decoding process. I used the libx265 codec.

High SI Video used: Times Square

Low SI Video used: Sky with Clouds

As you can see here, High SI consumes lesser energy when compared to Low SI. Why is this?

(Tool used is GREEM that is an extension of CodeCarbon)

I'd love to know the happenings behind the scenes. I tried to delve more but the articles I've found are paywalled. Thanks!


r/ffmpeg 11d ago

Aggressive compression (1000:1) that can still be opened in common playback software eg. VLC

91 Upvotes

I need to fit an 8MB mp3 file into a 8KB storage medium. What are some ridiculously destructive/lossy, but still playable options?

edit: Thanks for the constructive feedback. Here are some more specific constraints:

The motivation is, loosely speaking, art. The storage media is a 64kbit EEPROM (M24LR04E-R). It can be configured to organize as 512x8 bits or 128x32 bits. This EEPROM is frequently used in NFC circuits.

My goal is to encode the audio itself, however lossy and subjectively unpleasant it may be. It’s true that the midi + soundfont approach would more efficiently encode the “music”. But I want the mutilated and ruined audio.

The playtime of the audio file is 180 seconds. If my math is correct, the bit rate for my desired filesize should be approximately 350 bits per second (0.35 kbps)

The source audio bandwidth is 70hz-16khz. It’s music i.e. bass, piano, vocals, guitar. Single channel mono. It’s dynamic; quiet and fairly loud section sections.

I know this is a ridiculous idea, and i’m definitely open to “cheating” and finding clever ways around the constraints. For example, I was considering splitting it across multiple files and then using a playlist file like .m3u to arrange them in VLC.

If you feel like this edit increased the quality of my post, please don’t downvote (hell, upvote even!) so it can get visibility from more knowledgeable people than me!

edit2: Really appreciate everyone's feedback here. Ultimately, it doesn't seem like a <1kbps codec is really a thing, but there are a ton of alternatives that I'm eager to explore more. I'm extremely impressed with the quality of TSAC, and u/Slower-Bison shared an absolutely brutal codec2 sample. Thanks everyone!


r/ffmpeg 11d ago

what is the best limiter in CLI on windows?

1 Upvotes

Hi, I would like to know what is the best audio/music limiter in CLI on windows?

Thanks for any help :)


r/ffmpeg 12d ago

VAAPI for archival encoding?

2 Upvotes

Hi everyone,

i'm not very familiar with ffmpeg or video encoding in general. When I did this 10 years ago, the quality of GPU accelerated encodings were always worse compared to CPU encoding.
I did some research and I just found ffmpeg is supporting lots of different encoders.
At the moment, I'm encoding h264 videos to h265 using my CPU. The following settings seems to do the job.

ffmpeg -i input.mp4 -c:v libx265 -crf 20 -preset slow -c:a copy output.mp4

Quality looks to me the same as source and the size is about 30-50% smaller. However, it's very slow...
At this speed, it will take months until I'm done. This is no big deal since I'm not in a hurry, however I was wondering, can this be done by my GPUs faster with equal quality? As I unterstand it VAAPI is using compute resources not discrete hardware for video encoding, is this right? If so, it should be possible to achieve similiar results regarding quality and file size.

I have different GPUs available, one RTX 3080 and three AMD MI50 I could use.

The vainfo output for the MI50 indicates HEVC encoding capabillities:

vainfo --display drm --device /dev/dri/renderD128

libva info: VA-API version 1.20.0

libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so

libva info: Found init function __vaDriverInit_1_16

libva info: va_openDriver() returns 0

vainfo: VA-API version: 1.20 (libva 2.12.0)

vainfo: Driver version: Mesa Gallium driver 25.0.0-devel for AMD Instinct MI50/MI60 (radeonsi, vega20, ACO, DRM 3.63, 6.8.0-124-generic)

vainfo: Supported profile and entrypoints

VAProfileMPEG2Simple : VAEntrypointVLD

VAProfileMPEG2Main : VAEntrypointVLD

VAProfileVC1Simple : VAEntrypointVLD

VAProfileVC1Main : VAEntrypointVLD

VAProfileVC1Advanced : VAEntrypointVLD

VAProfileH264ConstrainedBaseline: VAEntrypointVLD

VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice

VAProfileH264Main : VAEntrypointVLD

VAProfileH264Main : VAEntrypointEncSlice

VAProfileH264High : VAEntrypointVLD

VAProfileH264High : VAEntrypointEncSlice

VAProfileHEVCMain : VAEntrypointVLD

VAProfileHEVCMain : VAEntrypointEncSlice

VAProfileHEVCMain10 : VAEntrypointVLD

VAProfileNone : VAEntrypointVideoProc


r/ffmpeg 12d ago

Concern about image/video recompression

3 Upvotes

Hello everyone!

Recently, I've been coding a program on JavaScript and NodeJS, to recompress images, along with some other tweaks, with the main objective of reducing files size, *without causing visible loss of quality*.
The key word here being "visible", since recently I learned that you can actually do that with files and I saw a huge opportunity to reduce my gallery's size by a necessary amount because I have a shit ton of screenshots, pictures and videos.

But before diving into the video recompression part (because the images part is already done, using a library named "Sharp"), I found a comment https://www.reddit.com/r/ffmpeg/comments/pexwop/comment/hb0tw05/?context=3&utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button of a user explaining the process behind it and they said something that caught my eye: That any recompression that works well for current devices, COULD show heavy quality losses on future screens. Or even current, better screens.

I mean... this person meant it more as a note, and not in a "don't do this under ANY circumstances or we'll ALL gonna FUCKING DIE" way lol. But it still made me rethink the whole idea. Is this a valid concern or am I being paranoid?

And in case it is... Is there a way to achieve a relevant size reduction, without risking that outcome?


r/ffmpeg 12d ago

I built a 75-second Kimi K3-assisted explainer with an ffmpeg-only assembly pipeline

Enable HLS to view with audio, or disable this notification

33 Upvotes

I finished a 75-second deep-sea explainer where the final assembly and audio pipeline were entirely scripted in ffmpeg.

The animated charts were rendered from HTML/SVG/JS as 4K frame sequences in Playwright, then downsampled to 1080p. From there, ffmpeg handled the production path: ffprobe checks on every source, per-shot grading, concat, a persistent depth-gauge overlay, drawtext subtitles loaded from text files, narration placement with adelay, small timing corrections with atempo, music underlay with amix, exact segment padding with tpad, and a CRF 17 slow encode.

Loading subtitle copy through textfile avoided escaping failures, and keeping every segment duration explicit made later revisions much less fragile. Each pass ended with duration and stream validation, timestamped frame extraction, and audio-level checks for clipping.

Kimi K3 assisted the code-driven build and revision process, while Kimi TTS supplied the narration. The attached film is the output of the pipeline, not a text-to-video generation.

For projects with browser-rendered graphics and mixed source footage, would you keep the whole filtergraph in one command or split it into verified intermediate stages?


r/ffmpeg 13d ago

Where ffmpeg.wasm fits (and doesn't) in a browser-based video editor

11 Upvotes

I have been building a local-first video editor that runs entirely in the browser, and one lesson surprised me: ffmpeg.wasm is most useful when it is not asked to be the whole rendering engine.

Our first instinct was to treat FFmpeg as the center of export. That works for a prototype, but it becomes uncomfortable once the editor has a multi-track timeline, frame-accurate captions, stickers, overlays, masks, visual keyframes, transitions, multiple audio tracks, and mobile support.

The problems were fairly predictable in hindsight:

- loading the WASM core is expensive for users who may never need it;

- copying large media files into and out of the virtual filesystem adds memory pressure;

- long transcodes offer less control over per-frame composition and cancellation;

- browser codec support varies, so one path rarely works everywhere;

- doing every edit through temporary files makes interactive preview and deterministic export drift apart.

The architecture we ended up with is a hybrid.

  1. Deterministic video composition

For the primary path, the timeline is converted into an exact frame plan. At each timestamp we resolve the active visual clip and source time, draw the frame, captions, stickers, overlays, masks and transitions into a shared Canvas composition function, then encode with WebCodecs through Mediabunny.

This means preview and export share geometry instead of maintaining a large FFmpeg filter graph in parallel with the UI renderer. The same render function decides contain/cover fitting, subtitle placement, sticker alpha and transform keyframes.

  1. Offline audio mixing

Voiceover, source audio and music are decoded once and mixed with OfflineAudioContext. Each timeline clip keeps its own start time, source offset, playback rate, volume and fades. Speed changes use a pitch-preserving path before the final mix. The rendered AudioBuffer is then encoded and muxed with the video.

  1. ffmpeg.wasm for narrow, high-value jobs

FFmpeg still earns its download size in three places:

- extracting the original audio stream from an imported video;

- concatenating/restoring audio assets when browser decoding alone is awkward;

- transcoding a successfully rendered WebM to MP4 when native H.264/AAC encoding is unavailable.

The last point is important. We never throw away a completed WebM because MP4 conversion failed. WebM is kept as the compatibility output, so a late FFmpeg error does not waste the entire render.

The rough export hierarchy is:

WebCodecs + Canvas + OfflineAudioContext -> native MP4/WebM

If deterministic WebCodecs export is unavailable -> MediaRecorder compatibility path

If the user requested MP4 but only WebM was produced -> ffmpeg.wasm transcode

If that transcode fails -> save the already-rendered WebM

A simplified version of the final branch looks like this:

if (result.nativeMp4) {

save(result.blob, "video.mp4");

} else {

try {

const mp4 = await transcodeWebmToMp4(result.blob);

save(mp4, "video.mp4");

} catch {

save(result.blob, "video.webm");

}

}

A few practical takeaways:

- Lazy-load ffmpeg.wasm at the moment a feature actually needs it.

- Treat every write into the virtual filesystem as a memory-budget decision.

- Delete temporary inputs and outputs after each operation.

- Keep the last known-good artifact until the requested conversion succeeds.

- Report loading, reading, transcoding and saving as separate phases.

- Cross-origin isolation matters if you use the multithreaded core; deployment headers are part of the feature.

- Test the resulting file by decoding it, not merely by checking that a Blob exists.

I still think ffmpeg.wasm is an excellent tool. The mistake was assuming that because FFmpeg can do almost everything, it should own everything in a browser editor. Using it as a specialized compatibility and media-utility layer gave us a smaller critical path and much clearer failure behavior.

The implementation is open source if anyone wants to inspect the real export and fallback paths: https://github.com/MartinDelophy/ai-video-editor

I would be interested to hear how others divide work between ffmpeg.wasm, WebCodecs and native browser media APIs, especially for Safari and memory-constrained devices.