mirror of
https://github.com/axiomatic-systems/Bento4.git
synced 2026-01-12 00:18:59 +08:00
new MkDocs docs
This commit is contained in:
@@ -1,19 +1,58 @@
|
||||
site_name: Bento4
|
||||
|
||||
use_directory_urls: false
|
||||
use_directory_urls: true
|
||||
|
||||
nav:
|
||||
- Home: index.md
|
||||
- Documentation:
|
||||
- Overview: documentation/index.md
|
||||
- MPEG DASH:
|
||||
- Getting Started: developers/dash/index.md
|
||||
- Encryption & DRM: developers/dash/encryption_and_drm.md
|
||||
- Multi Bitrate Audio: developers/dash/multi_bitrate_audio.md
|
||||
- Codecs: developers/dash/codecs.md
|
||||
- Subtitles: developers/dash/subtitles.md
|
||||
- Sample Content: developers/dash/sample_content.md
|
||||
- HLS: developers/hls/index.md
|
||||
- CMAF: developers/cmaf/index.md
|
||||
- Tools:
|
||||
- mp4info: documentation/mp4info.md
|
||||
- mp4dump: documentation/mp4dump.md
|
||||
- mp4edit: documentation/mp4edit.md
|
||||
- mp4extract: documentation/mp4extract.md
|
||||
- mp4encrypt: documentation/mp4encrypt.md
|
||||
- mp4decrypt: documentation/mp4decrypt.md
|
||||
- mp4dcfpackager: documentation/mp4dcfpackager.md
|
||||
- mp4compact: documentation/mp4compact.md
|
||||
- mp4fragment: documentation/mp4fragment.md
|
||||
- mp4split: documentation/mp4split.md
|
||||
- mp4tag: documentation/mp4tag.md
|
||||
- mp4mux: documentation/mp4mux.md
|
||||
- mp42aac: documentation/mp42aac.md
|
||||
- mp42avc: documentation/mp42avc.md
|
||||
- mp42hevc: documentation/mp42hevc.md
|
||||
- mp42hls: documentation/mp42hls.md
|
||||
- mp42ts: documentation/mp42ts.md
|
||||
- mp4dash: documentation/mp4dash.md
|
||||
- mp4dashclone: documentation/mp4dashclone.md
|
||||
- mp4hls: documentation/mp4hls.md
|
||||
- Developers: developers/index.md
|
||||
- Downloads: downloads.md
|
||||
- Support: support.md
|
||||
- About: about.md
|
||||
|
||||
copyright: © 2020 Axiomatic Systems, LLC. All rights reserved.
|
||||
|
||||
theme:
|
||||
name: 'material'
|
||||
logo: 'images/bento4-small.jpg'
|
||||
favicon: 'images/favicon.png'
|
||||
custom_dir: 'theme'
|
||||
|
||||
docs_dir: 'src'
|
||||
|
||||
edit_uri: ''
|
||||
|
||||
# Repo info
|
||||
repo_name: axiomatic-systems/Bento4
|
||||
repo_url: https://github.com/axiomatic-systems/Bento4
|
||||
@@ -24,6 +63,9 @@ markdown_extensions:
|
||||
- attr_list
|
||||
- pymdownx.details
|
||||
- pymdownx.superfences
|
||||
- pymdownx.emoji:
|
||||
emoji_index: !!python/name:materialx.emoji.twemoji
|
||||
emoji_generator: !!python/name:materialx.emoji.to_svg
|
||||
- codehilite:
|
||||
guess_lang: false
|
||||
- toc:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# This requirements file is for python3
|
||||
mkdocs == 1.1
|
||||
mkdocs-material == 4.6.3
|
||||
pymdown-extensions == 6.3
|
||||
mkdocs-material == 7.1.5
|
||||
mkdocs-material-extensions == 1.0
|
||||
pymdown-extensions == 7.0
|
||||
|
||||
9
Documents/MkDocs/src/about.md
Normal file
9
Documents/MkDocs/src/about.md
Normal file
@@ -0,0 +1,9 @@
|
||||
ABOUT BENTO4
|
||||
============
|
||||
|
||||
Bento4 is developed by Axiomatic Systems LLC in San Francisco, California.
|
||||
|
||||
**This software is available under two different licenses**
|
||||
For applications that are entirely distributable under the terms of the [GPL](http://www.gnu.org/licenses/gpl-2.0-standalone.html), the Bento4 GPL license applies.
|
||||
For applications that cannot be entirely distributable under the terms of the GPL (either the application, or code modules linked with the application are not compatible with the terms of the GPL licence), a non-GPL commercial license is available from Axiomatic Systems LLC.
|
||||
Contact Gilles Boccon-Gibod (licensing@axiosys.com or bok@bok.net) for more information.
|
||||
6
Documents/MkDocs/src/developers/cmaf/index.md
Normal file
6
Documents/MkDocs/src/developers/cmaf/index.md
Normal file
@@ -0,0 +1,6 @@
|
||||
CMAF
|
||||
====
|
||||
|
||||
The Common Media Application Format ([CMAF](https://developer.apple.com/documentation/http_live_streaming/about_the_common_media_application_format_with_http_live_streaming)) is a standard for the encoding and packaging of segmented media objects for adaptive streaming. CMAF unifies MPEG DASH and HLS in a way that allows the authoring of an MPEG DASH manifest and an HLS playlist that point to shared media segments, thus having just one set of encoded segment files.
|
||||
|
||||
The `mp4dash` tool supports creating such HLS + DASH presentations, using the `--hls` command-line option. See the [MPEG DASH page](../dash/index.md) for details
|
||||
29
Documents/MkDocs/src/developers/dash/codecs.md
Normal file
29
Documents/MkDocs/src/developers/dash/codecs.md
Normal file
@@ -0,0 +1,29 @@
|
||||
MPEG DASH & CODECS
|
||||
==================
|
||||
|
||||
An MPEG DASH presentation includes one more media steams, each containing encoded media. The specifics of how the media is encoded is referred to as a "codec" (COder DECoder). The Bento4 tools support a large number of codecs, most of which are handled in the same way, but some may have codec-specific options.
|
||||
|
||||
# Video Codecs
|
||||
|
||||
The two most most common codecs you are likely to work with are H.264 (a.k.a AVC, or "Advanced Video Coding"), and H.265 (a.k.a HEVC, or "High Efficiency Video Coding"). A more recent addition to the codec landscape is the AV1 codec ("AOMedia Video 1"). In all cases, the input files for the `mp4dash` packager are in MP4 format, which includes codec metadata and media samples.
|
||||
|
||||
## HDR
|
||||
|
||||
Some video streams may include extensions that encode extra information that allow the video to be displayed with a higher dynamic range. This is often called HDR ("High Dynamic Range"). The most common extensions/formats are Dolby Vision and HDR10.
|
||||
|
||||
### Dolby Vision
|
||||
|
||||
### HDR10
|
||||
|
||||
# Audio Codecs
|
||||
|
||||
The most common audio codec for MP4 files is AAC ("Advanced Audio Coding"), including it different "modes": HE-AAC v1 and HE-AAC v2 ("High-Efficiency AAC"), and more recently xHE-AAC ("Extended High Efficiency AAC").
|
||||
|
||||
## Multi Channel Audio
|
||||
Some codecs support encoding more than two channels. Multi-channel streams are often labled as X.Y, where X is the number of full-bandwidth audio channels, and Y is the number of low-frequency channels, like, for example "5.1".
|
||||
While AAC does have multi-channel support, it is much more common to see Dolby or DTS codecs used for multi-channel audio. This includes Dolby AC-3 (a.k.a "Dolby Digital"), Dolby E-AC-3 (a.k.a "Dolby Digital Plus"), Dolby AC-4 and Dolby Atmos.
|
||||
|
||||
Because not all players/decoders support all codecs, it is usually recommended to always include at least one AAC audio stream in an MPEG DASH presentation, which all players should be able to handle.
|
||||
|
||||
## Multi Bitrate Audio
|
||||
See the [Multi Bitrate Audio page](multi_bitrate_audio.md)
|
||||
80
Documents/MkDocs/src/developers/dash/encryption_and_drm.md
Normal file
80
Documents/MkDocs/src/developers/dash/encryption_and_drm.md
Normal file
@@ -0,0 +1,80 @@
|
||||
MPEG DASH ENCRYPTION AND DRM
|
||||
============================
|
||||
|
||||
# Encrypting The Media
|
||||
|
||||
MPEG DASH supports a Common Encryption mode (CENC), which is implemented by Bento4. The simplest way to produce encrypted MPEG DASH streams is to instruct `mp4dash` to perform the encryption for you automatically, by using the `--encryption-key` option. This is the easiest option, as it will internally call the `mp4encrypt` tool with the right parameters. Encrypted MPEG DASH presentations should also include the proper signaling in the MPD to inform the player of what DRM(s) can be used to obtain the decryption keys for the streams. An MPD can contain DRM signaling for several DRMs (either just one or multiple entries if the same stream can reach players with different DRM technologies).
|
||||
|
||||
## Marlin DRM
|
||||
|
||||
When using Marlin DRM, you may request that the proper signaling be inserted in the MPD by using the `--marlin` option.
|
||||
|
||||
!!! example
|
||||
With a KID = `121a0fca0f1b475b8910297fa8e0a07e`, an encryption KEY = `a0a1a2a3a4a5a6a7a8a9aaabacadaeaf` you would package a multi-bitrate presentation, with input video files `source_400kbps.mp4` and `source_800kbps.mp4` using a command-line like:
|
||||
|
||||
```
|
||||
mp4dash --marlin --encryption-key=121a0fca0f1b475b8910297fa8e0a07e:a0a1a2a3a4a5a6a7a8a9aaabacadaeaf source_400kbps.mp4 source_800kbps.mp4
|
||||
```
|
||||
|
||||
## PlayReady DRM
|
||||
|
||||
When using PlayReady DRM, the DRM signaling is in the form of a PlayReady Header Object (PRO). This header object includes fields like the license acquisition URL (LA_URL), the KID, and other fields. There are 2 places where the PRO can be conveyed:
|
||||
|
||||
* a PSSH box in the init segment(s)
|
||||
* a `<ContentProtection>` element in the MPD
|
||||
|
||||
With most PlayReady DASH clients, it is a requirement that at least the init segment PSSH box be present (when it is not, some players will not correctly detect that the media is encrypted). The Bento4 tools will automatically insert a PlayReady PSSH box in the init segments. If a PRO is found in the MPD, it takes priority over a PRO in an init segment PSSH box. Finally, PlayReady-enabled players often have an API that allows the playback application to override the License Acquisition URL field of the PRO, and/or the CustomData field. The PlayReady Header Object (PRO) can be provided in one of 3 ways, using the `--playready-header` command line option:
|
||||
|
||||
* Stored in a file that contains the binary representation of the PRO
|
||||
* Directly as a command-line argument, encoded in Base64
|
||||
* By specifying individual fields, like `LA_URL`, and letting the tool construct the binary representation of the PRO.
|
||||
|
||||
See the [command line argument help page](../../documentation/mp4dash.md) for details. The most flexible option is to specify the PRO from individual fields.
|
||||
Typically, only the `LA_URL` field is required, and it is set to the License Acquistion URL for your PlayReady server (consult your DRM provider for details if you use an online DRM service provider).
|
||||
|
||||
!!! warning "IMPORTANT NOTE"
|
||||
some PlayReady players are not fully compliant with the specification, in that they do not support content encrypted with 16-byte IVs. This is a known implementation defect of clients like SilverLight-based players. In order to be compatible with those players, it is necessary to use a special encryption option that instructs the encrypter to use 8-byte IVs in stead of the default 16-byte IVs. This is done automatically by the Bento4 tool when any of the PlayReady command line options are specified. If you want to encrypt content this way even when not using PlayReady, this can be done using the `--global-option mpeg-cenc.piff-compatible:true` option of `mp4encrypt`, or by simply using the `mp4dash` command line option: `--encryption-args="--global-option mpeg-cenc.piff-compatible:true"`.
|
||||
|
||||
!!! example
|
||||
With a KID = `09e367028f33436ca5dd60ffe6671e70`, an encryption KEY = `b42ca3172ee4e69bf51848a59db9cd13` and a License Acquisition URL = `http://playready.directtaps.net/pr/svc/rightsmanager.asmx`, you would package a single video file `video-source.mp4` using a command line like:
|
||||
|
||||
```
|
||||
mp4dash --encryption-key=09e367028f33436ca5dd60ffe6671e70:b42ca3172ee4e69bf51848a59db9cd13 --playready-header=LA_URL:http://playready.directtaps.net/pr/svc/rightsmanager.asmx video-source.mp4
|
||||
```
|
||||
|
||||
## Widevine DRM
|
||||
|
||||
For Widevine, the `--widevine-header` option is used to specify the value of the Widevine DRM data. This can be directly the content of a PSSH box (obtained from a key server for example), expressed as a # sign followed by the hex-encoded PSSH payload data, or as a set of `name:value` pairs.
|
||||
|
||||
!!! example
|
||||
With a KID = `90351951686b5e1ba222439ecec1f12a`, an encryption KEY = `0a237b0752cbf1a827e2fecfb87479a2`, a Widevine Service Provider ID = `widevine_test`, and a content ID = `*` (2a in hexadecimal), you would package a single video file `video-source.mp4` using a command line like:
|
||||
```
|
||||
mp4dash --widevine-header provider:widevine_test#content_id:2a --encryption-key 90351951686b5e1ba222439ecec1f12a:0a237b0752cbf1a827e2fecfb87479a2 video-source.mp4
|
||||
```
|
||||
or with an externally-generated PSSH payload:
|
||||
```
|
||||
mp4dash --widevine-header "#CAESEJA1GVFoa14boiJDns7B8SoaDXdpZGV2aW5lX3Rlc3QiASo=" --encryption-key 90351951686b5e1ba222439ecec1f12a:0a237b0752cbf1a827e2fecfb87479a2 video-source.mp4
|
||||
```
|
||||
|
||||
## FairPlay DRM
|
||||
|
||||
## Multiple DRMs at the same time
|
||||
|
||||
You can produce a DASH output that is compatible with multiple DRMs at the same time. Simply combine the DRM-specific options documented above.
|
||||
|
||||
!!! example "Example: Marlin, PlayReady and Widevine"
|
||||
```
|
||||
mp4dash --encryption-key=09e367028f33436ca5dd60ffe6671e70:b42ca3172ee4e69bf51848a59db9cd13 --marlin --playready-header=LA_URL:http://playready.directtaps.net/pr/svc/rightsmanager.asmx --widevine-header=provider:widevine_test#content_id:2a video-source.mp4
|
||||
```
|
||||
|
||||
## Encrypting as a Separate Step
|
||||
|
||||
If you need more precise control over encryption (for example only encryption certain tracks and not others, or use special options), you can encrypt the media before using `mp4dash`. This is done by calling `mp4encrypt` directly on the input files before calling `mp4dash`. The `mp4encrypt` command line tool will allow you to encrypt an MP4 video in MPEG DASH CENC mode.
|
||||
|
||||
!!! example
|
||||
```
|
||||
mp4encrypt --method MPEG-CENC --key 1:a0a1a2a3a4a5a6a7a8a9aaabacadaeaf:0123456789abcdef --property 1:KID:121a0fca0f1b475b8910297fa8e0a07e --key 2:a0a1a2a3a4a5a6a7a8a9aaabacadaeaf:aaaaaaaabbbbbbbb --property 2:KID:121a0fca0f1b475b8910297fa8e0a07e hbb_578kbps.mp4 hbb_578kbps-cenc.mp4
|
||||
```
|
||||
|
||||
!!! note
|
||||
The source video needs to be a fragmented MP4 file. If your source is not fragmented, you can use `mp4fragment` to convert it to a fragmented file.
|
||||
215
Documents/MkDocs/src/developers/dash/index.md
Normal file
215
Documents/MkDocs/src/developers/dash/index.md
Normal file
@@ -0,0 +1,215 @@
|
||||
MPEG DASH Adaptive Streaming
|
||||
============================
|
||||
|
||||
# Specifications
|
||||
|
||||
MPEG DASH is MPEG’s standardized **D**ynamic **A**daptive **S**treaming over **H**TTP. It is specified in the following international standards:
|
||||
|
||||
* ISO/IEC 23009-1 specifies the overall DASH architecture and the XML syntax for the MPD (Media Presentation Document)
|
||||
* ISO/IEC 23001-7 specifies the Common Encryption for MP4 fragments
|
||||
* ISO/IEC 14496-12/AMD 3 specifies the extensions to 14496-12 that are necessary to support DASH with fragmented MP4 media
|
||||
|
||||
# Quick introduction to MPEG DASH
|
||||
|
||||
At a high level, an MPEG DASH presentation consists of an initial XML manfifest, called the **Media Presentation Document** (MPD for short), which describes media segments that form a complete presentation. Along with a number of attributes, the MPD allows the MPEG DASH player to compute the URL of each segment, and to download and render them.
|
||||
The `mp4dash` tool takes care of creating the DASH MPD document, as well as packaging the media segment in their proper form and output location, including pre- and post- processing if necessary (like encryption for DRM support).
|
||||
|
||||
# Using the `mp4dash` packager tool
|
||||
|
||||
`mp4dash` is the name of the Bento4 tool that can convert one or more input media files into a complete MPEG DASH presentation.
|
||||
|
||||
!!! tip "Using `mp4dash` for HLS as well"
|
||||
Recent versions of the HLS specification support uusing MP4 fragments. Since those fragments are essentially the same as those used for MPEG DASH, the `mp4dash` tool can be used to output HLS presentations as well as DASH, from a single set of input files. Use the `--hls` option to enable that mode. See the [HLS](../hls/index.md) page for more details.
|
||||
|
||||
Running this tool requires that you have python version 3.7 or above installed on your system (python 2.x is no longer supported). Please visit [www.python.org](https://www.python.org) if you need to install python.
|
||||
|
||||
!!! note "Python on Windows"
|
||||
On Windows, the launch scripts assume that python3 is launched with the command python, but on all other systems, the command python3 is used.
|
||||
|
||||
If you are using the Bento4 precompiled SDK distribution, you will find it convenient to use the `mp4dash` command, located in the `bin/` directory, which will automatically run the `mp4-dash.py` python script for you. If you are running from a source distribution, you may need to invoke the python script (located under `Source/Python/utils`) directly, like this:
|
||||
|
||||
```bash
|
||||
python3 <path-to-bento4-python-utils>/mp4-dash.py <arguments>
|
||||
```
|
||||
|
||||
In the examples below, we assume that you are running from a standard precompiled distribution, thus we will simply use the `mp4dash` command.
|
||||
|
||||
!!! tip "Running with self-compiled binaries"
|
||||
The `mp4dash` tool needs to invoke the Bento4 command line binaries `mp4dump`, `mp4encrypt`, `mp4info`, and `mp4split`. If you are invoking the tool as distributed in the pre-compiled SDK, the binaries will automatically be found in the SDK package as installed. If you are running the tool from the Source SDK, with binaries that you compiled from the source, so you’ll need to use the `--exec-dir` option to specify the directory where your built binaries reside (platform dependent).
|
||||
|
||||
If you just run the `mp4dash` tool with no arguments, it will print out the options that are supported.
|
||||
For a complete list of command line options for `mp4dash`, visit the [mp4dash](../../documentation/mp4dash.md) command line details page.
|
||||
|
||||
## Preparing the input files
|
||||
|
||||
To create DASH MP4 content, you need to start with fragmented MP4 files. The input files you will be working with may or may not already be in fragmented MP4 form. Ideally, your encoder will already produce MP4 files that way.
|
||||
The command line tool `mp4info` can tell you if an MP4 file is fragmented or not: here’s an example of what you would see in the `Movie:` part of the `mp4info` output for a non-fragmented MP4 file (the line `fragments: no`)
|
||||
|
||||
```
|
||||
Movie:
|
||||
duration: 147188 ms
|
||||
time scale: 2997
|
||||
fragments: no
|
||||
|
||||
Found 2 Tracks
|
||||
```
|
||||
|
||||
If you have non-fragmented MP4 files, you can use the mp4fragment tool to fragment them.
|
||||
|
||||
!!! example "`mp4fragment` example"
|
||||
```
|
||||
mp4fragment video.mp4 video-fragmented.mp4
|
||||
```
|
||||
|
||||
### Dealing with ISMV and ISMA input files
|
||||
|
||||
ISMV and ISMA files are basically fragmented MP4 files, and as such can be used as input to `mp4dash`. However, most legacy tools (encoder and packagers) that produce ISMV and ISMA files generate fragmented MP4 files that lack a `tfdt` timestamp box. While these files appear to be normal fragmented MP4 files, the lack of tfdt renders those media files unsuitable for playback with many DASH clients, including most HTML5 based clients.
|
||||
If you have such files, you can fix this problem by refragmenting your ISMV and ISMA files into compliant fragmented MP4 files, using the `mp4fragment` tool.
|
||||
|
||||
!!! example "Example: re-fragmenting ISMV/ISMA files"
|
||||
```
|
||||
mp4fragment video.ismv video.mp4
|
||||
```
|
||||
|
||||
This should print something like
|
||||
|
||||
```
|
||||
NOTICE: file is already fragmented, it will be re-fragmented
|
||||
found regular I-frame interval: 1 frames (at 25.000 frames per second)
|
||||
```
|
||||
|
||||
You can then use the re-fragmented files as input to mp4dash.
|
||||
|
||||
!!! tip
|
||||
You can tell whether your fragmented input file has a tfdt box or not by using mp4dump.
|
||||
A file with tfdt will show entries like this:
|
||||
|
||||
```
|
||||
[moof] size=8+816
|
||||
[mfhd] size=12+4
|
||||
sequence number = 490
|
||||
[traf] size=8+792
|
||||
[tfhd] size=12+4, flags=20000
|
||||
track ID = 2
|
||||
[tfdt] size=12+8, version=1
|
||||
base media decode time = 32281600
|
||||
[trun] size=12+744, flags=301
|
||||
sample count = 92
|
||||
data offset = 832
|
||||
```
|
||||
with a tfdt box as a child of the traf container box
|
||||
|
||||
## Generating a DASH presentation
|
||||
|
||||
Once you have fragmented MP4 files to work with as input, you can generate a DASH presentation, including an MPD and media files or media segments. For single-bitrate streaming, a single MP4 file is required.
|
||||
The general usage for the `mp4dash` tool is: `mpdash <input files>`, which produces a DASH presentation in an output directory (`output` by default), including the MPD file that points to the media segments (`output/stream.mpd` by default).
|
||||
|
||||
### Single Bitrate
|
||||
|
||||
!!! example "Example: single MP4 input file"
|
||||
```
|
||||
mp4dash video.mp4
|
||||
```
|
||||
|
||||
### Multiple Bitrates
|
||||
|
||||
While it is entirely possible to use MPEG DASH for simple, single-bitrate Audio/Video streams, multi-bitrate support is where MPEG DASH shines. The most common use case is to package multiple video streams, each encoded at a different bitrate, into a single presentation, where the player will adaptively switch between segments of the different streams depending on the network and playback conditions.
|
||||
When supplying multiple video streams as input (one video track per input file) to `mp4dash`, it is important that the files have been encoded in a way that is compatible for this use case. You will need a set of MP4 files that have been encoded with closed GOPs (Group Of Pictures) with equal durations. Also, the audio tracks in all the files should be encoded with the same parameters. Once you have your input files, you can use the `mp4dash` tool to automatically generate the DASH MPD and, optionally, split the MP4 file into individual file segments.
|
||||
|
||||
!!! example "Example: multi-bitrate set of MP4 files"
|
||||
```
|
||||
mp4dash video_1000.mp4 video_2000.mp4 video_3000.mp4
|
||||
```
|
||||
|
||||
Codecs other than xHE-AAC aren't well suited for seamless dynamic bitrate switching, so when using traditional codecs like AAC or Dolby Digital, it is usually the case that a single audio stream (per codec) will be present as input. If more than one input includes an audio track (which may be expected with multi-bitrate packaging, where each of the input files may contain both an audio and video track), only one of the audio tracks will be retained, unless they differ by more than 10% in bitrate.
|
||||
For the xHE-AAC codec, however, seamless dynamic bitrate switching is possible. For more details on how to support that use case, read the [Multi Bitrate Audio page](multi_bitrate_audio.md).
|
||||
|
||||
## Advanced usage
|
||||
|
||||
### Input specifiers
|
||||
|
||||
The name of input files may be preceded by an input qualifier, which can be used for stream selection as well as setting properties for the input. The general syntax for input qualifiers is: `[<selector-name>=<selector-value>,+<property-name>=<property-value>,...]`.
|
||||
|
||||
#### Selectors
|
||||
|
||||
By default, `mp4dash` will create an output that contains all the audio tracks found in its each input, as well as one video track from each input (it is assumed that each input file only has one video track, but multi-track input files may still be used, using a selector to select one of the tracks). It is possible to limit the selected tracks by using input stream selectors.
|
||||
The supported selectors are:
|
||||
|
||||
Selector | Value | Descripton
|
||||
-----------|-------------------------------------------|--------------------------------------------------------
|
||||
`type` | `audio` or `video` | Select the `audio` or `video` track only from the input
|
||||
`track` | `<track-id>` (integer) | Select track ID <track-id> only from the input
|
||||
`language` | `<language-code>` (2 or 3 character code) | Only keep audio tracks with a specific language
|
||||
|
||||
#### Properties
|
||||
|
||||
Setting stream properties via input specifiers allows invoking `mp4dash` with extra information about the input that may not be otherwise inferred, or should override some of the streams' properties. This can be used, for example, to override the language code for an audio track, or specify labels or group names.
|
||||
|
||||
Property | Value | Description
|
||||
--------------------|-------------------------------------------|--------------------------
|
||||
`language` | `<language-code>` (2 or 3 character code) | Set/override the language code for an input
|
||||
`language_name` | `<language-name>` (string) | Set the language name (i.e human-readable string for the language) for an input
|
||||
`representation_id` | `<representation-id>` (string) | |
|
||||
`scan_type` | `<scan-type>` (string) | |
|
||||
`label` | `<label>` (string) | |
|
||||
`key` | `<key>` (hex string) | |
|
||||
`hls_group` | `<hls-group>` (string) | (only with `--hls` |
|
||||
`hls_group_match` | `<hls-group-match>` | (only with `--hls`) |
|
||||
`hls_default` | `YES` or `NO` | (only with `--hls`) |
|
||||
`hls_autoselect` | `YES` or `NO` | (only with `--hls`) |
|
||||
|
||||
### Multi-language
|
||||
|
||||
Use a `language=<language-code>` selector to select one of the audio tracks. The language code is a 2 or 3 letter code as defined by the DASH specification – (see [RFC 5646](https://datatracker.ietf.org/doc/html/rfc5646)]. It is possible to combine the language selector with a type selector, by separating the two by a comma (ex: `[type=audio,language=fr]`). If the language selector is used by itself without a type selector, the video track as well as the matching audio track will be selected.
|
||||
|
||||
#### Examples
|
||||
|
||||
!!! example
|
||||
Select the French audio track and the video track from video.mp4:
|
||||
|
||||
```
|
||||
mp4dash [language=fr]video.mp4
|
||||
```
|
||||
|
||||
!!! example
|
||||
Select the French audio track from `video1.mp4` and the video track from `video2.mp4`:
|
||||
|
||||
```
|
||||
mp4dash [type=audio,language=fr]video1.mp4 [type=video]video2.mp4
|
||||
```
|
||||
|
||||
!!! example
|
||||
Select track ID 3 from video1.mp4 and all tracks from video2.mp4:
|
||||
|
||||
```
|
||||
mp4dash [track=3]video1.mp4 video2.mp4
|
||||
```
|
||||
|
||||
!!! example
|
||||
Select the track with `undefined` language from `video1.mp4` and remap the language to `fr`
|
||||
|
||||
```
|
||||
mp4dash --language-map=und:fr [language=und]video1.mp4
|
||||
```
|
||||
|
||||
!!! tip
|
||||
Using the `--verbose` option may be useful when debugging language selection options
|
||||
|
||||
### Encryption and DRM
|
||||
|
||||
MPEG DASH streams can be encrypted, and played on clients that have a DRM-enabled DASH player.
|
||||
Visit the [MPEG DASH Encryption & DRM page](encryption_and_drm.md) for details.
|
||||
|
||||
### Codec Support
|
||||
|
||||
The `mp4dash` packager supports input files with streams encoded with a variety of difference codecs. For details on what's supported and what options may be used, read the [Codecs page](codecs.md).
|
||||
|
||||
# Serving DASH Streams
|
||||
|
||||
By default, `mp4dash` produces an output that can be served by any regular HTTP server. In order to make this possible, each one of the media segments and the init segments are stored in separate files. The MPD then refers to relative URLs for those files. Care should be taken to configure the HTTP server to return the correct `Content-Type` for the MPD document and segment files. The MPD document (named `stream.mpd` by default by the `mp4dash` tool) should be served with `Content-Type: application/dash+xml` and the init and media segments should be served with a `Content-Type: video/mp4`
|
||||
|
||||
## Serving DASH without splitting segments
|
||||
|
||||
For players that support the "on demand" profile, input files can be kept as single files on the server, and the players use an index embedded in the files to access individual segments using HTTP range requests.
|
||||
For the "live" profile, however, there is no such embedded index. With special support from the server, it is possible to serve such DASH streams without splitting the segments into individual files. This is achieved by having a server-side module that can virtualize URLs, so as to be able to expose each segment as an separate URL, mapping it back to a byte range in a source file when requests are made. MPEG does not specify a common standard for such URL virtualization. Each server that supports this model is free do do it any way it chooses. For example, the Microsoft IIS server can be used with a IIS Media Services extension for Smooth Streaming to deliver MPEG DASH streams. More details can be found on the Serving MPEG DASH with Microsoft IIS page. Another useful way to do the same thing is to use the open-source [Hippo Media Server](https://github.com/barbibulle/hippo) package, which knows how to virtualize URLs for MPEG DASH and Smooth Streaming.
|
||||
The `--hippo` option of `mp4dash` is used to generate the server-side manifest needed by the Hippo Media Server.
|
||||
51
Documents/MkDocs/src/developers/dash/multi_bitrate_audio.md
Normal file
51
Documents/MkDocs/src/developers/dash/multi_bitrate_audio.md
Normal file
@@ -0,0 +1,51 @@
|
||||
MULTI-BITRATE AUDIO
|
||||
===================
|
||||
|
||||
The most common use of MPEG DASH is for delivering adaptive streaming presentations to players. The adaptive part is achieved by offering the same video streams encoded at different bitrates (and typically different resolutions). When properly encoded, the segments of media for the different video bitrates are such that seamless transition from one bitrate set to another can be done on-the-fly without glitches.
|
||||
|
||||
For audio, however, it is typical to only have one bitrate. Offering multiple audio variants is often limited to offering a choice of stereo and multi-channel audio, where the stereo stream is usually encoded with AAC, and the multi-channel stream(s) with Dolby Digital or similar. The main reason for only having a single bitrate is the fact that with AAC and other codecs, seamless transition between audio streams encoded at different bitrates isn't easy or even possible. A second reason is that the audio bitrate is usually much lower than the video bitrate, so varrying the audio bitrate doesn't offer much of a difference in terms of the absolute total bitrate that the player has to receive.
|
||||
|
||||
With new generations of codecs, like xHE-AAC ("Extended High Efficiency AAC"), which combines the MPEG-D USAC standard (ISO/IEC 23003-3)) and appropriate parts of the MPEG-D DRC Loudness Control Profile or Dynamic Range Control Profile, it is now possible to offer audio encoded at different bitrates, and allow the player to seamlessly switch between the different bitrates on the fly.
|
||||
|
||||
The `mp4dash` tool supports input audio files that are encoded with xHE-AAC.
|
||||
|
||||
# xHE-AAC with MPEG DASH
|
||||
|
||||
No special option is needed when creating an MPEG DASH presentation with xHE-AAC audio tracks. Simply pass all the audio files as input to the packager, along with any video files if applicable.
|
||||
|
||||
!!! example "Example: 4 audio bitrates and 2 video bitrates"
|
||||
```
|
||||
mp4dash audio-16kbps.mp4 audio_32kbps.mp4 audio-64kbps.mp4 audio-128kbps.mp4 video-500kbps.mp4 video-2000kbps.mp4
|
||||
```
|
||||
|
||||
# xHE-AAC with HLS
|
||||
|
||||
With HLS, more precise control may be needed. With HLS, every possible combination of audio and video streams must be listed explicitly in the playlist (as opposed to MPEG DASH, where the audio and video streams are listed separately in the manifest, and it is up to the player to pick the right combination of audio and video streams).
|
||||
|
||||
By default, the `mp4dash` packager, when creating the HLS playlist, will list all possible combinations of audio and video streams. This means that if you have N audio streams and M video streams, the HLS playlist will have N*M `#EXT-X-STREAM-INF` entries, one for each possible (audio,video) pair.
|
||||
If you need more control over the different combinations listed in the playlist, you can use the `hls_group` and `hls_group_match` input specifiers. The `hls_group` specifier for audio input files assigns a group name to the audio track. The `hls_group_match` specifier for video input files specifies which should be combined with that video track If `hls_group_match` is not set, or set to `*`, all audio groups will be combined with the video track.
|
||||
|
||||
!!! example "Example: audio-only, 4 bitrates"
|
||||
```
|
||||
mp4dash --hls audio-16kbps.mp4 audio-32kbps.mp4 audio-64kbps.mp4 audio-128kbps.mp4
|
||||
```
|
||||
|
||||
!!! example "Example: 4 audio bitrates, 1 video bitrate"
|
||||
```
|
||||
mp4dash --hls audio-16kbps.mp4 audio-32kbps.mp4 audio-64kbps.mp4 audio-128kbps.mp4 video_00500.mp4
|
||||
```
|
||||
The playlist will have 4 `#EXT-X-STREAM-INF` entries
|
||||
|
||||
!!! example "Example: 4 audio bitrates, 3 video bitrates, all combinations listed"
|
||||
```
|
||||
mp4dash --hls audio-16kbps.mp4 audio-32kbps.mp4 audio-64kbps.mp4 audio-128kbps.mp4 video_00500.mp4 video_00800.mp4 video_01400.mp4
|
||||
```
|
||||
The playlist will have 12 `#EXT-X-STREAM-INF` entries
|
||||
|
||||
!!! example "Example: 4 audio bitrates, 3 video bitrates, with only the lowest bitrate video combined with multiple audio bitrates"
|
||||
```
|
||||
mp4dash --hls [+hls_group=audio_16]audio-16kbps.mp4 [+hls_group=audio_32]audio-32kbps.mp4 [+hls_group=audio_64]audio-64kbps.mp4 [+hls_group=audio_128]audio-128kbps.mp4 "[+hls_group_match=audio_16&audio_32&audio_64&audio_128]video_00500.mp4" video_00800.mp4 video_01400.mp4
|
||||
```
|
||||
The playlist will have 4 `#EXT-X-STREAM-INF` entries
|
||||
|
||||
|
||||
19
Documents/MkDocs/src/developers/dash/sample_content.md
Normal file
19
Documents/MkDocs/src/developers/dash/sample_content.md
Normal file
@@ -0,0 +1,19 @@
|
||||
SAMPLE CONTENT & TEST PLAYERS
|
||||
=============================
|
||||
|
||||
This page contains pointers to sample MPEG DASH streams, which you can use as examples, or to test MPEG DASH players.
|
||||
|
||||
# Sample Players
|
||||
|
||||
[HTML5/MSE](https://players.akamai.com/players/dashjs) player [Requires a browser that supports HTML/MSE. Supports cleartext and encrypted MPEG DASH]
|
||||
[Silverlight-based DASH player](http://www.bok.net/dash/players/silverlight) [Supports cleartext and encrypted MPEG DASH]
|
||||
|
||||
# Single Bitrate
|
||||
|
||||
:fontawesome-solid-video: Tears Of Steel – `http://www.bok.net/dash/tears_of_steel/cleartext/stream-single.mpd`
|
||||
|
||||
# Multi Bitrate
|
||||
|
||||
:fontawesome-solid-video: Tears Of Steel – `http://www.bok.net/dash/tears_of_steel/cleartext/stream.mpd`
|
||||
|
||||
You can copy/Paste those URLs in one of the test players listed above, or use with any DASH-compatible player
|
||||
61
Documents/MkDocs/src/developers/dash/subtitles.md
Normal file
61
Documents/MkDocs/src/developers/dash/subtitles.md
Normal file
@@ -0,0 +1,61 @@
|
||||
MPEG DASH SUBTITLES
|
||||
===================
|
||||
|
||||
The `mp4dash` tool supports including one or more subtitles track(s) in an MPEG DASH presentation.
|
||||
There are two ways for subtitles to be used with MPEG DASH. Subtitles data may be encapsulated in MP4 tracks, just like audio and video frames, or may be stored in a separate, standalone text or XML file without MP4 encapsulation.
|
||||
|
||||
# Formats
|
||||
|
||||
Subtitles can be encoded in a varietry of formats. Most of those formats belong to two family of related formats:
|
||||
|
||||
## IMSC1 Conformant Profiles
|
||||
[IMSC1](https://dvcs.w3.org/hg/ttml/raw-file/tip/ttml-ww-pro-files/ttml-ww-profiles.html) conformant profiles of TTML include:
|
||||
* W3C TTML
|
||||
* SMPTE Timed Text (SMPTE-TT)
|
||||
* EBU-TT
|
||||
|
||||
## WebVTT
|
||||
WebVTT is a text format, based on the SRT text format. The specification can be found here: [https://w3c.github.io/webvtt](https://w3c.github.io/webvtt)
|
||||
|
||||
## 3GPP Timed Text
|
||||
Another timed text format defined by 3GPP. This format is currently not supported.
|
||||
|
||||
# Using Subtitles with `mp4dash`
|
||||
The `mp4dash` packager can take one or more subtitles file(s) as input.
|
||||
|
||||
## External Subtitles
|
||||
This is the simplest mode to support, as no MP4 encapsulation is necessary, so a simple WebVTT text or IMSC1-conformant TTML XML file is all that’s needed to hold the subtitles.
|
||||
When the subtitles are in non-MP4 external files, the input filenames must be prefixed with an input specifier `[+format=webvtt]` for WebVTT-formatted subtitles, or `[+format=ttml]` for IMSC1-conformant TTML files. Also, since WebVTT files do not carry language information, you may want to specify the language code for the input file by adding the parameter `+language=xxx` to the input specifier.
|
||||
|
||||
!!! example "Example: single english-language WebVTT subtitles file"
|
||||
```
|
||||
mp4dash video.mp4 [+format=webvtt,+language=eng]sub_eng_webvtt.txt
|
||||
```
|
||||
|
||||
!!! example "Example: single TTML subtitles file"
|
||||
```
|
||||
mp4dash video.mp4 [+format=ttml]sub_fre_ttml.xml
|
||||
```
|
||||
|
||||
!!! example "Example: two WebVTT subtitles files"
|
||||
```
|
||||
mp4dash video_00500.mp4 [+format=webvtt,+language=eng]sub_eng_webvtt.txt [+format=webvtt,+language=fre]sub_fre_webvtt.txt
|
||||
```
|
||||
|
||||
## MP4-Encapsulated Subtitles
|
||||
MPEG- 4 Part 30 (ISO/IEC 14496-30) defines a way to carry IMSC1-conformat TTM XML in MP4 tracks. Those tracks have a codec 4-character code of `stpp`.
|
||||
When the subtitles are encapsulated in MP4 tracks, you must specify the `--subtitles` command line option to tell mp4dash to include those tracks in the DASH output.
|
||||
|
||||
!!! example "Example: single MP4 input file that contains video, audio and subtitles tracks"
|
||||
```
|
||||
mp4dash --subtitles video_file_with_subtitle_track.mp4
|
||||
```
|
||||
|
||||
!!! example "Example: separate MP4 file for video/audio and subtitles"
|
||||
```
|
||||
mp4dash --subtitles video.mp4 subtitles.mp4
|
||||
```
|
||||
# References
|
||||
|
||||
* [W3C TTML Profiles for Internet Media Subtitles and Captions 1.0.1 (IMSC1)](https://www.w3.org/TR/ttml-imsc1.0.1/)
|
||||
* [SMPTE ST 2052-1:2013 “Timed Text Format (SMPTE-TT)](https://ieeexplore.ieee.org/document/7291854)
|
||||
22
Documents/MkDocs/src/developers/hls/index.md
Normal file
22
Documents/MkDocs/src/developers/hls/index.md
Normal file
@@ -0,0 +1,22 @@
|
||||
HTTP LIVE STREAMING (HLS)
|
||||
=========================
|
||||
|
||||
The Bento4 tools support HLS in several ways
|
||||
|
||||
# HLS With MP4
|
||||
|
||||
|
||||
# HLS With MPEG2 TS
|
||||
|
||||
## Using `mp4hls`
|
||||
`mp4hls` is a high level tool that facilitates the use of the lower-level tool `mp42hls`. `mp4hls` will invoke the `mp42hls` tool, once for each input, in order to create a multi-bitrate HLS presentation.
|
||||
|
||||
!!! tip "Use `mp4dash` for HLS with MP4 segments (a.k.a `fMP4`)"
|
||||
The `mp4hls` tool only supports creating "legacy" HLS presentations, where the media segments are in MPEG2 TS format. Unless it isn't supported by the players you are targetting, we recommend using HLS with fMP4 segments, as this is compatible with MPEG DASH, and likely what is expected by modern environments.
|
||||
See the [MPEG DASH page](../dash/index.md) for details on how to use the `mp4dash` tool, which supports both MPEG DASH and HLS
|
||||
|
||||
See the [`mp4hls` documenation](../../documentation/mp4hls.md) for details on how to use the tool.
|
||||
|
||||
## Using `mp42hls`
|
||||
`mp42hls` is the low-level tool that can create an HLS output for a single MP4 input file.
|
||||
See the [`mp42hls` documentation](../../documentation/mp42hls.md) for details on how to use the tool.
|
||||
27
Documents/MkDocs/src/developers/index.md
Normal file
27
Documents/MkDocs/src/developers/index.md
Normal file
@@ -0,0 +1,27 @@
|
||||
DEVELOPERS
|
||||
==========
|
||||
|
||||
Precompiled SDKs and Tools
|
||||
--------------------------
|
||||
|
||||
For your convenience, we make available pre-compiled SDK and tools for the most popular platforms. Visit the [Download Page](/downloads/) for details.
|
||||
|
||||
There is one SDK for each target platform. Once you download the SDK for your platform, you must unzip it. You will obtain a directory named Bento4-SDK-. (ex: Bento4-SDK-1-4-3-607.universal-apple-macosx for version 1.4.3-607 on Mac OSX).
|
||||
In the SDK directory, you will find the following subdirectories:
|
||||
|
||||
* `bin` ==> precompiled tools, scripts and shared libraries
|
||||
* `docs` ==> documentation
|
||||
* `include` ==> C++ header files for the API
|
||||
* `lib` ==> static libraries
|
||||
* `utils` ==> tools and scripts
|
||||
|
||||
Source Code
|
||||
-----------
|
||||
|
||||
The code is hosted on GitHub: https://github.com/axiomatic-systems/Bento4 You can browse the source code directly through the GitHub interface, or download a copy of the source tree using the GitHub download link or a git client from the command line:
|
||||
|
||||
```
|
||||
git clone https://github.com/axiomatic-systems/Bento4.git
|
||||
```
|
||||
|
||||
You can also download a zip file containing the latest source distribution only (without history) from the [Downloads page](/downloads/)
|
||||
51
Documents/MkDocs/src/documentation/index.md
Normal file
51
Documents/MkDocs/src/documentation/index.md
Normal file
@@ -0,0 +1,51 @@
|
||||
DOCUMENTATION
|
||||
=============
|
||||
|
||||
The documentation for Bento4 consists of pages hosted on this site, documents stored as files in the source distribution and SDKs, as well as embedded documentation in the source code header files.
|
||||
|
||||
MPEG DASH Packager
|
||||
------------------
|
||||
The [MPEG DASH](../developers/dash/index.md) page is the starting point for information on MPEG DASH packaging.
|
||||
For a more advanced, detailed set of options, you can also directly consult the documentation for the [mp4dash](mp4dash.md) tool.
|
||||
The MPEG DASH packager can also be used to package HLS with MP4 fragments, allowing a dual DASH/HLS output from a single set of media files.
|
||||
|
||||
HLS Packager
|
||||
------------
|
||||
The [HLS](../developers/hls/index.md) page is the starting point for information HLS packaging.
|
||||
For a more advanced and detailed set of options, you can also directly consult the documentation for the mp4hls tool.
|
||||
|
||||
Tools Documentation
|
||||
-------------------
|
||||
|
||||
| TOOL NAME | DESCRIPTION |
|
||||
|-----------|-------------|
|
||||
| [mp4info](mp4info.md) | displays high level info about an MP4 file, including all tracks and codec details
|
||||
| [mp4dump](mp4info.md) | displays the entire atom/box structure of an MP4 file
|
||||
| [mp4edit](mp4edit.md) | add/insert/remove/replace atom/box items of an MP4 file
|
||||
| [mp4extract](mp4extract.md) | extracts an atom/box from an MP4 file
|
||||
| [mp4encrypt](mp4encrypt.md) | encrypts an MP4 file (multiple encryption schemes are supported)
|
||||
| [mp4decrypt](mp4decrypt.md) | decrypts an MP4 file (multiple encryption schemes are supported)
|
||||
| [mp4dcfpackager](mp4dcfpackager.md) | encrypts a media file into an OMA DCF file
|
||||
| [mp4compact](mp4compact.md) | converts stsz tables into stz2 tables to create more compact MP4 files
|
||||
| [mp4fragment](mp4fragment.md) | creates a fragmented MP4 file from a non-fragmented one.
|
||||
| [mp4split](mp4split.md) | splits a fragmented MP4 file into discrete files
|
||||
| [mp4tag](mp4tag.md) | show/edit MP4 metadata (iTunes-style and others)
|
||||
| [mp4mux](mp4mux.md) | multiplexes one or more elementary streams (H264, AAC) into an MP4 file
|
||||
| [mp42aac](mp42aac.md) | extract a raw AAC elementary stream from an MP4 file
|
||||
| [mp42avc](mp42avc.md) | extract a raw AVC/H.264 elementary stream from an MP4 file
|
||||
| [mp42hevc](mp42hevc.md) | extract a raw AVC/H.264 elementary stream from an MP4 file
|
||||
| [mp42hls](mp42hls.md) | converts an MP4 file to an HLS (HTTP Live Streaming) presentation, including the generation of the segments and .m3u8 playlist as well as AES-128 and SAMPLE-AES (for FairPlay) encryption. This can be used as a replacement for Apple’s mediafilesegmenter tool.
|
||||
| [mp42ts](mp42ts.md) | converts an MP4 file to an MPEG2-TS file.
|
||||
| [mp4dash](mp4dash.md) | creates an MPEG DASH output from one or more MP4 files, including encryption.
|
||||
| [mp4dashclone](mp4dashclone.md) | creates a local clone of a remote or local MPEG DASH presentation, optionally encrypting the segments as they are cloned.
|
||||
| [mp4hls](mp4hls.md) | creates a multi-bitrate HLS master playlist from one or more MP4 files, including support for encryption and I-frame-only playlists. This can be used as a replacement for Apple’s variantplaylistcreator tool.
|
||||
|
||||
Library API Documentation
|
||||
-------------------------
|
||||
|
||||
Some of the API documentation is produced from the source code comments using Doxygen. The doxygen output is available as a windows CHM file in Bento4.chm, and a set of HTML pages zipped together in Bento4-HTML.zip (to start, open the file named index.html with an HTML browser)
|
||||
|
||||
Licensing
|
||||
---------
|
||||
|
||||
Consult the [About](../about.md) page for GPL and non-GPL licensing information.
|
||||
10
Documents/MkDocs/src/documentation/mp42aac.md
Normal file
10
Documents/MkDocs/src/documentation/mp42aac.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# mp42aac
|
||||
```
|
||||
MP4 To AAC File Converter - Version 1.0
|
||||
(Bento4 Version 1.6.0.0)
|
||||
(c) 2002-2008 Axiomatic Systems, LLC
|
||||
|
||||
usage: mp42aac [options] <input> <output>
|
||||
Options:
|
||||
--key <hex>: 128-bit decryption key (in hex: 32 chars)
|
||||
```
|
||||
10
Documents/MkDocs/src/documentation/mp42avc.md
Normal file
10
Documents/MkDocs/src/documentation/mp42avc.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# mp42avc
|
||||
```
|
||||
MP4 To AVC File Converter - Version 1.0
|
||||
(Bento4 Version 1.6.0.0)
|
||||
(c) 2002-2009 Axiomatic Systems, LLC
|
||||
|
||||
usage: mp42avc [options] <input> <output>
|
||||
Options:
|
||||
--key <hex>: 128-bit decryption key (in hex: 32 chars)
|
||||
```
|
||||
10
Documents/MkDocs/src/documentation/mp42hevc.md
Normal file
10
Documents/MkDocs/src/documentation/mp42hevc.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# mp42hevc
|
||||
```
|
||||
MP4 To HEVC File Converter - Version 1.0
|
||||
(Bento4 Version 1.6.0.0)
|
||||
(c) 2002-2014 Axiomatic Systems, LLC
|
||||
|
||||
usage: mp42hevc [options] <input> <output>
|
||||
Options:
|
||||
--key <hex>: 128-bit decryption key (in hex: 32 chars)
|
||||
```
|
||||
65
Documents/MkDocs/src/documentation/mp42hls.md
Normal file
65
Documents/MkDocs/src/documentation/mp42hls.md
Normal file
@@ -0,0 +1,65 @@
|
||||
# mp42hls
|
||||
```
|
||||
MP4 To HLS File Converter - Version 1.2
|
||||
(Bento4 Version 1.6.0.0)
|
||||
(c) 2002-2018 Axiomatic Systems, LLC
|
||||
|
||||
usage: mp42hls [options] <input>
|
||||
Options:
|
||||
--verbose
|
||||
--show-info
|
||||
--hls-version <n> (default: 3)
|
||||
--pmt-pid <pid>
|
||||
PID to use for the PMT (default: 0x100)
|
||||
--audio-pid <pid>
|
||||
PID to use for audio packets (default: 0x101)
|
||||
--video-pid <pid>
|
||||
PID to use for video packets (default: 0x102)
|
||||
--audio-track-id <n>
|
||||
Read audio from track ID <n> (0 means no audio)
|
||||
--video-track-id <n>
|
||||
Read video from track ID <n> (0 means no video)
|
||||
--audio-format <format>
|
||||
Format to use for audio-only segments: 'ts' or 'packed' (default: 'ts')
|
||||
--segment-duration <n>
|
||||
Target segment duration in seconds (default: 6)
|
||||
--segment-duration-threshold <t>
|
||||
Segment duration threshold in milliseconds (default: 15)
|
||||
--pcr-offset <offset> in units of 90kHz (default 10000)
|
||||
--index-filename <filename>
|
||||
Filename to use for the playlist/index (default: stream.m3u8)
|
||||
--segment-filename-template <pattern>
|
||||
Filename pattern to use for the segments. Use a printf-style pattern with
|
||||
one number field for the segment number, unless using single file mode
|
||||
(default: segment-%d.<ext> for separate segment files, or stream.<ext> for single file)
|
||||
--segment-url-template <pattern>
|
||||
URL pattern to use for the segments. Use a printf-style pattern with
|
||||
one number field for the segment number unless unsing single file mode.
|
||||
(may be a relative or absolute URI).
|
||||
(default: segment-%d.<ext> for separate segment files, or stream.<ext> for single file)
|
||||
--iframe-index-filename <filename>
|
||||
Filename to use for the I-Frame playlist (default: iframes.m3u8 when HLS version >= 4)
|
||||
--output-single-file
|
||||
Output all the media in a single file instead of separate segment files.
|
||||
The segment filename template and segment URL template must be simple strings
|
||||
without '%d' or other printf-style patterns
|
||||
--encryption-mode <mode>
|
||||
Encryption mode (only used when --encryption-key is specified). AES-128 or SAMPLE-AES (default: AES-128)
|
||||
--encryption-key <key>
|
||||
Encryption key in hexadecimal (default: no encryption)
|
||||
--encryption-iv-mode <mode>
|
||||
Encryption IV mode: 'sequence', 'random' or 'fps' (FairPlay Streaming) (default: sequence)
|
||||
(when the mode is 'fps', the encryption key must be 32 bytes: 16 bytes for the key
|
||||
followed by 16 bytes for the IV).
|
||||
--encryption-key-uri <uri>
|
||||
Encryption key URI (may be a realtive or absolute URI). (default: key.bin)
|
||||
--encryption-key-format <format>
|
||||
Encryption key format. (default: 'identity')
|
||||
--encryption-key-format-versions <versions>
|
||||
Encryption key format versions.
|
||||
--encryption-key-line <ext-x-key-line>
|
||||
Preformatted encryption key line (only the portion after the #EXT-X-KEY: tag).
|
||||
This option can be used multiple times, once for each preformatted key line to be included in the playlist.
|
||||
(this option is mutually exclusive with the --encryption-key-uri, --encryption-key-format and --encryption-key-format-versions options)
|
||||
(the IV and METHOD parameters will automatically be added, so they must not appear in the <ext-x-key-line> argument)
|
||||
```
|
||||
21
Documents/MkDocs/src/documentation/mp42ts.md
Normal file
21
Documents/MkDocs/src/documentation/mp42ts.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# mp42ts
|
||||
```
|
||||
MP4 To MPEG2-TS File Converter - Version 1.3
|
||||
(Bento4 Version 1.6.0.0)
|
||||
(c) 2002-2018 Axiomatic Systems, LLC
|
||||
|
||||
usage: mp42ts [options] <input> <output>
|
||||
Options:
|
||||
--pmt-pid <pid> (default: 0x100)
|
||||
--audio-pid <pid> (default: 0x101)
|
||||
--video-pid <pid> (default: 0x102)
|
||||
--segment <segment-duration-in-seconds>
|
||||
[with this option, the <output> name must be a 'printf' template,
|
||||
like "seg-%d.ts"]
|
||||
--segment-duration-threshold in ms (default = 50)
|
||||
[only used with the --segment option]
|
||||
--pcr-offset <offset> in units of 90kHz (default 10000)
|
||||
--verbose
|
||||
--playlist <filename>
|
||||
--playlist-hls-version <n> (default=3)
|
||||
```
|
||||
10
Documents/MkDocs/src/documentation/mp4compact.md
Normal file
10
Documents/MkDocs/src/documentation/mp4compact.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# mp4compact
|
||||
```
|
||||
MP4 Compacter - Version 1.0
|
||||
(Bento4 Version 1.6.0.0)
|
||||
(c) 2002-2011 Axiomatic Systems, LLC
|
||||
|
||||
usage: mp4compact [options] <input> <output>
|
||||
Options:
|
||||
--verbose
|
||||
```
|
||||
166
Documents/MkDocs/src/documentation/mp4dash.md
Normal file
166
Documents/MkDocs/src/documentation/mp4dash.md
Normal file
@@ -0,0 +1,166 @@
|
||||
# mp4dash
|
||||
```
|
||||
Usage: mp4-dash.py [options] <media-file> [<media-file> ...]
|
||||
|
||||
Each <media-file> is the path to a fragmented MP4 file, optionally prefixed
|
||||
with a stream selector delimited by [ and ]. The same input MP4 file may be
|
||||
repeated, provided that the stream selector prefixes select different streams.
|
||||
Version 2.0.0 r637
|
||||
|
||||
Options:
|
||||
-h, --help show this help message and exit
|
||||
-v, --verbose Be verbose
|
||||
-d, --debug Print out debugging information
|
||||
-o <output-dir>, --output-dir=<output-dir>
|
||||
Output directory
|
||||
-f, --force Allow output to an existing directory
|
||||
--mpd-name=<filename>
|
||||
MPD file name
|
||||
--profiles=<profiles>
|
||||
Comma-separated list of one or more profile(s).
|
||||
Complete profile names can be used, or profile aliases
|
||||
('live'='urn:mpeg:dash:profile:isoff-live:2011', 'on-
|
||||
demand'='urn:mpeg:dash:profile:isoff-on-demand:2011',
|
||||
'hbbtv-1.5='urn:hbbtv:dash:profile:isoff-live:2012')
|
||||
--no-media Do not output media files (MPD/Manifests only)
|
||||
--rename-media Use a file name pattern instead of the base name of
|
||||
input files for output media files.
|
||||
--media-prefix=<prefix>
|
||||
Use this prefix for prefixed media file names (instead
|
||||
of the default prefix "media")
|
||||
--init-segment=<filename>
|
||||
Initialization segment name
|
||||
--no-split Do not split the file into individual segment files
|
||||
--use-segment-list Use segment lists instead of segment templates
|
||||
--use-segment-template-number-padding
|
||||
Use padded numbers in segment URL/filename templates
|
||||
--use-segment-timeline
|
||||
Use segment timelines (necessary if segment durations
|
||||
vary)
|
||||
--min-buffer-time=<duration>
|
||||
Minimum buffer time (in seconds)
|
||||
--max-playout-rate=<strategy>
|
||||
Max Playout Rate setting strategy for trick-play
|
||||
support. Supported strategies: lowest:X
|
||||
--language-map=<lang_from>:<lang_to>[,...]
|
||||
Remap language code <lang_from> to <lang_to>. Multiple
|
||||
mappings can be specified, separated by ','
|
||||
--always-output-lang Always output an @lang attribute for audio tracks even
|
||||
when the language is undefined
|
||||
--subtitles Enable Subtitles
|
||||
--attributes=<attributes-definition>
|
||||
Specify the attributes of a set of tracks. This option
|
||||
may be used multiple times, once per attribute set.
|
||||
--smooth Produce an output compatible with Smooth Streaming
|
||||
--smooth-client-manifest-name=<filename>
|
||||
Smooth Streaming Client Manifest file name
|
||||
--smooth-server-manifest-name=<filename>
|
||||
Smooth Streaming Server Manifest file name
|
||||
--smooth-h264-fourcc=<fourcc>
|
||||
Smooth Streaming FourCC value for H.264 video
|
||||
(default=H264) [some older players use AVC1]
|
||||
--hls Output HLS playlists in addition to MPEG DASH
|
||||
--hls-key-url=<url> HLS key URL (default: key.bin)
|
||||
--hls-master-playlist-name=<filename>
|
||||
HLS master playlist name (default: master.m3u8)
|
||||
--hls-media-playlist-name=<filename>
|
||||
HLS media playlist name (default: media.m3u8)
|
||||
--hls-iframes-playlist-name=<filename>
|
||||
HLS I-Frames playlist name (default: iframes.m3u8)
|
||||
--hippo Produce an output compatible with the Hippo Media
|
||||
Server
|
||||
--hippo-server-manifest-name=<filename>
|
||||
Hippo Media Server Manifest file name
|
||||
--use-compat-namespace
|
||||
Use the original DASH MPD namespace as it was
|
||||
specified in the first published specification
|
||||
--use-legacy-audio-channel-config-uri
|
||||
Use the legacy DASH namespace URI for the
|
||||
AudioChannelConfiguration descriptor
|
||||
--encryption-key=<key-spec>
|
||||
Encrypt some or all tracks with MPEG CENC (AES-128),
|
||||
where <key-spec> specifies the KID(s) and Key(s) to
|
||||
use, using one of the following forms: (1) <KID>:<key>
|
||||
or <KID>:<key>:<IV> with <KID> (and <IV> if
|
||||
specififed) as a 32-character hex string and <key>
|
||||
either a 32-character hex string or the character '#'
|
||||
followed by a base64-encoded key seed; or (2) @<key-
|
||||
locator> where <key-locator> is an expression of one
|
||||
of the supported key locator schemes. Each entry may
|
||||
be prefixed with an optional track filter, and
|
||||
multiple <key-spec> entries can be used, separated by
|
||||
','. (see online docs for details)
|
||||
--encryption-cenc-scheme=<cenc-scheme>
|
||||
MPEG Common Encryption scheme (cenc, cbc1, cens or
|
||||
cbcs). (default: cenc)
|
||||
--encryption-args=<cmdline-arguments>
|
||||
Pass additional command line arguments to mp4encrypt
|
||||
(separated by spaces)
|
||||
--eme-signaling=<eme-signaling-type>
|
||||
Add EME-compliant signaling in the MPD and PSSH boxes
|
||||
(valid options are 'pssh-v0' and 'pssh-v1')
|
||||
--merge-keys Merge all keys in a single set used for all
|
||||
<ContentProtection> elements
|
||||
--marlin Add Marlin signaling to the MPD (requires an encrypted
|
||||
input, or the --encryption-key option)
|
||||
--marlin-add-pssh Add an (optional) Marlin 'pssh' box in the init
|
||||
segment(s)
|
||||
--playready Add PlayReady signaling to the MPD (requires an
|
||||
encrypted input, or the --encryption-key option)
|
||||
--playready-version=PLAYREADY_VERSION
|
||||
PlayReady version to use (4.0, 4.1, 4.2, 4.3),
|
||||
defaults to 4.0
|
||||
--playready-header=<playready-header>
|
||||
Add a PlayReady PRO element in the MPD and a PlayReady
|
||||
PSSH box in the init segments. The use of this option
|
||||
implies the --playready option. The <playready-header>
|
||||
argument can be either: (1) the character '@' followed
|
||||
by the name of a file containing a PlayReady XML
|
||||
Rights Management Header (<WRMHEADER>) or a PlayReady
|
||||
Header Object (PRO) in binary form, or (2) the
|
||||
character '#' followed by a PlayReady Header Object
|
||||
encoded in Base64, or (3) one or more <name>:<value>
|
||||
pair(s) (separated by '#' if more than one) specifying
|
||||
fields of a PlayReady Header Object (field names
|
||||
include LA_URL, LUI_URL and DS_ID)
|
||||
--playready-add-pssh Store the PlayReady header in a 'pssh' box in the init
|
||||
segment(s) [deprecated: this is now implicitly on by
|
||||
default when the --playready or --playready-header
|
||||
option is used]
|
||||
--playready-no-pssh Do not store the PlayReady header in a 'pssh' box in
|
||||
the init segment(s)
|
||||
--widevine Add Widevine signaling to the MPD (requires an
|
||||
encrypted input, or the --encryption-key option)
|
||||
--widevine-header=<widevine-header>
|
||||
Add a Widevine entry in the MPD, and a Widevine PSSH
|
||||
box in the init segments. The use of this option
|
||||
implies the --widevine option. The <widevine-header>
|
||||
argument can be either: (1) the character '#' followed
|
||||
by a Widevine header encoded in Base64 (either a
|
||||
complete PSSH box or just the PSSH box payload), or
|
||||
(2) one or more <name>:<value> pair(s) (separated by
|
||||
'#' if more than one) specifying fields of a Widevine
|
||||
header (field names include 'provider' [string],
|
||||
'content_id' [byte array in hex], 'policy' [string])
|
||||
--primetime Add Primetime signaling to the MPD (requires an
|
||||
encrypted input, or the --encryption-key option)
|
||||
--primetime-metadata=<primetime-metadata>
|
||||
Add Primetime metadata in a PSSH box in the init
|
||||
segments. The use of this option implies the
|
||||
--primetime option. The <primetime-data> argument can
|
||||
be either: (1) the character '@' followed by the name
|
||||
of a file containing the Primetime Metadata to use, or
|
||||
(2) the character '#' followed by the Primetime
|
||||
Metadata encoded in Base64
|
||||
--fairplay-key-uri=FAIRPLAY_KEY_URI
|
||||
Specify the key URI to use for FairPlay Streaming key
|
||||
delivery (only valid with --hls option)
|
||||
--clearkey Add Clear Key signaling to the MPD (requires an
|
||||
encrypted input, or the --encryption-key option))
|
||||
--clearkey-license-uri=CLEARKEY_LICENSE_URI
|
||||
Specify the license/key URI to use for Clear Key (only
|
||||
valid with --clearkey option)
|
||||
--exec-dir=<exec_dir>
|
||||
Directory where the Bento4 executables are located
|
||||
(use '-' to look for executable in the current PATH)
|
||||
```
|
||||
13
Documents/MkDocs/src/documentation/mp4dashclone.md
Normal file
13
Documents/MkDocs/src/documentation/mp4dashclone.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# mp4dashclone
|
||||
```
|
||||
Usage: mp4-dash-clone.py [options] <file-or-http-url> <output-dir>
|
||||
|
||||
|
||||
Options:
|
||||
-h, --help show this help message and exit
|
||||
--quiet Be quiet
|
||||
--encrypt=<KID:KEY> Encrypt the media, with KID and KEY specified in Hex
|
||||
(32 characters each)
|
||||
--exec-dir=<exec_dir>
|
||||
Directory where the Bento4 executables are located
|
||||
```
|
||||
23
Documents/MkDocs/src/documentation/mp4dcfpackager.md
Normal file
23
Documents/MkDocs/src/documentation/mp4dcfpackager.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# mp4dcfpackager
|
||||
```
|
||||
MP4 DCF Packager - Version 1.0.1
|
||||
(Bento4 Version 1.6.0.0)
|
||||
(c) 2002-2009 Axiomatic Systems, LLC
|
||||
|
||||
usage: mp4dcfpackager --method <method> [options] <input> <output>
|
||||
--method: <method> is NULL, CBC or CTR
|
||||
Options:
|
||||
--show-progress: show progress details
|
||||
--content-type: content MIME type
|
||||
--content-id: content ID
|
||||
--rights-issuer: rights issuer URL
|
||||
--key <k>:<iv>
|
||||
Specifies the key to use for encryption.
|
||||
<k> a 128-bit key in hex (32 characters)
|
||||
and <iv> a 128-bit IV or salting key in hex (32 characters)
|
||||
--textual-header <name>:<value>
|
||||
Specifies a textual header where <name> is the header name,
|
||||
and <value> is the header value
|
||||
(several --textual-header options can be used)
|
||||
|
||||
```
|
||||
20
Documents/MkDocs/src/documentation/mp4decrypt.md
Normal file
20
Documents/MkDocs/src/documentation/mp4decrypt.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# mp4decrypt
|
||||
```
|
||||
MP4 Decrypter - Version 1.4
|
||||
(Bento4 Version 1.6.0.0)
|
||||
(c) 2002-2015 Axiomatic Systems, LLC
|
||||
|
||||
usage: mp4decrypt [options] <input> <output>
|
||||
Options are:
|
||||
--show-progress : show progress details
|
||||
--key <id>:<k>
|
||||
<id> is either a track ID in decimal or a 128-bit KID in hex,
|
||||
<k> is a 128-bit key in hex
|
||||
(several --key options can be used, one for each track or KID)
|
||||
note: for dcf files, use 1 as the track index
|
||||
note: for Marlin IPMP/ACGK, use 0 as the track ID
|
||||
note: KIDs are only applicable to some encryption methods like MPEG-CENC
|
||||
--fragments-info <filename>
|
||||
Decrypt the fragments read from <input>, with track info read
|
||||
from <filename>.
|
||||
```
|
||||
21
Documents/MkDocs/src/documentation/mp4dump.md
Normal file
21
Documents/MkDocs/src/documentation/mp4dump.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# mp4dump
|
||||
```
|
||||
MP4 File Dumper - Version 1.2
|
||||
(Bento4 Version 1.6.0.0)
|
||||
(c) 2002-2011 Axiomatic Systems, LLC
|
||||
|
||||
usage: mp4dump [options] <input>
|
||||
options are:
|
||||
--verbosity <n>
|
||||
sets the verbosity (details) level to <n> (between 0 and 3)
|
||||
--track <track_id>[:<key>]
|
||||
writes the track data into a file
|
||||
(<mp4filename>.<track_id>) and optionally
|
||||
tries to decrypt it with the key (128-bit in hex)
|
||||
(several --track options can be used, one for each track)
|
||||
Each sample is written preceded by its size encoded as a 32-bit
|
||||
value in big-endian byte order
|
||||
--format <format>
|
||||
format to use for the output, where <format> is either
|
||||
'text' (default) or 'json'
|
||||
```
|
||||
18
Documents/MkDocs/src/documentation/mp4edit.md
Normal file
18
Documents/MkDocs/src/documentation/mp4edit.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# mp4edit
|
||||
```
|
||||
MP4 File Editor - Version 1.2
|
||||
(Bento4 Version 1.6.0.0)
|
||||
(c) 2002-2017 Axiomatic Systems, LLC
|
||||
|
||||
usage: mp4edit [commands] <input> <output>
|
||||
where commands include one or more of:
|
||||
--insert <atom_path>:<atom_source>[:<position>]
|
||||
--remove <atom_path>
|
||||
--replace <atom_path>:<atom_source>
|
||||
|
||||
and <atom_source> may be either a filename for a file
|
||||
that contains the atom data (header and payload), or
|
||||
<uuid>#<file> with <uuid> specifying an atom uuid type,
|
||||
as a 32-character hex value, and <file> a file with the atom
|
||||
payload only.
|
||||
```
|
||||
74
Documents/MkDocs/src/documentation/mp4encrypt.md
Normal file
74
Documents/MkDocs/src/documentation/mp4encrypt.md
Normal file
@@ -0,0 +1,74 @@
|
||||
# mp4encrypt
|
||||
```
|
||||
MP4 Encrypter - Version 1.6
|
||||
(Bento4 Version 1.6.0.0)
|
||||
(c) 2002-2016 Axiomatic Systems, LLC
|
||||
|
||||
usage: mp4encrypt --method <method> [options] <input> <output>
|
||||
<method> is OMA-PDCF-CBC, OMA-PDCF-CTR, MARLIN-IPMP-ACBC,
|
||||
MARLIN-IPMP-ACGK, ISMA-IAEC, PIFF-CBC, PIFF-CTR, MPEG-CENC,
|
||||
MPEG-CBC1, MPEG-CENS, MPEG-CBCS
|
||||
Options:
|
||||
--show-progress
|
||||
Show progress details
|
||||
--fragments-info <filename>
|
||||
Encrypt the fragments read from <input>, with track info read
|
||||
from <filename>
|
||||
--key <n>:<k>:<iv>
|
||||
Specifies the key to use for a track (or group key).
|
||||
<n> is a track ID, <k> a 128-bit key in hex (32 characters)
|
||||
and <iv> a 64-bit or 128-bit IV or salting key in hex
|
||||
(16 or 32 characters) depending on the cipher mode
|
||||
The key and IV values can also be specified with the keyword 'random'
|
||||
instead of a hex-encoded value, in which case a randomly generated value
|
||||
will be used.
|
||||
(several --key options can be used, one for each track)
|
||||
--strict
|
||||
Fail if there is a warning (ex: one or more tracks would be left unencrypted)
|
||||
--property <n>:<name>:<value>
|
||||
Specifies a named string property for a track
|
||||
<n> is a track ID, <name> a property name, and <value> is the
|
||||
property value
|
||||
(several --property options can be used, one or more for each track)
|
||||
--global-option <name>:<value>
|
||||
Sets the global option <name> to be equal to <value>
|
||||
--pssh <system-id>:<filename>
|
||||
Add a 'pssh' atom for this system ID, with the payload
|
||||
loaded from <filename>.
|
||||
(several --pssh options can be used, with a different system ID for each)
|
||||
(the filename can be left empty after the ':' if no payload is needed)
|
||||
--pssh-v1 <system-id>:<filename>
|
||||
Same as --pssh but generates a version=1 'pssh' atom
|
||||
(this option must appear *after* the --property options on the command line)
|
||||
--kms-uri <uri>
|
||||
Specifies the KMS URI for the ISMA-IAEC method
|
||||
|
||||
Method Specifics:
|
||||
OMA-PDCF-CBC, MARLIN-IPMP-ACBC, MARLIN-IPMP-ACGK, PIFF-CBC, MPEG-CBC1, MPEG-CBCS:
|
||||
the <iv> can be 64-bit or 128-bit
|
||||
If the IV is specified as a 64-bit value, it will be padded with zeros.
|
||||
|
||||
OMA-PDCF-CTR, ISMA-IAEC, PIFF-CTR, MPEG-CENC, MPEG-CENS:
|
||||
the <iv> should be a 64-bit hex string.
|
||||
If a 128-bit value is supplied, it will be truncated to 64-bit.
|
||||
|
||||
OMA-PDCF-CBC, OMA-PDCF-CTR: The following properties are defined,
|
||||
and all other properties are stored in the textual headers:
|
||||
ContentId -> the content ID for the track
|
||||
RightsIssuerUrl -> the Rights Issuer URL
|
||||
|
||||
MARLIN-IPMP-ACBC, MARLIN-IPMP-ACGK: The following properties are defined:
|
||||
ContentId -> the content ID for the track
|
||||
|
||||
MARLIN-IPMP-ACGK: The group key is specified with --key where <n>
|
||||
is 0. The <iv> part of the key must be present, but will be ignored;
|
||||
It should therefore be set to 0000000000000000
|
||||
|
||||
MPEG-CENC, MPEG-CBC1, MPEG-CENS, MPEG-CBCS, PIFF-CTR, PIFF-CBC:
|
||||
The following properties are defined:
|
||||
KID -> the value of KID, 16 bytes, in hexadecimal (32 characters)
|
||||
ContentId -> Content ID mapping for KID (Marlin option)
|
||||
PsshPadding -> pad the 'pssh' container to this size
|
||||
(only when using ContentId).
|
||||
This property should be set for track ID 0 only
|
||||
```
|
||||
10
Documents/MkDocs/src/documentation/mp4extract.md
Normal file
10
Documents/MkDocs/src/documentation/mp4extract.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# mp4extract
|
||||
```
|
||||
MP4 Atom Extractor - Version 1.0
|
||||
(Bento4 Version 1.6.0.0)
|
||||
(c) 2002-2008 Axiomatic Systems, LLC
|
||||
|
||||
usage: mp4extract [options] <atom_path> <input> <output>
|
||||
options:
|
||||
--payload-only : omit the atom header
|
||||
```
|
||||
25
Documents/MkDocs/src/documentation/mp4fragment.md
Normal file
25
Documents/MkDocs/src/documentation/mp4fragment.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# mp4fragment
|
||||
```
|
||||
MP4 Fragmenter - Version 1.7.0
|
||||
(Bento4 Version 1.6.0.0)
|
||||
(c) 2002-2020 Axiomatic Systems, LLC
|
||||
|
||||
usage: mp4fragment [options] <input> <output>
|
||||
options are:
|
||||
--verbosity <n> sets the verbosity (details) level to <n> (between 0 and 3)
|
||||
--debug enable debugging information output
|
||||
--quiet don't print out notice messages
|
||||
--fragment-duration <milliseconds> (default = automatic)
|
||||
--timescale <n> (use 10000000 for Smooth Streaming compatibility)
|
||||
--track <track-id or type> only include media from one track (pass a track ID, 'audio', 'video' or 'subtitles')
|
||||
--index (re)create the segment index
|
||||
--trim trim excess media in longer tracks
|
||||
--no-tfdt don't add 'tfdt' boxes in the fragments (may be needed for legacy Smooth Streaming clients)
|
||||
--tfdt-start <start> value of the first tfdt timestamp, expressed as a floating point number in seconds
|
||||
--sequence-number-start <start> value of the first segment sequence number (default: 1)
|
||||
--force-i-frame-sync <auto|all> treat all I-frames as sync samples (for open-gop sequences)
|
||||
'auto' only forces the flag if an open-gop source is detected, 'all' forces the flag in all cases
|
||||
--copy-udta copy the moov/udta atom from input to output
|
||||
--no-zero-elst don't set the last edit list entry to 0 duration
|
||||
--trun-version-zero set the 'trun' box version to zero (default version: 1)
|
||||
```
|
||||
75
Documents/MkDocs/src/documentation/mp4hls.md
Normal file
75
Documents/MkDocs/src/documentation/mp4hls.md
Normal file
@@ -0,0 +1,75 @@
|
||||
# mp4hls
|
||||
```
|
||||
Usage: mp4-hls.py [options] <media-file> [<media-file> ...]
|
||||
|
||||
Each <media-file> is the path to an MP4 file, optionally prefixed with a
|
||||
stream selector delimited by [ and ]. The same input MP4 file may be repeated,
|
||||
provided that the stream selector prefixes select different streams. Version
|
||||
1.2.0 r637
|
||||
|
||||
Options:
|
||||
-h, --help show this help message and exit
|
||||
-v, --verbose Be verbose
|
||||
-d, --debug Print out debugging information
|
||||
-o <output-dir>, --output-dir=<output-dir>
|
||||
Output directory
|
||||
-f, --force Allow output to an existing directory
|
||||
--hls-version=<version>
|
||||
HLS Version (default: 4)
|
||||
--master-playlist-name=<filename>
|
||||
Master Playlist name
|
||||
--media-playlist-name=<name>
|
||||
Media Playlist name
|
||||
--iframe-playlist-name=<name>
|
||||
I-frame Playlist name
|
||||
--output-single-file Store segment data in a single output file per input
|
||||
file
|
||||
--audio-format=AUDIO_FORMAT
|
||||
Format for audio segments (packed or ts) (default:
|
||||
packed)
|
||||
--segment-duration=SEGMENT_DURATION
|
||||
Segment duration (default: 6)
|
||||
--encryption-mode=<mode>
|
||||
Encryption mode (only used when --encryption-key is
|
||||
specified). AES-128 or SAMPLE-AES (default: AES-128)
|
||||
--encryption-key=<key>
|
||||
Encryption key in hexadecimal (default: no encryption)
|
||||
--encryption-iv-mode=<mode>
|
||||
Encryption IV mode: 'sequence', 'random' or 'fps'
|
||||
(Fairplay Streaming) (default: sequence). When the
|
||||
mode is 'fps', the encryption key must be 32 bytes: 16
|
||||
bytes for the key followed by 16 bytes for the IV.
|
||||
--encryption-key-uri=<uri>
|
||||
Encryption key URI (may be a relative or absolute
|
||||
URI). (default: key.bin)
|
||||
--encryption-key-format=<format>
|
||||
Encryption key format. (default: 'identity')
|
||||
--encryption-key-format-versions=<versions>
|
||||
Encryption key format versions.
|
||||
--signal-session-key Signal an #EXT-X-SESSION-KEY tag in the master
|
||||
playlist
|
||||
--fairplay=<fairplay-parameters>
|
||||
Enable Fairplay Key Delivery. The <fairplay-
|
||||
parameters> argument is one or more <name>:<value>
|
||||
pair(s) (separated by '#' if more than one). Names
|
||||
include 'uri' [string] (required)
|
||||
--widevine=<widevine-parameters>
|
||||
Enable Widevine Key Delivery. The <widevine-header>
|
||||
argument can be either: (1) the character '#' followed
|
||||
by a Widevine header encoded in Base64, or (2) one or
|
||||
more <name>:<value> pair(s) (separated by '#' if more
|
||||
than one) specifying fields of a Widevine header
|
||||
(field names include 'provider' [string] (required),
|
||||
'content_id' [byte array in hex] (optional), 'kid'
|
||||
[16-byte array in hex] (required))
|
||||
--output-encryption-key
|
||||
Output the encryption key to a file (default: don't
|
||||
output the key). This option is only valid when the
|
||||
encryption key format is 'identity'
|
||||
--exec-dir=<exec_dir>
|
||||
Directory where the Bento4 executables are located
|
||||
--base-url=<base_url>
|
||||
The base URL for the Media Playlists and TS files
|
||||
listed in the playlists. This is the prefix for the
|
||||
files.
|
||||
```
|
||||
16
Documents/MkDocs/src/documentation/mp4info.md
Normal file
16
Documents/MkDocs/src/documentation/mp4info.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# mp4info
|
||||
```
|
||||
MP4 File Info - Version 1.3.4
|
||||
(Bento4 Version 1.6.0.0)
|
||||
(c) 2002-2017 Axiomatic Systems, LLC
|
||||
|
||||
usage: mp4info [options] <input>
|
||||
Options:
|
||||
--verbose: show extended information when available
|
||||
--format <format>: display the information in this format.
|
||||
<format> is: text (default) or json
|
||||
--show-layout: show sample layout
|
||||
--show-samples: show sample details
|
||||
--show-sample-data: show sample data
|
||||
--fast: skip some details that are slow to compute
|
||||
```
|
||||
36
Documents/MkDocs/src/documentation/mp4mux.md
Normal file
36
Documents/MkDocs/src/documentation/mp4mux.md
Normal file
@@ -0,0 +1,36 @@
|
||||
# mp4mux
|
||||
```
|
||||
MP4 Elementary Stream Multiplexer - Version 3.0
|
||||
(Bento4 Version 1.6.0.0)
|
||||
(c) 2002-20020 Axiomatic Systems, LLC
|
||||
|
||||
usage: mp4mux [options] --track [<type>:]<input>[#<params>] [--track [<type>:]<input>[#<params>] ...] <output>
|
||||
|
||||
<params>, when specified, are expressd as a comma-separated list of
|
||||
one or more <name>=<value> parameters
|
||||
|
||||
Supported types:
|
||||
h264: H264/AVC NAL units
|
||||
h265: H265/HEVC NAL units
|
||||
optional params:
|
||||
dv_profile: integer number for Dolby vision profile ID (valid value: 5,8,9)
|
||||
dv_bc: integer number for Dolby vision BL signal cross-compatibility ID (mandatory if dv_profile is set to 8/9)
|
||||
frame_rate: floating point number in frames per second (default=24.0)
|
||||
format: hev1 or hvc1 (default) for HEVC tracks and Dolby Vision backward-compatible tracks
|
||||
dvhe or dvh1 (default) for Dolby vision tracks
|
||||
aac: AAC in ADTS format
|
||||
ac3: Dolby Digital
|
||||
ec3: Dolby Digital Plus
|
||||
ac4: Dolby AC-4
|
||||
mp4: MP4 track(s) from an MP4 file
|
||||
optional params:
|
||||
track: audio, video, or integer track ID (default=all tracks)
|
||||
|
||||
Common optional parameters for all types:
|
||||
language: language code (3-character ISO 639-2 Alpha-3 code)
|
||||
|
||||
If no type is specified for an input, the type will be inferred from the file extension
|
||||
|
||||
Options:
|
||||
--verbose: show more details
|
||||
```
|
||||
23
Documents/MkDocs/src/documentation/mp4split.md
Normal file
23
Documents/MkDocs/src/documentation/mp4split.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# mp4split
|
||||
```
|
||||
MP4 Fragment Splitter - Version 1.2
|
||||
(Bento4 Version 1.6.0.0)
|
||||
(c) 2002-2016 Axiomatic Systems, LLC
|
||||
|
||||
usage: mp4split [options] <input>
|
||||
Options:
|
||||
--verbose : print verbose information when running
|
||||
--init-segment <filename> : name of init segment (default: init.mp4)
|
||||
--init-only : only output the init segment (no media segments)
|
||||
--media-segment <filename-pattern> (default: segment-%llu.%04llu.m4s)
|
||||
NOTE: all parameters are 64-bit integers, use %llu in the pattern
|
||||
--start-number <n> : start numbering segments at <n> (default=1)
|
||||
--pattern-parameters <params> : one or more selector letter (default: IN)
|
||||
I: track ID
|
||||
N: segment number
|
||||
--track-id <track-id> : only output segments with this track ID
|
||||
More than one track IDs can be specified if <track-id> is a comma-separated
|
||||
list of track IDs
|
||||
--audio : only output audio segments
|
||||
--video : only output video segments
|
||||
```
|
||||
48
Documents/MkDocs/src/documentation/mp4tag.md
Normal file
48
Documents/MkDocs/src/documentation/mp4tag.md
Normal file
@@ -0,0 +1,48 @@
|
||||
# mp4tag
|
||||
```
|
||||
MP4 File Tagger - Version 1.2 (Bento4 Version 1.6.0.0)
|
||||
(c) 2002-2008 Axiomatic Systems, LLC
|
||||
|
||||
usage: mp4tag [options] [commands...] <input> [<output>]
|
||||
commands:
|
||||
--help print this usage information
|
||||
--show-tags show tags found in the input file
|
||||
--list-symbols list all the builtin symbols
|
||||
--list-keys list all the builtin symbolic key names
|
||||
--set <key>:<type>:<value>
|
||||
set a tag (if the tag does not already exist, set behaves like add)
|
||||
--add <key>:<type>:<value>
|
||||
set/add a tag
|
||||
where <type> is:
|
||||
S if <value> is a UTF-8 string
|
||||
LS if <value> is a UTF-8 string with a language code (see notes)
|
||||
I8 if <value> is an 8-bit integer
|
||||
I16 if <value> is a 16-bit integer
|
||||
I32 if <value> is a 32-bit integer
|
||||
JPEG if <value> is the name of a JPEG file
|
||||
GIF if <value> is the name of a GIF file
|
||||
B if <value> is a binary string (see notes)
|
||||
Z if <value> is the name of a builtin symbol
|
||||
--remove <key>
|
||||
remove a tag
|
||||
--extract <key>:<file>
|
||||
extract the value of a tag and save it to a file
|
||||
|
||||
NOTES:
|
||||
In all commands with a <key> argument, except for '--add', <key> can be
|
||||
<key-name> or <key-name>#n where n is the zero-based index of the key when
|
||||
there is more than one key with the same name (ex: multiple images for cover
|
||||
art).
|
||||
A <key-name> has the form <namespace>/<name> or simply <name> (in which case
|
||||
the namespace defaults to 'meta').
|
||||
The <name> of a key is either one of a symbolic keys
|
||||
(see --list-keys) or a 4-character atom name.
|
||||
The namespace can be 'meta' for itunes-style metadata or 'dcf' for
|
||||
OMA-DCF-style metadata, or a user-defined long-form namespace
|
||||
(ex: com.mycompany.foo).
|
||||
Binary strings can be expressed as a normal string of ASCII characters
|
||||
prefixed by a + character if all the bytes fall in the ASCII range,
|
||||
or hex-encoded prefixed by a # character (ex: +hello, or #0FC4)
|
||||
Strings with a language code are expressed as: <lang>:<string>,
|
||||
where <lang> is a 3 character language code (ex: eng:hello)
|
||||
```
|
||||
22
Documents/MkDocs/src/downloads.md
Normal file
22
Documents/MkDocs/src/downloads.md
Normal file
@@ -0,0 +1,22 @@
|
||||
DOWNLOADS
|
||||
=========
|
||||
|
||||
# Binary Releases and Source Snapshot
|
||||
|
||||
As a convenience, we publish here the most recent version of the binary releases (SDK with header files, libraries and command line applications) for the most common platforms, and the corresponding source snapshot.
|
||||
|
||||
## Version 1.6.0-637
|
||||
|
||||
:fontawesome-brands-windows: [Binaries for Windows 10](https://www.bok.net/Bento4/binaries/Bento4-SDK-1-6-0-637.x86_64-microsoft-win32.zip)
|
||||
:fontawesome-brands-apple: [Binaries for macOS](https://www.bok.net/Bento4/binaries/Bento4-SDK-1-6-0-637.universal-apple-macosx.zip)
|
||||
:fontawesome-brands-linux: [Binaries for Linux x86_64](https://www.bok.net/Bento4/binaries/Bento4-SDK-1-6-0-637.x86_64-unknown-linux.zip)
|
||||
:fontawesome-solid-code: [Source Snapshot (all platforms)](https://www.bok.net/Bento4/source/Bento4-SRC-1-6-0-637.zip)
|
||||
|
||||
## SHA1 Checksums
|
||||
|
||||
| CHECKSUM | LINK |
|
||||
| ------------------------------------------ | ----------------------------------------------- |
|
||||
| `476a2d21d27383aba6238707d9a38bd4cabceb8f` | Bento4-SDK-1-6-0-637.universal-apple-macosx.zip |
|
||||
| `a60f19aedcdfd9bc7a9fc6a4c7587fefb4c59273` | Bento4-SDK-1-6-0-637.x86_64-microsoft-win32.zip |
|
||||
| `5fda10ea7347c5e6e5125c2ee9f4757ce270cf1e` | Bento4-SDK-1-6-0-637.x86_64-unknown-linux.zip |
|
||||
| `45b627e73253a3e03fa31af3b843f2c194f85793` | Bento4-SRC-1-6-0-637.zip |
|
||||
BIN
Documents/MkDocs/src/images/favicon.png
Normal file
BIN
Documents/MkDocs/src/images/favicon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
BIN
Documents/MkDocs/src/images/rocks_and_plants.jpg
Normal file
BIN
Documents/MkDocs/src/images/rocks_and_plants.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 69 KiB |
@@ -1,8 +1,65 @@
|
||||
Welcome to Bento4
|
||||
======================
|
||||

|
||||
|
||||
Bento4 MP4, DASH/HLS/CMAF Class Library, SDK and Tools
|
||||
------------------------------------------------------
|
||||
|
||||
A fast, modern, open source C++ toolkit for all your MP4 and DASH/HLS/CMAF media format needs
|
||||
A fast, modern, open source C++ toolkit for all your MP4 and DASH/HLS/CMAF media format needs.
|
||||
|
||||

|
||||
|
||||
Bento4 is a C++ class library and tools designed to read and write ISO-MP4 files. This format is defined in international specifications ISO/IEC 14496-12, 14496-14 and 14496-15. The format is a derivative of the Apple Quicktime file format, so Bento4 can be used to read and write most Quicktime files as well. In addition to supporting ISO-MP4, Bento4 includes support for parsing and multiplexing H.264 and H.265 elementary streams, converting ISO-MP4 to MPEG2-TS, packaging HLS and MPEG-DASH, CMAF, content encryption, decryption, and much more.
|
||||
|
||||
Features
|
||||
--------
|
||||
|
||||
A number of formats and features based on the ISO-MP4 format and related technologies are also supported, including:
|
||||
|
||||
* [MPEG DASH](developers/dash/index.md) with fragmented MP4 files, as defined in the international specification [ISO/IEC 23009-1](https://www.iso.org/standard/75485.html)
|
||||
* [HLS](developers/hls/index.md) with TS or MP4 segments (dual DASH/HLS output), as defined in [RFC 8216](https://datatracker.ietf.org/doc/html/rfc8216)
|
||||
* [CMAF](developers/cmaf/index.md) (Common Media Application Format) as defined in ISO/IEC 23000-19
|
||||
* MPEG Common Encryption (CENC) as specified in the international specification [ISO/IEC 23001-7](https://www.iso.org/standard/68042.html)
|
||||
* [PIFF](http://go.microsoft.com/?linkid=9682897) (Protected Interoperable File Format), and encrypted, fragmented MP4 format specified by Microsoft and used for encrypted HTTP Smooth Streaming.
|
||||
* Reading and writing 3GPP and iTunes-compatible metadata.
|
||||
* ISMA Encrytion and Decryption as defined in the [ISMA E&A specification](http://www.isma.tv/)
|
||||
* OMA 2.0 and 2.1 DCF/PDCF Encryption and Decryption as defined in the [OMA specifications](http://www.openmobilealliance.org/).
|
||||
* ISO-MP4 files profiled as part of the [3GPP family of standards](http://www.3gpp.org/).
|
||||
* The [UltraViolet](http://www.uvvu.com/) (DECE) CFF (Common File Format).
|
||||
* Parsing and multiplexing of H.264 (AVC) video and AAC audio elementary streams
|
||||
* Support for multiple DRM systems that are compatible with MP4-formatted content (usually leveraging CENC Common Encryption), such as Marlin, PlayReady, Widevine, FairPlay and Adobe Access.
|
||||
* Support for a wide range of codecs, including H.264 (AVC), H.265 (HEVC), AAC, HE-AAC, xHE-AAC, AC3 and eAC3 (Dolby Digital), AC4, Dolby Atmos, DTS, ALAC, and many more.
|
||||
* Support for Dolby Vision and HDR.
|
||||
|
||||
The SDK is designed to be cross-platform. The code is very portable; it can be compiled with any sufficiently modern C++ compiler. The implementation does not rely on any external library. All the code necessary to compile the SDK and tools is included in the standard distribution. The standard distribution contains makefiles for unix-like operating systems, including Linux and Android, project files for Microsoft Visual Studio, and an XCode project for MacOS X and iOS. There is also support for building the library with the [SCons](http://www.scons.org/) build system as well as [CMake](https://cmake.org/).
|
||||
|
||||
The library is Open Source, with a dual-license model. You can find out more about the license on the [About Page](about.md).
|
||||
The [Developers Page](developers/index.md) contains specific information on where to obtain the source code and documentation.
|
||||
The [Downloads Page](downloads.md) contains the links to pre-built SDKs and tools that you can use to get started quickly.
|
||||
|
||||
Included Applications
|
||||
---------------------
|
||||
|
||||
The Bento4 SDK includes several command-line applications/tools that are built using the SDK API. These include:
|
||||
|
||||
| TOOL NAME | DESCRIPTION |
|
||||
|-----------|-------------|
|
||||
| mp4info | displays high level info about an MP4 file, including all tracks and codec details |
|
||||
| mp4dump |displays the entire atom/box structure of an MP4 file |
|
||||
| mp4edit |add/insert/remove/replace atom/box items of an MP4 file |
|
||||
| mp4extract |extracts an atom/box from an MP4 file |
|
||||
| mp4encrypt |encrypts an MP4 file (multiple encryption schemes are supported) |
|
||||
| mp4decryp | decrypts an MP4 file (multiple encryption schemes are supported) |
|
||||
| mp4dcfpackager | encrypts a media file into an OMA DCF file |
|
||||
| mp4compact | converts ‘stsz’ tables into ‘stz2’ tables to create more compact MP4 files |
|
||||
| mp4fragment | creates a fragmented MP4 file from a non-fragmented one |
|
||||
| mp4split | splits a fragmented MP4 file into discrete files |
|
||||
| mp4tag | show/edit MP4 metadata (iTunes-style and others) |
|
||||
| mp4mux | multiplexes one or more elementary streams (H264/AVC, H265/HEVC, AAC) into an MP4 file |
|
||||
| mp42aac | extract a raw AAC elementary stream from an MP4 file |
|
||||
| mp42avc | extract a raw AVC/H.264 elementary stream from an MP4 file |
|
||||
| mp42hevc | extract a raw HEVC/H.265 elementary stream from an MP4 file |
|
||||
| mp42hls | converts an MP4 file to an HLS (HTTP Live Streaming) presentation, including the generation of the segments and .m3u8 playlist as well as AES-128 and SAMPLE-AES (for Fairplay) encryption. This can be used as a replacement for Apple’s mediafilesegmenter tool |
|
||||
| mp42ts | converts an MP4 file to an MPEG2-TS file |
|
||||
| mp4dash | creates an MPEG DASH output from one or more MP4 files, including encryption. As an option, an HLS playlist with MP4 segments can also be generated at the same time, allowing a single stream to be served as DASH and HLS. This is a full-featured MPEG DASH / HLS packager |
|
||||
| mp4dashclone | creates a local clone of a remote or local MPEG DASH presentation, optionally encrypting the segments as they are cloned |
|
||||
| mp4hls | creates a multi-bitrate HLS master playlist from one or more MP4 files, including support for encryption and I-frame-only playlists. This tool uses the ‘mp42hls’ low level tool internally, so all the options supported by that low level tool are also available. This can be used as a replacement for Apple’s variantplaylistcreator tool |
|
||||
6
Documents/MkDocs/src/support.md
Normal file
6
Documents/MkDocs/src/support.md
Normal file
@@ -0,0 +1,6 @@
|
||||
SUPPORT
|
||||
=======
|
||||
|
||||

|
||||
|
||||
For questions or bug reports, please go through the [GitHub Issues](https://github.com/axiomatic-systems/Bento4/issues) page, or our [Support Portal](http://axiosys.zendesk.com/)
|
||||
12
README.md
12
README.md
@@ -142,6 +142,18 @@ For Release builds:
|
||||
Release Notes
|
||||
-------------
|
||||
|
||||
### 1.6.0-638
|
||||
* support multi-bitrate audio
|
||||
* new docs using MkDocs
|
||||
* add av1 files and remove deprecated option from vs2019 build
|
||||
* add AV1 support
|
||||
* better handling of USAC signaling
|
||||
* add UTF-8 support on Windows
|
||||
* fix LGTM warnings
|
||||
* account for last sample when at EOS
|
||||
* new inspector API
|
||||
* bug fixes
|
||||
|
||||
### 1.6.0-636
|
||||
Dolby Vision encryption now properly encrypts in a NAL-unit-aware mode
|
||||
|
||||
|
||||
8
Scripts/GenerateToolsMarkdownDoc.sh
Normal file
8
Scripts/GenerateToolsMarkdownDoc.sh
Normal file
@@ -0,0 +1,8 @@
|
||||
DOC_ROOT=Documents/MkDocs/src/documentation
|
||||
for tool in mp4info mp4dump mp4edit mp4extract mp4encrypt mp4decrypt mp4dcfpackager mp4compact mp4fragment mp4split mp4tag mp4mux mp42aac mp42avc mp42hevc mp42hls mp42ts mp4dash mp4dashclone mp4hls
|
||||
do
|
||||
echo "#" $tool > $DOC_ROOT/$tool.md
|
||||
echo '```' >> $DOC_ROOT/$tool.md
|
||||
$tool >> $DOC_ROOT/$tool.md 2>&1
|
||||
echo '```' >> $DOC_ROOT/$tool.md
|
||||
done
|
||||
@@ -2,13 +2,29 @@
|
||||
Tasks for Bento4
|
||||
"""
|
||||
|
||||
from invoke import Collection
|
||||
import subprocess
|
||||
import os
|
||||
from invoke import Collection, Config
|
||||
from . import build
|
||||
from . import docker
|
||||
from . import doc
|
||||
from . import test
|
||||
|
||||
GIT_DIR = subprocess.check_output("git rev-parse --show-toplevel",
|
||||
shell=True).strip().decode("utf-8")
|
||||
ROOT_DIR = GIT_DIR
|
||||
|
||||
# Add collections
|
||||
ns = Collection()
|
||||
ns.add_collection(build)
|
||||
ns.add_collection(docker)
|
||||
ns.add_collection(doc)
|
||||
ns.add_collection(test)
|
||||
|
||||
# Setup the configuration
|
||||
config = Config(project_location=ROOT_DIR)
|
||||
config.C = {}
|
||||
config.C.ROOT_DIR = ROOT_DIR
|
||||
config.C.DOC_DIR = os.path.join(ROOT_DIR, "Documents")
|
||||
|
||||
ns.configure(config)
|
||||
31
tasks/doc.py
Normal file
31
tasks/doc.py
Normal file
@@ -0,0 +1,31 @@
|
||||
"""Tasks to build the Bento4 documentation"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
import shutil
|
||||
from invoke import task, Collection
|
||||
|
||||
@task(default=True)
|
||||
def mkdocs_build(ctx):
|
||||
'''Generate the Bento4 documentation using MkDocs'''
|
||||
|
||||
# Build the HTML docs
|
||||
mkdocs_dir = os.path.join(ctx.C.DOC_DIR, 'MkDocs')
|
||||
with ctx.cd(mkdocs_dir):
|
||||
ctx.run("mkdocs build")
|
||||
|
||||
print("HTML docs built, you can now open {}/site/index.html".format(mkdocs_dir))
|
||||
|
||||
@task
|
||||
def mkdocs_serve(ctx):
|
||||
'''Start a local mkdocs server'''
|
||||
mkdocs_dir = os.path.join(ctx.C.DOC_DIR, 'MkDocs')
|
||||
with ctx.cd(mkdocs_dir):
|
||||
ctx.run("mkdocs serve")
|
||||
|
||||
mkdocs = Collection('mkdocs')
|
||||
mkdocs.add_task(mkdocs_build, 'build')
|
||||
mkdocs.add_task(mkdocs_serve, 'serve')
|
||||
|
||||
# Export a namespace
|
||||
ns = Collection(mkdocs)
|
||||
Reference in New Issue
Block a user