video_normalizer library

Normalizes picked videos into a standard MP4 (H.264 + AAC-LC, SDR 8-bit, at most 720p30 by default) that plays on current and older Android and iOS devices. All processing is local.

Start with VideoNormalizer.instance.

Classes

AudioPlan
The audio part of ResolvedEncoderSettings.
BlobVideoInput
A VideoInput backed by a browser Blob or File.
ContentUriVideoInput
A VideoInput identified by an Android content:// URI.
FileUrlVideoInput
A VideoInput identified by an iOS file:// URL.
FileVideoInput
A VideoInput identified by an absolute file system path.
FileVideoOutput
A VideoOutput that is a file on the device.
FrameRatePlan
The frame-rate part of ResolvedEncoderSettings.
ResolvedEncoderSettings
Everything a platform needs to transcode one source, fully computed.
VideoBatchItem
The outcome of one request of a batch: a result or an error, never both.
VideoBatchProgress
How far a batch has come.
VideoCapabilities
What the current platform can do, independent of any particular input.
VideoEncoderCapability
One encoder a platform offers.
VideoInfo
What analysis found in a video.
VideoInput
Where a video comes from.
VideoNormalizationBatch
A list of requests that is processed one after the other.
VideoNormalizationConfiguration
The output specification a request is normalized to.
VideoNormalizationDecision
The outcome of comparing a source with a configuration.
VideoNormalizationRequest
One normalization job.
VideoNormalizationResult
The outcome of a successful request.
VideoNormalizationStatistics
Numbers describing what a request did. Unavailable values are null.
VideoNormalizationWarning
A non-fatal remark about how a request was carried out.
VideoNormalizer
Normalizes videos into a standard MP4 that plays on current and older devices.
VideoOutput
The normalized video.
VideoProcessingProgress
A progress update for one request.

Enums

AudioCodec
Audio codecs distinguished by analysis.
AudioMode
What happens to the audio of the source.
FrameRateMode
How the output frame rate is derived from the source.
H264Level
H.264 levels, with the limits from Table A-1 of the specification.
H264Profile
H.264 profiles this package can ask an encoder for.
HdrFallback
What to do with HDR input when it cannot be tone-mapped to SDR.
HdrFormat
The dynamic-range format of a video stream.
MetadataPolicy
What happens to identifying metadata in the source.
NormalizationReason
Why a source is not left untouched.
SkipPolicy
Whether a source that already meets the output specification is skipped.
VideoCodec
Video codecs distinguished by analysis.
VideoContainer
Container formats distinguished by analysis.
VideoNormalizationAction
What was done, or would be done, with a source.
VideoPreset
The built-in output presets.
VideoProcessingStage
The stages a request moves through.

Constants

videoOutputMimeType → const String
The MIME type of every output this package produces.

Typedefs

WebBlob = Blob
A browser Blob.
WebFile = File
A browser File.

Exceptions / Errors

AudioProcessingFailed
Audio decoding, resampling or encoding failed part-way through.
BrowserCapabilityError
The browser lacks something the web implementation requires.
DecoderInitFailed
A decoder could not be created at run time.
EncoderConfigurationUnsupported
The resolved settings were rejected by the live encoder.
EncoderInitFailed
An encoder could not be created at run time.
HdrConversionUnsupported
The source is HDR and this device has no way to tone-map it to SDR.
InsufficientMemory
The device or the browser tab ran out of memory.
InsufficientStorage
There is not enough free storage for the output.
InternalError
Anything that could not be mapped to a more specific error. Always a bug worth reporting; details carries the native error and stack.
InvalidInput
The file is missing, unreadable, empty, has no duration, or is not a video.
MuxingFailed
Writing the MP4 container failed.
NormalizationCancelled
The request was cancelled by the caller.
NormalizationTimeout
The request's timeout elapsed. The job was cancelled and cleaned up.
OutputValidationFailed
The produced file does not match the resolved settings. It was deleted.
PermissionDenied
Access to the file or URI was refused.
TargetSizeUnreachable
The requested target file size cannot be met at an acceptable quality.
TranscodingFailed
Decoding, frame processing or encoding failed part-way through.
UnsupportedAudioCodec
The platform cannot decode the source's audio codec.
UnsupportedContainer
The platform cannot read the source's container.
UnsupportedVideoCodec
The platform cannot decode the source's video codec.
UriAccessFailed
A content URI or security-scoped URL could not be opened.
VideoNormalizationException
The base of every error this package reports.
WorkerInitFailed
The web worker could not be started.