FFmpegfs Fuse Multi Media Filesystem 2.16
ffmpeg_profiles.cc
Go to the documentation of this file.
1/*
2 * Copyright (C) 2017-2024 Norbert Schlia (nschlia@oblivion-software.de)
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
17 *
18 * On Debian systems, the complete text of the GNU General Public License
19 * Version 3 can be found in `/usr/share/common-licenses/GPL-3'.
20 */
21
22#include "ffmpeg_transcoder.h"
23
178// ****************************************************************************************************************
179// Profiles
180// ****************************************************************************************************************
181
183{
184 // ****************************************************************************************************************
185 // MP4 Container
186 // ****************************************************************************************************************
187 {
188 FILETYPE::MP4,
191 {
192 // -profile:v high -level 3.1 - REQUIRED FOR PLAYBACK UNDER WIN7. (Partially or totally overwritten by profile!)
193 { "profile", "high", 0, 0 },
194 { "level", "3.1", 0, 0 },
195
196 // Set speed (changes profile!)
197 { "preset", "ultrafast", 0, OPT_SW_ONLY },
198 },
200 {
201 { "movflags", "+faststart", 0, OPT_ALL },
202 { "frag_duration", "1000000", 0, OPT_ALL }, // microseconds
203 { "movflags", "+empty_moov", 0, OPT_ALL },
204 }
205 },
206 // ----------------------------------------------------------------------------------------------------------------
207 {
208 FILETYPE::MP4,
214 {
215 // -profile:v high -level 3.1 - REQUIRED FOR PLAYBACK UNDER WIN7 (Partially or totally overwritten by profile!)
216 { "profile", "high", 0, 0 },
217 { "level", "3.1", 0, 0 },
218
219 // Set speed (changes profile!)
220 { "preset", "ultrafast", 0, OPT_SW_ONLY },
221 },
222 //
223 // @brief Firefox profile: MP4 format options.
224 //
225 {
226 { "frag_duration", "1000000", 0, OPT_AUDIO }, // microseconds
227 { "movflags", "+empty_moov", 0, OPT_ALL },
228 }
229 },
230 // ----------------------------------------------------------------------------------------------------------------
231 {
232 FILETYPE::MP4,
239 {
240 // Set speed (changes profile!)
241 { "preset", "ultrafast", 0, OPT_SW_ONLY },
242 },
246 {
247 { "frag_duration", "1000000", 0, OPT_ALL }, // microseconds
248 { "movflags", "+empty_moov", 0, OPT_ALL },
249 { "movflags", "+separate_moof", 0, OPT_ALL },
250 { "movflags", "+faststart", 0, OPT_ALL },
251 }
252 },
253 // ----------------------------------------------------------------------------------------------------------------
254 {
255 FILETYPE::MP4,
263 {
264 // -profile:v high -level 3.1 - REQUIRED FOR PLAYBACK UNDER WIN7 (Partially or totally overwritten by profile!)
265 { "profile", "high", 0, 0 },
266 { "level", "3.1", 0, 0 },
267
268 // Set speed (changes profile!)
269 { "preset", "ultrafast", 0, OPT_SW_ONLY },
270 },
274 {
275 }
276 },
277 // ----------------------------------------------------------------------------------------------------------------
278 {
279 FILETYPE::MP4,
286 {
287
288 // Set speed (changes profile!)
289 { "preset", "ultrafast", 0, OPT_SW_ONLY },
290 },
294 {
295 },
296 },
297 // ----------------------------------------------------------------------------------------------------------------
298 {
299 FILETYPE::MP4,
306 {
307 // Set speed (changes profile!)
308 { "preset", "ultrafast", 0, OPT_SW_ONLY },
309 },
313 {
314 }
315 },
316 // ----------------------------------------------------------------------------------------------------------------
317 {
318 FILETYPE::MP4,
325 {
326 // Set speed (changes profile!)
327 { "preset", "ultrafast", 0, OPT_SW_ONLY },
328 },
332 {
333 }
334 },
335 // ----------------------------------------------------------------------------------------------------------------
336 {
337 FILETYPE::MP4,
344 {
345 // -profile:v high -level 3.1 (Partially or totally overwritten by profile!)
346 { "profile", "high", 0, 0 },
347 { "level", "3.1", 0, 0 },
348
349 // Set speed (changes profile!)
350 { "preset", "ultrafast", 0, OPT_SW_ONLY },
351 },
355 {
356 }
357 },
358
359 // ****************************************************************************************************************
360 // MOV container
361 // ****************************************************************************************************************
362
363 {
364 FILETYPE::MOV,
369 {
370 // Set speed (changes profile!)
371 { "preset", "ultrafast", 0, OPT_SW_ONLY },
372 },
376 {
377 { "movflags", "+delay_moov", 0, OPT_ALL },
378 }
379 },
380
381 // ****************************************************************************************************************
382 // ProRes/MOV container
383 // ****************************************************************************************************************
384
385 {
386 FILETYPE::PRORES,
391 {
392 },
396 {
397 { "movflags", "+delay_moov", 0, OPT_ALL },
398 }
399 },
400
401 // ****************************************************************************************************************
402 // ProRes/ALAC container
403 // ****************************************************************************************************************
404
405 {
406 FILETYPE::ALAC,
411 {
412 },
416 {
417 { "movflags", "+delay_moov", 0, OPT_ALL },
418 }
419
420 },
421
422 // ****************************************************************************************************************
423 // HLS/ts container
424 // ****************************************************************************************************************
425
426 {
427 FILETYPE::HLS,
432 {
433 { "profile", "high", 0, 0 },
434 { "level", "3.1", 0, 0 },
435
436 // Set speed (changes profile!)
437 { "preset", "ultrafast", 0, OPT_SW_ONLY },
438 },
442 {
443 //{ "flags", "+cgop", 0, 0 },
444 { "movflags", "+faststart", 0, OPT_ALL },
445 { "frag_duration", "1000000", 0, OPT_ALL }, // microseconds
446 { "movflags", "+empty_moov", 0, OPT_ALL },
447 }
448 },
486 {
487 FILETYPE::WEBM,
492 {
493 { "deadline", "realtime", 0, OPT_SW_ONLY },
494
495 { "cpu-used", "8", 0, OPT_SW_ONLY },
496
497 // ffmpeg -i <source> -c:v libvpx-vp9 -pass 2 -b:v 1000K -threads 8 -speed 1
498 // -tile-columns 6 -frame-parallel 1 -auto-alt-ref 1 -lag-in-frames 25
499 // -c:a libopus -b:a 64k -f webm out.webm
500
501 // Most of the current VP9 decoders use tile-based, multi-threaded decoding. In order for the decoders to take advantage
502 // of multiple cores, the encoder must set tile-columns and frame-parallel.
503 // Setting auto-alt-ref and lag-in-frames >= 12 will turn on VP9's alt-ref frames, a VP9 feature that enhances quality.
504 // speed 4 tells VP9 to encode really fast, sacrificing quality. Useful to speed up the first pass.
505 // speed 1 is a good speed vs. quality compromise. Produces output quality typically very close to speed 0, but usually encodes much faster.
506 // Multi-threaded encoding may be used if -threads > 1 and -tile-columns > 0.
507
508 //{ "threads", "8", 0, OPT_SW_ONLY },
509 //{ "speed", "4", 0, OPT_SW_ONLY },
510 { "tile-columns", "6", 0, OPT_SW_ONLY },
511 { "frame-parallel", "1", 0, OPT_SW_ONLY },
512 { "auto-alt-ref", "1", 0, OPT_SW_ONLY },
513 { "lag-in-frames", "25", 0, OPT_SW_ONLY },
514 },
518 {
519 }
520 }
521};
static const PROFILE_LIST_VEC m_profile
List of profile options.
std::vector< PROFILE_LIST > PROFILE_LIST_VEC
PROFILE_LIST array.
#define OPT_ALL
All files.
#define OPT_AUDIO
For audio only files.
#define OPT_SW_ONLY
Use this option for software encoding only.
FFmpeg transcoder.
@ MP4_MAXTHON
Maxthon.
@ MP4_CHROME
Google Chrome.
@ MP4_OPERA
Opera.
@ ALAC_DEFAULT
MOV/ALAC uses no profile.
@ WEBM_DEFAULT
WebM uses no profile.
@ MOV_DEFAULT
MOV uses no profile.
@ MP4_EDGE
MS Edge.
@ MP4_IE
MS Internet Explorer.
@ HLS_DEFAULT
HLS/ts uses no profile.
@ DEFAULT
No specific profile/Don't care.
@ MP4_SAFARI
Apple Safari.
@ MP4_FF
Firefox.
@ PRORES_DEFAULT
MOV/ProRes uses no profile.