Skip to content

Commit

Permalink
patch latest changes from github wiki
Browse files Browse the repository at this point in the history
  • Loading branch information
nlsdvl committed Mar 4, 2024
1 parent dd1318c commit a5377f8
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 6 deletions.
8 changes: 6 additions & 2 deletions docs/Filters/cdcrypt.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@ When the file is set per PID, the first `CryptInfo` with the same ID is used, ot
# Options

<a id="cfile">__cfile__</a> (str): crypt file location
<a id="decrypt">__decrypt__</a> (enum, default: _full_): decrypt mode (CENC only)
<a id="decrypt">__decrypt__</a> (enum, default: _full_): decrypt mode (CENC only)

* full: decrypt everything, throwing error if keys are not found
* nokey: decrypt everything for which a key is found, skip decryption otherwise
* skip: decrypt nothing

* pad0: decrypt nothing and replace all crypted bits with 0
* pad1: decrypt nothing and replace all crypted bits with 1
* padsc: decrypt nothing and replace all crypted bytes with start codes

<a id="drop_keys">__drop_keys__</a> (uintl): consider keys with given 1-based indexes as not available (multi-key debug)
<a id="kids">__kids__</a> (strl): define KIDs. If `keys` is empty, consider keys with given KID (as hex string) as not available (debug)
<a id="keys">__keys__</a> (strl): define key values for each of the specified KID
Expand Down
25 changes: 22 additions & 3 deletions docs/Filters/dasher.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This filter requires the graph resolver to be activated.

This filter provides segmentation and manifest generation for MPEG-DASH and HLS formats.
The segmenter currently supports:

- MPD and m3u8 generation (potentially in parallel)
- ISOBMFF, MPEG-2 TS, MKV and raw bitstream segment formats
- override of profiles and levels in manifest for codecs
Expand Down Expand Up @@ -43,6 +44,7 @@ Standard DASH replacement strings:
_Note: these strings are not replaced in the manifest templates elements._

Additional replacement strings (not DASH, not generic GPAC replacements but may occur multiple times in template):

