├── docker ├── origin │ ├── html │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── crossdomain.xml │ │ └── clientaccesspolicy.xml │ ├── ffmpeg-transcoders.usp │ ├── entrypoint.sh │ ├── Dockerfile │ └── conf.d │ │ ├── unified-origin.conf │ │ └── mpm.conf └── origin-ubuntu │ ├── html │ ├── favicon.ico │ ├── index.html │ ├── crossdomain.xml │ └── clientaccesspolicy.xml │ ├── ffmpeg-transcoders.usp │ ├── conf │ ├── ports.conf │ ├── sites-enabled │ │ └── unified-origin.conf │ └── apache2.conf │ ├── Dockerfile │ └── entrypoint.sh ├── unifiedstreaming-logo-black.png ├── my_use_case.yaml └── README.md /docker/origin/html/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unifiedstreaming/origin/HEAD/docker/origin/html/favicon.ico -------------------------------------------------------------------------------- /unifiedstreaming-logo-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unifiedstreaming/origin/HEAD/unifiedstreaming-logo-black.png -------------------------------------------------------------------------------- /docker/origin-ubuntu/html/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unifiedstreaming/origin/HEAD/docker/origin-ubuntu/html/favicon.ico -------------------------------------------------------------------------------- /docker/origin/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Unified Origin is installed.

4 |

For more information see the documentation

5 | -------------------------------------------------------------------------------- /docker/origin-ubuntu/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Unified Origin is installed.

4 |

For more information see the documentation

