# Table of Contents - [wiki](#wiki) - [wiki - Adaptive Streaming](#wiki-adaptive-streaming) - [wiki - WebM Dash Specification](#wiki-webm-dash-specification) - [wiki - Instructions to playback Adaptive WebM using DASH](#wiki-instructions-to-playback-adaptive-webm-using-dash) - [wiki](#wiki) - [wiki - WebM Encryption](#wiki-webm-encryption) - [wiki - Instructions to do WebM live streaming via DASH](#wiki-instructions-to-do-webm-live-streaming-via-dash) - [wiki - Eclipse Setup](#wiki-eclipse-setup) - [wiki - WebM Subsample Encryption](#wiki-webm-subsample-encryption) - [wiki - Encryption](#wiki-encryption) - [wiki - WebM VOD Baseline format](#wiki-webm-vod-baseline-format) - [wiki - Community](#wiki-community) - [wiki - Alpha Channel](#wiki-alpha-channel) - [wiki - FFmpeg](#wiki-ffmpeg) - [wiki - Future Codec Ideas](#wiki-future-codec-ideas) - [wiki - vpxenc command line](#wiki-vpxenc-command-line) - [wiki - Hardware](#wiki-hardware) - [wiki - VP9 Encoding Guide](#wiki-vp9-encoding-guide) - [wiki - Compiling with libvpx support](#wiki-compiling-with-libvpx-support) - [wiki - Convert PNG frames to WebM video](#wiki-convert-png-frames-to-webm-video) - [wiki - HOWTOs](#wiki-howtos) - [wiki - Software](#wiki-software) - [wiki - SoCs Supporting VP8/VP9](#wiki-socs-supporting-vp8-vp9) - [wiki - VP9 Known Issues](#wiki-vp9-known-issues) - [wiki - Spherical Video RFC (draft)](#wiki-spherical-video-rfc-draft-) - [wiki - VP9](#wiki-vp9) - [wiki - WebP](#wiki-webp) - [wiki - WebM](#wiki-webm) - [wiki - WebM Metadata](#wiki-webm-metadata) - [wiki - VP8 Implementations](#wiki-vp8-implementations) - [wiki - Temporal Metadata](#wiki-temporal-metadata) - [wiki - VP9 CodecPrivate](#wiki-vp9-codecprivate) - [wiki - WebVTT Metadata](#wiki-webvtt-metadata) - [wiki - VP9 Tips](#wiki-vp9-tips) - [wiki - Xcode: Working with libvpx](#wiki-xcode-working-with-libvpx) - [wiki - zz-obsolete](#wiki-zz-obsolete) - [wiki - WebVTT in WebM](#wiki-webvtt-in-webm) - [wiki - Webm Encryption RFC](#wiki-webm-encryption-rfc) - [wiki - Instructions to Playback a WebM DASH Presentation [obsolete]](#wiki-instructions-to-playback-a-webm-dash-presentation-obsolete-) - [wiki - Devices with hardware support](#wiki-devices-with-hardware-support) - [wiki - Global Metadata](#wiki-global-metadata) - [wiki](#wiki) - [wiki](#wiki) --- # wiki Search this site Embedded Files Skip to main content Skip to navigation Welcome to the WebM Wiki! ========================= Interested users are invited to collaborate on this wiki for any reasonable purpose related to [WebM, VP8 or VP9](http://www.webmproject.org/about) . The WebM wiki is world-readable, and logged-in subscribers to one of the [WebM mailing lists](http://www.webmproject.org/about/discuss/#webm-mailing-lists) have write access. Learn more [here](http://www.webmproject.org/about/discuss/#webm-mailing-lists) , and contact webmaster@webmproject.org if you have any access issues. Also see: [webmproject.org](http://www.webmproject.org/)   Report abuse Page details Page updated Report abuse --- # wiki - Adaptive Streaming Search this site Embedded Files Skip to main content Skip to navigation Adaptive Streaming ================== Report abuse Page details Page updated Report abuse --- # wiki - WebM Dash Specification Search this site Embedded Files Skip to main content Skip to navigation WebM Dash Specification ======================= Matroska/WebM in MPEG DASH This document defines how to use Matroska/WebM with the MPEG DASH adaptive streaming system defined in ISO-IEC\_23009-1 \[DASH\]. Matroska and WebM share the same file structure, Matroska having some extra features. WebM is also restricted to the VP8 video codec and Vorbis audio codec. The Matroska specification can be found at [http://www.matroska.org/technical/specs/index.html](http://www.matroska.org/technical/specs/index.html) \[MATROSKA\] and the WebM specification can be found at [http://www.webmproject.org/code/specs/container/](http://www.webmproject.org/code/specs/container/) \[WEBM\]. There is also an overview of all the structures found in Matroska/WebM for beginners at [http://www.matroska.org/technical/diagram/index.html](http://www.matroska.org/technical/diagram/index.html) . The MPEG DASH terminology appears in bold and the Matroska terminology appears in italic. For example Segment in DASH and Segment in Matroska. [](#h.h68oalty472k) 1 Segment formats for Matroska/WebM ------------------------------------------------------------ ### [](#h.tsz3q0pln6ib) 1.1 Preliminaries: Refinements of generic concepts 1.1.1 Subsegments Media subsegments are defined as one or more consecutive Clusters. 1.1.2 Media stream access points Media stream access points correspond to a CuePoint contained in a Cues. Typically CuePoints reference Blocks that are marked as key frames within a single stream. For WebM all SAPs shall be of type 1. In this case a SAP shall not reference any Blocks preceding the SAP and the SAP shall be the first frame rendered. 1.1.3 Segment Index The Segment Index corresponds to the Cues. ### [](#h.7dyv5w828gnw) 1.2 Initialization Segment Format The Initialization Segment shall contain the EBML header, Segment header, Segment Information and Tracks. The Initialization Segment may contain other level1 elements and padding. If the Media Segment contains a Cues that is placed after the Clusters than the Initialization Segment shall contain a SeekHead with a reference to the Cues. The Initialization Segment shall not contain Clusters or Cues. ### [](#h.cppzgu8euls9) 1.3 Media Segment Types Media Segments can be of three different types: Basic Media Segments, Self-Initializing Media Segments, and Self-Initializing Indexed Media Segments. 1.3.1 General format type \- All Media Segments must contain one or more Clusters. 1.3.2 Basic Media Segment \- The Media Segment shall contain only one or more Clusters. \- The Initialization Segment that references these Media Segments should have a Segment with an unknown size (-1). 1.3.3 Self-Initializing Media Segment \- Each Media Segment shall contain an Initialization Segment. \- The Initialization Segment shall be placed before the Clusters. 1.3.4 Self-Initializing Indexed Media Segment \- Each Media Segment shall contain an Initialization Segment. \- The Initialization Segment shall be placed before the Clusters. \- Each Media Segment shall contain a Cues that references the Clusters in the Media Segment. \- The Cues shall not be part of the Initialization Segment. \- The Cues shall be placed after the Initialization Segment. \- If the Cues is placed after the Clusters then a SeekHead shall be contained in the Initialization Segment with a reference to the Cues. ### [](#h.351an4mlgc8d) 1.4 Media Presentation based on Matroska/WebM formats 1.4.1 MIME types The MIME types for Segments are as follows: * video/webm for WebM video files, * audio/webm for WebM audio-only files * video/x-matroska for Matroska video files * audio/x-matroska for Matroska audio-only files * video/x-matroska-3d for Matroska files with a stereoscopic video trackRFC 4281 The MIME type for codecs are as defined in [RFC 4281](http://tools.ietf.org/html/rfc4281) \[MIMETYPE\]. For WebM only video/vp8 and audio/vorbis are possible. 1.4.2 General \- In the case a Representation contains only one Media Segment then the Media Segment must be a Self-Initializing Indexed Media Segment. \- An Index Segment shall not be present. However an @indexRange attribute may be present to signal the byte range for a Segment Index within a Media Segment. \- If an Initialization Segment is contained within a Self-Initializing Indexed Media Segment then the @range attribute of the Initialization Segment shall be present to signal the byte range for the Initialization Segment within the Media Segment. 1.4.3 Authoring Rules for specific MPD flags 1.4.3.1 Segments starting with media stream access points \- If the @startWithRAP attribute is not set to '0', the conditions in 5.5.3.2 \[DASH\] shall apply. 1.4.3.2 Subsegments starting with media stream access points \- If the @subsegmentStartsWithRAP attribute is not set to '0', the conditions in 5.5.3.2 \[DASH\] shall apply. \- Each subsegment shall start on a Cluster boundary. \- The first Block in the subsegment shall be a key Block. 1.4.3.3 Subsegment Alignment \- If the @segmentAlignmentFlag is set to 'true', the conditions in 5.5.3.2 \[DASH\] shall apply. \- The Cues of each Representation within an AdaptationSet shall have the same timecodes. \- Each CuePoint within a Cues should reference the first Block of the TrackNumber within a Cluster. 1.4.3.4 Bitstream switching \- If the @bitstreamSwitchingFlag is set to 'true', for a set of Representations within an AdaptationSet, the conditions in 5.5.3.2 \[DASH\] shall apply and the Bitstream Switching Segment shall not be present. \- For a set of Representations within an AdaptationSet, the TrackNumber, CodecID and CodecPrivate shall contain the same value. \- The codec shall support transparent resolution switching. (e.g. VP8) [](#h.me5vqvn6smh0) 2 Matroska/WebM On-Demand profile ---------------------------------------------------------- ### [](#h.7962a5o7j6f8) 2.1 General \- The conditions in 8.3.1 \[DASH\] shall apply. \- For WebM the On-Demand profile is identified by the URN “urn:mpeg:dash:profile:webm-on-demand:2012”. ### [](#h.sil5e9afpayp) 2.2 Media Presentation Description Constraints Most of the constraints are the same constraints as those outlined in 8.3.2 \[DASH\]. \- The rules for the MPD and the segments as defined in Media Presentation based on Matroska/WebM formats shall apply. \- Representations not inferred to have @profiles equal to the profile identifier as defined in On-Demand General may be ignored. \- MPD@type shall be “static”. \- The Subset element may be ignored. \- neither the Period.SegmentList element nor the Period.SegmentTemplate element shall be present \- if either the AdaptationSet.SegmentList or the AdaptationSet.SegmentTemplate element is present in an AdaptationSet element then this AdaptationSet element may be ignored. \- if either the Representation.SegmentList or the Representation.SegmentTemplate element is present in a Representation element then this Representation element may be ignored. \- if the Representation element does not contain a BaseURL element then this Representation element may be ignored. \- AdaptationSet elements with AdaptationSet@subsegmentAlignment not present, or set to 'false' may be ignored. \- Representation elements with @subsegmentStartWithSAP value (either supplied directly or inherited from the containing AdaptationSet) that does not equal 1 may be ignored if the containing AdaptationSet contains more than one Representation. \- Elements using the @xlink attribute may be ignored from the MPD. The Representations conforming to this profile are those not accessed through an AdaptationSet that uses an @xlink. ### [](#h.o349xgfc7cdm) 2.3 Segment Format Constraints \- Each Representation shall contain one Segment that complies with the Self-Initializing Index Media Segment. [](#h.h7ryep7y9ttc) 3 Matroska/WebM Live profile ----------------------------------------------------- TODO(fgalligan) [](#h.8n83qbaejj1g) 4 References ===================================== \[DASH\] Dash specification [www.itscj.ipsj.or.jp/sc29/open/29view/29n12313t.doc](http://www.itscj.ipsj.or.jp/sc29/open/29view/29n12313t.doc) \[MATROSKA\] Matroska specification             [http://www.matroska.org/technical/specs/index.htm](http://www.matroska.org/technical/specs/index.html) \[MIMETYPE\] RFC mimetypes for codecs [http://www.ietf.org/rfc/rfc4281.txt](http://www.ietf.org/rfc/rfc4281.txt) \[WEBM\] WebM specification [http://www.webmproject.org/code/specs/container/](http://www.webmproject.org/code/specs/container/) Report abuse Page details Page updated Report abuse --- # wiki - Instructions to playback Adaptive WebM using DASH Search this site Embedded Files Skip to main content Skip to navigation Instructions to playback Adaptive WebM using DASH ================================================= This page describes the recommended ways to create, stream and playback WebM files using DASH. If you are looking for the old (and obsolete) page that used FFmpeg, libwebm and webm-tools, it has been moved here: [http://wiki.webmproject.org/zz-obsolete/instructions-to-playback-a-webm-dash-presentation](http://wiki.webmproject.org/zz-obsolete/instructions-to-playback-a-webm-dash-presentation) Creating WebM Files for DASH Note about FFmpeg: You will need to download the latest (tip-of-the-tree) version of FFmpeg in order for some DASH features to work. You can either download nightly static build from [https://www.ffmpeg.org/download.html](https://www.ffmpeg.org/download.html) or build FFmpeg yourself from the git repository. Step 1: Create the Video and Audio Streams For streaming WebM files using DASH, the video and audio files have to be non-muxed and non-chunked (i.e.) each video stream goes into it’s own file and each audio stream goes into it’s own file. For more information on what this means see [this link](http://wiki.webmproject.org/adaptive-streaming/webm-vod-baseline-format) . For the sake of examples, let’s assume there is a raw video source named “input\_video.y4m” and a raw audio source named “input\_audio.wav”. We create 5 video streams and 1 audio stream each with varying resolutions and bit rates. Video Streams: VP9\_DASH\_PARAMS="-tile-columns 4 -frame-parallel 1" ffmpeg -i input\_video.y4m -c:v libvpx-vp9 -s 160x90 -b:v 250k -keyint\_min 150 -g 150 ${VP9\_DASH\_PARAMS} -an -f webm -dash 1 video\_160x90\_250k.webm ffmpeg -i input\_video.y4m -c:v libvpx-vp9 -s 320x180 -b:v 500k -keyint\_min 150 -g 150 ${VP9\_DASH\_PARAMS} -an -f webm -dash 1 video\_320x180\_500k.webm ffmpeg -i input\_video.y4m -c:v libvpx-vp9 -s 640x360 -b:v 750k -keyint\_min 150 -g 150 ${VP9\_DASH\_PARAMS} -an -f webm -dash 1 video\_640x360\_750k.webm ffmpeg -i input\_video.y4m -c:v libvpx-vp9 -s 640x360 -b:v 1000k -keyint\_min 150 -g 150 ${VP9\_DASH\_PARAMS} -an -f webm -dash 1 video\_640x360\_1000k.webm ffmpeg -i input\_video.y4m -c:v libvpx-vp9 -s 1280x720 -b:v 1500k -keyint\_min 150 -g 150 ${VP9\_DASH\_PARAMS} -an -f webm -dash 1 video\_1280x720\_500k.webm The "keyint\_min" and "g" parameters make sure that all the video streams have aligned Cue Points. "dash" parameter ensures that DASH compliant WebM files are created. Also, to use VP8 instead of VP9, use "libvpx" as the video codec in the above command lines instead of "libvpx-vp9". Audio Stream: ffmpeg -i input\_audio.wav -c:a libvorbis -b:a 128k -vn -f webm -dash 1 audio\_128k.webm Even though, the example commands show raw video and audio, any input source format supported by FFmpeg can be used and the command line has to be changed accordingly. Step 2: Create the WebM DASH Manifest WebM DASH Manifest is an XML file (usually with the extension .mpd). It can be created using ffmpeg as follows: ffmpeg \\ \-f webm\_dash\_manifest -i video\_160x90\_250k.webm \\ \-f webm\_dash\_manifest -i video\_320x180\_500k.webm \\ \-f webm\_dash\_manifest -i video\_640x360\_750k.webm \\ \-f webm\_dash\_manifest -i video\_640x360\_1000k.webm \\ \-f webm\_dash\_manifest -i video\_1280x720\_500k.webm \\ \-f webm\_dash\_manifest -i audio\_128k.webm \\ \-c copy -map 0 -map 1 -map 2 -map 3 -map 4 -map 5 \\ \-f webm\_dash\_manifest \\ \-adaptation\_sets "id=0,streams=0,1,2,3,4 id=1,streams=5" \\ manifest.mpd Make sure that you have all the video and audio files along with the manifest in the same directory. DASH Playback on Web using Shaka One option for streaming WebM files adaptively on the Web is Shaka, which is an open source media player built on HTML5. Source code: [https://github.com/google/shaka-player](https://github.com/google/shaka-player) For tutorials and more information please see the Shaka Home Page: [http://shaka-player-demo.appspot.com/docs/index.html](http://shaka-player-demo.appspot.com/docs/index.html) . DASH Playback on Web using Dash.js Another option for streaming WebM files adaptively on the Web, is Dash.js, which is also an open source media player built on HTML5. Here is a simple piece of HTML and javascript that will play back your video adaptively:             The above code snippet is based on Dash.js' baseline player. You can obtain dash.webm.min.js from the [Dash.js github repository](https://github.com/Dash-Industry-Forum/dash.js/blob/development/contrib/webmjs/dash.webm.min.js) . For more information on Dash.js API and tweaking, you can refer to Dash.js wiki here: [https://github.com/Dash-Industry-Forum/dash.js/wiki](https://github.com/Dash-Industry-Forum/dash.js/wiki) To create a custom skinnable HTML5 player using Dash, you can use [Video.js](http://www.videojs.com/) which in turn supports Dash.js for adaptive playback. Here is a demo that shows how to use Dash.js and Video.js for adaptive playback of WebM files: [http://demos.webmproject.org/dash/201410](http://demos.webmproject.org/dash/201410) DASH Playback on Android For streaming WebM files adaptively on Android, you can use ExoPlayer - an open source extensible media player built on top of the Android Media library. It is developed by YouTube. A beginner's guide to ExoPlayer can be found here: [https://www.youtube.com/watch?v=6VjF638VObA](https://www.youtube.com/watch?v=6VjF638VObA) For more details on ExoPlayer see here: [http://developer.android.com/guide/topics/media/exoplayer.html](http://developer.android.com/guide/topics/media/exoplayer.html) Report abuse Page details Page updated Report abuse --- # wiki Search this site Embedded Files Skip to main content Skip to navigation Welcome to the WebM Wiki! ========================= Interested users are invited to collaborate on this wiki for any reasonable purpose related to [WebM, VP8 or VP9](http://www.webmproject.org/about) . The WebM wiki is world-readable, and logged-in subscribers to one of the [WebM mailing lists](http://www.webmproject.org/about/discuss/#webm-mailing-lists) have write access. Learn more [here](http://www.webmproject.org/about/discuss/#webm-mailing-lists) , and contact webmaster@webmproject.org if you have any access issues. Also see: [webmproject.org](http://www.webmproject.org/)   Report abuse Page details Page updated Report abuse --- # wiki - WebM Encryption Search this site Embedded Files Skip to main content Skip to navigation WebM Encryption =============== Moved. See [http://www.webmproject.org/docs/webm-encryption/](http://www.webmproject.org/docs/webm-encryption/) Report abuse Page details Page updated Report abuse --- # wiki - Instructions to do WebM live streaming via DASH Search this site Embedded Files Skip to main content Skip to navigation Instructions to do WebM live streaming via DASH =============================================== This page describes the recommended ways to create, stream and playback live WebM files using DASH. [](#h.fopvhyi7e23y) Prerequisites ====================================== 1) FFmpeg - You will need to download version 2.8 of FFmpeg (or higher) in order for some DASH features to work. You can either download nightly static build from [https://www.ffmpeg.org/download.html](https://www.ffmpeg.org/download.html) or [build FFmpeg yourself](https://trac.ffmpeg.org/wiki/CompilationGuide) from the git repository. 2) A web server. 3) Shaka Player (for playback on Web) - [https://github.com/google/shaka-player](https://github.com/google/shaka-player) 4) ExoPlayer (for playback on Android) - [https://github.com/google/ExoPlayer](https://github.com/google/ExoPlayer) 5) Dash.js (for playback on Web) - [https://github.com/Dash-Industry-Forum/dash.js](https://github.com/Dash-Industry-Forum/dash.js) [](#h.abdivbe7syrr) Creating Live Content ============================================== [](#h.x31bachsvk4f) Encode Video and Audio ----------------------------------------------- FFmpeg can be used to create the Audio and Video streams for DASH Live. This will seem familiar if you have used FFmpeg to create VOD (non-live) DASH streams. For live streaming WebM files using DASH, the video and audio streams have to be non-muxed and chunked. For more information on what this means, see [this link](http://wiki.webmproject.org/adaptive-streaming/webm-vod-baseline-format) . We are going to use the following encoding settings with libvpx for the VP9 encoder: VP9\_LIVE\_PARAMS="-speed 6 -tile-columns 4 -frame-parallel 1 -threads 8 -static-thresh 0 -max-intra-rate 300 -deadline realtime -lag-in-frames 0 -error-resilient 1" Now, the video and audio streams can be generated by using a command as follows: ffmpeg \\  -f v4l2 -input\_format mjpeg -r 30 -s 1280x720 -i /dev/video0 \\  -f alsa -ar 44100 -ac 2 -i hw:2 \\  -map 0:0 \\  -pix\_fmt yuv420p \\  -c:v libvpx-vp9 \\    -s 1280x720 -keyint\_min 60 -g 60 ${VP9\_LIVE\_PARAMS} \\    -b:v 3000k \\  -f webm\_chunk \\    -header "/var/www/webm\_live/glass\_360.hdr" \\    -chunk\_start\_index 1 \\  /var/www/webm\_live/glass\_360\_%d.chk \\  -map 1:0 \\  -c:a libvorbis \\    -b:a 128k -ar 44100 \\  -f webm\_chunk \\    -audio\_chunk\_duration 2000 \\    -header /var/www/webm\_live/glass\_171.hdr \\    -chunk\_start\_index 1 \\  /var/www/webm\_live/glass\_171\_%d.chk This command captures the video and audio from the webcam and microphone respectively and encodes them into a Live WebM Stream. Things to note: * * This is a never ending command, so this should probably be run in the background. * If you get warnings about Alsa or V4L2 thread queue not being enough, try increasing the "-thread\_queue\_size" parameter. * File name of the header should conform to the following format: \_.hdr * File name of the chunks should conform to the following format: \_\_%d.chk * The input audio/video sources and their parameters can change based upon the OS and drivers that you have in your machine. See [FFmpeg's device documentation](https://www.ffmpeg.org/ffmpeg-devices.html) for more information on which source and parameters to use. * The "map" parameter has to be modified in such a way that the input video stream is routed to the video encoder and the input audio stream is routed to the audio encoder. For more information, see [FFmpeg's map option documentation](https://trac.ffmpeg.org/wiki/How%20to%20use%20-map%20option) . * The video and audio chunks have to be in sync. This is ensured by following these rules: * The "keyint\_min" and "g" parameters to the video encoder should always be the same. * The "keyint\_min" parameter should be in sync with the "audio\_chunk\_duration" parameter passed to the audio encoder (keyint\_min is expressed in number of frames whereas audio\_chunk\_duration is expressed in milliseconds). In the given example, the video frame rate is 30 fps, so keyint\_min of 150 means that each chunk is of duration 5000 milliseconds (5 seconds). * More than one video/audio stream can be created this way by merely adding another "webm\_chunk" output to the above command. [](#h.50lzpc54n837) Create the DASH Manifest ------------------------------------------------- FFmpeg can be used to create the DASH Manifest by passing the header file created from the previous step as input. Here's a sample command: ffmpeg \\  -f webm\_dash\_manifest -live 1 \\  -i /var/www/webm\_live/glass\_360.hdr \\  -f webm\_dash\_manifest -live 1 \\  -i /var/www/webm\_live/glass\_171.hdr \\  -c copy \\  -map 0 -map 1 \\  -f webm\_dash\_manifest -live 1 \\    -adaptation\_sets "id=0,streams=0 id=1,streams=1" \\    -chunk\_start\_index 1 \\    -chunk\_duration\_ms 2000 \\    -time\_shift\_buffer\_depth 7200 \\    -minimum\_update\_period 7200 \\  /var/www/webm\_live/glass\_live\_manifest.mpd Make sure that the "chunk\_start\_index" and the "chunk\_duration\_ms" parameters are the same as in the previous step. Also, ensure that the previous FFmpeg command has actually written the header file (usually happens instantaneously) before running this. If you are wrapping both the commands in a script, it's recommended to add at least 1 second of sleep between these two commands. [](#h.scilo8dl6apq) Streaming Live Content =============================================== [](#h.vlw2hjkprn2a) Web ([Shaka Player](https://github.com/google/shaka-player) ) -------------------------------------------------------------------------------------- Shaka Player is an open source media player built on top of HTML5 video API and it is capable of playing back Live WebM via DASH (provided the browser supports Media Source Extensions and WebM/VP9 playback). Clone and Build Shaka Player: * * git clone [https://github.com/google/shaka-player.git](https://github.com/google/shaka-player.git) * cd shaka-player * ./build/all.py The above steps will generate "shaka-player.compiled.js". Copy that to your web-server's directory. Here's a sample piece of HTML and Javascript that uses Shaka Player for WebM Live Playback:             [](#h.raborr7bpu20) Android ([ExoPlayer](https://github.com/google/ExoPlayer) ) ------------------------------------------------------------------------------------ ExoPlayer is an extensible open source media player built on top of Android's Media APIs. ExoPlayer natively supports WebM Live Streams via DASH. Please refer to the ExoPlayer's [sample app](https://github.com/google/ExoPlayer/tree/master/demo) to know how to use ExoPlayer to playback Live Streams via DASH. To playback VP9 videos on Android devices running prior to Kitkat, the native [ExoPlayer VP9 Extension](https://github.com/google/ExoPlayer/tree/dev-webm-vp9-opus/extensions/vp9) can be used. [](#h.e935lc4dtlch) Web ([Dash.js](https://github.com/Dash-Industry-Forum/dash.js) ) ----------------------------------------------------------------------------------------- Dash.js is an open source media player built on top of the HTML5 video API. Merely point the URL of your manifest to Dash.js and it will adaptively stream the live content. Here's a sample piece of HTML and Javascript that uses Dash.js:               For more information on Dash.js API and tweaking, you can refer to Dash.js wiki here: [https://github.com/Dash-Industry-Forum/dash.js/wiki](https://github.com/Dash-Industry-Forum/dash.js/wiki) [](#h.d7uw1asz0y2m) \[Optional\] Time Sync Between Server and Clients -------------------------------------------------------------------------- Note: This section only applies for ExoPlayer and Dash.js DASH Live playback works better if the server and client clocks are in sync. In order to achieve that, the client requests a page from the server, for which the server responds with 200 OK and the response body as the current server UTC date and time in ISO Format. The strftime format specifier for ISO format is "%FT%TZ". A sample time page can be found here: [http://time.akamai.com/?iso](http://time.akamai.com/?iso) Once you have the time server ready, you can include the UTCTiming URL in the manifest by passing: \-utc\_timing\_url "" Report abuse Page details Page updated Report abuse --- # wiki - Eclipse Setup Search this site Embedded Files Skip to main content Skip to navigation Eclipse Setup ============= Install Eclipse in the recommended way for your environment, and start it.  Then:  * * Select Help -> Install New Software * Select a relevant site from the Work with dropdown * Select the following packages: * CDT Main Features -> C/C++ Development Tools * CDT Optional Features -> all (you may deselect Autotools support for CDT Source) * Collaboration -> Eclipse EGit * Programming Languages -> all (though you may deselect the following) *   Autotools Support for CDT (Incubation) *   C/C++ Development Tools SDK *   C++ Library API Documentation Hover/Help (Incubation) *   Fortran Development Tools *   IBM XLF Compiler Support *   Linux Fortran Compiler Support *   Object Teams \* * Select Next > * Resolve any dependency conflicts and select Next > again * Accept the licenses and select Finish Git Setup * * Select File -> Import -> Git -> Projects from Git -> Next > * Select URI -> Next > * Enter the URI ssh://gerrit.chromium.org:29418/webm/libvpx * Eclipse parses the URI for other field data * Select Next > * Provide the passphrase for your SSH key, if prompted * Accept all the branches. Select Next > * Select a project directory, and make a note of it ($PROJECT\_DIRECTORY). Select Finish * Eclipse does a git clone into the project directory Before continuing, in a shell, do: $ cd $PROJECT\_DIRECTORY $ ./configure --disable-codecs --enable-vp8 --target=x86\_64-linux-gcc --enable-debug --disable-install-docs --log=yes --enable-internal-stats --enable-unit-tests Return to Eclipse: * * Run the New Project wizard * Select the wizard for C/C++ -> Makefile Project with Existing Code. Select Next > * Specify a project name, and the existing code location ($PROJECT\_DIRECTORY) * Select the Linux GCC Toolchain * Select Finish Adding Gerrit Support * * Select Window -> Open Perspective -> Other... -> Git Repository Exploring -> OK * In the Git Repositories pane, expand the libvpx -> Remotes -> origin * Right-click origin and select Gerrit Configuration * Push URI should be correct.  Select Finish Indexing and Content Assist (so that code references work)  * * Select Window -> Preferences -> C/C++ -> Indexer * Check Enable Indexer, Index unused headers, and Allow heuristic resolution of includes, and click Apply Missing includes? * * Right-click project -> Properties -> Paths and Symbols \-> Includes * Include Directories to add * /usr/include * /usr/include/linux * /usr/include/c++/4.4/tr1 Content Assist * * Select Window -> Preferences -> C/C++ -> Editor -> Content Assist -> Advanced * Check Help Proposals, Parsing, Template and Word To use, type in the start of a structure or parm and hit Ctrl+Space to see list of options. Also works for functions, etc. Now, as you type code, it shows you the errors in your code until you fix. Style * * Select Window -> Preferences -> Code Style -> Formatter -> Import * (Use the attached files) * Right-click project name -> Properties -> C/C++ General -> Formatter * Enable Project specific settings * Set Active profile to WEBM Project * FILTERING THE .o files * Project Explorer Triangle Menu -> Customize View * Select Object files to remove To use, select text and press Ctrl+Shift-F to reformat the selection. Debugging * * Select Run -> Debug Configurations -> C/C++ Application -> New Button (upper left) * Search Project * vpxenc [](https://drive.google.com/folderview?id=1jJLtSxkwWz0MspuD_7gZ13Nq2dIRlDZ- "Open Drive Folder in new window") Report abuse Page details Page updated Report abuse --- # wiki - WebM Subsample Encryption Search this site Embedded Files Skip to main content Skip to navigation WebM Subsample Encryption ========================= Incorporated into [WebM Encryption Spec](https://www.webmproject.org/docs/webm-encryption/) , 2016-09-20. Report abuse Page details Page updated Report abuse --- # wiki - Encryption Search this site Embedded Files Skip to main content Skip to navigation Encryption ========== Report abuse Page details Page updated Report abuse --- # wiki - WebM VOD Baseline format Search this site Embedded Files Skip to main content Skip to navigation WebM VOD Baseline format ======================== The WebM Video on Demand (VOD) baseline format for adaptive streaming are Non-Chunked and Non-muxed files. ![](https://lh6.googleusercontent.com/aTSLDFKoGUfJyT5YAL920AlFlSwN3PeL5kR_4Ht3wMhJF5iRefSpBP9odx-bJQoQ4GjBWy1gTHQ729mMF0Pte9f57UEvZWN-JDgbGGJJ-kTe3pN-78MrAqGbbLXrPZH_YA=w1280) Figure for Separate Non-chunked files. Information on Decision Process Adaptive streaming can be done with many different file formats and features. Different formats will pose tradeoffs in areas such as complexity and storage. Below are four choices for the physical layout of WebM VOD files for adaptive streaming. 1\. Muxed and Non-Chunked ![](https://lh5.googleusercontent.com/B361rG3rA25aGPZjlwbcWLF_tDOrvO9IjrB2jyT_QMuv_AtKtruLuK2U_qMUXMDaQ9RNPAZlYPGqZEMD7MCPA4keTCZGzDPUzQB3iDkLHGeaYVRWuyTLOU-hXhdHY_679g=w1280) 2\. Muxed and Chunked ![](https://lh6.googleusercontent.com/JCnAMsrVCeY35u0UcvBG6UGl4TFh7aHVH7A7gndNp_7M1LI0H5pP2c2Iqd2OthFEgiNkCljkwyiKpq8DWh9pLM4TYy_oKhQQKTAkQmqpgBwpgaOg6P7zPJHcKZqut-Y5BA=w1280) 3\. Non-Muxed and Non-Chunked ![](https://lh3.googleusercontent.com/ui4BRPIi15byMCz9Kcb4Jw0_GBJtujtrUeKDrto8BMKcSnpaJNY0sz4aMomdEBRkAFYMa64LMylWAYFMbA5DAIvdDmpROOCGS-iUOs1B9BhbwsM_ySm8o_HJNQynEYMC9A=w1280) 4\. Non-Muxed and Chunked ![](https://lh6.googleusercontent.com/PHG24j4MK68aTNAaDXWsbXCmqmxrsMC1_w89Z6nvouz6B4qzAY-ocJI5LCswW3UNhE6uRye8umYDRyQPxrwUGrTJNFCNpA_KlX95YDwvZdyULn8HPStTAHQCHPkX_GHhHQ=w1280) Discussion of the Four Formats 1\. Muxed and Non-Chunked * * Pros * There is already a lot of content as this is the format most websites use today for progressive download. * Tools already have support. * File management is easy. Number of files equals number of audio streams \* number of video streams \[ \* number of text streams\]. * Cons * Storage does not scale well. Size of data equals num video(A0 size + ... + An size) + num audio(V0 size + ... + Vn size). (Some combinations could be optimized out) * Switching may be more complex depending on frame alignment and stream interleaving. 2\. Muxed and Chunked * * Pros * Format of the de-facto leader in adaptive streaming. * Cons * Storage does not scale well. Size of data equals num video(A0 size + ... + An size) + num audio(V0 size + ... + Vn size). * Switching may be more complex depending on frame alignment and stream interleaving. * File management is complex. Number of files equals number of chunks \* number of audio streams \* number of video streams \[\* number of text streams\]. * Extraneous downloaded bytes may be bigger. This depends on if there is an requirement that each chunk be a fully formed WebM file as the setup data for Vorbis can be fairly big. 3\.  Non-Muxed and Non-Chunked * * Pros * Storage scales well. Size of data equals (A0 size + ... + An size) + (V0 size + ... + Vn size). * Switching may be easier than the other formats because you do not need to worry about alignment of other interleaved streams. * File management is easy. Number of files equals number of audio streams + number of video streams \[+ number of text streams\]. * Cache invalidation of only one stream when one stream needs to be added/removed/changed. * Cons * Current tools support is small. * Currently relatively unused format. 4\. Non-Muxed and Chunked * Pros * Storage scales well. Size of data equals (A0 size + ... + An size) + (V0 size + ... + Vn size). * Switching may be easier than the other formats because you do not need to worry about alignment of other interleaved streams. * Cons * File management is complex. Number of files equals number of chunks \* (number of audio streams + number of video streams \[+ number of text streams\]). * Extraneous downloaded bytes may be bigger. This depends on if there is an requirement that each chunk be a fully formed WebM file as the setup data for Vorbis can be fairly big. * Current tools support is nonexistent. * Currently unused format. WebM VOD Baseline Format Choice The heaviest weighted decision point is storage, which downgrades muxed formats 1 and 2. Format 3 is better than format 4 because of file management and tool support. Format 3 (Non-chunked, Non-muxed) is the choice for the baseline format of WebM VOD files for adaptive streaming. The cons for format 3 should be overcome as adaptive streaming is fairly new and there is not a lot of content currently. [](https://drive.google.com/folderview?id=10paBncctTK7-3kOiQNpJLj5KjaG36Z88 "Open Drive Folder in new window") Report abuse Page details Page updated Report abuse --- # wiki - Community Search this site Embedded Files Skip to main content Skip to navigation Community ========= [](#h.ldr0qebme3gq) Chat ----------------------------- Both development and user chat for WebM/VP8 takes place on IRC in the #vp8 channel on libera. There are also channels for #vorbis and #matroska. [](#h.5hq5i27y78u) Mailing Lists ------------------------------------- See [http://www.webmproject.org/about/discuss/](http://www.webmproject.org/about/discuss/) [](#h.xavgp4dyj64w) Blogs ------------------------------ [](#h.z5x1azi8u4kg) [http://blog.webmproject.org/](http://blog.webmproject.org/) -------------------------------------------------------------------------------------- [http://thomasdaede.com/wordpress/](http://blog.webmproject.org/) ([a](http://web.archive.org/web/20140210085757/http://thomasdaede.com/wordpress/) ) [http://multimedia.cx/eggs/](http://multimedia.cx/eggs/) [https://x264dev.multimedia.cx/](https://x264dev.multimedia.cx/) [https://librevideo.org](https://librevideo.org/) [http://xiphmont.livejournal.com/](http://xiphmont.livejournal.com/) [https://xiphmont.dreamwidth.org/](https://xiphmont.dreamwidth.org/) [](#h.myfmt5uqwnjg) People ------------------------------- Report abuse Page details Page updated Report abuse --- # wiki - Alpha Channel Search this site Embedded Files Skip to main content Skip to navigation Alpha Channel ============= [](#h.tgsy9siq699i) Objective ---------------------------------- The purpose of this document is to define the method of supporting WebM video with alpha channel information for VP8 video. [](#h.2bsdrnqcnmo7) Background ----------------------------------- One of the most requested features for WebM as used in HTML5 is for alpha channel support, i.e. a value for each pixel in a video frame that indicates the desired transparency, where 0 is completely transparent and effectively masked, and 255 is completely opaque. Values in between specify degrees of opaqueness meaning that the resulting pixel value is the ratio of the normally occluded pixel and the normally occluding pixel. Use Cases * Alpha channel data should be pixel perfect * Loss in alpha channel data is acceptable [](#h.jntikusrahhv) Design Ideas ------------------------------------- Method 1 - VP8 encoding of A-channel Encoding: The YUV frame is sent to the encoder (without the A-channel). The encoded output is placed into a Block element in the container. The A-channel is also VP8 encoded (with A-channel in Y plane, dummy values in U and V planes) and the encoded output is placed in the BlockAdditional element of the container. The A-channel uses a separate encoder than that of the YUV frames (to exploit temporal coherence). Though this method might not give a pixel perfect alpha information, it will be perceptually lossless given enough datarate. ![](https://lh5.googleusercontent.com/C_0EZlIgXj-ZBoEKKfap0UTN8oH1ZGNKsh2NzOijgzDJGeGEhN34frSRby7jEoja6najGJPgIXUQA6PNpaPzF5NSFFoVUnBfiOri3fJrrpUGphrZis_vf9sRVboP0U6-HQ=w1280) Decoding: The “Block” data is sent to the VP8 decoder and the “BlockAdditional” data (if present) is sent to another VP8 decoder and a component after the decoder will reconstruct the appropriate YUV frame and A-channel, which is then passed on to the renderer. ![](https://lh3.googleusercontent.com/NF-fqBgWaXU1eL-ev2Vhuu_8l7IS6TjusRSnZRlojiXxh1G_BiQrFb9t6hZ7oE5uFtd1qMvO_yKgaAys3QYcKXVXR13uX9py2W9tb-RxJhvicnPCj2ECO3-k5N5ycstLAQ=w1280) [](#h.yzoxp6b7sjof) Alternatives Considered ------------------------------------------------ Method 2 - Lossless encoding of A-channel This method is almost similar to Method 2 with the only difference being the A-channel is encoded by a lossless technique (which is to be defined later) and is placed into BlockAdditional element in the container (exact spec to be defined later). This is optimized such that the BlockAdditional is present only when there is a change in A-channel (for e.g. if the A-channel doesn’t change between frame 20 and frame 35, then there will be a block additional only on frame 20 and not on frames 21 through 35). The lossless encoding technique used can be similar to the one used for alpha channels in WebP, so essentially it will be alpha part of a standard WebP frame. Again, this is tentative and if there is a better lossless encoding method that will exploit temporal redundancy, we can probably use that. Methods 1 & 2 need vpx to support a new paradigm of having multiple encoder/decoder instances at the same time (one for video data and one for alpha channel). Method 3 - Double height and VP8 encoding Encoding: The YUV frame height is doubled and the A-plane information is stored in the bottom half of the Y plane. The bottom halves of the U and V planes are not used and are set to fixed dummy values. This frame is then sent to the encoder, which does not know presence of A-channel in the raw YUV frame. A flag is added to the container indicating the presence of alpha channel. ![](https://lh4.googleusercontent.com/BwjXdeRrcI86pMieQaLhr7BCeU-HMI2ZS4OCQY_MN6tCdJdWFAz8PE7eBycE69Gp3p2Z24dBoyuYfd9Ti2N4g90N48EW2N8MXKlObddKh2poGf8cEbWq5U_iBjHs7Ml-ew=w1280) Decoding: The decoder will decode the encoded frame with A-channel and output YUV frames of twice the original source height. Again, the decoder does not know about the presence of A-channel in the decoded data. If the flag is set in the container, a component after the encoder must reconstruct the original YUVA frame. Then the YUV and A-channels are passed on to the renderer appropriately. ![](https://lh6.googleusercontent.com/pOIUR6JEgJ12vBcpHvuHLPgN2NSOZmlkYzKNYHnFWAXGndrbKOU0RtFYYljeJtN83ikqB7wOJ0NK01cNF6Bf-FxoB6rxWDGkEtQoHXtcA1ro6vdXvtspDFbiBBcKbedl1A=w1280) Pros and Cons Report abuse Page details Page updated Report abuse --- # wiki - FFmpeg Search this site Embedded Files Skip to main content Skip to navigation FFmpeg ====== [](#h.wqnj6apsyxh5) FFmpeg VP8 Encoding Options ---------------------------------------------------- See [http://ffmpeg.org/ffmpeg.html#libvpx](http://ffmpeg.org/ffmpeg.html#libvpx) for additional parameter information. See [http://ffmpeg.org/trac/ffmpeg/wiki/vpxEncodingGuide](http://ffmpeg.org/trac/ffmpeg/wiki/vpxEncodingGuide) for a discussion of bitrate parameters. Report abuse Page details Page updated Report abuse --- # wiki - Future Codec Ideas Search this site Embedded Files Skip to main content Skip to navigation Future Codec Ideas ================== This page is to collect ideas on features for a future codec.  Goals/Non-Goals: * * The focus is still on "web video." * The primary delivery model is unicast IP over the Internet. We can make assumptions based on the behavior of IP networks rather than radio broadcast or optical media, for example. * Video-on-demand, video conferencing, screen-casting, multistreaming all primary use cases. * Want a useful, consistently deployed feature set, not tons of profiles and extensions. * Strong support for parallel encode/decode within each frame. [](#h.3hxlwd3hagag) Specific deficiencies in VP8 to address: ----------------------------------------------------------------- * * VP8 has \*almost\* enough framing information to parse it as an elementary stream. It'd help some applications (including support) if it could be parsed without an extra container. * Lack of 4:4:4 or equivalent for screen-casting * Lack of alpha support * Inflexible/expensive segmentation [](#h.cf6fx7qgpshs) Things to consider: -------------------------------------------- * * Bytestream vs bitstream? Literals vs bool-coded partitions? Which parts of the stream should a semi-smart sever be able to cheaply parse/rewrite? * Ability to insert "informative" blocks into the bitstream? things a dumb decoder or MITM could always ignore but interested parties could parse and act on? Report abuse Page details Page updated Report abuse --- # wiki - vpxenc command line Search this site Embedded Files Skip to main content Skip to navigation vpxenc command line =================== This page is to discuss future improvements to the vpxenc command line interface. [](#h.vnrk6a4w4ekf) Overall -------------------------------- vpxenc should aim to let users produce quality output videos with as few command line flags and as little knowledge of the codec internals as possible. [](#h.terzsi2m0b8w) Speed/quality profiles ----------------------------------------------- x264 provides speed/quailty profiles (--veryslow, --slow etc.) that will provide reasonable defaults for all other codec settings for the user. It would be nice if vpxenc could provide something as a replacement (or alternative) to the current --good --cpu-used= style. [](#h.v3tylzyri4py) Threading ---------------------------------- Multi-threaded encoding should be a matter of setting --threads= and having vpxenc select values for everything else as needed to make this work. In VP9 it may be useful to default to multi-threaded encoding. Report abuse Page details Page updated Report abuse --- # wiki - Hardware Search this site Embedded Files Skip to main content Skip to navigation Hardware ======== Report abuse Page details Page updated Report abuse --- # wiki - VP9 Encoding Guide Search this site Embedded Files Skip to main content Skip to navigation VP9 Encoding Guide ================== Last Modified: 2016-05-18 Examples given are for 2-pass VP9 encoding with [FFMpeg](https://www.ffmpeg.org/) . Ensure that your FFMpeg has been built with [libvpx support](http://wiki.webmproject.org/ffmpeg/building-with-libvpx) . [](#h.q0uhzmtx55zn) VOD Recommended Settings ------------------------------------------------- ffmpeg -i -c:v libvpx-vp9 -pass 1 -b:v 1000K -threads 8 -speed 4 \\  -tile-columns 6 -frame-parallel 1 \\  -an -f webm /dev/null  ffmpeg -i -c:v libvpx-vp9 -pass 2 -b:v 1000K -threads 8 -speed 1 \\  -tile-columns 6 -frame-parallel 1 -auto-alt-ref 1 -lag-in-frames 25 \\  -c:a libopus -b:a 64k -f webm out.webm c:v libvpx-vp9 tells FFmpeg to encode the video in VP9. c:a libopus tells FFmpeg to encode the audio in Opus. b:v 1000K tells FFmpeg to encode the video with a target of 1000 kilobits. b:a 64k tells FFmpeg to encode the audio with a target of 64 kilobits. Most of the current VP9 decoders use tile-based, multi-threaded decoding. In order for the decoders to take advantage of multiple cores, the encoder must set tile-columns and frame-parallel. Setting auto-alt-ref and lag-in-frames >= 12 will turn on VP9's alt-ref frames, a VP9 feature that enhances quality. speed 4 tells VP9 to encode really fast, sacrificing quality. Useful to speed up the first pass. speed 1 is a good speed vs. quality compromise. Produces output quality typically very close to speed 0, but usually encodes much faster. Multi-threaded encoding may be used if -threads > 1 and -tile-columns > 0. [](#h.8dy3obucasln) DASH Recommended Settings -------------------------------------------------- See [http://wiki.webmproject.org/adaptive-streaming/instructions-to-playback-adaptive-webm-using-dash](http://wiki.webmproject.org/adaptive-streaming/instructions-to-playback-adaptive-webm-using-dash) for WebM DASH settings. [](#h.bsi1cnoqdxad) Best Quality (Slowest) Recommended Settings -------------------------------------------------------------------- ffmpeg -i -c:v libvpx-vp9 -pass 1 -b:v 1000K -threads 1 -speed 4 \\  -tile-columns 0 -frame-parallel 0 \\  -g 9999 -aq-mode 0 -an -f webm /dev/null ffmpeg -i -c:v libvpx-vp9 -pass 2 -b:v 1000K -threads 1 -speed 0 \\  -tile-columns 0 -frame-parallel 0 -auto-alt-ref 1 -lag-in-frames 25 \\  -g 9999 -aq-mode 0 -c:a libopus -b:a 64k -f webm out.webm tile-columns 0, frame-parallel 0: Turning off tile-columns and frame-parallel should give a small bump in quality, but will most likely hamper decode performance severely. [](#h.3hv3as2oq0r2) Constant Quality Recommended Settings -------------------------------------------------------------- Objective is to achieve a constant (perceptual) quality level without regard to bitrate. (Note that Constant Quality differs from Constrained Quality, described below.) ffmpeg -i -c:v libvpx-vp9 -pass 1 -b:v 0 -crf 33 -threads 8 -speed 4 \\  -tile-columns 6 -frame-parallel 1 \\  -an -f webm /dev/null  ffmpeg -i -c:v libvpx-vp9 -pass 2 -b:v 0 -crf 33 -threads 8 -speed 2 \\  -tile-columns 6 -frame-parallel 1 -auto-alt-ref 1 -lag-in-frames 25 \\  -c:a libopus -b:a 64k -f webm out.webm crf is the quality value (0-63 for VP9). To trigger this mode, you must use a combination of crf and b:v 0. bv MUST be 0. [](#h.5bf9tygxh7p5) Constrained Quality Recommended Settings ----------------------------------------------------------------- Objective is to achieve a constant (perceptual) quality level as long as the bitrate achieved is below a specified upper bound. [Constrained Quality](http://www.webmproject.org/docs/encoder-parameters/#vbr-cbr-and-cq-mode) is useful for bulk encoding large sets of videos in a generally consistent fashion. ffmpeg -i -c:v libvpx-vp9 -pass 1 -b:v 1400K -crf 23 -threads 8 -speed 4 \\  -tile-columns 6 -frame-parallel 1 \\  -an -f webm /dev/null  ffmpeg -i -c:v libvpx-vp9 -pass 2 -b:v 1400K -crf 23 -threads 8 -speed 2 \\  -tile-columns 6 -frame-parallel 1 -auto-alt-ref 1 -lag-in-frames 25 \\  -c:a libopus -b:a 64k -f webm out.webm The quality desired is provided as the crf parameter and the bitrate upper bound is provided as the b:v parameter, where bitrate MUST be non-zero. Both crf and b:v MUST be provided. In this mode, bitrate control will kick in for difficult videos, where the quality specified cannot be achieved within the given bitrate. For easy videos, this mode behaves exactly like the constant quality mode, and the actual bitrate achieved can be much lower than the specified bitrate in the b:v parameter. One caveat in FFMpeg is that if you do not provide the b:v parameter, FFMpeg will assume a default target bitrate of 256K -- so the constrained quality mode will be triggered with a potentially very low target bitrate. Report abuse Page details Page updated Report abuse --- # wiki - Compiling with libvpx support Search this site Embedded Files Skip to main content Skip to navigation Compiling with libvpx support ============================= ### [](#h.2tsvamg99kaa) Objective Build ffmpeg with libvpx support, on Linux, OSX and Windows7 ### [](#h.4bl61milkm3v) Dependencies * [ffmpeg](http://ffmpeg.org/) depends on [yasm](http://www.tortall.net/projects/yasm/) or [nasm](https://nasm.us/) * [libvpx](http://www.webmproject.org/code/#libvpx-the-vp8-codec-sdk) depends on [libvorbis](http://xiph.org/vorbis/) * libvorbis depends on [libogg](http://www.xiph.org/ogg/) * (Optional) [ffplay](http://ffmpeg.org/ffplay.html) , if not disabled at configure time, will be built if [libsdl](http://www.libsdl.org/) is installed [](#h.ng3e8cgmzs6) Linux and OSX ------------------------------------- Updated 2013-05-14 ### [](#h.9m8nsdwh5jke) Systems Tested * Mac OSX 10.8.3 * Ubuntu 12.04 (Linux kernel 3.2.5) Tools Needed * git * tar / gzip * wget * a build environment ### [](#h.yia0q6ytej0r) Begin Note: Commands preceded by # (hash) should be invoked with root privileges, perhaps using sudo. Create a workspace in $HOME: mkdir ~/src ### [](#h.hcrl37s8vjua) yasm cd ~/src git clone git://github.com/yasm/yasm.git cd yasm ./autogen.sh make \# make install ### [](#h.ys50ttdngq9e) libogg cd ~src wget http://downloads.xiph.org/releases/ogg/libogg-1.3.0.tar.gz tar xzvf libogg-1.3.0.tar.gz cd libogg-1.3.0 ./configure --disable-shared make \# make install ### [](#h.3yhhrrdb9fxp) libvorbis cd ~/src wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.3.tar.gz tar xzvf libvorbis-1.3.3.tar.gz cd libvorbis-1.3.3 ./configure --disable-shared make \# make install ### [](#h.98exk2kpxhqp) libvpx cd ~/src git clone https://chromium.googlesource.com/webm/libvpx cd libvpx ./configure make \# make install ### [](#h.wv7uf5xwqoki) libsdl (optional) cd ~/src wget http://www.libsdl.org/release/SDL-1.2.15.tar.gz tar xzvf SDL-1.2.15.tar.gz cd SDL-1.2.15 ./configure make \# make install ### [](#h.7be9e5wbh6xc) ffmpeg cd ~/src git clone git://source.ffmpeg.org/ffmpeg.git cd ffmpeg ./configure --enable-libvpx --enable-libvorbis make \# make install [](#h.5kohgvv1pm95) MS Windows 7 ------------------------------------- Updated 2013-05-16 ### [](#h.l2e24z42i6ed) Systems Tested Windows 7 Home Premium 64-bit (SP1) ### [](#h.wo4bhr1vyead) Tools Needed python git MinGW/MSYS wget ### [](#h.huha5nv9rqb7) Python Python doesn't ship with Windows 7, and configure scripts below will require it. Download and run a current Python 2.x installer: [http://www.python.org/getit/](http://www.python.org/getit/) Install Python for all users. Choose the default components. Install to c:\\python27 or similar. Add the Python executable to your $PATH: Computer > Properties > Advanced system settings > Environment Variables ... Locate and edit the System variable "Path". Append a semicolon (;) followed by the path to your python executable (perhaps c:\\python27). ### [](#h.regf0c2740at) git Download and run a current Git installer: [http://git-scm.com/downloads](http://git-scm.com/downloads) Choose the default components. Choose "Run Git from the Windows Command Prompt". Choose "Checkout as-is, commit Unix-style endings". Last choice is important. FFmpeg won't build if git changes line endings to crlf. ### [](#h.2t6slx2u78n1) MinGW/MSYS Download and run the MinGW+MSYS installer mingw-get-inst: [http://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/](http://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/) Install to c:\\mingw. Choose the default C compiler, MSYS Basic System, and MinGW Developer Toolkit. Begin Launch a MinGW shell (Start > MinGW > MinGW Shell). Create a workspace in $HOME: mkdir ~/src (This directory corresponds to C:\\MinGW\\msys\\1.0\\home\\\[username\]\\src) ### [](#h.ewymotl31mqn) wget Install wget with the following command: mingw-get install msys-wget ### [](#h.neyy7f67w0iq) yasm cd ~/src git clone git://github.com/yasm/yasm.git cd yasm ./autogen.sh --prefix=/mingw --target=x86\_64-win64-gcc make make install ### [](#h.al2s1c1bfg90) libogg cd ~/src wget http://downloads.xiph.org/releases/ogg/libogg-1.3.0.tar.gz tar xzvf libogg-1.3.0.tar.gz cd libogg-1.3.0 ./configure --prefix=/mingw --target=x86\_64-win64-gcc make make install ### [](#h.z0ewpjd3x36f) libvorbis cd ~/src wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.3.tar.gz tar xzvf libvorbis-1.3.3.tar.gz cd libvorbis-1.3.3 ./configure --prefix=/mingw --target=x86\_64-win64-gcc make make install ### [](#h.nxy61ybsl7sh) libvpx cd ~/src git clone https://chromium.googlesource.com/webm/libvpx cd libvpx ./configure --prefix=/mingw --target=x86\_64-win64-gcc make make install ### [](#h.75krl1nbxixq) libsdl (optional) cd ~/src wget http://www.libsdl.org/release/SDL-1.2.15.tar.gz tar xzvf SDL-1.2.15.tar.gz cd SDL-1.2.15 ./configure --prefix=/mingw --target=x86\_64-win64-gcc make make install ### [](#h.79je7kake1wn) ffmpeg cd ~/src git clone git://source.ffmpeg.org/ffmpeg.git cd ffmpeg ./configure --prefix=/mingw --target=x86\_64-win64-gcc --enable-libvpx --enable-libvorbis make make install Report abuse Page details Page updated Report abuse --- # wiki - Convert PNG frames to WebM video Search this site Embedded Files Skip to main content Skip to navigation Convert PNG frames to WebM video ================================ How to convert a sequence of PNG images to a VP8 WebM video.  This is handy for converting a rendered animation from, for example, [Blender](http://www.blender.org/) to WebM. To summarize the process: first we need to convert the PNG frames to a YUV4MPEG file, then vpxenc can encode that to a webm file. On Ubuntu Linux   1. Install the mjpegtools package - this gives you the png2yuv command.  ([MJPEG Tools project](http://mjpeg.sourceforge.net/) )   2. Install the vpx-tools package - this gives you the vpxenc command.  (Note: vpxenc is part of the official [VP8 SDK](http://www.webmproject.org/tools/#vp8-sdk) .)   3. Use png2yuv to convert the frames to a YUV4MPEG file (aka Y4M, I420 or IYUV).  For example: png2yuv -I p -f 24 -b 1 -n 1440 -j big\_buck\_bunny\_%05d.png > my.yuv Let's break that down: * * \-I p    Non-interlaced. * \-f 24  24 frames per second. * \-b 1    Start with image number 1. * \-n 1440  The number of images to process. * \-j big\_buck\_bunny\_%05d.png   The file name pattern.  %05d is the expanded to 00001, 00002, ..., 01440.  %03d would expand to 001, 002, etc. * \> my.yuv  Send output to a file instead of dumping it to your console screen.   4. Encode the YUV file with with vpxenc.  For example: vpxenc --good --cpu-used=0 --auto-alt-ref=1 --lag-in-frames=16 --end-usage=vbr --passes=2 --threads=2 --target-bitrate=3000 -o my.webm my.yuv This will output a file my.webm.  Perhaps the most important option above is --target-bitrate.  This is your primary control for the file size (lower bitrate, smaller file).  For details on the other encoding options please refer to the [VP8 Encoder Parameter Guidelines](http://www.webmproject.org/tools/encoder-parameters/#10-sample-command-lines) . Windows Use the same commands as for Linux (above).  The only difference should be where you get the tools: * * The [MJPEG Tools project](http://mjpeg.sourceforge.net/) provides binaries for Windows (get the one with mingw-bin in it's name). * vpxenc.exe can be found in bin/Win32 of the pre-built Visual Studio zip on the [webm downloads page](http://code.google.com/p/webm/downloads/list) .  (eg vpx-vp8-debug-src-x86-win32mt-vs9-v1.1.0.zip) Happy encoding! Report abuse Page details Page updated Report abuse --- # wiki - HOWTOs Search this site Embedded Files Skip to main content Skip to navigation HOWTOs ====== This section is place for guides and "recipes" for working with WebM. Report abuse Page details Page updated Report abuse --- # wiki - Software Search this site Embedded Files Skip to main content Skip to navigation Software ======== Report abuse Page details Page updated Report abuse --- # wiki - SoCs Supporting VP8/VP9 Search this site Embedded Files Skip to main content Skip to navigation SoCs Supporting VP8/VP9 ======================= ### [](#h.82lostsc19uc) Systems with dedicated VP8/VP9 support Some System-on-a-Chip (SoC) manufacturers have added support for VP8/VP9 decoding (and in some cases encoding) directly to their SoC. In theory these systems should out-perform systems without dedicated hardware both in terms of speed and power usage. Note that the [embedded spreadsheet](http://goo.gl/dUVxCr) shown below has separate tabs for VP8 and VP9. Report abuse Page details Page updated Report abuse --- # wiki - VP9 Known Issues Search this site Embedded Files Skip to main content Skip to navigation VP9 Known Issues ================ While the VP9 bitstream design is finalized, work to optimize the VP9 tools provided in libvpx continues. At the current stage of development, the following features and functionality are intentionally disabled or unfinished: vpxenc * * Speed optimizations continue. Expect slow performance. Report abuse Page details Page updated Report abuse --- # wiki - Spherical Video RFC (draft) Search this site Embedded Files Skip to main content Skip to navigation Spherical Video RFC (draft) =========================== 2015-02-26: This RFC has been moved to the GitHub project [google/spatial-media](https://github.com/google/spatial-media) . Pull requests are welcome. Report abuse Page details Page updated Report abuse --- # wiki - VP9 Search this site Embedded Files Skip to main content Skip to navigation VP9 === Post date: Aug 26, 2013 6:16:21 PM Report abuse Page details Page updated Report abuse --- # wiki - WebP Search this site Embedded Files Skip to main content Skip to navigation WebP ==== Browsers Platform Graphics Software Libraries Tools Report abuse Page details Page updated Report abuse --- # wiki - WebM Search this site Embedded Files Skip to main content Skip to navigation WebM ==== Browsers \[1\]Requires [WebM Media Foundation Components](http://www.webmproject.org/ie/) . Encoders Platform Tools Video Editors Video Players \[1\]Requires [WebM Media Foundation Components](http://www.webmproject.org/ie/) . \[2\]Requires [WebM DirectShow Filter](http://www.webmproject.org/tools/#directshow_filters) Report abuse Page details Page updated Report abuse --- # wiki - WebM Metadata Search this site Embedded Files Skip to main content Skip to navigation WebM Metadata ============= * [Global Metadata](/webm-metadata/global-metadata) * [Temporal Metadata](/webm-metadata/temporal-metadata) (reserved) * [WebVTT in WebM](/webm-metadata/temporal-metadata/webvtt-in-webm) Report abuse Page details Page updated Report abuse --- # wiki - VP8 Implementations Search this site Embedded Files Skip to main content Skip to navigation VP8 Implementations =================== ### [](#h.vln68j57wz9g) Encoders Software Hardware ### [](#h.zfkgciruhttt) Decoders Software Hardware For ARM SoC with hardware support see ARM SoCs. Report abuse Page details Page updated Report abuse --- # wiki - Temporal Metadata Search this site Embedded Files Skip to main content Skip to navigation Temporal Metadata ================= \[Reserved\] Prior content moved to [WebVTT in WebM](/webm-metadata/temporal-metadata/webvtt-in-webm) Report abuse Page details Page updated Report abuse --- # wiki - VP9 CodecPrivate Search this site Embedded Files Skip to main content Skip to navigation VP9 CodecPrivate ================ Please see [https://www.webmproject.org/docs/container/#vp9-codec-feature-metadata-codecprivate](https://www.webmproject.org/docs/container/#vp9-codec-feature-metadata-codecprivate) Report abuse Page details Page updated Report abuse --- # wiki - WebVTT Metadata Search this site Embedded Files Skip to main content Skip to navigation WebVTT Metadata =============== [](#h.k8p8jaslck3h) WebVTT Metadata Common To WebM ======================================================= Objective The purpose of this document is to describe WebVTT metadata that are useful in the context of WebM. Background See [WebVTT in WebM](/webm-metadata/temporal-metadata/webvtt-in-webm) for general background notes. Metadata Format It has been proposed that file-wide metadata (see \[DEV\] or \[CHANGE\]) be stored at the top of the WebVTT file, and formatted as UNIX-style name-value pairs. This has been refined based on discussion on the webm-discuss and public-testtracks mailing lists \[WEBMDISCUSS\]\[W3\] to look like the following: WEBVTT VTTKind: metadata VTTDataFormat: VTTDataHint: 1 00:00:15.000 --> 00:00:17.950 first cue GPS Data (GeoJSON) A WebVTT file containing GPS coordinates could be used with e.g., Google Maps or Earth, to give location information while playing back a WebM video. Using a payload that is conducive to use in JavaScript will simplify the parsing of the WebVTT file. The file-wide metadata used in this case would be: WEBVTT VTTKind: metadata VTTDataFormat: GeoJSON VTTDataHint: GPS data With the payload of each cue would being the GeoJSON itself \[GeoJSON\]. 00:00.000 --> 00:01.000 {     "type":"Feature",     "id":"OpenLayers.Feature.Vector\_314",     "properties":{},     "geometry":{ "type":"Point", "coordinates":\[97.03125, 39.7265625\] },     "crs":{         "type":"OGC",         "properties":{ "urn":"urn:ogc:def:crs:OGC:1.3:CRS84" }     } } Outstanding Issues The format of WebVTT metadata is still in flux. The format described here could be used, however, within a element allowing the parsing to be done in JavaScript. References \[CHANGE\] [http://www.w3.org/WAI/PF/HTML/wiki/Media\_WebVTT\_Changes](http://www.w3.org/WAI/PF/HTML/wiki/Media_WebVTT_Changes) \[DEV\] [http://blog.gingertech.net/2011/06/27/recent-developments-around-webvtt/](http://blog.gingertech.net/2011/06/27/recent-developments-around-webvtt/) \[WEBMDISCUSS\] [https://groups.google.com/a/webmproject.org/d/topic/webm-discuss/N\_g0xchnFM8/discussion](https://groups.google.com/a/webmproject.org/d/topic/webm-discuss/N_g0xchnFM8/discussion) \[W3\] [http://lists.w3.org/Archives/Public/public-texttracks/2012Apr/0011.html](http://lists.w3.org/Archives/Public/public-texttracks/2012Apr/0011.html) \[GEOJSON\] [http://en.wikipedia.org/wiki/GeoJSON](http://en.wikipedia.org/wiki/GeoJSON) Report abuse Page details Page updated Report abuse --- # wiki - VP9 Tips Search this site Embedded Files Skip to main content Skip to navigation VP9 Tips ======== [](#h.977c1ohekki5) Encoding Modes and Recommended Command Line Options ---------------------------------------------------------------------------- 1. Configure libvpx with no parameters (works on most platforms): 1. configure 2. If you encounter any issues, use: * 1. configure --disable-unit-tests 3. Build * 1. make -j16 ### [](#h.q76thyv0amt4) Encoding Control bitrate mode (achieves a given target bitrate): vpxenc -o --codec=vp9 --cpu-used=0 \\   --target\_bitrate= --kf-max-dist= Constant quality mode (achieves a given quality level): vpxenc -o --codec=vp9 --cpu-used=0 \\   --end-usage=3 --cq-level= \\   --kf-max-dist= Constrained Quality mode (Achieves a given quality level subject to an upper bound on bitrate): vpxenc -o --codec=vp9 --cpu-used=0 \\   --end-usage=2 --cq-level= \\   --target-bitrate= --kf-max-dist= ### [](#h.536n5gdcq4dd) Decoding vpxdec --progress --codec=vp9 -o /tmp/football\_vp9.y4m /tmp/football.webm Report abuse Page details Page updated Report abuse --- # wiki - Xcode: Working with libvpx Search this site Embedded Files Skip to main content Skip to navigation Xcode: Working with libvpx ========================== This guide explains the steps required to build libvpx examples and to debug libvpx using Xcode. [](#h.buaqwemr4iys) Step 1: Build VPX.framework ---------------------------------------------------- This process is vastly simplified by using build/make/iosbuild.sh to produce a framework containing all necessary libvpx targets. The iOS simulator targets used to build the framework are basically identical to the Darwin targets that would be used for normal development builds of libvpx on Mac OS X. 1. Open a terminal window. 2. Create a directory in which to build the framework. 3. From within the directory just created:      $ path/to/libvpx/build/make/iosbuild.sh --extra-configure-args --disable-webm-io ### [](#h.jvkk2h5ge1i9) Notes 1. WebM IO is disabled to keep this guide simple. 2. Additional arguments are required if you wish to be able to step into libvpx with the debugger:      $ path/to/libvpx/build/make/iosbuild.sh \\        --extra-configure-args "--disable-webm-io --enable-debug" [](#h.2exu368sxdpi) Step 2: Build a libvpx Example ------------------------------------------------------- Create a new command line tool project in Xcode, and: 1. Excluding files whose names start with webm, vpxdec, and vpxenc, add all .c and .h files from the root of the libvpx repository to the new project. * This is more than is necessary for any single example, but is harmless and keeps this guide short and simple (and ensures it works for most examples). 2. Add VPX.framework to the project. 3. Select an example to build, and add it to the project. * This can be vpxdec.c, vpxenc.c, or most of the files in the examples directory within the libvpx repository: * vp8\_multi\_resolution\_encoder.c requires libyuv, which is well beyond the scope of this guide. * vp9\_spatial\_svc\_encoder.c requires that additional undocumented flags are passed via \--extra-configure-args when building VPX.framework. 4. Add the path to the Headers directory within VPX.framework to User Header Search Paths in your Xcode project settings, and make it recursive. * Mine is /Users/tomfinegan/libvpx/framework/VPX.framework/Headers * This is required because libvpx examples don't know anything about VPX.framework. If all that is desired is the ability to build and hack on the examples, you're now done.  [](#h.msfuakxj2ikb) Step 3: Debugging (Optional) ----------------------------------------------------- Debugging libvpx within Xcode can be achieved by setting breakpoints on calls into libvpx and stepping into those calls. Deeper breakpoints can be set by adding additional libvpx source files to the project: 1. Add a file as you normally would. 2. Uncheck the box that adds the file to the current target. * The files will not compile, and would cause duplicate symbol linker errors anyway. 3. Set command line args for the current example (all examples define a usage() function, documenting required arguments). 4. Debug as you normally would. Report abuse Page details Page updated Report abuse --- # wiki - zz-obsolete Search this site Embedded Files Skip to main content Skip to navigation zz-obsolete =========== Report abuse Page details Page updated Report abuse --- # wiki - WebVTT in WebM Search this site Embedded Files Skip to main content Skip to navigation WebVTT in WebM ============== [](#h.ylpylzl90j61) Embedding WebVTT In WebM ================================================= 2012-02-01 (Revised) by: [Matthew Heaney](mailto:matthewjheaney@google.com) and [Frank Galligan](mailto:fgalligan@google.com) [](#h.1cjp62yerpl) Objective --------------------------------- The purpose of this document is to specify a mechanism for embedding WebVTT in a WebM file. [](#h.ymqn832bqnew) Background ----------------------------------- WebVTT is a standard for subtitles, captions, and related timed metadata.  A web media text track comprises a set of [cues](http://dev.w3.org/html5/webvtt/#webvtt-cue) , each of which has an optional identifier, timestamp, optional settings, and the actual payload text. The cues are listed in a dedicated WebVTT file (having the .vtt file extension by convention) that is associated with a web media file using the src and kind attributes of the HTML5 track element. WebM is a media standard for web video.  Its container format is based on Matroska and there are separate tracks for video and audio.  There is interest in embedding the contents of a WebVTT file inside a WebM file, so that the video text track does not have to be carried out-of-band, separate from the video itself. [](#h.pqy6nfws2ui3) Design Ideas ------------------------------------- Our goal is to embed the contents of a WebVTT file in a WebM file, in a way that preserves the information from each cue, and without too much disruption to the container standard. A WebVTT cue is a set of lines of text comprising an optional identifier, a timestamp and optional settings, followed by the payload.  The payload is the text of the subtitle or caption, chapter title, or metadata.   ### [](#h.eh21f6adwec3) Why using SRT is not a viable option This format is actually very similar to the SubRip file format \[SRT\].  Matroska already supports embedded SRT subtitles as a track (see \[MKVSRT\]), by embedding just the SRT payload as the data portion of a block. However, this exact approach might not be suitable for WebVTT because: * Timestamps are (optionally) annotated with additional settings, such as the position and orientation of the text. * WebVTT cue identifiers are optional; SRT cue identifiers are required. However, WebVTT cues can include arbitrary text – unlike SRT identifiers, which are numeric only. This means that Web VTT identifier values may be useful and must therefore be stored. * The arrow symbol ("-->") on the timestamp line of the cue is distinguished.  It is not allowed to appear on the cue identifier line, and must appear on the timestamp line, in order to determine whether the cue identifier is present. ### [](#h.2ziuyp64gcgb) Storing WebVTT data in a WebM Track The contents of the WebVTT file is stored as its own WebM track.  The information that would appear as attributes of the HTML5 track tag can be embedded in WebM Track element as follows: * The TrackType sub-element value is 0x11 for WebVTT SUBTITLES and CAPTIONS, and 0x21 for WebVTT DESCRIPTIONS, and METADATA. * The label attribute is stored as the Name sub-element. * The srclang attribute is stored as the Language sub-element. Per the convention (see \[MKVCODECID\]) used for flavors of a particular video or audio codec, the CodecID for a WebVTT track is "D\_WEBVTT/kind", where kind is one of SUBTITLES, CAPTIONS, DESCRIPTIONS, or METADATA. ### [](#h.k6kwzwphpv5y) Storing WebVTT cue in a WebM Block The WebVTT cues are stored as the data portion of Block elements in the track, per the formatting described below. All WebVTT data stored within a WebM Block must be encoded as UTF-8. The timestamp of the WebM block and its duration are synthesized from the start and end times specified on the timestamp of the WebVTT cue.  A BlockGroup element (not a SimpleBlock) must be used to contain the Block element, in order to also use a BlockDuration element, which is necessary to losslessly encode the original timestamp of the WebVTT cue. If the [WebVTT cue](http://dev.w3.org/html5/webvtt/#webvtt-cue) includes a [WebVTT cue identifier](http://dev.w3.org/html5/webvtt/#webvtt-cue-identifier) then the [WebVTT cue identifier](http://dev.w3.org/html5/webvtt/#webvtt-cue-identifier) is written to the WebM Block followed by a [WebVTT line terminator](http://dev.w3.org/html5/webvtt/#webvtt-line-terminator) . If the [WebVTT cue](http://dev.w3.org/html5/webvtt/#webvtt-cue) does not have a [WebVTT cue identifier](http://dev.w3.org/html5/webvtt/#webvtt-cue-identifier) then a [WebVTT line terminator](http://dev.w3.org/html5/webvtt/#webvtt-line-terminator) is written to the WebM Block. The empty line is used to distinguish that there was no [WebVTT cue identifier](http://dev.w3.org/html5/webvtt/#webvtt-cue-identifier) in the original [WebVTT cue](http://dev.w3.org/html5/webvtt/#webvtt-cue) .  The [WebVTT cue timings](http://dev.w3.org/html5/webvtt/#webvtt-cue-timings) is not written to the WebM Block. The start and end time of the [WebVTT cue](http://dev.w3.org/html5/webvtt/#webvtt-cue) is synthesized from the start time and duration of the WebM Block.  If the [WebVTT cue](http://dev.w3.org/html5/webvtt/#webvtt-cue) includes a [WebVTT cue settings](http://dev.w3.org/html5/webvtt/#webvtt-cue-settings) then the [WebVTT cue settings](http://dev.w3.org/html5/webvtt/#webvtt-cue-settings) is written to the WebM Block followed by a [WebVTT line terminator](http://dev.w3.org/html5/webvtt/#webvtt-line-terminator) . If the [WebVTT cue](http://dev.w3.org/html5/webvtt/#webvtt-cue)   does not have a [WebVTT cue settings](http://dev.w3.org/html5/webvtt/#webvtt-cue-settings) then a [WebVTT line terminator](http://dev.w3.org/html5/webvtt/#webvtt-line-terminator) is written to the WebM Block. The [cue payload](http://dev.w3.org/html5/webvtt/#cue-payload) is then written to the WebM Block. ### [](#h.40boepf73u75) General Notes Note that no WebVTT data is stored in the CodecPrivate element of the WebM Track header.  All WebVTT cues are stored as Block elements for the track. The timestamps for WebVTT cues can overlap in time.  This is how roll-up captions work: multiple cues are rendered simultaneously, and when the top cue expires, the other cues move up and a new cue appears at the bottom.  The WebM block timestamps must therefore be allowed to be monotonically increasing (a requirement already needed for the WebM container to support VP8 alt-ref frames), and the duration for a block must be allowed to overlap the start time of the next block. ### [](#h.ayrcwh5g85c6) WebVTT Chapter cues WebVTT chapter cues are used for navigation and so they are handled differently, because they must all be together and immediately available.  For this reason, WebVTT chapter cues should not be embedded the same as for timed cues (a representation that would vitiate their use for navigation); instead they should be converted to Matroska chapters (see \[MKVCHAP\]) and embedded that way.  Matroska chapters are a superset of WebVTT chapter cues and therefore the conversion is lossless. [](#h.sb17qrm4cjle) Alternatives Considered ------------------------------------------------ Representation of Block Payload The simplest method for storing the WebVTT cue would be to embed the entire cue as the data portion of the Block element.  However, we cannot do this, because it would then be impossible to change the block timestamps when the track is edited, as this would cause the timestamp of the cue (embedded as the block payload) to get out of sync with the timestamp of its enclosing block.  We must satisfy the design constraint that video editors be allowed to manipulate WebM tracks without necessarily having intimate knowledge of the track’s codec (here, WebVTT). For this reason, the start and end timestamps of the cue need to be stripped from the timestamp line when embedding the WebVTT cue in the WebM block.  The arrow symbol remains (as it must, to determine whether a cue identifier is present), but there are no actual time values on the timestamp line. This should not cause too much pain for muxers, because they must parse WebVTT cues anyway in order to synthesize the time and duration of the WebM block. Demuxers will have to hand the timestamp and block payload off to some WebVTT-aware component in order for it to be "decoded", but this no different from what any demuxer must do; the only thing different is the codec. Placement of WebVTT Cues The WebVTT file content could be stored in the CodecPrivate element of the track. This could be useful for situations that require all of cues to be together, such as for chapter cues.  This storage location could also be used for the file-wide metadata that precedes the actual WebVTT cues (see below). However, putting any payload in the CodecPrivate area would make the payload very brittle, in the sense that it can break too easily during editing or remuxing. SRT-style Embedding of Cue Payload An alternative is for the muxer to fully parse each WebVTT cue, embed the payload the same as for SRT (the cue payload only as the data part of the Block element), and use the BlockAdditions element to store the cue identifier and cue settings. The advantage of this approach is that the information associated with a cue would already be in binary form, so in principle this would make it simpler for parsers or other downstream clients that must also parse the WebVTT cues.  (But then again, they might also prefer to use the text as is, so perhaps this is not much of an advantage.)  There might be a storage penalty however, because Matroska elements do have a certain amount of overhead. The disadvantage is that this ties WebM more closely to WebVTT, since any changes to the WebVTT standard would have to be matched with concomitant changes to the WebM standard; blob-style embedding avoids this. [](#h.sy9vsx5nqzp6) Outstanding Issues ------------------------------------------- Live Chapter Cues Live WebVTT chapter cues are used to mark the place in the stream where a special event has occurred (e.g. this is a live presentation of a football match, and the striker has just scored a goal, and so a chapter cue is inserted in the stream). This may be better handled with standardized temporal metadata that would add a chapter point that references time in the past. This way no latency would have to be added for the purpose of a human adding a live chapter cue. File-Wide Metadata It has been proposed that file-wide metadata (see \[DEV\] or \[CHANGE\]) be stored at the top of the WebVTT file, and formatted as UNIX-style name-value pairs: WEBVTT Language=zh Kind=Caption Version=V1\_ABC License=CC-BY-SA 1 00:00:15.000 --> 00:00:17.950 first cue File-wide metadata does not have a timestamp, so all the text (up to and excluding the linefeed separator that demarcates the file-wide metadata and the first cue) could be stored in the CodecPrivate sub-element of the Track element. Note that a metadata cue \[META\] is the same as other WebVTT cues, with the difference that the text has no particular interpretation, except as generic text. Default Cue Settings The cue settings are attached to the timestamp line, and it has been suggested (see \[DEV\] or \[CHANGE\]) that the syntax be modified to allow for default cue settings to be specified.  The timestamp line retains the distinguished arrow symbol ("-->"), but the actual timestamps are omitted: WEBVTT DEFAULTS --> D:vertical A:end 00:00.000 --> 00:02.000 This is vertical and end-aligned. Block elements must have a timestamp value, so it’s not clear how this cue should be embedded in the WebM stream. One idea is to use the start time of following cue, and embed the cue as a Block either within a BlockGroup that omits the BlockDuration element, or simply use a SimpleBlock element instead (possible here because no BlockDuration need be present).   Another idea is to embed both the default settings cue in the same block as the following (normal) cue. This might complicate the demuxer, though, since there is no longer a one-to-one correspondence between a WebVTT cue and a WebM block. Inline CSS and Comments could be handled similarly. The presence of default cue settings implies that the state of the subtitle rendering system depends on everything that has come before (at least, what default cue settings have come before).  One problem is that seeking into the middle of the stream will break the rendering, because the seek will skip over cues that potentially specify new default settings. Assuming that seeking is desired, there are at least a couple of ways to handle this.  One way is to simply not write any default settings cues into the WebM track.  Instead, write the settings explicitly, in the normal way, on the same line as the timestamp.  If a cue overrides the default, then that value would be preserved; otherwise, write the current default value. Another way is to write a default settings cue that is the union of all current defaults, whenever you write a block that is the target of a WebM Cue (typically a video keyframe).  A muxer will have to make similar arrangements anyway, to ensure that the WebVTT cues associated with a video frame are placed on the same cluster as the frame itself (similar to the same rule we have for audio). In both cases, the muxer will have to a be WebVTT interpreter too, since each cue will need to be parsed to determine whether it specifies a default settings cue, and then actual default settings will need to be parsed. Yet another possibility is that the default settings cues could be embedded separately, in a different part of the file, say in the CodecPrivate area.  During the demuxing phase, the original stream of cues could be reconstituted from the set of settings cues and the normal cues.  This still means more work for the muxer, however, because it must parse enough of the cue to determine what kind of cue it is, and then parse the settings too.  (No matter what, the muxer will need to parse the timestamp of the cue, in order to synthesize the timestamp of the block, so perhaps the extra parsing is not too much of a greater burden.) Metadata Format WebVTT has explicit support for a metadata track, but it’s not clear exactly what WebVTT metadata looks like.  Is it name/value pairs?  In any event, WebM will probably have to standardize a few of the names, no matter how it is formatted. There might also be interest in supporting XMP (see \[XMP1CORE\] and \[XMP2PROP\]), RDF (see for example \[RDF\]), JSON, or some other stylized form of metadata the payload of a metadata cue.  For example, it might be possible to embed, say, the GPS coordinates of the video track using XMP as follows: \-->               42/1,50/1,5427/100        73/1,45/1,2272/100        N        W        (In this example, it’s not clear whether the markup needs to escaped using the standard ampersand sequence.) Of course if you’re only interest is in GPS data, then an XMP representation might have too much storage overhead, and a plain WebVTT metadata cue, using name/value pairs, might be adequate.  Following a Vorbis comment example (see "Geo Location fields" in \[OGGCOMM\]), it would look something like: \--> GEO\_LOCATION=42.84;-73.75 See \[GEO\] for more information about GPS microformat. [](#h.z5q1m6wfwv3n) References ----------------------------------- \[WEBVTT\] WebVTT Living Standard (accessed 12 Jan 2012) [http://dev.w3.org/html5/webvtt/](http://dev.w3.org/html5/webvtt/) \[CHANGE\] [http://www.w3.org/WAI/PF/HTML/wiki/Media\_WebVTT\_Changes](http://www.w3.org/WAI/PF/HTML/wiki/Media_WebVTT_Changes) \[DEV\] [http://blog.gingertech.net/2011/06/27/recent-developments-around-webvtt/](http://blog.gingertech.net/2011/06/27/recent-developments-around-webvtt/) \[META\] [http://dev.w3.org/html5/webvtt/#webvtt-metadata-text](http://dev.w3.org/html5/webvtt/#webvtt-metadata-text) \[MKV\] [http://matroska.org/technical/specs/index.html](http://matroska.org/technical/specs/index.html) \[MKVSRT\] SRT Subtitles [http://www.matroska.org/technical/specs/subtitles/srt.html](http://www.matroska.org/technical/specs/subtitles/srt.html) \[MKVCODECID\]  Matroska Codec Specs [http://matroska.org/technical/specs/codecid/index.html](http://matroska.org/technical/specs/codecid/index.html) \[MKVCHAP\] [http://matroska.org/technical/specs/chapters/index.html](http://matroska.org/technical/specs/chapters/index.html) \[SRT\] SubRip [http://en.wikipedia.org/wiki/SubRip](http://en.wikipedia.org/wiki/SubRip) \[WEBM\] [http://www.webmproject.org/code/specs/container/](http://www.webmproject.org/code/specs/container/) \[XMP1CORE\] XMP Specification, Part 1, Data Model, Serialization, and Core Properties [http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/xmp/pdfs/XMPSpecificationPart1.pdf](http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/xmp/pdfs/XMPSpecificationPart1.pdf) \[XMP2PROP\] XMP Specification, Part 2, Additional Properties [http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/xmp/pdfs/XMPSpecificationPart2.pdf](http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/xmp/pdfs/XMPSpecificationPart2.pdf) \[RDF\] Embedding RDF in WebVTT [http://ninsuna.elis.ugent.be/node/39](http://ninsuna.elis.ugent.be/node/39) \[OGGCOMM\] [http://wiki.xiph.org/VorbisComment](http://wiki.xiph.org/VorbisComment) \[GEO\] [http://en.wikipedia.org/wiki/Geo\_(microformat)](http://en.wikipedia.org/wiki/Geo_%28microformat%29) [http://microformats.org/wiki/geo](http://microformats.org/wiki/geo) Report abuse Page details Page updated Report abuse --- # wiki - Webm Encryption RFC Search this site Embedded Files Skip to main content Skip to navigation Webm Encryption RFC =================== Please see [WebM Encryption](/encryption/webm-encryption) Report abuse Page details Page updated Report abuse --- # wiki - Instructions to Playback a WebM DASH Presentation [obsolete] Search this site Embedded Files Skip to main content Skip to navigation Instructions to Playback a WebM DASH Presentation \[obsolete\] ============================================================== [](#h.bxo556kb8r0i) Note: This page is obsolete and is here only for historic reference. For recommended instructions on how to adaptively stream WebM files using DASH, see this page: [http://wiki.webmproject.org/adaptive-streaming/instructions-to-playback-adaptive-webm-using-dash](http://wiki.webmproject.org/adaptive-streaming/instructions-to-playback-adaptive-webm-using-dash) ================================================================================================================================================================================================================================================================================================================================================================================================== [](#h.13fyg1dv08vc) 1\. Introduction ========================================= Typically today there are two different methods for delivering video over the Internet, RTSP and HTTP progressive download. Both have major shortcomings. RTSP is a stateful protocol that is hampered by connection issues and does not scale as easily as HTTP servers. HTTP progressive download cannot dynamically change the video as conditions on the client change. Client-side HTTP adaptive streaming addresses the major issues of the current delivery methods while retaining their redeeming features. The client as the end point in any streaming solution has better insight to what is happening within the system and the network. Therefore given different playback choices the client can make the most informed decisions on what to play so the user will have the best playback experience. Client-side adaptive streaming is what typically people think of when they hear adaptive streaming. There are many different formats for adaptive streaming, but usually they have one manifest file that describes how to retrieve the media data from an HTTP server. [](#h.m5zbode1rx3s) 2\. Creating Files for the Presentation ================================================================ [](#h.3ptwqfsm0d72) 2.1 Prerequisites ------------------------------------------ * FFmpeg * [http://ffmpeg.org/](http://ffmpeg.org/) * A newer version of FFmpeg with libvpx and libvorbis support. * libwebm * git clone [https://gerrit.chromium.org/gerrit/p/webm/libwebm.git](https://gerrit.chromium.org/gerrit/p/webm/libwebm.git) * You will need the sample\_muxer application that is created with the libwebm project. * TODO(fgalligan): Add patches to FFmpeg to remove dependency on sample\_muxer. * webm-tools * git clone [https://gerrit.chromium.org/gerrit/p/webm/webm-tools.git](https://gerrit.chromium.org/gerrit/p/webm/webm-tools.git) * You will need the webm\_dash\_manifest command line application. * \*Note\* Only tested on Linux and Windows. [](#h.m20u48m03yds) 2.2 WebM and DASH Manifest Files --------------------------------------------------------- ### [](#h.gu6y9dl2n0yf) 2.2.1 WebM DASH Manifest format DASH is the manifest format the WebM DASH javascript player uses. Here is a link to an informative specification of adding WebM files to DASH. [https://sites.google.com/a/webmproject.org/wiki/adaptive-streaming/webm-dash-specification](/adaptive-streaming/webm-dash-specification) ### [](#h.m4uu6q2pezw5) 2.2.2 WebM VOD adaptive streaming format The WebM files for video-on-demand (VOD) adaptive streaming are non-chunked files with only one stream per file. For more information on why this format was chosen see this page [http://wiki.webmproject.org/adaptive-streaming/webm-vod-baseline-format](http://wiki.webmproject.org/adaptive-streaming/webm-vod-baseline-format) . ### [](#h.ppeag7new6rd) 2.2.3 Differences from WebM Specification The only difference is the addition of a CUES element for all files. Currently most WebM files created have audio and video streams muxed with a seek index for the video stream key frames. The seek index is needed to get the best experience when switching streams. Without a seek index for a stream it may be close to impossible to switch the stream without having a discontinuity. Each WebM file will need to have its own seek index. ### [](#h.u5srivfnfn95) 2.2.4 Constraints imposed by the WebM DASH javascript player The current player only supports the [WebM On-Demand Profile](/adaptive-streaming/webm-dash-specification) . To switch video streams with the current player the video streams in an AdaptationSet must set @subsegmentStartsWithRAP \= 1, @segmentAlignmentFlag \= true, and @bitstreamSwitchingFlag \= true. What this means is that all WebM video streams within an AdaptationSet must have: * All Cuepoint timecodes match across the video streams. * All Clusters that are at sync points start with a key frame. * All TrackIDs match across the video streams. Currently only one audio stream is supported. ### [](#h.1sz3soadan8h) 2.2.5 Creating demuxed video streams for the WebM DASH javascript player \*NOTE\* If you want to change resolution you need to use Chrome with a version of 18.0.980.0 or higher. First step is to encode a video only WebM file. Below is a sample command line to create a video only WebM file with FFmpeg: ffmpeg -i ${SOURCE} -vcodec libvpx -vb 250k -keyint\_min 150 -g 150 -an ${FFMPEG\_VIDEO}.webm * \-i ${SOURCE} This is your source file. * \-vcodec libvpx This tells FFmpeg to use libvpx (VP8) as the video encoder. * \-vb 250k This tells FFmpeg to use 250 kilobits as the target datarate for the video encode. * \-keyint\_min 150 -g 150 This tells FFmpeg to use 150 frames as the minimum and maximum key frame interval. These values are used to align all of the sync points in the video streams to be switched. In the current WebM DASH javascript player these values must be identical. * \-an This tells FFmpeg to not output an audio stream. * ${FFMPEG\_VIDEO}.webm This is your output file. Unfortunately FFmpeg may not align the Cluster and Cues as needed by WebM DASH javascript player. The next step is to run encoded files through sample\_muxer to align the sync points across the video streams. Below is a sample command line for sample\_muxer to align the sync points: sample\_muxer -i ${FFMPEG\_VIDEO}.webm -o ${SAMPLE\_MUXER\_VIDEO}.webm At this point your video files should be ready to create the manifest file. ### [](#h.d43n1tdev7nt) 2.2.6 Creating demuxed audio stream for the WebM DASH javascript player First step is to encode an audio only WebM file. Below is a sample command line to create an audio only WebM file with FFmpeg: ffmpeg -i ${SOURCE} -vn -acodec libvorbis -ab 128k ${FFMPEG\_AUDIO}.webm * \-i ${SOURCE} This is your source file. * \-vn This tells FFmpeg to not output a video stream. * \-acodec libvorbis This tells FFmpeg to use libvorbis as the audio encoder. * \-ab 128k This tells FFmpeg to use 128 kilobits as the target datarate for the audio encode. * ${FFMPEG\_AUDIO}.webm This is your output file. The next step is to run your audio only WebM file through sample\_muxer to add a Cues element, change the track number to a value different than the track number for the video streams, and to set the cluster duration. The WebM DASH javascript player needs a Cues element in the audio file to download the audio data. The WebM DASH javascript player needs the audio WebM file to have a different track number than the video files because the Media Source API does not know how to handle separate files for audio and video streams. Below is a sample command line for sample\_muxer to create the audio files needed by the WebM DASH javascript player: sample\_muxer -i ${FFMPEG\_AUDIO}.webm -o ${SAMPLE\_MUXER\_AUDIO}.webm -output\_cues 1 -cues\_on\_audio\_track 1 -max\_cluster\_duration 5 -audio\_track\_number 2 * \-i ${FFMPEG\_AUDIO}.webm Input file. * \-o ${SAMPLE\_MUXER\_AUDIO}.webm Output file. * \-output\_cues 1 Tells sample\_muxer to output a Cues element. * \-cues\_on\_audio\_track 1 Tells sample\_muxer to output the Cues element on the audio track. * \-max\_cluster\_duration 5 Tells sample\_muxer to set the maximum cluster duration to 5 seconds. * \-audio\_track\_number 2 Tells sample\_muxer to set the audio track id to 2. At this point your audio file should be ready to create the manifest file. ### [](#h.oqgfq2wwq4og) 2.2.7 \*\*\*OPTIONAL\*\*\* Encrypting the video streams You can optionally encrypt the video streams to playback in Chrome version 22+. \*Note\* Currently Chrome can only decode encrypted video streams. The command line tool webm\_crypt is used to encrypt the video streams. The source code for webm\_crypt is in the webm\_crypt folder in the webm-tools project. To build webm\_crypt follow the instructions in readme.txt. The WebM DASH javascript player will only support video streams encrypted with the same key. The code will look for a key named key.bin in the same directory as dash\_player.js. The First step is to encrypt one of WebM video files. This will also generate a key file.  webm\_crypt -i ${FFMPEG\_VIDEO}.webm -o ${ENCRYPTED\_VIDEO}.webm The key file generated will be named vid\_base\_secret.key. Rename vid\_base\_secret.key to key.bin. Then encrypt all the rest of the WebM video files with the generated key file (i.e. key.bin) from the first encryption step. webm\_crypt -i ${FFMPEG\_VIDEO}.webm -o ${ENCRYPTED\_VIDEO}.webm -video\_options base\_file=key.bin Then when creating the manifest file use the encrypted WebM video files. \*NOTE\* To enable playback of the encrypted content you can turn support on via entering “chrome://flags/” in the browser and scrolling down to you see "Enable Encrypted Media Extensions on