get_shaka_documentation
Access Shaka Packager documentation to understand command structure and examples for video packaging tasks.
Instructions
Get comprehensive Shaka Packager documentation, including command structure and examples.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- shaka_packager_mcp.py:672-766 (handler)The main handler function for the 'get_shaka_documentation' tool. It is decorated with @mcp.tool() which also serves as registration. The function returns a hardcoded comprehensive documentation string for Shaka Packager usage, examples, and common options.@mcp.tool() async def get_shaka_documentation(ctx: Context) -> str: """ Get comprehensive Shaka Packager documentation, including command structure and examples. """ # Documentation based on https://shaka-project.github.io/shaka-packager/html/index.html documentation = """ # Shaka Packager Documentation Shaka Packager is a media packaging SDK that supports packaging of MP4 and WebM files into fragmented MP4, MPEG-DASH, and HLS formats. ## Basic Command Structure The basic command structure for Shaka Packager is: ``` packager [options] [stream_descriptors] ``` ## Stream Descriptors Stream descriptors define the input and output streams. The basic format is: ``` in=INPUT,stream=STREAM_TYPE[,STREAM_OPTIONS][,out=OUTPUT] ``` - `in=INPUT`: Specifies the input file path - `stream=STREAM_TYPE`: Specifies the stream type (audio, video, text) - `out=OUTPUT`: Specifies the output file path (optional) Multiple streams are separated by spaces. ## Important: Input Format The input must ALWAYS be specified as `input=PATH` (for single files) or through stream descriptors as `in=PATH`. Never leave a space between `input=` and the file path or between `in=` and the file path. ## Common Examples 1. **Dump stream info (analyze video):** ``` packager --dump_stream_info input=/path/to/video.mp4 ``` 2. **Package MP4 to HLS and DASH:** ``` packager \ in=/path/to/video.mp4,stream=audio,out=audio.mp4 \ in=/path/to/video.mp4,stream=video,out=video.mp4 \ --mpd_output=manifest.mpd \ --hls_master_playlist_output=master.m3u8 ``` 3. **Package MP4 to fragmented MP4:** ``` packager \ in=/path/to/video.mp4,stream=audio,out=audio.mp4 \ in=/path/to/video.mp4,stream=video,out=video.mp4 ``` 4. **Package with encryption:** ``` packager \ in=/path/to/video.mp4,stream=audio,out=audio.mp4 \ in=/path/to/video.mp4,stream=video,out=video.mp4 \ --enable_widevine_encryption \ --key_server_url=https://license.widevine.com/cenc/getcontentkey/widevine_test \ --content_id=16b8649bd2783c56 \ --signer=widevine_test ``` ## Most Common Options - `--dump_stream_info`: Analyze the input file - `--mpd_output=FILE`: Output DASH manifest file - `--hls_master_playlist_output=FILE`: Output HLS master playlist file - `--segment_duration=SECONDS`: Set the segment duration (default: 6) - `--protection_scheme=SCHEME`: Set the protection scheme (cenc, cens, cbc1, cbcs) - `--enable_widevine_encryption`: Enable Widevine encryption - `--enable_fixed_key_encryption`: Enable fixed key encryption - `--keys=KEY_INFO`: Specify key information for fixed key encryption ## Common Pitfalls 1. Always use `input=PATH` with no space between `input=` and the path 2. Always use `in=PATH` with no space between `in=` and the path 3. Make sure all file paths are accessible to the packager 4. For multiple streams, each stream descriptor must be properly quoted or separated This documentation is a simplified version of the full Shaka Packager documentation at: https://shaka-project.github.io/shaka-packager/html/index.html """ return documentation