summaryrefslogtreecommitdiffstats
path: root/DOCS/man/encode.rst
blob: 2c5bc14ddcd91440fc8d48070d2586e7c3a7502e (plain)
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
ENCODING
========

You can encode files from one format/codec to another using this facility.

``--o=<filename>``
    Enables encoding mode and specifies the output file name.

``--of=<format>``
    Specifies the output format (overrides autodetection by the file name
    extension of the file specified by ``-o``). This can be a comma separated
    list of possible formats to try. See ``--of=help`` for a full list of
    supported formats.

``--ofopts=<options>``
    Specifies the output format options for libavformat.
    See ``--ofopts=help`` for a full list of supported options.

    Options are managed in lists. There are a few commands to manage the
    options list.

    ``--ofopts-add=<options1[,options2,...]>``
        Appends the options given as arguments to the options list.

    ``--ofopts-pre=<options1[,options2,...]>``
        Prepends the options given as arguments to the options list.

    ``--ofopts-del=<index1[,index2,...]>``
        Deletes the options at the given indexes. Index numbers start at 0,
        negative numbers address the end of the list (-1 is the last).

    ``--ofopts-clr``
        Completely empties the options list.

``--ofps=<float value>``
    Specifies the output format time base (default: 24000). Low values like 25
    limit video fps by dropping frames.

``--oautofps``
    Sets the output format time base to the guessed frame rate of the input
    video (simulates MEncoder behavior, useful for AVI; may cause frame drops).
    Note that not all codecs and not all formats support VFR encoding, and some
    which do have bugs when a target bitrate is specified - use ``--ofps`` or
    ``--oautofps`` to force CFR encoding in these cases.

``--omaxfps=<float value>``
    Specifies the minimum distance of adjacent frames (default: 0, which means
    unset). Content of lower frame rate is not readjusted to this frame rate;
    content of higher frame rate is decimated to this frame rate.

``--oharddup``
    If set, the frame rate given by ``--ofps`` is attained not by skipping time
    codes, but by duplicating frames (constant frame rate mode).

``--oneverdrop``
    If set, frames are never dropped. Instead, time codes of video are
    readjusted to always increase. This may cause AV desync, though; to work
    around this, use a high-fps time base using ``--ofps`` and absolutely
    avoid ``--oautofps``.

``--oac=<codec>``
    Specifies the output audio codec. This can be a comma separated list of
    possible codecs to try. See ``--oac=help`` for a full list of supported
    codecs.

``--oaoffset=<value>``
    Shifts audio data by the given time (in seconds) by adding/removing
    samples at the start.

``--oacopts=<options>``
    Specifies the output audio codec options for libavcodec.
    See ``--oacopts=help`` for a full list of supported options.

    .. admonition:: Example

        "``--oac=libmp3lame --oacopts=b=128000``"
            selects 128 kbps MP3 encoding.

    Options are managed in lists. There are a few commands to manage the
    options list.

    ``--oacopts-add=<options1[,options2,...]>``
        Appends the options given as arguments to the options list.

    ``--oacopts-pre=<options1[,options2,...]>``
        Prepends the options given as arguments to the options list.

    ``--oacopts-del=<index1[,index2,...]>``
        Deletes the options at the given indexes. Index numbers start at 0,
        negative numbers address the end of the list (-1 is the last).

    ``--oacopts-clr``
        Completely empties the options list.

``--oafirst``
    Force the audio stream to become the first stream in the output.
    By default, the order is unspecified.

``--ovc=<codec>``
    Specifies the output video codec. This can be a comma separated list of
    possible codecs to try. See ``--ovc=help`` for a full list of supported
    codecs.

``--ovoffset=<value>``
    Shifts video data by the given time (in seconds) by shifting the pts
    values.

``--ovcopts <options>``
    Specifies the output video codec options for libavcodec.
    See --ovcopts=help for a full list of supported options.

    .. admonition:: Examples

        ``"--ovc=mpeg4 --ovcopts=qscale=5"``
            selects constant quantizer scale 5 for MPEG-4 encoding.

        ``"--ovc=libx264 --ovcopts=crf=23"``
            selects VBR quality factor 23 for H.264 encoding.

    Options are managed in lists. There are a few commands to manage the
    options list.

    ``--ovcopts-add=<options1[,options2,...]>``
        Appends the options given as arguments to the options list.

    ``--ovcopts-pre=<options1[,options2,...]>``
        Prepends the options given as arguments to the options list.

    ``--ovcopts-del=<index1[,index2,...]>``
        Deletes the options at the given indexes. Index numbers start at 0,
        negative numbers address the end of the list (-1 is the last).

    ``--ovcopts-clr``
        Completely empties the options list.

``--ovfirst``
    Force the video stream to become the first stream in the output.
    By default, the order is unspecified.

``--ocopyts``
    Copies input pts to the output video (not supported by some output
    container formats, e.g. AVI). Discontinuities are still fixed.
    By default, audio pts are set to playback time and video pts are
    synchronized to match audio pts, as some output formats do not support
    anything else.

``--orawts``
    Copies input pts to the output video (not supported by some output
    container formats, e.g. AVI). In this mode, discontinuities are not fixed
    and all pts are passed through as-is. Never seek backwards or use multiple
    input files in this mode!

``--no-ocopy-metadata``
    Turns off copying of metadata from input files to output files when
    encoding (which is enabled by default).

``--oset-metadata=<metadata-tag[,metadata-tag,...]>``
    Specifies metadata to include in the output file.
    Supported keys vary between output formats. For example, Matroska (MKV) and
    FLAC allow almost arbitrary keys, while support in MP4 and MP3 is more
    limited.

    .. admonition:: Example

        "``--oset-metadata=title="Output title",comment="Another tag"``"
            adds a title and a comment to the output file.

``--oremove-metadata=<metadata-tag[,metadata-tag,...]>``
    Specifies metadata to exclude from the output file when copying from the
    input file.

    .. admonition:: Example

        "``--oremove-metadata=comment,genre``"
            excludes copying of the the comment and genre tags to the output
            file.