[](https://packagist.org/packages/danjones000/ffmpeg-mappable-media)
Mappable Media is a plugin for [PHP-FFMpeg](https://packagist.org/packages/php-ffmpeg/php-ffmpeg) which provides a mechanism for mapping individual streams from input to output files.
It allows for greater control regarding specific codecs and metadata from a particular input stream to a particular output stream than the built-in [AdvancedMedia](https://github.com/PHP-FFMpeg/PHP-FFMpeg/#advancedmedia) provides.
The `saveStream` method returns the `Map` that created it. Likewise, the `saveMap` returns the `MappableMedia` that created it. All other methods are chainable.
This will result in two files. The first will be a webm file (suitable for play in a browser) with a `title` field on the file set to "The Greatest Story Ever Hulaed". The second file will copy the first stream from each file directly, and set the language of the subtitle stream to English.
Mostly documentation. There are a lot more ways to use this, including using the `Format` objects from PHP-FFMpeg to set the codecs, and the ability to use callbacks to set additional data on both maps and individual streams.
I also need to figure out how to set the listeners on the codecs to get realtime progress updates (see [Formats](https://github.com/PHP-FFMpeg/PHP-FFMpeg/#formats)). Once that's figured out, I need to document it properly here.