If user wants to present multiple files as a single seamless file and/or user wants to use only a part of a file, then one can utilize a playlist for that purpose. Playlist is a simple text file with a list of file paths; each file must be located on the new line, like this:
Playlist file extension must be .pls or .m3u.
All files in a playlist MUST have exactly the same encoding settings, including low level parameters; i.e., they must be recorded from one source or encoded using the same encoder/tool with the same settings. User CAN'T combine files recorded from different sources in one playlist. If a user wants to do it, then one has to transcode all the files to exactly the same output format using exactly the same encoding settings. A user can do it with FFmpeg, for example.
In addition to that, playback interval command is supported:
Both <from> and <to> parameters are optional. If <from> is not specified, then it is assumed that data will be read from the beginning of a file. If <to> is not specified, then it is assumed that data will be read till the end of a file.
When specified, <from> and <to> must be in a format parseable by the TimeSpan class.
It should be understood that position of <from> and <to> will be actually aligned to the keyframes nearest to them, because splicing of several files can be done only on keyframes. For <from>, by default, a keyframe that is equal to or preceding the indicated position will be used. For <to>, a keyframe that is equal to or following the indicated position will be used. But keyframe alignment can be changed in file opening parameters. Accordingly, the real range of every file with previously set parameter EXT-X-VAST-INTERVAL can be slightly different from what has been defined by a user because of keyframes alignment.
Both <from> and <to> intervals are specified:
Only <from> is specified (reading till the end of a file):
Only <to> is specified (reading from the beginning of a file):
This line has to be placed before the line with file path, e.g.:
Playback interval indicating NTP timestamps is also supported:
When specified, <from> and <to> are absolute NTP timestamps. They can be decimal or hexadecimal numbers.
EXT-X-VAST-NTP-INTERVAL can only be used with mp4 files written by VASTreaming library and containing NTP timestamp.
Positions of <from> and <to> are also aligned to the keyframes nearest to them, because splicing of several files can be done only on keyframes. For <from>, by default, a keyframe that is equal to or preceding the set position will be used. For <to>, a keyframe that is equal to or following the indicated position will be used. But keyframe alignment can be changed in file opening parameters. Accordingly, the real range of every file with previously set parameter EXT-X-VAST-NTP-INTERVAL can be different from what has been defined by a user because of keyframes alignment.
FileCache is a class which can be used for caching internet and local files, including video and image files. In case of mp4, FileCache implements advanced algorithm of metadata sharing, described in the previous paragraph; i.e., it saves memory and processor time while opening new file copies.
FileSource is an object implementing interface of IInteractiveMediaSource and allowing use of a playlist as a single seamless file. Separate files inside the playlist can be .mp4, .mp3, .wav, or .ts. Besides, a playlist can be set not only as a text file but as an inline URI.
Supported URI format is "content:\n<inline-playlist>", for example:
MpaSource - an object inherited from IInteractiveMediaSource which allows opening MP1, MP2, MP3 audio files.
WavSource - an object inherited from IInteractiveMediaSource which allows opening WAV audio files.
VASTreaming library provides user with several utilities for manipulating mp4 files directly from a user code.
AudioMixer allows mixing audio tracks of two or more mp4 files into one output audio track. Video is copied from the first source file.
Concatenator- a utility for splicing of two or more mp4 files. It is also can be used for cutting one file if user sets only one file as a parameter and indicates start and end timestamps for this file.
ImageExtractor is intended for extracting of an image from a previously set position of an original mp4 file and saving it as a JPEG image.
VideoMixer is intended for mixing source mp4 file with one or more images including animated images e.g., GIFs.