View Source ExMP4.Writer (MP4 Reader and Writer v0.1.0)
This module contains functions to write MP4.
Summary
Types
@type t() :: %ExMP4.Writer{ ftyp_size: integer(), mdat_size: integer(), next_track_id: integer(), tracks: %{required(non_neg_integer()) => ExMP4.Track.t()}, writer_mod: module(), writer_state: any() }
Functions
@spec add_track(t(), ExMP4.Track.t()) :: {ExMP4.Track.id(), t()}
Add a new track.
A track is created by instantiating the public fields of ExMP4.Track
except for id
. The
id is assigned by the writer.
Create a new mp4 writer that writes to filesystem.
The same as new/1
, but raises if it fails.
Write the mp4 header.
This function should be called first before adding tracks.
@spec write_sample(t(), ExMP4.Track.id(), ExMP4.Sample.t()) :: t()
Write a sample.
@spec write_trailer(t()) :: :ok
Write the trailer and close the stream.