181 lines
13 KiB
HTML
181 lines
13 KiB
HTML
|
<!DOCTYPE html>
|
|||
|
<html class="writer-html5" lang="en" >
|
|||
|
<head>
|
|||
|
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
|
|||
|
|
|||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|||
|
<title>ShuffleChannels — VapourSynth R64 documentation</title>
|
|||
|
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
|||
|
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
|||
|
<link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />
|
|||
|
<!--[if lt IE 9]>
|
|||
|
<script src="../../_static/js/html5shiv.min.js"></script>
|
|||
|
<![endif]-->
|
|||
|
|
|||
|
<script src="../../_static/jquery.js"></script>
|
|||
|
<script src="../../_static/_sphinx_javascript_frameworks_compat.js"></script>
|
|||
|
<script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
|
|||
|
<script src="../../_static/doctools.js"></script>
|
|||
|
<script src="../../_static/sphinx_highlight.js"></script>
|
|||
|
<script src="../../_static/js/theme.js"></script>
|
|||
|
<link rel="index" title="Index" href="../../genindex.html" />
|
|||
|
<link rel="search" title="Search" href="../../search.html" />
|
|||
|
<link rel="next" title="SplitChannels" href="splitchannels.html" />
|
|||
|
<link rel="prev" title="SetAudioCache" href="setaudiocache.html" />
|
|||
|
</head>
|
|||
|
|
|||
|
<body class="wy-body-for-nav">
|
|||
|
<div class="wy-grid-for-nav">
|
|||
|
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|||
|
<div class="wy-side-scroll">
|
|||
|
<div class="wy-side-nav-search" >
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<a href="../../index.html" class="icon icon-home">
|
|||
|
VapourSynth
|
|||
|
</a>
|
|||
|
<div class="version">
|
|||
|
R64
|
|||
|
</div>
|
|||
|
<div role="search">
|
|||
|
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
|
|||
|
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
|
|||
|
<input type="hidden" name="check_keywords" value="yes" />
|
|||
|
<input type="hidden" name="area" value="default" />
|
|||
|
</form>
|
|||
|
</div>
|
|||
|
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
|
|||
|
<ul class="current">
|
|||
|
<li class="toctree-l1"><a class="reference internal" href="../../introduction.html">Introduction</a></li>
|
|||
|
<li class="toctree-l1"><a class="reference internal" href="../../installation.html">Installation</a></li>
|
|||
|
<li class="toctree-l1"><a class="reference internal" href="../../gettingstarted.html">Getting Started</a></li>
|
|||
|
<li class="toctree-l1"><a class="reference internal" href="../../pythonreference.html">Python Reference</a></li>
|
|||
|
<li class="toctree-l1 current"><a class="reference internal" href="../../functions.html">Function Reference</a><ul class="current">
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../functions.html#general-functions">General Functions</a></li>
|
|||
|
<li class="toctree-l2"><a class="reference internal" href="../../functions.html#video-functions">Video Functions</a></li>
|
|||
|
<li class="toctree-l2 current"><a class="reference internal" href="../../functions.html#audio-functions">Audio Functions</a><ul class="current">
|
|||
|
<li class="toctree-l3"><a class="reference internal" href="assumesamplerate.html">AssumeSampleRate</a></li>
|
|||
|
<li class="toctree-l3"><a class="reference internal" href="audiogain.html">AudioGain</a></li>
|
|||
|
<li class="toctree-l3"><a class="reference internal" href="audioloop.html">AudioLoop</a></li>
|
|||
|
<li class="toctree-l3"><a class="reference internal" href="audiomix.html">AudioMix</a></li>
|
|||
|
<li class="toctree-l3"><a class="reference internal" href="audioreverse.html">AudioReverse</a></li>
|
|||
|
<li class="toctree-l3"><a class="reference internal" href="audiosplice.html">AudioSplice</a></li>
|
|||
|
<li class="toctree-l3"><a class="reference internal" href="audiotrim.html">AudioTrim</a></li>
|
|||
|
<li class="toctree-l3"><a class="reference internal" href="blankaudio.html">BlankAudio</a></li>
|
|||
|
<li class="toctree-l3"><a class="reference internal" href="setaudiocache.html">SetAudioCache</a></li>
|
|||
|
<li class="toctree-l3 current"><a class="current reference internal" href="#">ShuffleChannels</a><ul>
|
|||
|
<li class="toctree-l4"><a class="reference internal" href="#std.ShuffleChannels"><code class="docutils literal notranslate"><span class="pre">ShuffleChannels()</span></code></a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
<li class="toctree-l3"><a class="reference internal" href="splitchannels.html">SplitChannels</a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
<li class="toctree-l1"><a class="reference internal" href="../../output.html">Output</a></li>
|
|||
|
<li class="toctree-l1"><a class="reference internal" href="../../applications.html">Applications and Libraries</a></li>
|
|||
|
<li class="toctree-l1"><a class="reference internal" href="../../apireference.html">VapourSynth C API Reference</a></li>
|
|||
|
</ul>
|
|||
|
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</nav>
|
|||
|
|
|||
|
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
|
|||
|
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|||
|
<a href="../../index.html">VapourSynth</a>
|
|||
|
</nav>
|
|||
|
|
|||
|
<div class="wy-nav-content">
|
|||
|
<div class="rst-content">
|
|||
|
<div role="navigation" aria-label="Page navigation">
|
|||
|
<ul class="wy-breadcrumbs">
|
|||
|
<li><a href="../../index.html" class="icon icon-home" aria-label="Home"></a></li>
|
|||
|
<li class="breadcrumb-item"><a href="../../functions.html">Function Reference</a></li>
|
|||
|
<li class="breadcrumb-item active">ShuffleChannels</li>
|
|||
|
<li class="wy-breadcrumbs-aside">
|
|||
|
<a href="../../_sources/functions/audio/shufflechannels.rst.txt" rel="nofollow"> View page source</a>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
<hr/>
|
|||
|
</div>
|
|||
|
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|||
|
<div itemprop="articleBody">
|
|||
|
|
|||
|
<section id="shufflechannels">
|
|||
|
<h1>ShuffleChannels<a class="headerlink" href="#shufflechannels" title="Permalink to this heading"></a></h1>
|
|||
|
<dl class="py function">
|
|||
|
<dt class="sig sig-object py" id="std.ShuffleChannels">
|
|||
|
<span class="sig-prename descclassname"><span class="pre">std.</span></span><span class="sig-name descname"><span class="pre">ShuffleChannels</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">anode[]</span> <span class="pre">clips</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">int[]</span> <span class="pre">channels_in</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">int[]</span> <span class="pre">channels_out</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#std.ShuffleChannels" title="Permalink to this definition"></a></dt>
|
|||
|
<dd><p>ShuffleChannels can extract and combine channels from different clips in the most
|
|||
|
general way possible.</p>
|
|||
|
<p>Most of the returned clip’s properties are implicitly determined from the
|
|||
|
first clip given to <em>clips</em>.</p>
|
|||
|
<p>The <em>clips</em> parameter takes one or more clips with the same format. If the clips
|
|||
|
are different lengths they’ll be zero extended to that of the longest.</p>
|
|||
|
<p>The argument <em>channels_in</em> controls which of the input clips’ channels to use and
|
|||
|
takes a channel constants as its argument. Specifying a non-existent channel
|
|||
|
is an error. If more <em>channels_in</em> than <em>clips</em> values are specified then the last
|
|||
|
clip in the <em>clips</em> list is reused as a source. In addition to the channel constant
|
|||
|
it’s also possible to specify the nth channel by using negative numbers.</p>
|
|||
|
<p>The output channel mapping is determined by <em>channels_out</em> and corresponds to the
|
|||
|
input channel order. The number of <em>channels_out</em> entries must be the same as the
|
|||
|
number of <em>channels_in</em> entries. Specifying the same output channel twice is an error.</p>
|
|||
|
<p>Below are some examples of useful operations.</p>
|
|||
|
<p>Extract the left channel (assuming it exists):</p>
|
|||
|
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ShuffleChannels</span><span class="p">(</span><span class="n">clips</span><span class="o">=</span><span class="n">clip</span><span class="p">,</span> <span class="n">channels_in</span><span class="o">=</span><span class="n">vs</span><span class="o">.</span><span class="n">FRONT_LEFT</span><span class="p">,</span> <span class="n">channels_out</span><span class="o">=</span><span class="n">vs</span><span class="o">.</span><span class="n">FRONT_LEFT</span><span class="p">)</span>
|
|||
|
</pre></div>
|
|||
|
</div>
|
|||
|
<p>Swap left and right audio channels in a stereo clip:</p>
|
|||
|
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ShuffleChannels</span><span class="p">(</span><span class="n">clips</span><span class="o">=</span><span class="n">clip</span><span class="p">,</span> <span class="n">channels_in</span><span class="o">=</span><span class="p">[</span><span class="n">vs</span><span class="o">.</span><span class="n">FRONT_RIGHT</span><span class="p">,</span> <span class="n">vs</span><span class="o">.</span><span class="n">FRONT_LEFT</span><span class="p">],</span> <span class="n">channels_out</span><span class="o">=</span><span class="p">[</span><span class="n">vs</span><span class="o">.</span><span class="n">FRONT_LEFT</span><span class="p">,</span> <span class="n">vs</span><span class="o">.</span><span class="n">FRONT_RIGHT</span><span class="p">])</span>
|
|||
|
</pre></div>
|
|||
|
</div>
|
|||
|
<p>Swap left and right audio channels in a stereo clip (alternate ordering of arguments):</p>
|
|||
|
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ShuffleChannels</span><span class="p">(</span><span class="n">clips</span><span class="o">=</span><span class="n">clip</span><span class="p">,</span> <span class="n">channels_in</span><span class="o">=</span><span class="p">[</span><span class="n">vs</span><span class="o">.</span><span class="n">FRONT_LEFT</span><span class="p">,</span> <span class="n">vs</span><span class="o">.</span><span class="n">FRONT_RIGHT</span><span class="p">],</span> <span class="n">channels_out</span><span class="o">=</span><span class="p">[</span><span class="n">vs</span><span class="o">.</span><span class="n">FRONT_RIGHT</span><span class="p">,</span> <span class="n">vs</span><span class="o">.</span><span class="n">FRONT_LEFT</span><span class="p">])</span>
|
|||
|
</pre></div>
|
|||
|
</div>
|
|||
|
<p>Swap left and right audio channels in a stereo clip (alternate indexing):</p>
|
|||
|
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ShuffleChannels</span><span class="p">(</span><span class="n">clips</span><span class="o">=</span><span class="n">clip</span><span class="p">,</span> <span class="n">channels_in</span><span class="o">=</span><span class="p">[</span><span class="o">-</span><span class="mi">2</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">],</span> <span class="n">channels_out</span><span class="o">=</span><span class="p">[</span><span class="n">vs</span><span class="o">.</span><span class="n">FRONT_LEFT</span><span class="p">,</span> <span class="n">vs</span><span class="o">.</span><span class="n">FRONT_RIGHT</span><span class="p">])</span>
|
|||
|
</pre></div>
|
|||
|
</div>
|
|||
|
<p>Merge 2 mono audio clips into a single stereo clip:</p>
|
|||
|
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ShuffleChannels</span><span class="p">(</span><span class="n">clips</span><span class="o">=</span><span class="p">[</span><span class="n">clipa</span><span class="p">,</span> <span class="n">clipb</span><span class="p">],</span> <span class="n">channels_in</span><span class="o">=</span><span class="p">[</span><span class="n">vs</span><span class="o">.</span><span class="n">FRONT_LEFT</span><span class="p">,</span> <span class="n">vs</span><span class="o">.</span><span class="n">FRONT_LEFT</span><span class="p">],</span> <span class="n">channels_out</span><span class="o">=</span><span class="p">[</span><span class="n">vs</span><span class="o">.</span><span class="n">FRONT_LEFT</span><span class="p">,</span> <span class="n">vs</span><span class="o">.</span><span class="n">FRONT_RIGHT</span><span class="p">])</span>
|
|||
|
</pre></div>
|
|||
|
</div>
|
|||
|
</dd></dl>
|
|||
|
|
|||
|
</section>
|
|||
|
|
|||
|
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
|
|||
|
<a href="setaudiocache.html" class="btn btn-neutral float-left" title="SetAudioCache" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
|||
|
<a href="splitchannels.html" class="btn btn-neutral float-right" title="SplitChannels" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
|||
|
</div>
|
|||
|
|
|||
|
<hr/>
|
|||
|
|
|||
|
<div role="contentinfo">
|
|||
|
<p>© Copyright 2012-2023, Fredrik Mellbin.</p>
|
|||
|
</div>
|
|||
|
|
|||
|
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
|||
|
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
|||
|
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|||
|
|
|||
|
|
|||
|
</footer>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</section>
|
|||
|
</div>
|
|||
|
<script>
|
|||
|
jQuery(function () {
|
|||
|
SphinxRtdTheme.Navigation.enable(true);
|
|||
|
});
|
|||
|
</script>
|
|||
|
|
|||
|
</body>
|
|||
|
</html>
|