Video Export Notes
Transparent VP8 WebM with ffmpeg.wasm
When transparent VP8 WebM is encoded from a raw RGBA stream, crf can appear to do nothing even though the argument is being passed correctly.
Why this happens:
- The app feeds ffmpeg a
rawvideoinput stream, not a PNG frame sequence. - FFmpeg's
rawvideodemuxer declares a fixed input bitrate based on width, height, pixel format, and framerate. - For RGBA video this reported input bitrate is enormous, often hundreds of Mbps.
- If
libvpxthen sees a much smaller explicit-b:vtarget, its rate control can collapse into an effectively strict bitrate clamp. - In that state, output size tracks duration and
-b:vmuch more thancrf, so different CRF values can produce nearly identical files.
Practical consequence:
crfis not reliably meaningful for transparent VP8 WebM when the input israwvideoand-b:vis set too low.
Why PNG-sequence examples behave differently:
- With an image-sequence input such as
frame_%03d.png, the demuxer does not report the same huge fixed source bitrate. - That means
libvpxis less likely to abandon CRF-driven rate control.
Project takeaway:
- For the app's transparent
VP8 WebMmode, avoid treating a low-b:vvalue as harmless. - If CRF tuning seems ignored, the first thing to check is whether the explicit bitrate target is forcing
libvpxinto a near-CBR path.