5 | -------------------------------------------------------------------------------- /docker/origin/ffmpeg-transcoders.usp: -------------------------------------------------------------------------------- 1 | # Override default transcoders with FFmpeg-based ones. 2 | 3 | video_decoder_avc avcodec 4 | video_decoder_hvc avcodec 5 | video_filter_resize swscale 6 | video_encoder_jpg avcodec -------------------------------------------------------------------------------- /docker/origin-ubuntu/ffmpeg-transcoders.usp: -------------------------------------------------------------------------------- 1 | # Override default transcoders with FFmpeg-based ones. 2 | 3 | video_decoder_avc avcodec 4 | video_decoder_hvc avcodec 5 | video_filter_resize swscale 6 | video_encoder_jpg avcodec -------------------------------------------------------------------------------- /docker/origin/html/crossdomain.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /docker/origin-ubuntu/html/crossdomain.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /docker/origin-ubuntu/conf/ports.conf: -------------------------------------------------------------------------------- 1 | # If you just change the port or add more ports here, you will likely also 2 | # have to change the VirtualHost statement in 3 | # /etc/apache2/sites-enabled/000-default.conf 4 | 5 | Listen 80 6 | 7 | 8 | Listen 443 9 | 10 | 11 | 12 | Listen 443 13 | 14 | 15 | # vim: syntax=apache ts=4 sw=4 sts=4 sr noet 16 | -------------------------------------------------------------------------------- /my_use_case.yaml: -------------------------------------------------------------------------------- 1 | mpd: 2 | - manifest_edit.plugins.mpd.descriptor_add: 3 | periods: 4 | - '*' : '.*' 5 | adaptationSets: 6 | - contentType: "video" 7 | representations: 8 | - '*' : '.*' 9 | plugin_config: 10 | name: 'SupplementalProperty' 11 | schemeIdUri: "MyCustomName" 12 | value: "MyCustomValue" -------------------------------------------------------------------------------- /docker/origin/html/clientaccesspolicy.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /docker/origin-ubuntu/html/clientaccesspolicy.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /docker/origin-ubuntu/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG UBUNTUVERSION=jammy 2 | FROM ubuntu:$UBUNTUVERSION 3 | 4 | ARG ARCH=amd64 5 | ARG DIST=jammy 6 | ARG REPO=https://beta.apt.unified-streaming.com/ 7 | ARG VERSION=1.15.13 8 | 9 | RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ 10 | && apt-get install -y wget gnupg curl 11 | # Setup USP repositories 12 | RUN wget https://stable.apt.unified-streaming.com/unifiedstreaming.pub \ 13 | && apt-key add unifiedstreaming.pub \ 14 | && echo "deb [arch=$ARCH] $REPO $DIST multiverse" > /etc/apt/sources.list.d/usp.list 15 | 16 | # install origin 17 | RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ 18 | && apt-get -y install apache2 \ 19 | && if [ -z "$VERSION" ]; then \ 20 | apt-get -y install libapache2-mod-smooth-streaming; \ 21 | else \ 22 | apt-get -y install \ 23 | libapache2-mod-smooth-streaming=$VERSION\* \ 24 | libapache2-mod-unified-s3-auth=$VERSION\* \ 25 | mp4split=$VERSION\* \ 26 | manifest-edit=$VERSION\*; \ 27 | fi 28 | 29 | # config stuffs 30 | RUN a2dismod mpm_prefork mpm_event \ 31 | && a2enmod mpm_worker mod_smooth_streaming \ 32 | && a2dissite 000-default 33 | 34 | # Copy webpage 35 | COPY html /var/www/unified-origin/ 36 | 37 | # entrypoint 38 | COPY entrypoint.sh /usr/local/bin/entrypoint.sh 39 | RUN chmod +x /usr/local/bin/entrypoint.sh 40 | 41 | # apache conf 42 | COPY conf /etc/apache2 43 | 44 | EXPOSE 80 45 | 46 | ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] 47 | 48 | CMD ["-D", "FOREGROUND"] -------------------------------------------------------------------------------- /docker/origin-ubuntu/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | # Validate license key variable is set 5 | if [ -z "$UspLicenseKey" ] && [ -z "$USP_LICENSE_KEY" ] 6 | then 7 | echo >&2 "Error: UspLicenseKey environment variable is required but not set." 8 | exit 1 9 | elif [ -z "$UspLicenseKey" ] 10 | then 11 | export UspLicenseKey=$USP_LICENSE_KEY 12 | fi 13 | 14 | # write license key to file 15 | echo "$UspLicenseKey" > /etc/usp-license.key 16 | 17 | # If specified, override default log level and format config 18 | if [ "$LOG_FORMAT" ] 19 | then 20 | export EXTRA_OPTIONS="$EXTRA_OPTIONS -D LOG_FORMAT" 21 | fi 22 | if [ "$LOG_LEVEL" ] 23 | then 24 | export EXTRA_OPTIONS="$EXTRA_OPTIONS -D LOG_LEVEL" 25 | fi 26 | 27 | # Remote storage URL and storage proxy config 28 | if [ "$REMOTE_STORAGE_URL" ] 29 | then 30 | export EXTRA_OPTIONS="$EXTRA_OPTIONS -D REMOTE_STORAGE_URL" 31 | if [ -z "$REMOTE_PATH" ] 32 | then 33 | export REMOTE_PATH=remote 34 | fi 35 | fi 36 | if [ "$S3_ACCESS_KEY" ] 37 | then 38 | export EXTRA_OPTIONS="$EXTRA_OPTIONS -D S3_ACCESS_KEY" 39 | fi 40 | if [ "$S3_SECRET_KEY" ] 41 | then 42 | export EXTRA_OPTIONS="$EXTRA_OPTIONS -D S3_SECRET_KEY" 43 | fi 44 | if [ "$S3_SECURITY_TOKEN" ] 45 | then 46 | export EXTRA_OPTIONS="$EXTRA_OPTIONS -D S3_SECURITY_TOKEN" 47 | fi 48 | if [ "$S3_REGION" ] 49 | then 50 | export EXTRA_OPTIONS="$EXTRA_OPTIONS -D S3_REGION" 51 | fi 52 | 53 | # REST API 54 | if [ "$REST_API_PORT" ] 55 | then 56 | export EXTRA_OPTIONS="$EXTRA_OPTIONS -D REST_API_PORT" 57 | fi 58 | 59 | 60 | # First arg is `-f` or `--some-option` 61 | if [ "${1#-}" != "$1" ]; then 62 | set -- apachectl $EXTRA_OPTIONS "$@" 63 | fi 64 | 65 | exec "$@" 66 | -------------------------------------------------------------------------------- /docker/origin/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | # Validate license key variable is set 5 | if [ -z "$UspLicenseKey" ] && [ -z "$USP_LICENSE_KEY" ] 6 | then 7 | echo >&2 "Error: UspLicenseKey environment variable is required but not set." 8 | exit 1 9 | elif [ -z "$UspLicenseKey" ] 10 | then 11 | export UspLicenseKey=$USP_LICENSE_KEY 12 | fi 13 | 14 | # write license key to file 15 | echo "$UspLicenseKey" > /etc/usp-license.key 16 | 17 | # If specified, override default log level and format config 18 | if [ "$LOG_FORMAT" ] 19 | then 20 | export EXTRA_OPTIONS="$EXTRA_OPTIONS -D LOG_FORMAT" 21 | fi 22 | if [ "$LOG_LEVEL" ] 23 | then 24 | export EXTRA_OPTIONS="$EXTRA_OPTIONS -D LOG_LEVEL" 25 | fi 26 | 27 | # Remote storage URL and storage proxy config 28 | if [ "$REMOTE_STORAGE_URL" ] 29 | then 30 | export EXTRA_OPTIONS="$EXTRA_OPTIONS -D REMOTE_STORAGE_URL" 31 | if [ -z "$REMOTE_PATH" ] 32 | then 33 | export REMOTE_PATH=remote 34 | fi 35 | fi 36 | if [ "$S3_ACCESS_KEY" ] 37 | then 38 | export EXTRA_OPTIONS="$EXTRA_OPTIONS -D S3_ACCESS_KEY" 39 | fi 40 | if [ "$S3_SECRET_KEY" ] 41 | then 42 | export EXTRA_OPTIONS="$EXTRA_OPTIONS -D S3_SECRET_KEY" 43 | fi 44 | if [ "$S3_SECURITY_TOKEN" ] 45 | then 46 | export EXTRA_OPTIONS="$EXTRA_OPTIONS -D S3_SECURITY_TOKEN" 47 | fi 48 | if [ "$S3_REGION" ] 49 | then 50 | export EXTRA_OPTIONS="$EXTRA_OPTIONS -D S3_REGION" 51 | fi 52 | 53 | # REST API 54 | if [ "$REST_API_PORT" ] 55 | then 56 | export EXTRA_OPTIONS="$EXTRA_OPTIONS -D REST_API_PORT" 57 | fi 58 | 59 | # Change 'Listen 80' to 'Listen 0.0.0.0:80' to avoid some strange issues when IPv6 is available 60 | /bin/sed -i "s@Listen 80@Listen 0.0.0.0:80@g" /etc/apache2/httpd.conf 61 | 62 | rm -f /run/apache2/httpd.pid 63 | 64 | # First arg is `-f` or `--some-option` 65 | if [ "${1#-}" != "$1" ]; then 66 | set -- httpd $EXTRA_OPTIONS "$@" 67 | fi 68 | 69 | exec "$@" 70 | -------------------------------------------------------------------------------- /docker/origin/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ALPINEVERSION=3.19 2 | 3 | FROM alpine:$ALPINEVERSION 4 | 5 | # ARGs declared before FROM are in a different scope, so need to be stated again 6 | # https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact 7 | ARG ALPINEVERSION 8 | ARG REPO=https://beta.apk.unified-streaming.com/alpine/ 9 | ARG VERSION=1.15.13 10 | 11 | # Get USP public key 12 | RUN wget -q -O /etc/apk/keys/alpine@unified-streaming.com.rsa.pub \ 13 | https://stable.apk.unified-streaming.com/alpine@unified-streaming.com.rsa.pub 14 | 15 | # Install Origin 16 | RUN apk \ 17 | --update \ 18 | --repository $REPO/v$ALPINEVERSION \ 19 | add \ 20 | mp4split~$VERSION \ 21 | mp4split-ffmpeg-plugins~$VERSION \ 22 | mod_smooth_streaming~$VERSION \ 23 | mod_unified_s3_auth~$VERSION \ 24 | manifest-edit~$VERSION \ 25 | && rm -f /var/cache/apk/* 26 | 27 | # Set up directories and log file redirection 28 | RUN mkdir -p /run/apache2 \ 29 | && ln -s /dev/stderr /var/log/apache2/error.log \ 30 | && ln -s /dev/stdout /var/log/apache2/access.log \ 31 | && mkdir -p /var/www/unified-origin \ 32 | && rm -f /etc/apache2/conf.d/default.conf \ 33 | /etc/apache2/conf.d/info.conf \ 34 | /etc/apache2/conf.d/languages.conf \ 35 | /etc/apache2/conf.d/mpm.conf \ 36 | /etc/apache2/conf.d/proxy.conf \ 37 | /etc/apache2/conf.d/ssl.conf \ 38 | /etc/apache2/conf.d/userdir.conf 39 | 40 | # Enable default Manifest Edit pipelines 41 | RUN mkdir -p /etc/manifest-edit \ 42 | && cp -R /usr/share/manifest-edit/* /etc/manifest-edit/ 43 | 44 | # Swap MPM from prefork to worker 45 | RUN sed -i "s|LoadModule mpm_prefork_module modules/mod_mpm_prefork.so|#LoadModule mpm_prefork_module modules/mod_mpm_prefork.so|g; s|#LoadModule mpm_worker_module modules/mod_mpm_worker.so|LoadModule mpm_worker_module modules/mod_mpm_worker.so|g" /etc/apache2/httpd.conf 46 | 47 | # Copy apache config and entrypoint script 48 | COPY conf.d /etc/apache2/conf.d 49 | COPY entrypoint.sh /usr/local/bin/entrypoint.sh 50 | 51 | RUN chmod +x /usr/local/bin/entrypoint.sh 52 | 53 | # Copy webpage 54 | COPY html /var/www/unified-origin/ 55 | 56 | # Copy Transcoder Config for ffmpeg-usp 57 | COPY ffmpeg-transcoders.usp /etc/ffmpeg-transcoders.usp 58 | 59 | # set Apache as owner of /var/www/unified-origin so it can write from API 60 | RUN chown apache:apache /var/www/unified-origin 61 | 62 | EXPOSE 80 63 | 64 | ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] 65 | 66 | CMD ["-D", "FOREGROUND"] 67 | -------------------------------------------------------------------------------- /docker/origin-ubuntu/conf/sites-enabled/unified-origin.conf: -------------------------------------------------------------------------------- 1 | AddHandler smooth-streaming.extensions .ism .isml 2 | 3 | ServerName unified-origin 4 | 5 | UspLicenseKey /etc/usp-license.key 6 | 7 | 8 | LogFormat '${LOG_FORMAT}' log_format 9 | 10 | 11 | LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\" %D" log_format 12 | 13 | 14 | 15 | # Don't log kubernetes probes 16 | SetEnvIf User-Agent "kube-probe" dontlog 17 | CustomLog /dev/stdout log_format env=!dontlog 18 | ErrorLog /dev/stderr 19 | 20 | 21 | LogLevel ${LOG_LEVEL} 22 | 23 | 24 | LogLevel warn 25 | 26 | 27 | SSLProxyEngine on 28 | 29 | DocumentRoot /var/www/unified-origin 30 | 31 | Header set Access-Control-Allow-Headers "origin, range" 32 | Header set Access-Control-Allow-Methods "GET, HEAD, OPTIONS" 33 | Header set Access-Control-Allow-Origin "*" 34 | Header set Access-Control-Expose-Headers "Server,range" 35 | 36 | # Enable Origin and use subrequests instead of libcurl 37 | 38 | UspHandleIsm on 39 | UspEnableSubreq on 40 | 41 | 42 | # Remote storage configuration 43 | 44 | 45 | IsmProxyPass "${REMOTE_STORAGE_URL}" 46 | 47 | 48 | 49 | ProxySet connectiontimeout=5 enablereuse=on keepalive=on retry=0 timeout=30 ttl=300 50 | RequestHeader unset Accept-Encoding 51 | RequestHeader unset x-amz-cf-id 52 | S3UseHeaders on 53 | 54 | S3AccessKey ${S3_ACCESS_KEY} 55 | 56 | 57 | S3SecretKey ${S3_SECRET_KEY} 58 | 59 | 60 | S3SecurityToken ${S3_SECURITY_TOKEN} 61 | 62 | 63 | S3Region ${S3_REGION} 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | Require all granted 72 | Options -Indexes 73 | 74 | 75 | # Optional REST API for publishing point management 76 | 77 | Listen 0.0.0.0:${REST_API_PORT} 78 | 79 | CustomLog /dev/stdout log_format 80 | ErrorLog /dev/stderr 81 | 82 | 83 | LogLevel ${LOG_LEVEL} 84 | 85 | 86 | LogLevel warn 87 | 88 | 89 | DocumentRoot /var/www/unified-origin 90 | 91 | # Enable REST API 92 | 93 | UspHandleApi on 94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /docker/origin/conf.d/unified-origin.conf: -------------------------------------------------------------------------------- 1 | # Load required modules, if needed 2 | 3 | LoadModule headers_module /usr/lib/apache2/mod_headers.so 4 | 5 | 6 | LoadModule proxy_module /usr/lib/apache2/mod_proxy.so 7 | 8 | 9 | LoadModule proxy_http_module /usr/lib/apache2/mod_proxy_http.so 10 | 11 | 12 | LoadModule socache_shmcb_module /usr/lib/apache2/mod_socache_shmcb.so 13 | 14 | 15 | LoadModule ssl_module /usr/lib/apache2/mod_ssl.so 16 | 17 | 18 | LoadModule ext_filter_module /usr/lib/apache2/mod_ext_filter.so 19 | 20 | 21 | LoadModule unified_s3_auth_module /usr/lib/apache2/mod_unified_s3_auth.so 22 | 23 | 24 | LoadModule smooth_streaming_module /usr/lib/apache2/mod_smooth_streaming.so 25 | 26 | 27 | AddHandler smooth-streaming.extensions .ism .isml 28 | 29 | ServerName unified-origin 30 | 31 | UspLicenseKey /etc/usp-license.key 32 | 33 | 34 | LogFormat '${LOG_FORMAT}' log_format 35 | 36 | 37 | LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\" %D" log_format 38 | 39 | 40 | # Don't timeout to support long running POST from live encoder 41 | LimitRequestBody 0 42 | 43 | RequestReadTimeout header=0 body=0 44 | 45 | 46 | 47 | # Don't log kubernetes probes 48 | SetEnvIf User-Agent "kube-probe" dontlog 49 | CustomLog /dev/stdout log_format env=!dontlog 50 | ErrorLog /dev/stderr 51 | 52 | 53 | LogLevel ${LOG_LEVEL} 54 | 55 | 56 | LogLevel warn 57 | 58 | 59 | SSLProxyEngine on 60 | 61 | DocumentRoot /var/www/unified-origin 62 | 63 | Header set Access-Control-Allow-Headers "origin, range" 64 | Header set Access-Control-Allow-Methods "GET, HEAD, OPTIONS" 65 | Header set Access-Control-Allow-Origin "*" 66 | Header set Access-Control-Expose-Headers "Server,range" 67 | 68 | # Enable Origin and use subrequests instead of libcurl 69 | 70 | UspHandleIsm on 71 | UspEnableSubreq on 72 | 73 | 74 | # Remote storage configuration 75 | 76 | 77 | IsmProxyPass "${REMOTE_STORAGE_URL}" 78 | 79 | 80 | 81 | ProxySet connectiontimeout=5 enablereuse=on keepalive=on retry=0 timeout=30 ttl=300 82 | RequestHeader unset Accept-Encoding 83 | RequestHeader unset x-amz-cf-id 84 | S3UseHeaders on 85 | 86 | S3AccessKey ${S3_ACCESS_KEY} 87 | 88 | 89 | S3SecretKey ${S3_SECRET_KEY} 90 | 91 | 92 | S3SecurityToken ${S3_SECURITY_TOKEN} 93 | 94 | 95 | S3Region ${S3_REGION} 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | Require all granted 104 | Options -Indexes 105 | 106 | 107 | # Optional REST API for publishing point management 108 | 109 | Listen 0.0.0.0:${REST_API_PORT} 110 | 111 | CustomLog /dev/stdout log_format 112 | ErrorLog /dev/stderr 113 | 114 | 115 | LogLevel ${LOG_LEVEL} 116 | 117 | 118 | LogLevel warn 119 | 120 | 121 | DocumentRoot /var/www/unified-origin 122 | 123 | # Enable REST API 124 | 125 | UspHandleApi on 126 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /docker/origin/conf.d/mpm.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Server-Pool Management (MPM specific) 3 | # 4 | 5 | # 6 | # PidFile: The file in which the server should record its process 7 | # identification number when it starts. 8 | # 9 | # Note that this is the default PidFile for most MPMs. 10 | # 11 | 12 | PidFile "/run/apache2/httpd.pid" 13 | 14 | 15 | # 16 | # Only one of the below sections will be relevant on your 17 | # installed httpd. Use "apachectl -l" to find out the 18 | # active mpm. 19 | # 20 | 21 | # prefork MPM 22 | # StartServers: number of server processes to start 23 | # MinSpareServers: minimum number of server processes which are kept spare 24 | # MaxSpareServers: maximum number of server processes which are kept spare 25 | # MaxRequestWorkers: maximum number of server processes allowed to start 26 | # MaxConnectionsPerChild: maximum number of connections a server process serves 27 | # before terminating 28 | 29 | StartServers 5 30 | MinSpareServers 5 31 | MaxSpareServers 10 32 | MaxRequestWorkers 250 33 | MaxConnectionsPerChild 0 34 | 35 | 36 | # worker MPM 37 | # StartServers: initial number of server processes to start 38 | # MinSpareThreads: minimum number of worker threads which are kept spare 39 | # MaxSpareThreads: maximum number of worker threads which are kept spare 40 | # ThreadsPerChild: constant number of worker threads in each server process 41 | # MaxRequestWorkers: maximum number of worker threads 42 | # MaxConnectionsPerChild: maximum number of connections a server process serves 43 | # before terminating 44 | 45 | StartServers 3 46 | MinSpareThreads 75 47 | MaxSpareThreads 250 48 | ThreadsPerChild 25 49 | MaxRequestWorkers 400 50 | MaxConnectionsPerChild 0 51 | 52 | 53 | # event MPM 54 | # StartServers: initial number of server processes to start 55 | # MinSpareThreads: minimum number of worker threads which are kept spare 56 | # MaxSpareThreads: maximum number of worker threads which are kept spare 57 | # ThreadsPerChild: constant number of worker threads in each server process 58 | # MaxRequestWorkers: maximum number of worker threads 59 | # MaxConnectionsPerChild: maximum number of connections a server process serves 60 | # before terminating 61 | 62 | StartServers 3 63 | MinSpareThreads 75 64 | MaxSpareThreads 250 65 | ThreadsPerChild 25 66 | MaxRequestWorkers 400 67 | MaxConnectionsPerChild 0 68 | 69 | 70 | # NetWare MPM 71 | # ThreadStackSize: Stack size allocated for each worker thread 72 | # StartThreads: Number of worker threads launched at server startup 73 | # MinSpareThreads: Minimum number of idle threads, to handle request spikes 74 | # MaxSpareThreads: Maximum number of idle threads 75 | # MaxThreads: Maximum number of worker threads alive at the same time 76 | # MaxConnectionsPerChild: Maximum number of connections a thread serves. It 77 | # is recommended that the default value of 0 be set 78 | # for this directive on NetWare. This will allow the 79 | # thread to continue to service requests indefinitely. 80 | 81 | ThreadStackSize 65536 82 | StartThreads 250 83 | MinSpareThreads 25 84 | MaxSpareThreads 250 85 | MaxThreads 1000 86 | MaxConnectionsPerChild 0 87 | 88 | 89 | # OS/2 MPM 90 | # StartServers: Number of server processes to maintain 91 | # MinSpareThreads: Minimum number of idle threads per process, 92 | # to handle request spikes 93 | # MaxSpareThreads: Maximum number of idle threads per process 94 | # MaxConnectionsPerChild: Maximum number of connections per server process 95 | 96 | StartServers 2 97 | MinSpareThreads 5 98 | MaxSpareThreads 10 99 | MaxConnectionsPerChild 0 100 | 101 | 102 | # WinNT MPM 103 | # ThreadsPerChild: constant number of worker threads in the server process 104 | # MaxConnectionsPerChild: maximum number of connections a server process serves 105 | 106 | ThreadsPerChild 150 107 | MaxConnectionsPerChild 0 108 | 109 | 110 | # The maximum number of free Kbytes that every allocator is allowed 111 | # to hold without calling free(). In threaded MPMs, every thread has its own 112 | # allocator. When not set, or when set to zero, the threshold will be set to 113 | # unlimited. 114 | 115 | MaxMemFree 2048 116 | 117 | 118 | MaxMemFree 100 119 | 120 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![logo](https://raw.githubusercontent.com/unifiedstreaming/origin/stable/unifiedstreaming-logo-black.png) 2 | 3 | # What is Unified Origin? 4 | 5 | Unified Origin offers one solution for just-in-time packaging to MPEG-DASH, Apple (HLS), Adobe (HDS) and Microsoft (MSS). Our added features include content protection, restart TV, time-shift, catchup-TV, subtitles, and multiple language and audio tracks. 6 | 7 | Further documentation is available at: 8 | 9 | ## Usage 10 | 11 | Note: for running in production we strongly recommend either [building your own 12 | Docker image](https://docs.unified-streaming.com/installation/evaluation.html#creating-your-own-docker-images), 13 | or using this image with additional configuration files in order to set up access control, tune Apache MPM, etc. 14 | 15 | This image is usable out of the box, but must be configured using environment variables. 16 | 17 | Available variables are: 18 | 19 | |Variable |Usage |Mandatory?| 20 | |----------------|--------|----------| 21 | |UspLicenseKey |Your license key. To evaluate the software you can create an account at |Yes| 22 | |REMOTE_STORAGE_URL|Set an IsmProxyPass to this URL at />|No| 23 | |REMOTE_PATH|Set the path to be used for remote storage, defaults to "remote"|No| 24 | |S3_SECRET_KEY|If using S3 remote storage sets the secret key for authentication|No| 25 | |S3_ACCESS_KEY|If using S3 remote storage sets the access key for authentication|No| 26 | |S3_REGION|If using S3 remote storage with v4 authentication set the region|No| 27 | |LOG_LEVEL|Sets the Apache error log level|No| 28 | |LOG_FORMAT|Sets a custom Apache log format|No| 29 | |REST_API_PORT|Enable the REST API for publishing point management on this port|No| 30 | 31 | ### Apache Configuration 32 | Additional Apache configuration files can be used by mounting them as Docker 33 | volumes, for example: 34 | 35 | ```bash 36 | docker run \ 37 | -e UspLicenseKey= \ 38 | -v foo.conf:/etc/apache2/conf.d/foo.conf \ 39 | -p 80:80 \ 40 | unifiedstreaming/origin:latest 41 | ``` 42 | 43 | ## Tutorial 44 | 45 | A full tutorial is available at 46 | 47 | ## Manifest Edit 48 | 49 | > **NOTICE**: older versions of this Docker image (prior to 1.11.13) used a different setup for accessing the default Manifest Edit pipelines, they now need to be referred to including the manifest type in the path. 50 | 51 | This image also contains Manifest Edit functionality with a set of default 52 | use cases as described in our [documentation](https://docs.unified-streaming.com/documentation/manifest-edit/use_cases/index.html). 53 | 54 | You can enable each use case by adding to any `/.mpd` or `/.m3u8` url a query 55 | parameter passing a pipeline name, which will generate an "edited" manifest. 56 | The available pipelines for `/.mpd` urls are: 57 | 58 | - `?python_pipeline_config=mpd/accessibility_add` 59 | - `?python_pipeline_config=mpd/adaptation_sets_order` 60 | - `?python_pipeline_config=mpd/adaptation_sets_removal` 61 | - `?python_pipeline_config=mpd/adaptation_sets_representations_order` 62 | - `?python_pipeline_config=mpd/adaptation_sets_switching` 63 | - `?python_pipeline_config=mpd/audiochannelconfiguration_add` 64 | - `?python_pipeline_config=mpd/essential_property_add` 65 | - `?python_pipeline_config=mpd/essential_property_remove` 66 | - `?python_pipeline_config=mpd/eventstream_value_add` 67 | - `?python_pipeline_config=mpd/hard_of_hearing_add` 68 | - `?python_pipeline_config=mpd/label_add` 69 | - `?python_pipeline_config=mpd/label_remove` 70 | - `?python_pipeline_config=mpd/low_latency` 71 | - `?python_pipeline_config=mpd/low_latency_with_essential_property` 72 | - `?python_pipeline_config=mpd/multiple_isms.yaml` 73 | - `?python_pipeline_config=mpd/representations_order` 74 | - `?python_pipeline_config=mpd/representations_remove` 75 | - `?python_pipeline_config=mpd/role_add` 76 | - `?python_pipeline_config=mpd/supplemental_property_add` 77 | - `?python_pipeline_config=mpd/supplemental_property_remove` 78 | - `?python_pipeline_config=mpd/utc_add` 79 | - `?python_pipeline_config=mpd/utc_change` 80 | - `?python_pipeline_config=mpd/utc_remove` 81 | 82 | The available pipelines for `/.m3u8` urls are: 83 | 84 | - `?python_pipeline_config=m3u8/default_audio_language` 85 | - `?python_pipeline_config=m3u8/default_subs_language` 86 | - `?python_pipeline_config=m3u8/hard_of_hearing` 87 | 88 | These pre-configured use cases are using some defaults that may or may not 89 | apply at all to your content (i.e. a pipeline may be configured to edit a 90 | subtitle track, but the original manifest may not have one)! If, after invoking 91 | a pipeline, you don't see any evident change in the manifest, check the 92 | pipeline configuration, reported in a comment header in the manifest itself and 93 | see if any change in the manifest is indeed expected or for that particular 94 | manifest. 95 | This may happen for HLS manifests as well, i.e. the `default_audio_language` 96 | pipeline sets English as the default audio track. If 97 | that is already the default track in your original manifest, you will notice 98 | no visible changes in the edited manifest. 99 | 100 | In these cases, either edit the pipeline 101 | configuration file in the `/usr/share/manifest-edit` folder of the 102 | docker image, or read next chapter to create and use your own custom 103 | configuration file. 104 | 105 | ### Manifest Edit customized pipeline 106 | 107 | If you want to experiment creating your own pipeline, the suggested way to 108 | do so is to edit the provided `my_use_case.yaml` file and mount in the docker 109 | image using additional docker run options (see the following example): 110 | 111 | ```bash 112 | docker run \ 113 | -e UspLicenseKey= \ 114 | -e REMOTE_PATH=usp-s3-storage \ 115 | -e REMOTE_STORAGE_URL=http://usp-s3-storage.s3.eu-central-1.amazonaws.com/ \ 116 | -v "$(pwd)"/my_use_case.yaml:/etc/manifest-edit/my_use_case.yaml \ 117 | -p 1080:80 \ 118 | --name unified-origin-manifest-edit \ 119 | unifiedstreaming/origin:latest 120 | ``` 121 | 122 | You can now edit the `my_use_case.yaml` local file based on your needs. Refer 123 | to individual plugins documentation for instructions on how to do so. Any 124 | saved change will be immediately available: the corresponding pipeline can be 125 | invoked with the query parameter 126 | 127 | - `?python_pipeline_config=my_use_case` 128 | -------------------------------------------------------------------------------- /docker/origin-ubuntu/conf/apache2.conf: -------------------------------------------------------------------------------- 1 | # This is the main Apache server configuration file. It contains the 2 | # configuration directives that give the server its instructions. 3 | # See http://httpd.apache.org/docs/2.4/ for detailed information about 4 | # the directives and /usr/share/doc/apache2/README.Debian about Debian specific 5 | # hints. 6 | # 7 | # 8 | # Summary of how the Apache 2 configuration works in Debian: 9 | # The Apache 2 web server configuration in Debian is quite different to 10 | # upstream's suggested way to configure the web server. This is because Debian's 11 | # default Apache2 installation attempts to make adding and removing modules, 12 | # virtual hosts, and extra configuration directives as flexible as possible, in 13 | # order to make automating the changes and administering the server as easy as 14 | # possible. 15 | 16 | # It is split into several files forming the configuration hierarchy outlined 17 | # below, all located in the /etc/apache2/ directory: 18 | # 19 | # /etc/apache2/ 20 | # |-- apache2.conf 21 | # | `-- ports.conf 22 | # |-- mods-enabled 23 | # | |-- *.load 24 | # | `-- *.conf 25 | # |-- conf-enabled 26 | # | `-- *.conf 27 | # `-- sites-enabled 28 | # `-- *.conf 29 | # 30 | # 31 | # * apache2.conf is the main configuration file (this file). It puts the pieces 32 | # together by including all remaining configuration files when starting up the 33 | # web server. 34 | # 35 | # * ports.conf is always included from the main configuration file. It is 36 | # supposed to determine listening ports for incoming connections which can be 37 | # customized anytime. 38 | # 39 | # * Configuration files in the mods-enabled/, conf-enabled/ and sites-enabled/ 40 | # directories contain particular configuration snippets which manage modules, 41 | # global configuration fragments, or virtual host configurations, 42 | # respectively. 43 | # 44 | # They are activated by symlinking available configuration files from their 45 | # respective *-available/ counterparts. These should be managed by using our 46 | # helpers a2enmod/a2dismod, a2ensite/a2dissite and a2enconf/a2disconf. See 47 | # their respective man pages for detailed information. 48 | # 49 | # * The binary is called apache2. Due to the use of environment variables, in 50 | # the default configuration, apache2 needs to be started/stopped with 51 | # /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not 52 | # work with the default configuration. 53 | 54 | 55 | # Global configuration 56 | # 57 | 58 | # 59 | # ServerRoot: The top of the directory tree under which the server's 60 | # configuration, error, and log files are kept. 61 | # 62 | # NOTE! If you intend to place this on an NFS (or otherwise network) 63 | # mounted filesystem then please read the Mutex documentation (available 64 | # at ); 65 | # you will save yourself a lot of trouble. 66 | # 67 | # Do NOT add a slash at the end of the directory path. 68 | # 69 | #ServerRoot "/etc/apache2" 70 | 71 | # 72 | # The accept serialization lock file MUST BE STORED ON A LOCAL DISK. 73 | # 74 | #Mutex file:${APACHE_LOCK_DIR} default 75 | 76 | # 77 | # The directory where shm and other runtime files will be stored. 78 | # 79 | 80 | DefaultRuntimeDir ${APACHE_RUN_DIR} 81 | 82 | # 83 | # PidFile: The file in which the server should record its process 84 | # identification number when it starts. 85 | # This needs to be set in /etc/apache2/envvars 86 | # 87 | PidFile ${APACHE_PID_FILE} 88 | 89 | # 90 | # Timeout: The number of seconds before receives and sends time out. 91 | # 92 | Timeout 300 93 | 94 | # 95 | # KeepAlive: Whether or not to allow persistent connections (more than 96 | # one request per connection). Set to "Off" to deactivate. 97 | # 98 | KeepAlive On 99 | 100 | # 101 | # MaxKeepAliveRequests: The maximum number of requests to allow 102 | # during a persistent connection. Set to 0 to allow an unlimited amount. 103 | # We recommend you leave this number high, for maximum performance. 104 | # 105 | MaxKeepAliveRequests 100 106 | 107 | # 108 | # KeepAliveTimeout: Number of seconds to wait for the next request from the 109 | # same client on the same connection. 110 | # 111 | KeepAliveTimeout 5 112 | 113 | 114 | # These need to be set in /etc/apache2/envvars 115 | User ${APACHE_RUN_USER} 116 | Group ${APACHE_RUN_GROUP} 117 | 118 | # 119 | # HostnameLookups: Log the names of clients or just their IP addresses 120 | # e.g., www.apache.org (on) or 204.62.129.132 (off). 121 | # The default is off because it'd be overall better for the net if people 122 | # had to knowingly turn this feature on, since enabling it means that 123 | # each client request will result in AT LEAST one lookup request to the 124 | # nameserver. 125 | # 126 | HostnameLookups Off 127 | 128 | # ErrorLog: The location of the error log file. 129 | # If you do not specify an ErrorLog directive within a 130 | # container, error messages relating to that virtual host will be 131 | # logged here. If you *do* define an error logfile for a 132 | # container, that host's errors will be logged there and not here. 133 | # 134 | ErrorLog /dev/stderr 135 | 136 | # 137 | # LogLevel: Control the severity of messages logged to the error_log. 138 | # Available values: trace8, ..., trace1, debug, info, notice, warn, 139 | # error, crit, alert, emerg. 140 | # It is also possible to configure the log level for particular modules, e.g. 141 | # "LogLevel info ssl:warn" 142 | # 143 | LogLevel warn 144 | 145 | # Include module configuration: 146 | IncludeOptional mods-enabled/*.load 147 | IncludeOptional mods-enabled/*.conf 148 | 149 | # Include list of ports to listen on 150 | Include ports.conf 151 | 152 | 153 | # Sets the default security model of the Apache2 HTTPD server. It does 154 | # not allow access to the root filesystem outside of /usr/share and /var/www. 155 | # The former is used by web applications packaged in Debian, 156 | # the latter may be used for local directories served by the web server. If 157 | # your system is serving content from a sub-directory in /srv you must allow 158 | # access here, or in any related virtual host. 159 | 160 | Options FollowSymLinks 161 | AllowOverride None 162 | Require all denied 163 | 164 | 165 | 166 | AllowOverride None 167 | Require all granted 168 | 169 | 170 | 171 | Options Indexes FollowSymLinks 172 | AllowOverride None 173 | Require all granted 174 | 175 | 176 | # 177 | # Options Indexes FollowSymLinks 178 | # AllowOverride None 179 | # Require all granted 180 | # 181 | 182 | 183 | 184 | 185 | # AccessFileName: The name of the file to look for in each directory 186 | # for additional configuration directives. See also the AllowOverride 187 | # directive. 188 | # 189 | AccessFileName .htaccess 190 | 191 | # 192 | # The following lines prevent .htaccess and .htpasswd files from being 193 | # viewed by Web clients. 194 | # 195 | 196 | Require all denied 197 | 198 | 199 | 200 | # 201 | # The following directives define some format nicknames for use with 202 | # a CustomLog directive. 203 | # 204 | # These deviate from the Common Log Format definitions in that they use %O 205 | # (the actual bytes sent including headers) instead of %b (the size of the 206 | # requested file), because the latter makes it impossible to detect partial 207 | # requests. 208 | # 209 | # Note that the use of %{X-Forwarded-For}i instead of %h is not recommended. 210 | # Use mod_remoteip instead. 211 | # 212 | LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined 213 | LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined 214 | LogFormat "%h %l %u %t \"%r\" %>s %O" common 215 | LogFormat "%{Referer}i -> %U" referer 216 | LogFormat "%{User-agent}i" agent 217 | 218 | # Include of directories ignores editors' and dpkg's backup files, 219 | # see README.Debian for details. 220 | 221 | # Include generic snippets of statements 222 | IncludeOptional conf-enabled/*.conf 223 | 224 | # Include the virtual host configurations: 225 | IncludeOptional sites-enabled/*.conf 226 | 227 | # vim: syntax=apache ts=4 sw=4 sts=4 sr noet 228 | --------------------------------------------------------------------------------