* $Init=NAME$: replaced by NAME for init segment, ignored otherwise
* $XInit=NAME$: complete replace by NAME for init segment, ignored otherwise
* $InitExt=EXT$: replaced by EXT for init segment file extensions, ignored otherwise
Expand All @@ -51,10 +53,12 @@ Additional replacement strings (not DASH, not generic GPAC replacements but may
* $Segment=NAME$: replaced by NAME for media segments, ignored for init segments
* $SegExt=EXT$: replaced by EXT for media segment file extensions, ignored for init segments
* $FS$ (FileSuffix): replaced by `_trackN` in case the input is an AV multiplex, or kept empty otherwise

_Note: these strings are replaced in the manifest templates elements._

## PID assignment and configuration
To assign PIDs into periods and adaptation sets and configure the session, the segmenter looks for the following properties on each input PID:
To assign PIDs into periods and adaptation sets and configure the session, the segmenter looks for the following properties on each input PID:

* `Representation`: assigns representation ID to input PID. If not set, the default behavior is to have each media component in different adaptation sets. Setting the `Representation` allows explicit multiplexing of the source(s)
* `Period`: assigns period ID to input PID. If not set, the default behavior is to have all media in the same period with the same start time
* `PStart`: assigns period start. If not set, 0 is assumed, and periods appear in the Period ID declaration order. If negative, this gives the period order (-1 first, then -2 ...). If positive, this gives the true start time and will abort DASHing at period end
Expand All @@ -71,6 +75,7 @@ _Note: If multiple streams in source, only the first stream will have an AS ID a
* `CropOrigin`: indicates x and y coordinates of video for SRD (size is video size)
* `SRD`: indicates SRD position and size of video for SRD, ignored if `CropOrigin` is set
* `SRDRef`: indicates global width and height of SRD, ignored if `CropOrigin` is set
* `HLSPL`: name of variant playlist, can use templates
* `HLSMExt`: list of extensions to add to master playlist entries, ['foo','bar=val'] added as `,foo,bar=val`
* `HLSVExt`: list of extensions to add to variant playlist, ['#foo','#bar=val'] added as `#foo \n #bar=val`
* Non-dash properties: `Bitrate`, `SAR`, `Language`, `Width`, `Height`, `SampleRate`, `NumChannels`, `Language`, `ID`, `DependencyID`, `FPS`, `Interlaced`, `Codec`. These properties are used to setup each representation and can be overridden on input PIDs using the general PID property settings (cf global help).
Expand Down Expand Up @@ -135,9 +140,19 @@ This will layout the `v2` below `v1` using a global SRD size of 1280x720.

The segmenter will create multiplexing filter chains for each representation and will reassign PID IDs so that each media component (video, audio, ...) in an adaptation set has the same ID.

For HLS, the output PID will deliver the master playlist __and__ the variant playlists.
For HLS, the output manifest PID will deliver the master playlist __and__ the variant playlists.
The default variant playlist are $NAME_$N.m3u8, where $NAME is the radical of the output file name and $N is the 1-based index of the variant.


When HLS mode is enabled, the segment [template](#template) is relative to the variant playlist file, which can also be templated.

Example
```
gpac -i av.mp4:#HLSPL=$Type$/index.m3u8 -o dash/live.m3u8:dual:template='$Number$'
```

This will put video segments and playlist in `dash/video/` and audio segments and playlist in `dash/audio/`


## Segmentation
The default behavior of the segmenter is to estimate the theoretical start time of each segment based on target segment duration, and start a new segment when a packet with SAP type 1,2,3 or 4 with time greater than the theoretical time is found.
This behavior can be changed to find the best SAP packet around a segment theoretical boundary using [sbound](#sbound):
Expand All @@ -163,6 +178,7 @@ gpac -i source.mp4 -o live.mpd:segdur=2:profile=live:dmode=dynamic:sreg
```

For low latency segmentation with fMP4, you will need to specify the following options:

* cdur: set the fMP4 fragment duration
* asto: set the availability time offset for DASH. This value should be equal or slightly greater than segment duration minus cdur
* llhls: enable low latency for HLS
Expand Down Expand Up @@ -211,12 +227,14 @@ The segmenter can take a list of instructions, or Cues, to use for the segmentat

Cue files can be specified for the entire segmenter, or per PID using `DashCue` property.
Cues are given in an XML file with a root element called &lt;DASHCues&gt;, with currently no attribute specified. The children are one or more &lt;Stream&gt; elements, with attributes:

* id: integer for stream/track/PID ID
* timescale: integer giving the units of following timestamps
* mode: if present and value is `edit`, the timestamp are in presentation time (edit list applied) otherwise they are in media time
* ts_offset: integer giving a value (in timescale) to subtract to the DTS/CTS values listed

The children of &lt;Stream&gt; are one or more &lt;Cue&gt; elements, with attributes:

* sample: integer giving the sample/frame number of a sample at which splitting shall happen
* dts: long integer giving the decoding time stamp of a sample at which splitting shall happen
* cts: long integer giving the composition / presentation time stamp of a sample at which splitting shall happen
Expand All @@ -238,6 +256,7 @@ The segmenter can be used to generate manifests from already fragmented ISOBMFF
In this case, segment boundaries are attached to each packet starting a segment and used to drive the segmentation.
This can be used with single-track ISOBMFF sources, either single file or multi file.
For single file source:

- if onDemand [profile](#profile) is requested, sources have to be formatted as a DASH self-initializing media segment with the proper sidx.
- templates are disabled.
- [sseg](#sseg) is forced for all profiles except onDemand ones.
Expand Down
3 changes: 3 additions & 0 deletions docs/Filters/nvdec.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ This filter may be automatically loaded during graph resolution.
This filter decodes MPEG-2, MPEG-4 Part 2, AVC|H264 and HEVC streams through NVidia decoder. It allows GPU frame dispatch or direct frame copy.
If the SDK is not available, the configuration key `nvdec@disabled` will be written in configuration file to avoid future load attempts.

The absolute path to cuda lib can be set using the `cuda_lib` option in `core` or `temp` section of the config file, e.g. `-cfg=temp:cuda_lib=PATH_TO_CUDA`.
The absolute path to cuvid lib can be set using the `cuvid_lib` option in `core` or `temp` section of the config file, e.g. `-cfg=temp:cuvid_lib=PATH_TO_CUDA`.


# Options

Expand Down
2 changes: 1 addition & 1 deletion docs/xmlformats/Common-Encryption.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ The following example shows a simple GPAC DRM system info:
* `selectiveType` : specifies how selective encryption is to be used. The possible values are:
* **None** : no selective encryption, all samples encrypted (this is the default behavior).
* **Clear**: samples are not encrypted but track is signaled as using encryption and sample group seig is used.
* **ForceClear[=N]**: samples are not encrypted, track is signaled as using encryption but no sample groups are used. If `N` is set, only leaves the first N samples in the clear and switch to regular encryption after.
* ForceClear[=N]**: samples are not encrypted, track is signaled as using encryption but no sample groups are used. If `N` is set, only leaves the first N samples in the clear and switch to regular encryption after. If N is 0, all samples are encrypted. If N is -1, no samples are encrypted.
* **RAP** : only Random Access Samples (key frames) will be encrypted. If all media samples are RAPs, this defaults to `None`.
* **Non-RAP** : only non-Random Access Samples (non-key frames) will be encrypted. If all media samples are RAPs, this defaults to `None`.
* **Rand** : random selection of samples to encrypt is performed.
Expand Down

0 comments on commit a5377f8

Please sign in to comment.