Transcoder Input/Output Requirements and Limitations
Using file or stream as input
A file input is always allowed. It is a valid source for all media formats (defined in the StreamType enumeration).
An implementation of primo::Stream can be used as input if it supports reading and seeking. A seekable primo::Stream is equivalent to a file and therefore it can be used with all media formats (StreamType).
Note:
A future version of AVBlocks will support the usage of non-seekable streams as Transcoder inputs for certain media formats.
A future version of AVBlocks will support push mode for certain container formats.
When a video stream is pushed the video data must be provided in whole video frames (compressed or uncompressed). The MediaSample pushed to the transcoder must describe a single video frame. The video frame may be combined with header frames.
When an audio stream is pushed the audio data may be pushed in any fragments.
Using file or stream as output
A file output is always allowed. It is a valid sink for all media formats (defined in the StreamType enumeration ).
An implementation of primo::Stream can be used as output if it supports writing. For certain media formats seeking is also required. It is needed in order to overwrite some meta structures of the generated stream. Seeking is required for the following media formats: WAVE, MP4, WebM, ASF (Windows Media).
Using Transcoder pull mode to get output
Only elementary streams and uncompressed video/audio may be pulled. Container formats cannot be pulled.
When a video stream is pulled the retrieved MediaSample contains a single and complete video frame (compressed or uncompressed).
When an audio stream is pulled the audio data is retrieved in one or more compressed frames or uncompressed LPCM samples.