### Install Apache Module Example Source: https://docs.unified-streaming.com/_downloads/00a7b6e82573d22faec35c2b78959bbd/install-usp.ps1 Example command to install the Apache module for Smooth Streaming to a specific directory. ```powershell install-usp.ps1 \ -baseurl https://stable.zip.unified-streaming.com/windows/x86_64 \ -version 1.10.18 \ apache_mod_smooth_streaming \ -targetdir C:\Apache24\modules ``` -------------------------------- ### Install mp4split with PATH Update Example Source: https://docs.unified-streaming.com/_downloads/00a7b6e82573d22faec35c2b78959bbd/install-usp.ps1 Example command to install mp4split and add the installation directory to the user PATH. ```powershell install-usp.ps1 \ -baseurl https://stable.zip.unified-streaming.com/windows/x86_64 \ -version 1.10.18 \ mp4split \ -targetdir "C:\Program Files\Unified Streaming" \ -addtopath ``` -------------------------------- ### Enable and start x264 encoding service on RHEL-based systems Source: https://docs.unified-streaming.com/documentation/media-processing/x264_encoding_service.html Configure the service to start on boot and start it immediately. ```bash sudo systemctl enable x264_encoding_service ``` ```bash sudo systemctl start x264_encoding_service ``` -------------------------------- ### Install x264 encoding service on Debian and Ubuntu Source: https://docs.unified-streaming.com/documentation/media-processing/x264_encoding_service.html Install the package using apt. ```bash sudo apt install x264-encoding-service ``` -------------------------------- ### Example transcoders file selecting ffmpeg and x264 plugins Source: https://docs.unified-streaming.com/documentation/media-processing/transcoders_file.html This example transcoders file specifies which plugins to use for video transcoding. It selects the avcodec and x264 implementations, and includes comments and attribute configuration. It can be used as-is for any supported use case and is a good starting point if you are not using the Intel Media SDK or are migrating away from it. ```text # Example transcoders file selecting the ffmpeg- and x264-based # plugins for video transcoding. The Intel Media SDK is not required # nor used. # Comments, that is, everything from a '#' to the end of the line it # appears on, are skipped. # Please note that the x264 AVC video encoding plugin (new in version # 1.15.0) relies on a running instance of the x264_encoding_service. # Transcoder type Implementation Attributes (as of version 1.14.3) video_decoder_avc avcodec # video_decoder_hvc avcodec # video_filter_resize swscale # video_encoder_avc x264 # service_host=::1 service_port=11264 video_encoder_jpg avcodec # quality=30 ``` -------------------------------- ### Start the system Source: https://docs.unified-streaming.com/documentation/virtual-channel/faq/index.html Start the Virtual Channel system after the data has been restored. ```bash # Start Virtual Channel docker compose up -d ``` -------------------------------- ### Install Intel Media SDK runtime and prerequisites via apt-get Source: https://docs.unified-streaming.com/documentation/media-processing/media-sdk.html Use this shell script to install the Intel Media SDK runtime library (`libmfx1`), the full-featured `intel-media-va-driver-non-free` driver for VA-API, the `libva-drm2` DRM runtime library for headless environments, and the `vainfo` utility for verification. Requires Ubuntu 22.04 LTS or 24.04 LTS with an Intel GPU; virtualization and containerization are not supported. ```bash #!/bin/bash sudo apt-get -q -y update sudo apt-get -q -y install intel-media-va-driver-non-free libmfx1 libva-drm2 vainfo ``` -------------------------------- ### Start Live streaming demo with docker-compose up Source: https://docs.unified-streaming.com/installation/evaluation.html Starts the Live streaming demo containers in the directory of the Compose file. The first run builds the FFmpeg container locally, which takes about ten minutes. ```bash docker-compose up -d ``` -------------------------------- ### Start Nginx Service Source: https://docs.unified-streaming.com/best-practice/caching/recommendations/configuration/decrease-upstream-traffic.html Command to start the Nginx service, assuming it is installed in /usr/local/sbin. ```bash #!/bin/bash sudo /usr/local/sbin/nginx ``` -------------------------------- ### Install mp4split packages on Ubuntu and Debian using apt-get Source: https://docs.unified-streaming.com/documentation/media-processing/tiled_thumbnails_ffmpeg.html Installs the FFmpeg plugins for libfmp4 on Debian-derived systems after repository setup. Relies on apt-get to update and install the required packages. ```bash #!/bin/bash apt-get update apt-get install mp4split mp4split-ffmpeg-plugins ``` -------------------------------- ### Create a channel with curl PUT Source: https://docs.unified-streaming.com/documentation/virtual-channel/gettingstarted/index.html Creates a channel named getting_started by sending a playlist (examples/vod2live_promo.smil) to the API. The response contains a task_id and status_url to track the creation job. ```bash curl -X PUT -H 'content-type: application/xml' \ -d @examples/vod2live_promo.smil \ http://localhost:8000/channels/getting_started ``` -------------------------------- ### Ubuntu: install build dependencies for Nginx module Source: https://docs.unified-streaming.com/installation/origin/nginx.html Ubuntu build environment setup. The 'devel' package is not needed because headers are installed by default on Debian/Ubuntu. After this, unpack the tarball and run make/make install as outlined in the Rocky Linux section. ```bash #!/bin/bash sudo apt-get install build-essential \ g++ \ make \ autoconf \ automake \ libtool ``` -------------------------------- ### Manifest timeline segment from start time Source: https://docs.unified-streaming.com/documentation/vod/playout-control.html Example of a timeline segment indicating duration until the end. ```xml ``` -------------------------------- ### Create and start an Ubuntu LXC instance Source: https://docs.unified-streaming.com/documentation/vod/cloud/lxc.html Initializes a new LXC container using the Ubuntu trusty distribution and starts it in daemon mode. ```bash #!/bin/bash name=test-$(date +%s) sudo lxc-create -t download -n $name -- -d ubuntu -r trusty -a amd64 sudo lxc-start -n $name -d ``` -------------------------------- ### Create a 15-second preview subclip using t parameter Source: https://docs.unified-streaming.com/documentation/capture/capture.html Creates a subclip from a VOD presentation by specifying start and end times in HH:MM:SS.sss format. The example captures a 15-second preview starting at 3 minutes. ```bash #!/bin/bash unified_capture -o video-preview.ismv \ "http://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel.ism/.mpd?t=00:03:00.000-00:03:15.000" ``` -------------------------------- ### Typical upgrade workflow: development to staging to production Source: https://docs.unified-streaming.com/installation/upgrade.html Shows the recommended sequence of environments for testing an upgrade: development, then staging, then production. The staging environment should closely mimic production and be able to access the same assets and services. ```text development --> staging --> production ``` -------------------------------- ### Replace hostname in features.json Source: https://docs.unified-streaming.com/documentation/vod/cloud/google/instances.html Replaces the default hostname in the features.json file with the instance's hostname. Run this when the instance starts, for example as a conf file in /etc/init. ```bash #!/bin/bash hn=$(curl http://metadata.google.internal/computeMetadata/v1/instance/hostname -H "Metadata-Flavor: Google") /bin/sed -i -e "s/features.unified-streaming.com/$hn/g" /var/www/tears-of-steel/features.json ``` -------------------------------- ### SMIL with SCTE-35 Program Transition Events Source: https://docs.unified-streaming.com/documentation/remix/avod/smil.html Shows an SMIL document with SCTE-35 events for a program transition, including Program End (type 17), Program Start (type 16), and Chapter Start (type 32) segmentation descriptors. The example is from section 5.4 of the ETDS specification and uses the tears-of-steel-avc1-750k.mp4 asset. ```xml ``` -------------------------------- ### Create and configure a Live server manifest Source: https://docs.unified-streaming.com/tutorials/live/index.html Generates a channel1.isml manifest with default settings, moves it to the web directory, and sets the appropriate ownership for the Apache server. ```bash #/bin/bash mp4split -o channel1.isml \ --archiving=true \ --archive_length=1200 \ --archive_segment_length=300 \ --dvr_window_length=600 \ --restart_on_encoder_reconnect \ --hls.client_manifest_version=4 \ --hls.no_multiplex \ --fixed_gop=48/25 sudo mkdir -p /var/www/channel1 sudo mv channel1.isml /var/www/channel1/ sudo chown -R www-data:www-data /var/www/channel1/ ``` -------------------------------- ### Install sample content Source: https://docs.unified-streaming.com/documentation/vod/cloud/lxc.html Downloads and executes the installation script for the Tears of Steel sample content. ```bash sudo lxc-attach -n $name -- wget http://repo.unified-streaming.com/install-tears-of-steel.sh sudo lxc-attach -n $name -- chmod +x install-tears-of-steel.sh sudo lxc-attach -n $name -- ./install-tears-of-steel.sh -y sudo lxc-attach -n $name -- rm install-tears-of-steel.sh ``` -------------------------------- ### Rocky Linux: build environment, install dependencies, download and build Nginx module Source: https://docs.unified-streaming.com/installation/origin/nginx.html Rocky Linux build environment setup, installation of libfmp4 and headers, downloading Nginx and the module, and building/installing the module. The Makefile's NGINX_VERSION line must be set to the downloaded Nginx version, or passed via make NGINX_VERSION=THEVERSION. ```bash #!/bin/bash yum groupinstall "Development Tools" yum install \ zlib-devel \ glib2-devel \ bzip2-devel ``` ```bash #!/bin/bash yum install mp4split yum install mp4split-devel ``` ```bash #!/bin/bash nginx_version=THEVERSION usp_version=THEVERSION cd ~ curl https://nginx.org/download/nginx-$nginx_version.tar.gz -O curl https://stable.yum.unified-streaming.com/rocky/9/x86_64/nginx_mod_smooth_streaming-$usp_version.tar.gz -O tar -zxvf nginx_mod_smooth_streaming-$usp_version.tar.gz ``` ```bash #!/bin/bash usp_version=THEVERSION cd ~/nginx_mod_smooth_streaming-$usp_version make sudo make install ``` -------------------------------- ### Generate .isml example with mp4split Source: https://docs.unified-streaming.com/documentation/virtual-channel/userguide/index.html Use this command to generate an example .isml file to check the formatting of Origin output configuration options. ```bash mp4split -o stdout:.isml --hls.client_manifest_version=5 ``` -------------------------------- ### Shaka Player: Ignoring large gap console message Source: https://docs.unified-streaming.com/documentation/vod/player-urls.html Example console message logged by Shaka Player when a gap is present at the start of a clip. To solve the issue, set the configuration for 'jumpLargeGaps' to 'true'. ```text gap_jumping_controller.js:226 Ignoring large gap at 0 size 1.907336 ``` -------------------------------- ### Enable JIT Packaging for VOD and Live Source: https://docs.unified-streaming.com/installation/origin/apache.html Enables just-in-time packaging for .ism and .isml files using the UspHandleIsm directive. ```apache UspHandleIsm on ``` -------------------------------- ### Unified Capture with --frame_accurate Source: https://docs.unified-streaming.com/documentation/media-processing/media-sdk.html Command-line example for producing frame-accurate clips using Unified Capture after installing Intel Media SDK and Unified Capture. Requires the --frame_accurate parameter and t= parameter for begin/end times. ```bash #!/bin/bash unified_capture -v 3 \ -o clip1.ismv \ --frame_accurate \ "https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel.ism/Manifest?t=00:00:00.000-00:04:00.000" ``` -------------------------------- ### CPIX ContentKeyPeriodList for key rotation Source: https://docs.unified-streaming.com/documentation/drm/key-rotation.html Defines two content key periods in a CPIX document, each with a start and end time. Used for key rotation to specify the validity time span of each content key. The example shows the required structure for a key rotation use case. ```xml ``` -------------------------------- ### Install Unified Streaming software Source: https://docs.unified-streaming.com/documentation/vod/cloud/lxc.html Downloads and executes the installation script for Apache and Unified Streaming inside the container. ```bash sudo lxc-attach -n $name -- wget http://repo.unified-streaming.com/install-apache-usp.sh sudo lxc-attach -n $name -- chmod +x install-apache-usp.sh sudo lxc-attach -n $name -- ./install-apache-usp.sh -y sudo lxc-attach -n $name -- rm install-apache-usp.sh ``` -------------------------------- ### Live PlayReady server manifest with mp4split Source: https://docs.unified-streaming.com/documentation/drm/hss.html Creates a Live server manifest file with PlayReady key information embedded. Uses the same key variables and license URL as the VOD example, but outputs a .isml file instead of .ism. Note the different extension for the Live server manifest. ```bash #!/bin/bash KID=10000000100010001000100000000001 CEK=3a2a1b68dd2bd9b2eeb25e84c4776668 KID_UUID=10000000-1000-1000-1000-100000000001 #UUID representation of KID CEK_B64="OiobaN0r2bLusl6ExHdmaA==" #Base64 byte array representation of CEK LAURL="https://test.playready.microsoft.com/service/rightsmanager.asmx?cfg=(kid:${KID_UUID},contentkey:${CEK_B64},ckt:aesctr)" mp4split -o channel1.isml \ --iss.key=$KID:$CEK --iss.license_server_url=$LAURL ```