Mercurial > mplayer.hg
annotate DOCS/xml/ru/encoding-guide.xml @ 21680:e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
author | voroshil |
---|---|
date | Wed, 20 Dec 2006 11:50:00 +0000 |
parents | 7438195728a0 |
children | 034349ea092d |
rev | line source |
---|---|
20725 | 1 <?xml version="1.0" encoding="utf-8"?> |
21598
fa4f5b0fd510
r21612: replace " with ", better readability
voroshil
parents:
21594
diff
changeset
|
2 <!-- synced with r21612 --> |
20725 | 3 <!-- **Partially** translated --> |
4 <chapter id="encoding-guide"> | |
5 <title>Кодирование с <application>MEncoder</application></title> | |
6 | |
7 <sect1 id="menc-feat-dvd-mpeg4"> | |
21598
fa4f5b0fd510
r21612: replace " with ", better readability
voroshil
parents:
21594
diff
changeset
|
8 <title>Создание высококачественного MPEG-4 ("DivX") рипа из DVD фильма</title> |
20725 | 9 |
10 <para> | |
21525 | 11 Одним часто задаваемым вопросом является "Как мне сделать рип самого высокого |
12 качества для заданного размера?". Другой вопрос "Как мне создать DVD рип с самым | |
13 высоким возможным качеством? Я не беспокоюсь о размере файла, мне нужно лишь | |
14 наилучшее качество.". | |
15 </para> | |
16 | |
17 <para> | |
18 Последний вопрос, похоже, отчасти неверно сформулирован. В конце концов, если | |
19 Вы не беспокоитесь о размере файла, почему бы просто не скопировать весь MPEG-2 | |
20 видео поток с DVD? Конечно, ваш AVI файл будет занимать около 5GB, | |
21 но если Вы желате наилучшее качество и не волнуетесь о размере, то это, | |
22 несомненно, лучшее решение. | |
23 </para> | |
24 | |
25 <para> | |
26 В действительности, причиной, по которой Вы хотите перекодировать DVD в MPEG-4, | |
27 является именно Ваше <emphasis role="bold">беспокойство</emphasis> | |
28 о размере файла. | |
29 </para> | |
30 | |
31 <para> | |
32 Сложно дать универсальный рецепт о создании DVD рипа очень высокого | |
33 качества. Необходимо рассмотреть несколько факторов, и Вы должны | |
34 понимать эти детали, иначе Вы, скорее всего, разочаруетесь своими | |
35 результатами. Ниже мы исследуем некоторые из этих вопросов, а затем | |
36 рассмотрим пример. Мы предполагаем, что Вы используете | |
37 <systemitem class="library">libavcodec</systemitem> для кодирования видео, | |
38 хотя теория также применима и к другим кодекам. | |
39 </para> | |
40 | |
41 <para> | |
42 Если это кажется для Вас слишком сложным, то Вам, пожалуй, следует использовать | |
43 один из многочисленных неплохих фронтендов, указанных в | |
44 <ulink url="http://www.mplayerhq.hu/design7/projects.html#mencoder_frontends">разделе MEncoder</ulink> | |
45 нашей страницы родственных проектов. | |
46 Так Вы должны получить высококачественные рипы без особых размышлений, | |
47 поскольку большинство этих утилит разработаны для принятия умных решений за Вас. | |
48 </para> | |
49 | |
50 <!-- ********** --> | |
20725 | 51 |
52 <sect2 id="menc-feat-dvd-mpeg4-preparing-encode"> | |
53 <title>Подготовка к кодированию: Идентификация исходного материала и кадровой | |
54 частоты</title> | |
55 <para> | |
21525 | 56 Прежде, чем даже задумываться о кодировании фильма, Вам необходимо выполнить |
57 некоторые предварительные действия. | |
58 </para> | |
59 | |
60 <para> | |
61 Первым и наиболее важным шагом перед кодированием должно быть опеределение | |
62 типа содержимого, с которым Вы работате. | |
63 Если источником Ваших исходных материалов является DVD или | |
64 широковещательное/кабельное/спутниковое TV, оно будет содержаться в одном из | |
65 двух форматов: NTSC для Северной Америки и Японии, PAL для Европы и т.д.. | |
66 Однако, важно понимать, что это только форматирование для показа на | |
67 телевидении, и оно часто | |
68 <emphasis role="bold">не</emphasis> соответствует | |
69 исходному формату фильма. | |
70 Опыт показывает, что NTSC материал существенно более сложен для кодирования, | |
71 т.к. в нём содержится больше элементов, которые нужно идентифицировать. | |
72 Для проведения удачного кодирования, Вам необходимо знать исходный формат. | |
73 Отказ от принятия этого во внимание приведёт к различным дефектам в Вашем | |
74 кодировании, включая безобразные гребешки (артефакты череcстрочной развёртки) | |
75 и повторяющиеся или даже потерянные кадры. | |
76 Кроме ухудщения картинки, артефакты так же уменьшают эффективность кодирования: | |
77 Вы получите худшее качество на единицу битпотока. | |
78 </para> | |
79 | |
20725 | 80 |
81 <sect3 id="menc-feat-dvd-mpeg4-preparing-encode-fps"> | |
82 <title>Определение кадровой чатоты источника</title> | |
83 <para> | |
21525 | 84 Вот список, содержащий общие типы исходных материалов, где, |
85 преимущественно, можно найти и их свойства: | |
86 </para> | |
87 | |
20725 | 88 <itemizedlist> |
89 <listitem><para> | |
90 <emphasis role="bold">Стандартный фильм</emphasis>: Производятся | |
91 для театральных показов на 24 fps [кадр/сек]. | |
92 </para></listitem> | |
93 <listitem><para> | |
94 <emphasis role="bold">PAL видео</emphasis>: Записывается с помощью | |
95 PAL видеокамеры при 50 полях в секунду. | |
96 Поле состоит только из чётных или нечётных линий кадра. | |
97 Телевидение было разработано для обновления этих полей попеременно, | |
98 что используется как вид дешёвого аналогового сжатия. | |
99 Человеческий глаз, предположительно, компенсирует это, но однажды | |
100 поняв чересстрочную развёртку, Вы научитесь видеть её и на TV и | |
101 Вам больше никогда не понравится телевидение. | |
102 Два поля <emphasis role="bold">не</emphasis> составляют | |
103 целый кадр, поскольку они снимаются с задержкой в 1/50 секунды | |
104 и, следовательно, не формируют одно изображение, за исключением случая | |
105 полного отсутсвия движения. | |
106 </para></listitem> | |
107 <listitem><para> | |
108 <emphasis role="bold">NTSC видео</emphasis>: Записывается с помощью | |
109 NTSC видеокамеры при 60000/1001 полях в секунду, или 60 полях в секунду | |
110 в эпоху чёрно-белого TV. | |
111 В других отношениях аналогично PAL. | |
112 </para></listitem> | |
113 <listitem><para> | |
114 <emphasis role="bold">Анимация</emphasis>: Обычно рисуется на 24 fps, | |
115 но также существуют разновидности со смешанной кадровой частотой. | |
116 </para></listitem> | |
117 <listitem><para> | |
118 <emphasis role="bold">Компьютерныя графика (CG)</emphasis>: Может | |
119 быть с любой частотой кадров, но некоторые встречаются чаще остальных; | |
120 24 и 30 кадров в секунду типичны для NTSC, и 25 fps типично для PAL. | |
121 </para></listitem> | |
122 <listitem><para> | |
123 <emphasis role="bold">Старый фильм</emphasis>: Различные низкие | |
124 кадровые частоты. | |
125 </para></listitem> | |
126 </itemizedlist> | |
127 </sect3> | |
128 | |
21525 | 129 |
20725 | 130 <sect3 id="menc-feat-dvd-mpeg4-preparing-encode-material"> |
131 <title>Идентификация исходного материала</title> | |
21525 | 132 |
133 <para> | |
134 Фильмы, состоящие из кадров, называются фильмами с построчной (или прогрессивной) | |
135 развёрткой, а состоящие из независимых полей — фильмами с чересстрочной | |
136 развёрткой или просто видео; однако, последний термин двусмысленный. | |
137 </para> | |
138 | |
139 <para> | |
140 Из-за дальнейших усложнений, некоторые фильмы будут смесью | |
141 нескольких, указанных выше. | |
142 </para> | |
143 | |
144 <para> | |
145 Наиболее важным различием между всеми этими форматами является | |
146 то, что одни из них основаны на кадрах, а другие — на полях. | |
147 <emphasis role="bold">Любой</emphasis> фильм, подготовленный для | |
148 просмотра на телевидении (включая DVD), преобразуется в формат, | |
149 основанный на полях. | |
20725 | 150 <!-- FIXME: Существует ли лучший *краткий* (1-2 слова) перевод для |
151 терминов pulldown и telecine? В литературе, которую я нашёл, | |
152 используют или указанные мной, по сути дела, транслитерации, | |
153 или так и оставляют английские названия. | |
154 А точный перевод можно выполнить только целым предложением | |
155 (т.е. определением), что совершенно неуместно в контексте | |
156 данного документа, где эти термины часто встречаются. --> | |
21525 | 157 Различные методы, с помощью которых это может быть сделано, совокупно |
158 называются "телесин" (англ. telecine), одним из вариантов которого | |
159 является отвратительный NTSC "3:2 пулдаун" (англ. pulldown). | |
160 За исключением случаев, когда формат исходного материала был | |
161 также основан на полях (и с такой же частотой полей), Вы получите | |
162 фильм в формате отличном от исходного. | |
20725 | 163 </para> |
164 | |
165 <itemizedlist> | |
166 <title>Существует несколько общих типов пулдауна:</title> | |
167 <listitem><para> | |
168 <emphasis role="bold">PAL 2:2 пулдаун</emphasis>: Наилучший из всех. | |
169 Каждый кадр показывается за время длительности двух полей путем | |
170 извлечения чётных и нечётных строк и их попременного показа. | |
171 Если в исходном материале 24 fps, то это ускоряет воспроизведение фильма | |
172 на 4%. | |
173 </para></listitem> | |
174 <listitem><para> | |
175 <emphasis role="bold">PAL 2:2:2:2:2:2:2:2:2:2:2:3 пулдаун</emphasis>: | |
176 Каждый 12-й кадр показывается за время длительности трёх полей, | |
177 вместо двух. | |
178 Это помогает избежать проблемы 4%-го ускорения, но делает обращение | |
179 процесса существенно более сложным. | |
180 Такие вещи обычно наблюдаются в музыкальных произведениях, где | |
181 изменение скорости на 4% существенно повредит музыкальную партитуру. | |
182 </para></listitem> | |
183 <listitem><para> | |
184 <emphasis role="bold">NTSC 3:2 телесин</emphasis>: Кадры показываются | |
185 попеременно за время длительности 3-х полей или 2-х полей. | |
186 Это даёт частоту полей в 2.5 раза больше исходной частоты кадров. | |
187 Результат также очень незначительно замедляется от 60 до 60000/1001 | |
188 полей в секунду для поддержания частоты полей NTSC. | |
189 </para></listitem> | |
190 <listitem><para> | |
191 <emphasis role="bold">NTSC 2:2 пулдаун</emphasis>: Используется | |
192 для отображения материала с 30 fps на NTSC. | |
193 Так же мил, как и 2:2 PAL пулдаун. | |
194 </para></listitem> | |
195 </itemizedlist> | |
196 | |
197 <para> | |
21525 | 198 Так же существуют методы для преобразования между NTSC и PAL видео, |
199 но подобные темы выходят за рамки данного руководства. | |
200 Если Вам попался такой фильм, и Вы хотите кодировать его, | |
201 лучшим решением будет найти копию в исходном формате. | |
202 Преобразование между этими двумя форматами вносит большие потери | |
203 и не может быть точно обращено, так что Ваше кодирование | |
204 существенно пострадает, если оно делается из преобразованного | |
205 источника. | |
206 </para> | |
207 | |
208 <para> | |
209 Когда видео находится на DVD, последовательные пары полей | |
210 группируются как кадр, даже если они не предназначены для | |
211 одновременного отображения. | |
212 Стандарт MPEG-2, используемый на DVD и цифровом TV предоставляет | |
213 возможность одновременно кодировать исходные кадры с построчной | |
214 развёрткой и сохранять число полей, в течении которых кадр | |
215 должен быть показан, в его заголовке. | |
216 Если был использован такой метод, фильм часто будет называться | |
217 как "мягкий телесин", т.к. процесс только указывает DVD-плееру | |
218 о необходимости применения пулдауна к фильму, не изменяя при этом | |
219 сам фильм. | |
220 Этот случай существенно предпочтителен, т.к. он может быть легко обращён | |
221 (в действительности, проигнорирован) кодером и т.к. он сохраняет | |
222 максимальное качество. | |
223 Однако, многие широковещательные и DVD студии не используют | |
224 надлежащую технологию кодирования и вместо этого производят | |
225 фильмы с "жёстким телесином", где поля в действительности | |
226 повторяются в кодированном MPEG-2. | |
227 </para> | |
228 | |
229 <para> | |
230 Порядок действия в таких случаях будет описан | |
231 <link linkend="menc-feat-telecine">позже в данном руководстве</link>. | |
232 Сейчас мы дадим Вам несколько советов по идентификации типа | |
233 материала, с которым Вы работаете: | |
20725 | 234 </para> |
235 | |
236 <itemizedlist> | |
237 <title>Области NTSC:</title> | |
238 <listitem><para> | |
239 Если при просмотре Вашего фильма <application>MPlayer</application> | |
240 выводит, что частота кадров была изменена до 24000/1001 и она | |
241 никогда не меняется обратно, то это почти наверняка содержимое | |
242 с построчной развёрткой, которое было подвергнуто | |
243 "мягкому телесину". | |
244 </para></listitem> | |
245 <listitem><para> | |
246 Если <application>MPlayer</application> отображает попеременные | |
247 переключения частоты кадров между 24000/1001 и 30000/1001, и Вы | |
248 иногда видите "гребешки", есть несколько возможностей. | |
249 Сегменты с 24000/1001 fps почти наверняка являются "мягко | |
250 телесиненным" содержимым с построчной развёрткой, но части с | |
251 30000/1001 fps могут быть как "жёстко телесиненым" содержимым | |
252 с 24000/1001 fps, так и NTSC видео с 60000/1001 полями в секунду. | |
253 Испольуйте два нижеследующих руководства для определения того, | |
254 с каким случаем вы имеете дело. | |
255 </para></listitem> | |
256 <listitem><para> | |
257 Если <application>MPlayer</application> никогда не показывает | |
258 изменения кадровой частоты и каждый отдельный кадр, где есть | |
259 движение, оказывается гребёнкой, Ваш фильм есть NTSC видео с | |
260 60000/1001 полями в секунду. | |
261 </para></listitem> | |
262 <listitem><para> | |
263 Если <application>MPlayer</application> никогда не показывает | |
264 изменения кадровой частоты и два кадра из каждых пяти оказываются | |
265 гребёнкой, Ваш фильм представляет собой "жёстко телесиненное" | |
266 содержимое с 24000/1001 fps. | |
267 </para></listitem> | |
268 </itemizedlist> | |
269 | |
270 <itemizedlist> | |
271 <title>Области PAL:</title> | |
272 <listitem><para> | |
273 Если Вы не видите никакой гребёнки, Ваш фильм есть 2:2 пулдаун. | |
274 </para></listitem> | |
275 <listitem><para> | |
276 Если Вы видите попеременную гребёнку каждые полсекунды, | |
277 Ваш фильм представляет собой 2:2:2:2:2:2:2:2:2:2:2:3 пулдаун. | |
278 </para></listitem> | |
279 <listitem><para> | |
280 Если Вы всегда видите гребёшки во время движения, значит Ваш | |
281 фильм является PAL видео с 50 полями в секунду. | |
282 </para></listitem> | |
283 </itemizedlist> | |
284 | |
285 <note><title>Подсказка:</title> | |
286 <para> | |
287 <application>MPlayer</application> может замедлить воспроизведение | |
288 фильма с опцией -speed или воспроизводить его покадрово. | |
289 Попробуйте использовать опцию <option>-speed 0.2</option> для | |
290 очень медленного просмотра фильма или несколько раз нажмите | |
291 клавишу "<keycap>.</keycap>" для воспроизведения одного кадра | |
292 за раз и идетнифицируйте образец, если не можете его увидеть на | |
293 полной скорости. | |
294 </para> | |
295 </note> | |
296 </sect3> | |
297 </sect2> | |
298 | |
21525 | 299 <!-- ********** --> |
300 | |
20725 | 301 <sect2 id="menc-feat-dvd-mpeg4-2pass"> |
302 <title>Постоянный квантователь против многопроходности</title> | |
303 | |
304 <para> | |
21525 | 305 Возможно кодировать Ваш фильм, широко варьируя качество. |
306 С современными видеокодерами и небольшим сжатием перед кодированием | |
307 (уменьшением размера и шумов) возможно достичь очень хорошего | |
308 качества при размере 700 МБ для 90-110-минутного широкоэкранного фильма. | |
309 Более того, всё, кроме самых длинных фильмов, может быть кодировано | |
310 с почти безупречным качеством на 1400 МБ. | |
311 </para> | |
312 | |
313 <para> | |
314 Есть три подхода при кодировании видео: постоянный битпоток (CBR), | |
315 постоянный квантователь и многопроходность (ABR или усреднённый битпоток). | |
316 </para> | |
317 | |
318 <para> | |
319 Сложность кадров фильма и, таким образом, число битов, нужных для их | |
320 сжатия может существенно отличаться от одной сцены к другой. | |
321 Современные видеокодеры могут подстраиваться под это в процессе | |
322 работы и варьировать битпоток. | |
323 Однако, в таких простых режимах как CBR кодеры не знают загруженность | |
324 битпотока в последующих сценах и т.о. не могут превысить затребованный | |
325 битпоток для больших промежутков времени. | |
326 Более продвинутые режимы, такие как многопроходный режим, могут | |
327 учитывать статистику предыдущих проходов; это решает проблему, | |
328 упомянутую выше. | |
20725 | 329 </para> |
330 | |
331 <note><title>Замечание:</title> | |
332 <para> | |
21525 | 333 Большинство кодеков, поддерживающих ABR кодирование, поддерживают |
334 только двупроходный режим, в то время как некоторые другие, такие | |
335 как <systemitem class="library">x264</systemitem>, | |
336 <systemitem class="library">Xvid</systemitem> | |
337 и <systemitem class="library">libavcodec</systemitem> поддерживают | |
338 многопроходность, несколько улучшающую качество на каждом проходе, | |
339 однако, это улучшение не измеримо и не заметно после 4-го прохода | |
340 или около того. | |
341 Поэтому, в данном разделе дву- и многопроходность будут | |
342 использоваться взаимозаменяемо. | |
20725 | 343 </para> |
344 </note> | |
345 | |
346 <para> | |
21525 | 347 В каждом из этих режимов видеокодек (такой как |
348 <systemitem class="library">libavcodec</systemitem>) | |
349 разбивает видеокадр на макроблоки размером 16х16 пикселей и потом | |
350 применяет квантователь к каждому макроблоку. Чем меньше квантоваль, | |
351 тем лучше качество и выше битпоток. | |
352 Метод, используемый видео кодером для определения того, какой | |
353 квантователь использовать для данного макроблока, варьируется и | |
354 подлежит тонкой настройке. (Это крайнее упрощение реального | |
355 процесса, но основная концепция полезна для понимания.) | |
356 </para> | |
357 | |
358 <para> | |
359 Когда Вы указываете постоянный битпоток, видеокодек будет кодировать | |
360 видео, отбрасывая детали столько, сколько необходимо и настолько мало, | |
361 насколько это возможно с целью оставаться ниже заданного битпотока. | |
362 Если Вас действительно не волнует размер файла, Вы можете также | |
363 использовать CBR и указать бесконечный битпоток. (На практике это | |
364 означает значение, достаточно большое для обозначения отсутствия | |
365 предела, например, 10000 Кбит.) В результате, без реального ограничения | |
366 битпотока, кодек использует наименьший возможный квантователь для | |
367 каждого макроблока (как указано опцией | |
368 <option>vqmin</option> для | |
369 <systemitem class="library">libavcodec</systemitem>, равной 2 по умолчанию). | |
370 Как только Вы укажите настолько низкий битпоток, что кодек будет | |
371 вынужден использовать более высокий квантователь, Вы почти наверняка | |
372 испортите качество Вашего видео. | |
373 Чтобы избежать этого, Вам, вероятно, придётся уменьшить размеры | |
374 Вашего видео, согласно методу, описанному далее в этом руководстве. | |
375 В общих чертах, Вам следует избегать CBR совсем, если Вы заботитесь | |
376 о качестве. | |
377 </para> | |
378 | |
379 <para> | |
380 С постоянным квантователем кодек использует для всех макроблоков | |
381 один и тот же квантователь, указанный в опции | |
382 <option>vqscale</option> (для | |
383 <systemitem class="library">libavcodec</systemitem>). | |
384 Если Вы хотите рип наивысшего возможного качества, снова не взирая | |
385 на битпоток, Вы можете использовать | |
386 <option>vqscale=2</option>. | |
387 Это приведёт к тому же битпотоку и PSNR (пику отношения сигнала к шуму), | |
388 что и CBR с | |
389 <option>vbitrate</option>=бесконечности и значением по умолчанию | |
390 <option>vqmin</option>, равным 2. | |
391 </para> | |
392 | |
393 <para> | |
394 Проблема с постоянным квантованием заключается в том, что кодек использует | |
395 заданный квантователь вне зависимости от того, требуется это для | |
396 макроблока или нет. То есть возможно использование большего квантователя | |
397 для макроблока без ухудшения видимого качества. Зачем тратить биты на | |
398 излишне низкий квантователь? У Вашего процессора есть столько тактов, | |
399 сколько есть времени, но имеется лишь ограниченное число битов на | |
400 жёстком диске. | |
401 </para> | |
402 | |
403 <para> | |
404 При двупроходном кодировании первый проход создаст рип фильма так, | |
405 как будто это был CBR, но сохранит лог свойств для каждого кадра. | |
406 Эта информация затем будет использована во время второго прохода | |
407 для принятия интеллектуальных решений о том, какой квантователь | |
408 следует использовать. Во время быстрого движения или сцен с | |
409 высокой детализацией с большой веротностью будут использованы | |
410 бОльшие квантователи, а во время медленного движения или сцен | |
411 с низкой детализацией — меньшие. | |
412 Обычно количество движения играет существенно более важную роль, | |
413 чем количество деталей. | |
414 </para> | |
415 | |
416 <para> | |
417 Если Вы используете <option>vqscale=2</option>, то Вы теряете биты. | |
418 Если Вы используете <option>vqscale=3</option>, то Вы не получаете | |
419 рип наивысшего качества. Предположим, вы делаете рип DVD, используя | |
420 <option>vqscale=3</option>, результат получается 1800 Кбит. | |
421 Если Вы сделаете двупроходное кодирование с | |
422 <option>vbitrate=1800</option>, получившееся видео быдет обладать | |
423 <emphasis role="bold">лучшим качеством</emphasis> для | |
424 <emphasis role="bold">того же битпотока</emphasis>. | |
425 </para> | |
426 | |
427 <para> | |
428 После того, как Вы сейчас убедились, что два прохода — это путь | |
429 к действию, возникает вопрос о том, какой битпоток использовать? | |
430 Ответ таков, что нет единого ответа. В идеале, Вы хотите выбрать | |
431 битпоток, при котором достигается наилучший баланс между качеством | |
432 и размером файла. Здесь возможны вариации в зависимости от | |
433 исходного видеоматериала. | |
434 </para> | |
435 | |
436 <para> | |
437 Если размер не важен, хорошей отправной точкой для рипа очень высокого | |
438 качества будет 2000 Кбит +/- 200 Кбит. | |
439 Для видеоматериала с быстрым движением или высокой детализацией | |
440 или просто если у Вас очень разборчивый глаз, Вы можете использовать | |
441 2400 или 2600. | |
442 Для некоторых DVD Вы не заметите разницы на 1400 Кбит. Хорошей идеей | |
443 является экспериментирование со сценами на разных битпотоках, чтобы | |
444 почувствовать разницу. | |
445 </para> | |
446 | |
447 <para> | |
448 Если Вашей целью является определённый размер, Вам нужно как-нибудь | |
449 вычислить битпоток. Но перед этим, Вам нужно знать, сколько места | |
450 нужно зарезервировать по аудио дорожку(и), так что Вам необходимо | |
451 <link linkend="menc-feat-dvd-mpeg4-audio">извлечь их</link> сперва. | |
452 Вы можете расчитать битпоток с помощью следующей формулы: | |
453 <systemitem>битпоток = (конечный_размер_в_МБайт - размер_звука_в_МБайт) * | |
454 1024 * 1024 / длительность_в_секундах * 8 / 1000</systemitem>. | |
455 Например, для сжатия двухчасового фильма в 702 МБ CD, с 60 МБ | |
456 аудио дорожкой, битпоток видео должен составлять: | |
457 <systemitem>(702 - 60) * 1024 * 1024 / (120*60) * 8 / 1000 | |
458 = 740 кбит/сек</systemitem>. | |
459 </para> | |
20725 | 460 </sect2> |
461 | |
21525 | 462 <!-- ********** --> |
20725 | 463 |
464 <sect2 id="menc-feat-dvd-mpeg4-constraints"> | |
465 <title>Ограничения для эффективного кодирования</title> | |
466 | |
467 <para> | |
21525 | 468 Из-за особенностей MPEG-подобного сжатия, существуют различные |
469 ограничения, которым Вы должны следовать для достижения | |
470 максимального качества. | |
471 MPEG разбивает видео на квадраты 16х16, называемые макроблоками. | |
472 Каждый макроблок состоит из 4 блоков 8х8 с информацией о люме | |
473 (интенсивности) и двух блоков 8х8 с информацией о хроме (цвете) | |
474 половинного разрешения (один для красно-бирюзовой оси и другой | |
475 для жёлто-голубой оси). | |
476 Даже если ширина и высота Вашего фильма не кратны 16, кодер | |
477 всё равно использует нужное количество макроблоков 16х16 для покрытия | |
478 всей области картинки, дополнительная область будет впустую потрачена. | |
479 Так что в интересах максимизации качества при фиксированном размере | |
480 файла, не стоит использовать размеры, не кратные 16. | |
481 </para> | |
482 | |
483 <para> | |
484 У большинства DVD также есть определённое подобие чёрных полос на | |
485 краях. Если Вы их оставите, это может <emphasis>сильно</emphasis> | |
486 повредить качество несколькими путями. | |
20725 | 487 </para> |
488 | |
489 <orderedlist> | |
490 <listitem> | |
21525 | 491 <para> |
20725 | 492 MPEG-подобное сжатие также очень чувствительно к преобразованиям |
493 частотных интервалов, в частности, к дискретному косинусному | |
494 преобразованию (DCT), которое аналогично преобразованию Фурье. | |
495 Этот вид сжатия эффективен для представления образов и сглаженных | |
496 переходов, но у него возникают проблемы с острыми краями. | |
497 <!-- FIXME: для слова ringing я тоже не нашёл краткого однозначного | |
498 перевода; лучшее, что приходит на ум - это "размывание краёв", | |
499 ясное дело, что причиной является отбрасывание малых гармоник, | |
500 в результате чего вместо точки возникает затухающая окружность, | |
501 но вот как это кратко выразить... --> | |
502 Для кодирования последних Вам нужно гораздо больше битов, а иначе | |
503 у вас появится артефакт, известный как размывание краёв | |
504 (англ. ringing). | |
21525 | 505 </para> |
506 | |
507 <para> | |
20725 | 508 Частотные преобразования (DCT) выполняются независимо для каждого |
509 макроблока (на самом деле, для каждого блока), так что эта проблема | |
510 возникает только в случае попадания острого края внутрь блока. | |
511 Если Ваши чёрные поля возникают точно на границах, кратных 16 | |
512 пикселям, это не проблема. | |
513 Однако, чёрные полосы на DVD редко хорошо расположены, так что | |
514 на практике Вам всегда придётся усекать стороны для избежания | |
515 этих проблем. | |
21525 | 516 </para> |
20725 | 517 </listitem> |
518 </orderedlist> | |
519 | |
520 <para> | |
21525 | 521 В дополнение к преобразованиям частотных интервалов, MPEG-подобное |
522 сжатие использует векторы движения для отображения изменений от | |
523 одного кадра к другому. Векторы движения, естественно, работают | |
524 существенно менее эффективно для новых объектов, идущих от | |
525 краёв картинки, поскольку они отсутсвуют в предыдущих кадрах. | |
526 Пока картинка простирается вплоть до края кодируемой области, | |
527 у векторов движения не возникает проблем с движением объектов | |
528 за пределы картинки. Однако, при наличии черных полей | |
529 могут возникнуть проблемы: | |
20725 | 530 </para> |
531 | |
532 <orderedlist continuation="continues"> | |
533 <listitem> | |
21525 | 534 <para> |
20725 | 535 Для каждого макроблока MPEG-подобное сжатие сохраняет вектор, |
536 определяющий какая часть предыдущего кадра должна быть скопирована | |
537 в этот макроблок как основа для предсказания следующего кадра. | |
538 Кодированию подлежит только оставшаяся разность. Если макроблок | |
539 простирается до края картинки и содержит часть чёрной полосы, | |
540 то векторы движения других частей каритки перепишут чёрную полосу. | |
541 Это означает, что много битов нужно потратить либо на повторное | |
542 чернение переписанной полосы, либо (что более вероятно) вектор | |
543 движения не будет использован вовсе и все изменения для этого | |
544 макроблока будут явно кодированы. Другими словами, эффективность | |
545 кодирования существенно уменьшается. | |
21525 | 546 </para> |
547 | |
548 <para> | |
20725 | 549 Ещё раз, эта проблема возникает только в случае, если чёрные полосы |
550 не укладываются в границы, кратные 16. | |
21525 | 551 </para> |
20725 | 552 </listitem> |
553 | |
554 <listitem> | |
21525 | 555 <para> |
20725 | 556 Наконец, предположим, что у нас есть находящийся внутри картинки |
557 макроблок и объект движется в этот блок от края изображения. | |
558 MPEG-подобное кодирование не может сказать "скопируй ту часть, | |
559 что внутри картинки, но не чёрную полосу". Так что чёрная полоса | |
560 также быдет скопирована внутрь, в результате чего масса битов | |
561 будет потрачена на кодирование части изображения, которое должно | |
562 быть на месте полосы. | |
21525 | 563 </para> |
564 | |
565 <para> | |
20725 | 566 Для случаев, когда всё изображение движется к краю кодируемой |
567 области, у MPEG есть специальные оптимизации для многократного | |
568 копирования пикселей на край картинки, когда вектор движения | |
569 идёт извне области кодирования. Эта возможность становится | |
570 бесполезной, если у фильма есть чёрные полосы. В отличии от | |
571 случаев 1 и 2, выравнивание границ до кратности 16 здесь | |
572 не поможет. | |
21525 | 573 </para> |
20725 | 574 </listitem> |
575 | |
21525 | 576 <listitem><para> |
20725 | 577 Несмотря на то, что границы полностью чёрные и никогда не изменяются, |
578 существуют, как минимум, определённые накладные расходы, связанные | |
579 с наличием большего числа макроблоков. | |
21525 | 580 </para></listitem> |
20725 | 581 </orderedlist> |
582 | |
583 <para> | |
21525 | 584 Благодаря всем этим причинам, рекомендуется полностью урезать |
585 чёрные полосы. Более того, если есть области шумов/искажений | |
586 на краях картинки, то их урезание также поспособствует улучшению | |
587 качества кодирования. Видеофилы, желающие сохранить оригинал как | |
588 можно более точно, могут возражать против такого усечения; но | |
589 если Вы не планируете кодировать при постоянном квантователе, | |
590 качество, полученное при усечении, существенно превысит потери | |
591 информации на краях. | |
20725 | 592 </para> |
593 </sect2> | |
594 | |
21525 | 595 <!-- ********** --> |
20725 | 596 |
597 <sect2 id="menc-feat-dvd-mpeg4-crop"> | |
598 <title>Усечение и масштабирование</title> | |
599 | |
600 <para> | |
21525 | 601 Вспомните из предыдущего раздела, что конечный размер картинки, |
602 подлежащей кодированию, должен быть кратен 16 (как высота,так | |
603 и ширина). Это может быть достигнуто усечением, масштабированием | |
604 или комбинацией того и другого. | |
605 </para> | |
606 | |
607 <para> | |
608 Есть несколько рекомендаций для усечения, которым необходимо следовать | |
609 для избежания повреждения фильма. | |
610 Обычный формат YUV, 4:2:0, сохраняет хрому (информацию о цвете) | |
611 половинной дискретизации, т.е. хрома сохраняется в два раза реже | |
612 в каждом направлении, чем люма (информация об интенсивности). | |
613 Рассмотрите следующую диаграмму, где L обозначает точки дискретизации | |
614 люмы и C — хромы. | |
20725 | 615 </para> |
616 | |
617 <informaltable> | |
618 <?dbhtml table-width="40%" ?> | |
619 <?dbfo table-width="40%" ?> | |
620 <tgroup cols="8" align="center"> | |
621 <colspec colnum="1" colname="col1"/> | |
622 <colspec colnum="2" colname="col2"/> | |
623 <colspec colnum="3" colname="col3"/> | |
624 <colspec colnum="4" colname="col4"/> | |
625 <colspec colnum="5" colname="col5"/> | |
626 <colspec colnum="6" colname="col6"/> | |
627 <colspec colnum="7" colname="col7"/> | |
628 <colspec colnum="8" colname="col8"/> | |
629 <spanspec spanname="spa1-2" namest="col1" nameend="col2"/> | |
630 <spanspec spanname="spa3-4" namest="col3" nameend="col4"/> | |
631 <spanspec spanname="spa5-6" namest="col5" nameend="col6"/> | |
632 <spanspec spanname="spa7-8" namest="col7" nameend="col8"/> | |
633 <tbody> | |
634 <row> | |
635 <entry>L</entry> | |
636 <entry>L</entry> | |
637 <entry>L</entry> | |
638 <entry>L</entry> | |
639 <entry>L</entry> | |
640 <entry>L</entry> | |
641 <entry>L</entry> | |
642 <entry>L</entry> | |
643 </row> | |
644 <row> | |
645 <entry spanname="spa1-2">C</entry> | |
646 <entry spanname="spa3-4">C</entry> | |
647 <entry spanname="spa5-6">C</entry> | |
648 <entry spanname="spa7-8">C</entry> | |
649 </row> | |
650 <row> | |
651 <entry>L</entry> | |
652 <entry>L</entry> | |
653 <entry>L</entry> | |
654 <entry>L</entry> | |
655 <entry>L</entry> | |
656 <entry>L</entry> | |
657 <entry>L</entry> | |
658 <entry>L</entry> | |
659 </row> | |
660 <row> | |
661 <entry>L</entry> | |
662 <entry>L</entry> | |
663 <entry>L</entry> | |
664 <entry>L</entry> | |
665 <entry>L</entry> | |
666 <entry>L</entry> | |
667 <entry>L</entry> | |
668 <entry>L</entry> | |
669 </row> | |
670 <row> | |
671 <entry spanname="spa1-2">C</entry> | |
672 <entry spanname="spa3-4">C</entry> | |
673 <entry spanname="spa5-6">C</entry> | |
674 <entry spanname="spa7-8">C</entry> | |
675 </row> | |
676 <row> | |
677 <entry>L</entry> | |
678 <entry>L</entry> | |
679 <entry>L</entry> | |
680 <entry>L</entry> | |
681 <entry>L</entry> | |
682 <entry>L</entry> | |
683 <entry>L</entry> | |
684 <entry>L</entry> | |
685 </row> | |
686 </tbody> | |
687 </tgroup> | |
688 </informaltable> | |
689 | |
690 <para> | |
21525 | 691 Как Вы видите, строки и столбцы изображения естественным образом |
692 идут в парах. Поэтому смещения и размеры усечения | |
693 <emphasis>должны</emphasis> быть чётными числами. | |
694 Иначе хрома перестанет правильно соответствовать люме. | |
695 Теоретически возможно усечение с нечётными смещениями, но оно | |
696 потребует преобразования хромы, что потенциально является | |
697 операцией с потерей качества и не поддерживается фильтром | |
698 усечения сторон crop. | |
699 </para> | |
700 | |
701 <para> | |
702 Далее, видео с чересстрочной развёрткой дискретизируется следующим образом: | |
20725 | 703 </para> |
704 | |
705 <informaltable> | |
706 <?dbhtml table-width="80%" ?> | |
707 <?dbfo table-width="80%" ?> | |
708 <tgroup cols="16" align="center"> | |
709 <colspec colnum="1" colname="col1"/> | |
710 <colspec colnum="2" colname="col2"/> | |
711 <colspec colnum="3" colname="col3"/> | |
712 <colspec colnum="4" colname="col4"/> | |
713 <colspec colnum="5" colname="col5"/> | |
714 <colspec colnum="6" colname="col6"/> | |
715 <colspec colnum="7" colname="col7"/> | |
716 <colspec colnum="8" colname="col8"/> | |
717 <colspec colnum="9" colname="col9"/> | |
718 <colspec colnum="10" colname="col10"/> | |
719 <colspec colnum="11" colname="col11"/> | |
720 <colspec colnum="12" colname="col12"/> | |
721 <colspec colnum="13" colname="col13"/> | |
722 <colspec colnum="14" colname="col14"/> | |
723 <colspec colnum="15" colname="col15"/> | |
724 <colspec colnum="16" colname="col16"/> | |
725 <spanspec spanname="spa1-2" namest="col1" nameend="col2"/> | |
726 <spanspec spanname="spa3-4" namest="col3" nameend="col4"/> | |
727 <spanspec spanname="spa5-6" namest="col5" nameend="col6"/> | |
728 <spanspec spanname="spa7-8" namest="col7" nameend="col8"/> | |
729 <spanspec spanname="spa9-10" namest="col9" nameend="col10"/> | |
730 <spanspec spanname="spa11-12" namest="col11" nameend="col12"/> | |
731 <spanspec spanname="spa13-14" namest="col13" nameend="col14"/> | |
732 <spanspec spanname="spa15-16" namest="col15" nameend="col16"/> | |
733 <tbody> | |
734 <row> | |
735 <entry namest="col1" nameend="col8">Верхнее поле</entry> | |
736 <entry namest="col9" nameend="col16">Нижнее поле</entry> | |
737 </row> | |
738 <row> | |
739 <entry>L</entry> | |
740 <entry>L</entry> | |
741 <entry>L</entry> | |
742 <entry>L</entry> | |
743 <entry>L</entry> | |
744 <entry>L</entry> | |
745 <entry>L</entry> | |
746 <entry>L</entry> | |
747 <entry></entry> | |
748 <entry></entry> | |
749 <entry></entry> | |
750 <entry></entry> | |
751 <entry></entry> | |
752 <entry></entry> | |
753 <entry></entry> | |
754 <entry></entry> | |
755 </row> | |
756 <row> | |
757 <entry spanname="spa1-2">C</entry> | |
758 <entry spanname="spa3-4">C</entry> | |
759 <entry spanname="spa5-6">C</entry> | |
760 <entry spanname="spa7-8">C</entry> | |
761 <entry></entry> | |
762 <entry></entry> | |
763 <entry></entry> | |
764 <entry></entry> | |
765 <entry></entry> | |
766 <entry></entry> | |
767 <entry></entry> | |
768 <entry></entry> | |
769 </row> | |
770 <row> | |
771 <entry></entry> | |
772 <entry></entry> | |
773 <entry></entry> | |
774 <entry></entry> | |
775 <entry></entry> | |
776 <entry></entry> | |
777 <entry></entry> | |
778 <entry></entry> | |
779 <entry>L</entry> | |
780 <entry>L</entry> | |
781 <entry>L</entry> | |
782 <entry>L</entry> | |
783 <entry>L</entry> | |
784 <entry>L</entry> | |
785 <entry>L</entry> | |
786 <entry>L</entry> | |
787 </row> | |
788 <row> | |
789 <entry>L</entry> | |
790 <entry>L</entry> | |
791 <entry>L</entry> | |
792 <entry>L</entry> | |
793 <entry>L</entry> | |
794 <entry>L</entry> | |
795 <entry>L</entry> | |
796 <entry>L</entry> | |
797 <entry></entry> | |
798 <entry></entry> | |
799 <entry></entry> | |
800 <entry></entry> | |
801 <entry></entry> | |
802 <entry></entry> | |
803 <entry></entry> | |
804 <entry></entry> | |
805 </row> | |
806 <row> | |
807 <entry></entry> | |
808 <entry></entry> | |
809 <entry></entry> | |
810 <entry></entry> | |
811 <entry></entry> | |
812 <entry></entry> | |
813 <entry></entry> | |
814 <entry></entry> | |
815 <entry spanname="spa9-10">C</entry> | |
816 <entry spanname="spa11-12">C</entry> | |
817 <entry spanname="spa13-14">C</entry> | |
818 <entry spanname="spa15-16">C</entry> | |
819 </row> | |
820 <row> | |
821 <entry></entry> | |
822 <entry></entry> | |
823 <entry></entry> | |
824 <entry></entry> | |
825 <entry></entry> | |
826 <entry></entry> | |
827 <entry></entry> | |
828 <entry></entry> | |
829 <entry>L</entry> | |
830 <entry>L</entry> | |
831 <entry>L</entry> | |
832 <entry>L</entry> | |
833 <entry>L</entry> | |
834 <entry>L</entry> | |
835 <entry>L</entry> | |
836 <entry>L</entry> | |
837 </row> | |
838 <row> | |
839 <entry>L</entry> | |
840 <entry>L</entry> | |
841 <entry>L</entry> | |
842 <entry>L</entry> | |
843 <entry>L</entry> | |
844 <entry>L</entry> | |
845 <entry>L</entry> | |
846 <entry>L</entry> | |
847 <entry></entry> | |
848 <entry></entry> | |
849 <entry></entry> | |
850 <entry></entry> | |
851 <entry></entry> | |
852 <entry></entry> | |
853 <entry></entry> | |
854 <entry></entry> | |
855 </row> | |
856 <row> | |
857 <entry spanname="spa1-2">C</entry> | |
858 <entry spanname="spa3-4">C</entry> | |
859 <entry spanname="spa5-6">C</entry> | |
860 <entry spanname="spa7-8">C</entry> | |
861 <entry></entry> | |
862 <entry></entry> | |
863 <entry></entry> | |
864 <entry></entry> | |
865 <entry></entry> | |
866 <entry></entry> | |
867 <entry></entry> | |
868 <entry></entry> | |
869 </row> | |
870 <row> | |
871 <entry></entry> | |
872 <entry></entry> | |
873 <entry></entry> | |
874 <entry></entry> | |
875 <entry></entry> | |
876 <entry></entry> | |
877 <entry></entry> | |
878 <entry></entry> | |
879 <entry>L</entry> | |
880 <entry>L</entry> | |
881 <entry>L</entry> | |
882 <entry>L</entry> | |
883 <entry>L</entry> | |
884 <entry>L</entry> | |
885 <entry>L</entry> | |
886 <entry>L</entry> | |
887 </row> | |
888 <row> | |
889 <entry>L</entry> | |
890 <entry>L</entry> | |
891 <entry>L</entry> | |
892 <entry>L</entry> | |
893 <entry>L</entry> | |
894 <entry>L</entry> | |
895 <entry>L</entry> | |
896 <entry>L</entry> | |
897 <entry></entry> | |
898 <entry></entry> | |
899 <entry></entry> | |
900 <entry></entry> | |
901 <entry></entry> | |
902 <entry></entry> | |
903 <entry></entry> | |
904 <entry></entry> | |
905 </row> | |
906 <row> | |
907 <entry></entry> | |
908 <entry></entry> | |
909 <entry></entry> | |
910 <entry></entry> | |
911 <entry></entry> | |
912 <entry></entry> | |
913 <entry></entry> | |
914 <entry></entry> | |
915 <entry spanname="spa9-10">C</entry> | |
916 <entry spanname="spa11-12">C</entry> | |
917 <entry spanname="spa13-14">C</entry> | |
918 <entry spanname="spa15-16">C</entry> | |
919 </row> | |
920 <row> | |
921 <entry></entry> | |
922 <entry></entry> | |
923 <entry></entry> | |
924 <entry></entry> | |
925 <entry></entry> | |
926 <entry></entry> | |
927 <entry></entry> | |
928 <entry></entry> | |
929 <entry>L</entry> | |
930 <entry>L</entry> | |
931 <entry>L</entry> | |
932 <entry>L</entry> | |
933 <entry>L</entry> | |
934 <entry>L</entry> | |
935 <entry>L</entry> | |
936 <entry>L</entry> | |
937 </row> | |
938 </tbody> | |
939 </tgroup> | |
940 </informaltable> | |
941 | |
942 <para> | |
21525 | 943 Как Вы видите, структура повторяется только после 4 строк. |
944 Так что для чересстрочного видео Ваше y-смещение и высота | |
945 усечения должны быть кратны 4. | |
946 </para> | |
947 | |
948 <para> | |
949 Естественные разрешения DVD составляют 720x480 для NTSC и 720x576 | |
950 для PAL, но существует флаг соотношения сторон, который указывает | |
951 является ли видео полноэкранным (4:3) или широкоэкранным (16:9). | |
952 Многие (если не большинство) широкоэкранных DVD не точно соответсвуют | |
20725 | 953 <!-- FIXME: Есть ли перевод названия формата cinescope (он же CinemaScope) ?? --> |
21525 | 954 формату 16:9 и он может быть как 1.85:1, так и 2.35:1 (формат cinescope). |
955 Это означает, что в видео будут чёрные полосы, которые нужно усечь. | |
956 </para> | |
957 | |
958 <para> | |
959 <application>MPlayer</application> предоставляет фильтр обнаружения | |
960 усечения, который определяет прямоугольник, до которго нужно усечь | |
961 (<option>-vf cropdetect</option>). | |
962 Запустите <application>MPlayer</application> с | |
963 <option>-vf cropdetect</option> и он выдаст настройки | |
964 усечения для удаления полей. | |
965 С целью получения точных параметров усечения, Вы должны проигрывать | |
966 фильм достаточно долго для того, чтоб была использована вся область | |
967 изображения. | |
968 </para> | |
969 | |
970 <para> | |
971 Затем проверьте значения, полученные с помощью | |
972 <application>MPlayer</application>, используя командную строку, | |
973 выведенную <option>cropdetect</option>, и подстройте прямоугольник | |
974 при необходимости. | |
975 Фильтр <option>rectangle</option> может быть полезен, позволив | |
976 Вам интерактивно менять прямоугольник усечения для Вашего фильма. | |
977 Не забывайте следовать указанным выше руководствам по делимости, | |
978 чтобы не испортить выравнивание хромы. | |
979 </para> | |
980 | |
981 <para> | |
982 В ряде случаев масштабирование может быть нежелательным. | |
983 Масштабирование по вертикальному направлению затруднено для | |
984 чересстрочного видео, и если Вы хотите сохранить чересстрочность, | |
985 Вам в большинстве случаев будет необходимо воздерживаться от | |
986 масштабирования. | |
987 Если Вы не будете масштабировать, но всё ещё желаете размеры, | |
988 кратные 16, то Вам придётся проводить излишнее усечение. | |
989 Не проводите неполное усечение, поскольку чёрные полосы очень | |
990 плохи для кодирования! | |
991 </para> | |
992 | |
993 <para> | |
994 Посокльку MPEG-4 использует макроблоки 16х16, Вы должны убедиться, | |
995 что каждое измерение кодируемого видео кратно 16; иначе Вы ухудшите | |
996 качество, особенно на малых битпотоках. Вы можете сделать это, | |
997 округлив ширину и высоту прямоугольника усечения до ближайшего | |
998 меньшего целого, кратного 16. | |
999 Учитывая установленное ранее, при усечении Вы можете захотеть увеличить | |
1000 смещение по Y на половину разности старой и новой высоты, так что | |
1001 полученное видео будет браться из центра кадра. | |
20725 | 1002 |
21525 | 1003 И из-за способа дискретизации DVD видео, убедитесь, что смещение |
1004 есть чётное число. (Фактически, возьмите за правило никогда не | |
1005 использовать нечётные величины для любых параметров усечения или | |
1006 масштабирования видео.) Если Вы беспокоитесь из-за нескольких | |
1007 излишне отброшенных битов, возможно, Вы предпочтёте взамен | |
1008 масштабировать видео. | |
1009 В действительности, Вы можете доверить фильтру | |
1010 <option>cropdetect</option> сделать для Вас всё вышеупомянутое, | |
1011 т.к. у него есть необязательный параметр округления | |
1012 <option>round</option>, равный 16 по умолчанию. | |
1013 </para> | |
1014 | |
1015 <para> | |
1016 Также будьте осторожны с "полутёмными" пикселями на краях. Убедитесь, | |
1017 что они тоже отрезаются, иначе Вы будете тратить биты, которым есть | |
1018 лучшее применение. | |
1019 </para> | |
1020 | |
1021 <para> | |
1022 После всего выше сказанного и сделанного, Вы, вероятно, получите | |
1023 видео не точно формата 1:85.1 или 2.35:1, а с чем-то близким | |
1024 к этому. Вы можете вычислить новый коэффициент соотношения | |
1025 сторон вручную, но <application>MEncoder</application> | |
1026 предоставляет опцию для <systemitem class="library">libavcodec</systemitem>, | |
1027 называемую <option>autoaspect</option>, которая сделает это для | |
1028 Вас. Ни в коем случае не увеличивайте размер этого видео с целью | |
1029 квадратизации пикселей, если Вы не желаете впустую потратить | |
1030 место на жёстком диске. | |
1031 Масштабирование должно выполняться при воспроизведении, и плеер | |
1032 использует коэффициент соотношения сторон, сохранённый в AVI, для | |
1033 определения правильного разрешения. | |
1034 К сожалению, не все плееры используют эту информацию автомасштабирования, | |
1035 поэтому Вам всё ещё может быть необходимо перемасштабирование. | |
20725 | 1036 </para> |
1037 </sect2> | |
1038 | |
21525 | 1039 <!-- ********** --> |
20725 | 1040 |
1041 <sect2 id="menc-feat-dvd-mpeg4-resolution-bitrate"> | |
1042 <title>Выбор разрешения и битпотока</title> | |
1043 | |
1044 <para> | |
21525 | 1045 Если Вы не собираетеся кодировать в режиме постоянного квантователя, |
1046 Вам нужно выбрать битпоток. | |
1047 Понятие битпотока очень просто: это среднее число битов, которые | |
1048 будут использованы для сохранения Вашего фильма, в секунду. | |
1049 Обычно битпоток измеряется в килобитах (1000 бит) в секунду. | |
1050 Размер Вашего фильма на диске есть битпоток, умноженный на | |
1051 длительность фильма, плюс небольшие накладные расходы | |
1052 (см. раздел | |
1053 <link linkend="menc-feat-dvd-mpeg4-muxing-avi-limitations">контейнер AVI</link> | |
1054 для примера). | |
1055 Остальные параметры, такие как масштабирование, усечение и т.п. | |
1056 <emphasis role="bold">не</emphasis> изменят размер файла, пока | |
1057 Вы также не измените битпоток! | |
1058 </para> | |
1059 | |
1060 <para> | |
1061 Битпоток изменяется <emphasis role="bold">не</emphasis> | |
1062 пропорционально разрешению. | |
1063 То есть файл разрешением 320х240 с 200 кбит/сек не будет | |
1064 того же качества, что этот же фильм разрешением 640х480 | |
1065 и 800 кбит/сек! | |
1066 Для этого есть две причины: | |
20725 | 1067 <orderedlist> |
21525 | 1068 <listitem><para> |
1069 <emphasis role="bold">Восприятие</emphasis>: Вы сильнее | |
1070 замечаете MPEG артефакты, если они больше! | |
1071 Артефакты возникают на масштабе блоков (8х8). | |
1072 Ваш глаз не увидит ошибки в 4800 маленьких блоков так же | |
1073 легко, как и в 1200 больших блоков (предполагая | |
1074 масштабирование обоих фильмов на полный экран). | |
1075 </para></listitem> | |
1076 <listitem><para> | |
1077 <emphasis role="bold">Теоретическая</emphasis>: Когда Вы | |
1078 уменьшаете размер изображения, но продолжаете использовать | |
1079 блоки того же размера (8х8) для пространственных частотных | |
1080 преобразований, Вы перемещаете больше данных в высокочастотные | |
1081 полосы. Грубо говоря, каждый пиксель содержит больше деталей, | |
1082 чем раньше. | |
1083 Так что несмотря на то, что ваша картинка с уменьшенным | |
1084 масштабом содержит 1/4 информации в пространственных направлениях, | |
1085 она всё ещё может содержать большУю часть информации в | |
1086 частотных интервалах (предполагая, что высокие частоты были | |
1087 не использованы в оригинальном 640х480 изображении). | |
1088 </para></listitem> | |
1089 </orderedlist> | |
1090 </para> | |
1091 | |
1092 <para> | |
1093 Последние руководства рекомендовали выбор битпотока и разрешения, | |
1094 основываясь на приближении "бит на пиксель", но это обычно не | |
1095 верно из-за упомянутых выше причин. | |
1096 Похоже, лучшей оценкой является рост битпотока пропорционально | |
1097 квадратному корню разрешения, так что 320х240 и 400 кбит/сек | |
1098 должно быть сравнимо с 640х480 и 800 кбит/сек. | |
1099 Однако, это не было строго проверено теоретически или эмпирически. | |
1100 Кроме того, из-за существенного отличия фильмов по уровню шума, | |
1101 деталей, степеней свободы и т.п., тщетно давать общие рекомендации | |
1102 для "битов на длину диагонали" (аналог битов на пиксель, используя | |
1103 квадратный корень). | |
1104 </para> | |
1105 | |
1106 <para> | |
1107 Таким образом, мы обсудили сложность выбора битпотока и разрешения. | |
20725 | 1108 </para> |
1109 | |
1110 | |
1111 <sect3 id="menc-feat-dvd-mpeg4-resolution-bitrate-compute"> | |
1112 <title>Расчёт разрешения</title> | |
21525 | 1113 |
1114 <para> | |
1115 Следующие шаги помогут Вам расчитать разрешение для Вашего | |
1116 кодирования без слишком сильного искажения видео, учитывая | |
1117 некоторую информацию об исходном видео. | |
1118 Прежде всего, Вам необходимо расчитать коэффициент соотношения | |
1119 сторон для кодированного видео: | |
1120 <systemitem>ARc = (Wc x (ARa / PRdvd )) / Hc</systemitem> | |
1121 | |
20725 | 1122 <itemizedlist> |
1123 <title>где:</title> | |
1124 <listitem><para> | |
1125 Wc и Hc — ширина и высота усечённого видео, | |
1126 </para></listitem> | |
1127 <listitem><para> | |
1128 ARa — коэффициент соотношения сторон изображения, обычно 4/3 или 16/9, | |
1129 </para></listitem> | |
1130 <listitem><para> | |
1131 PRdvd — отношение пикселей DVD, что равно 1.25=(720/576) для PAL | |
1132 DVD и 1.5=(720/480) для NTSC DVD. | |
1133 </para></listitem> | |
1134 </itemizedlist> | |
1135 </para> | |
1136 | |
1137 <para> | |
21525 | 1138 Затем Вы можете расчитать разрешение по X и Y, согласно определённому |
1139 фактору качества сжатия (CQ): | |
1140 <systemitem>ResY = INT(SQRT( 1000*Битпоток/25/ARc/CQ )/16) * 16</systemitem> | |
1141 и <systemitem>ResX = INT( ResY * ARc / 16) * 16</systemitem>. | |
1142 </para> | |
1143 | |
1144 <para> | |
1145 Хорошо, но что такое CQ? | |
1146 CQ соответсвует числу битов на пиксель и на кадр для кодирования. | |
1147 Грубо говоря, чем больше CQ, тем меньше вероятность увидеть | |
1148 артефакты кодирования. | |
1149 Однако, если у Вас есть заданный размер для Вашего фильма | |
1150 (например, 1 или 2 CD), есть ограниченное общее число битов, | |
1151 которые Вы можете потратить; поэтому важно найти хороший | |
1152 компромисс между сжимаемостью и качеством. | |
1153 </para> | |
1154 | |
1155 <para> | |
1156 CQ зависит от битпотока, эффективности видеокодека и разрешения фильма. | |
1157 Обычно, в целях увеличеиня CQ, Вам нужно будет уменьшить размер | |
1158 фильма при постоянном битпотоке, заданном размере и длине фильма. | |
1159 С MPEG-4 ASP кодеками, такими как <systemitem class="library">Xvid</systemitem> | |
1160 и <systemitem class="library">libavcodec</systemitem>, CQ | |
1161 меньше 0.18 обычно приводит к изображению с большим числом | |
1162 сегментов "квадратиками", из-за недостаточного числа битов для | |
1163 кодирования информации в каждом макроблоке. | |
1164 (MPEG4, как и многие другие кодеки, группирует пиксели в блоки по | |
1165 несколько пикселей для сжатия изображения; если битов не хватает, | |
1166 границы этих блоков становятся заметными.) | |
1167 Следовательно, благоразумно выбрать CQ в диапазоне от 0.20 до 0.22 | |
1168 для рипа на 1 CD и 0.26-0.28 для рипа на 2 CD при использовании | |
1169 стандартных опций кодирования. | |
1170 Более продвинутые опции кодирования, такие как указанные для | |
1171 <link linkend="menc-feat-mpeg4-lavc-example-settings"><systemitem class="library">libavcodec</systemitem></link> | |
20725 | 1172 и |
20879 | 1173 <link linkend="menc-feat-xvid-example-settings"><systemitem class="library">Xvid</systemitem></link> |
21525 | 1174 должны сделать возможным получение того же качества с CQ в диапазоне |
1175 от 0.18 до 0.20 для рипа на 1 CD и 0.24-0.26 для рипа на 2 CD. | |
1176 Используя MPEG-4 ASP кодеки, такие как | |
1177 <systemitem class="library">x264</systemitem>, Вы можете использовать | |
1178 CQ в диапазоне от 0.14 до 0.16 со стандартными опциями кодирования | |
1179 и должны суметь достичь таких низких значений, как 0.10-0.12 | |
1180 с помощью | |
1181 <link linkend="menc-feat-x264-example-settings">продвинутых опций кодирования <systemitem class="library">x264</systemitem></link>. | |
1182 </para> | |
1183 | |
1184 <para> | |
1185 Пожалуйста, обратите внимание, что CQ — лишь показательная величина, | |
1186 т.к. она зависит от кодируемого содержимого; CQ 0.18 может хорошо | |
1187 смотреться для Бергмана (Bergman), в отличии от такого фильма как | |
1188 Матрица (The Matrix), содержащего много сцен с быстрым движением. | |
1189 С другой стороны, бесполезно увеличивать CQ выше 0.30, т.к. Вы | |
1190 будете тратить биты без заметного увеличения качества. | |
1191 Так же обратите внимание, что, как было указано выше в данном | |
1192 руководстве, фильмам с низким разрешением (например, по сравнению с DVD) | |
1193 необходим более высокий CQ для того, чтоб они выглядели хорошо. | |
20725 | 1194 </para> |
1195 </sect3> | |
1196 </sect2> | |
1197 | |
21525 | 1198 <!-- ********** --> |
1199 | |
20725 | 1200 <sect2 id="menc-feat-dvd-mpeg4-filtering"> |
1201 <title>Фильтрация</title> | |
1202 | |
1203 <para> | |
21525 | 1204 Изучение использования видео фильтров <application>MEncoder</application> |
1205 важно для получения хороших результатов кодирования. | |
1206 Вся обработка видео выполняется посредством фильтров: усечение, | |
1207 масштабирование, подстройка цвета, удаление шума, увеличение | |
1208 чёткости, деинтерлейс (преобразование видео из чересстрочной | |
1209 развёртки в построчную), телесин, обратный телесин и удаление | |
1210 блочной сегментации — и это лишь некоторые из них. | |
1211 Вместе с огромным количеством поддерживаемых входных форматов, | |
1212 разнообразие фильтров, доступных в <application>MEncoder</application>, | |
1213 является одним из его основных достоинств над другими аналогичными | |
1214 программами. | |
1215 </para> | |
1216 | |
1217 <para> | |
1218 Фильтры загружаются в цепочки с помощью опции -vf: | |
1219 | |
1220 <screen>-vf фильтр1=опции,фильтр2=опции,...</screen> | |
1221 | |
1222 Большинство фильтров используют численные значения опций, | |
1223 разделённые двоеточиями, но синтаксис этих параметров различается | |
1224 у разных фильтров, так что читайте мануал для детальной | |
1225 информации о фильтрах, которые Вы желаете использовать. | |
1226 </para> | |
1227 | |
1228 <para> | |
1229 Фильтры действуют на видео в порядке их загрузки. | |
1230 Например, следующая цепочка: | |
1231 | |
1232 <screen>-vf crop=688:464:12:4,scale=640:464</screen> | |
1233 | |
1234 сперва усечёт область изображения до 688х464 с верхним левым | |
1235 углом (12,4), а затем масштабирует результат до 640х464. | |
1236 </para> | |
1237 | |
1238 <para> | |
1239 Некоторые фильтры нужно загружать в начале цепочки фильтров (или | |
1240 рядом с ним) с целью получения преимущества от использования | |
1241 информации после видеодекодера, которая будет потеряна или | |
1242 искажена другими фильтрами. | |
1243 Важнейшими примерами являются: <option>pp</option> (постобработка, | |
1244 только при выполнении операций удаления блочной сегментации | |
1245 (deblocking) или увеличения чёткости краёв (deringing)), | |
1246 <option>spp</option> (другой фильтр постобработки, служащий для | |
1247 удаления артефактов MPEG), <option>pullup</option> (обратный | |
1248 телесин), и <option>softpulldown</option> (для преобразования | |
1249 мягкого телесина в жёсткий). | |
1250 </para> | |
1251 | |
1252 <para> | |
1253 В общем случае, Вам следует делать настолько мало фильтрации, | |
1254 насколько это возможно, для того чтоб остаться близко к оригинальному | |
1255 DVD источнику. Усечение часто необходимо (как описано выше), но | |
1256 избегайте масштабирования видео. Несмотря на то, что уменьшение | |
1257 размера иногда предпочтительно при использовании больших | |
1258 квантователей, нужно избегать и того, и другого: помните, | |
1259 что мы с самого начала решили обменять биты на качество. | |
1260 </para> | |
1261 | |
1262 <para> | |
1263 Также не корректируйте гамму, контрастность, яркость и т.п.. То, | |
1264 что хорошо выглядит на Вашем мониторе, может плохо выглядеть | |
1265 на других. Коррекция должна выполняться только при воспроизведении. | |
1266 </para> | |
1267 | |
1268 <para> | |
1269 Однако, есть одна вещь, которую Вы, быть может, захотите сделать — | |
1270 это пропустить видео через очень слабый фильтр удаления шумов, | |
1271 такой как <option>-vf hqdn3d=2:1:2</option>. | |
1272 Ещё раз, причиной этому является то, что этим битам можно найти | |
1273 лучшее применение: зачем тратить их, кодируя шум, если Вы просто | |
1274 можете вернуть этот шум в процессе воспроизведения? | |
1275 Увеличение параметров для <option>hqdn3d</option> дополнительно | |
1276 улучшит сжимаемость, но увеличив значения слишком сильно, Вы рискуете | |
1277 ухудшить различимость изображения. | |
1278 Рекомендованные выше значения (<option>2:1:2</option>) слегка | |
1279 консервативны; не бойтесь экспериментировать с более высокими | |
1280 значениями и самостоятельно оценивать результаты. | |
1281 </para> | |
20725 | 1282 </sect2> |
1283 | |
21525 | 1284 <!-- ********** --> |
20725 | 1285 |
1286 <sect2 id="menc-feat-dvd-mpeg4-interlacing"> | |
1287 <title>Чересстрочная развёртка и телесин</title> | |
1288 | |
1289 <para> | |
21525 | 1290 Почти все фильмы снимаются при 24 fps [кадр/сек]. Поскольку |
1291 в NTSC ниспользуется 30000/1001 fps, нужно выполнить некоторую | |
1292 обработку для такого 24 fps видео, чтобы оно корректно | |
1293 воспроизводилось при кадровой частоте NTSC. Этот процесс называется | |
1294 3:2 пулдаун, обычно называемый телесин (поскольку пулдаун часто | |
1295 применяется в процессе показа телевизионного фильма, англ. telecine); | |
1296 и в упрощенном описании это работает путём замедления фильма до | |
1297 24000/1001 fps и повтора каждого четвёртого кадра. | |
1298 </para> | |
1299 | |
1300 <para> | |
1301 Однако, никакой специальной обработки не выполняется для видео | |
1302 на PAL DVD, которое воспроизводится при 25 fps. (Технически PAL | |
1303 может быть подверженым телесину, называемому 2:2 пулдаун, но на | |
1304 практике это не применяется). | |
1305 24 fps фильм просто проигрывается на 25 fps. В результате фильм | |
1306 воспроизводится слегка быстрее, но если Вы не пришелец, то, | |
1307 вероятно, не заметите разницы. | |
1308 У большинства PAL DVD аудио корректируемо по высоте звука, так | |
1309 что, воспроизводясь при 25 fps, оно звучит нормально, даже если | |
1310 аудиодорожка (и, следовательно, весь фильм) проигрываются на | |
1311 4% быстрее, чем NTSC DVD. | |
1312 </para> | |
1313 | |
1314 <para> | |
1315 Поскольку видео на PAL DVD не переделывается, Вам не стоит | |
1316 беспокоится о частоте кадров. У источника 25 fps и у Вашего | |
1317 рипа будет 25 fps. Однако, если Вы делаете рип NTSC DVD фильма, | |
1318 Вам, быть может, придётся выполнить обратный телесин. | |
1319 </para> | |
1320 | |
1321 <para> | |
1322 Для фильмов, снятых на 24 fps, видео на NTSC DVD идёт либо с телесином | |
1323 30000/1001, либо с построчной развёрткой 24000/1001 fps и | |
1324 предназначается для телесина на лету с помощью DVD плеера. | |
1325 С другой стороны, TV сериалы идут обычно только с чересстрочной развёрткой, | |
1326 но без телесина. Это не строгое правило: есть сериалы с | |
1327 чересстрочной развёрткой (например, Баффи, Убийца Вампиров | |
1328 [Buffy the Vampire Slayer]), в то время как другие представляют | |
1329 собой смесь построчной и чересстрочной развёртки (такие как | |
1330 Ангел [Angel] или 24). | |
1331 </para> | |
1332 | |
1333 <para> | |
1334 Настоятельно рекомендуется прочитать раздел о | |
1335 <link linkend="menc-feat-telecine">работе с телесином и чересстрочной развёрткой в NTSC DVD</link> | |
1336 для изучения способов обработки в разных ситуациях. | |
1337 </para> | |
1338 | |
1339 <para> | |
1340 Однако, если Вы преимущественно делаете рипы фильмов, Вы, скорее | |
1341 всего, имеете дело с 24 fps видео либо с построчной развёрткой, | |
1342 либо с подвергнутым телесину; в последнем случае Вы можете использовать | |
1343 <option>pullup</option> фильтр: <option>-vf | |
1344 pullup,softskip</option>. | |
1345 </para> | |
20725 | 1346 </sect2> |
1347 | |
21525 | 1348 <!-- ********** --> |
1349 | |
20725 | 1350 <sect2 id="menc-feat-dvd-mpeg4-encoding-interlaced"> |
1351 <title>Кодирование чересстрочного видео</title> | |
1352 | |
1353 <para> | |
21525 | 1354 Если Вы желаете кодировать фильм с чересстрочной развёрткой |
1355 (NTSC или PAL видео), Вам нужно решить, будете ли Вы его | |
1356 преобразовывать в построчную развёртку или нет. | |
1357 Хотя такое преобразование (деинтерлейс) сделает Ваш фильм | |
1358 пригодным для дисплеев с построчной развёрткой, таких как | |
1359 компьютерные мониторы и проекторы, это будет иметь свою цену: | |
1360 частота полей уменьшится вдвое от 50 или 60000/1001 до 25 или | |
1361 30000/1001 поля в секунду, и примерно половина информации в | |
1362 Вашем фильме будет потеряна в сценах со значительным движением. | |
1363 </para> | |
1364 | |
1365 <para> | |
1366 Поэтому, если Вы кодируете для высококачественных архивных целей, | |
1367 не рекомендуется делать деинтерлейс. Вы всегда можете преобразовать | |
1368 развёртку фильма в процессе воспроизведения (при воспроизведении | |
1369 на устройствах с построчной развёрткой). | |
1370 Мощность современных компьютеров вынуждает плееры использовать | |
1371 фильтр деинтерлейса, что слегка ухудшает качество изображения. | |
1372 Но плееры будущего будут способны имитировать дисплей TV с | |
1373 чересстрочной развёрткой, выполняя деинтерлейс на полной частоте | |
1374 полей и интерполируя 50 или 60000/1001 кадров в секунду для | |
1375 чересстрочного видео. | |
1376 </para> | |
1377 | |
1378 <para> | |
1379 С чересстрочным видео нужно работать особым образом: | |
20725 | 1380 </para> |
1381 | |
1382 <orderedlist> | |
1383 <listitem><para> | |
1384 Высота усечения и смещение по оси y должны быть кратны 4. | |
1385 </para></listitem> | |
1386 <listitem><para> | |
1387 Любое вертикальное масштабирование должно выполняться в режиме | |
1388 чересстрочной развёртки. | |
1389 </para></listitem> | |
1390 <listitem><para> | |
1391 Фильтры постобработки и удаления шума могут не работать как | |
1392 ожидается, только если Вы особо не позаботитесь об их | |
1393 одновременном применении на частоте полей, иначе они могут | |
1394 повредить видео при неверном использовании. | |
1395 </para></listitem> | |
1396 </orderedlist> | |
1397 | |
1398 <para> | |
1399 Учитывая вышесказанное, вот наш первый пример: | |
1400 <screen> | |
21525 | 1401 mencoder <replaceable>захват.avi</replaceable> -mc 0 -oac lavc -ovc lavc -lavcopts \ |
1402 vcodec=mpeg2video:vbitrate=6000:ilme:ildct:acodec=mp2:abitrate=224 | |
20725 | 1403 </screen> |
21525 | 1404 Обратите внимание на опции <option>ilme</option> и <option>ildct</option>. |
20725 | 1405 </para> |
1406 </sect2> | |
1407 | |
21525 | 1408 <!-- ********** --> |
20725 | 1409 |
1410 <sect2 id="menc-feat-dvd-mpeg4-av-sync"> | |
1411 <title>Замечания об аудио/видео синхронизации</title> | |
1412 | |
1413 <para> | |
21525 | 1414 Алгоритмы аудио/видео (A/V) синхронизации <application>MEncoder</application> |
1415 были разработаны с целью восстановления файлов с повреждённой | |
1416 синхронизацией. | |
1417 Однако, в ряде случаев они могут привести к ненужному пропуску | |
1418 или повторению кадров и, возможно, к лёгкой A/V десинхронизации | |
1419 корректных входных данных (конечно, проблемы A/V синхронизации | |
1420 возникают только при обработке или копировании аудиотрека при | |
1421 кодировании видео, что настоятельно рекомендуется). | |
1422 Поэтому Вы можете переключиться на базовую A/V синхронизацию | |
1423 с помощью опции <option>-mc 0</option> или разместить это в | |
1424 конфигурационном файле <systemitem>~/.mplayer/mencoder</systemitem>, | |
1425 если Вы работаете только с хорошими источниками (DVD, TV-захват, | |
1426 высококачественные MPEG-4 рипы и т.п.), а не с повреждёнными | |
1427 файлами ASF/RM/MOV. | |
1428 </para> | |
1429 | |
1430 <para> | |
1431 Если Вы хотите дополнительно защититься от странных пропусков | |
1432 и повторений кадров, вы можете одновременно использовать опции | |
1433 <option>-mc 0</option> и <option>-noskip</option>. | |
1434 Это предотвратит <emphasis>любую</emphasis> A/V коррекцию, и | |
1435 будет копировать кадры один в один, так что Вы не сможете это | |
1436 использовать, если будете применять какие-либо фильтры, которые | |
1437 непредсказуемо добавляют или отбрасывают кадры, либо если у | |
1438 Вашего входного файла переменный битопоток! | |
1439 Поэтому использование <option>-noskip</option> в общем случае не | |
1440 рекомендуется. | |
1441 </para> | |
1442 | |
1443 <para> | |
1444 Сообщалось о том, что так называемое трёхпроходное аудиокодирование, | |
1445 поддерживаемое <application>MEncoder</application>, вызывало | |
1446 A/V десинхронизацию. | |
1447 Это наверняка произойдёт при использовании совместно с некоторыми | |
1448 фильтрами, поэтому сейчас <emphasis>не</emphasis> рекомендуется | |
1449 использовать трёхпроходный аудио режим. | |
1450 Эта возможность оставлена только для совместимости и для опытных | |
1451 пользователей, понимающих когда это безопасно, а когда нет. | |
1452 Если Вы ранее никогда не слышали о трёхпроходном режиме, забудьте | |
1453 даже о том, что мы его упоминали! | |
1454 </para> | |
1455 | |
1456 <para> | |
1457 Также были сообщения об A/V десинхронизации при кодировании | |
1458 со стандартного ввода (stdin) с помощью <application>MEncoder</application>. | |
1459 Не делайте этого! Всегда взамен используйте файл или CD/DVD и т.п. | |
1460 устройство. | |
20725 | 1461 </para> |
1462 </sect2> | |
1463 | |
21525 | 1464 <!-- ********** --> |
1465 | |
20725 | 1466 <sect2 id="menc-feat-dvd-mpeg4-codec"> |
1467 <title>Выбор видеокодека</title> | |
1468 | |
1469 <para> | |
21525 | 1470 То, какой видеокодек лучше выбрать, зависит от нескольких |
1471 факторов, таких как размер, качество, устойчивость к ошибкам, | |
1472 практичность и распостранённость, многие из которых сильно | |
1473 зависят от личных предпочтений и технических ограничений. | |
20725 | 1474 </para> |
1475 <itemizedlist> | |
21525 | 1476 <listitem> |
1477 <para> | |
20725 | 1478 <emphasis role="bold">Эффективность сжатия</emphasis>: |
21525 | 1479 Достаточно очевидно, что большинство кодеков нового поколения |
1480 разработаны для увеличения качества и степени сжатия. | |
1481 Поэтому, авторы данного руководства и многие другие люди полагают, | |
1482 что Вы не можете ошибиться | |
1483 <footnote id='fn-menc-feat-dvd-mpeg4-codec-cpu'><para> | |
1484 Несмотря на это, будьте осторожны: для декодирования MPEG-4 AVC | |
1485 видео с DVD разрешением необходима быстрая машина (например, | |
1486 Pentium 4 свыше 1.5 ГГц или Pentium M свыше 1 ГГц). | |
1487 </para></footnote>, | |
1488 выбирая MPEG-4 AVC кодеки (например, | |
1489 <systemitem class="library">x264</systemitem>) | |
1490 вместо таких MPEG-4 ASP кодеков, как | |
1491 <systemitem class="library">libavcodec</systemitem> MPEG-4 или | |
1492 <systemitem class="library">Xvid</systemitem>. | |
1493 (Опытные разработчики кодеков могут быть заинтересованы в | |
1494 ознакомлении с точкой зрения Михаэля Найдермауэра (Michael | |
1495 Niedermayer) | |
1496 "<ulink url="http://guru.multimedia.cx/?p=10">почему MPEG4-ASP отстой</ulink>".) | |
1497 Аналогично, Вы должны получить лучшее качество с MPEG-4 ASP, по | |
1498 сравнению с MPEG-2 кодеками. | |
20725 | 1499 </para> |
21525 | 1500 |
20725 | 1501 <para> |
21525 | 1502 Однако, новые кодеки, находящиеся в интенсивной разработке, |
1503 могут страдать от ещё не замеченных ошибок, которые могут | |
1504 испортить кодирование. Просто это плата за использование | |
1505 передовых технологий. | |
20725 | 1506 </para> |
21525 | 1507 |
20725 | 1508 <para> |
21525 | 1509 Более существенно то, что для начала использования нового кодека |
1510 необходимо потратить время на изучение его опций так, чтобы Вы | |
1511 знали, что нужно подстраивать для достижения заданного качества | |
1512 изображения. | |
1513 </para> | |
1514 </listitem> | |
1515 | |
1516 <listitem><para> | |
20725 | 1517 <emphasis role="bold">Аппаратная совместимость</emphasis>: |
21525 | 1518 Обычно необходимо длительное время для включения поддержки |
1519 последних видеокодеков в автономные видеоплееры. | |
1520 В итоге, большинство поддерживает только MPEG-1 (наподобие | |
1521 VCD, XVCD и KVCD), MPEG-2 (например, DVD, SVCD и KVCD) и MPEG-4 | |
1522 ASP (например, DivX, | |
1523 <systemitem class="library">libavcodec</systemitem> LMP4 и | |
1524 <systemitem class="library">Xvid</systemitem>) | |
1525 (Осторожно: обычно поддерживаются не все возможности MPEG-4 ASP). | |
1526 Пожалуйста, обратитесь к технической спецификации Вашего плеера | |
1527 (если она доступна) или к гугл (google) для детальной информации. | |
1528 </para></listitem> | |
1529 | |
1530 <listitem> | |
1531 <para> | |
20725 | 1532 <emphasis role="bold">Лучшее соотношение качества и времени кодирования</emphasis>: |
21525 | 1533 Кодеки, уже использующиеся определённое время (например, |
1534 <systemitem class="library">libavcodec</systemitem> MPEG-4 и | |
1535 <systemitem class="library">Xvid</systemitem>) обычно сильно | |
1536 оптимизированы всевозможными остроумными алгоритмами и | |
1537 ассемблерным SIMD кодом. Поэтому они обладают тенденцией | |
1538 достижения лучшего соотношения качества к времени кодирования. | |
1539 Однако, у них могут быть некоторые очень продвинутые опции, | |
1540 которые, будучи включенными, сделают кодирование очень медленным | |
1541 ради несущественного выигрыша. | |
20725 | 1542 </para> |
21525 | 1543 |
20725 | 1544 <para> |
21525 | 1545 Если Вам нужна высокая скорость, примерно придерживайтесь настроек |
1546 видеокодека по умолчанию (хотя Вам стоит попробовать другие опции, | |
1547 упоминаемые в иных разделах данного руководства). | |
20725 | 1548 </para> |
21525 | 1549 |
20725 | 1550 <para> |
21525 | 1551 Вы так же можете рассмотреть вариант использования многопоточного |
1552 кодека, хотя это полезно только для пользователей машин с | |
1553 несколькими процессорами. | |
1554 <systemitem class="library">libavcodec</systemitem> MPEG-4 позволяет | |
1555 это, но выигрыш в скорости ограничен и есть небольшой отрицательный | |
1556 эффект для качества картинки. | |
1557 Многопоточное кодирование <systemitem class="library">Xvid</systemitem>, | |
1558 включаемое опцией <option>threads</option>, может использоваться для | |
1559 ускорения кодирования (на примерно 40-60% в типичных случаях) | |
1560 с небольшим ухудшением картинки или вообще без него. | |
1561 <systemitem class="library">x264</systemitem> также позволяет | |
1562 многопоточное кодирование, что обычно ускоряет процесс на 15-30% | |
1563 (в зависимости от настроек кодирования) с уменьшением PSNR примерно | |
1564 на 0.05 дБ. | |
1565 </para> | |
1566 </listitem> | |
1567 | |
1568 <listitem> | |
1569 <para> | |
20725 | 1570 <emphasis role="bold">Личные предпочтения</emphasis>: |
21525 | 1571 Здесь всё становится почти неразумным: из-за тех же причин, по |
1572 которым одни придерживаются DivX 3 в течении лет, в то время | |
1573 как новые кодеки уже творят чудеса, другие люди предпочитают | |
1574 <systemitem class="library">Xvid</systemitem> или | |
1575 <systemitem class="library">libavcodec</systemitem> MPEG-4 | |
1576 использованиию <systemitem class="library">x264</systemitem>. | |
20725 | 1577 </para> |
21525 | 1578 |
20725 | 1579 <para> |
21525 | 1580 Вам нужно принимать решение самостоятельно; не слушайте советов |
1581 людей, признающих только один кодек. | |
1582 Сделайте несколько образцов клипов из искомых источников и | |
1583 сравните разные опции кодирования и кодеки, с целью выбора | |
1584 того, что Вам наиболее подходит. | |
1585 Лучший кодек — это тот, которым Вы сами овладели, и | |
1586 который выглядит лучше всего для Ваших глаз на Вашем дисплее | |
1587 <footnote id='fn-menc-feat-dvd-mpeg4-codec-playback'><para> | |
1588 Один и тот же результат кодирования может не выглядеть таким же | |
1589 на чьём-либо другом мониторе или при воспроизведении с помощью | |
1590 другого декодера, так что проверяйте Ваши результаты кодирования | |
1591 на жизнеспособность, воспроизводя их в разных начальных условиях. | |
1592 </para></footnote>! | |
1593 </para> | |
1594 </listitem> | |
20725 | 1595 </itemizedlist> |
21525 | 1596 |
1597 <para> | |
1598 Пожалуйста, обратитесь к разделу | |
1599 <link linkend="menc-feat-selecting-codec">выбор кодеков и форматов контейнера</link> | |
1600 для получения списка поддерживаемых кодеков. | |
20725 | 1601 </para> |
1602 </sect2> | |
1603 | |
21525 | 1604 <!-- ********** --> |
1605 | |
20725 | 1606 <sect2 id="menc-feat-dvd-mpeg4-audio"> |
1607 <title>Аудио</title> | |
1608 | |
1609 <para> | |
21525 | 1610 Аудио — это гораздо более простая проблема: если Вы |
1611 беспокоитесь о качестве, просто оставьте всё как есть. | |
1612 Даже потоки AC3 5.1 не более чем 448 Кбит/с и они стоят каждого | |
1613 бита. Вы можете соблазниться перекодированием аудио в | |
1614 высококачественный Vorbis (он же ogg формат), но лишь то, что | |
1615 у Вас сегодня нет A/V приёмника для пропускания AC3, не означает, | |
1616 что у Вас не будет его завтра. Для жизнеспособности Ваших DVD | |
1617 рипов в будущем, сохраняйте поток AC3. | |
1618 Вы можете сохранить поток AC3, копируя его непосредственно в | |
1619 видеопоток <link linkend="menc-feat-mpeg4">в процессе кодирования</link>. | |
1620 Вы также можете извлечь AC3 поток с целью мультиплексирования его | |
1621 в контейнеры наподобие NUT или Matroska (Матрёшка). | |
1622 <screen> | |
1623 mplayer <replaceable>файл_источника.vob</replaceable> -aid 129 -dumpaudio -dumpfile <replaceable>звук.ac3</replaceable></screen> | |
1624 сохранит в файл <replaceable>звук.ac3</replaceable> аудиодорожку | |
1625 с номером 129 из файла | |
1626 <replaceable>файл_источника.vob</replaceable> (Обратите внимание: | |
1627 DVD VOB файлы обычно импользуют нумерацию аудио, отличную от | |
1628 стандартной, что означает, что аудиодорожка VOB 129 — это вторая | |
1629 аудиодорожка файла). | |
1630 </para> | |
1631 | |
1632 <para> | |
1633 Но иногда у Вас действительно нет иного выбора, чем далее сжимать | |
1634 звук для того, чтоб больше битов могло быть потрачено на видео. | |
1635 Большинство людей предпочитают сжимать звук с помощью MP3 или | |
1636 Vorbis аудиокодеков. | |
1637 Последний является очень эффективным, но MP3 лучше поддерживается | |
1638 аппаратными плеерами, хотя эта тенденция меняется. | |
1639 </para> | |
1640 | |
1641 <para> | |
1642 <emphasis>Не</emphasis> используйте <option>-nosound</option> при | |
1643 кодировании файла с аудио, даже если Вы будете позже кодировать и | |
1644 мультеплексировать аудио отдельно. | |
1645 Хотя это может работать в идеальных случаях, использование | |
1646 <option>-nosound</option> обычно скрывает ряд проблем в Ваших | |
1647 настройках кодирования в командной строке. | |
1648 Другими словами, наличие звуковой дорожки в процессе кодирования | |
1649 гарантирует Вам, что в случае отсутствия сообщений, подобных | |
1650 <quote>Слишком много аудиопакетов в буфере</quote>, у Вас будет | |
1651 получена правильная синхронизация. | |
1652 </para> | |
1653 | |
1654 <para> | |
1655 Вам необходим <application>MEncoder</application> для обработки | |
1656 звука. | |
1657 Например, Вы можете копировать исходную звуковую дорожку в | |
1658 процессе кодирования с помощью <option>-oac copy</option> или | |
1659 преобразовать её в "лёгкий" 4 кГц моно WAV PCM с помощью | |
1660 <option>-oac pcm -channels 1 -srate 4000</option>. | |
1661 Иначе, в ряде случаев, будет создаваться видео файл, | |
1662 десинхронизированный с аудио. | |
1663 Такие случаи происходят, когда число кадров видео исходного файла | |
1664 не совпадает с полной длиной кадров аудио, или когда были | |
1665 разрывы/сшивания потока, где появились пропущенные или излишние | |
1666 аудиокадры. | |
1667 Правильным решением подобных проблем является вставка тишины или | |
1668 усечение аудио в таких точках. | |
1669 Однако, <application>MPlayer</application> не может это сделать | |
1670 и если Вы демультиплексируете AC3 аудио и кодируете его отдельным | |
1671 приложением (или создаёте дамп в PCM с помощью | |
1672 <application>MPlayer</application>), сшивания останутся | |
1673 нескорректированными и единственный испособ их исправить — | |
1674 пропускать/дублировать видеокадры в местах сшивки. | |
1675 Пока <application>MEncoder</application> видит аудио при | |
1676 кодировании видео, он может выполнять этот пропуск/дублирование | |
1677 (что обычно не вызывыет проблем, т.к. происходит при полностью | |
1678 чёрных кадрах или при смене сцен), но если | |
1679 <application>MEncoder</application> не доступно аудио, он просто | |
1680 будет обрабатывать все кадры "как есть" и они не будут совпадать | |
1681 с окончательным аудиопотоком, когда Вы, например, объедините | |
1682 аудио и видео дорожки в Matroska файл. | |
1683 </para> | |
1684 | |
1685 <para> | |
1686 Прежде всего, Вам необходимо преобразовать DVD звук в WAV файл, | |
1687 который может использоваться аудиокодеком в качестве входных | |
1688 данных. Например: | |
1689 <screen> | |
1690 mplayer <replaceable>исходный_файл.vob</replaceable> -ao pcm:file=<replaceable>звук.wav</replaceable> | |
1691 -vc dummy -aid 1 -vo null | |
1692 </screen> | |
1693 сохранит вторую аудиодорожку из файла | |
1694 <replaceable>исходный_файл.vob</replaceable> в файл | |
1695 <replaceable>звук.wav</replaceable>. | |
1696 Возможно, Вы захотите нормализировать звук перед кодированием, | |
1697 поскольку аудиодорожки DVD обычно записываются с маленькой | |
1698 громкостью. | |
1699 Вы можете использовать, например, утилиту <application>normalize</application>, | |
1700 доступную в большинстве дистрибутивов. | |
1701 Если вы пользуетесь Window$, утилита <application>BeSweet</application> | |
1702 делает то же самое. | |
1703 Вы можете сжать в Vorbis или MP3. Например: | |
1704 <screen>oggenc -q1 <replaceable>звук.wav</replaceable></screen> | |
1705 кодирует <replaceable>звук.wav</replaceable> с качеством 1, | |
1706 что примерно эквивалентно 80 Кб/с и является минимальным качеством, | |
1707 при котором Вам нужно кодировать, если Вы заботитесь о качестве. | |
1708 Пожалуйста, обратите внимание, что <application>MEncoder</application> | |
1709 на данный момент не поддерживает мультиплексирование аудиопотоков | |
1710 Vorbis в выходной файл, поскольку он поддерживает только AVI и | |
1711 MPEG контейнеры для выходных файлов, использование каждого из | |
1712 которых может привести к проблемам A/V синхронизации с | |
1713 некоторыми плеерами, в случае когда AVI файл содержит VBR | |
1714 аудиопотоки наподобие Vorbis. | |
1715 Не беспокойтесь, в данном документе будет рассказано как Вы | |
1716 можете это сделать с помощью сторонних программ. | |
1717 </para> | |
20725 | 1718 </sect2> |
1719 | |
21525 | 1720 <!-- ********** --> |
20725 | 1721 |
1722 <sect2 id="menc-feat-dvd-mpeg4-muxing"> | |
1723 <title>Мультиплексирование</title> | |
21525 | 1724 |
1725 <para> | |
1726 Теперь, после того как Вы кодировали видео, скорее всего, Вы | |
1727 захотите мультиплексировать его с одним или несколькими | |
1728 аудиопотоками в такие видео контейнеры как AVI, MPEG, | |
1729 Matroska или NUT. | |
1730 На данный момент встроенная поддержка вывода аудио и видео в | |
1731 <application>MEncoder</application> есть только для форматов | |
1732 контейнеров MPEG и AVI. | |
1733 Например: | |
1734 <screen> | |
1735 mencoder -oac copy -ovc copy -o <replaceable>выходной_фильм.avi</replaceable> \ | |
1736 -audiofile <replaceable>исходный_звук.mp2</replaceable> <replaceable>исходное_видео.avi</replaceable> | |
1737 </screen> | |
1738 Это объединит видеофайл <replaceable>исходное_видео.avi</replaceable> | |
1739 и аудиофайл <replaceable>исходный_звук.mp2</replaceable> | |
1740 в AVI файл <replaceable>выходной_фильм.avi</replaceable>. | |
1741 Эта команда работает с MPEG-1 слой I, II и III (более | |
1742 известный как MP3) аудио, WAV, а также с некоторыми иными | |
1743 форматами аудио. | |
1744 </para> | |
1745 | |
1746 <para> | |
1747 <application>MEncoder</application> | |
1748 обладает экспериментальной поддержкой | |
1749 <systemitem class="library">libavformat</systemitem> — | |
1750 библиотеки из проекта FFmpeg, поддерживающей мультиплексирование | |
1751 и демультиплексирование множества контейнеров. | |
1752 Например: | |
1753 <screen> | |
1754 mencoder -oac copy -ovc copy -o <replaceable>выходной_фильм.asf</replaceable> \ | |
1755 -audiofile <replaceable>исходный_звук.mp2</replaceable> <replaceable>исходное_видео.avi</replaceable> \ | |
1756 -of lavf -lavfopts format=asf | |
1757 </screen> | |
1758 Это сделает то же самое, что и предыдущий пример, но выходным | |
1759 контейнером будет ASF. | |
1760 Пожалуйста, обратите внимание, что эта поддержка весьма | |
1761 экспериментальна (но становится лучше c каждым днём), и будет | |
1762 работать только в случае компиляции <application>MPlayer</application> | |
1763 с включенной поддержкой | |
1764 <systemitem class="library">libavformat</systemitem> (что означает, | |
1765 что в большинстве случаев бинарная версия из пакетов не будет | |
1766 работать). | |
20725 | 1767 </para> |
1768 | |
1769 | |
1770 <sect3 id="menc-feat-dvd-mpeg4-muxing-filter-issues"> | |
1771 <title>Улучшение мультиплексирования и надёжности A/V синхронизации</title> | |
21525 | 1772 |
1773 <para> | |
1774 Вы можете столкнуться с некоторыми серьёзными проблемами A/V | |
1775 синхронизации при попытке мультиплексирования вашего видео | |
1776 с некоторыми аудиодорожками, где, как бы Вы не подбирали задержку | |
1777 аудио, никогда не получается правильная синхронизация. | |
1778 Это может происходить при использовании некоторых видеофильтров, | |
1779 пропускающих или дублирующих некоторые кадры, например фильтров | |
1780 обратного телесина. | |
1781 Настоятельно рекомендуется добавлять видеофильтр | |
1782 <option>harddup</option> в конце цепочки фильтров для избежания | |
1783 подобных проблем. | |
1784 </para> | |
1785 | |
1786 <para> | |
1787 Без опции <option>harddup</option>, в случае когда | |
1788 <application>MEncoder</application> хочет дублировать кадр, он | |
1789 полагается на то, что мультиплексор расположит отметку в | |
1790 контейнере таким образом, что последний кадр будет повторен для | |
1791 достижения синхронизации без реальной записи кадра. | |
1792 С опцией <option>harddup</option>, <application>MEncoder</application> | |
1793 вместо этого просто ещё раз поместит последний кадр в цепочку | |
1794 фильтров. | |
1795 Это означает, что кодер получит <emphasis>точно</emphasis> | |
1796 такой же кадр дважды и сожмёт его. | |
1797 Это приведёт у несколько большему файлу, но избавит от проблем | |
1798 при демультиплексировании или ремультиплексировании с другими | |
1799 форматами контейнеров. | |
1800 </para> | |
1801 | |
1802 <para> | |
1803 Также у Вас может не быть иного выбора, как использовать | |
1804 <option>harddup</option> с форматами контейнеров, которые | |
1805 не слишком плотно связаны с | |
1806 <application>MEncoder</application>, например, с форматами, | |
1807 поддерживаемыми с помощью | |
1808 <systemitem class="library">libavformat</systemitem>, | |
1809 которые могут не поддерживать дублирование кадров на уровне | |
1810 контейнера. | |
20725 | 1811 </para> |
1812 </sect3> | |
1813 | |
1814 | |
1815 <sect3 id="menc-feat-dvd-mpeg4-muxing-avi-limitations"> | |
1816 <title>Ограничения контейнера AVI</title> | |
21525 | 1817 |
1818 <para> | |
1819 Хотя это самый широко распостранённый формат контейнера после | |
1820 MPEG-1, он также обладает некоторыми существенными недостатками. | |
1821 Пожалуй, они наиболее очевидны в его избыточности. | |
1822 Для каждой цепочки AVI файла теряется 24 байта на заголовки и | |
1823 индекс. | |
1824 Это приводит к чуть более 5 МБ/час или 1.0-2.5% избыточности | |
1825 для 700 МБ фильма. Это не кажется большим, но может означать | |
1826 разницу между возможностью использования 700 кбит/сек или | |
1827 714 кбит/сек в случаях, когда каждый бит на счету. | |
1828 </para> | |
1829 | |
1830 <para> | |
1831 В дополнение к малой эффективности, AVI также обладает следующими | |
1832 серьёзными ограничениями: | |
20725 | 1833 </para> |
1834 | |
1835 <orderedlist> | |
21525 | 1836 <listitem><para> |
20725 | 1837 Может быть сохранено только содержимое с фиксированной частотой |
1838 кадров. В частности, это особенно ограничивает, когда Ваш | |
1839 исходный материал смешанного содержимого: например, является | |
1840 смесью NTSC видео и киноматериала. | |
1841 В действительности, есть хаки, позволяющие сохранять содержимое | |
1842 с переменным fps в AVI, но они увеличивают (и без того большую) | |
1843 избыточность впятеро или более того и поэтому непрактичны. | |
21525 | 1844 </para></listitem> |
1845 <listitem><para> | |
20725 | 1846 Аудио в AVI файлах должно быть или с постоянным битпотоком (CBR) |
1847 или с постоянным размером кадра (т.е. все кадры декодируются | |
1848 в одно и то же число выборок). | |
1849 К сожалению, самый эффективный кодек, Vorbis, не удовлетворяет | |
1850 ни одному из данных требований. | |
1851 Поэтому, если Вы планируете сохранять Ваш фильм в AVI, Вы должны | |
1852 использовать менее эффективный кодек, такой как MP3 или AC3. | |
21525 | 1853 </para></listitem> |
20725 | 1854 </orderedlist> |
1855 | |
1856 <para> | |
21525 | 1857 Сказав всё это, отметим, что <application>MEncoder</application> |
1858 на данный момент не поддерживает вывод с переменным fps или | |
1859 Vorbis кодирование. | |
1860 Поэтому Вы можете не рассматривать всё это как ограничения, если | |
1861 <application>MEncoder</application> — это единственный | |
1862 инструмент, который Вы используете для кодирования. | |
1863 Однако, возможно использовать <application>MEncoder</application> | |
1864 только для кодирования видео и затем использовать внешние | |
1865 утилиты для кодирования аудио и мультиплексирования его в | |
1866 контейнер другого формата. | |
20725 | 1867 </para> |
1868 </sect3> | |
1869 | |
21525 | 1870 |
20725 | 1871 <sect3 id="menc-feat-dvd-mpeg4-muxing-matroska"> |
1872 <title>Мультиплексирование в контейнер Matroska (Матрёшка)</title> | |
21525 | 1873 |
1874 <para> | |
1875 Matroska — это свободный, открытый стандарт формата | |
1876 контейнера, нацеленный на предоставление большого количества | |
1877 продвинутых возможностей, которые старые контейнеры (наподобие | |
1878 AVI) не поддерживают. | |
1879 Например, Matroska поддерживает аудиосодержимое с переменным | |
1880 битпотоком (VBR), переменные частоты кадров (VFR), разделы, | |
1881 файловые вложения, код обнаружения ошибок (EDC) и современные | |
1882 A/V кодеки, такие как "Продвинутое Аудио Кодирование" ("Advanced | |
1883 Audio Coding", AAC), "Vorbis" или "MPEG-4 AVC" (H.264), также | |
1884 не поддерживаемые AVI. | |
1885 </para> | |
1886 | |
1887 <para> | |
1888 Утилиты, необходимые для создания Matroska файлов, сообща | |
1889 называются <application>mkvtoolnix</application>, и доступны | |
1890 для большиства Unix платформ, так же как и для Window$. | |
1891 Поскольку Matroska — открытый формат, Вы можете найти | |
1892 иные утилиты, которые лучше Вам подходят, но поскольку | |
1893 <application>mkvtoolnix</application> — наиболее общие | |
1894 и поддерживаются самой командой разработчиков Matroska, мы | |
1895 будем обсуждать только их использование. | |
1896 </para> | |
1897 | |
1898 <para> | |
1899 Возможно, самым простым способом начать использовать Matroska | |
1900 является использование <application>MMG</application>, | |
1901 графической оболочки, поставляемой с | |
1902 <application>mkvtoolnix</application>. Следуйте | |
1903 <ulink url="http://www.bunkus.org/videotools/mkvtoolnix/doc/mkvmerge-gui.html">руководству к mkvmerge GUI (mmg)</ulink>. | |
1904 </para> | |
1905 | |
1906 <para> | |
1907 Также Вы можете мультиплексировать аудио и видео файлы используя | |
1908 командную строку: | |
1909 <screen> | |
1910 mkvmerge -o <replaceable>выходной_файл.mkv</replaceable> <replaceable>входное_видео.avi</replaceable> <replaceable>входное_аудио1.mp3</replaceable> <replaceable>входное_аудио2.ac3</replaceable> | |
1911 </screen> | |
1912 Это объединит видеофайл <replaceable>входное_видео.avi</replaceable> | |
1913 и два аудиофайла <replaceable>входное_аудио1.mp3</replaceable> | |
1914 и <replaceable>входное_аудио2.ac3</replaceable> в Matroska | |
1915 файл <replaceable>выходной_файл.mkv</replaceable>. | |
1916 Как было отмечено ранее, Matroska способна реализовать гораздо | |
1917 большее, например, множественные аудиодорожки (включая тонкую | |
1918 настройку аудио/видео синхронизации), разделы, субтитры, | |
1919 разбиение и т.д.. | |
1920 Пожалуйста, обратитесь к документации на эти приложения для | |
1921 деталей. | |
1922 </para> | |
20725 | 1923 </sect3> |
1924 </sect2> | |
1925 </sect1> | |
1926 | |
21525 | 1927 |
1928 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> | |
1929 | |
1930 | |
20725 | 1931 <sect1 id="menc-feat-telecine"> |
1932 <title>How to deal with telecine and interlacing within NTSC DVDs</title> | |
1933 | |
1934 <sect2 id="menc-feat-telecine-intro"> | |
1935 <title>Introduction</title> | |
21525 | 1936 |
20725 | 1937 <formalpara> |
1938 <title>What is telecine?</title> | |
1939 <para> | |
21525 | 1940 If you do not understand much of what is written in this document, |
1941 read the | |
1942 <ulink url="http://en.wikipedia.org/wiki/Telecine">Wikipedia entry on telecine</ulink>. | |
1943 It is an understandable and reasonably comprehensive | |
1944 description of what telecine is. | |
20725 | 1945 </para></formalpara> |
1946 | |
1947 <formalpara> | |
1948 <title>A note about the numbers.</title> | |
1949 <para> | |
21525 | 1950 Many documents, including the guide linked above, refer to the fields |
1951 per second value of NTSC video as 59.94 and the corresponding frames | |
1952 per second values as 29.97 (for telecined and interlaced) and 23.976 | |
1953 (for progressive). For simplicity, some documents even round these | |
1954 numbers to 60, 30, and 24. | |
20725 | 1955 </para></formalpara> |
1956 | |
1957 <para> | |
21525 | 1958 Strictly speaking, all those numbers are approximations. Black and |
1959 white NTSC video was exactly 60 fields per second, but 60000/1001 | |
1960 was later chosen to accomodate color data while remaining compatible | |
1961 with contemporary black and white televisions. Digital NTSC video | |
1962 (such as on a DVD) is also 60000/1001 fields per second. From this, | |
1963 interlaced and telecined video are derived to be 30000/1001 frames | |
1964 per second; progressive video is 24000/1001 frames per second. | |
1965 </para> | |
1966 | |
1967 <para> | |
1968 Older versions of the <application>MEncoder</application> documentation | |
1969 and many archived mailing list posts refer to 59.94, 29.97, and 23.976. | |
1970 All <application>MEncoder</application> documentation has been updated | |
1971 to use the fractional values, and you should use them too. | |
1972 </para> | |
1973 | |
1974 <para> | |
1975 <option>-ofps 23.976</option> is incorrect. | |
1976 <option>-ofps 24000/1001</option> should be used instead. | |
20725 | 1977 </para> |
1978 | |
1979 <formalpara> | |
1980 <title>How telecine is used.</title> | |
1981 <para> | |
21525 | 1982 All video intended to be displayed on an NTSC |
1983 television set must be 60000/1001 fields per second. Made-for-TV movies 4 | |
1984 and shows are often filmed directly at 60000/1001 fields per second, but | |
1985 the majority of cinema is filmed at 24 or 24000/1001 frames per | |
1986 second. When cinematic movie DVDs are mastered, the video is then | |
1987 converted for television using a process called telecine. | |
20725 | 1988 </para></formalpara> |
1989 | |
1990 <para> | |
21525 | 1991 On a DVD, the video is never actually stored as 60000/1001 fields per |
1992 second. For video that was originally 60000/1001, each pair of fields is | |
1993 combined to form a frame, resulting in 30000/1001 frames per | |
1994 second. Hardware DVD players then read a flag embedded in the video | |
1995 stream to determine whether the odd- or even-numbered lines should | |
1996 form the first field. | |
1997 </para> | |
1998 | |
1999 <para> | |
2000 Usually, 24000/1001 frames per second content stays as it is when | |
2001 encoded for a DVD, and the DVD player must perform telecining | |
2002 on-the-fly. Sometimes, however, the video is telecined | |
2003 <emphasis>before</emphasis> being stored on the DVD; even though it | |
2004 was originally 24000/1001 frames per second, it becomes 60000/1001 fields per | |
2005 second. When it is stored on the DVD, pairs of fields are combined to form | |
2006 30000/1001 frames per second. | |
2007 </para> | |
2008 | |
2009 <para> | |
2010 When looking at individual frames formed from 60000/1001 fields per | |
2011 second video, telecined or otherwise, interlacing is clearly visible | |
2012 wherever there is any motion, because one field (say, the | |
2013 even-numbered lines) represents a moment in time 1/(60000/1001) | |
2014 seconds later than the other. Playing interlaced video on a computer | |
2015 looks ugly both because the monitor is higher resolution and because | |
2016 the video is shown frame-after-frame instead of field-after-field. | |
20725 | 2017 </para> |
2018 | |
2019 <itemizedlist> | |
2020 <title>Notes:</title> | |
2021 <listitem><para> | |
2022 This section only applies to NTSC DVDs, and not PAL. | |
21525 | 2023 </para></listitem> |
20725 | 2024 <listitem><para> |
2025 The example <application>MEncoder</application> lines throughout the | |
2026 document are <emphasis role="bold">not</emphasis> intended for | |
2027 actual use. They are simply the bare minimum required to encode the | |
2028 pertaining video category. How to make good DVD rips or fine-tune | |
2029 <systemitem class="library">libavcodec</systemitem> for maximal | |
2030 quality is not within the scope of this document. | |
21525 | 2031 </para></listitem> |
20725 | 2032 <listitem><para> |
2033 There are a couple footnotes specific to this guide, linked like this: | |
2034 <link linkend="menc-feat-telecine-footnotes">[1]</link> | |
21525 | 2035 </para></listitem> |
20725 | 2036 </itemizedlist> |
2037 </sect2> | |
2038 | |
21525 | 2039 <!-- ********** --> |
2040 | |
20725 | 2041 <sect2 id="menc-feat-telecine-ident"> |
2042 <title>How to tell what type of video you have</title> | |
2043 | |
2044 <sect3 id="menc-feat-telecine-ident-progressive"> | |
2045 <title>Progressive</title> | |
21525 | 2046 |
2047 <para> | |
2048 Progressive video was originally filmed at 24000/1001 fps, and stored | |
2049 on the DVD without alteration. | |
2050 </para> | |
2051 | |
2052 <para> | |
2053 When you play a progressive DVD in <application>MPlayer</application>, | |
2054 <application>MPlayer</application> will print the following line as | |
2055 soon as the movie begins to play: | |
2056 <screen> | |
2057 demux_mpg: 24000/1001 fps progressive NTSC content detected, switching framerate. | |
2058 </screen> | |
2059 From this point forward, demux_mpg should never say it finds | |
21598
fa4f5b0fd510
r21612: replace " with ", better readability
voroshil
parents:
21594
diff
changeset
|
2060 "30000/1001 fps NTSC content." |
21525 | 2061 </para> |
2062 | |
2063 <para> | |
2064 When you watch progressive video, you should never see any | |
2065 interlacing. Beware, however, because sometimes there is a tiny bit | |
2066 of telecine mixed in where you would not expect. I have encountered TV | |
2067 show DVDs that have one second of telecine at every scene change, or | |
2068 at seemingly random places. I once watched a DVD that had a | |
2069 progressive first half, and the second half was telecined. If you | |
2070 want to be <emphasis>really</emphasis> thorough, you can scan the | |
2071 entire movie: | |
2072 <screen>mplayer dvd://1 -nosound -vo null -benchmark</screen> | |
2073 Using <option>-benchmark</option> makes | |
2074 <application>MPlayer</application> play the movie as quickly as it | |
2075 possibly can; still, depending on your hardware, it can take a | |
2076 while. Every time demux_mpg reports a framerate change, the line | |
2077 immediately above will show you the time at which the change | |
2078 occurred. | |
2079 </para> | |
2080 | |
2081 <para> | |
2082 Sometimes progressive video on DVDs is referred to as | |
21598
fa4f5b0fd510
r21612: replace " with ", better readability
voroshil
parents:
21594
diff
changeset
|
2083 "soft-telecine" because it is intended to |
21525 | 2084 be telecined by the DVD player. |
20725 | 2085 </para> |
2086 </sect3> | |
2087 | |
21525 | 2088 |
20725 | 2089 <sect3 id="menc-feat-telecine-ident-telecined"> |
2090 <title>Telecined</title> | |
21525 | 2091 |
2092 <para> | |
2093 Telecined video was originally filmed at 24000/1001, but was telecined | |
2094 <emphasis>before</emphasis> it was written to the DVD. | |
2095 </para> | |
2096 | |
2097 <para> | |
2098 <application>MPlayer</application> does not (ever) report any | |
2099 framerate changes when it plays telecined video. | |
2100 </para> | |
2101 | |
2102 <para> | |
2103 Watching a telecined video, you will see interlacing artifacts that | |
21598
fa4f5b0fd510
r21612: replace " with ", better readability
voroshil
parents:
21594
diff
changeset
|
2104 seem to "blink": they repeatedly appear and disappear. |
21525 | 2105 You can look closely at this by |
2106 <orderedlist> | |
2107 <listitem><screen>mplayer dvd://1</screen></listitem> | |
2108 <listitem><para> | |
2109 Seek to a part with motion. | |
2110 </para></listitem> | |
2111 <listitem><para> | |
2112 Use the <keycap>.</keycap> key to step forward one frame at a time. | |
2113 </para></listitem> | |
2114 <listitem><para> | |
2115 Look at the pattern of interlaced-looking and progressive-looking | |
2116 frames. If the pattern you see is PPPII,PPPII,PPPII,... then the | |
2117 video is telecined. If you see some other pattern, then the video | |
2118 may have been telecined using some non-standard method; | |
2119 <application>MEncoder</application> cannot losslessly convert | |
2120 non-standard telecine to progressive. If you do not see any | |
2121 pattern at all, then it is most likely interlaced. | |
2122 </para></listitem> | |
2123 </orderedlist> | |
2124 </para> | |
2125 | |
2126 <para> | |
2127 Sometimes telecined video on DVDs is referred to as | |
21598
fa4f5b0fd510
r21612: replace " with ", better readability
voroshil
parents:
21594
diff
changeset
|
2128 "hard-telecine". Since hard-telecine is already 60000/1001 fields |
21525 | 2129 per second, the DVD player plays the video without any manipulation. |
2130 </para> | |
2131 | |
2132 <para> | |
2133 Another way to tell if your source is telecined or not is to play | |
2134 the source with the <option>-vf pullup</option> and <option>-v</option> | |
2135 command line options to see how <option>pullup</option> matches frames. | |
2136 If the source is telecined, you should see on the console a 3:2 pattern | |
2137 with <systemitem>0+.1.+2</systemitem> and <systemitem>0++1</systemitem> | |
2138 alternating. | |
2139 This technique has the advantage that you do not need to watch the | |
2140 source to identify it, which could be useful if you wish to automate | |
2141 the encoding procedure, or to carry out said procedure remotely via | |
2142 a slow connection. | |
2143 </para> | |
20725 | 2144 </sect3> |
2145 | |
21525 | 2146 |
20725 | 2147 <sect3 id="menc-feat-telecine-ident-interlaced"> |
2148 <title>Interlaced</title> | |
21525 | 2149 |
2150 <para> | |
2151 Interlaced video was originally filmed at 60000/1001 fields per second, | |
2152 and stored on the DVD as 30000/1001 frames per second. The interlacing effect | |
21598
fa4f5b0fd510
r21612: replace " with ", better readability
voroshil
parents:
21594
diff
changeset
|
2153 (often called "combing") is a result of combining pairs of |
21525 | 2154 fields into frames. Each field is supposed to be 1/(60000/1001) seconds apart, |
2155 and when they are displayed simultaneously the difference is apparent. | |
2156 </para> | |
2157 | |
2158 <para> | |
2159 As with telecined video, <application>MPlayer</application> should | |
2160 not ever report any framerate changes when playing interlaced content. | |
2161 </para> | |
2162 | |
2163 <para> | |
2164 When you view an interlaced video closely by frame-stepping with the | |
2165 <keycap>.</keycap> key, you will see that every single frame is interlaced. | |
20725 | 2166 </para> |
2167 </sect3> | |
2168 | |
21525 | 2169 |
20725 | 2170 <sect3 id="menc-feat-telecine-ident-mixedpt"> |
2171 <title>Mixed progressive and telecine</title> | |
21525 | 2172 |
2173 <para> | |
21598
fa4f5b0fd510
r21612: replace " with ", better readability
voroshil
parents:
21594
diff
changeset
|
2174 All of a "mixed progressive and telecine" video was originally |
21525 | 2175 24000/1001 frames per second, but some parts of it ended up being telecined. |
2176 </para> | |
2177 | |
2178 <para> | |
2179 When <application>MPlayer</application> plays this category, it will | |
21598
fa4f5b0fd510
r21612: replace " with ", better readability
voroshil
parents:
21594
diff
changeset
|
2180 (often repeatedly) switch back and forth between "30000/1001 fps NTSC" |
fa4f5b0fd510
r21612: replace " with ", better readability
voroshil
parents:
21594
diff
changeset
|
2181 and "24000/1001 fps progressive NTSC". Watch the bottom of |
21525 | 2182 <application>MPlayer</application>'s output to see these messages. |
2183 </para> | |
2184 | |
2185 <para> | |
21598
fa4f5b0fd510
r21612: replace " with ", better readability
voroshil
parents:
21594
diff
changeset
|
2186 You should check the "30000/1001 fps NTSC" sections to make sure |
21525 | 2187 they are actually telecine, and not just interlaced. |
20725 | 2188 </para> |
2189 </sect3> | |
2190 | |
21525 | 2191 |
20725 | 2192 <sect3 id="menc-feat-telecine-ident-mixedpi"> |
2193 <title>Mixed progressive and interlaced</title> | |
21525 | 2194 |
2195 <para> | |
21598
fa4f5b0fd510
r21612: replace " with ", better readability
voroshil
parents:
21594
diff
changeset
|
2196 In "mixed progressive and interlaced" content, progressive |
21525 | 2197 and interlaced video have been spliced together. |
2198 </para> | |
2199 | |
2200 <para> | |
21598
fa4f5b0fd510
r21612: replace " with ", better readability
voroshil
parents:
21594
diff
changeset
|
2201 This category looks just like "mixed progressive and telecine", |
21525 | 2202 until you examine the 30000/1001 fps sections and see that they do not have the |
2203 telecine pattern. | |
20725 | 2204 </para> |
2205 </sect3> | |
2206 </sect2> | |
2207 | |
21525 | 2208 <!-- ********** --> |
2209 | |
20725 | 2210 <sect2 id="menc-feat-telecine-encode"> |
2211 <title>How to encode each category</title> | |
21525 | 2212 |
2213 <para> | |
2214 As I mentioned in the beginning, example <application>MEncoder</application> | |
2215 lines below are <emphasis role="bold">not</emphasis> meant to actually be used; | |
2216 they only demonstrate the minimum parameters to properly encode each category. | |
2217 </para> | |
2218 | |
20725 | 2219 |
2220 <sect3 id="menc-feat-telecine-encode-progressive"> | |
2221 <title>Progressive</title> | |
21525 | 2222 |
2223 <para> | |
2224 Progressive video requires no special filtering to encode. The only | |
2225 parameter you need to be sure to use is | |
2226 <option>-ofps 24000/1001</option>. Otherwise, <application>MEncoder</application> | |
2227 will try to encode at 30000/1001 fps and will duplicate frames. | |
2228 </para> | |
2229 | |
2230 <para> | |
2231 <screen>mencoder dvd://1 -oac copy -ovc lavc -ofps 24000/1001</screen> | |
2232 </para> | |
2233 | |
2234 <para> | |
2235 It is often the case, however, that a video that looks progressive | |
2236 actually has very short parts of telecine mixed in. Unless you are | |
2237 sure, it is safest to treat the video as | |
2238 <link linkend="menc-feat-telecine-encode-mixedpt">mixed progressive and telecine</link>. | |
2239 The performance loss is small | |
2240 <link linkend="menc-feat-telecine-footnotes">[3]</link>. | |
20725 | 2241 </para> |
2242 </sect3> | |
2243 | |
21525 | 2244 |
20725 | 2245 <sect3 id="menc-feat-telecine-encode-telecined"> |
2246 <title>Telecined</title> | |
21525 | 2247 |
2248 <para> | |
2249 Telecine can be reversed to retrieve the original 24000/1001 content, | |
2250 using a process called inverse-telecine. | |
2251 <application>MPlayer</application> contains several filters to | |
2252 accomplish this; the best filter, <option>pullup</option>, is described | |
2253 in the <link linkend="menc-feat-telecine-encode-mixedpt">mixed | |
2254 progressive and telecine</link> section. | |
20725 | 2255 </para> |
2256 </sect3> | |
2257 | |
21525 | 2258 |
20725 | 2259 <sect3 id="menc-feat-telecine-encode-interlaced"> |
2260 <title>Interlaced</title> | |
21525 | 2261 |
2262 <para> | |
2263 For most practical cases it is not possible to retrieve a complete | |
2264 progressive video from interlaced content. The only way to do so | |
2265 without losing half of the vertical resolution is to double the | |
21598
fa4f5b0fd510
r21612: replace " with ", better readability
voroshil
parents:
21594
diff
changeset
|
2266 framerate and try to "guess" what ought to make up the |
21525 | 2267 corresponding lines for each field (this has drawbacks - see method 3). |
20725 | 2268 </para> |
2269 | |
2270 <orderedlist> | |
2271 <listitem><para> | |
2272 Encode the video in interlaced form. Normally, interlacing wreaks | |
2273 havoc with the encoder's ability to compress well, but | |
2274 <systemitem class="library">libavcodec</systemitem> has two | |
2275 parameters specifically for dealing with storing interlaced video a | |
2276 bit better: <option> ildct</option> and <option>ilme</option>. Also, | |
2277 using <option>mbd=2</option> is strongly recommended | |
2278 <link linkend="menc-feat-telecine-footnotes">[2] </link> because it | |
2279 will encode macroblocks as non-interlaced in places where there is | |
2280 no motion. Note that <option>-ofps</option> is NOT needed here. | |
2281 <screen>mencoder dvd://1 -oac copy -ovc lavc -lavcopts ildct:ilme:mbd=2</screen> | |
21525 | 2282 </para></listitem> |
20725 | 2283 <listitem><para> |
2284 Use a deinterlacing filter before encoding. There are several of | |
2285 these filters available to choose from, each with its own advantages | |
21134
d3ef4ae45375
r21078: add a link to Michael's de-interlacing filters...
voroshil
parents:
21051
diff
changeset
|
2286 and disadvantages. Consult <option>mplayer -pphelp</option> and |
d3ef4ae45375
r21078: add a link to Michael's de-interlacing filters...
voroshil
parents:
21051
diff
changeset
|
2287 <option>mplayer -vf help</option> to see what is available |
21598
fa4f5b0fd510
r21612: replace " with ", better readability
voroshil
parents:
21594
diff
changeset
|
2288 (grep for "deint"), read Michael's Niedermayer |
21134
d3ef4ae45375
r21078: add a link to Michael's de-interlacing filters...
voroshil
parents:
21051
diff
changeset
|
2289 <ulink url="http://guru.multimedia.cx/deinterlacing-filters/">Deinterlacing filters comparison</ulink>, |
d3ef4ae45375
r21078: add a link to Michael's de-interlacing filters...
voroshil
parents:
21051
diff
changeset
|
2290 and search the |
21385
70b9b7400bc3
r21372: Some punctuation cosmetics and better wording
voroshil
parents:
21134
diff
changeset
|
2291 <ulink url="http://www.mplayerhq.hu/design7/mailing_lists.html"> |
20725 | 2292 MPlayer mailing lists</ulink> to find many discussions about the |
21134
d3ef4ae45375
r21078: add a link to Michael's de-interlacing filters...
voroshil
parents:
21051
diff
changeset
|
2293 various filters. |
d3ef4ae45375
r21078: add a link to Michael's de-interlacing filters...
voroshil
parents:
21051
diff
changeset
|
2294 Again, the framerate is not changing, so no |
20725 | 2295 <option>-ofps</option>. Also, deinterlacing should be done after |
2296 cropping <link linkend="menc-feat-telecine-footnotes">[1]</link> and | |
2297 before scaling. | |
21134
d3ef4ae45375
r21078: add a link to Michael's de-interlacing filters...
voroshil
parents:
21051
diff
changeset
|
2298 <screen>mencoder dvd://1 -oac copy -vf yadif -ovc lavc</screen> |
21525 | 2299 </para></listitem> |
20725 | 2300 <listitem><para> |
2301 Unfortunately, this option is buggy with | |
2302 <application>MEncoder</application>; it ought to work well with | |
2303 <application>MEncoder G2</application>, but that is not here yet. You | |
2304 might experience crahes. Anyway, the purpose of <option> -vf | |
2305 tfields</option> is to create a full frame out of each field, which | |
2306 makes the framerate 60000/1001. The advantage of this approach is that no | |
2307 data is ever lost; however, since each frame comes from only one | |
2308 field, the missing lines have to be interpolated somehow. There are | |
2309 no very good methods of generating the missing data, and so the | |
2310 result will look a bit similar to when using some deinterlacing | |
2311 filters. Generating the missing lines creates other issues, as well, | |
2312 simply because the amount of data doubles. So, higher encoding | |
2313 bitrates are required to maintain quality, and more CPU power is | |
2314 used for both encoding and decoding. tfields has several different | |
2315 options for how to create the missing lines of each frame. If you | |
2316 use this method, then Reference the manual, and chose whichever | |
2317 option looks best for your material. Note that when using | |
2318 <option>tfields</option> you | |
2319 <emphasis role="bold">have to</emphasis> specify both | |
2320 <option>-fps</option> and <option>-ofps</option> to be twice the | |
2321 framerate of your original source. | |
21525 | 2322 <screen> |
2323 mencoder dvd://1 -oac copy -vf tfields=2 -ovc lavc \ | |
2324 -fps 60000/1001 -ofps 60000/1001<!-- | |
2325 --></screen> | |
2326 </para></listitem> | |
20725 | 2327 <listitem><para> |
2328 If you plan on downscaling dramatically, you can extract and encode | |
2329 only one of the two fields. Of course, you will lose half the vertical | |
2330 resolution, but if you plan on downscaling to at most 1/2 of the | |
2331 original, the loss will not matter much. The result will be a | |
2332 progressive 30000/1001 frames per second file. The procedure is to use | |
2333 <option>-vf field</option>, then crop | |
2334 <link linkend="menc-feat-telecine-footnotes">[1]</link> and scale | |
2335 appropriately. Remember that you will have to adjust the scale to | |
2336 compensate for the vertical resolution being halved. | |
2337 <screen>mencoder dvd://1 -oac copy -vf field=0 -ovc lavc</screen> | |
21525 | 2338 </para></listitem> |
20725 | 2339 </orderedlist> |
2340 </sect3> | |
2341 | |
21525 | 2342 |
20725 | 2343 <sect3 id="menc-feat-telecine-encode-mixedpt"> |
2344 <title>Mixed progressive and telecine</title> | |
21525 | 2345 |
2346 <para> | |
2347 In order to turn mixed progressive and telecine video into entirely | |
2348 progressive video, the telecined parts have to be | |
2349 inverse-telecined. There are three ways to accomplish this, | |
2350 described below. Note that you should | |
2351 <emphasis role="bold">always</emphasis> inverse-telecine before any | |
2352 rescaling; unless you really know what you are doing, | |
2353 inverse-telecine before cropping, too | |
2354 <link linkend="menc-feat-telecine-footnotes">[1]</link>. | |
2355 <option>-ofps 24000/1001</option> is needed here because the output video | |
2356 will be 24000/1001 frames per second. | |
20725 | 2357 </para> |
2358 | |
2359 <itemizedlist> | |
2360 <listitem><para> | |
2361 <option>-vf pullup</option> is designed to inverse-telecine | |
2362 telecined material while leaving progressive data alone. In order to | |
2363 work properly, <option>pullup</option> <emphasis role="bold">must</emphasis> | |
2364 be followed by the <option>softskip</option> filter or | |
2365 else <application>MEncoder</application> will crash. | |
2366 <option>pullup</option> is, however, the cleanest and most | |
2367 accurate method available for encoding both telecine and | |
21598
fa4f5b0fd510
r21612: replace " with ", better readability
voroshil
parents:
21594
diff
changeset
|
2368 "mixed progressive and telecine". |
21525 | 2369 <screen> |
2370 mencoder dvd://1 -oac copy -vf pullup,softskip \ | |
2371 -ovc lavc -ofps 24000/1001<!-- | |
2372 --></screen> | |
2373 </para></listitem> | |
2374 <listitem><para> | |
20725 | 2375 An older method |
2376 is to, rather than inverse-telecine the telecined parts, telecine | |
2377 the non-telecined parts and then inverse-telecine the whole | |
2378 video. Sound confusing? softpulldown is a filter that goes through | |
2379 a video and makes the entire file telecined. If we follow | |
2380 softpulldown with either <option>detc</option> or | |
2381 <option>ivtc</option>, the final result will be entirely | |
2382 progressive. <option>-ofps 24000/1001</option> is needed. | |
21525 | 2383 <screen> |
2384 mencoder dvd://1 -oac copy -vf softpulldown,ivtc=1 -ovc lavc -ofps 24000/1001 | |
2385 </screen> | |
2386 </para></listitem> | |
20725 | 2387 <listitem><para> |
2388 I have not used <option>-vf filmdint</option> myself, but here is what | |
2389 D Richard Felker III has to say: | |
2390 | |
2391 <blockquote><para>It is OK, but IMO it tries to deinterlace rather | |
21525 | 2392 than doing inverse telecine too often (much like settop DVD |
2393 players & progressive TVs) which gives ugly flickering and | |
2394 other artifacts. If you are going to use it, you at least need to | |
2395 spend some time tuning the options and watching the output first | |
2396 to make sure it is not messing up. | |
2397 </para></blockquote> | |
2398 </para></listitem> | |
20725 | 2399 </itemizedlist> |
2400 </sect3> | |
2401 | |
21525 | 2402 |
20725 | 2403 <sect3 id="menc-feat-telecine-encode-mixedpi"> |
2404 <title>Mixed progressive and interlaced</title> | |
21525 | 2405 |
2406 <para> | |
2407 There are two options for dealing with this category, each of | |
2408 which is a compromise. You should decide based on the | |
2409 duration/location of each type. | |
20725 | 2410 </para> |
2411 | |
2412 <itemizedlist> | |
21525 | 2413 <listitem> |
2414 <para> | |
20725 | 2415 Treat it as progressive. The interlaced parts will look interlaced, |
2416 and some of the interlaced fields will have to be dropped, resulting | |
2417 in a bit of uneven jumpiness. You can use a postprocessing filter if | |
2418 you want to, but it may slightly degrade the progressive parts. | |
2419 </para> | |
2420 | |
2421 <para> | |
2422 This option should definitely not be used if you want to eventually | |
2423 display the video on an interlaced device (with a TV card, for | |
2424 example). If you have interlaced frames in a 24000/1001 frames per | |
2425 second video, they will be telecined along with the progressive | |
2426 frames. Half of the interlaced "frames" will be displayed for three | |
2427 fields' duration (3/(60000/1001) seconds), resulting in a flicking | |
21598
fa4f5b0fd510
r21612: replace " with ", better readability
voroshil
parents:
21594
diff
changeset
|
2428 "jump back in time" effect that looks quite bad. If you |
20725 | 2429 even attempt this, you <emphasis role="bold">must</emphasis> use a |
2430 deinterlacing filter like <option>lb</option> or | |
2431 <option>l5</option>. | |
2432 </para> | |
2433 | |
2434 <para> | |
2435 It may also be a bad idea for progressive display, too. It will drop | |
2436 pairs of consecutive interlaced fields, resulting in a discontinuity | |
2437 that can be more visible than with the second method, which shows | |
2438 some progressive frames twice. 30000/1001 frames per second interlaced | |
2439 video is already a bit choppy because it really should be shown at | |
2440 60000/1001 fields per second, so the duplicate frames do not stand out as | |
2441 much. | |
2442 </para> | |
2443 | |
2444 <para> | |
2445 Either way, it is best to consider your content and how you intend to | |
2446 display it. If your video is 90% progressive and you never intend to | |
2447 show it on a TV, you should favor a progressive approach. If it is | |
2448 only half progressive, you probably want to encode it as if it is all | |
2449 interlaced. | |
2450 </para> | |
21525 | 2451 </listitem> |
20725 | 2452 |
2453 <listitem><para> | |
2454 Treat it as interlaced. Some frames of the progressive parts will | |
2455 need to be duplicated, resulting in uneven jumpiness. Again, | |
2456 deinterlacing filters may slightly degrade the progressive parts. | |
21525 | 2457 </para></listitem> |
20725 | 2458 </itemizedlist> |
2459 </sect3> | |
2460 </sect2> | |
2461 | |
21525 | 2462 <!-- ********** --> |
2463 | |
20725 | 2464 <sect2 id="menc-feat-telecine-footnotes"> |
2465 <title>Footnotes</title> | |
21525 | 2466 |
20725 | 2467 <orderedlist> |
21525 | 2468 <listitem> |
2469 <formalpara> | |
20725 | 2470 <title>About cropping:</title> |
2471 <para> | |
2472 Video data on DVDs are stored in a format called YUV 4:2:0. In YUV | |
21598
fa4f5b0fd510
r21612: replace " with ", better readability
voroshil
parents:
21594
diff
changeset
|
2473 video, luma ("brightness") and chroma ("color") |
20725 | 2474 are stored separately. Because the human eye is somewhat less |
2475 sensitive to color than it is to brightness, in a YUV 4:2:0 picture | |
2476 there is only one chroma pixel for every four luma pixels. In a | |
2477 progressive picture, each square of four luma pixels (two on each | |
2478 side) has one common chroma pixel. You must crop progressive YUV | |
2479 4:2:0 to even resolutions, and use even offsets. For example, | |
2480 <option>crop=716:380:2:26</option> is OK but | |
2481 <option>crop=716:380:3:26 </option> is not. | |
2482 </para> | |
2483 </formalpara> | |
2484 | |
2485 <para> | |
2486 When you are dealing with interlaced YUV 4:2:0, the situation is a | |
2487 bit more complicated. Instead of every four luma pixels in the | |
2488 <emphasis>frame</emphasis> sharing a chroma pixel, every four luma | |
2489 pixels in each <emphasis> field</emphasis> share a chroma | |
2490 pixel. When fields are interlaced to form a frame, each scanline is | |
2491 one pixel high. Now, instead of all four luma pixels being in a | |
2492 square, there are two pixels side-by-side, and the other two pixels | |
2493 are side-by-side two scanlines down. The two luma pixels in the | |
2494 intermediate scanline are from the other field, and so share a | |
2495 different chroma pixel with two luma pixels two scanlines away. All | |
2496 this confusion makes it necessary to have vertical crop dimensions | |
2497 and offsets be multiples of four. Horizontal can stay even. | |
2498 </para> | |
2499 | |
2500 <para> | |
2501 For telecined video, I recommend that cropping take place after | |
2502 inverse telecining. Once the video is progressive you only need to | |
2503 crop by even numbers. If you really want to gain the slight speedup | |
2504 that cropping first may offer, you must crop vertically by multiples | |
2505 of four or else the inverse-telecine filter will not have proper data. | |
2506 </para> | |
2507 | |
2508 <para> | |
2509 For interlaced (not telecined) video, you must always crop | |
2510 vertically by multiples of four unless you use <option>-vf | |
2511 field</option> before cropping. | |
2512 </para> | |
21525 | 2513 </listitem> |
20725 | 2514 |
2515 <listitem><formalpara> | |
2516 <title>About encoding parameters and quality:</title> | |
2517 <para> | |
2518 Just because I recommend <option>mbd=2</option> here does not mean it | |
2519 should not be used elsewhere. Along with <option>trell</option>, | |
2520 <option>mbd=2</option> is one of the two | |
2521 <systemitem class="library">libavcodec</systemitem> options that | |
2522 increases quality the most, and you should always use at least those | |
2523 two unless the drop in encoding speed is prohibitive (e.g. realtime | |
2524 encoding). There are many other options to | |
2525 <systemitem class="library">libavcodec</systemitem> that increase | |
2526 encoding quality (and decrease encoding speed) but that is beyond | |
2527 the scope of this document. | |
2528 </para> | |
21525 | 2529 </formalpara></listitem> |
20725 | 2530 |
2531 <listitem><formalpara> | |
2532 <title>About the performance of pullup:</title> | |
2533 <para> | |
2534 It is safe to use <option>pullup</option> (along with <option>softskip | |
2535 </option>) on progressive video, and is usually a good idea unless | |
2536 the source has been definitively verified to be entirely progressive. | |
2537 The performace loss is small for most cases. On a bare-minimum encode, | |
2538 <option>pullup</option> causes <application>MEncoder</application> to | |
2539 be 50% slower. Adding sound processing and advanced <option>lavcopts | |
2540 </option> overshadows that difference, bringing the performance | |
2541 decrease of using <option>pullup</option> down to 2%. | |
2542 </para> | |
21525 | 2543 </formalpara></listitem> |
20725 | 2544 </orderedlist> |
2545 </sect2> | |
2546 </sect1> | |
2547 | |
2548 | |
21525 | 2549 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> |
2550 | |
2551 | |
20725 | 2552 <sect1 id="menc-feat-enc-libavcodec"> |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2553 <title>Кодирование семейством кодеков <systemitem class="library">libavcodec</systemitem> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2554 </title> |
20725 | 2555 |
2556 <para> | |
2557 <link linkend="ffmpeg"><systemitem class="library">libavcodec</systemitem></link> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2558 предоставляет возможность простого кодирования в множество интересных видео и |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2559 аудио форматов. Вы можете кодировать следующими кодеками (более или менее |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2560 свежий список): |
20725 | 2561 </para> |
2562 | |
21525 | 2563 <!-- ********** --> |
2564 | |
20725 | 2565 <sect2 id="menc-feat-enc-libavcodec-video-codecs"> |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2566 <title>Видео кодеки <systemitem class="library">libavcodec</systemitem></title> |
20725 | 2567 |
2568 <para> | |
2569 <informaltable frame="all"> | |
2570 <tgroup cols="2"> | |
2571 <thead> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2572 <row><entry>Название видео кодека</entry><entry>Описание</entry></row> |
20725 | 2573 </thead> |
2574 <tbody> | |
21525 | 2575 <row> |
2576 <entry>mjpeg</entry> | |
2577 <entry>Motion JPEG</entry> | |
2578 </row> | |
2579 <row> | |
2580 <entry>ljpeg</entry> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2581 <entry>JPEG без потери качества</entry> |
21525 | 2582 </row> |
2583 <row> | |
2584 <entry>h261</entry> | |
2585 <entry>H.261</entry> | |
2586 </row> | |
2587 <row> | |
2588 <entry>h263</entry> | |
2589 <entry>H.263</entry> | |
2590 </row> | |
2591 <row> | |
2592 <entry>h263p</entry> | |
2593 <entry>H.263+</entry> | |
2594 </row> | |
2595 <row> | |
2596 <entry>mpeg4</entry> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2597 <entry>ISO стандарт MPEG-4 (DivX, Xvid совместимый)</entry> |
21525 | 2598 </row> |
2599 <row> | |
2600 <entry>msmpeg4</entry> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2601 <entry>вариант пре-стандарта MPEG-4 от MS, v3 (он же DivX3)</entry> |
21525 | 2602 </row> |
2603 <row> | |
2604 <entry>msmpeg4v2</entry> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2605 <entry>вариант пре-стандарта MPEG-4 от MS, v2 (используемый в старых ASF |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2606 файлах)</entry> |
21525 | 2607 </row> |
2608 <row> | |
2609 <entry>wmv1</entry> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2610 <entry>Windows Media Video, версия 1 (он же WMV7)</entry> |
21525 | 2611 </row> |
2612 <row> | |
2613 <entry>wmv2</entry> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2614 <entry>Windows Media Video, версия 2 (он же WMV8)</entry> |
21525 | 2615 </row> |
2616 <row> | |
2617 <entry>rv10</entry> | |
2618 <entry>RealVideo 1.0</entry> | |
2619 </row> | |
2620 <row> | |
2621 <entry>rv20</entry> | |
2622 <entry>RealVideo 2.0</entry> | |
2623 </row> | |
2624 <row> | |
2625 <entry>mpeg1video</entry> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2626 <entry>MPEG-1 видео</entry> |
21525 | 2627 </row> |
2628 <row> | |
2629 <entry>mpeg2video</entry> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2630 <entry>MPEG-2 видео</entry> |
21525 | 2631 </row> |
2632 <row> | |
2633 <entry>huffyuv</entry> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2634 <entry>сжатие без потерь</entry> |
21525 | 2635 </row> |
2636 <row> | |
2637 <entry>asv1</entry> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2638 <entry>ASUS Видео v1</entry> |
21525 | 2639 </row> |
2640 <row> | |
2641 <entry>asv2</entry> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2642 <entry>ASUS Видео v2</entry> |
21525 | 2643 </row> |
2644 <row> | |
2645 <entry>ffv1</entry> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2646 <entry>видео кодек без потерь из FFmpeg</entry> |
21525 | 2647 </row> |
2648 <row> | |
2649 <entry>svq1</entry> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2650 <entry>Sorenson видео 1</entry> |
21525 | 2651 </row> |
2652 <row> | |
2653 <entry>flv</entry> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2654 <entry>Sorenson H.263 используемый в Flash Видео</entry> |
21525 | 2655 </row> |
2656 <row> | |
2657 <entry>dvvideo</entry> | |
2658 <entry>Sony Digital Video</entry> | |
2659 </row> | |
2660 <row> | |
2661 <entry>snow</entry> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2662 <entry>экспериментальный кодек FFmpeg, основанный на вейвлетах</entry> |
21525 | 2663 </row> |
20725 | 2664 </tbody> |
2665 </tgroup> | |
2666 </informaltable> | |
2667 | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2668 Первый столбец содержит названия кодеков, которые следует указывать после |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2669 <literal>vcodec</literal> опции, например: |
21525 | 2670 <option>-lavcopts vcodec=msmpeg4</option> |
2671 </para> | |
2672 | |
2673 <informalexample><para> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2674 Пример с MJPEG сжатием: |
21525 | 2675 <screen> |
2676 mencoder dvd://2 -o title2.avi -ovc lavc -lavcopts vcodec=mjpeg -oac copy | |
2677 </screen> | |
2678 </para></informalexample> | |
20725 | 2679 </sect2> |
2680 | |
21525 | 2681 <!-- ********** --> |
2682 | |
20725 | 2683 <sect2 id="menc-feat-enc-libavcodec-audio-codecs"> |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2684 <title>Аудио кодеки <systemitem class="library">libavcodec</systemitem></title> |
20725 | 2685 <para> |
2686 <informaltable frame="all"> | |
2687 <tgroup cols="2"> | |
2688 <thead> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2689 <row><entry>Название аудио кодека</entry><entry>Описание</entry></row> |
20725 | 2690 </thead> |
2691 <tbody> | |
21525 | 2692 <row> |
2693 <entry>mp2</entry> | |
2694 <entry>MPEG Layer 2</entry> | |
2695 </row> | |
2696 <row> | |
2697 <entry>ac3</entry> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2698 <entry>AC3, он же Dolby Digital</entry> |
21525 | 2699 </row> |
2700 <row> | |
2701 <entry>adpcm_ima_wav</entry> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2702 <entry>IMA адаптивный PCM (4 бита на сэмпл, сжатие 4:1)</entry> |
21525 | 2703 </row> |
2704 <row> | |
2705 <entry>sonic</entry> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2706 <entry>экспериментальный кодек с сжатием с/без потерь</entry> |
21525 | 2707 </row> |
20725 | 2708 </tbody> |
2709 </tgroup> | |
2710 </informaltable> | |
2711 | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2712 Первый столбец содержит названия кодеков, которые следует указывать после |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2713 <literal>acodec</literal> опции, например: <option>-lavcopts acodec=ac3</option> |
20725 | 2714 </para> |
2715 | |
21525 | 2716 <informalexample><para> |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2717 Пример с AC3 сжатием: |
21525 | 2718 <screen> |
2719 mencoder dvd://2 -o title2.avi -oac lavc -lavcopts acodec=ac3 -ovc copy | |
2720 </screen> | |
2721 </para></informalexample> | |
2722 | |
2723 <para> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2724 В отличие от видео кодеков <systemitem class="library">libavcodec</systemitem>, |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2725 ее аудио кодеки не очень разумно используют отданные им биты, в силу |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2726 неудачной реализации некоторой минимальной психоакустической модели (если она |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2727 вообще есть), которая является характерной чертой большинства остальных реализаций кодеков. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2728 Однако заметьте, что все эти аудио кодеки очень быстры и работают прямо из |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2729 коробки везде, где <application>MEncoder</application> скомпилирован с |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2730 <systemitem class="library">libavcodec</systemitem> (а почти всегда так оно и |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2731 есть), и не зависят от внешних библиотек. |
20725 | 2732 </para> |
2733 </sect2> | |
2734 | |
21525 | 2735 <!-- ********** --> |
20725 | 2736 |
2737 <sect2 id="menc-feat-dvd-mpeg4-lavc-encoding-options"> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2738 <title>Опции кодирования libavcodec</title> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2739 |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2740 <para> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2741 В идеале, вы, наверное, хотели бы иметь возможность просто сказать кодировщику |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2742 переключиться на "высокое качество" и начать кодирование. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2743 Это было бы замечательно, но, к сожалению, трудно реализуемо, поскольку |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2744 различные опции кодирования, в зависимости от исходного материала, дают в результате |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2745 различное качество. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2746 Так происходит потому, что сжатие зависит от визуальных свойств видео. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2747 Например, аниме и живая съемка имеют сильно отличающиеся свойства и, |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2748 поэтому, требуют разные опции для получения оптимального результата. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2749 Хорошая новость состоит в том, что некоторые опции, такие как |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2750 <option>mbd=2</option>, <option>trell</option>, и <option>v4mv</option> могут |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2751 быть опущены. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2752 Детальное описание основных опций кодирования смотрите ниже. |
21525 | 2753 </para> |
20725 | 2754 |
2755 <itemizedlist> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2756 <title>Опции для настройки:</title> |
20725 | 2757 <listitem><para> |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2758 <emphasis role="bold">vmax_b_frames</emphasis>: хороши 1 или 2, в зависимости |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2759 от фильма. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2760 Заметьте, если хотите, чтобы ваш фильм декодировался DivX5, вы должны |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2761 активировать поддержку закрытых GOP, используя опцию <option>cgop</option> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2762 <systemitem class="library">libavcodec</systemitem>, но также должны деактивировать |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2763 определение сцен, что не является хорошей идеей, поскольку несколько вредит |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2764 эффективности. |
20725 | 2765 </para></listitem> |
2766 <listitem><para> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2767 <emphasis role="bold">vb_strategy=1</emphasis>: помогает в высокодинамичных |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2768 сценах. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2769 Для некоторых видео файлов vmax_b_frames может повредить качеству, но vmax_b_frames=2 |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2770 вместе с vb_strategy=1 поможет в этом случае. |
20725 | 2771 </para></listitem> |
2772 <listitem><para> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2773 <emphasis role="bold">dia</emphasis>: диапазон поиска движения. Большие |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2774 значения лучше и медленнее. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2775 Отрицательные значения - это совершенно другая шкала. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2776 Хорошими значениями являются -1 для быстрого кодирования или 2-4 - для |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2777 медленного. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2778 </para></listitem> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2779 <listitem><para> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2780 <emphasis role="bold">predia</emphasis>: предпроход поиска движения. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2781 Не так важен, как dia. Хорошими являются значения от 1 (по-умолчанию) до 4. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2782 Требует preme=2, чтобы быть действительно полезным. |
20725 | 2783 </para></listitem> |
2784 <listitem><para> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2785 <emphasis role="bold">cmp, subcmp, precmp</emphasis>: Функция сравнения для |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2786 поиска движения. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2787 Поэкспериментируйте со значениями 0 (по-умолчанию), 2 (hadamard), 3 (dct), и 6 |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2788 (соотношение сигнал-шум). |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2789 0 - самый быстрый и достаточен для precmp. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2790 В случае cmp и subcmp 2 является хорошим для аниме, а 3 для живой съемки. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2791 6 может оказаться лучше, а может и нет, но он медленнее. |
20725 | 2792 </para></listitem> |
2793 <listitem><para> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2794 <emphasis role="bold">last_pred</emphasis>: Количество предсказателей |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2795 движения, берущихся из предыдущего кадра. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2796 1-3 или около того помогут вам ценой небольшой потери в скорости. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2797 Большие значения медленны и не дают дополнительного улучшения. |
20725 | 2798 </para></listitem> |
2799 <listitem><para> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2800 <emphasis role="bold">cbp, mv0</emphasis>: Контролирует выбор макроблоков. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2801 Незначительное снижение скорости с небольшим приростом в качестве. |
20725 | 2802 </para></listitem> |
2803 <listitem><para> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2804 <emphasis role="bold">qprd</emphasis>: адаптивное квантование, основанное на |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2805 сложности макроблока. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2806 Может сделать лучше или хуже в зависимости от видео и других опций. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2807 Она также может привести к появлению артефактов, если вы не установите vqmax в |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2808 некоторое разумно малое значение |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2809 (хорошо - 6, может быть даже 4); vqmin=1 также может помочь. |
20725 | 2810 </para></listitem> |
2811 <listitem><para> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2812 <emphasis role="bold">qns</emphasis>: очень медленно, особенно в комбинации с qprd. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2813 Эта опция укажет кодировщику минимизировать шум от артефактов сжатия вместо |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2814 создания закодированного видео, полностью идентичного исходному. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2815 Не используйте ее, если только не перепробовали настроить все, что было |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2816 возможно, а результат все таки недостаточно хорош. |
20725 | 2817 </para></listitem> |
2818 <listitem><para> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2819 <emphasis role="bold">vqcomp</emphasis>: Настраивает управление битпотоком. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2820 Какие значения являются хорошими зависит от фильма. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2821 Если хотите, можете без опаски оставить значение по-умолчанию. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2822 Уменьшение vqcomp отдает больше бит в сцены с низкой сложностью, увеличение |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2823 его передает биты в очень сложные сцены (по-умолчанию: 0.5, диапазон: 0-1. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2824 рекомендуемый диапазон: 0.5-0.7). |
20725 | 2825 </para></listitem> |
2826 <listitem><para> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2827 <emphasis role="bold">vlelim, vcelim</emphasis>: Устанавливает порог |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2828 отбрасывания одиночного коэффициента для яркостной и цветностной плоскостей. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2829 Они кодируются независимо во всех MPEG-похожих алгоритмах. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2830 Идея этих опций заключается в использованию некоторой хорошей эвристики для |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2831 определения момента, когда изменения в блоке ниже указанного вами порога, и что его |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2832 стоит кодировать как "блок без изменений". |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2833 Это сохраняет быти и, возможно, ускоряет кодирование. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2834 vlelim=-4 и vcelim=9 выглядят неплохими для живой съемки, но, скорее всего, не |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2835 помогут для аниме; при кодировании анимации вам, возможно, следует оставить |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2836 эту опцию неизменной. |
20725 | 2837 </para></listitem> |
2838 <listitem><para> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2839 <emphasis role="bold">qpel</emphasis>: Четверьтпиксельная оценка движения. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2840 По-умолчанию, MPEG-4 использует полупиксельную точность для оценки движения, |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2841 следовательно, эта опция вносит дополнительные накладные рахсоды, поскольку |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2842 сохраняет больше информации в закодированном файле. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2843 Улучшение/ухудшение степени сжатия зависит от фильма, но обычно эта опция не |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2844 очень эффективна для аниме. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2845 qpel всегда вносит значительный вклад в CPU время декодирования (+25% на |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2846 практике). |
20725 | 2847 </para></listitem> |
2848 <listitem><para> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2849 <emphasis role="bold">psnr</emphasis>: не влияет на сам процесс кодирования, |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2850 но выводит в файл тип/размер/качество каждого кадра, а также итоговый |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2851 PSNR (Peak Signal to Noise Ratio, пиковое отношения сигнала к шуму) в конце |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2852 прцесса. |
20725 | 2853 </para></listitem> |
2854 </itemizedlist> | |
2855 | |
2856 <itemizedlist> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2857 <title>Опции, с которыми играть не стоит:</title> |
20725 | 2858 <listitem><para> |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2859 <emphasis role="bold">vme</emphasis>: Значение по-умолчанию является лучшим. |
20725 | 2860 </para></listitem> |
2861 <listitem><para> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2862 <emphasis role="bold">lumi_mask, dark_mask</emphasis>: Психовизуальное |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2863 адаптивное квантование. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2864 Не стоит играть с этими опциями, если заботитесь о качестве. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2865 Разумные значения могут быть эффективными в вашем случае, но имейте в виду, |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2866 что это весьма субъективно. |
20725 | 2867 </para></listitem> |
2868 <listitem><para> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2869 <emphasis role="bold">scplx_mask</emphasis>: Пытается предотвратить появление |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2870 квадратиков, но постобработка делает это лучше. |
20725 | 2871 </para></listitem> |
2872 </itemizedlist> | |
2873 </sect2> | |
2874 | |
21525 | 2875 <!-- ********** --> |
2876 | |
20725 | 2877 <sect2 id="menc-feat-mpeg4-lavc-example-settings"> |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2878 <title>Примеры настроек кодирования</title> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2879 |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2880 <para> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2881 Следующие настройки - это примеры различных комбинаций опций кодирования, |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2882 которые влияют на соотношение скорость-качество при той же величине целевого |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2883 биптотока. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2884 </para> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2885 |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2886 <para> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2887 Все настройки кодирования проверялись на тестовом видео 720x448 @30000/1001 fps |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2888 с целевым битпотоком 900кбит/сек, на машине AMD-64 3400+ с 2400 МГц и 64 битном режиме. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2889 Для каждой настройки кодирования указаны измеренная скорость кодирования (в |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2890 кадрах в секунду) и потеря PSNR (в дБ) по сравнению с настройкой "очень высокое |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2891 качество". Поймите, пожалуйста, что в зависимости от вашего материала, типа |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2892 машины, прогресса разработки вы можете получить сильно отличающиеся результаты. |
20725 | 2893 </para> |
2894 | |
2895 <para> | |
2896 <informaltable frame="all"> | |
2897 <tgroup cols="4"> | |
2898 <thead> | |
21525 | 2899 <row> |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2900 <entry>Описание</entry> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2901 <entry>Опции кодирования</entry> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2902 <entry>скорость (в fps)</entry> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2903 <entry>Относительная потеря PSNR (в дБ)</entry> |
21525 | 2904 </row> |
20725 | 2905 </thead> |
2906 <tbody> | |
2907 <row> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2908 <entry>Очень высокое качество</entry> |
20725 | 2909 <entry><option>vcodec=mpeg4:mbd=2:mv0:trell:v4mv:cbp:last_pred=3:predia=2:dia=2:vmax_b_frames=2:vb_strategy=1:precmp=2:cmp=2:subcmp=2:preme=2:qns=2</option></entry> |
2910 <entry>6fps</entry> | |
2911 <entry>0dB</entry> | |
2912 </row> | |
2913 <row> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2914 <entry>Высокое качество</entry> |
20725 | 2915 <entry><option>vcodec=mpeg4:mbd=2:trell:v4mv:last_pred=2:dia=-1:vmax_b_frames=2:vb_strategy=1:cmp=3:subcmp=3:precmp=0:vqcomp=0.6:turbo</option></entry> |
2916 <entry>15fps</entry> | |
2917 <entry>-0.5dB</entry> | |
2918 </row> | |
2919 <row> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2920 <entry>Быстрое</entry> |
20725 | 2921 <entry><option>vcodec=mpeg4:mbd=2:trell:v4mv:turbo</option></entry> |
2922 <entry>42fps</entry> | |
2923 <entry>-0.74dB</entry> | |
2924 </row> | |
2925 <row> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2926 <entry>Реального времени</entry> |
20725 | 2927 <entry><option>vcodec=mpeg4:mbd=2:turbo</option></entry> |
2928 <entry>54fps</entry> | |
2929 <entry>-1.21dB</entry> | |
2930 </row> | |
2931 </tbody> | |
2932 </tgroup> | |
2933 </informaltable> | |
2934 </para> | |
2935 </sect2> | |
2936 | |
21525 | 2937 <!-- ********** --> |
2938 | |
2939 <sect2 id="custommatrices"> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2940 <title>Нестандартные inter/intra матрицы</title> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2941 |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2942 <para> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2943 С этой возможностью |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2944 <link linkend="ffmpeg"><systemitem |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2945 class="library">libavcodec</systemitem></link>, |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2946 вы можете установить нестандартные inter (I-кадры/ключевые) и intra |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2947 (P-кадры/предсказанные) матрицы. Это поддерживается многими кодеками: |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2948 В <systemitem>mpeg1video</systemitem> и <systemitem>mpeg2video</systemitem> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2949 также заявлена поддержка. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2950 </para> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2951 |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2952 <para> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2953 Обычное использовани этой опции - установить матрицы, предпочитаемые |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2954 спецификациями <ulink url="http://www.kvcd.net/">KVCD</ulink>. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2955 </para> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2956 |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2957 <para> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2958 <emphasis role="bold">KVCD Матрица Квантования "Notch":</emphasis> |
20725 | 2959 </para> |
2960 | |
2961 <para> | |
2962 Intra: | |
2963 <screen> | |
2964 8 9 12 22 26 27 29 34 | |
2965 9 10 14 26 27 29 34 37 | |
2966 12 14 18 27 29 34 37 38 | |
2967 22 26 27 31 36 37 38 40 | |
2968 26 27 29 36 39 38 40 48 | |
2969 27 29 34 37 38 40 48 58 | |
2970 29 34 37 38 40 48 58 69 | |
2971 34 37 38 40 48 58 69 79 | |
2972 </screen> | |
2973 | |
2974 Inter: | |
2975 <screen> | |
2976 16 18 20 22 24 26 28 30 | |
2977 18 20 22 24 26 28 30 32 | |
2978 20 22 24 26 28 30 32 34 | |
2979 22 24 26 30 32 32 34 36 | |
2980 24 26 28 32 34 34 36 38 | |
2981 26 28 30 32 34 36 38 40 | |
2982 28 30 32 34 36 38 42 42 | |
2983 30 32 34 36 38 40 42 44 | |
2984 </screen> | |
2985 </para> | |
2986 | |
2987 <para> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
2988 Использование: |
20725 | 2989 <screen> |
21525 | 2990 mencoder <replaceable>input.avi</replaceable> -o <replaceable>output.avi</replaceable> -oac copy -ovc lavc \ |
2991 -lavcopts inter_matrix=...:intra_matrix=... | |
20725 | 2992 </screen> |
2993 </para> | |
2994 | |
2995 <para> | |
2996 <screen> | |
21525 | 2997 mencoder <replaceable>input.avi</replaceable> -ovc lavc -lavcopts \ |
2998 vcodec=mpeg2video:intra_matrix=8,9,12,22,26,27,29,34,9,10,14,26,27,29,34,37,\ | |
2999 12,14,18,27,29,34,37,38,22,26,27,31,36,37,38,40,26,27,29,36,39,38,40,48,27,\ | |
3000 29,34,37,38,40,48,58,29,34,37,38,40,48,58,69,34,37,38,40,48,58,69,79\ | |
3001 :inter_matrix=16,18,20,22,24,26,28,30,18,20,22,24,26,28,30,32,20,22,24,26,\ | |
3002 28,30,32,34,22,24,26,30,32,32,34,36,24,26,28,32,34,34,36,38,26,28,30,32,34,\ | |
20725 | 3003 36,38,40,28,30,32,34,36,38,42,42,30,32,34,36,38,40,42,44 -oac copy -o svcd.mpg |
3004 </screen> | |
3005 </para> | |
3006 </sect2> | |
3007 | |
21525 | 3008 <!-- ********** --> |
20725 | 3009 |
3010 <sect2 id="menc-feat-dvd-mpeg4-example"> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3011 <title>Пример</title> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3012 |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3013 <para> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3014 Итак, вы только что купили новенькую, блестящую копию фильма "Гарри Поттер и Тайная |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3015 Комната" (в широкоэкранном формате, конечно) и хотите сделать рип этого DVD так, |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3016 чтобы добавить его к Домашнему кинотеатру на PC. Это DVD первого региона, |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3017 поэтому NTSC. Пример ниже также применим и для PAL, за исключением того, что |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3018 надо будет опустить <option>-ofps 24000/1001</option> (поскольку частота кадров |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3019 на выходе такая же, как и на входе), и, конечно, границы обрезания будут |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3020 другими. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3021 </para> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3022 |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3023 <para> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3024 После запуска <option>mplayer dvd://1</option> мы следуем процессу, детально |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3025 описанному в разделе <link linkend="menc-feat-telecine">Как работать с телесином |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3026 и черезстрочностью в NTSC DVD</link>, и выясняем, что это 24000/1001 fps |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3027 прогрессивное видео, а значит использовать фильтры обратного телесина, |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3028 такие как <option>pullup</option> или <option>filmdint</option> не нужно. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3029 </para> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3030 |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3031 <para> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3032 Далее, мы хотим определить верные границы обрезания, поэтому используем фильтр |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3033 cropdetect: |
21525 | 3034 <screen>mplayer dvd://1 -vf cropdetect</screen> |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3035 Убедитесь, что переместились к полностью заполненному кадру (например, |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3036 к светлой сцене), вы должны увидеть в консоли <application>MPlayer</application>: |
21525 | 3037 <screen>crop area: X: 0..719 Y: 57..419 (-vf crop=720:362:0:58)</screen> |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3038 Затем снова воспроизводим фильм с этим фильтром для проверки его корректности: |
21525 | 3039 <screen>mplayer dvd://1 -vf crop=720:362:0:58</screen> |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3040 И убеждаемся, что все выглядит прекрасно. Далее, проверяем, что ширина и высота |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3041 делятся на 16. С шириной все в порядке, а с высотой - нет. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3042 Поскольку мы не заваливали математику в 7-ом классе, то знаем, что ближайшее |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3043 целое, меньшее 362 и кратное 16, равно 352. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3044 </para> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3045 |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3046 <para> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3047 Мы могли бы просто использовать <option>crop=720:352:0:58</option>, но будет |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3048 лучше отрезать понемногу от верха и низа, чтобы центр остался на месте. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3049 Мы уменьшили высоту на 10 пикселов, но не хотим увеличивать смещение по y на 5, |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3050 поскольку это нечетное число и отрицательно скажется на качестве. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3051 Вместо этого, мы увеличим y на 4: |
21525 | 3052 <screen>mplayer dvd://1 -vf crop=720:352:0:62</screen> |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3053 Другая причина, по которой мы урезаем пикселы сверху и снизу, заключаемся в том, |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3054 что мы хотим убедиться, что удалены все наполовину черные пикселы, если они есть. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3055 Если ваше видео телесиненное, убедитесь, что фильтр <option>pullup</option> (или |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3056 любой другой фильтр обратного телесина, который вы решили использовать) |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3057 находится в цепочке до фильтра crop. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3058 Если оно черезстрочное, то перед обрезкой проведите деинтерлейсинг. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3059 (Если решили сохранить черезстрочность видео, убедитесь, что вертикальный сдвиг |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3060 обрезания кратен 4.) |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3061 </para> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3062 |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3063 <para> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3064 Если вас действительно заботит потеря этих 10 пикселов, вы можете |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3065 вместо этого отмасштабировать фильм, уменьшив размерности до ближайших |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3066 кратных 16 значений. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3067 Цепочка фильтров будет выглядеть примерно так: |
21525 | 3068 <screen>-vf crop=720:362:0:58,scale=720:352</screen> |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3069 Подобное уменьшение изображения будет означать потерю небольшого количества |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3070 деталей, хотя это, возможно, окажется незаметным. Масштабирование изображения в |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3071 сторону увеличения даст худшее качество (если вы не увеличиваете битпоток). |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3072 Обрезка же полностью выбросит те пикселы. Это компромисс, идти на который или нет, |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3073 придется решать в каждом частном случае. Например, если DVD видео было создано |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3074 для телевидения, вы можете захотеть избежать вертикального масштабирования, |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3075 поскольки частота строчной развертки [line sampling] соответствует тому, как содержимое |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3076 изначально записывалось. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3077 </para> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3078 |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3079 <para> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3080 При проверке видим, что наш фильм имеет немного движения и большое количество |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3081 деталей, так что выбираем для битпотока значение 2400Кбит/сек. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3082 </para> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3083 |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3084 <para> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3085 Теперь мы готовы произвести двухпроходное кодирование. Проход первый: |
21525 | 3086 <screen> |
3087 mencoder dvd://1 -ofps 24000/1001 -oac copy -o <replaceable>Harry_Potter_2.avi</replaceable> -ovc lavc \ | |
3088 -lavcopts vcodec=mpeg4:vbitrate=2400:v4mv:mbd=2:trell:cmp=3:subcmp=3:mbcmp=3:autoaspect:vpass=1 \ | |
3089 -vf pullup,softskip,crop=720:352:0:62,hqdn3d=2:1:2 | |
3090 </screen> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3091 И второй проход с теми же параметрами, за исключением <option>vpass=2</option>: |
21525 | 3092 <screen> |
3093 mencoder dvd://1 -ofps 24000/1001 -oac copy -o <replaceable>Harry_Potter_2.avi</replaceable> -ovc lavc \ | |
3094 -lavcopts vcodec=mpeg4:vbitrate=2400:v4mv:mbd=2:trell:cmp=3:subcmp=3:mbcmp=3:autoaspect:vpass=2 \ | |
3095 -vf pullup,softskip,crop=720:352:0:62,hqdn3d=2:1:2 | |
3096 </screen> | |
3097 </para> | |
3098 | |
3099 <para> | |
21672
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3100 Опции <option>v4mv:mbd=2:trell</option> значительно улучшат качество ценой |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3101 времени кодирования. Нет никаких оснований отключать эти |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3102 опции, когда главным критерием является качество. Опции |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3103 <option>cmp=3:subcmp=3:mbcmp=3</option> выбирают функцию сравнения, дающую |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3104 лучшее качество, чем стандартная. Вы можете поэкспериментировать с этим параметром |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3105 (возможные значения смотрите на man странице), поскольку разные функции могут |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3106 давать разный прирост в качестве в зависимости от исходного материала. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3107 Например, если вы замечаете, что <systemitem class="library">libavcodec</systemitem> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3108 производит слишком много блочных артефактов (квадратиков), то можете попытаться |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3109 выбрать экспериментальный NSSE в качестве функции сравнения при помощи опциеи <option>*cmp=10</option>. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3110 </para> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3111 |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3112 <para> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3113 Для этого фильма полученный AVI будет 138 минут длинной и рамером около 3Гб. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3114 И, поскольку вы сказали, что размер файла значения не имеет, это вполне |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3115 приемлемый результат. Однако, если все-таки хотите получить меньший размер файла, |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3116 можете попробовать уменьшить битпоток. Увеличение битпотока имеет снижающийся эффект, |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3117 поэтому, хотя мы можем ясно видеть улучшение от 1800Кбит/сек до 20000Кбит/сек, оно |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3118 может быть не столь заметно выше 20000Кбит/сек. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3119 </para> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3120 |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3121 <para> |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3122 Так как мы пропустили исходное видео через фильтр удаления шума, то, возможно, |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3123 захочется вернуть какую-то его часть во время воспроизведения. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3124 Это, совместпно с фильтром постобработки <option>spp</option>, существенно |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3125 улучшит воспринимаемое качество и поможет избежать блочных артефактов в видео. |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3126 Опцией <option>autoq</option> <application>MPlayer</application>'а вы можете |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3127 изменять величину производимой фильтром spp постобработки в зависимости от |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3128 доступных ресурсов CPU. Вдобавок, на этом этапе вы можете захотеть применить |
7438195728a0
Translation of menc-feat-enc-libavcodec sect1 in encoding-guide.xml
voroshil
parents:
21598
diff
changeset
|
3129 коррекцию гаммы и/или цвета для лучшего соответствия вашему монитору. Например: |
21525 | 3130 <screen> |
3131 mplayer <replaceable>Harry_Potter_2.avi</replaceable> -vf spp,noise=9ah:5ah,eq2=1.2 -autoq 3 | |
3132 </screen> | |
20725 | 3133 </para> |
3134 </sect2> | |
3135 </sect1> | |
3136 | |
3137 | |
21525 | 3138 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> |
3139 | |
3140 | |
20725 | 3141 <sect1 id="menc-feat-xvid"> |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3142 <title>Кодирование кодеком <systemitem class="library">Xvid</systemitem></title> |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3143 |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3144 <para> |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3145 <systemitem class="library">Xvid</systemitem> - это свободная библиотека для |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3146 кодирования MPEG-4 ASP видео потоков. |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3147 Перед тем, как начать кодирование, вам потребуется <link linkend="xvid"> |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3148 настроить <application>MEncoder</application> для его поддержки</link>. |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3149 </para> |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3150 |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3151 <para> |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3152 Это руководство в основном нацелено на особенности применения тех же методов, |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3153 что описаны в руководстве по кодированию с помощью x264. |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3154 Поэтому, сначала прочтите, пожалуйста, |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3155 <link linkend="menc-feat-x264-encoding-options-intro">первую часть</link> |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3156 того руководства. |
21525 | 3157 </para> |
3158 | |
3159 <!-- ********** --> | |
20725 | 3160 |
3161 <sect2 id="menc-feat-xvid-intro"> | |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3162 <title>Какие опции следует использовать для получения лучших резудьтатов?</title> |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3163 |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3164 <para> |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3165 Пожалуйста, начните с просмотра раздела |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3166 <systemitem class="library">Xvid</systemitem> man страницы |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3167 <application>MPlayer</application>. |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3168 Этот раздел предполагается как дополнение к man странице. |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3169 </para> |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3170 |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3171 <para> |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3172 Настройки по-умолчанию Xvid уже являются хорошим выбором между скоростью и |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3173 качеством, поэтому вы можете без опасений придерживаться их, если следующий |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3174 раздел вас озадачивает. |
20725 | 3175 </para> |
3176 </sect2> | |
3177 | |
21525 | 3178 <!-- ********** --> |
3179 | |
20725 | 3180 <sect2 id="menc-feat-xvid-encoding-options"> |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3181 <title>Опции кодирования <systemitem class="library">Xvid</systemitem></title> |
20725 | 3182 |
3183 <itemizedlist> | |
3184 <listitem><para> | |
21525 | 3185 <emphasis role="bold">vhq</emphasis> |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3186 Эта опция влияет на алгоритм принятия решений о макроблоке, чем выше значение, тем |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3187 мудрее будут решения. |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3188 Значение по-умолчанию можно без опаски использовать для любого кодирования, в |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3189 то время, как более высокие значения улучшат PSNR, но будут работать значительно |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3190 медленнее. |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3191 Заметье, пожалуйста, что лучший PSNR не обязательно означает лучше выглядящую |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3192 картинку, но говорит, что она ближе к оригиналу. |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3193 Отключение этой опции заметно ускоряет кодирование; это может быть достойным |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3194 компромиссом, если скорость вам критична. |
20725 | 3195 </para></listitem> |
3196 <listitem><para> | |
21525 | 3197 <emphasis role="bold">bvhq</emphasis> |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3198 То же, что и vhq, но для B-кадров. |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3199 Имеет незначительное влияние на скорость и слегка улучшает качество (около |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3200 +0.1дБ). |
20725 | 3201 </para></listitem> |
3202 <listitem><para> | |
21525 | 3203 <emphasis role="bold">max_bframes</emphasis> |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3204 Большее число допустимых последовательных B-кадров обычно улучшает |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3205 сжимаемость, хотя оно может также привести к большему количеству блочных |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3206 артефактов (квадратиков). |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3207 Значение по-умолчанию - хороший выбор между сжимаемостью и качеством, но вы |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3208 можете увеличить его до 3, если стеснены величиной битпотока. |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3209 Вы также можете уменьшить это значение до 1 или 0, если печетесь об отличном качестве, |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3210 впрочем в этом случае вы должны убедиться, что целевой битпоток достаточно высок, |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3211 дабы кодировщик не увеличивал значение квантователя, сохраняя нужную величину |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3212 битпотока. |
20725 | 3213 </para></listitem> |
3214 <listitem><para> | |
21525 | 3215 <emphasis role="bold">bf_threshold</emphasis> |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3216 Управляет чувствительностью кодировщика к B-кадрам, где большие значения |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3217 приводят к использованию большиего количество B-кадров (и наоборот). |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3218 Опция должна использоваться совместно с <option>max_bframes</option>; |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3219 если вы стеснены величиной битпотока, то должны увеличить и |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3220 <option>max_bframes</option>, и <option>bf_threshold</option>, |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3221 в том время как увеличение <option>max_bframes</option> и уменьшение |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3222 <option>bf_threshold</option> позволят кодировщику использовать больше |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3223 B-кадров в местах, где это <emphasis role="bold">действительно</emphasis> |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3224 необходимо. |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3225 Низкое количество <option>max_bframes</option> и высокое значение |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3226 <option>bf_threshold</option> - это, возможно, не самое мудрое решение, |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3227 поскольку оно принудит кодировщик размещать B-кадры в местах, которые никак не |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3228 выиграют от этого, тем самым ухудшая визуальное качество. |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3229 Однако, если вам требуется совместимость с аппаратными |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3230 проигрывателями, поддерживающими только старые DivX профили (которые |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3231 поддерживают только 1 последовательный B-кадр), это единственный способ |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3232 увеличить сжимаемость при помощи B-кадров. |
20725 | 3233 </para></listitem> |
3234 <listitem><para> | |
21525 | 3235 <emphasis role="bold">trellis</emphasis> |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3236 Оптимизирует процесс квантования для получения оптимального |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3237 соотношения между PSNR и битпотоком, что позволяет существенно экономить биты. |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3238 Эти биты впоследствии будут потрачены на другие части видео, что приведет к |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3239 увеличению общего качества. |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3240 Следует всегда оставлять эту опцию включенной, поскольку ее влияние на |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3241 качество огромно. Даже если вы заботитесь о скорости, не отключайте ее до тех |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3242 пор, пока не выставили <option>vhq</option> и остальные более CPU-прожорливые |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3243 опции на минимум. |
20725 | 3244 </para></listitem> |
3245 <listitem><para> | |
3246 <emphasis role="bold">hq_ac</emphasis> | |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3247 Активирует более точный метод оценки стоимости коэффициентов, что |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3248 уменьшает размер файла примерно на 0.15 - 0.19% (соответствует увеличению |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3249 PSNR меньше, чем на 0.01дБ), имея несущественное влияние на скорость. |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3250 Поэтому, рекомендуется всегда держать эту опцию включенной. |
20725 | 3251 </para></listitem> |
3252 <listitem><para> | |
21525 | 3253 <emphasis role="bold">cartoon</emphasis> |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3254 Разработана для лучшего кодирования мультфильмов и не влияет на скорость, |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3255 поскольку всего-лишь настраивает эвристики принятия решений о режимах для |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3256 этого типа содержимого. |
20725 | 3257 </para></listitem> |
21525 | 3258 <listitem> |
3259 <para> | |
3260 <emphasis role="bold">me_quality</emphasis> | |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3261 Это опция для настройки точности оценки движения. |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3262 Чем выше <option>me_quality</option>, тем точнее будет оценка оригинального |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3263 |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3264 движения и тем лучше получающийся отрывок будет фиксировать оригинальное движение. |
21525 | 3265 </para> |
3266 | |
3267 <para> | |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3268 Настройка по-умолчанию лучше во всех случаях, поэтому не рекомендуется ее |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3269 выключать, если только вы действительно не гонитесь за скоростью, поскольку |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3270 биты, сэкономленные хорошей оценкой движения, могут быть использованы |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3271 где-нибудь еще, увеличивая общее качество. |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3272 Таким образом, не используйте значения ниже 5, да и его - только в крайнем |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3273 случае. |
21525 | 3274 </para> |
3275 </listitem> | |
20725 | 3276 <listitem><para> |
21525 | 3277 <emphasis role="bold">chroma_me</emphasis> |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3278 Улучшает оценку движения, дополнительно принимая во внимание информацию о |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3279 цвете, тогда как одна <option>me_quality</option> использует только яркость. |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3280 Это замедляет кодирование на 5-10%, но несколько улучшает визуальное качество, |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3281 уменьшая эффект блочности и сокращая размер файла примерно на 1.3%. |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3282 Если вас интересует скорость, следует попробовать отключить эту опцию, прежде |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3283 чем решите уменьшать значение <option>me_quality</option>. |
20725 | 3284 </para></listitem> |
3285 <listitem><para> | |
3286 <emphasis role="bold">chroma_opt</emphasis> | |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3287 Эта опция служит для увеличения качества цветного изображения вокруг чисто черных/белых |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3288 краниц вместо улучшения сжатия. Она также может помочь против |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3289 эффекта красных ступенек ["red stairs" effect]. |
20725 | 3290 </para></listitem> |
3291 <listitem><para> | |
3292 <emphasis role="bold">lumi_mask</emphasis> | |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3293 Пытается отдать меньший битпоток областям изображения, которые |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3294 человеческий глаз не в состоянии цвидеть достаточно хорошо, что |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3295 позволит кодировщику потратить сэкономленные биты на более важные |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3296 части картинки. Качество закодированного материала, привнесенное этой |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3297 опцией, сильно зависит от личных предпочтений и от типа и настроек монитора, |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3298 использовавшегося для просмотра (обычно результат выглядит не очень хорошо, |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3299 если он яркий, или является TFT монитором). |
20725 | 3300 </para></listitem> |
21525 | 3301 <listitem> |
3302 <para> | |
20725 | 3303 <emphasis role="bold">qpel</emphasis> |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3304 Увеличивает количество предполагаемых векторов движения, повышая точность |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3305 оценки движения с полупиксельной до четверьтпиксельной. |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3306 Идея состоит в том, чтобы найти лучшие векторы движения, которые взамен |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3307 уменьшат битпоток (тем самым увеличивая качество). |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3308 Однако, векторы движения с четверьтпиксельной точностью требуют большего |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3309 количества дополнительных бит для кодирования, а векторы-кандидаты не всегда |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3310 дают (значительно) лучшие результаты. |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3311 Почти всегда кодек тратит дополнительные биты на повышенную точность |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3312 впустую, а в взамен получает или вообще ничего, или небольшое увеличение качества. |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3313 К сожалению, нет способа предсказать возможные улучшения от <option>qpel</option>, |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3314 так что вам пирдется сделать кодирование с ней и без нее, чтобы знать |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3315 наверняка. |
21525 | 3316 </para> |
3317 | |
3318 <para> | |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3319 <option>qpel</option> может привести к удвоенному времени кодирования и |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3320 требует, как минимум, на 25% большей мощности при декодировании. |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3321 Она поддерживается не всеми аппаратными проигрывателями. |
21525 | 3322 </para> |
3323 </listitem> | |
20725 | 3324 <listitem><para> |
3325 <emphasis role="bold">gmc</emphasis> | |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3326 Пытается сэкономить биты в сценах с приближением, используя один вектор |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3327 движения для всего кадра. Это почти всегда увеличивает PSNR, но заметно |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3328 замедляет кодирования (так же как и декодирование). |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3329 Поэтому вас следует использовать ее, только когда вы включили |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3330 <option>vhq</option> на максимум. |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3331 GMC <systemitem class="library">Xvid</systemitem>'а является более сложным, |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3332 чем у DivX'а, но поддерживается только некоторыми аппаратными проигрывателями. |
20725 | 3333 </para></listitem> |
3334 </itemizedlist> | |
3335 </sect2> | |
3336 | |
21525 | 3337 <!-- ********** --> |
3338 | |
20725 | 3339 <sect2 id="menc-feat-xvid-encoding-profiles"> |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3340 <title>Профили кодирования</title> |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3341 |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3342 <para> |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3343 Xvid поддерживает профили кодирования через опцию <option>profile</option>, |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3344 которая используется для накладиывания ограничений на значения видео потока Xvid таким |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3345 образом, что он будет воспроизводиться на всем, что поддерживает выбранный |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3346 профиль. |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3347 Ограничения относятся к разрешению, битпотоку и некоторым возможностям MPEG-4. |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3348 Следующая таблица показывает, что поддерживает тот или иной профиль. |
21525 | 3349 </para> |
3350 | |
20725 | 3351 <informaltable> |
3352 <tgroup cols="16" align="center"> | |
3353 <colspec colnum="1" colname="col1"/> | |
3354 <colspec colnum="2" colname="col2"/> | |
3355 <colspec colnum="3" colname="col3"/> | |
3356 <colspec colnum="4" colname="col4"/> | |
3357 <colspec colnum="5" colname="col5"/> | |
3358 <colspec colnum="6" colname="col6"/> | |
3359 <colspec colnum="7" colname="col7"/> | |
3360 <colspec colnum="8" colname="col8"/> | |
3361 <colspec colnum="9" colname="col9"/> | |
3362 <colspec colnum="10" colname="col10"/> | |
3363 <colspec colnum="11" colname="col11"/> | |
3364 <colspec colnum="12" colname="col12"/> | |
3365 <colspec colnum="13" colname="col13"/> | |
3366 <colspec colnum="14" colname="col14"/> | |
3367 <colspec colnum="15" colname="col15"/> | |
3368 <colspec colnum="16" colname="col16"/> | |
3369 <colspec colnum="17" colname="col17"/> | |
3370 <spanspec spanname="spa2-5" namest="col2" nameend="col5"/> | |
3371 <spanspec spanname="spa6-11" namest="col6" nameend="col11"/> | |
3372 <spanspec spanname="spa12-17" namest="col12" nameend="col17"/> | |
21525 | 3373 <tbody> |
3374 <row> | |
3375 <entry></entry> | |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3376 <entry spanname="spa2-5">Простой</entry> |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3377 <entry spanname="spa6-11">Расширенный простой</entry> |
21525 | 3378 <entry spanname="spa12-17">DivX</entry> |
3379 </row> | |
3380 <row> | |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3381 <entry>Название профиля</entry> |
21525 | 3382 <entry>0</entry> |
3383 <entry>1</entry> | |
3384 <entry>2</entry> | |
3385 <entry>3</entry> | |
3386 <entry>0</entry> | |
3387 <entry>1</entry> | |
3388 <entry>2</entry> | |
3389 <entry>3</entry> | |
3390 <entry>4</entry> | |
3391 <entry>5</entry> | |
3392 <entry>Handheld</entry> | |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3393 <entry>Портативный NTSC</entry> |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3394 <entry>Портативный PAL</entry> |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3395 <entry>Домашний кинотеатр NTSC</entry> |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3396 <entry>Домашний кинотеатр PAL</entry> |
21525 | 3397 <entry>HDTV</entry> |
3398 </row> | |
3399 <row> | |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3400 <entry>Ширина [пикселов]</entry> |
21525 | 3401 <entry>176</entry> |
3402 <entry>176</entry> | |
3403 <entry>352</entry> | |
3404 <entry>352</entry> | |
3405 <entry>176</entry> | |
3406 <entry>176</entry> | |
3407 <entry>352</entry> | |
3408 <entry>352</entry> | |
3409 <entry>352</entry> | |
3410 <entry>720</entry> | |
3411 <entry>176</entry> | |
3412 <entry>352</entry> | |
3413 <entry>352</entry> | |
3414 <entry>720</entry> | |
3415 <entry>720</entry> | |
3416 <entry>1280</entry> | |
3417 </row> | |
3418 <row> | |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3419 <entry>Высота [пикселов]</entry> |
21525 | 3420 <entry>144</entry> |
3421 <entry>144</entry> | |
3422 <entry>288</entry> | |
3423 <entry>288</entry> | |
3424 <entry>144</entry> | |
3425 <entry>144</entry> | |
3426 <entry>288</entry> | |
3427 <entry>288</entry> | |
3428 <entry>576</entry> | |
3429 <entry>576</entry> | |
3430 <entry>144</entry> | |
3431 <entry>240</entry> | |
3432 <entry>288</entry> | |
3433 <entry>480</entry> | |
3434 <entry>576</entry> | |
3435 <entry>720</entry> | |
3436 </row> | |
3437 <row> | |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3438 <entry>Частота кадров [fps]</entry> |
21525 | 3439 <entry>15</entry> |
3440 <entry>15</entry> | |
3441 <entry>15</entry> | |
3442 <entry>15</entry> | |
3443 <entry>30</entry> | |
3444 <entry>30</entry> | |
3445 <entry>15</entry> | |
3446 <entry>30</entry> | |
3447 <entry>30</entry> | |
3448 <entry>30</entry> | |
3449 <entry>15</entry> | |
3450 <entry>30</entry> | |
3451 <entry>25</entry> | |
3452 <entry>30</entry> | |
3453 <entry>25</entry> | |
3454 <entry>30</entry> | |
3455 </row> | |
3456 <row> | |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3457 <entry>Максимальный средний битпоток [кбит/сек]</entry> |
21525 | 3458 <entry>64</entry> |
3459 <entry>64</entry> | |
3460 <entry>128</entry> | |
3461 <entry>384</entry> | |
3462 <entry>128</entry> | |
3463 <entry>128</entry> | |
3464 <entry>384</entry> | |
3465 <entry>768</entry> | |
3466 <entry>3000</entry> | |
3467 <entry>8000</entry> | |
3468 <entry>537.6</entry> | |
3469 <entry>4854</entry> | |
3470 <entry>4854</entry> | |
3471 <entry>4854</entry> | |
3472 <entry>4854</entry> | |
3473 <entry>9708.4</entry> | |
3474 </row> | |
3475 <row> | |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3476 <entry>Пиковое значение средней величины битпотока за 3 секунды [кбит/сек]</entry> |
21525 | 3477 <entry></entry> |
3478 <entry></entry> | |
3479 <entry></entry> | |
3480 <entry></entry> | |
3481 <entry></entry> | |
3482 <entry></entry> | |
3483 <entry></entry> | |
3484 <entry></entry> | |
3485 <entry></entry> | |
3486 <entry></entry> | |
3487 <entry>800</entry> | |
3488 <entry>8000</entry> | |
3489 <entry>8000</entry> | |
3490 <entry>8000</entry> | |
3491 <entry>8000</entry> | |
3492 <entry>16000</entry> | |
3493 </row> | |
3494 <row> | |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3495 <entry>Макс. B-кадров</entry> |
21525 | 3496 <entry>0</entry> |
3497 <entry>0</entry> | |
3498 <entry>0</entry> | |
3499 <entry>0</entry> | |
3500 <entry></entry> | |
3501 <entry></entry> | |
3502 <entry></entry> | |
3503 <entry></entry> | |
3504 <entry></entry> | |
3505 <entry></entry> | |
3506 <entry>0</entry> | |
3507 <entry>1</entry> | |
3508 <entry>1</entry> | |
3509 <entry>1</entry> | |
3510 <entry>1</entry> | |
3511 <entry>2</entry> | |
3512 </row> | |
3513 <row> | |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3514 <entry>MPEG квантование</entry> |
21525 | 3515 <entry></entry> |
3516 <entry></entry> | |
3517 <entry></entry> | |
3518 <entry></entry> | |
3519 <entry>X</entry> | |
3520 <entry>X</entry> | |
3521 <entry>X</entry> | |
3522 <entry>X</entry> | |
3523 <entry>X</entry> | |
3524 <entry>X</entry> | |
3525 <entry></entry> | |
3526 <entry></entry> | |
3527 <entry></entry> | |
3528 <entry></entry> | |
3529 <entry></entry> | |
3530 <entry></entry> | |
3531 </row> | |
3532 <row> | |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3533 <entry>Адаптивное квантование</entry> |
21525 | 3534 <entry></entry> |
3535 <entry></entry> | |
3536 <entry></entry> | |
3537 <entry></entry> | |
3538 <entry>X</entry> | |
3539 <entry>X</entry> | |
3540 <entry>X</entry> | |
3541 <entry>X</entry> | |
3542 <entry>X</entry> | |
3543 <entry>X</entry> | |
3544 <entry>X</entry> | |
3545 <entry>X</entry> | |
3546 <entry>X</entry> | |
3547 <entry>X</entry> | |
3548 <entry>X</entry> | |
3549 <entry>X</entry> | |
3550 </row> | |
3551 <row> | |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3552 <entry>Черезстрочное кодирование</entry> |
21525 | 3553 <entry></entry> |
3554 <entry></entry> | |
3555 <entry></entry> | |
3556 <entry></entry> | |
3557 <entry>X</entry> | |
3558 <entry>X</entry> | |
3559 <entry>X</entry> | |
3560 <entry>X</entry> | |
3561 <entry>X</entry> | |
3562 <entry>X</entry> | |
3563 <entry></entry> | |
3564 <entry></entry> | |
3565 <entry></entry> | |
3566 <entry>X</entry> | |
3567 <entry>X</entry> | |
3568 <entry>X</entry> | |
3569 </row> | |
3570 <row> | |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3571 <entry>Четвертьпиксельная точность</entry> |
21525 | 3572 <entry></entry> |
3573 <entry></entry> | |
3574 <entry></entry> | |
3575 <entry></entry> | |
3576 <entry>X</entry> | |
3577 <entry>X</entry> | |
3578 <entry>X</entry> | |
3579 <entry>X</entry> | |
3580 <entry>X</entry> | |
3581 <entry>X</entry> | |
3582 <entry></entry> | |
3583 <entry></entry> | |
3584 <entry></entry> | |
3585 <entry></entry> | |
3586 <entry></entry> | |
3587 <entry></entry> | |
3588 </row> | |
3589 <row> | |
3590 <entry>Global motion compensation</entry> | |
3591 <entry></entry> | |
3592 <entry></entry> | |
3593 <entry></entry> | |
3594 <entry></entry> | |
3595 <entry>X</entry> | |
3596 <entry>X</entry> | |
3597 <entry>X</entry> | |
3598 <entry>X</entry> | |
3599 <entry>X</entry> | |
3600 <entry>X</entry> | |
3601 <entry></entry> | |
3602 <entry></entry> | |
3603 <entry></entry> | |
3604 <entry></entry> | |
3605 <entry></entry> | |
3606 <entry></entry> | |
3607 </row> | |
3608 </tbody> | |
20725 | 3609 </tgroup> |
3610 </informaltable> | |
3611 </sect2> | |
3612 | |
21525 | 3613 <!-- ********** --> |
3614 | |
20725 | 3615 <sect2 id="menc-feat-xvid-example-settings"> |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3616 <title>Примеры настроек кодирования</title> |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3617 |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3618 <para> |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3619 Последующие настройки - это примеры различных комбинаций опций кодирования, |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3620 которые влияют на соотношения скорость-качество при той же величине целевого |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3621 битпотока. |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3622 </para> |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3623 |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3624 <para> |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3625 Все настройки кодирования проверялись на тестовом видео 720x448 @30000/1001 fps |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3626 с целевым битпотоком 900кбит/сек, на машине AMD-64 3400+ с 2400 МГц и 64 битном режиме. |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3627 Для каждой настройки кодирования указаны измеренная скорость кодирования (в |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3628 кадрах в секунду) и потеря PSNR (в дБ) по сравнению с настройкой "очень высокое |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3629 качество". Поймите, пожалуйста, что в зависимости от вашего материала, типа |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3630 машины, прогресса разработки вы можете получить сильно отличающиеся результаты. |
21525 | 3631 </para> |
3632 | |
20725 | 3633 <informaltable frame="all"> |
3634 <tgroup cols="4"> | |
3635 <thead> | |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3636 <row><entry>Описание</entry><entry>Опции кодирования</entry><entry>скорость |
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3637 (в fps)</entry><entry>Относительная потеря PSNR (в дБ)</entry></row> |
20725 | 3638 </thead> |
3639 <tbody> | |
3640 <row> | |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3641 <entry>Очень высокое качество</entry> |
20725 | 3642 <entry><option>chroma_opt:vhq=4:bvhq=1:quant_type=mpeg</option></entry> |
3643 <entry>16fps</entry> | |
3644 <entry>0dB</entry> | |
3645 </row> | |
3646 <row> | |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3647 <entry>Высокое качество</entry> |
20725 | 3648 <entry><option>vhq=2:bvhq=1:chroma_opt:quant_type=mpeg</option></entry> |
3649 <entry>18fps</entry> | |
3650 <entry>-0.1dB</entry> | |
3651 </row> | |
3652 <row> | |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3653 <entry>Быстрое</entry> |
20725 | 3654 <entry><option>turbo:vhq=0</option></entry> |
3655 <entry>28fps</entry> | |
3656 <entry>-0.69dB</entry> | |
3657 </row> | |
3658 <row> | |
21680
e09ef4ecdb30
Translation of menc-feat-xvid sect1 in encoding-guide.xml
voroshil
parents:
21672
diff
changeset
|
3659 <entry>Реального времени</entry> |
20725 | 3660 <entry><option>turbo:nochroma_me:notrellis:max_bframes=0:vhq=0</option></entry> |
3661 <entry>38fps</entry> | |
3662 <entry>-1.48dB</entry> | |
3663 </row> | |
3664 </tbody> | |
3665 </tgroup> | |
3666 </informaltable> | |
3667 </sect2> | |
3668 </sect1> | |
3669 | |
21525 | 3670 |
3671 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> | |
3672 | |
3673 | |
20725 | 3674 <sect1 id="menc-feat-x264"> |
3675 <title>Encoding with the <systemitem class="library">x264</systemitem> codec</title> | |
3676 <para> | |
21525 | 3677 <systemitem class="library">x264</systemitem> is a free library for |
3678 encoding H.264/AVC video streams. | |
3679 Before starting to encode, you need to <link linkend="codec-x264-encode"> | |
3680 set up <application>MEncoder</application> to support it</link>. | |
3681 </para> | |
3682 | |
3683 <!-- ********** --> | |
20725 | 3684 |
3685 <sect2 id="menc-feat-x264-encoding-options"> | |
3686 <title>Encoding options of x264</title> | |
3687 | |
3688 <para> | |
21525 | 3689 Please begin by reviewing the |
3690 <systemitem class="library">x264</systemitem> section of | |
3691 <application>MPlayer</application>'s man page. | |
3692 This section is intended to be a supplement to the man page. | |
3693 Here you will find quick hints about which options are most | |
3694 likely to interest most people. The man page is more terse, | |
3695 but also more exhaustive, and it sometimes offers much better | |
3696 technical detail. | |
3697 </para> | |
3698 | |
20725 | 3699 |
3700 <sect3 id="menc-feat-x264-encoding-options-intro"> | |
3701 <title>Introduction</title> | |
21525 | 3702 |
3703 <para> | |
3704 This guide considers two major categories of encoding options: | |
3705 </para> | |
20725 | 3706 |
3707 <orderedlist> | |
21525 | 3708 <listitem><para> |
3709 Options which mainly trade off encoding time vs. quality | |
3710 </para></listitem> | |
3711 <listitem><para> | |
3712 Options which may be useful for fulfilling various personal | |
3713 preferences and special requirements | |
3714 </para></listitem> | |
20725 | 3715 </orderedlist> |
3716 | |
3717 <para> | |
21525 | 3718 Ultimately, only you can decide which options are best for your |
3719 purposes. The decision for the first class of options is the simplest: | |
3720 you only have to decide whether you think the quality differences | |
3721 justify the speed differences. For the second class of options, | |
3722 preferences may be far more subjective, and more factors may be | |
3723 involved. Note that some of the "personal preferences and special | |
3724 requirements" options can still have large impacts on speed or quality, | |
3725 but that is not what they are primarily useful for. A couple of the | |
3726 "personal preference" options may even cause changes that look better | |
3727 to some people, but look worse to others. | |
3728 </para> | |
3729 | |
3730 <para> | |
3731 Before continuing, you need to understand that this guide uses only one | |
3732 quality metric: global PSNR. | |
3733 For a brief explanation of what PSNR is, see | |
3734 <ulink url="http://en.wikipedia.org/wiki/PSNR">the Wikipedia article on PSNR</ulink>. | |
3735 Global PSNR is the last PSNR number reported when you include | |
3736 the <option>psnr</option> option in <option>x264encopts</option>. | |
3737 Any time you read a claim about PSNR, one of the assumptions | |
3738 behind the claim is that equal bitrates are used. | |
3739 </para> | |
3740 | |
3741 <para> | |
3742 Nearly all of this guide's comments assume you are using | |
3743 two pass. | |
3744 When comparing options, there are two major reasons for using | |
3745 two pass encoding. | |
3746 First, using two pass often gains around 1dB PSNR, which is a | |
3747 very big difference. | |
3748 Secondly, testing options by doing direct quality comparisons | |
3749 with one pass encodes introduces a major confounding | |
3750 factor: bitrate often varies significantly with each encode. | |
3751 It is not always easy to tell whether quality changes are due | |
3752 mainly to changed options, or if they mostly reflect essentially | |
3753 random differences in the achieved bitrate. | |
3754 </para> | |
20725 | 3755 </sect3> |
3756 | |
21525 | 3757 |
20725 | 3758 <sect3 id="menc-feat-x264-encoding-options-speedvquality"> |
3759 <title>Options which primarily affect speed and quality</title> | |
3760 | |
3761 <itemizedlist> | |
21525 | 3762 <listitem> |
3763 <para> | |
20725 | 3764 <emphasis role="bold">subq</emphasis>: |
3765 Of the options which allow you to trade off speed for quality, | |
3766 <option>subq</option> and <option>frameref</option> (see below) are usually | |
3767 by far the most important. | |
3768 If you are interested in tweaking either speed or quality, these | |
3769 are the first options you should consider. | |
3770 On the speed dimension, the <option>frameref</option> and | |
3771 <option>subq</option> options interact with each other fairly | |
3772 strongly. | |
3773 Experience shows that, with one reference frame, | |
3774 <option>subq=5</option> (the default setting) takes about 35% more time than | |
3775 <option>subq=1</option>. | |
3776 With 6 reference frames, the penalty grows to over 60%. | |
3777 <option>subq</option>'s effect on PSNR seems fairly constant | |
3778 regardless of the number of reference frames. | |
3779 Typically, <option>subq=5</option> achieves 0.2-0.5 dB higher global | |
3780 PSNR in comparison <option>subq=1</option>. | |
3781 This is usually enough to be visible. | |
21525 | 3782 </para> |
3783 | |
3784 <para> | |
20725 | 3785 <option>subq=6</option> is the slowest, highest quality mode. |
3786 In comparison to <option>subq=5</option>, it usually gains 0.1-0.4 dB | |
3787 global PSNR with speed costs varying from 25%-100%. | |
3788 Unlike other levels of <option>subq</option>, the behavior of | |
3789 <option>subq=6</option> does not depend much on <option>frameref</option> | |
3790 and <option>me</option>. Instead, the effectiveness of <option>subq=6 | |
3791 </option> depends mostly upon the number of B-frames used. In normal | |
3792 usage, this means <option>subq=6</option> has a large impact on both speed | |
3793 and quality in complex, high motion scenes, but it may not have much effect | |
3794 in low-motion scenes. Note that it is still recommended to always set | |
3795 <option>bframes</option> to something other than zero (see below). | |
21525 | 3796 </para> |
3797 </listitem> | |
3798 <listitem> | |
3799 <para> | |
20725 | 3800 <emphasis role="bold">frameref</emphasis>: |
3801 <option>frameref</option> is set to 1 by default, but this | |
21525 | 3802 should not be taken to imply that it is reasonable to set it to 1. |
20725 | 3803 Merely raising <option>frameref</option> to 2 gains around |
21525 | 3804 0.15dB PSNR with a 5-10% speed penalty; this seems like a good tradeoff. |
20725 | 3805 <option>frameref=3</option> gains around 0.25dB PSNR over |
21525 | 3806 <option>frameref=1</option>, which should be a visible difference. |
20725 | 3807 <option>frameref=3</option> is around 15% slower than |
3808 <option>frameref=1</option>. | |
3809 Unfortunately, diminishing returns set in rapidly. | |
3810 <option>frameref=6</option> can be expected to gain only | |
3811 0.05-0.1 dB over <option>frameref=3</option> at an additional | |
3812 15% speed penalty. | |
3813 Above <option>frameref=6</option>, the quality gains are | |
3814 usually very small (although you should keep in mind throughout | |
21525 | 3815 this whole discussion that it can vary quite a lot depending on your source). |
20725 | 3816 In a fairly typical case, <option>frameref=12</option> |
3817 will improve global PSNR by a tiny 0.02dB over | |
3818 <option>frameref=6</option>, at a speed cost of 15%-20%. | |
3819 At such high <option>frameref</option> values, the only really | |
3820 good thing that can be said is that increasing it even further will | |
3821 almost certainly never <emphasis role="bold">harm</emphasis> | |
3822 PSNR, but the additional quality benefits are barely even | |
3823 measurable, let alone perceptible. | |
21525 | 3824 </para> |
3825 <note><title>Note:</title> | |
3826 <para> | |
20725 | 3827 Raising <option>frameref</option> to unnecessarily high values |
3828 <emphasis role="bold">can</emphasis> and | |
3829 <emphasis role="bold">usually does</emphasis> | |
3830 hurt coding efficiency if you turn CABAC off. | |
3831 With CABAC on (the default behavior), the possibility of setting | |
3832 <option>frameref</option> "too high" currently seems too remote | |
3833 to even worry about, and in the future, optimizations may remove | |
3834 the possibility altogether. | |
21525 | 3835 </para></note> |
3836 <para> | |
20725 | 3837 If you care about speed, a reasonable compromise is to use low |
3838 <option>subq</option> and <option>frameref</option> values on | |
3839 the first pass, and then raise them on the second pass. | |
3840 Typically, this has a negligible negative effect on the final | |
3841 quality: You will probably lose well under 0.1dB PSNR, which | |
3842 should be much too small of a difference to see. | |
3843 However, different values of <option>frameref</option> can | |
3844 occasionally affect frametype decision. | |
3845 Most likely, these are rare outlying cases, but if you want to | |
3846 be pretty sure, consider whether your video has either | |
3847 fullscreen repetitive flashing patterns or very large temporary | |
3848 occlusions which might force an I-frame. | |
3849 Adjust the first-pass <option>frameref</option> so it is large | |
3850 enough to contain the duration of the flashing cycle (or occlusion). | |
3851 For example, if the scene flashes back and forth between two images | |
3852 over a duration of three frames, set the first pass | |
3853 <option>frameref</option> to 3 or higher. | |
3854 This issue is probably extremely rare in live action video material, | |
3855 but it does sometimes come up in video game captures. | |
21525 | 3856 </para> |
3857 </listitem> | |
3858 <listitem> | |
3859 <para> | |
20725 | 3860 <emphasis role="bold">me</emphasis>: |
3861 This option is for choosing the motion estimation search method. | |
3862 Altering this option provides a straightforward quality-vs-speed | |
3863 tradeoff. <option>me=dia</option> is only a few percent faster than | |
3864 the default search, at a cost of under 0.1dB global PSNR. The | |
3865 default setting (<option>me=hex</option>) is a reasonable tradeoff | |
3866 between speed and quality. <option>me=umh</option> gains a little under | |
3867 0.1dB global PSNR, with a speed penalty that varies depending on | |
3868 <option>frameref</option>. At high values of | |
3869 <option>frameref</option> (e.g. 12 or so), <option>me=umh</option> | |
3870 is about 40% slower than the default <option> me=hex</option>. With | |
3871 <option>frameref=3</option>, the speed penalty incurred drops to | |
3872 25%-30%. | |
21525 | 3873 </para> |
3874 <para> | |
20725 | 3875 <option>me=esa</option> uses an exhaustive search that is too slow for |
3876 practical use. | |
21525 | 3877 </para> |
20725 | 3878 </listitem> |
3879 <listitem><para> | |
3880 <emphasis role="bold">partitions=all</emphasis>: | |
3881 This option enables the use of 8x4, 4x8 and 4x4 subpartitions in | |
3882 predicted macroblocks (in addition to the default partitions). | |
3883 Enabling it results in a fairly consistent | |
3884 10%-15% loss of speed. This option is rather useless in source | |
3885 containing only low motion, however in some high-motion source, | |
3886 particularly source with lots of small moving objects, gains of | |
3887 about 0.1dB can be expected. | |
21525 | 3888 </para></listitem> |
3889 <listitem> | |
3890 <para> | |
20725 | 3891 <emphasis role="bold">bframes</emphasis>: |
3892 If you are used to encoding with other codecs, you may have found | |
3893 that B-frames are not always useful. | |
3894 In H.264, this has changed: there are new techniques and block | |
3895 types that are possible in B-frames. | |
3896 Usually, even a naive B-frame choice algorithm can have a | |
3897 significant PSNR benefit. | |
3898 It is interesting to note that using B-frames usually speeds up | |
3899 the second pass somewhat, and may also speed up a single | |
3900 pass encode if adaptive B-frame decision is turned off. | |
21525 | 3901 </para> |
3902 <para> | |
20725 | 3903 With adaptive B-frame decision turned off |
3904 (<option>x264encopts</option>'s <option>nob_adapt</option>), | |
3905 the optimal value for this setting is usually no more than | |
3906 <option>bframes=1</option>, or else high-motion scenes can suffer. | |
3907 With adaptive B-frame decision on (the default behavior), it is | |
3908 safe to use higher values; the encoder will reduce the use of | |
3909 B-frames in scenes where they would hurt compression. | |
3910 The encoder rarely chooses to use more than 3 or 4 B-frames; | |
3911 setting this option any higher will have little effect. | |
21525 | 3912 </para> |
3913 </listitem> | |
3914 <listitem> | |
3915 <para> | |
20725 | 3916 <emphasis role="bold">b_adapt</emphasis>: |
3917 Note: This is on by default. | |
21525 | 3918 </para> |
3919 <para> | |
20725 | 3920 With this option enabled, the encoder will use a reasonably fast |
3921 decision process to reduce the number of B-frames used in scenes that | |
3922 might not benefit from them as much. | |
3923 You can use <option>b_bias</option> to tweak how B-frame-happy | |
3924 the encoder is. | |
3925 The speed penalty of adaptive B-frames is currently rather modest, | |
3926 but so is the potential quality gain. | |
3927 It usually does not hurt, however. | |
3928 Note that this only affects speed and frametype decision on the | |
3929 first pass. | |
3930 <option>b_adapt</option> and <option>b_bias</option> have no | |
3931 effect on subsequent passes. | |
21525 | 3932 </para> |
3933 </listitem> | |
20725 | 3934 <listitem><para> |
3935 <emphasis role="bold">b_pyramid</emphasis>: | |
3936 You might as well enable this option if you are using >=2 B-frames; | |
3937 as the man page says, you get a little quality improvement at no | |
3938 speed cost. | |
3939 Note that these videos cannot be read by libavcodec-based decoders | |
3940 older than about March 5, 2005. | |
3941 </para></listitem> | |
21525 | 3942 <listitem> |
3943 <para> | |
20725 | 3944 <emphasis role="bold">weight_b</emphasis>: |
3945 In typical cases, there is not much gain with this option. | |
3946 However, in crossfades or fade-to-black scenes, weighted | |
3947 prediction gives rather large bitrate savings. | |
3948 In MPEG-4 ASP, a fade-to-black is usually best coded as a series | |
3949 of expensive I-frames; using weighted prediction in B-frames | |
3950 makes it possible to turn at least some of these into much smaller | |
3951 B-frames. | |
3952 Encoding time cost is minimal, as no extra decisions need to be made. | |
3953 Also, contrary to what some people seem to guess, the decoder | |
3954 CPU requirements are not much affected by weighted prediction, | |
3955 all else being equal. | |
21525 | 3956 </para> |
3957 <para> | |
20725 | 3958 Unfortunately, the current adaptive B-frame decision algorithm |
3959 has a strong tendency to avoid B-frames during fades. | |
3960 Until this changes, it may be a good idea to add | |
3961 <option>nob_adapt</option> to your x264encopts, if you expect | |
3962 fades to have a large effect in your particular video | |
3963 clip. | |
21525 | 3964 </para> |
3965 </listitem> | |
20725 | 3966 </itemizedlist> |
3967 </sect3> | |
3968 | |
21525 | 3969 |
20725 | 3970 <sect3 id="menc-feat-x264-encoding-options-misc-preferences"> |
3971 <title>Options pertaining to miscellaneous preferences</title> | |
3972 <itemizedlist> | |
21525 | 3973 <listitem> |
3974 <para> | |
20725 | 3975 <emphasis role="bold">Two pass encoding</emphasis>: |
3976 Above, it was suggested to always use two pass encoding, but there | |
3977 are still reasons for not using it. For instance, if you are capturing | |
3978 live TV and encoding in realtime, you are forced to use single-pass. | |
3979 Also, one pass is obviously faster than two passes; if you use the | |
3980 exact same set of options on both passes, two pass encoding is almost | |
3981 twice as slow. | |
21525 | 3982 </para> |
3983 <para> | |
20725 | 3984 Still, there are very good reasons for using two pass encoding. For |
3985 one thing, single pass ratecontrol is not psychic, and it often makes | |
3986 unreasonable choices because it cannot see the big picture. For example, | |
3987 suppose you have a two minute long video consisting of two distinct | |
3988 halves. The first half is a very high-motion scene lasting 60 seconds | |
3989 which, in isolation, requires about 2500kbps in order to look decent. | |
3990 Immediately following it is a much less demanding 60-second scene | |
3991 that looks good at 300kbps. Suppose you ask for 1400kbps on the theory | |
3992 that this is enough to accomodate both scenes. Single pass ratecontrol | |
3993 will make a couple of "mistakes" in such a case. First of all, it | |
3994 will target 1400kbps in both segments. The first segment may end up | |
3995 heavily overquantized, causing it to look unacceptably and unreasonably | |
3996 blocky. The second segment will be heavily underquantized; it may look | |
3997 perfect, but the bitrate cost of that perfection will be completely | |
3998 unreasonable. What is even harder to avoid is the problem at the | |
3999 transition between the two scenes. The first seconds of the low motion | |
4000 half will be hugely over-quantized, because the ratecontrol is still | |
4001 expecting the kind of bitrate requirements it met in the first half | |
4002 of the video. This "error period" of heavily over-quantized low motion | |
4003 will look jarringly bad, and will actually use less than the 300kbps | |
4004 it would have taken to make it look decent. There are ways to | |
4005 mitigate the pitfalls of single-pass encoding, but they may tend to | |
4006 increase bitrate misprediction. | |
21525 | 4007 </para> |
4008 <para> | |
20725 | 4009 Multipass ratecontrol can offer huge advantages over a single pass. |
4010 Using the statistics gathered from the first pass encode, the encoder | |
4011 can estimate, with reasonable accuracy, the "cost" (in bits) of | |
4012 encoding any given frame, at any given quantizer. This allows for | |
4013 a much more rational, better planned allocation of bits between the | |
4014 expensive (high-motion) and cheap (low-motion) scenes. See | |
4015 <option>qcomp</option> below for some ideas on how to tweak this | |
4016 allocation to your liking. | |
21525 | 4017 </para> |
4018 <para> | |
20725 | 4019 Moreover, two passes need not take twice as long as one pass. You can |
4020 tweak the options in the first pass for higher speed and lower quality. | |
4021 If you choose your options well, you can get a very fast first pass. | |
4022 The resulting quality in the second pass will be slightly lower because size | |
4023 prediction is less accurate, but the quality difference is normally much | |
4024 too small to be visible. Try, for example, adding | |
4025 <option>subq=1:frameref=1</option> to the first pass | |
4026 <option>x264encopts</option>. Then, on the second pass, use slower, | |
4027 higher-quality options: | |
4028 <option>subq=6:frameref=15:partitions=all:me=umh</option> | |
21525 | 4029 </para> |
4030 </listitem> | |
20725 | 4031 <listitem><para> |
4032 <emphasis role="bold">Three pass encoding</emphasis>? | |
4033 x264 offers the ability to make an arbitrary number of consecutive | |
4034 passes. If you specify <option>pass=1</option> on the first pass, | |
4035 then use <option>pass=3</option> on a subsequent pass, the subsequent | |
4036 pass will both read the statistics from the previous pass, and write | |
4037 its own statistics. An additional pass following this one will have | |
4038 a very good base from which to make highly accurate predictions of | |
4039 framesizes at a chosen quantizer. In practice, the overall quality | |
4040 gain from this is usually close to zero, and quite possibly a third | |
4041 pass will result in slightly worse global PSNR than the pass before | |
4042 it. In typical usage, three passes help if you get either bad bitrate | |
4043 prediction or bad looking scene transitions when using only two passes. | |
4044 This is somewhat likely to happen on extremely short clips. There are | |
4045 also a few special cases in which three (or more) passes are handy | |
4046 for advanced users, but for brevity, this guide omits discussing those | |
4047 special cases. | |
4048 </para></listitem> | |
4049 <listitem><para> | |
4050 <emphasis role="bold">qcomp</emphasis>: | |
4051 <option>qcomp</option> trades off the number of bits allocated | |
4052 to "expensive" high-motion versus "cheap" low-motion frames. At | |
4053 one extreme, <option>qcomp=0</option> aims for true constant | |
4054 bitrate. Typically this would make high-motion scenes look completely | |
4055 awful, while low-motion scenes would probably look absolutely | |
4056 perfect, but would also use many times more bitrate than they | |
4057 would need in order to look merely excellent. At the other extreme, | |
4058 <option>qcomp=1</option> achieves nearly constant quantization parameter | |
4059 (QP). Constant QP does not look bad, but most people think it is more | |
4060 reasonable to shave some bitrate off of the extremely expensive scenes | |
4061 (where the loss of quality is not as noticeable) and reallocate it to | |
4062 the scenes that are easier to encode at excellent quality. | |
4063 <option>qcomp</option> is set to 0.6 by default, which may be slightly | |
4064 low for many peoples' taste (0.7-0.8 are also commonly used). | |
4065 </para></listitem> | |
4066 <listitem><para> | |
4067 <emphasis role="bold">keyint</emphasis>: | |
4068 <option>keyint</option> is solely for trading off file seekability against | |
4069 coding efficiency. By default, <option>keyint</option> is set to 250. In | |
4070 25fps material, this guarantees the ability to seek to within 10 seconds | |
4071 precision. If you think it would be important and useful to be able to | |
4072 seek within 5 seconds of precision, set <option>keyint=125</option>; | |
4073 this will hurt quality/bitrate slightly. If you care only about quality | |
4074 and not about seekability, you can set it to much higher values | |
4075 (understanding that there are diminishing returns which may become | |
4076 vanishingly low, or even zero). The video stream will still have seekable | |
4077 points as long as there are some scene changes. | |
4078 </para></listitem> | |
21525 | 4079 <listitem> |
4080 <para> | |
20725 | 4081 <emphasis role="bold">deblock</emphasis>: |
4082 This topic is going to be a bit controversial. | |
21525 | 4083 </para> |
4084 <para> | |
20725 | 4085 H.264 defines a simple deblocking procedure on I-blocks that uses |
4086 pre-set strengths and thresholds depending on the QP of the block | |
4087 in question. | |
4088 By default, high QP blocks are filtered heavily, and low QP blocks | |
4089 are not deblocked at all. | |
4090 The pre-set strengths defined by the standard are well-chosen and | |
4091 the odds are very good that they are PSNR-optimal for whatever | |
4092 video you are trying to encode. | |
4093 The <option>deblock</option> allow you to specify offsets to the preset deblocking | |
4094 thresholds. | |
21525 | 4095 </para> |
4096 <para> | |
20725 | 4097 Many people seem to think it is a good idea to lower the deblocking |
4098 filter strength by large amounts (say, -3). | |
4099 This is however almost never a good idea, and in most cases, | |
4100 people who are doing this do not understand very well how | |
4101 deblocking works by default. | |
21525 | 4102 </para> |
4103 <para> | |
20725 | 4104 The first and most important thing to know about the in-loop |
4105 deblocking filter is that the default thresholds are almost always | |
4106 PSNR-optimal. | |
4107 In the rare cases that they are not optimal, the ideal offset is | |
4108 plus or minus 1. | |
4109 Adjusting deblocking parameters by a larger amount is almost | |
4110 guaranteed to hurt PSNR. | |
4111 Strengthening the filter will smear more details; weakening the | |
4112 filter will increase the appearance of blockiness. | |
21525 | 4113 </para> |
4114 <para> | |
20725 | 4115 It is definitely a bad idea to lower the deblocking thresholds if |
4116 your source is mainly low in spacial complexity (i.e., not a lot | |
4117 of detail or noise). | |
4118 The in-loop filter does a rather excellent job of concealing | |
4119 the artifacts that occur. | |
4120 If the source is high in spacial complexity, however, artifacts | |
4121 are less noticeable. | |
4122 This is because the ringing tends to look like detail or noise. | |
4123 Human visual perception easily notices when detail is removed, | |
4124 but it does not so easily notice when the noise is wrongly | |
4125 represented. | |
4126 When it comes to subjective quality, noise and detail are somewhat | |
4127 interchangeable. | |
4128 By lowering the deblocking filter strength, you are most likely | |
4129 increasing error by adding ringing artifacts, but the eye does | |
4130 not notice because it confuses the artifacts with detail. | |
21525 | 4131 </para> |
4132 <para> | |
20725 | 4133 This <emphasis role="bold">still</emphasis> does not justify |
4134 lowering the deblocking filter strength, however. | |
4135 You can generally get better quality noise from postprocessing. | |
4136 If your H.264 encodes look too blurry or smeared, try playing with | |
4137 <option>-vf noise</option> when you play your encoded movie. | |
4138 <option>-vf noise=8a:4a</option> should conceal most mild | |
4139 artifacting. | |
4140 It will almost certainly look better than the results you | |
4141 would have gotten just by fiddling with the deblocking filter. | |
21525 | 4142 </para> |
4143 </listitem> | |
20725 | 4144 </itemizedlist> |
4145 </sect3> | |
4146 </sect2> | |
4147 | |
21525 | 4148 <!-- ********** --> |
4149 | |
20725 | 4150 <sect2 id="menc-feat-x264-example-settings"> |
4151 <title>Encoding setting examples</title> | |
4152 | |
4153 <para> | |
21525 | 4154 The following settings are examples of different encoding |
4155 option combinations that affect the speed vs quality tradeoff | |
4156 at the same target bitrate. | |
4157 </para> | |
4158 | |
4159 <para> | |
4160 All the encoding settings were tested on a 720x448 @30000/1001 fps | |
4161 video sample, the target bitrate was 900kbps, and the machine was an | |
4162 AMD-64 3400+ at 2400 MHz in 64 bits mode. | |
4163 Each encoding setting features the measured encoding speed (in | |
4164 frames per second) and the PSNR loss (in dB) compared to the "very | |
4165 high quality" setting. | |
4166 Please understand that depending on your source, your machine type | |
4167 and development advancements, you may get very different results. | |
4168 </para> | |
4169 | |
20725 | 4170 <informaltable frame="all"> |
4171 <tgroup cols="4"> | |
4172 <thead> | |
21525 | 4173 <row> |
4174 <entry>Description</entry> | |
4175 <entry>Encoding options</entry> | |
4176 <entry>speed (in fps)</entry> | |
4177 <entry>Relative PSNR loss (in dB)</entry> | |
4178 </row> | |
20725 | 4179 </thead> |
4180 <tbody> | |
4181 <row> | |
4182 <entry>Very high quality</entry> | |
4183 <entry><option>subq=6:partitions=all:8x8dct:me=umh:frameref=5:bframes=3:b_pyramid:weight_b</option></entry> | |
4184 <entry>6fps</entry> | |
4185 <entry>0dB</entry> | |
4186 </row> | |
4187 <row> | |
4188 <entry>High quality</entry> | |
4189 <entry><option>subq=5:8x8dct:frameref=2:bframes=3:b_pyramid:weight_b</option></entry> | |
4190 <entry>13fps</entry> | |
4191 <entry>-0.89dB</entry> | |
4192 </row> | |
4193 <row> | |
4194 <entry>Fast</entry> | |
4195 <entry><option>subq=4:bframes=2:b_pyramid:weight_b</option></entry> | |
4196 <entry>17fps</entry> | |
4197 <entry>-1.48dB</entry> | |
4198 </row> | |
4199 </tbody> | |
4200 </tgroup> | |
4201 </informaltable> | |
4202 </sect2> | |
4203 </sect1> | |
4204 | |
21525 | 4205 |
4206 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> | |
4207 | |
4208 | |
20725 | 4209 <sect1 id="menc-feat-video-for-windows"> |
21525 | 4210 <title> |
4211 Encoding with the <systemitem class="library">Video For Windows</systemitem> | |
4212 codec family | |
4213 </title> | |
20725 | 4214 |
4215 <para> | |
4216 Video for Windows provides simple encoding by means of binary video codecs. | |
4217 You can encode with the following codecs (if you have more, please tell us!) | |
4218 </para> | |
21525 | 4219 |
20725 | 4220 <para> |
4221 Note that support for this is very experimental and some codecs may not work | |
4222 correctly. Some codecs will only work in certain colorspaces, try | |
4223 <option>-vf format=bgr24</option> and <option>-vf format=yuy2</option> | |
4224 if a codec fails or gives wrong output. | |
4225 </para> | |
4226 | |
21525 | 4227 <!-- ********** --> |
4228 | |
20725 | 4229 <sect2 id="menc-feat-enc-vfw-video-codecs"> |
4230 <title>Video for Windows supported codecs</title> | |
4231 | |
4232 <para> | |
4233 <informaltable frame="all"> | |
4234 <tgroup cols="4"> | |
4235 <thead> | |
4236 <row> | |
21525 | 4237 <entry>Video codec file name</entry> |
4238 <entry>Description (FourCC)</entry> | |
4239 <entry>md5sum</entry> | |
4240 <entry>Comment</entry> | |
20725 | 4241 </row> |
4242 </thead> | |
4243 <tbody> | |
4244 <row> | |
4245 <entry>aslcodec_vfw.dll</entry> | |
4246 <entry>Alparysoft lossless codec vfw (ASLC)</entry> | |
4247 <entry>608af234a6ea4d90cdc7246af5f3f29a</entry> | |
4248 <entry></entry> | |
4249 </row> | |
4250 <row> | |
4251 <entry>avimszh.dll</entry> | |
4252 <entry>AVImszh (MSZH)</entry> | |
4253 <entry>253118fe1eedea04a95ed6e5f4c28878</entry> | |
4254 <entry>needs <option>-vf format</option></entry> | |
4255 </row> | |
4256 <row> | |
4257 <entry>avizlib.dll</entry> | |
4258 <entry>AVIzlib (ZLIB)</entry> | |
4259 <entry>2f1cc76bbcf6d77d40d0e23392fa8eda</entry> | |
4260 <entry></entry> | |
4261 </row> | |
4262 <row> | |
4263 <entry>divx.dll</entry> | |
4264 <entry>DivX4Windows-VFW</entry> | |
4265 <entry>acf35b2fc004a89c829531555d73f1e6</entry> | |
4266 <entry></entry> | |
4267 </row> | |
4268 <row> | |
4269 <entry>huffyuv.dll</entry> | |
4270 <entry>HuffYUV (lossless) (HFYU)</entry> | |
4271 <entry>b74695b50230be4a6ef2c4293a58ac3b</entry> | |
4272 <entry></entry> | |
4273 </row> | |
4274 <row> | |
4275 <entry>iccvid.dll</entry> | |
4276 <entry>Cinepak Video (cvid)</entry> | |
4277 <entry>cb3b7ee47ba7dbb3d23d34e274895133</entry> | |
4278 <entry></entry> | |
4279 </row> | |
4280 <row> | |
4281 <entry>icmw_32.dll</entry> | |
4282 <entry>Motion Wavelets (MWV1)</entry> | |
4283 <entry>c9618a8fc73ce219ba918e3e09e227f2</entry> | |
4284 <entry></entry> | |
4285 </row> | |
4286 <row> | |
4287 <entry>jp2avi.dll</entry> | |
4288 <entry>ImagePower MJPEG2000 (IPJ2)</entry> | |
4289 <entry>d860a11766da0d0ea064672c6833768b</entry> | |
4290 <entry><option>-vf flip</option></entry> | |
4291 </row> | |
4292 <row> | |
4293 <entry>m3jp2k32.dll</entry> | |
4294 <entry>Morgan MJPEG2000 (MJ2C)</entry> | |
4295 <entry>f3c174edcbaef7cb947d6357cdfde7ff</entry> | |
4296 <entry></entry> | |
4297 </row> | |
4298 <row> | |
4299 <entry>m3jpeg32.dll</entry> | |
4300 <entry>Morgan Motion JPEG Codec (MJPG)</entry> | |
4301 <entry>1cd13fff5960aa2aae43790242c323b1</entry> | |
4302 <entry></entry> | |
4303 </row> | |
4304 <row> | |
4305 <entry>mpg4c32.dll</entry> | |
4306 <entry>Microsoft MPEG-4 v1/v2</entry> | |
4307 <entry>b5791ea23f33010d37ab8314681f1256</entry> | |
4308 <entry></entry> | |
4309 </row> | |
4310 <row> | |
4311 <entry>tsccvid.dll</entry> | |
4312 <entry>TechSmith Camtasia Screen Codec (TSCC)</entry> | |
4313 <entry>8230d8560c41d444f249802a2700d1d5</entry> | |
4314 <entry>shareware error on windows</entry> | |
4315 </row> | |
4316 <row> | |
4317 <entry>vp31vfw.dll</entry> | |
4318 <entry>On2 Open Source VP3 Codec (VP31)</entry> | |
4319 <entry>845f3590ea489e2e45e876ab107ee7d2</entry> | |
4320 <entry></entry> | |
4321 </row> | |
4322 <row> | |
4323 <entry>vp4vfw.dll</entry> | |
4324 <entry>On2 VP4 Personal Codec (VP40)</entry> | |
4325 <entry>fc5480a482ccc594c2898dcc4188b58f</entry> | |
4326 <entry></entry> | |
4327 </row> | |
4328 <row> | |
4329 <entry>vp6vfw.dll</entry> | |
4330 <entry>On2 VP6 Personal Codec (VP60)</entry> | |
4331 <entry>04d635a364243013898fd09484f913fb</entry> | |
4332 <entry>crashing on Linux</entry> | |
4333 </row> | |
4334 <row> | |
4335 <entry>vp7vfw.dll</entry> | |
4336 <entry>On2 VP7 Personal Codec (VP70)</entry> | |
4337 <entry>cb4cc3d4ea7c94a35f1d81c3d750bc8d</entry> | |
4338 <entry>wrong FourCC?</entry> | |
4339 </row> | |
4340 <row> | |
4341 <entry>ViVD2.dll</entry> | |
4342 <entry>SoftMedia ViVD V2 codec VfW (GXVE)</entry> | |
4343 <entry>a7b4bf5cac630bb9262c3f80d8a773a1</entry> | |
4344 <entry></entry> | |
4345 </row> | |
4346 <row> | |
4347 <entry>msulvc06.DLL</entry> | |
4348 <entry>MSU Lossless codec (MSUD)</entry> | |
4349 <entry>294bf9288f2f127bb86f00bfcc9ccdda</entry> | |
4350 <entry> | |
21525 | 4351 Decodable by <application>Window Media Player</application>, |
4352 not <application>MPlayer</application> (yet). | |
20725 | 4353 </entry> |
4354 </row> | |
4355 <row> | |
4356 <entry>camcodec.dll</entry> | |
4357 <entry>CamStudio lossless video codec (CSCD)</entry> | |
4358 <entry>0efe97ce08bb0e40162ab15ef3b45615</entry> | |
4359 <entry>sf.net/projects/camstudio</entry> | |
4360 </row> | |
4361 </tbody> | |
4362 </tgroup> | |
4363 </informaltable> | |
4364 | |
4365 The first column contains the codec names that should be passed after the | |
21525 | 4366 <literal>codec</literal> parameter, |
4367 like: <option>-xvfwopts codec=divx.dll</option> | |
20725 | 4368 The FourCC code used by each codec is given in the parentheses. |
4369 </para> | |
4370 <informalexample> | |
4371 <para> | |
4372 An example with VP3 compression: | |
21525 | 4373 <screen> |
4374 mencoder dvd://2 -o <replaceable>title2.avi</replaceable> -ovc vfw -xvfwopts codec=vp31vfw.dll -oac copy | |
4375 </screen> | |
20725 | 4376 </para> |
4377 </informalexample> | |
4378 </sect2> | |
4379 </sect1> | |
4380 | |
4381 | |
21525 | 4382 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> |
4383 | |
4384 | |
20725 | 4385 <sect1 id="menc-feat-vcd-dvd"> |
21525 | 4386 <title>Using <application>MEncoder</application> |
4387 to create VCD/SVCD/DVD-compliant files.</title> | |
20725 | 4388 |
4389 <sect2 id="menc-feat-vcd-dvd-constraints"> | |
4390 <title>Format Constraints</title> | |
21525 | 4391 |
4392 <para> | |
4393 <application>MEncoder</application> is capable of creating VCD, SCVD | |
4394 and DVD format MPEG files using the | |
4395 <systemitem class="library">libavcodec</systemitem> library. | |
4396 These files can then be used in conjunction with | |
4397 <ulink url="http://www.gnu.org/software/vcdimager/vcdimager.html">vcdimager</ulink> | |
4398 or | |
4399 <ulink url="http://dvdauthor.sourceforge.net/">dvdauthor</ulink> | |
4400 to create discs that will play on a standard set-top player. | |
4401 </para> | |
4402 | |
4403 <para> | |
4404 The DVD, SVCD, and VCD formats are subject to heavy constraints. | |
4405 Only a small selection of encoded picture sizes and aspect ratios are | |
4406 available. | |
4407 If your movie does not already meet these requirements, you may have | |
4408 to scale,crop or add black borders to the picture to make it | |
4409 compliant. | |
4410 </para> | |
4411 | |
20725 | 4412 |
4413 <sect3 id="menc-feat-vcd-dvd-constraints-resolution"> | |
4414 <title>Format Constraints</title> | |
4415 | |
4416 <informaltable frame="all"> | |
4417 <tgroup cols="9"> | |
4418 <thead> | |
21525 | 4419 <row> |
4420 <entry>Format</entry> | |
4421 <entry>Resolution</entry> | |
4422 <entry>V. Codec</entry> | |
4423 <entry>V. Bitrate</entry> | |
4424 <entry>Sample Rate</entry> | |
4425 <entry>A. Codec</entry> | |
4426 <entry>A. Bitrate</entry> | |
4427 <entry>FPS</entry> | |
4428 <entry>Aspect</entry> | |
4429 </row> | |
20725 | 4430 </thead> |
4431 <tbody> | |
21525 | 4432 <row> |
4433 <entry>NTSC DVD</entry> | |
4434 <entry>720x480, 704x480, 352x480, 352x240</entry> | |
4435 <entry>MPEG-2</entry> | |
4436 <entry>9800 kbps</entry> | |
4437 <entry>48000 Hz</entry> | |
4438 <entry>AC3,PCM</entry> | |
4439 <entry>1536 kbps (max)</entry> | |
4440 <entry>30000/1001, 24000/1001</entry> | |
4441 <entry>4:3, 16:9 (only for 720x480)</entry> | |
4442 </row> | |
4443 <row> | |
4444 <entry>NTSC DVD</entry> | |
4445 <entry>352x240<footnote id='fn-rare-resolutions'><para> | |
4446 These resolutions are rarely used for DVDs because | |
4447 they are fairly low quality.</para></footnote></entry> | |
4448 <entry>MPEG-1</entry> | |
4449 <entry>1856 kbps</entry> | |
4450 <entry>48000 Hz</entry> | |
4451 <entry>AC3,PCM</entry> | |
4452 <entry>1536 kbps (max)</entry> | |
4453 <entry>30000/1001, 24000/1001</entry> | |
4454 <entry>4:3, 16:9</entry> | |
4455 </row> | |
4456 <row> | |
4457 <entry>NTSC SVCD</entry> | |
4458 <entry>480x480</entry> | |
4459 <entry>MPEG-2</entry> | |
4460 <entry>2600 kbps</entry> | |
4461 <entry>44100 Hz</entry> | |
4462 <entry>MP2</entry> | |
4463 <entry>384 kbps (max)</entry> | |
4464 <entry>30000/1001</entry> | |
4465 <entry>4:3</entry> | |
4466 </row> | |
4467 <row> | |
4468 <entry>NTSC VCD</entry> | |
4469 <entry>352x240</entry> | |
4470 <entry>MPEG-1</entry> | |
4471 <entry>1150 kbps</entry> | |
4472 <entry>44100 Hz</entry> | |
4473 <entry>MP2</entry> | |
4474 <entry>224 kbps</entry> | |
4475 <entry>24000/1001, 30000/1001</entry> | |
4476 <entry>4:3</entry> | |
4477 </row> | |
4478 <row> | |
4479 <entry>PAL DVD</entry> | |
4480 <entry>720x576, 704x576, 352x576, 352x288</entry> | |
4481 <entry>MPEG-2</entry> | |
4482 <entry>9800 kbps</entry> | |
4483 <entry>48000 Hz</entry> | |
4484 <entry>MP2,AC3,PCM</entry> | |
4485 <entry>1536 kbps (max)</entry> | |
4486 <entry>25</entry> | |
4487 <entry>4:3, 16:9 (only for 720x576)</entry> | |
4488 </row> | |
4489 <row> | |
4490 <entry>PAL DVD</entry> | |
4491 <entry>352x288<footnoteref linkend='fn-rare-resolutions'/></entry> | |
4492 <entry>MPEG-1</entry> | |
4493 <entry>1856 kbps</entry> | |
4494 <entry>48000 Hz</entry> | |
4495 <entry>MP2,AC3,PCM</entry> | |
4496 <entry>1536 kbps (max)</entry> | |
4497 <entry>25</entry> | |
4498 <entry>4:3, 16:9</entry> | |
4499 </row> | |
4500 <row> | |
4501 <entry>PAL SVCD</entry> | |
4502 <entry>480x576</entry> | |
4503 <entry>MPEG-2</entry> | |
4504 <entry>2600 kbps</entry> | |
4505 <entry>44100 Hz</entry> | |
4506 <entry>MP2</entry> | |
4507 <entry>384 kbps (max)</entry> | |
4508 <entry>25</entry> | |
4509 <entry>4:3</entry> | |
4510 </row> | |
4511 <row> | |
4512 <entry>PAL VCD</entry> | |
4513 <entry>352x288</entry> | |
4514 <entry>MPEG-1</entry> | |
4515 <entry>1152 kbps</entry> | |
4516 <entry>44100 Hz</entry> | |
4517 <entry>MP2</entry> | |
4518 <entry>224 kbps</entry> | |
4519 <entry>25</entry> | |
4520 <entry>4:3</entry> | |
4521 </row> | |
20725 | 4522 </tbody> |
4523 </tgroup> | |
4524 </informaltable> | |
4525 | |
4526 <para> | |
21525 | 4527 If your movie has 2.35:1 aspect (most recent action movies), you will |
4528 have to add black borders or crop the movie down to 16:9 to make a DVD | |
4529 or VCD. | |
4530 If you add black borders, try to align them at 16-pixel boundaries in | |
4531 order to minimize the impact on encoding performance. | |
4532 Thankfully DVD has sufficiently excessive bitrate that you do not have | |
4533 to worry too much about encoding efficiency, but SVCD and VCD are | |
4534 highly bitrate-starved and require effort to obtain acceptable quality. | |
20725 | 4535 </para> |
4536 </sect3> | |
4537 | |
21525 | 4538 |
20725 | 4539 <sect3 id="menc-feat-vcd-dvd-constraints-gop"> |
4540 <title>GOP Size Constraints</title> | |
21525 | 4541 |
4542 <para> | |
4543 DVD, VCD, and SVCD also constrain you to relatively low | |
4544 GOP (Group of Pictures) sizes. | |
4545 For 30 fps material the largest allowed GOP size is 18. | |
4546 For 25 or 24 fps, the maximum is 15. | |
4547 The GOP size is set using the <option>keyint</option> option. | |
20725 | 4548 </para> |
4549 </sect3> | |
4550 | |
21525 | 4551 |
20725 | 4552 <sect3 id="menc-feat-vcd-dvd-constraints-bitrate"> |
4553 <title>Bitrate Constraints</title> | |
21525 | 4554 |
4555 <para> | |
4556 VCD video is required to be CBR at 1152 kbps. | |
4557 This highly limiting constraint also comes along with an extremly low vbv | |
4558 buffer size of 327 kilobits. | |
4559 SVCD allows varying video bitrates up to 2500 kbps, and a somewhat less | |
4560 restrictive vbv buffer size of 917 kilobits is allowed. | |
4561 DVD video bitrates may range anywhere up to 9800 kbps (though typical | |
4562 bitrates are about half that), and the vbv buffer size is 1835 kilobits. | |
20725 | 4563 </para> |
4564 </sect3> | |
4565 </sect2> | |
4566 | |
21525 | 4567 <!-- ********** --> |
4568 | |
20725 | 4569 <sect2 id="menc-feat-vcd-dvd-output"> |
4570 <title>Output Options</title> | |
21525 | 4571 |
4572 <para> | |
4573 <application>MEncoder</application> has options to control the output | |
4574 format. | |
4575 Using these options we can instruct it to create the correct type of | |
4576 file. | |
4577 </para> | |
4578 | |
4579 <para> | |
4580 The options for VCD and SVCD are called xvcd and xsvcd, because they | |
4581 are extended formats. | |
4582 They are not strictly compliant, mainly because the output does not | |
4583 contain scan offsets. | |
4584 If you need to generate an SVCD image, you should pass the output file | |
4585 to | |
4586 <ulink url="http://www.gnu.org/software/vcdimager/vcdimager.html">vcdimager</ulink>. | |
4587 </para> | |
4588 | |
4589 <para> | |
4590 VCD: | |
4591 <screen>-of mpeg -mpegopts format=xvcd</screen> | |
4592 </para> | |
4593 | |
4594 <para> | |
4595 SVCD: | |
4596 <screen>-of mpeg -mpegopts format=xsvcd</screen> | |
4597 </para> | |
4598 | |
4599 <para> | |
4600 DVD (with timestamps on every frame, if possible): | |
4601 <screen>-of mpeg -mpegopts format=dvd:tsaf</screen> | |
4602 </para> | |
4603 | |
4604 <para> | |
4605 DVD with NTSC Pullup: | |
4606 <screen>-of mpeg -mpegopts format=dvd:tsaf:telecine -ofps 24000/1001</screen> | |
4607 This allows 24000/1001 fps progressive content to be encoded at 30000/1001 | |
4608 fps whilst maintaing DVD-compliance. | |
4609 </para> | |
4610 | |
20725 | 4611 |
4612 <sect3 id="menc-feat-vcd-dvd-output-aspect"> | |
4613 <title>Aspect Ratio</title> | |
4614 <para> | |
21525 | 4615 The aspect argument of <option>-lavcopts</option> is used to encode |
4616 the aspect ratio of the file. | |
4617 During playback the aspect ratio is used to restore the video to the | |
4618 correct size. | |
4619 </para> | |
4620 | |
4621 <para> | |
4622 16:9 or "Widescreen" | |
4623 <screen>-lavcopts aspect=16/9</screen> | |
4624 </para> | |
4625 | |
4626 <para> | |
4627 4:3 or "Fullscreen" | |
4628 <screen>-lavcopts aspect=4/3</screen> | |
4629 </para> | |
4630 | |
4631 <para> | |
4632 2.35:1 or "Cinemascope" NTSC | |
4633 <screen>-vf scale=720:368,expand=720:480 -lavcopts aspect=16/9</screen> | |
4634 To calculate the correct scaling size, use the expanded NTSC width of | |
4635 854/2.35 = 368 | |
4636 </para> | |
4637 | |
4638 <para> | |
4639 2.35:1 or "Cinemascope" PAL | |
4640 <screen>-vf scale="720:432,expand=720:576 -lavcopts aspect=16/9</screen> | |
4641 To calculate the correct scaling size, use the expanded PAL width of | |
4642 1024/2.35 = 432 | |
4643 </para> | |
20725 | 4644 </sect3> |
4645 | |
21525 | 4646 |
20725 | 4647 <sect3 id="menc-feat-vcd-dvd-a-v-sync"> |
4648 <title>Maintaining A/V sync</title> | |
21525 | 4649 |
4650 <para> | |
4651 In order to maintain audio/video synchronization throughout the encode, | |
4652 <application>MEncoder</application> has to drop or duplicate frames. | |
4653 This works rather well when muxing into an AVI file, but is almost | |
4654 guaranteed to fail to maintain A/V sync with other muxers such as MPEG. | |
4655 This is why it is necessary to append the | |
4656 <option>harddup</option> video filter at the end of the filter chain | |
4657 to avoid this kind of problem. | |
4658 You can find more technical information about <option>harddup</option> | |
4659 in the section | |
4660 <link linkend="menc-feat-dvd-mpeg4-muxing-filter-issues">Improving muxing and A/V sync reliability</link> | |
4661 or in the manual page. | |
20725 | 4662 </para> |
4663 </sect3> | |
4664 | |
21525 | 4665 |
20725 | 4666 <sect3 id="menc-feat-vcd-dvd-output-srate"> |
4667 <title>Sample Rate Conversion</title> | |
21525 | 4668 |
4669 <para> | |
4670 If the audio sample rate in the original file is not the same as | |
4671 required by the target format, sample rate conversion is required. | |
4672 This is achieved using the <option>-srate</option> option and | |
4673 the <option>-af lavcresample</option> audio filter together. | |
4674 </para> | |
4675 | |
4676 <para> | |
4677 DVD: | |
4678 <screen>-srate 48000 -af lavcresample=48000</screen> | |
4679 </para> | |
4680 | |
4681 <para> | |
4682 VCD and SVCD: | |
4683 <screen>-srate 44100 -af lavcresample=44100</screen> | |
4684 </para> | |
20725 | 4685 </sect3> |
4686 </sect2> | |
4687 | |
21525 | 4688 <!-- ********** --> |
4689 | |
20725 | 4690 <sect2 id="menc-feat-vcd-dvd-lavc"> |
4691 <title>Using libavcodec for VCD/SVCD/DVD Encoding</title> | |
4692 | |
4693 <sect3 id="menc-feat-vcd-dvd-lavc-intro"> | |
4694 <title>Introduction</title> | |
21525 | 4695 |
20725 | 4696 <para> |
4697 <systemitem class="library">libavcodec</systemitem> can be used to | |
4698 create VCD/SVCD/DVD compliant video by using the appropriate options. | |
4699 </para> | |
4700 </sect3> | |
4701 | |
21525 | 4702 |
20725 | 4703 <sect3 id="menc-feat-vcd-dvd-lavc-options"> |
4704 <title>lavcopts</title> | |
21525 | 4705 |
4706 <para> | |
4707 This is a list of fields in <option>-lavcopts</option> that you may | |
4708 be required to change in order to make a complaint movie for VCD, SVCD, | |
4709 or DVD: | |
20725 | 4710 </para> |
4711 | |
4712 <itemizedlist> | |
4713 <listitem><para> | |
4714 <emphasis role="bold">acodec</emphasis>: | |
4715 <option>mp2</option> for VCD, SVCD, or PAL DVD; | |
4716 <option>ac3</option> is most commonly used for DVD. | |
4717 PCM audio may also be used for DVD, but this is mostly a big waste of | |
4718 space. | |
4719 Note that MP3 audio is not compliant for any of these formats, but | |
4720 players often have no problem playing it anyway. | |
4721 </para></listitem> | |
4722 <listitem><para> | |
4723 <emphasis role="bold">abitrate</emphasis>: | |
4724 224 for VCD; up to 384 for SVCD; up to 1536 for DVD, but commonly | |
4725 used values range from 192 kbps for stereo to 384 kbps for 5.1 channel | |
4726 sound. | |
4727 </para></listitem> | |
4728 <listitem><para> | |
4729 <emphasis role="bold">vcodec</emphasis>: | |
4730 <option>mpeg1video</option> for VCD; | |
4731 <option>mpeg2video</option> for SVCD; | |
4732 <option>mpeg2video</option> is usually used for DVD but you may also use | |
4733 <option>mpeg1video</option> for CIF resolutions. | |
4734 </para></listitem> | |
4735 <listitem><para> | |
4736 <emphasis role="bold">keyint</emphasis>: | |
4737 Used to set the GOP size. | |
4738 18 for 30fps material, or 15 for 25/24 fps material. | |
4739 Commercial producers seem to prefer keyframe intervals of 12. | |
4740 It is possible to make this much larger and still retain compatibility | |
4741 with most players. | |
4742 A <option>keyint</option> of 25 should never cause any problems. | |
4743 </para></listitem> | |
4744 <listitem><para> | |
4745 <emphasis role="bold">vrc_buf_size</emphasis>: | |
4746 327 for VCD, 917 for SVCD, and 1835 for DVD. | |
4747 </para></listitem> | |
4748 <listitem><para> | |
4749 <emphasis role="bold">vrc_minrate</emphasis>: | |
4750 1152, for VCD. May be left alone for SVCD and DVD. | |
4751 </para></listitem> | |
4752 <listitem><para> | |
4753 <emphasis role="bold">vrc_maxrate</emphasis>: | |
4754 1152 for VCD; 2500 for SVCD; 9800 for DVD. | |
4755 For SVCD and DVD, you might wish to use lower values depending on your | |
4756 own personal preferences and requirements. | |
4757 </para></listitem> | |
4758 <listitem><para> | |
4759 <emphasis role="bold">vbitrate</emphasis>: | |
4760 1152 for VCD; | |
4761 up to 2500 for SVCD; | |
4762 up to 9800 for DVD. | |
4763 For the latter two formats, vbitrate should be set based on personal | |
4764 preference. | |
4765 For instance, if you insist on fitting 20 or so hours on a DVD, you | |
4766 could use vbitrate=400. | |
4767 The resulting video quality would probably be quite bad. | |
4768 If you are trying to squeeze out the maximum possible quality on a DVD, | |
4769 use vbitrate=9800, but be warned that this could constrain you to less | |
4770 than an hour of video on a single-layer DVD. | |
4771 </para></listitem> | |
21594
0b1c322c5409
r21599: vstrict=0 is required to create DVDs decodable by standalone dvd players
voroshil
parents:
21525
diff
changeset
|
4772 <listitem><para> |
0b1c322c5409
r21599: vstrict=0 is required to create DVDs decodable by standalone dvd players
voroshil
parents:
21525
diff
changeset
|
4773 <emphasis role="bold">vtrict</emphasis>: |
0b1c322c5409
r21599: vstrict=0 is required to create DVDs decodable by standalone dvd players
voroshil
parents:
21525
diff
changeset
|
4774 <option>vstrict</option>=0 should be used to create DVDs. |
0b1c322c5409
r21599: vstrict=0 is required to create DVDs decodable by standalone dvd players
voroshil
parents:
21525
diff
changeset
|
4775 Without this option, <application>MEncoder</application> creates a |
0b1c322c5409
r21599: vstrict=0 is required to create DVDs decodable by standalone dvd players
voroshil
parents:
21525
diff
changeset
|
4776 stream that cannot be correctly decoded by some standalone DVD |
0b1c322c5409
r21599: vstrict=0 is required to create DVDs decodable by standalone dvd players
voroshil
parents:
21525
diff
changeset
|
4777 players. |
0b1c322c5409
r21599: vstrict=0 is required to create DVDs decodable by standalone dvd players
voroshil
parents:
21525
diff
changeset
|
4778 </para></listitem> |
20725 | 4779 </itemizedlist> |
4780 </sect3> | |
4781 | |
21525 | 4782 |
20725 | 4783 <sect3 id="menc-feat-vcd-dvd-lavc-examples"> |
4784 <title>Examples</title> | |
21525 | 4785 |
20725 | 4786 <para> |
4787 This is a typical minimum set of <option>-lavcopts</option> for | |
4788 encoding video: | |
4789 </para> | |
4790 <para> | |
21525 | 4791 VCD: |
4792 <screen> | |
4793 -lavcopts vcodec=mpeg1video:vrc_buf_size=327:vrc_minrate=1152:\ | |
4794 vrc_maxrate=1152:vbitrate=1152:keyint=15:acodec=mp2 | |
4795 </screen> | |
4796 </para> | |
4797 | |
4798 <para> | |
4799 SVCD: | |
4800 <screen> | |
4801 -lavcopts vcodec=mpeg2video:vrc_buf_size=917:vrc_maxrate=2500:vbitrate=1800:\ | |
4802 keyint=15:acodec=mp2 | |
4803 </screen> | |
4804 </para> | |
4805 | |
4806 <para> | |
4807 DVD: | |
4808 <screen> | |
4809 -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:\ | |
21594
0b1c322c5409
r21599: vstrict=0 is required to create DVDs decodable by standalone dvd players
voroshil
parents:
21525
diff
changeset
|
4810 keyint=15:vstrict=0:acodec=ac3 |
21525 | 4811 </screen> |
4812 </para> | |
20725 | 4813 </sect3> |
4814 | |
21525 | 4815 |
20725 | 4816 <sect3 id="menc-feat-vcd-dvd-lavc-advanced"> |
4817 <title>Advanced Options</title> | |
21525 | 4818 |
4819 <para> | |
4820 For higher quality encoding, you may also wish to add quality-enhancing | |
4821 options to lavcopts, such as <option>trell</option>, | |
4822 <option>mbd=2</option>, and others. | |
4823 Note that <option>qpel</option> and <option>v4mv</option>, while often | |
4824 useful with MPEG-4, are not usable with MPEG-1 or MPEG-2. | |
4825 Also, if you are trying to make a very high quality DVD encode, it may | |
4826 be useful to add <option>dc=10</option> to lavcopts. | |
4827 Doing so may help reduce the appearance of blocks in flat-colored areas. | |
4828 Putting it all together, this is an example of a set of lavcopts for a | |
4829 higher quality DVD: | |
4830 </para> | |
4831 | |
4832 <para> | |
4833 <screen> | |
4834 -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=8000:\ | |
4835 keyint=15:trell:mbd=2:precmp=2:subcmp=2:cmp=2:dia=-10:predia=-10:cbp:mv0:\ | |
21594
0b1c322c5409
r21599: vstrict=0 is required to create DVDs decodable by standalone dvd players
voroshil
parents:
21525
diff
changeset
|
4836 vqmin=1:lmin=1:dc=10:vstrict=0 |
21525 | 4837 </screen> |
4838 </para> | |
20725 | 4839 </sect3> |
4840 </sect2> | |
4841 | |
21525 | 4842 <!-- ********** --> |
4843 | |
20725 | 4844 <sect2 id="menc-feat-vcd-dvd-audio"> |
4845 <title>Encoding Audio</title> | |
21525 | 4846 |
4847 <para> | |
4848 VCD and SVCD support MPEG-1 layer II audio, using one of | |
4849 <systemitem class="library">toolame</systemitem>, | |
4850 <systemitem class="library">twolame</systemitem>, | |
4851 or <systemitem class="library">libavcodec</systemitem>'s MP2 encoder. | |
4852 The libavcodec MP2 is far from being as good as the other two libraries, | |
4853 however it should always be available to use. | |
4854 VCD only supports constant bitrate audio (CBR) whereas SVCD supports | |
4855 variable bitrate (VBR), too. | |
4856 Be careful when using VBR because some bad standalone players might not | |
4857 support it too well. | |
4858 </para> | |
4859 | |
4860 <para> | |
4861 For DVD audio, <systemitem class="library">libavcodec</systemitem>'s | |
4862 AC3 codec is used. | |
4863 </para> | |
4864 | |
20725 | 4865 |
4866 <sect3 id="menc-feat-vcd-dvd-audio-toolame"> | |
4867 <title>toolame</title> | |
21525 | 4868 |
4869 <para> | |
4870 For VCD and SVCD: | |
4871 <screen>-oac toolame -toolameopts br=224</screen> | |
20725 | 4872 </para> |
4873 </sect3> | |
4874 | |
21525 | 4875 |
20725 | 4876 <sect3 id="menc-feat-vcd-dvd-audio-twolame"> |
4877 <title>twolame</title> | |
21525 | 4878 |
4879 <para> | |
4880 For VCD and SVCD: | |
4881 <screen>-oac twolame -twolameopts br=224</screen> | |
20725 | 4882 </para> |
4883 </sect3> | |
4884 | |
21525 | 4885 |
20725 | 4886 <sect3 id="menc-feat-vcd-dvd-audio-lavc"> |
4887 <title>libavcodec</title> | |
21525 | 4888 |
4889 <para> | |
4890 For DVD with 2 channel sound: | |
4891 <screen>-oac lavc -lavcopts acodec=ac3:abitrate=192</screen> | |
4892 </para> | |
4893 | |
4894 <para> | |
4895 For DVD with 5.1 channel sound: | |
4896 <screen>-channels 6 -oac lavc -lavcopts acodec=ac3:abitrate=384</screen> | |
4897 </para> | |
4898 | |
4899 <para> | |
4900 For VCD and SVCD: | |
4901 <screen>-oac lavc -lavcopts acodec=mp2:abitrate=224</screen> | |
20725 | 4902 </para> |
4903 </sect3> | |
4904 </sect2> | |
4905 | |
21525 | 4906 <!-- ********** --> |
4907 | |
20725 | 4908 <sect2 id="menc-feat-vcd-dvd-all"> |
4909 <title>Putting it all Together</title> | |
21525 | 4910 |
4911 <para> | |
4912 This section shows some complete commands for creating VCD/SVCD/DVD | |
4913 compliant videos. | |
4914 </para> | |
4915 | |
20725 | 4916 |
4917 <sect3 id="menc-feat-vcd-dvd-all-pal-dvd"> | |
4918 <title>PAL DVD</title> | |
21525 | 4919 |
4920 <para> | |
4921 <screen> | |
4922 mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:tsaf \ | |
4923 -vf scale=720:576,harddup -srate 48000 -af lavcresample=48000 \ | |
4924 -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:\ | |
21594
0b1c322c5409
r21599: vstrict=0 is required to create DVDs decodable by standalone dvd players
voroshil
parents:
21525
diff
changeset
|
4925 keyint=15:vstrict=0:acodec=ac3:abitrate=192:aspect=16/9 -ofps 25 \ |
20725 | 4926 -o <replaceable>movie.mpg</replaceable> <replaceable>movie.avi</replaceable> |
21525 | 4927 </screen> |
20725 | 4928 </para> |
4929 </sect3> | |
4930 | |
21525 | 4931 |
20725 | 4932 <sect3 id="menc-feat-vcd-dvd-all-ntsc-dvd"> |
4933 <title>NTSC DVD</title> | |
21525 | 4934 |
4935 <para> | |
4936 <screen> | |
4937 mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:tsaf \ | |
4938 -vf scale=720:480,harddup -srate 48000 -af lavcresample=48000 \ | |
4939 -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:\ | |
21594
0b1c322c5409
r21599: vstrict=0 is required to create DVDs decodable by standalone dvd players
voroshil
parents:
21525
diff
changeset
|
4940 keyint=18:vstrict=0:acodec=ac3:abitrate=192:aspect=16/9 -ofps 30000/1001 \ |
20725 | 4941 -o <replaceable>movie.mpg</replaceable> <replaceable>movie.avi</replaceable> |
21525 | 4942 </screen> |
20725 | 4943 </para> |
4944 </sect3> | |
4945 | |
21525 | 4946 |
20725 | 4947 <sect3 id="menc-feat-vcd-dvd-all-pal-ac3-copy"> |
4948 <title>PAL AVI Containing AC3 Audio to DVD</title> | |
21525 | 4949 |
4950 <para> | |
4951 If the source already has AC3 audio, use -oac copy instead of re-encoding it. | |
4952 <screen> | |
4953 mencoder -oac copy -ovc lavc -of mpeg -mpegopts format=dvd:tsaf \ | |
4954 -vf scale=720:576,harddup -ofps 25 \ | |
4955 -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:\ | |
21594
0b1c322c5409
r21599: vstrict=0 is required to create DVDs decodable by standalone dvd players
voroshil
parents:
21525
diff
changeset
|
4956 keyint=15:vstrict=0:aspect=16/9 -o <replaceable>movie.mpg</replaceable> <replaceable>movie.avi</replaceable> |
21525 | 4957 </screen> |
20725 | 4958 </para> |
4959 </sect3> | |
4960 | |
21525 | 4961 |
20725 | 4962 <sect3 id="menc-feat-vcd-dvd-all-ntsc-ac3-copy"> |
4963 <title>NTSC AVI Containing AC3 Audio to DVD</title> | |
21525 | 4964 |
4965 <para> | |
4966 If the source already has AC3 audio, and is NTSC @ 24000/1001 fps: | |
4967 <screen> | |
4968 mencoder -oac copy -ovc lavc -of mpeg -mpegopts format=dvd:tsaf:telecine \ | |
20725 | 4969 -vf scale=720:480,harddup -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:\ |
21594
0b1c322c5409
r21599: vstrict=0 is required to create DVDs decodable by standalone dvd players
voroshil
parents:
21525
diff
changeset
|
4970 vrc_maxrate=9800:vbitrate=5000:keyint=15:vstrict=0:aspect=16/9 -ofps 24000/1001 \ |
20725 | 4971 -o <replaceable>movie.mpg</replaceable> <replaceable>movie.avi</replaceable> |
21525 | 4972 </screen> |
20725 | 4973 </para> |
4974 </sect3> | |
4975 | |
21525 | 4976 |
20725 | 4977 <sect3 id="menc-feat-vcd-dvd-all-pal-svcd"> |
4978 <title>PAL SVCD</title> | |
21525 | 4979 |
4980 <para> | |
4981 <screen> | |
4982 mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=xsvcd -vf \ | |
4983 scale=480:576,harddup -srate 44100 -af lavcresample=44100 -lavcopts \ | |
4984 vcodec=mpeg2video:mbd=2:keyint=15:vrc_buf_size=917:vrc_minrate=600:\ | |
4985 vbitrate=2500:vrc_maxrate=2500:acodec=mp2:abitrate=224 -ofps 25 \ | |
4986 -o <replaceable>movie.mpg</replaceable> <replaceable>movie.avi</replaceable> | |
4987 </screen> | |
20725 | 4988 </para> |
4989 </sect3> | |
4990 | |
21525 | 4991 |
20725 | 4992 <sect3 id="menc-feat-vcd-dvd-all-ntsc-svcd"> |
4993 <title>NTSC SVCD</title> | |
21525 | 4994 |
4995 <para> | |
4996 <screen> | |
4997 mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=xsvcd -vf \ | |
4998 scale=480:480,harddup -srate 44100 -af lavcresample=44100 -lavcopts \ | |
4999 vcodec=mpeg2video:mbd=2:keyint=18:vrc_buf_size=917:vrc_minrate=600:\ | |
5000 vbitrate=2500:vrc_maxrate=2500:acodec=mp2:abitrate=224 -ofps 30000/1001 \ | |
5001 -o <replaceable>movie.mpg</replaceable> <replaceable>movie.avi</replaceable> | |
5002 </screen> | |
20725 | 5003 </para> |
5004 </sect3> | |
5005 | |
21525 | 5006 |
20725 | 5007 <sect3 id="menc-feat-vcd-dvd-all-pal-vcd"> |
5008 <title>PAL VCD</title> | |
5009 <para> | |
21525 | 5010 <screen> |
5011 mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=xvcd -vf \ | |
5012 scale=352:288,harddup -srate 44100 -af lavcresample=44100 -lavcopts \ | |
5013 vcodec=mpeg1video:keyint=15:vrc_buf_size=327:vrc_minrate=1152:\ | |
5014 vbitrate=1152:vrc_maxrate=1152:acodec=mp2:abitrate=224 -ofps 25 \ | |
5015 -o <replaceable>movie.mpg</replaceable> <replaceable>movie.avi</replaceable> | |
5016 </screen> | |
20725 | 5017 </para> |
5018 </sect3> | |
5019 | |
21525 | 5020 |
20725 | 5021 <sect3 id="menc-feat-vcd-dvd-all-ntsc-vcd"> |
5022 <title>NTSC VCD</title> | |
5023 <para> | |
21525 | 5024 <screen> |
5025 mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=xvcd -vf \ | |
5026 scale=352:240,harddup -srate 44100 -af lavcresample=44100 -lavcopts \ | |
5027 vcodec=mpeg1video:keyint=18:vrc_buf_size=327:vrc_minrate=1152:\ | |
5028 vbitrate=1152:vrc_maxrate=1152:acodec=mp2:abitrate=224 -ofps 30000/1001 \ | |
5029 -o <replaceable>movie.mpg</replaceable> <replaceable>movie.avi</replaceable> | |
5030 </screen> | |
20725 | 5031 </para> |
5032 </sect3> | |
5033 </sect2> | |
5034 </sect1> | |
5035 </chapter> |