Repository navigation
fix: review fixes, example e2e tests, and Android hardening from #1 - #3
Merged
Merged
Conversation
- A reconfigure forgets the frames the old encoder held, and flush() treats frames the codec never returned as dropped, so it no longer waits forever. - Errors Nitro prefixes with the method name keep their DOMException name (configure() reported NotSupportedError as EncodingError). - Callbacks of a native codec that reset() or configure() replaced are ignored; its decoded frames are released. - A native error, a throwing output callback or an unsupported reconfigure close the native codec. - reset() on a closed codec throws InvalidStateError, a pending flush() rejects with AbortError on reset() or close(), and encoding a closed VideoFrame or AudioData throws TypeError.
…me count Codec2's AAC encoder drops the frames it still holds when the end of stream arrives, so a 1 s sound came out 0.94-0.98 s long. Flush now feeds three frames of silence before the end of stream and keeps the output up to the input plus the encoder's delay (1600 samples). Output timestamps count AAC frames from the first input's timestamp, and start over after a flush.
…t cannot start - Frames MediaCodec dropped (a timestamp that does not grow) come out as empty chunks at the end of stream, so flush() no longer waits for them. - A setColorSpace failure (HDR) reports NotSupportedError through the error callback instead of escaping. - A failed start stops the codec and its surface, and closes the frame's fence.
…Ls, parent directories created Relative paths resolve under /data/user/<user>/<package>/cache, so work profiles and secondary users get their own; file:// URLs are percent-decoded; writing a file creates the directories it goes in.
Also E2E_ANDROID_HOST, for an emulator that adb reverse does not reach, and how to run the tests beside other projects.
…ne module The export screen and the e2e tests load the card the same way. Named lottieCard.ts, as Metro resolves ./card to card.json before card.ts.
… its own code Tests.tsx hands the app's exportVideo, card loading, openSource, compress, supportedCodecs and settings to the tests. The card is exported silent, with its sound, and as 10-bit HLG (skipped without a Main 10 encoder). Videos made with ffmpeg on the host (3 s of testsrc2 at 1280x720, one tagged as a phone's portrait recording) are compressed once per supported codec, without sound, at 15 fps, and upright, and checked with ffprobe: size, codec, rotation, duration, frame order, audio and fast start.
VideoToolbox may return frames in decoding order: the Simulator's decoder does, with temporal processing or not. A stream with B-frames then reached the encoder out of order, and compressing it to HEVC failed in Mediabunny. Decoded frames now wait, sorted by timestamp, until more than the stream's reorder depth are held: max_num_reorder_frames (H.264 VUI) or sps_max_num_reorder_pics (HEVC SPS), 4 when the SPS does not say, and one more for each frame that still comes late. flush() outputs the frames held; close() and errors drop them. The e2e test decodes x264 High B-frames and checks the frames come in time order.
flush() padded with three frames of silence and an end of stream even when no sound had been fed since the codec started (or since the last flush), so two chunks of silence reached the output callback. Skip the padding and the end of stream then, and keep the codec as it is. Refs #1
Codec2 encoders read "profile", OMX ones "aac-profile"; set both. The key is spelled out, since AMEDIAFORMAT_KEY_PROFILE is API 28. The e2e MP3 to AAC transcode now checks the stream is AAC-LC (a guard: the emulator's encoder was LC before too).
The AAC encoder came from createEncoderByType, but the frames kept after flush() assumed FDK's delay of 1600 sample frames: with another encoder the end of the sound could be cut, or padding kept. Ask for c2.android.aac.encoder, then OMX.google.aac.encoder (both FDK) by name, falling back to the platform's default; apply the 1600 only to those, and keep every frame for an encoder of unknown delay. The encoder's name is logged, through a codecName() helper in Common.hpp. The delay and keep-frame rules live in AudioRules.hpp, with no NDK, checked by a host test: yarn test:cpp (android/src/test/cpp).
…ng fed flush() always queued an end of stream and then called AMediaCodec_flush. With nothing fed since the last flush (or since configure) it now does neither: an end of stream as the first input, or a codec flushed before its first output format, can lose the AAC config (API 29's c2.android.aac.decoder, b/141097367). When input was fed but no output format came out, the drained codec is replaced by a new one from the config instead of flushed. That is done for any decoder, not only on API 29 with c2.android.aac.decoder, so neither the name nor the API level is checked. The rule is in AudioRules.hpp, covered by yarn test:cpp. A new e2e test flushes an AudioDecoder before and between two decodes of a whole sound; it passed on the API 35 emulator before this change too.
The e2e test added for Android showed iOS doing the same: a flush with nothing encoded since the last one (or since configure) ended the converter's stream and output its priming as three chunks of silence. Skip the end of stream then.
…eration VideoDecoderConfig.hardwareAcceleration reaches the native decoder (NativeVideoDecoderConfig.hardwareAcceleration, nitrogen regenerated). On Android, Capabilities.findVideoDecoders lists the decoders from MediaCodecList in the platform's order: "prefer-software" puts the software-only ones first, "prefer-hardware" the others. Each is created by name, configured and started in turn; one that fails gives way to the next, and with no list the platform's choice is used. The chosen name is logged. iOS leaves the choice to VideoToolbox.
… samples only that Software decoders (c2.android.avc.decoder) pad the width to a multiple of 128: a 360x640 picture came in a 384-wide buffer, the frame said 384, and the encoder squeezed all of it, padding included, into 360. A decoded surface now has the image's crop size (AImage_getWidth/Height), which clones keep, and the GL blit scales its texture coordinates to that part, stopping one texel short of the crop edge so filtering reads no padding. Pool and wrapped surfaces keep their full size. The new e2e test decodes a 360x640 clip with a red right edge on the software decoder and re-encodes it: red before the fix (codedWidth 384, padding at x=355), green after.
…:0 layout Only YCbCr_420_888 buffers were named "NV12"; c2.android.avc.decoder's YV12 and vendor-private layouts read "unknown", so frame.format was null. A decoder's surfaces now fall back to "NV12" (the format the decoder is configured for), and clones keep it. The e2e tests for the software decoder and the 360x640 clip assert the format: null before, NV12 after.
… none A VideoDecoderConfig without codedWidth/codedHeight left the Android decoder at 1920x1080, so c2.android.avc.decoder sized its input buffers at 2 MiB and failed a 4K key frame with "chunk larger than the input buffer". The size now comes from the avcC's SPS (src/lib/avc.ts, unit tested on libx264 records and a hand-written SPS with scaling lists, POC type 1, fields and emulation prevention), and the decoder asks for Media3's max-input-size (3/4 byte per pixel). The error now says the chunk's size and the buffer's.
…of stream A flush with no chunk queued since configure() or the last flush now resolves at once, without an end-of-stream input (which some decoders mishandle as their first input) or AMediaCodec_flush. The e2e test (empty flushes before and between two decodes of the clip, on the default and the software decoder) passed before the change too: a regression test only.
Sets allow-frame-drop to 0 (surfaces drop excessive frames by default from Android 10). Untested hardening: our drain renders one picture at a time and waits for the ImageReader to take it, so no drop is reachable on the emulator; the decoder e2e tests pass with it.
…frame With JS holding all 16 pictures of the decoder's ImageReader, the drain waits for it (as a web decoder stalls until frames are closed), but the input thread gave up after 5 s without an input buffer: "EncodingError: no input buffer", with 16 of 90 frames out. Input now waits as long as JS holds the pictures. flush()'s 10 s stall limit also counts that wait as progress (not reached by the test: the input wait comes first there). test(e2e): hold the first 16 decoded frames for 12 s, expect all 90 frames in order and no picture lost.
…d only iOS has no limit on the pictures JS holds, so its decoder never waits.
Guards the input wait added for held frames: close() still returns at once with the input and drain threads waiting for JS (33 ms on the emulator). Green from the start.
…s.java EncoderRules holds the checks Capabilities.java applied to MediaCodecList's answers, behind an interface MediaCodecInfo's capabilities are adapted to, so plain JUnit can drive them with made-up encoders (yarn test:jvm). No change in behaviour.
…rements isConfigSupported() refused an encoder whose listed bitrate range or size-and-rate limits a config went past (c2.android.avc.encoder lists at most 12 Mbps, and about 30 fps at 1080x1920), although configure() then encoded it fine through the by-type fallback. As in Media3, an encoder is now chosen by size, profile and input color format only. The bitrate asked for is clamped into the range of the encoder made, and the frame rate is floored, and ignored below 1.
With no bitrate, width * height * fps * 0.1 went to the encoder whatever its range: 4K at 120 fps asks for about 99.5 Mbps, and vision-camera saw an 80 Mbps encoder refuse its 100 Mbps default (#2208). It is now clamped into the range of the encoder made, as a given bitrate already is.
…0p/2160p by CamcorderProfile An encoder was refused for a size it lists only differently: encoders listing a 16-pixel alignment often take 1080 rows (ExoPlayer #6551), encoders limit macroblocks rather than orientation, and some Samsung, Huawei and Pixel 6 encoders list 1072 rows for H.264 1920x1080 and 2144 for HEVC 3840x2160 (b/222095724, b/229825948). As in Media3, a size is now also checked aligned up to the encoder's alignment, swapped, and for those two sizes vouched for by the device's CamcorderProfile. The encoder is still configured with the size asked for.
…software one The encoder was the first in the platform's order that took the config, so a software encoder listed before a hardware one that also takes it (now more often, with the lenient size, rate and bitrate checks) made the export run in software. A hardware encoder that fits is now chosen first, and a software one only when none does. isConfigSupported() and configure() still share the choice.
…rate; yarn test:jvm
…(review) The encoder is configured with the size asked for, which encoders aligned to 2 refuse when odd: 1279x720 and 641x481 answered supported. The aligned-up reading now applies to even sizes only (the 1080-rows case).
…read leniently (review) configure() is given the size asked for and falls back on no other encoder, so a hardware encoder only the lenient size reading (aligned up, swapped, CamcorderProfile) lets through could be chosen over a software one that takes the size, then refuse it at configure time. As in Media3, encoders that take the size strictly come first (H.264's optional profile dropped before the lenient reading), then the lenient ones; hardware first in each.
…ile on its own The codec string's level (avc1.PPCCLL) now reaches the native encoder (NativeVideoEncoderConfig.level; iOS still picks the level itself). Android gives the encoder the profile together with a level, as Media3 and Chromium do (OMX encoders refuse a profile alone): the codec string's level, raised to what the size and frame rate need, capped at the encoder's highest for the profile. An encoder that does not list the profile gets the next one down that it lists (High, Main, Baseline). The configure retries no longer cap the frame rate and drop the operating rate when they drop the profile: the rate settings are relaxed with the profile kept, then again without it (EncoderAttempts.hpp). The attempt that succeeded is logged. On emulator-5580 (c2.android.avc.encoder, libavc, no High), avc1.640028 at 1280x720 now gives Main at level 4.0 (it gave Baseline at the encoder's default 4.1); avc1.42001f at 1920x1080 is raised to 4.0.
…and say why isConfigSupported's encoder no longer is the only one: every encoder that may take the config is a candidate, in the order EncoderRules ranks them (EncoderRules.candidates; choose() is its first), software ones included. When one refuses every configure attempt, or its input surface or start() fails, the next is tried; the one that started (and its attempt) is tried first on the restarts after a flush. When none starts, the NotSupportedError names each encoder and the status of each attempt by name, as MediaCodec returned it (e.g. -12 NO_MEMORY, -10000 AMEDIA_ERROR_UNKNOWN), instead of the last status alone.
The input surface drops a frame whose timestamp does not move forward, and a repeated timestamp overwrote the duration of the frame before it. Frames now go to the codec with a pts nudged 1 us past the last one when it does not increase, and each output takes back the real timestamp and duration of its frame from a FIFO kept in draw order (no B-frames: output order is input order). An output pts matching no frame (b/235045165's 0 on the second-to-last frame) takes the oldest one. Timestamps are not respaced. Host test (yarn test:cpp) for the FIFO; e2e test with repeated and backward timestamps, and the two-frames-one-timestamp test now expects 4 chunks on Android.
request-sync applies to the next frame the encoder takes, which can be one drawn earlier and still queued: key frames landed 2 to 9 frames early (e.g. at 5, 18, 29, 44, 45, 68 for 7, 20, 33, 50, 51, 77). Before asking, encode() now waits, at most 200 ms, until every frame drawn has come out (or been dropped); each output wakes it. E2E test: 90 frames queued at once at 64x64 and 1280x720, key frames at known indices, and exactly those chunks are key.
…trol (review) The fix for repeated and backward timestamps leaves part of the issue item open: Chromium and WebRTC feed the codec evenly spaced timestamps because some rate control (WebRTC's Exynos frame-rate bitrate adjuster) assumes a fixed frame rate. The codec here still gets the real ones. Say so in the header instead of in passing.
Some encoders lose the last frame when the end of stream follows it at once (b/301603935). flush() now waits, up to 200 ms, for every drawn frame to come out before it signals the end of stream, as Media3 does. The e2e test (1, 2 and 3 frames per flush, three times) is a regression guard: the emulator's encoder does not lose the frame.
…eout
flush() rejected 'flush timed out' 10 s after asking for the end of
stream, whether or not the encoder was still making progress, and an
encoder that never outputs the end of stream (b/365484741) always hit
it. Now flush() times out only after kStallTimeout with no output, and
when every drawn frame came out and nothing more for 1 s, it stops the
codec (so nothing comes after it resolves) and resolves; the next
encode() starts a new codec.
Adds a debug-only fault hook (debug.webcodecs.fault, compiled out with
NDEBUG) for the e2e tests: venc-no-eos made the new test red before the
fix ('EncodingError: flush timed out' twice).
…s not left blocked When the codec stops taking output (here: never drained), it stops taking input, and the GL thread blocks in eglSwapBuffers (BufferQueueProducer:: dequeueBuffer) on the next frame. The drain thread then reports the stall, but close()'s stop() queues behind the blocked draw forever: the codec is never released, and the destructor's shutdown() waits without end. fail() now stops the codec from whatever thread it runs on (abortCodec, once per codec, under its own mutex): the input surface is abandoned and the blocked draw returns. shutdown() waits 2 s for the GL thread, then stops the codec itself and waits 2 s more. The e2e test uses the venc-stall-output fault (debug builds). Red before: no 'video encoder: released' line ever (wc-venc-gl stuck in Surface::dequeueBuffer under eglSwapBuffers, from debuggerd -b).
…urns close() only posted the codec's stop() to the encoder's GL thread, so a configure() right after it (JS closes the old native encoder, then makes a new one) made the new codec while the old one was still there: devices with a limit on codec instances refuse the second (Media3 b/283768701). close() now runs shutdown(), as the video decoder does: it waits for the GL thread to stop the codec, bounded (2 s, then the codec is stopped from the JS thread and 2 s more), and the destructor's shutdown() is then a no-op. Red before (venc-slow-stop:800 fault, logcat order): made, made, then released; now made, released, made.
With venc-stall-output:60, nothing has failed when close() comes and the GL thread is blocked drawing: close() waits 2 s, stops the codec from the JS thread, and returns (logcat: 'not stopped after 2000 ms', then 'released'). A regression test for the bounded shutdown(); not seen red (it came after the fix).
…e (review) fail() stopped the codec (abortCodec) from whatever thread failed. From the GL thread (a draw that fails, a color space change after the first frame, signalEndOfInputStream failing) that could run while the drain thread was copying from an output buffer, which the stop takes back; and shutdown()'s abort, from the JS thread, had the same race, and in HDR mode could stop the codec under a P010 copy into an input buffer. - fail() stops the codec only when the drain thread asks (stall, codec error), where no output buffer is held; the GL thread is not blocked when it fails itself, and close() releases the codec as usual. - The drain thread holds _codecMutex from getOutputBuffer to releaseOutputBuffer, so abortCodec() (shutdown() included) waits for a copy, and an index taken before an abort is dropped untouched. - Surface input only: an HDR (buffer input) codec is never stopped from another thread; its waits are bounded and end on _failed. Test: a debug-only fault (venc-draw-fail:N) fails the Nth draw on the GL thread. Red before: logcat had 'stopping c2.android.avc.encoder from another thread' from the GL thread's tid. The buffer race itself is not reproduced by a test.
…hout overflowing rgba16fToP010 kept width/2 chroma sums, so the last column of an odd width wrote past them, and the queued size (stride * sliceHeight * 3 / 2) dropped the last chroma row of an odd slice height. The converter moves to P010.hpp (no NDK) with a host test under ASan: (width+1)/2 chroma pairs, each the average of the samples it covers, a stride that fits them, and room for (sliceHeight+1)/2 chroma rows. A reported slice height below the picture's is ignored.
…me when it never signals GlBlitter::waitFence fell back to glFinish() when eglCreateSyncKHR refused the fence (which waits only for our own context, not the producer's), ignored eglWaitSyncKHR's result, and had no bound: a fence that never signals (a hung GPU) blocked the GL thread, and close()/flush() behind it, for ever. Now a shared helper (Fence.hpp, host-tested with pipes: timeout, EINTR, POLLERR/POLLNVAL) first waits on the CPU for at most 5 s; a timeout throws, which fails the encoder with an EncodingError. The GPU wait that follows is on a signalled fence, its failure logged. The HDR path's waitFenceCpu uses the same bounded wait. A debug-only fault (venc-fence-hang) swaps each frame's fence for a pipe that never signals: before this, the e2e test saw every frame encoded.
…re locking it The HDR path waited up to 1 s on the frame's fence, ignored the result and then locked the buffer with no fence: a late frame was read half written. It now uses awaitFence (5 s, throws), so a timeout fails the encoder with an EncodingError, and AHardwareBuffer_lock takes -1 only after the fence was seen to signal (handing it to gralloc would make its wait unbounded). The buffer is unlocked by a scope guard.
…PU-readable createSurfacePool asks AHardwareBuffer_isSupported (API 29, resolved at run time) for the pool's own size, format and usage, and throws NotSupportedError up front instead of failing at the first acquire or lock. isConfigSupported answers false for Main 10 on such devices, so apps fall back to SDR. An e2e test checks the emulator's RGBA16F pool is still made (a regression test: it passed before the change too).
…frame Some drivers keep, and tile-based GPUs load, the window buffer's old contents unless it is cleared (webrtc:5147). Not observable on the emulator: the quad covers the whole surface; the export pixel tests guard the output.
…uffer Devices with no config that is both window and pbuffer (and recordable) failed every encoder with "eglChooseConfig failed". Then a window-only recordable config is taken. A pbuffer that cannot be made is no longer ignored: the context goes on surfaceless where EGL_KHR_surfaceless_context is there, and fails with the EGL error otherwise. EGL errors are now in the messages. Untested hardening: the emulator has the combined config (and no surfaceless contexts); the encoder e2e tests guard the usual path.
…n read
A VideoFrame from new VideoFrame({ handle }) only references a foreign
AHardwareBuffer (a camera's, say), whose producer may write the next
picture into it as soon as encode() returns, while the GL thread had not
drawn it yet: the frame came out with the later picture. For such
buffers encode() now waits (at most 10 s) until the GL thread has read
the buffer (after glFinish, before the swap; for HDR after the P010
copy), or dropped the frame. Pool and decoder buffers are not reused
while held, so they do not wait.
The e2e test reuses a pool buffer as the producer would, with a debug
fault (venc-slow-draw) that delays every draw: red before the fix (the
wrapped frames came out green, [0,254,0]), green after.
…frame is not drawn (review) encode() waited for a foreign buffer's FrameRead while holding its own reference to it, so the destructor that was meant to signal a frame left unread could not run before the 10 s wait ended. A frame whose draw failed, or one that came to an encoder that had already failed, blocked the JS thread for 10 s and then threw EncodingError. encode() now keeps only the future, the GL task owns the only FrameRead, and a scope guard in the task signals it on every path out of the task (the failed early return, a throw from start(), the fence wait or the draw). The e2e test wraps pool buffers and makes the second draw fail (venc-draw-fail:2). Red before the fix: encode() took [6, 10002, 10004] ms and threw "the frame was not read within 10000 ms" twice. Green after: [1, 1, 0] ms, nothing thrown, one EncodingError to the error callback.
56 of 81 tasks
|
🎉 This PR is included in version 0.1.2 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
github-actions Bot
pushed a commit
that referenced
this pull request
Nov 25, 2026
## [0.1.3](v0.1.2...v0.1.3) (2026-11-25) ### Bug Fixes * **android:** put out a GOP that goes back in time after the one before it ([e0eb929](e0eb929)) * **example:** load the export's sound in Android release builds ([0cd1af8](0cd1af8)) * **ios:** decode AAC from its AudioSpecificConfig, ADTS, and restart the AudioDecoder on flush ([b78c863](b78c863)), closes [#3](#3) [#2](#2) [#10](#10) [#2](#2) * **ios:** decode from a CRA or recovery point, drain the reorder buffer when a key frame goes back in time ([5c3e02a](5c3e02a)) * **ios:** forward bitrateMode, refuse quantizer, and tag the range the encoder writes ([05e9063](05e9063)) * **ios:** keep small AAC packets alive while the AudioConverter reads them ([d8f2742](d8f2742)) * **ios:** pin a wrapped surface's use count until the frame is closed ([99d3aa6](99d3aa6)) * **ios:** start an AudioDecoder over on flush with a new AudioConverter ([9cb6fd4](9cb6fd4))
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes from a code review of 0.1.1, new e2e tests for the example app's own flows, and work on the Android items listed in #1. Each fix is its own conventional commit, so please merge with a merge commit or rebase, not squash: the commit messages make the changelog.
What changed
From the code review (JS and both platforms)
flush()after a reconfigure, no output from a replaced codec afterreset()/configure(), and the native codec is released when a codec errors.configure()keep their DOMException name (NotSupportedErrorinstead ofEncodingError).reset()on a closed codec throws, a pendingflush()rejects withAbortError, closed frames throwTypeError.file://URLs are percent-decoded, parent directories are created.AudioEncoderstarts a new timeline afterflush(), andVideoDecoderoutputs frames in presentation order (sources with B-frames came out in decode order).New e2e tests for the example app
The tests now call the example's own
exportVideo(silent, with sound, HDR) andcompress(each codec the device has, no sound, another frame rate, a rotated clip). The source clips are generated with ffmpeg at test time, so no video files were added.Android items from #1
hardwareAcceleration; frames have the visible size, not the padded buffer's, and the encoder samples only that area; frames reportNV12; the size comes from the SPS when the config has none, withmax-input-sizeset;flush()with nothing queued queues no end of stream;allow-frame-dropis 0.flush()ends when every frame came out, with no fixed 10 s timeout; a failed codec is stopped so the GL thread is not left blocked;close()releases the codec before returning.encode()of a wrapped surface returns once its frame has been read.profiletoo; FDK's encoder is taken by name and only it gets the 1600-sample trim;flush()with nothing encoded or decoded outputs nothing.Tests
yarn test:jvm) and C++ host tests under ASan and UBSan (yarn test:cpp, also in CI).debug.webcodecs.fault, compiled out of release builds) lets e2e tests make the Android encoder hang, drop its end of stream, or never signal a fence.yarn tsc,yarn lint, unit 63/63, C++ host 5/5, JVM 18/18, e2e 56/56 on an Android emulator (API 35) and 56/56 on the iOS Simulator.Most items had a test that failed before the fix. These did not, and land as hardening:
allow-frame-drop, the AACprofilekey and per-encoder trim, decoder flush with nothing queued, the EOS wait on short encodes, the HDR lock fence, the GL hardening (glClear, EGL fallback), and the RGBA16F probe. The emulator only has Android's ownc2.android.*codecs, so OMX encoders, vendor encoders and real GPUs are untested.Not done
From #1: the decoder release fence, the black frames on Snapdragon 8 Gen 3, the vendor RGB to YUV matrix, the Dawn AHardwareBuffer import (react-native-webgpu), aligning the P010 stride when the codec doesn't report one, and rotation, mirroring and chroma for wrapped camera frames. Timestamps are not respaced for rate control, and
configure()keeps its last-resortcreateEncoderByTypewhen nothing fits.Refs #1