-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgettingstarted.html
150 lines (135 loc) · 8.35 KB
/
gettingstarted.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<title>Getting Started — VapourSynth-Classic R57 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/agogo.css" />
<link rel="stylesheet" type="text/css" href="_static/css/custom.css" />
<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>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Python Reference" href="pythonreference.html" />
<link rel="prev" title="Installation" href="installation.html" />
</head><body>
<div class="header-wrapper" role="banner">
<div class="header">
<div class="headertitle"><a
href="index.html">VapourSynth-Classic R57 documentation</a></div>
<div class="rel" role="navigation" aria-label="related navigation">
<a href="installation.html" title="Installation"
accesskey="P">previous</a> |
<a href="pythonreference.html" title="Python Reference"
accesskey="N">next</a> |
<a href="genindex.html" title="General Index"
accesskey="I">index</a>
</div>
</div>
</div>
<div class="content-wrapper">
<div class="content">
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="getting-started">
<h1>Getting Started<a class="headerlink" href="#getting-started" title="Permalink to this heading">¶</a></h1>
<p>So you managed to install VapourSynth. Now what?</p>
<p>If you don’t know the basics of Python, you may want to check out a
<a class="reference external" href="https://learnxinyminutes.com/docs/python3/">tutorial</a>.</p>
<p>You can “play around” in the python interpreter if you want, but that’s not how
most video scripts are created.</p>
<section id="example-script">
<h2>Example Script<a class="headerlink" href="#example-script" title="Permalink to this heading">¶</a></h2>
<p>Here’s a sample script to be inspired by, it assumes that lsmas is installed and <a class="reference internal" href="installation.html"><span class="doc">auto-loaded</span></a>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">vapoursynth</span> <span class="kn">import</span> <span class="n">core</span>
<span class="n">video</span> <span class="o">=</span> <span class="n">core</span><span class="o">.</span><span class="n">lsmas</span><span class="o">.</span><span class="n">LWLibavSource</span><span class="p">(</span><span class="n">source</span><span class="o">=</span><span class="s1">'Rule6.mkv'</span><span class="p">)</span>
<span class="n">video</span> <span class="o">=</span> <span class="n">core</span><span class="o">.</span><span class="n">std</span><span class="o">.</span><span class="n">Transpose</span><span class="p">(</span><span class="n">video</span><span class="p">)</span>
<span class="n">video</span><span class="o">.</span><span class="n">set_output</span><span class="p">()</span>
</pre></div>
</div>
<p>What it does is to get an instance of the core and load a video file using L-SMASH. The video is then transposed
(think matrix transpose, or if you don’t know that, a 90 degree rotation plus horizontal flip).</p>
<p>Remember that most VapourSynth objects have a quite nice string representation
in Python, so if you want to know more about an instance just call print().</p>
<p>It it also possible to directly open the script in VapourSynth Editor or VirtualDub FilterMod for previewing.</p>
</section>
<section id="output-with-vspipe">
<h2>Output with VSPipe<a class="headerlink" href="#output-with-vspipe" title="Permalink to this heading">¶</a></h2>
<p>VSPipe is very useful to pipe the output to various applications, for example x264 and FFmpeg for encoding.
Here are two examples of command lines that automatically pass on most video attributes.</p>
<p>For x264:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">vspipe</span> <span class="o">-</span><span class="n">c</span> <span class="n">y4m</span> <span class="n">script</span><span class="o">.</span><span class="n">vpy</span> <span class="o">-</span> <span class="o">|</span> <span class="n">x264</span> <span class="o">--</span><span class="n">demuxer</span> <span class="n">y4m</span> <span class="o">-</span> <span class="o">--</span><span class="n">output</span> <span class="n">encoded</span><span class="o">.</span><span class="n">mkv</span>
</pre></div>
</div>
<p>For FFmpeg:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">vspipe</span> <span class="o">-</span><span class="n">c</span> <span class="n">y4m</span> <span class="n">script</span><span class="o">.</span><span class="n">vpy</span> <span class="o">-</span> <span class="o">|</span> <span class="n">ffmpeg</span> <span class="o">-</span><span class="n">i</span> <span class="n">pipe</span><span class="p">:</span> <span class="n">encoded</span><span class="o">.</span><span class="n">mkv</span>
</pre></div>
</div>
</section>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
</div>
<div class="sidebar">
<h3>Table of Contents</h3>
<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 current"><a class="current reference internal" href="#">Getting Started</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#example-script">Example Script</a></li>
<li class="toctree-l2"><a class="reference internal" href="#output-with-vspipe">Output with VSPipe</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="pythonreference.html">Python Reference</a></li>
<li class="toctree-l1"><a class="reference internal" href="functions.html">Function Reference</a></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="avisynthcomp.html">Avisynth functions and their VapourSynth equivalents</a></li>
<li class="toctree-l1"><a class="reference internal" href="includedplugins.html">Included Plugins</a></li>
<li class="toctree-l1"><a class="reference internal" href="apireference.html">VapourSynth C API Reference</a></li>
</ul>
<div role="search">
<h3 style="margin-top: 1.5em;">Search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<div class="clearer"></div>
</div>
</div>
<div class="footer-wrapper">
<div class="footer">
<div class="left">
<div role="navigation" aria-label="related navigaton">
<a href="installation.html" title="Installation"
>previous</a> |
<a href="pythonreference.html" title="Python Reference"
>next</a> |
<a href="genindex.html" title="General Index"
>index</a>
</div>
<div role="note" aria-label="source link">
<br/>
<a href="_sources/gettingstarted.rst.txt"
rel="nofollow">Show Source</a>
</div>
</div>
<div class="right">
<div class="footer" role="contentinfo">
© Copyright 2012-2021, Fredrik Mellbin.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 6.1.3.
</div>
</div>
<div class="clearer"></div>
</div>
</div>
</body>
</html>