FFmpegfs Fuse Multi Media Filesystem 2.19
Loading...
Searching...
No Matches
ffmpeg_profiles.cc
Go to the documentation of this file.
1/*
2 * Copyright (C) 2017-2026 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 FILETYPE::ALAC,
428 {
429 },
433 {
434 //-movflags E……. MOV muxer flags (default 0)
435 // empty_moov E……. Make the initial moov atom empty (not supported by QuickTime)
436 // separate_moof E……. Write separate moof/mdat atoms for each track
437 // isml E……. Create a live smooth streaming feed (for pushing to a publishing point)
438 // faststart E……. Run a second pass to put the index (moov atom) at the beginning of the file
439 // omit_tfhd_offset E……. Omit the base data offset in tfhd atoms
440 //-moov_size E……. maximum moov size so it can be placed at the begin (from 0 to INT_MAX) (default 0)
441
442 //{ "movflags", "+empty_moov", 0, OPT_ALL },
443 //{ "movflags", "+delay_moov", 0, OPT_ALL },
444 //{ "movflags", "+separate_moof", 0, OPT_ALL },
445 //{ "movflags", "+faststart", 0, OPT_ALL }, // FEHLER: Unable to re-open .m4a output file for shifting data
446 //{ "movflags", "+delay_moov", 0, OPT_ALL },
447
448 //{ "moov_size", "200000", 0, OPT_ALL },
449
450 // No options: iTunes plays the files, but only after they have been fully recoded.
451 }
452
453 },
454
455 // ****************************************************************************************************************
456 // HLS/ts container
457 // ****************************************************************************************************************
458
459 {
460 FILETYPE::HLS,
465 {
466 { "profile", "high", 0, 0 },
467 { "level", "3.1", 0, 0 },
468
469 // Set speed (changes profile!)
470 { "preset", "ultrafast", 0, OPT_SW_ONLY },
471 },
475 {
476 //{ "flags", "+cgop", 0, 0 },
477 { "movflags", "+faststart", 0, OPT_ALL },
478 { "frag_duration", "1000000", 0, OPT_ALL }, // microseconds
479 { "movflags", "+empty_moov", 0, OPT_ALL },
480 }
481 },
519 {
520 FILETYPE::WEBM,
525 {
526 { "deadline", "realtime", 0, OPT_SW_ONLY },
527
528 { "cpu-used", "8", 0, OPT_SW_ONLY },
529
530 // ffmpeg -i <source> -c:v libvpx-vp9 -pass 2 -b:v 1000K -threads 8 -speed 1
531 // -tile-columns 6 -frame-parallel 1 -auto-alt-ref 1 -lag-in-frames 25
532 // -c:a libopus -b:a 64k -f webm out.webm
533
534 // Most of the current VP9 decoders use tile-based, multi-threaded decoding. In order for the decoders to take advantage
535 // of multiple cores, the encoder must set tile-columns and frame-parallel.
536 // Setting auto-alt-ref and lag-in-frames >= 12 will turn on VP9's alt-ref frames, a VP9 feature that enhances quality.
537 // speed 4 tells VP9 to encode really fast, sacrificing quality. Useful to speed up the first pass.
538 // speed 1 is a good speed vs. quality compromise. Produces output quality typically very close to speed 0, but usually encodes much faster.
539 // Multi-threaded encoding may be used if -threads > 1 and -tile-columns > 0.
540
541 //{ "threads", "8", 0, OPT_SW_ONLY },
542 //{ "speed", "4", 0, OPT_SW_ONLY },
543 { "tile-columns", "6", 0, OPT_SW_ONLY },
544 { "frame-parallel", "1", 0, OPT_SW_ONLY },
545 { "auto-alt-ref", "1", 0, OPT_SW_ONLY },
546 { "lag-in-frames", "25", 0, OPT_SW_ONLY },
547 },
551 {
552 }
553 }
554};
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
Default 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.
@ ALAC_ITUNES
Optimised for iTunes.
@ DEFAULT
No specific profile/Don't care.
@ MP4_SAFARI
Apple Safari.
@ MP4_FF
Firefox.
@ PRORES_DEFAULT
MOV/ProRes uses no profile.