2018-08-16 00:35:22 +00:00
|
|
|
|
|
2020-01-22 00:59:16 +00:00
|
|
|
|
<!DOCTYPE html>
|
2018-08-16 00:35:22 +00:00
|
|
|
|
|
2021-04-10 04:00:37 +00:00
|
|
|
|
<html>
|
2018-08-16 00:35:22 +00:00
|
|
|
|
<head>
|
2020-01-22 00:59:16 +00:00
|
|
|
|
<meta charset="utf-8" />
|
2021-06-22 00:16:40 +00:00
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
|
|
|
|
|
|
2018-08-16 00:35:22 +00:00
|
|
|
|
<title>Ad Insertion — Shaka Packager documentation</title>
|
2021-06-22 00:16:40 +00:00
|
|
|
|
<link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="../_static/sphinxdoc_new.css" />
|
2020-01-22 00:59:16 +00:00
|
|
|
|
<link rel="stylesheet" type="text/css" href="../_static/graphviz.css" />
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="../_static/table_styling.css" />
|
2021-06-22 00:16:40 +00:00
|
|
|
|
<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
|
2021-04-10 04:00:37 +00:00
|
|
|
|
<script src="../_static/jquery.js"></script>
|
|
|
|
|
<script src="../_static/underscore.js"></script>
|
|
|
|
|
<script src="../_static/doctools.js"></script>
|
2018-08-16 00:35:22 +00:00
|
|
|
|
<link rel="index" title="Index" href="../genindex.html" />
|
2018-08-20 17:47:59 +00:00
|
|
|
|
<link rel="search" title="Search" href="../search.html" />
|
|
|
|
|
<link rel="next" title="FFmpeg piping" href="ffmpeg_piping.html" />
|
2021-04-10 04:00:37 +00:00
|
|
|
|
<link rel="prev" title="Text output formats" href="text.html" />
|
2020-01-22 00:59:16 +00:00
|
|
|
|
</head><body>
|
2018-08-16 00:35:22 +00:00
|
|
|
|
<div class="related" role="navigation" aria-label="related navigation">
|
|
|
|
|
<h3>Navigation</h3>
|
|
|
|
|
<ul>
|
|
|
|
|
<li class="right" style="margin-right: 10px">
|
|
|
|
|
<a href="../genindex.html" title="General Index"
|
|
|
|
|
accesskey="I">index</a></li>
|
2018-08-20 17:47:59 +00:00
|
|
|
|
<li class="right" >
|
|
|
|
|
<a href="ffmpeg_piping.html" title="FFmpeg piping"
|
|
|
|
|
accesskey="N">next</a> |</li>
|
|
|
|
|
<li class="right" >
|
2021-04-10 04:00:37 +00:00
|
|
|
|
<a href="text.html" title="Text output formats"
|
2018-08-20 17:47:59 +00:00
|
|
|
|
accesskey="P">previous</a> |</li>
|
|
|
|
|
<li class="nav-item nav-item-0"><a href="../index.html">Shaka Packager documentation</a> »</li>
|
2021-04-10 04:00:37 +00:00
|
|
|
|
<li class="nav-item nav-item-1"><a href="tutorials.html" accesskey="U">Tutorials</a> »</li>
|
|
|
|
|
<li class="nav-item nav-item-this"><a href="">Ad Insertion</a></li>
|
2018-08-16 00:35:22 +00:00
|
|
|
|
</ul>
|
2021-04-10 04:00:37 +00:00
|
|
|
|
</div>
|
2018-08-16 00:35:22 +00:00
|
|
|
|
|
|
|
|
|
<div class="document">
|
|
|
|
|
<div class="documentwrapper">
|
|
|
|
|
<div class="bodywrapper">
|
|
|
|
|
<div class="body" role="main">
|
|
|
|
|
|
2021-06-22 00:16:40 +00:00
|
|
|
|
<section id="ad-insertion">
|
2018-08-16 00:35:22 +00:00
|
|
|
|
<h1>Ad Insertion<a class="headerlink" href="#ad-insertion" title="Permalink to this headline">¶</a></h1>
|
|
|
|
|
<p>Shaka Packager does not do Ad Insertion directly, but it can precondition
|
|
|
|
|
content for <a class="reference external" href="http://bit.ly/2KK10DD">Dynamic Ad Insertion</a> with Google Ad
|
|
|
|
|
Manager.</p>
|
|
|
|
|
<p>Both DASH and HLS are supported.</p>
|
2021-06-22 00:16:40 +00:00
|
|
|
|
<section id="synopsis">
|
2018-08-16 00:35:22 +00:00
|
|
|
|
<h2>Synopsis<a class="headerlink" href="#synopsis" title="Permalink to this headline">¶</a></h2>
|
2020-01-22 00:59:16 +00:00
|
|
|
|
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ packager <stream_descriptor> ... \
|
2018-08-16 00:35:22 +00:00
|
|
|
|
--ad_cues <start_time[;start_time]...> \
|
|
|
|
|
[Other options, e.g. DRM options, DASH options, HLS options]
|
|
|
|
|
</pre></div>
|
|
|
|
|
</div>
|
2021-06-22 00:16:40 +00:00
|
|
|
|
</section>
|
|
|
|
|
<section id="examples">
|
2018-08-16 00:35:22 +00:00
|
|
|
|
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
|
|
|
|
|
<p>The examples below use the H264 streams created in <a class="reference internal" href="encoding.html"><span class="doc">Media Encoding</span></a>.</p>
|
|
|
|
|
<p>Three midroll cue markers are inserted at 10 minutes, 30 minutes and 50 minutes
|
|
|
|
|
respectively.</p>
|
|
|
|
|
<ul>
|
2020-01-22 00:59:16 +00:00
|
|
|
|
<li><p>DASH with live profile:</p>
|
|
|
|
|
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ packager \
|
2018-08-16 00:35:22 +00:00
|
|
|
|
'in=h264_baseline_360p_600.mp4,stream=audio,init_segment=audio/init.mp4,segment_template=audio/$Number$.m4s' \
|
|
|
|
|
'in=input_text.vtt,stream=text,init_segment=text/init.mp4,segment_template=text/$Number$.m4s' \
|
|
|
|
|
'in=h264_baseline_360p_600.mp4,stream=video,init_segment=h264_360p/init.mp4,segment_template=h264_360p/$Number$.m4s' \
|
|
|
|
|
'in=h264_main_480p_1000.mp4,stream=video,init_segment=h264_480p/init.mp4,segment_template=h264_480p/$Number$.m4s' \
|
|
|
|
|
'in=h264_main_720p_3000.mp4,stream=video,init_segment=h264_720p/init.mp4,segment_template=h264_720p/$Number$.m4s' \
|
|
|
|
|
'in=h264_high_1080p_6000.mp4,stream=video,init_segment=h264_1080p/init.mp4,segment_template=h264_1080p/$Number$.m4s' \
|
|
|
|
|
--ad_cues 600;1800;3000 \
|
2020-01-22 00:59:16 +00:00
|
|
|
|
--generate_static_live_mpd --mpd_output h264.mpd
|
2018-08-16 00:35:22 +00:00
|
|
|
|
</pre></div>
|
|
|
|
|
</div>
|
|
|
|
|
</li>
|
2020-01-22 00:59:16 +00:00
|
|
|
|
<li><p>DASH with on-demand profile:</p>
|
|
|
|
|
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ packager \
|
2018-08-16 00:35:22 +00:00
|
|
|
|
in=h264_baseline_360p_600.mp4,stream=audio,output=audio.mp4 \
|
|
|
|
|
in=input_text.vtt,stream=text,output=output_text.mp4 \
|
|
|
|
|
in=h264_baseline_360p_600.mp4,stream=video,output=h264_360p.mp4 \
|
|
|
|
|
in=h264_main_480p_1000.mp4,stream=video,output=h264_480p.mp4 \
|
|
|
|
|
in=h264_main_720p_3000.mp4,stream=video,output=h264_720p.mp4 \
|
|
|
|
|
in=h264_high_1080p_6000.mp4,stream=video,output=h264_1080p.mp4 \
|
|
|
|
|
--ad_cues 600;1800;3000 \
|
|
|
|
|
--mpd_output h264.mpd
|
|
|
|
|
</pre></div>
|
|
|
|
|
</div>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
<p>This generates six single-segment media files, one per stream, spanning multiple
|
|
|
|
|
periods. There may be problems handling this type of DASH contents in some
|
|
|
|
|
players, although it is recommended by <a class="reference external" href="http://bit.ly/2B0HL9q">DASH IF IOP</a>.
|
|
|
|
|
Use the below option if your player does not like it.</p>
|
|
|
|
|
<ul>
|
2020-01-22 00:59:16 +00:00
|
|
|
|
<li><p>DASH with on-demand profile but one file per Period:</p>
|
|
|
|
|
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ packager \
|
2018-08-16 00:35:22 +00:00
|
|
|
|
'in=h264_baseline_360p_600.mp4,stream=audio,output=audio_$Number$.mp4' \
|
|
|
|
|
'in=input_text.vtt,stream=text,output=output_text_$Number$.mp4' \
|
|
|
|
|
'in=h264_baseline_360p_600.mp4,stream=video,output=h264_360p_$Number$.mp4' \
|
|
|
|
|
'in=h264_main_480p_1000.mp4,stream=video,output=h264_480p_$Number$.mp4' \
|
|
|
|
|
'in=h264_main_720p_3000.mp4,stream=video,output=h264_720p_$Number$.mp4' \
|
|
|
|
|
'in=h264_high_1080p_6000.mp4,stream=video,output=h264_1080p_$Number$.mp4' \
|
|
|
|
|
--ad_cues 600;1800;3000 \
|
|
|
|
|
--mpd_output h264.mpd
|
|
|
|
|
</pre></div>
|
|
|
|
|
</div>
|
|
|
|
|
</li>
|
2020-01-22 00:59:16 +00:00
|
|
|
|
<li><p>HLS using transport streams:</p>
|
|
|
|
|
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ packager \
|
2018-08-16 00:35:22 +00:00
|
|
|
|
'in=h264_baseline_360p_600.mp4,stream=audio,segment_template=audio_$Number$.aac' \
|
|
|
|
|
'in=input_text.vtt,stream=text,segment_template=output_text_$Number$.vtt' \
|
|
|
|
|
'in=h264_baseline_360p_600.mp4,stream=video,segment_template=h264_360p_$Number$.ts' \
|
|
|
|
|
'in=h264_main_480p_1000.mp4,stream=video,segment_template=h264_480p_$Number$.ts' \
|
|
|
|
|
'in=h264_main_720p_3000.mp4,stream=video,segment_template=h264_720p_$Number$.ts' \
|
|
|
|
|
'in=h264_high_1080p_6000.mp4,stream=video,segment_template=h264_1080p_$Number$.ts' \
|
|
|
|
|
--ad_cues 600;1800;3000 \
|
|
|
|
|
--hls_master_playlist_output h264_master.m3u8
|
|
|
|
|
</pre></div>
|
|
|
|
|
</div>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
2021-06-22 00:16:40 +00:00
|
|
|
|
</section>
|
|
|
|
|
<section id="configuration-options">
|
2018-08-20 17:47:59 +00:00
|
|
|
|
<h2>Configuration options<a class="headerlink" href="#configuration-options" title="Permalink to this headline">¶</a></h2>
|
2021-06-22 00:16:40 +00:00
|
|
|
|
<section id="ads-options">
|
2018-08-16 00:35:22 +00:00
|
|
|
|
<h3>Ads options<a class="headerlink" href="#ads-options" title="Permalink to this headline">¶</a></h3>
|
2020-01-22 00:59:16 +00:00
|
|
|
|
<dl class="option-list">
|
|
|
|
|
<dt><kbd><span class="option">--ad_cues <var><start_time[;start_time]…></var></span></kbd></dt>
|
|
|
|
|
<dd><p>List of cuepoint markers separated by semicolon. The start_time represents
|
2018-08-16 00:35:22 +00:00
|
|
|
|
the start of the cue marker in seconds (double precision) relative to the
|
|
|
|
|
start of the program. This flag preconditions content for
|
|
|
|
|
<a class="reference external" href="http://bit.ly/2KK10DD">Dynamic Ad Insertion</a> with Google Ad Manager.
|
|
|
|
|
For DASH, multiple periods will be generated with period boundaries at the
|
|
|
|
|
next key frame to the designated start times; For HLS, segments will be
|
|
|
|
|
terminated at the next key frame to the designated start times and
|
|
|
|
|
‘#EXT-X-PLACEMENT-OPPORTUNITY’ tag will be inserted after the segment in
|
2020-01-22 00:59:16 +00:00
|
|
|
|
media playlist.</p>
|
|
|
|
|
</dd>
|
|
|
|
|
</dl>
|
2021-06-22 00:16:40 +00:00
|
|
|
|
</section>
|
|
|
|
|
</section>
|
|
|
|
|
</section>
|
2018-08-16 00:35:22 +00:00
|
|
|
|
|
|
|
|
|
|
2021-04-10 04:00:37 +00:00
|
|
|
|
<div class="clearer"></div>
|
2018-08-16 00:35:22 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2021-04-10 04:00:37 +00:00
|
|
|
|
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
|
|
|
|
<div class="sphinxsidebarwrapper">
|
|
|
|
|
<h3><a href="../index.html">Table of Contents</a></h3>
|
|
|
|
|
<ul>
|
|
|
|
|
<li><a class="reference internal" href="#">Ad Insertion</a><ul>
|
|
|
|
|
<li><a class="reference internal" href="#synopsis">Synopsis</a></li>
|
|
|
|
|
<li><a class="reference internal" href="#examples">Examples</a></li>
|
|
|
|
|
<li><a class="reference internal" href="#configuration-options">Configuration options</a><ul>
|
|
|
|
|
<li><a class="reference internal" href="#ads-options">Ads options</a></li>
|
|
|
|
|
</ul>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
<h4>Previous topic</h4>
|
|
|
|
|
<p class="topless"><a href="text.html"
|
|
|
|
|
title="previous chapter">Text output formats</a></p>
|
|
|
|
|
<h4>Next topic</h4>
|
|
|
|
|
<p class="topless"><a href="ffmpeg_piping.html"
|
|
|
|
|
title="next chapter">FFmpeg piping</a></p>
|
|
|
|
|
<div role="note" aria-label="source link">
|
|
|
|
|
<h3>This Page</h3>
|
|
|
|
|
<ul class="this-page-menu">
|
|
|
|
|
<li><a href="../_sources/tutorials/ads.rst.txt"
|
|
|
|
|
rel="nofollow">Show Source</a></li>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="searchbox" style="display: none" role="search">
|
|
|
|
|
<h3 id="searchlabel">Quick search</h3>
|
|
|
|
|
<div class="searchformwrapper">
|
|
|
|
|
<form class="search" action="../search.html" method="get">
|
|
|
|
|
<input type="text" name="q" aria-labelledby="searchlabel" />
|
|
|
|
|
<input type="submit" value="Go" />
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<script>$('#searchbox').show(0);</script>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2018-08-16 00:35:22 +00:00
|
|
|
|
<div class="clearer"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="related" role="navigation" aria-label="related navigation">
|
|
|
|
|
<h3>Navigation</h3>
|
|
|
|
|
<ul>
|
|
|
|
|
<li class="right" style="margin-right: 10px">
|
|
|
|
|
<a href="../genindex.html" title="General Index"
|
|
|
|
|
>index</a></li>
|
2018-08-20 17:47:59 +00:00
|
|
|
|
<li class="right" >
|
|
|
|
|
<a href="ffmpeg_piping.html" title="FFmpeg piping"
|
|
|
|
|
>next</a> |</li>
|
|
|
|
|
<li class="right" >
|
2021-04-10 04:00:37 +00:00
|
|
|
|
<a href="text.html" title="Text output formats"
|
2018-08-20 17:47:59 +00:00
|
|
|
|
>previous</a> |</li>
|
|
|
|
|
<li class="nav-item nav-item-0"><a href="../index.html">Shaka Packager documentation</a> »</li>
|
2021-04-10 04:00:37 +00:00
|
|
|
|
<li class="nav-item nav-item-1"><a href="tutorials.html" >Tutorials</a> »</li>
|
|
|
|
|
<li class="nav-item nav-item-this"><a href="">Ad Insertion</a></li>
|
2018-08-16 00:35:22 +00:00
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="footer" role="contentinfo">
|
|
|
|
|
© Copyright 2017, Google.
|
2021-06-22 00:16:40 +00:00
|
|
|
|
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.0.2.
|
2018-08-16 00:35:22 +00:00
|
|
|
|
</div>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|