1FFMPEG-FORMATS(1) FFMPEG-FORMATS(1)
2
3
4
6 ffmpeg-formats - FFmpeg formats
7
9 This document describes the supported formats (muxers and demuxers)
10 provided by the libavformat library.
11
13 The libavformat library provides some generic global options, which can
14 be set on all the muxers and demuxers. In addition each muxer or
15 demuxer may support so-called private options, which are specific for
16 that component.
17
18 Options may be set by specifying -option value in the FFmpeg tools, or
19 by setting the value explicitly in the "AVFormatContext" options or
20 using the libavutil/opt.h API for programmatic use.
21
22 The list of supported options follows:
23
24 avioflags flags (input/output)
25 Possible values:
26
27 direct
28 Reduce buffering.
29
30 probesize integer (input)
31 Set probing size in bytes, i.e. the size of the data to analyze to
32 get stream information. A higher value will enable detecting more
33 information in case it is dispersed into the stream, but will
34 increase latency. Must be an integer not lesser than 32. It is
35 5000000 by default.
36
37 max_probe_packets integer (input)
38 Set the maximum number of buffered packets when probing a codec.
39 Default is 2500 packets.
40
41 packetsize integer (output)
42 Set packet size.
43
44 fflags flags
45 Set format flags. Some are implemented for a limited number of
46 formats.
47
48 Possible values for input files:
49
50 discardcorrupt
51 Discard corrupted packets.
52
53 fastseek
54 Enable fast, but inaccurate seeks for some formats.
55
56 genpts
57 Generate missing PTS if DTS is present.
58
59 igndts
60 Ignore DTS if PTS is set. Inert when nofillin is set.
61
62 ignidx
63 Ignore index.
64
65 nobuffer
66 Reduce the latency introduced by buffering during initial input
67 streams analysis.
68
69 nofillin
70 Do not fill in missing values in packet fields that can be
71 exactly calculated.
72
73 noparse
74 Disable AVParsers, this needs "+nofillin" too.
75
76 sortdts
77 Try to interleave output packets by DTS. At present, available
78 only for AVIs with an index.
79
80 Possible values for output files:
81
82 autobsf
83 Automatically apply bitstream filters as required by the output
84 format. Enabled by default.
85
86 bitexact
87 Only write platform-, build- and time-independent data. This
88 ensures that file and data checksums are reproducible and match
89 between platforms. Its primary use is for regression testing.
90
91 flush_packets
92 Write out packets immediately.
93
94 shortest
95 Stop muxing at the end of the shortest stream. It may be
96 needed to increase max_interleave_delta to avoid flushing the
97 longer streams before EOF.
98
99 seek2any integer (input)
100 Allow seeking to non-keyframes on demuxer level when supported if
101 set to 1. Default is 0.
102
103 analyzeduration integer (input)
104 Specify how many microseconds are analyzed to probe the input. A
105 higher value will enable detecting more accurate information, but
106 will increase latency. It defaults to 5,000,000 microseconds = 5
107 seconds.
108
109 cryptokey hexadecimal string (input)
110 Set decryption key.
111
112 indexmem integer (input)
113 Set max memory used for timestamp index (per stream).
114
115 rtbufsize integer (input)
116 Set max memory used for buffering real-time frames.
117
118 fdebug flags (input/output)
119 Print specific debug info.
120
121 Possible values:
122
123 ts
124 max_delay integer (input/output)
125 Set maximum muxing or demuxing delay in microseconds.
126
127 fpsprobesize integer (input)
128 Set number of frames used to probe fps.
129
130 audio_preload integer (output)
131 Set microseconds by which audio packets should be interleaved
132 earlier.
133
134 chunk_duration integer (output)
135 Set microseconds for each chunk.
136
137 chunk_size integer (output)
138 Set size in bytes for each chunk.
139
140 err_detect, f_err_detect flags (input)
141 Set error detection flags. "f_err_detect" is deprecated and should
142 be used only via the ffmpeg tool.
143
144 Possible values:
145
146 crccheck
147 Verify embedded CRCs.
148
149 bitstream
150 Detect bitstream specification deviations.
151
152 buffer
153 Detect improper bitstream length.
154
155 explode
156 Abort decoding on minor error detection.
157
158 careful
159 Consider things that violate the spec and have not been seen in
160 the wild as errors.
161
162 compliant
163 Consider all spec non compliancies as errors.
164
165 aggressive
166 Consider things that a sane encoder should not do as an error.
167
168 max_interleave_delta integer (output)
169 Set maximum buffering duration for interleaving. The duration is
170 expressed in microseconds, and defaults to 10000000 (10 seconds).
171
172 To ensure all the streams are interleaved correctly, libavformat
173 will wait until it has at least one packet for each stream before
174 actually writing any packets to the output file. When some streams
175 are "sparse" (i.e. there are large gaps between successive
176 packets), this can result in excessive buffering.
177
178 This field specifies the maximum difference between the timestamps
179 of the first and the last packet in the muxing queue, above which
180 libavformat will output a packet regardless of whether it has
181 queued a packet for all the streams.
182
183 If set to 0, libavformat will continue buffering packets until it
184 has a packet for each stream, regardless of the maximum timestamp
185 difference between the buffered packets.
186
187 use_wallclock_as_timestamps integer (input)
188 Use wallclock as timestamps if set to 1. Default is 0.
189
190 avoid_negative_ts integer (output)
191 Possible values:
192
193 make_non_negative
194 Shift timestamps to make them non-negative. Also note that
195 this affects only leading negative timestamps, and not non-
196 monotonic negative timestamps.
197
198 make_zero
199 Shift timestamps so that the first timestamp is 0.
200
201 auto (default)
202 Enables shifting when required by the target format.
203
204 disabled
205 Disables shifting of timestamp.
206
207 When shifting is enabled, all output timestamps are shifted by the
208 same amount. Audio, video, and subtitles desynching and relative
209 timestamp differences are preserved compared to how they would have
210 been without shifting.
211
212 skip_initial_bytes integer (input)
213 Set number of bytes to skip before reading header and frames if set
214 to 1. Default is 0.
215
216 correct_ts_overflow integer (input)
217 Correct single timestamp overflows if set to 1. Default is 1.
218
219 flush_packets integer (output)
220 Flush the underlying I/O stream after each packet. Default is -1
221 (auto), which means that the underlying protocol will decide, 1
222 enables it, and has the effect of reducing the latency, 0 disables
223 it and may increase IO throughput in some cases.
224
225 output_ts_offset offset (output)
226 Set the output time offset.
227
228 offset must be a time duration specification, see the Time duration
229 section in the ffmpeg-utils(1) manual.
230
231 The offset is added by the muxer to the output timestamps.
232
233 Specifying a positive offset means that the corresponding streams
234 are delayed bt the time duration specified in offset. Default value
235 is 0 (meaning that no offset is applied).
236
237 format_whitelist list (input)
238 "," separated list of allowed demuxers. By default all are allowed.
239
240 dump_separator string (input)
241 Separator used to separate the fields printed on the command line
242 about the Stream parameters. For example, to separate the fields
243 with newlines and indentation:
244
245 ffprobe -dump_separator "
246 " -i ~/videos/matrixbench_mpeg2.mpg
247
248 max_streams integer (input)
249 Specifies the maximum number of streams. This can be used to reject
250 files that would require too many resources due to a large number
251 of streams.
252
253 skip_estimate_duration_from_pts bool (input)
254 Skip estimation of input duration when calculated using PTS. At
255 present, applicable for MPEG-PS and MPEG-TS.
256
257 strict, f_strict integer (input/output)
258 Specify how strictly to follow the standards. "f_strict" is
259 deprecated and should be used only via the ffmpeg tool.
260
261 Possible values:
262
263 very
264 strictly conform to an older more strict version of the spec or
265 reference software
266
267 strict
268 strictly conform to all the things in the spec no matter what
269 consequences
270
271 normal
272 unofficial
273 allow unofficial extensions
274
275 experimental
276 allow non standardized experimental things, experimental
277 (unfinished/work in progress/not well tested) decoders and
278 encoders. Note: experimental decoders can pose a security
279 risk, do not use this for decoding untrusted input.
280
281 Format stream specifiers
282 Format stream specifiers allow selection of one or more streams that
283 match specific properties.
284
285 The exact semantics of stream specifiers is defined by the
286 "avformat_match_stream_specifier()" function declared in the
287 libavformat/avformat.h header and documented in the Stream specifiers
288 section in the ffmpeg(1) manual.
289
291 Demuxers are configured elements in FFmpeg that can read the multimedia
292 streams from a particular type of file.
293
294 When you configure your FFmpeg build, all the supported demuxers are
295 enabled by default. You can list all available ones using the configure
296 option "--list-demuxers".
297
298 You can disable all the demuxers using the configure option
299 "--disable-demuxers", and selectively enable a single demuxer with the
300 option "--enable-demuxer=DEMUXER", or disable it with the option
301 "--disable-demuxer=DEMUXER".
302
303 The option "-demuxers" of the ff* tools will display the list of
304 enabled demuxers. Use "-formats" to view a combined list of enabled
305 demuxers and muxers.
306
307 The description of some of the currently available demuxers follows.
308
309 aa
310 Audible Format 2, 3, and 4 demuxer.
311
312 This demuxer is used to demux Audible Format 2, 3, and 4 (.aa) files.
313
314 aac
315 Raw Audio Data Transport Stream AAC demuxer.
316
317 This demuxer is used to demux an ADTS input containing a single AAC
318 stream alongwith any ID3v1/2 or APE tags in it.
319
320 apng
321 Animated Portable Network Graphics demuxer.
322
323 This demuxer is used to demux APNG files. All headers, but the PNG
324 signature, up to (but not including) the first fcTL chunk are
325 transmitted as extradata. Frames are then split as being all the
326 chunks between two fcTL ones, or between the last fcTL and IEND chunks.
327
328 -ignore_loop bool
329 Ignore the loop variable in the file if set. Default is enabled.
330
331 -max_fps int
332 Maximum framerate in frames per second. Default of 0 imposes no
333 limit.
334
335 -default_fps int
336 Default framerate in frames per second when none is specified in
337 the file (0 meaning as fast as possible). Default is 15.
338
339 asf
340 Advanced Systems Format demuxer.
341
342 This demuxer is used to demux ASF files and MMS network streams.
343
344 -no_resync_search bool
345 Do not try to resynchronize by looking for a certain optional start
346 code.
347
348 concat
349 Virtual concatenation script demuxer.
350
351 This demuxer reads a list of files and other directives from a text
352 file and demuxes them one after the other, as if all their packets had
353 been muxed together.
354
355 The timestamps in the files are adjusted so that the first file starts
356 at 0 and each next file starts where the previous one finishes. Note
357 that it is done globally and may cause gaps if all streams do not have
358 exactly the same length.
359
360 All files must have the same streams (same codecs, same time base,
361 etc.).
362
363 The duration of each file is used to adjust the timestamps of the next
364 file: if the duration is incorrect (because it was computed using the
365 bit-rate or because the file is truncated, for example), it can cause
366 artifacts. The "duration" directive can be used to override the
367 duration stored in each file.
368
369 Syntax
370
371 The script is a text file in extended-ASCII, with one directive per
372 line. Empty lines, leading spaces and lines starting with '#' are
373 ignored. The following directive is recognized:
374
375 "file path"
376 Path to a file to read; special characters and spaces must be
377 escaped with backslash or single quotes.
378
379 All subsequent file-related directives apply to that file.
380
381 "ffconcat version 1.0"
382 Identify the script type and version.
383
384 To make FFmpeg recognize the format automatically, this directive
385 must appear exactly as is (no extra space or byte-order-mark) on
386 the very first line of the script.
387
388 "duration dur"
389 Duration of the file. This information can be specified from the
390 file; specifying it here may be more efficient or help if the
391 information from the file is not available or accurate.
392
393 If the duration is set for all files, then it is possible to seek
394 in the whole concatenated video.
395
396 "inpoint timestamp"
397 In point of the file. When the demuxer opens the file it instantly
398 seeks to the specified timestamp. Seeking is done so that all
399 streams can be presented successfully at In point.
400
401 This directive works best with intra frame codecs, because for non-
402 intra frame ones you will usually get extra packets before the
403 actual In point and the decoded content will most likely contain
404 frames before In point too.
405
406 For each file, packets before the file In point will have
407 timestamps less than the calculated start timestamp of the file
408 (negative in case of the first file), and the duration of the files
409 (if not specified by the "duration" directive) will be reduced
410 based on their specified In point.
411
412 Because of potential packets before the specified In point, packet
413 timestamps may overlap between two concatenated files.
414
415 "outpoint timestamp"
416 Out point of the file. When the demuxer reaches the specified
417 decoding timestamp in any of the streams, it handles it as an end
418 of file condition and skips the current and all the remaining
419 packets from all streams.
420
421 Out point is exclusive, which means that the demuxer will not
422 output packets with a decoding timestamp greater or equal to Out
423 point.
424
425 This directive works best with intra frame codecs and formats where
426 all streams are tightly interleaved. For non-intra frame codecs you
427 will usually get additional packets with presentation timestamp
428 after Out point therefore the decoded content will most likely
429 contain frames after Out point too. If your streams are not tightly
430 interleaved you may not get all the packets from all streams before
431 Out point and you may only will be able to decode the earliest
432 stream until Out point.
433
434 The duration of the files (if not specified by the "duration"
435 directive) will be reduced based on their specified Out point.
436
437 "file_packet_metadata key=value"
438 Metadata of the packets of the file. The specified metadata will be
439 set for each file packet. You can specify this directive multiple
440 times to add multiple metadata entries. This directive is
441 deprecated, use "file_packet_meta" instead.
442
443 "file_packet_meta key value"
444 Metadata of the packets of the file. The specified metadata will be
445 set for each file packet. You can specify this directive multiple
446 times to add multiple metadata entries.
447
448 "option key value"
449 Option to access, open and probe the file. Can be present multiple
450 times.
451
452 "stream"
453 Introduce a stream in the virtual file. All subsequent stream-
454 related directives apply to the last introduced stream. Some
455 streams properties must be set in order to allow identifying the
456 matching streams in the subfiles. If no streams are defined in the
457 script, the streams from the first file are copied.
458
459 "exact_stream_id id"
460 Set the id of the stream. If this directive is given, the string
461 with the corresponding id in the subfiles will be used. This is
462 especially useful for MPEG-PS (VOB) files, where the order of the
463 streams is not reliable.
464
465 "stream_meta key value"
466 Metadata for the stream. Can be present multiple times.
467
468 "stream_codec value"
469 Codec for the stream.
470
471 "stream_extradata hex_string"
472 Extradata for the string, encoded in hexadecimal.
473
474 "chapter id start end"
475 Add a chapter. id is an unique identifier, possibly small and
476 consecutive.
477
478 Options
479
480 This demuxer accepts the following option:
481
482 safe
483 If set to 1, reject unsafe file paths and directives. A file path
484 is considered safe if it does not contain a protocol specification
485 and is relative and all components only contain characters from the
486 portable character set (letters, digits, period, underscore and
487 hyphen) and have no period at the beginning of a component.
488
489 If set to 0, any file name is accepted.
490
491 The default is 1.
492
493 auto_convert
494 If set to 1, try to perform automatic conversions on packet data to
495 make the streams concatenable. The default is 1.
496
497 Currently, the only conversion is adding the h264_mp4toannexb
498 bitstream filter to H.264 streams in MP4 format. This is necessary
499 in particular if there are resolution changes.
500
501 segment_time_metadata
502 If set to 1, every packet will contain the lavf.concat.start_time
503 and the lavf.concat.duration packet metadata values which are the
504 start_time and the duration of the respective file segments in the
505 concatenated output expressed in microseconds. The duration
506 metadata is only set if it is known based on the concat file. The
507 default is 0.
508
509 Examples
510
511 • Use absolute filenames and include some comments:
512
513 # my first filename
514 file /mnt/share/file-1.wav
515 # my second filename including whitespace
516 file '/mnt/share/file 2.wav'
517 # my third filename including whitespace plus single quote
518 file '/mnt/share/file 3'\''.wav'
519
520 • Allow for input format auto-probing, use safe filenames and set the
521 duration of the first file:
522
523 ffconcat version 1.0
524
525 file file-1.wav
526 duration 20.0
527
528 file subdir/file-2.wav
529
530 dash
531 Dynamic Adaptive Streaming over HTTP demuxer.
532
533 This demuxer presents all AVStreams found in the manifest. By setting
534 the discard flags on AVStreams the caller can decide which streams to
535 actually receive. Each stream mirrors the "id" and "bandwidth"
536 properties from the "<Representation>" as metadata keys named "id" and
537 "variant_bitrate" respectively.
538
539 Options
540
541 This demuxer accepts the following option:
542
543 cenc_decryption_key
544 16-byte key, in hex, to decrypt files encrypted using ISO Common
545 Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7).
546
547 imf
548 Interoperable Master Format demuxer.
549
550 This demuxer presents audio and video streams found in an IMF
551 Composition.
552
553 flv, live_flv, kux
554 Adobe Flash Video Format demuxer.
555
556 This demuxer is used to demux FLV files and RTMP network streams. In
557 case of live network streams, if you force format, you may use live_flv
558 option instead of flv to survive timestamp discontinuities. KUX is a
559 flv variant used on the Youku platform.
560
561 ffmpeg -f flv -i myfile.flv ...
562 ffmpeg -f live_flv -i rtmp://<any.server>/anything/key ....
563
564 -flv_metadata bool
565 Allocate the streams according to the onMetaData array content.
566
567 -flv_ignore_prevtag bool
568 Ignore the size of previous tag value.
569
570 -flv_full_metadata bool
571 Output all context of the onMetadata.
572
573 gif
574 Animated GIF demuxer.
575
576 It accepts the following options:
577
578 min_delay
579 Set the minimum valid delay between frames in hundredths of
580 seconds. Range is 0 to 6000. Default value is 2.
581
582 max_gif_delay
583 Set the maximum valid delay between frames in hundredth of seconds.
584 Range is 0 to 65535. Default value is 65535 (nearly eleven
585 minutes), the maximum value allowed by the specification.
586
587 default_delay
588 Set the default delay between frames in hundredths of seconds.
589 Range is 0 to 6000. Default value is 10.
590
591 ignore_loop
592 GIF files can contain information to loop a certain number of times
593 (or infinitely). If ignore_loop is set to 1, then the loop setting
594 from the input will be ignored and looping will not occur. If set
595 to 0, then looping will occur and will cycle the number of times
596 according to the GIF. Default value is 1.
597
598 For example, with the overlay filter, place an infinitely looping GIF
599 over another video:
600
601 ffmpeg -i input.mp4 -ignore_loop 0 -i input.gif -filter_complex overlay=shortest=1 out.mkv
602
603 Note that in the above example the shortest option for overlay filter
604 is used to end the output video at the length of the shortest input
605 file, which in this case is input.mp4 as the GIF in this example loops
606 infinitely.
607
608 hls
609 HLS demuxer
610
611 Apple HTTP Live Streaming demuxer.
612
613 This demuxer presents all AVStreams from all variant streams. The id
614 field is set to the bitrate variant index number. By setting the
615 discard flags on AVStreams (by pressing 'a' or 'v' in ffplay), the
616 caller can decide which variant streams to actually receive. The total
617 bitrate of the variant that the stream belongs to is available in a
618 metadata key named "variant_bitrate".
619
620 It accepts the following options:
621
622 live_start_index
623 segment index to start live streams at (negative values are from
624 the end).
625
626 prefer_x_start
627 prefer to use #EXT-X-START if it's in playlist instead of
628 live_start_index.
629
630 allowed_extensions
631 ',' separated list of file extensions that hls is allowed to
632 access.
633
634 max_reload
635 Maximum number of times a insufficient list is attempted to be
636 reloaded. Default value is 1000.
637
638 m3u8_hold_counters
639 The maximum number of times to load m3u8 when it refreshes without
640 new segments. Default value is 1000.
641
642 http_persistent
643 Use persistent HTTP connections. Applicable only for HTTP streams.
644 Enabled by default.
645
646 http_multiple
647 Use multiple HTTP connections for downloading HTTP segments.
648 Enabled by default for HTTP/1.1 servers.
649
650 http_seekable
651 Use HTTP partial requests for downloading HTTP segments. 0 =
652 disable, 1 = enable, -1 = auto, Default is auto.
653
654 seg_format_options
655 Set options for the demuxer of media segments using a list of
656 key=value pairs separated by ":".
657
658 image2
659 Image file demuxer.
660
661 This demuxer reads from a list of image files specified by a pattern.
662 The syntax and meaning of the pattern is specified by the option
663 pattern_type.
664
665 The pattern may contain a suffix which is used to automatically
666 determine the format of the images contained in the files.
667
668 The size, the pixel format, and the format of each image must be the
669 same for all the files in the sequence.
670
671 This demuxer accepts the following options:
672
673 framerate
674 Set the frame rate for the video stream. It defaults to 25.
675
676 loop
677 If set to 1, loop over the input. Default value is 0.
678
679 pattern_type
680 Select the pattern type used to interpret the provided filename.
681
682 pattern_type accepts one of the following values.
683
684 none
685 Disable pattern matching, therefore the video will only contain
686 the specified image. You should use this option if you do not
687 want to create sequences from multiple images and your
688 filenames may contain special pattern characters.
689
690 sequence
691 Select a sequence pattern type, used to specify a sequence of
692 files indexed by sequential numbers.
693
694 A sequence pattern may contain the string "%d" or "%0Nd", which
695 specifies the position of the characters representing a
696 sequential number in each filename matched by the pattern. If
697 the form "%d0Nd" is used, the string representing the number in
698 each filename is 0-padded and N is the total number of 0-padded
699 digits representing the number. The literal character '%' can
700 be specified in the pattern with the string "%%".
701
702 If the sequence pattern contains "%d" or "%0Nd", the first
703 filename of the file list specified by the pattern must contain
704 a number inclusively contained between start_number and
705 start_number+start_number_range-1, and all the following
706 numbers must be sequential.
707
708 For example the pattern "img-%03d.bmp" will match a sequence of
709 filenames of the form img-001.bmp, img-002.bmp, ...,
710 img-010.bmp, etc.; the pattern "i%%m%%g-%d.jpg" will match a
711 sequence of filenames of the form i%m%g-1.jpg, i%m%g-2.jpg,
712 ..., i%m%g-10.jpg, etc.
713
714 Note that the pattern must not necessarily contain "%d" or
715 "%0Nd", for example to convert a single image file img.jpeg you
716 can employ the command:
717
718 ffmpeg -i img.jpeg img.png
719
720 glob
721 Select a glob wildcard pattern type.
722
723 The pattern is interpreted like a "glob()" pattern. This is
724 only selectable if libavformat was compiled with globbing
725 support.
726
727 glob_sequence (deprecated, will be removed)
728 Select a mixed glob wildcard/sequence pattern.
729
730 If your version of libavformat was compiled with globbing
731 support, and the provided pattern contains at least one glob
732 meta character among "%*?[]{}" that is preceded by an unescaped
733 "%", the pattern is interpreted like a "glob()" pattern,
734 otherwise it is interpreted like a sequence pattern.
735
736 All glob special characters "%*?[]{}" must be prefixed with
737 "%". To escape a literal "%" you shall use "%%".
738
739 For example the pattern "foo-%*.jpeg" will match all the
740 filenames prefixed by "foo-" and terminating with ".jpeg", and
741 "foo-%?%?%?.jpeg" will match all the filenames prefixed with
742 "foo-", followed by a sequence of three characters, and
743 terminating with ".jpeg".
744
745 This pattern type is deprecated in favor of glob and sequence.
746
747 Default value is glob_sequence.
748
749 pixel_format
750 Set the pixel format of the images to read. If not specified the
751 pixel format is guessed from the first image file in the sequence.
752
753 start_number
754 Set the index of the file matched by the image file pattern to
755 start to read from. Default value is 0.
756
757 start_number_range
758 Set the index interval range to check when looking for the first
759 image file in the sequence, starting from start_number. Default
760 value is 5.
761
762 ts_from_file
763 If set to 1, will set frame timestamp to modification time of image
764 file. Note that monotonity of timestamps is not provided: images go
765 in the same order as without this option. Default value is 0. If
766 set to 2, will set frame timestamp to the modification time of the
767 image file in nanosecond precision.
768
769 video_size
770 Set the video size of the images to read. If not specified the
771 video size is guessed from the first image file in the sequence.
772
773 export_path_metadata
774 If set to 1, will add two extra fields to the metadata found in
775 input, making them also available for other filters (see drawtext
776 filter for examples). Default value is 0. The extra fields are
777 described below:
778
779 lavf.image2dec.source_path
780 Corresponds to the full path to the input file being read.
781
782 lavf.image2dec.source_basename
783 Corresponds to the name of the file being read.
784
785 Examples
786
787 • Use ffmpeg for creating a video from the images in the file
788 sequence img-001.jpeg, img-002.jpeg, ..., assuming an input frame
789 rate of 10 frames per second:
790
791 ffmpeg -framerate 10 -i 'img-%03d.jpeg' out.mkv
792
793 • As above, but start by reading from a file with index 100 in the
794 sequence:
795
796 ffmpeg -framerate 10 -start_number 100 -i 'img-%03d.jpeg' out.mkv
797
798 • Read images matching the "*.png" glob pattern , that is all the
799 files terminating with the ".png" suffix:
800
801 ffmpeg -framerate 10 -pattern_type glob -i "*.png" out.mkv
802
803 libgme
804 The Game Music Emu library is a collection of video game music file
805 emulators.
806
807 See <https://bitbucket.org/mpyne/game-music-emu/overview> for more
808 information.
809
810 It accepts the following options:
811
812 track_index
813 Set the index of which track to demux. The demuxer can only export
814 one track. Track indexes start at 0. Default is to pick the first
815 track. Number of tracks is exported as tracks metadata entry.
816
817 sample_rate
818 Set the sampling rate of the exported track. Range is 1000 to
819 999999. Default is 44100.
820
821 max_size (bytes)
822 The demuxer buffers the entire file into memory. Adjust this value
823 to set the maximum buffer size, which in turn, acts as a ceiling
824 for the size of files that can be read. Default is 50 MiB.
825
826 libmodplug
827 ModPlug based module demuxer
828
829 See <https://github.com/Konstanty/libmodplug>
830
831 It will export one 2-channel 16-bit 44.1 kHz audio stream. Optionally,
832 a "pal8" 16-color video stream can be exported with or without printed
833 metadata.
834
835 It accepts the following options:
836
837 noise_reduction
838 Apply a simple low-pass filter. Can be 1 (on) or 0 (off). Default
839 is 0.
840
841 reverb_depth
842 Set amount of reverb. Range 0-100. Default is 0.
843
844 reverb_delay
845 Set delay in ms, clamped to 40-250 ms. Default is 0.
846
847 bass_amount
848 Apply bass expansion a.k.a. XBass or megabass. Range is 0 (quiet)
849 to 100 (loud). Default is 0.
850
851 bass_range
852 Set cutoff i.e. upper-bound for bass frequencies. Range is 10-100
853 Hz. Default is 0.
854
855 surround_depth
856 Apply a Dolby Pro-Logic surround effect. Range is 0 (quiet) to 100
857 (heavy). Default is 0.
858
859 surround_delay
860 Set surround delay in ms, clamped to 5-40 ms. Default is 0.
861
862 max_size
863 The demuxer buffers the entire file into memory. Adjust this value
864 to set the maximum buffer size, which in turn, acts as a ceiling
865 for the size of files that can be read. Range is 0 to 100 MiB. 0
866 removes buffer size limit (not recommended). Default is 5 MiB.
867
868 video_stream_expr
869 String which is evaluated using the eval API to assign colors to
870 the generated video stream. Variables which can be used are "x",
871 "y", "w", "h", "t", "speed", "tempo", "order", "pattern" and "row".
872
873 video_stream
874 Generate video stream. Can be 1 (on) or 0 (off). Default is 0.
875
876 video_stream_w
877 Set video frame width in 'chars' where one char indicates 8 pixels.
878 Range is 20-512. Default is 30.
879
880 video_stream_h
881 Set video frame height in 'chars' where one char indicates 8
882 pixels. Range is 20-512. Default is 30.
883
884 video_stream_ptxt
885 Print metadata on video stream. Includes "speed", "tempo", "order",
886 "pattern", "row" and "ts" (time in ms). Can be 1 (on) or 0 (off).
887 Default is 1.
888
889 libopenmpt
890 libopenmpt based module demuxer
891
892 See <https://lib.openmpt.org/libopenmpt/> for more information.
893
894 Some files have multiple subsongs (tracks) this can be set with the
895 subsong option.
896
897 It accepts the following options:
898
899 subsong
900 Set the subsong index. This can be either 'all', 'auto', or the
901 index of the subsong. Subsong indexes start at 0. The default is
902 'auto'.
903
904 The default value is to let libopenmpt choose.
905
906 layout
907 Set the channel layout. Valid values are 1, 2, and 4 channel
908 layouts. The default value is STEREO.
909
910 sample_rate
911 Set the sample rate for libopenmpt to output. Range is from 1000
912 to INT_MAX. The value default is 48000.
913
914 mov/mp4/3gp
915 Demuxer for Quicktime File Format & ISO/IEC Base Media File Format
916 (ISO/IEC 14496-12 or MPEG-4 Part 12, ISO/IEC 15444-12 or JPEG 2000 Part
917 12).
918
919 Registered extensions: mov, mp4, m4a, 3gp, 3g2, mj2, psp, m4b, ism,
920 ismv, isma, f4v
921
922 Options
923
924 This demuxer accepts the following options:
925
926 enable_drefs
927 Enable loading of external tracks, disabled by default. Enabling
928 this can theoretically leak information in some use cases.
929
930 use_absolute_path
931 Allows loading of external tracks via absolute paths, disabled by
932 default. Enabling this poses a security risk. It should only be
933 enabled if the source is known to be non-malicious.
934
935 seek_streams_individually
936 When seeking, identify the closest point in each stream
937 individually and demux packets in that stream from identified
938 point. This can lead to a different sequence of packets compared to
939 demuxing linearly from the beginning. Default is true.
940
941 ignore_editlist
942 Ignore any edit list atoms. The demuxer, by default, modifies the
943 stream index to reflect the timeline described by the edit list.
944 Default is false.
945
946 advanced_editlist
947 Modify the stream index to reflect the timeline described by the
948 edit list. "ignore_editlist" must be set to false for this option
949 to be effective. If both "ignore_editlist" and this option are set
950 to false, then only the start of the stream index is modified to
951 reflect initial dwell time or starting timestamp described by the
952 edit list. Default is true.
953
954 ignore_chapters
955 Don't parse chapters. This includes GoPro 'HiLight' tags/moments.
956 Note that chapters are only parsed when input is seekable. Default
957 is false.
958
959 use_mfra_for
960 For seekable fragmented input, set fragment's starting timestamp
961 from media fragment random access box, if present.
962
963 Following options are available:
964
965 auto
966 Auto-detect whether to set mfra timestamps as PTS or DTS
967 (default)
968
969 dts Set mfra timestamps as DTS
970
971 pts Set mfra timestamps as PTS
972
973 0 Don't use mfra box to set timestamps
974
975 use_tfdt
976 For fragmented input, set fragment's starting timestamp to
977 "baseMediaDecodeTime" from the "tfdt" box. Default is enabled,
978 which will prefer to use the "tfdt" box to set DTS. Disable to use
979 the "earliest_presentation_time" from the "sidx" box. In either
980 case, the timestamp from the "mfra" box will be used if it's
981 available and "use_mfra_for" is set to pts or dts.
982
983 export_all
984 Export unrecognized boxes within the udta box as metadata entries.
985 The first four characters of the box type are set as the key.
986 Default is false.
987
988 export_xmp
989 Export entire contents of XMP_ box and uuid box as a string with
990 key "xmp". Note that if "export_all" is set and this option isn't,
991 the contents of XMP_ box are still exported but with key "XMP_".
992 Default is false.
993
994 activation_bytes
995 4-byte key required to decrypt Audible AAX and AAX+ files. See
996 Audible AAX subsection below.
997
998 audible_fixed_key
999 Fixed key used for handling Audible AAX/AAX+ files. It has been
1000 pre-set so should not be necessary to specify.
1001
1002 decryption_key
1003 16-byte key, in hex, to decrypt files encrypted using ISO Common
1004 Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7).
1005
1006 max_stts_delta
1007 Very high sample deltas written in a trak's stts box may
1008 occasionally be intended but usually they are written in error or
1009 used to store a negative value for dts correction when treated as
1010 signed 32-bit integers. This option lets the user set an upper
1011 limit, beyond which the delta is clamped to 1. Values greater than
1012 the limit if negative when cast to int32 are used to adjust onward
1013 dts.
1014
1015 Unit is the track time scale. Range is 0 to UINT_MAX. Default is
1016 "UINT_MAX - 48000*10" which allows upto a 10 second dts correction
1017 for 48 kHz audio streams while accommodating 99.9% of "uint32"
1018 range.
1019
1020 Audible AAX
1021
1022 Audible AAX files are encrypted M4B files, and they can be decrypted by
1023 specifying a 4 byte activation secret.
1024
1025 ffmpeg -activation_bytes 1CEB00DA -i test.aax -vn -c:a copy output.mp4
1026
1027 mpegts
1028 MPEG-2 transport stream demuxer.
1029
1030 This demuxer accepts the following options:
1031
1032 resync_size
1033 Set size limit for looking up a new synchronization. Default value
1034 is 65536.
1035
1036 skip_unknown_pmt
1037 Skip PMTs for programs not defined in the PAT. Default value is 0.
1038
1039 fix_teletext_pts
1040 Override teletext packet PTS and DTS values with the timestamps
1041 calculated from the PCR of the first program which the teletext
1042 stream is part of and is not discarded. Default value is 1, set
1043 this option to 0 if you want your teletext packet PTS and DTS
1044 values untouched.
1045
1046 ts_packetsize
1047 Output option carrying the raw packet size in bytes. Show the
1048 detected raw packet size, cannot be set by the user.
1049
1050 scan_all_pmts
1051 Scan and combine all PMTs. The value is an integer with value from
1052 -1 to 1 (-1 means automatic setting, 1 means enabled, 0 means
1053 disabled). Default value is -1.
1054
1055 merge_pmt_versions
1056 Re-use existing streams when a PMT's version is updated and
1057 elementary streams move to different PIDs. Default value is 0.
1058
1059 max_packet_size
1060 Set maximum size, in bytes, of packet emitted by the demuxer.
1061 Payloads above this size are split across multiple packets. Range
1062 is 1 to INT_MAX/2. Default is 204800 bytes.
1063
1064 mpjpeg
1065 MJPEG encapsulated in multi-part MIME demuxer.
1066
1067 This demuxer allows reading of MJPEG, where each frame is represented
1068 as a part of multipart/x-mixed-replace stream.
1069
1070 strict_mime_boundary
1071 Default implementation applies a relaxed standard to multi-part
1072 MIME boundary detection, to prevent regression with numerous
1073 existing endpoints not generating a proper MIME MJPEG stream.
1074 Turning this option on by setting it to 1 will result in a stricter
1075 check of the boundary value.
1076
1077 rawvideo
1078 Raw video demuxer.
1079
1080 This demuxer allows one to read raw video data. Since there is no
1081 header specifying the assumed video parameters, the user must specify
1082 them in order to be able to decode the data correctly.
1083
1084 This demuxer accepts the following options:
1085
1086 framerate
1087 Set input video frame rate. Default value is 25.
1088
1089 pixel_format
1090 Set the input video pixel format. Default value is "yuv420p".
1091
1092 video_size
1093 Set the input video size. This value must be specified explicitly.
1094
1095 For example to read a rawvideo file input.raw with ffplay, assuming a
1096 pixel format of "rgb24", a video size of "320x240", and a frame rate of
1097 10 images per second, use the command:
1098
1099 ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw
1100
1101 sbg
1102 SBaGen script demuxer.
1103
1104 This demuxer reads the script language used by SBaGen
1105 <http://uazu.net/sbagen/> to generate binaural beats sessions. A SBG
1106 script looks like that:
1107
1108 -SE
1109 a: 300-2.5/3 440+4.5/0
1110 b: 300-2.5/0 440+4.5/3
1111 off: -
1112 NOW == a
1113 +0:07:00 == b
1114 +0:14:00 == a
1115 +0:21:00 == b
1116 +0:30:00 off
1117
1118 A SBG script can mix absolute and relative timestamps. If the script
1119 uses either only absolute timestamps (including the script start time)
1120 or only relative ones, then its layout is fixed, and the conversion is
1121 straightforward. On the other hand, if the script mixes both kind of
1122 timestamps, then the NOW reference for relative timestamps will be
1123 taken from the current time of day at the time the script is read, and
1124 the script layout will be frozen according to that reference. That
1125 means that if the script is directly played, the actual times will
1126 match the absolute timestamps up to the sound controller's clock
1127 accuracy, but if the user somehow pauses the playback or seeks, all
1128 times will be shifted accordingly.
1129
1130 tedcaptions
1131 JSON captions used for <http://www.ted.com/>.
1132
1133 TED does not provide links to the captions, but they can be guessed
1134 from the page. The file tools/bookmarklets.html from the FFmpeg source
1135 tree contains a bookmarklet to expose them.
1136
1137 This demuxer accepts the following option:
1138
1139 start_time
1140 Set the start time of the TED talk, in milliseconds. The default is
1141 15000 (15s). It is used to sync the captions with the downloadable
1142 videos, because they include a 15s intro.
1143
1144 Example: convert the captions to a format most players understand:
1145
1146 ffmpeg -i http://www.ted.com/talks/subtitles/id/1/lang/en talk1-en.srt
1147
1148 vapoursynth
1149 Vapoursynth wrapper.
1150
1151 Due to security concerns, Vapoursynth scripts will not be autodetected
1152 so the input format has to be forced. For ff* CLI tools, add "-f
1153 vapoursynth" before the input "-i yourscript.vpy".
1154
1155 This demuxer accepts the following option:
1156
1157 max_script_size
1158 The demuxer buffers the entire script into memory. Adjust this
1159 value to set the maximum buffer size, which in turn, acts as a
1160 ceiling for the size of scripts that can be read. Default is 1
1161 MiB.
1162
1164 Muxers are configured elements in FFmpeg which allow writing multimedia
1165 streams to a particular type of file.
1166
1167 When you configure your FFmpeg build, all the supported muxers are
1168 enabled by default. You can list all available muxers using the
1169 configure option "--list-muxers".
1170
1171 You can disable all the muxers with the configure option
1172 "--disable-muxers" and selectively enable / disable single muxers with
1173 the options "--enable-muxer=MUXER" / "--disable-muxer=MUXER".
1174
1175 The option "-muxers" of the ff* tools will display the list of enabled
1176 muxers. Use "-formats" to view a combined list of enabled demuxers and
1177 muxers.
1178
1179 A description of some of the currently available muxers follows.
1180
1181 a64
1182 A64 muxer for Commodore 64 video. Accepts a single "a64_multi" or
1183 "a64_multi5" codec video stream.
1184
1185 adts
1186 Audio Data Transport Stream muxer. It accepts a single AAC stream.
1187
1188 Options
1189
1190 It accepts the following options:
1191
1192 write_id3v2 bool
1193 Enable to write ID3v2.4 tags at the start of the stream. Default is
1194 disabled.
1195
1196 write_apetag bool
1197 Enable to write APE tags at the end of the stream. Default is
1198 disabled.
1199
1200 write_mpeg2 bool
1201 Enable to set MPEG version bit in the ADTS frame header to 1 which
1202 indicates MPEG-2. Default is 0, which indicates MPEG-4.
1203
1204 aiff
1205 Audio Interchange File Format muxer.
1206
1207 Options
1208
1209 It accepts the following options:
1210
1211 write_id3v2
1212 Enable ID3v2 tags writing when set to 1. Default is 0 (disabled).
1213
1214 id3v2_version
1215 Select ID3v2 version to write. Currently only version 3 and 4 (aka.
1216 ID3v2.3 and ID3v2.4) are supported. The default is version 4.
1217
1218 alp
1219 Muxer for audio of High Voltage Software's Lego Racers game. It accepts
1220 a single ADPCM_IMA_ALP stream with no more than 2 channels nor a sample
1221 rate greater than 44100 Hz.
1222
1223 Extensions: tun, pcm
1224
1225 Options
1226
1227 It accepts the following options:
1228
1229 type type
1230 Set file type.
1231
1232 tun Set file type as music. Must have a sample rate of 22050 Hz.
1233
1234 pcm Set file type as sfx.
1235
1236 auto
1237 Set file type as per output file extension. ".pcm" results in
1238 type "pcm" else type "tun" is set. (default)
1239
1240 asf
1241 Advanced Systems Format muxer.
1242
1243 Note that Windows Media Audio (wma) and Windows Media Video (wmv) use
1244 this muxer too.
1245
1246 Options
1247
1248 It accepts the following options:
1249
1250 packet_size
1251 Set the muxer packet size. By tuning this setting you may reduce
1252 data fragmentation or muxer overhead depending on your source.
1253 Default value is 3200, minimum is 100, maximum is 64k.
1254
1255 avi
1256 Audio Video Interleaved muxer.
1257
1258 Options
1259
1260 It accepts the following options:
1261
1262 reserve_index_space
1263 Reserve the specified amount of bytes for the OpenDML master index
1264 of each stream within the file header. By default additional master
1265 indexes are embedded within the data packets if there is no space
1266 left in the first master index and are linked together as a chain
1267 of indexes. This index structure can cause problems for some use
1268 cases, e.g. third-party software strictly relying on the OpenDML
1269 index specification or when file seeking is slow. Reserving enough
1270 index space in the file header avoids these problems.
1271
1272 The required index space depends on the output file size and should
1273 be about 16 bytes per gigabyte. When this option is omitted or set
1274 to zero the necessary index space is guessed.
1275
1276 write_channel_mask
1277 Write the channel layout mask into the audio stream header.
1278
1279 This option is enabled by default. Disabling the channel mask can
1280 be useful in specific scenarios, e.g. when merging multiple audio
1281 streams into one for compatibility with software that only supports
1282 a single audio stream in AVI (see the "amerge" section in the
1283 ffmpeg-filters manual).
1284
1285 flipped_raw_rgb
1286 If set to true, store positive height for raw RGB bitmaps, which
1287 indicates bitmap is stored bottom-up. Note that this option does
1288 not flip the bitmap which has to be done manually beforehand, e.g.
1289 by using the vflip filter. Default is false and indicates bitmap
1290 is stored top down.
1291
1292 chromaprint
1293 Chromaprint fingerprinter.
1294
1295 This muxer feeds audio data to the Chromaprint library, which generates
1296 a fingerprint for the provided audio data. See
1297 <https://acoustid.org/chromaprint>
1298
1299 It takes a single signed native-endian 16-bit raw audio stream of at
1300 most 2 channels.
1301
1302 Options
1303
1304 silence_threshold
1305 Threshold for detecting silence. Range is from -1 to 32767, where
1306 -1 disables silence detection. Silence detection can only be used
1307 with version 3 of the algorithm. Silence detection must be
1308 disabled for use with the AcoustID service. Default is -1.
1309
1310 algorithm
1311 Version of algorithm to fingerprint with. Range is 0 to 4. Version
1312 3 enables silence detection. Default is 1.
1313
1314 fp_format
1315 Format to output the fingerprint as. Accepts the following options:
1316
1317 raw Binary raw fingerprint
1318
1319 compressed
1320 Binary compressed fingerprint
1321
1322 base64
1323 Base64 compressed fingerprint (default)
1324
1325 crc
1326 CRC (Cyclic Redundancy Check) testing format.
1327
1328 This muxer computes and prints the Adler-32 CRC of all the input audio
1329 and video frames. By default audio frames are converted to signed
1330 16-bit raw audio and video frames to raw video before computing the
1331 CRC.
1332
1333 The output of the muxer consists of a single line of the form:
1334 CRC=0xCRC, where CRC is a hexadecimal number 0-padded to 8 digits
1335 containing the CRC for all the decoded input frames.
1336
1337 See also the framecrc muxer.
1338
1339 Examples
1340
1341 For example to compute the CRC of the input, and store it in the file
1342 out.crc:
1343
1344 ffmpeg -i INPUT -f crc out.crc
1345
1346 You can print the CRC to stdout with the command:
1347
1348 ffmpeg -i INPUT -f crc -
1349
1350 You can select the output format of each frame with ffmpeg by
1351 specifying the audio and video codec and format. For example to compute
1352 the CRC of the input audio converted to PCM unsigned 8-bit and the
1353 input video converted to MPEG-2 video, use the command:
1354
1355 ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f crc -
1356
1357 dash
1358 Dynamic Adaptive Streaming over HTTP (DASH) muxer that creates segments
1359 and manifest files according to the MPEG-DASH standard ISO/IEC
1360 23009-1:2014.
1361
1362 For more information see:
1363
1364 • ISO DASH Specification:
1365 <http://standards.iso.org/ittf/PubliclyAvailableStandards/c065274_ISO_IEC_23009-1_2014.zip>
1366
1367 • WebM DASH Specification:
1368 <https://sites.google.com/a/webmproject.org/wiki/adaptive-streaming/webm-dash-specification>
1369
1370 It creates a MPD manifest file and segment files for each stream.
1371
1372 The segment filename might contain pre-defined identifiers used with
1373 SegmentTemplate as defined in section 5.3.9.4.4 of the standard.
1374 Available identifiers are "$RepresentationID$", "$Number$",
1375 "$Bandwidth$" and "$Time$". In addition to the standard identifiers,
1376 an ffmpeg-specific "$ext$" identifier is also supported. When
1377 specified ffmpeg will replace $ext$ in the file name with muxing
1378 format's extensions such as mp4, webm etc.,
1379
1380 ffmpeg -re -i <input> -map 0 -map 0 -c:a libfdk_aac -c:v libx264 \
1381 -b:v:0 800k -b:v:1 300k -s:v:1 320x170 -profile:v:1 baseline \
1382 -profile:v:0 main -bf 1 -keyint_min 120 -g 120 -sc_threshold 0 \
1383 -b_strategy 0 -ar:a:1 22050 -use_timeline 1 -use_template 1 \
1384 -window_size 5 -adaptation_sets "id=0,streams=v id=1,streams=a" \
1385 -f dash /path/to/out.mpd
1386
1387 seg_duration duration
1388 Set the segment length in seconds (fractional value can be set).
1389 The value is treated as average segment duration when use_template
1390 is enabled and use_timeline is disabled and as minimum segment
1391 duration for all the other use cases.
1392
1393 frag_duration duration
1394 Set the length in seconds of fragments within segments (fractional
1395 value can be set).
1396
1397 frag_type type
1398 Set the type of interval for fragmentation.
1399
1400 window_size size
1401 Set the maximum number of segments kept in the manifest.
1402
1403 extra_window_size size
1404 Set the maximum number of segments kept outside of the manifest
1405 before removing from disk.
1406
1407 remove_at_exit remove
1408 Enable (1) or disable (0) removal of all segments when finished.
1409
1410 use_template template
1411 Enable (1) or disable (0) use of SegmentTemplate instead of
1412 SegmentList.
1413
1414 use_timeline timeline
1415 Enable (1) or disable (0) use of SegmentTimeline in
1416 SegmentTemplate.
1417
1418 single_file single_file
1419 Enable (1) or disable (0) storing all segments in one file,
1420 accessed using byte ranges.
1421
1422 single_file_name file_name
1423 DASH-templated name to be used for baseURL. Implies single_file set
1424 to "1". In the template, "$ext$" is replaced with the file name
1425 extension specific for the segment format.
1426
1427 init_seg_name init_name
1428 DASH-templated name to used for the initialization segment. Default
1429 is "init-stream$RepresentationID$.$ext$". "$ext$" is replaced with
1430 the file name extension specific for the segment format.
1431
1432 media_seg_name segment_name
1433 DASH-templated name to used for the media segments. Default is
1434 "chunk-stream$RepresentationID$-$Number%05d$.$ext$". "$ext$" is
1435 replaced with the file name extension specific for the segment
1436 format.
1437
1438 utc_timing_url utc_url
1439 URL of the page that will return the UTC timestamp in ISO format.
1440 Example: "https://time.akamai.com/?iso"
1441
1442 method method
1443 Use the given HTTP method to create output files. Generally set to
1444 PUT or POST.
1445
1446 http_user_agent user_agent
1447 Override User-Agent field in HTTP header. Applicable only for HTTP
1448 output.
1449
1450 http_persistent http_persistent
1451 Use persistent HTTP connections. Applicable only for HTTP output.
1452
1453 hls_playlist hls_playlist
1454 Generate HLS playlist files as well. The master playlist is
1455 generated with the filename hls_master_name. One media playlist
1456 file is generated for each stream with filenames media_0.m3u8,
1457 media_1.m3u8, etc.
1458
1459 hls_master_name file_name
1460 HLS master playlist name. Default is "master.m3u8".
1461
1462 streaming streaming
1463 Enable (1) or disable (0) chunk streaming mode of output. In chunk
1464 streaming mode, each frame will be a moof fragment which forms a
1465 chunk.
1466
1467 adaptation_sets adaptation_sets
1468 Assign streams to AdaptationSets. Syntax is "id=x,streams=a,b,c
1469 id=y,streams=d,e" with x and y being the IDs of the adaptation sets
1470 and a,b,c,d and e are the indices of the mapped streams.
1471
1472 To map all video (or audio) streams to an AdaptationSet, "v" (or
1473 "a") can be used as stream identifier instead of IDs.
1474
1475 When no assignment is defined, this defaults to an AdaptationSet
1476 for each stream.
1477
1478 Optional syntax is
1479 "id=x,seg_duration=x,frag_duration=x,frag_type=type,descriptor=descriptor_string,streams=a,b,c
1480 id=y,seg_duration=y,frag_type=type,streams=d,e" and so on,
1481 descriptor is useful to the scheme defined by ISO/IEC
1482 23009-1:2014/Amd.2:2015. For example, -adaptation_sets
1483 "id=0,descriptor=<SupplementalProperty
1484 schemeIdUri=\"urn:mpeg:dash:srd:2014\"
1485 value=\"0,0,0,1,1,2,2\"/>,streams=v". Please note that descriptor
1486 string should be a self-closing xml tag. seg_duration,
1487 frag_duration and frag_type override the global option values for
1488 each adaptation set. For example, -adaptation_sets
1489 "id=0,seg_duration=2,frag_duration=1,frag_type=duration,streams=v
1490 id=1,seg_duration=2,frag_type=none,streams=a" type_id marks an
1491 adaptation set as containing streams meant to be used for Trick
1492 Mode for the referenced adaptation set. For example,
1493 -adaptation_sets "id=0,seg_duration=2,frag_type=none,streams=0
1494 id=1,seg_duration=10,frag_type=none,trick_id=0,streams=1"
1495
1496 timeout timeout
1497 Set timeout for socket I/O operations. Applicable only for HTTP
1498 output.
1499
1500 index_correction index_correction
1501 Enable (1) or Disable (0) segment index correction logic.
1502 Applicable only when use_template is enabled and use_timeline is
1503 disabled.
1504
1505 When enabled, the logic monitors the flow of segment indexes. If a
1506 streams's segment index value is not at the expected real time
1507 position, then the logic corrects that index value.
1508
1509 Typically this logic is needed in live streaming use cases. The
1510 network bandwidth fluctuations are common during long run
1511 streaming. Each fluctuation can cause the segment indexes fall
1512 behind the expected real time position.
1513
1514 format_options options_list
1515 Set container format (mp4/webm) options using a ":" separated list
1516 of key=value parameters. Values containing ":" special characters
1517 must be escaped.
1518
1519 global_sidx global_sidx
1520 Write global SIDX atom. Applicable only for single file, mp4
1521 output, non-streaming mode.
1522
1523 dash_segment_type dash_segment_type
1524 Possible values:
1525
1526 auto
1527 If this flag is set, the dash segment files format will be
1528 selected based on the stream codec. This is the default mode.
1529
1530 mp4 If this flag is set, the dash segment files will be in in
1531 ISOBMFF format.
1532
1533 webm
1534 If this flag is set, the dash segment files will be in in WebM
1535 format.
1536
1537 ignore_io_errors ignore_io_errors
1538 Ignore IO errors during open and write. Useful for long-duration
1539 runs with network output.
1540
1541 lhls lhls
1542 Enable Low-latency HLS(LHLS). Adds #EXT-X-PREFETCH tag with current
1543 segment's URI. hls.js player folks are trying to standardize an
1544 open LHLS spec. The draft spec is available in
1545 https://github.com/video-dev/hlsjs-rfcs/blob/lhls-spec/proposals/0001-lhls.md
1546 This option tries to comply with the above open spec. It enables
1547 streaming and hls_playlist options automatically. This is an
1548 experimental feature.
1549
1550 Note: This is not Apple's version LHLS. See
1551 <https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis>
1552
1553 ldash ldash
1554 Enable Low-latency Dash by constraining the presence and values of
1555 some elements.
1556
1557 master_m3u8_publish_rate master_m3u8_publish_rate
1558 Publish master playlist repeatedly every after specified number of
1559 segment intervals.
1560
1561 write_prft write_prft
1562 Write Producer Reference Time elements on supported streams. This
1563 also enables writing prft boxes in the underlying muxer. Applicable
1564 only when the utc_url option is enabled. It's set to auto by
1565 default, in which case the muxer will attempt to enable it only in
1566 modes that require it.
1567
1568 mpd_profile mpd_profile
1569 Set one or more manifest profiles.
1570
1571 http_opts http_opts
1572 A :-separated list of key=value options to pass to the underlying
1573 HTTP protocol. Applicable only for HTTP output.
1574
1575 target_latency target_latency
1576 Set an intended target latency in seconds (fractional value can be
1577 set) for serving. Applicable only when streaming and write_prft
1578 options are enabled. This is an informative fields clients can use
1579 to measure the latency of the service.
1580
1581 min_playback_rate min_playback_rate
1582 Set the minimum playback rate indicated as appropriate for the
1583 purposes of automatically adjusting playback latency and buffer
1584 occupancy during normal playback by clients.
1585
1586 max_playback_rate max_playback_rate
1587 Set the maximum playback rate indicated as appropriate for the
1588 purposes of automatically adjusting playback latency and buffer
1589 occupancy during normal playback by clients.
1590
1591 update_period update_period
1592 Set the mpd update period ,for dynamic content.
1593 The unit is second.
1594
1595 fifo
1596 The fifo pseudo-muxer allows the separation of encoding and muxing by
1597 using first-in-first-out queue and running the actual muxer in a
1598 separate thread. This is especially useful in combination with the tee
1599 muxer and can be used to send data to several destinations with
1600 different reliability/writing speed/latency.
1601
1602 API users should be aware that callback functions (interrupt_callback,
1603 io_open and io_close) used within its AVFormatContext must be thread-
1604 safe.
1605
1606 The behavior of the fifo muxer if the queue fills up or if the output
1607 fails is selectable,
1608
1609 • output can be transparently restarted with configurable delay
1610 between retries based on real time or time of the processed stream.
1611
1612 • encoding can be blocked during temporary failure, or continue
1613 transparently dropping packets in case fifo queue fills up.
1614
1615 fifo_format
1616 Specify the format name. Useful if it cannot be guessed from the
1617 output name suffix.
1618
1619 queue_size
1620 Specify size of the queue (number of packets). Default value is 60.
1621
1622 format_opts
1623 Specify format options for the underlying muxer. Muxer options can
1624 be specified as a list of key=value pairs separated by ':'.
1625
1626 drop_pkts_on_overflow bool
1627 If set to 1 (true), in case the fifo queue fills up, packets will
1628 be dropped rather than blocking the encoder. This makes it possible
1629 to continue streaming without delaying the input, at the cost of
1630 omitting part of the stream. By default this option is set to 0
1631 (false), so in such cases the encoder will be blocked until the
1632 muxer processes some of the packets and none of them is lost.
1633
1634 attempt_recovery bool
1635 If failure occurs, attempt to recover the output. This is
1636 especially useful when used with network output, since it makes it
1637 possible to restart streaming transparently. By default this
1638 option is set to 0 (false).
1639
1640 max_recovery_attempts
1641 Sets maximum number of successive unsuccessful recovery attempts
1642 after which the output fails permanently. By default this option is
1643 set to 0 (unlimited).
1644
1645 recovery_wait_time duration
1646 Waiting time before the next recovery attempt after previous
1647 unsuccessful recovery attempt. Default value is 5 seconds.
1648
1649 recovery_wait_streamtime bool
1650 If set to 0 (false), the real time is used when waiting for the
1651 recovery attempt (i.e. the recovery will be attempted after at
1652 least recovery_wait_time seconds). If set to 1 (true), the time of
1653 the processed stream is taken into account instead (i.e. the
1654 recovery will be attempted after at least recovery_wait_time
1655 seconds of the stream is omitted). By default, this option is set
1656 to 0 (false).
1657
1658 recover_any_error bool
1659 If set to 1 (true), recovery will be attempted regardless of type
1660 of the error causing the failure. By default this option is set to
1661 0 (false) and in case of certain (usually permanent) errors the
1662 recovery is not attempted even when attempt_recovery is set to 1.
1663
1664 restart_with_keyframe bool
1665 Specify whether to wait for the keyframe after recovering from
1666 queue overflow or failure. This option is set to 0 (false) by
1667 default.
1668
1669 timeshift duration
1670 Buffer the specified amount of packets and delay writing the
1671 output. Note that queue_size must be big enough to store the
1672 packets for timeshift. At the end of the input the fifo buffer is
1673 flushed at realtime speed.
1674
1675 Examples
1676
1677 • Stream something to rtmp server, continue processing the stream at
1678 real-time rate even in case of temporary failure (network outage)
1679 and attempt to recover streaming every second indefinitely.
1680
1681 ffmpeg -re -i ... -c:v libx264 -c:a aac -f fifo -fifo_format flv -map 0:v -map 0:a
1682 -drop_pkts_on_overflow 1 -attempt_recovery 1 -recovery_wait_time 1 rtmp://example.com/live/stream_name
1683
1684 flv
1685 Adobe Flash Video Format muxer.
1686
1687 This muxer accepts the following options:
1688
1689 flvflags flags
1690 Possible values:
1691
1692 aac_seq_header_detect
1693 Place AAC sequence header based on audio stream data.
1694
1695 no_sequence_end
1696 Disable sequence end tag.
1697
1698 no_metadata
1699 Disable metadata tag.
1700
1701 no_duration_filesize
1702 Disable duration and filesize in metadata when they are equal
1703 to zero at the end of stream. (Be used to non-seekable living
1704 stream).
1705
1706 add_keyframe_index
1707 Used to facilitate seeking; particularly for HTTP pseudo
1708 streaming.
1709
1710 framecrc
1711 Per-packet CRC (Cyclic Redundancy Check) testing format.
1712
1713 This muxer computes and prints the Adler-32 CRC for each audio and
1714 video packet. By default audio frames are converted to signed 16-bit
1715 raw audio and video frames to raw video before computing the CRC.
1716
1717 The output of the muxer consists of a line for each audio and video
1718 packet of the form:
1719
1720 <stream_index>, <packet_dts>, <packet_pts>, <packet_duration>, <packet_size>, 0x<CRC>
1721
1722 CRC is a hexadecimal number 0-padded to 8 digits containing the CRC of
1723 the packet.
1724
1725 Examples
1726
1727 For example to compute the CRC of the audio and video frames in INPUT,
1728 converted to raw audio and video packets, and store it in the file
1729 out.crc:
1730
1731 ffmpeg -i INPUT -f framecrc out.crc
1732
1733 To print the information to stdout, use the command:
1734
1735 ffmpeg -i INPUT -f framecrc -
1736
1737 With ffmpeg, you can select the output format to which the audio and
1738 video frames are encoded before computing the CRC for each packet by
1739 specifying the audio and video codec. For example, to compute the CRC
1740 of each decoded input audio frame converted to PCM unsigned 8-bit and
1741 of each decoded input video frame converted to MPEG-2 video, use the
1742 command:
1743
1744 ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f framecrc -
1745
1746 See also the crc muxer.
1747
1748 framehash
1749 Per-packet hash testing format.
1750
1751 This muxer computes and prints a cryptographic hash for each audio and
1752 video packet. This can be used for packet-by-packet equality checks
1753 without having to individually do a binary comparison on each.
1754
1755 By default audio frames are converted to signed 16-bit raw audio and
1756 video frames to raw video before computing the hash, but the output of
1757 explicit conversions to other codecs can also be used. It uses the
1758 SHA-256 cryptographic hash function by default, but supports several
1759 other algorithms.
1760
1761 The output of the muxer consists of a line for each audio and video
1762 packet of the form:
1763
1764 <stream_index>, <packet_dts>, <packet_pts>, <packet_duration>, <packet_size>, <hash>
1765
1766 hash is a hexadecimal number representing the computed hash for the
1767 packet.
1768
1769 hash algorithm
1770 Use the cryptographic hash function specified by the string
1771 algorithm. Supported values include "MD5", "murmur3", "RIPEMD128",
1772 "RIPEMD160", "RIPEMD256", "RIPEMD320", "SHA160", "SHA224", "SHA256"
1773 (default), "SHA512/224", "SHA512/256", "SHA384", "SHA512", "CRC32"
1774 and "adler32".
1775
1776 Examples
1777
1778 To compute the SHA-256 hash of the audio and video frames in INPUT,
1779 converted to raw audio and video packets, and store it in the file
1780 out.sha256:
1781
1782 ffmpeg -i INPUT -f framehash out.sha256
1783
1784 To print the information to stdout, using the MD5 hash function, use
1785 the command:
1786
1787 ffmpeg -i INPUT -f framehash -hash md5 -
1788
1789 See also the hash muxer.
1790
1791 framemd5
1792 Per-packet MD5 testing format.
1793
1794 This is a variant of the framehash muxer. Unlike that muxer, it
1795 defaults to using the MD5 hash function.
1796
1797 Examples
1798
1799 To compute the MD5 hash of the audio and video frames in INPUT,
1800 converted to raw audio and video packets, and store it in the file
1801 out.md5:
1802
1803 ffmpeg -i INPUT -f framemd5 out.md5
1804
1805 To print the information to stdout, use the command:
1806
1807 ffmpeg -i INPUT -f framemd5 -
1808
1809 See also the framehash and md5 muxers.
1810
1811 gif
1812 Animated GIF muxer.
1813
1814 It accepts the following options:
1815
1816 loop
1817 Set the number of times to loop the output. Use "-1" for no loop, 0
1818 for looping indefinitely (default).
1819
1820 final_delay
1821 Force the delay (expressed in centiseconds) after the last frame.
1822 Each frame ends with a delay until the next frame. The default is
1823 "-1", which is a special value to tell the muxer to re-use the
1824 previous delay. In case of a loop, you might want to customize this
1825 value to mark a pause for instance.
1826
1827 For example, to encode a gif looping 10 times, with a 5 seconds delay
1828 between the loops:
1829
1830 ffmpeg -i INPUT -loop 10 -final_delay 500 out.gif
1831
1832 Note 1: if you wish to extract the frames into separate GIF files, you
1833 need to force the image2 muxer:
1834
1835 ffmpeg -i INPUT -c:v gif -f image2 "out%d.gif"
1836
1837 Note 2: the GIF format has a very large time base: the delay between
1838 two frames can therefore not be smaller than one centi second.
1839
1840 hash
1841 Hash testing format.
1842
1843 This muxer computes and prints a cryptographic hash of all the input
1844 audio and video frames. This can be used for equality checks without
1845 having to do a complete binary comparison.
1846
1847 By default audio frames are converted to signed 16-bit raw audio and
1848 video frames to raw video before computing the hash, but the output of
1849 explicit conversions to other codecs can also be used. Timestamps are
1850 ignored. It uses the SHA-256 cryptographic hash function by default,
1851 but supports several other algorithms.
1852
1853 The output of the muxer consists of a single line of the form:
1854 algo=hash, where algo is a short string representing the hash function
1855 used, and hash is a hexadecimal number representing the computed hash.
1856
1857 hash algorithm
1858 Use the cryptographic hash function specified by the string
1859 algorithm. Supported values include "MD5", "murmur3", "RIPEMD128",
1860 "RIPEMD160", "RIPEMD256", "RIPEMD320", "SHA160", "SHA224", "SHA256"
1861 (default), "SHA512/224", "SHA512/256", "SHA384", "SHA512", "CRC32"
1862 and "adler32".
1863
1864 Examples
1865
1866 To compute the SHA-256 hash of the input converted to raw audio and
1867 video, and store it in the file out.sha256:
1868
1869 ffmpeg -i INPUT -f hash out.sha256
1870
1871 To print an MD5 hash to stdout use the command:
1872
1873 ffmpeg -i INPUT -f hash -hash md5 -
1874
1875 See also the framehash muxer.
1876
1877 hls
1878 Apple HTTP Live Streaming muxer that segments MPEG-TS according to the
1879 HTTP Live Streaming (HLS) specification.
1880
1881 It creates a playlist file, and one or more segment files. The output
1882 filename specifies the playlist filename.
1883
1884 By default, the muxer creates a file for each segment produced. These
1885 files have the same name as the playlist, followed by a sequential
1886 number and a .ts extension.
1887
1888 Make sure to require a closed GOP when encoding and to set the GOP size
1889 to fit your segment time constraint.
1890
1891 For example, to convert an input file with ffmpeg:
1892
1893 ffmpeg -i in.mkv -c:v h264 -flags +cgop -g 30 -hls_time 1 out.m3u8
1894
1895 This example will produce the playlist, out.m3u8, and segment files:
1896 out0.ts, out1.ts, out2.ts, etc.
1897
1898 See also the segment muxer, which provides a more generic and flexible
1899 implementation of a segmenter, and can be used to perform HLS
1900 segmentation.
1901
1902 Options
1903
1904 This muxer supports the following options:
1905
1906 hls_init_time duration
1907 Set the initial target segment length. Default value is 0.
1908
1909 duration must be a time duration specification, see the Time
1910 duration section in the ffmpeg-utils(1) manual.
1911
1912 Segment will be cut on the next key frame after this time has
1913 passed on the first m3u8 list. After the initial playlist is
1914 filled ffmpeg will cut segments at duration equal to "hls_time"
1915
1916 hls_time duration
1917 Set the target segment length. Default value is 2.
1918
1919 duration must be a time duration specification, see the Time
1920 duration section in the ffmpeg-utils(1) manual. Segment will be
1921 cut on the next key frame after this time has passed.
1922
1923 hls_list_size size
1924 Set the maximum number of playlist entries. If set to 0 the list
1925 file will contain all the segments. Default value is 5.
1926
1927 hls_delete_threshold size
1928 Set the number of unreferenced segments to keep on disk before
1929 "hls_flags delete_segments" deletes them. Increase this to allow
1930 continue clients to download segments which were recently
1931 referenced in the playlist. Default value is 1, meaning segments
1932 older than "hls_list_size+1" will be deleted.
1933
1934 hls_ts_options options_list
1935 Set output format options using a :-separated list of key=value
1936 parameters. Values containing ":" special characters must be
1937 escaped. "hls_ts_options" is deprecated, use hls_segment_options
1938 instead of it..
1939
1940 hls_start_number_source
1941 Start the playlist sequence number ("#EXT-X-MEDIA-SEQUENCE")
1942 according to the specified source. Unless "hls_flags single_file"
1943 is set, it also specifies source of starting sequence numbers of
1944 segment and subtitle filenames. In any case, if "hls_flags
1945 append_list" is set and read playlist sequence number is greater
1946 than the specified start sequence number, then that value will be
1947 used as start value.
1948
1949 It accepts the following values:
1950
1951 generic (default)
1952 Set the starting sequence numbers according to start_number
1953 option value.
1954
1955 epoch
1956 The start number will be the seconds since epoch (1970-01-01
1957 00:00:00)
1958
1959 epoch_us
1960 The start number will be the microseconds since epoch
1961 (1970-01-01 00:00:00)
1962
1963 datetime
1964 The start number will be based on the current date/time as
1965 YYYYmmddHHMMSS. e.g. 20161231235759.
1966
1967 start_number number
1968 Start the playlist sequence number ("#EXT-X-MEDIA-SEQUENCE") from
1969 the specified number when hls_start_number_source value is generic.
1970 (This is the default case.) Unless "hls_flags single_file" is set,
1971 it also specifies starting sequence numbers of segment and subtitle
1972 filenames. Default value is 0.
1973
1974 hls_allow_cache allowcache
1975 Explicitly set whether the client MAY (1) or MUST NOT (0) cache
1976 media segments.
1977
1978 hls_base_url baseurl
1979 Append baseurl to every entry in the playlist. Useful to generate
1980 playlists with absolute paths.
1981
1982 Note that the playlist sequence number must be unique for each
1983 segment and it is not to be confused with the segment filename
1984 sequence number which can be cyclic, for example if the wrap option
1985 is specified.
1986
1987 hls_segment_filename filename
1988 Set the segment filename. Unless "hls_flags single_file" is set,
1989 filename is used as a string format with the segment number:
1990
1991 ffmpeg -i in.nut -hls_segment_filename 'file%03d.ts' out.m3u8
1992
1993 This example will produce the playlist, out.m3u8, and segment
1994 files: file000.ts, file001.ts, file002.ts, etc.
1995
1996 filename may contain full path or relative path specification, but
1997 only the file name part without any path info will be contained in
1998 the m3u8 segment list. Should a relative path be specified, the
1999 path of the created segment files will be relative to the current
2000 working directory. When strftime_mkdir is set, the whole expanded
2001 value of filename will be written into the m3u8 segment list.
2002
2003 When "var_stream_map" is set with two or more variant streams, the
2004 filename pattern must contain the string "%v", this string
2005 specifies the position of variant stream index in the generated
2006 segment file names.
2007
2008 ffmpeg -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
2009 -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map "v:0,a:0 v:1,a:1" \
2010 -hls_segment_filename 'file_%v_%03d.ts' out_%v.m3u8
2011
2012 This example will produce the playlists segment file sets:
2013 file_0_000.ts, file_0_001.ts, file_0_002.ts, etc. and
2014 file_1_000.ts, file_1_001.ts, file_1_002.ts, etc.
2015
2016 The string "%v" may be present in the filename or in the last
2017 directory name containing the file, but only in one of them.
2018 (Additionally, %v may appear multiple times in the last sub-
2019 directory or filename.) If the string %v is present in the
2020 directory name, then sub-directories are created after expanding
2021 the directory name pattern. This enables creation of segments
2022 corresponding to different variant streams in subdirectories.
2023
2024 ffmpeg -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
2025 -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map "v:0,a:0 v:1,a:1" \
2026 -hls_segment_filename 'vs%v/file_%03d.ts' vs%v/out.m3u8
2027
2028 This example will produce the playlists segment file sets:
2029 vs0/file_000.ts, vs0/file_001.ts, vs0/file_002.ts, etc. and
2030 vs1/file_000.ts, vs1/file_001.ts, vs1/file_002.ts, etc.
2031
2032 strftime
2033 Use strftime() on filename to expand the segment filename with
2034 localtime. The segment number is also available in this mode, but
2035 to use it, you need to specify second_level_segment_index hls_flag
2036 and %%d will be the specifier.
2037
2038 ffmpeg -i in.nut -strftime 1 -hls_segment_filename 'file-%Y%m%d-%s.ts' out.m3u8
2039
2040 This example will produce the playlist, out.m3u8, and segment
2041 files: file-20160215-1455569023.ts, file-20160215-1455569024.ts,
2042 etc. Note: On some systems/environments, the %s specifier is not
2043 available. See
2044 "strftime()" documentation.
2045
2046 ffmpeg -i in.nut -strftime 1 -hls_flags second_level_segment_index -hls_segment_filename 'file-%Y%m%d-%%04d.ts' out.m3u8
2047
2048 This example will produce the playlist, out.m3u8, and segment
2049 files: file-20160215-0001.ts, file-20160215-0002.ts, etc.
2050
2051 strftime_mkdir
2052 Used together with -strftime_mkdir, it will create all
2053 subdirectories which is expanded in filename.
2054
2055 ffmpeg -i in.nut -strftime 1 -strftime_mkdir 1 -hls_segment_filename '%Y%m%d/file-%Y%m%d-%s.ts' out.m3u8
2056
2057 This example will create a directory 201560215 (if it does not
2058 exist), and then produce the playlist, out.m3u8, and segment files:
2059 20160215/file-20160215-1455569023.ts,
2060 20160215/file-20160215-1455569024.ts, etc.
2061
2062 ffmpeg -i in.nut -strftime 1 -strftime_mkdir 1 -hls_segment_filename '%Y/%m/%d/file-%Y%m%d-%s.ts' out.m3u8
2063
2064 This example will create a directory hierarchy 2016/02/15 (if any
2065 of them do not exist), and then produce the playlist, out.m3u8, and
2066 segment files: 2016/02/15/file-20160215-1455569023.ts,
2067 2016/02/15/file-20160215-1455569024.ts, etc.
2068
2069 hls_segment_options options_list
2070 Set output format options using a :-separated list of key=value
2071 parameters. Values containing ":" special characters must be
2072 escaped.
2073
2074 hls_key_info_file key_info_file
2075 Use the information in key_info_file for segment encryption. The
2076 first line of key_info_file specifies the key URI written to the
2077 playlist. The key URL is used to access the encryption key during
2078 playback. The second line specifies the path to the key file used
2079 to obtain the key during the encryption process. The key file is
2080 read as a single packed array of 16 octets in binary format. The
2081 optional third line specifies the initialization vector (IV) as a
2082 hexadecimal string to be used instead of the segment sequence
2083 number (default) for encryption. Changes to key_info_file will
2084 result in segment encryption with the new key/IV and an entry in
2085 the playlist for the new key URI/IV if "hls_flags periodic_rekey"
2086 is enabled.
2087
2088 Key info file format:
2089
2090 <key URI>
2091 <key file path>
2092 <IV> (optional)
2093
2094 Example key URIs:
2095
2096 http://server/file.key
2097 /path/to/file.key
2098 file.key
2099
2100 Example key file paths:
2101
2102 file.key
2103 /path/to/file.key
2104
2105 Example IV:
2106
2107 0123456789ABCDEF0123456789ABCDEF
2108
2109 Key info file example:
2110
2111 http://server/file.key
2112 /path/to/file.key
2113 0123456789ABCDEF0123456789ABCDEF
2114
2115 Example shell script:
2116
2117 #!/bin/sh
2118 BASE_URL=${1:-'.'}
2119 openssl rand 16 > file.key
2120 echo $BASE_URL/file.key > file.keyinfo
2121 echo file.key >> file.keyinfo
2122 echo $(openssl rand -hex 16) >> file.keyinfo
2123 ffmpeg -f lavfi -re -i testsrc -c:v h264 -hls_flags delete_segments \
2124 -hls_key_info_file file.keyinfo out.m3u8
2125
2126 -hls_enc enc
2127 Enable (1) or disable (0) the AES128 encryption. When enabled
2128 every segment generated is encrypted and the encryption key is
2129 saved as playlist name.key.
2130
2131 -hls_enc_key key
2132 16-octet key to encrypt the segments, by default it is randomly
2133 generated.
2134
2135 -hls_enc_key_url keyurl
2136 If set, keyurl is prepended instead of baseurl to the key filename
2137 in the playlist.
2138
2139 -hls_enc_iv iv
2140 16-octet initialization vector for every segment instead of the
2141 autogenerated ones.
2142
2143 hls_segment_type flags
2144 Possible values:
2145
2146 mpegts
2147 Output segment files in MPEG-2 Transport Stream format. This is
2148 compatible with all HLS versions.
2149
2150 fmp4
2151 Output segment files in fragmented MP4 format, similar to MPEG-
2152 DASH. fmp4 files may be used in HLS version 7 and above.
2153
2154 hls_fmp4_init_filename filename
2155 Set filename to the fragment files header file, default filename is
2156 init.mp4.
2157
2158 Use "-strftime 1" on filename to expand the segment filename with
2159 localtime.
2160
2161 ffmpeg -i in.nut -hls_segment_type fmp4 -strftime 1 -hls_fmp4_init_filename "%s_init.mp4" out.m3u8
2162
2163 This will produce init like this 1602678741_init.mp4
2164
2165 hls_fmp4_init_resend
2166 Resend init file after m3u8 file refresh every time, default is 0.
2167
2168 When "var_stream_map" is set with two or more variant streams, the
2169 filename pattern must contain the string "%v", this string
2170 specifies the position of variant stream index in the generated
2171 init file names. The string "%v" may be present in the filename or
2172 in the last directory name containing the file. If the string is
2173 present in the directory name, then sub-directories are created
2174 after expanding the directory name pattern. This enables creation
2175 of init files corresponding to different variant streams in
2176 subdirectories.
2177
2178 hls_flags flags
2179 Possible values:
2180
2181 single_file
2182 If this flag is set, the muxer will store all segments in a
2183 single MPEG-TS file, and will use byte ranges in the playlist.
2184 HLS playlists generated with this way will have the version
2185 number 4. For example:
2186
2187 ffmpeg -i in.nut -hls_flags single_file out.m3u8
2188
2189 Will produce the playlist, out.m3u8, and a single segment file,
2190 out.ts.
2191
2192 delete_segments
2193 Segment files removed from the playlist are deleted after a
2194 period of time equal to the duration of the segment plus the
2195 duration of the playlist.
2196
2197 append_list
2198 Append new segments into the end of old segment list, and
2199 remove the "#EXT-X-ENDLIST" from the old segment list.
2200
2201 round_durations
2202 Round the duration info in the playlist file segment info to
2203 integer values, instead of using floating point. If there are
2204 no other features requiring higher HLS versions be used, then
2205 this will allow ffmpeg to output a HLS version 2 m3u8.
2206
2207 discont_start
2208 Add the "#EXT-X-DISCONTINUITY" tag to the playlist, before the
2209 first segment's information.
2210
2211 omit_endlist
2212 Do not append the "EXT-X-ENDLIST" tag at the end of the
2213 playlist.
2214
2215 periodic_rekey
2216 The file specified by "hls_key_info_file" will be checked
2217 periodically and detect updates to the encryption info. Be sure
2218 to replace this file atomically, including the file containing
2219 the AES encryption key.
2220
2221 independent_segments
2222 Add the "#EXT-X-INDEPENDENT-SEGMENTS" to playlists that has
2223 video segments and when all the segments of that playlist are
2224 guaranteed to start with a Key frame.
2225
2226 iframes_only
2227 Add the "#EXT-X-I-FRAMES-ONLY" to playlists that has video
2228 segments and can play only I-frames in the "#EXT-X-BYTERANGE"
2229 mode.
2230
2231 split_by_time
2232 Allow segments to start on frames other than keyframes. This
2233 improves behavior on some players when the time between
2234 keyframes is inconsistent, but may make things worse on others,
2235 and can cause some oddities during seeking. This flag should be
2236 used with the "hls_time" option.
2237
2238 program_date_time
2239 Generate "EXT-X-PROGRAM-DATE-TIME" tags.
2240
2241 second_level_segment_index
2242 Makes it possible to use segment indexes as %%d in
2243 hls_segment_filename expression besides date/time values when
2244 strftime is on. To get fixed width numbers with trailing
2245 zeroes, %%0xd format is available where x is the required
2246 width.
2247
2248 second_level_segment_size
2249 Makes it possible to use segment sizes (counted in bytes) as
2250 %%s in hls_segment_filename expression besides date/time values
2251 when strftime is on. To get fixed width numbers with trailing
2252 zeroes, %%0xs format is available where x is the required
2253 width.
2254
2255 second_level_segment_duration
2256 Makes it possible to use segment duration (calculated in
2257 microseconds) as %%t in hls_segment_filename expression besides
2258 date/time values when strftime is on. To get fixed width
2259 numbers with trailing zeroes, %%0xt format is available where x
2260 is the required width.
2261
2262 ffmpeg -i sample.mpeg \
2263 -f hls -hls_time 3 -hls_list_size 5 \
2264 -hls_flags second_level_segment_index+second_level_segment_size+second_level_segment_duration \
2265 -strftime 1 -strftime_mkdir 1 -hls_segment_filename "segment_%Y%m%d%H%M%S_%%04d_%%08s_%%013t.ts" stream.m3u8
2266
2267 This will produce segments like this:
2268 segment_20170102194334_0003_00122200_0000003000000.ts,
2269 segment_20170102194334_0004_00120072_0000003000000.ts etc.
2270
2271 temp_file
2272 Write segment data to filename.tmp and rename to filename only
2273 once the segment is complete. A webserver serving up segments
2274 can be configured to reject requests to *.tmp to prevent access
2275 to in-progress segments before they have been added to the m3u8
2276 playlist. This flag also affects how m3u8 playlist files are
2277 created. If this flag is set, all playlist files will written
2278 into temporary file and renamed after they are complete,
2279 similarly as segments are handled. But playlists with "file"
2280 protocol and with type ("hls_playlist_type") other than "vod"
2281 are always written into temporary file regardless of this flag.
2282 Master playlist files ("master_pl_name"), if any, with "file"
2283 protocol, are always written into temporary file regardless of
2284 this flag if "master_pl_publish_rate" value is other than zero.
2285
2286 hls_playlist_type event
2287 Emit "#EXT-X-PLAYLIST-TYPE:EVENT" in the m3u8 header. Forces
2288 hls_list_size to 0; the playlist can only be appended to.
2289
2290 hls_playlist_type vod
2291 Emit "#EXT-X-PLAYLIST-TYPE:VOD" in the m3u8 header. Forces
2292 hls_list_size to 0; the playlist must not change.
2293
2294 method
2295 Use the given HTTP method to create the hls files.
2296
2297 ffmpeg -re -i in.ts -f hls -method PUT http://example.com/live/out.m3u8
2298
2299 This example will upload all the mpegts segment files to the HTTP
2300 server using the HTTP PUT method, and update the m3u8 files every
2301 "refresh" times using the same method. Note that the HTTP server
2302 must support the given method for uploading files.
2303
2304 http_user_agent
2305 Override User-Agent field in HTTP header. Applicable only for HTTP
2306 output.
2307
2308 var_stream_map
2309 Map string which specifies how to group the audio, video and
2310 subtitle streams into different variant streams. The variant stream
2311 groups are separated by space. Expected string format is like this
2312 "a:0,v:0 a:1,v:1 ....". Here a:, v:, s: are the keys to specify
2313 audio, video and subtitle streams respectively. Allowed values are
2314 0 to 9 (limited just based on practical usage).
2315
2316 When there are two or more variant streams, the output filename
2317 pattern must contain the string "%v", this string specifies the
2318 position of variant stream index in the output media playlist
2319 filenames. The string "%v" may be present in the filename or in the
2320 last directory name containing the file. If the string is present
2321 in the directory name, then sub-directories are created after
2322 expanding the directory name pattern. This enables creation of
2323 variant streams in subdirectories.
2324
2325 ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
2326 -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map "v:0,a:0 v:1,a:1" \
2327 http://example.com/live/out_%v.m3u8
2328
2329 This example creates two hls variant streams. The first variant
2330 stream will contain video stream of bitrate 1000k and audio stream
2331 of bitrate 64k and the second variant stream will contain video
2332 stream of bitrate 256k and audio stream of bitrate 32k. Here, two
2333 media playlist with file names out_0.m3u8 and out_1.m3u8 will be
2334 created. If you want something meaningful text instead of indexes
2335 in result names, you may specify names for each or some of the
2336 variants as in the following example.
2337
2338 ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
2339 -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map "v:0,a:0,name:my_hd v:1,a:1,name:my_sd" \
2340 http://example.com/live/out_%v.m3u8
2341
2342 This example creates two hls variant streams as in the previous
2343 one. But here, the two media playlist with file names
2344 out_my_hd.m3u8 and out_my_sd.m3u8 will be created.
2345
2346 ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k \
2347 -map 0:v -map 0:a -map 0:v -f hls -var_stream_map "v:0 a:0 v:1" \
2348 http://example.com/live/out_%v.m3u8
2349
2350 This example creates three hls variant streams. The first variant
2351 stream will be a video only stream with video bitrate 1000k, the
2352 second variant stream will be an audio only stream with bitrate 64k
2353 and the third variant stream will be a video only stream with
2354 bitrate 256k. Here, three media playlist with file names
2355 out_0.m3u8, out_1.m3u8 and out_2.m3u8 will be created.
2356
2357 ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
2358 -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map "v:0,a:0 v:1,a:1" \
2359 http://example.com/live/vs_%v/out.m3u8
2360
2361 This example creates the variant streams in subdirectories. Here,
2362 the first media playlist is created at
2363 http://example.com/live/vs_0/out.m3u8 and the second one at
2364 http://example.com/live/vs_1/out.m3u8.
2365
2366 ffmpeg -re -i in.ts -b:a:0 32k -b:a:1 64k -b:v:0 1000k -b:v:1 3000k \
2367 -map 0:a -map 0:a -map 0:v -map 0:v -f hls \
2368 -var_stream_map "a:0,agroup:aud_low a:1,agroup:aud_high v:0,agroup:aud_low v:1,agroup:aud_high" \
2369 -master_pl_name master.m3u8 \
2370 http://example.com/live/out_%v.m3u8
2371
2372 This example creates two audio only and two video only variant
2373 streams. In addition to the #EXT-X-STREAM-INF tag for each variant
2374 stream in the master playlist, #EXT-X-MEDIA tag is also added for
2375 the two audio only variant streams and they are mapped to the two
2376 video only variant streams with audio group names 'aud_low' and
2377 'aud_high'.
2378
2379 By default, a single hls variant containing all the encoded streams
2380 is created.
2381
2382 ffmpeg -re -i in.ts -b:a:0 32k -b:a:1 64k -b:v:0 1000k \
2383 -map 0:a -map 0:a -map 0:v -f hls \
2384 -var_stream_map "a:0,agroup:aud_low,default:yes a:1,agroup:aud_low v:0,agroup:aud_low" \
2385 -master_pl_name master.m3u8 \
2386 http://example.com/live/out_%v.m3u8
2387
2388 This example creates two audio only and one video only variant
2389 streams. In addition to the #EXT-X-STREAM-INF tag for each variant
2390 stream in the master playlist, #EXT-X-MEDIA tag is also added for
2391 the two audio only variant streams and they are mapped to the one
2392 video only variant streams with audio group name 'aud_low', and the
2393 audio group have default stat is NO or YES.
2394
2395 By default, a single hls variant containing all the encoded streams
2396 is created.
2397
2398 ffmpeg -re -i in.ts -b:a:0 32k -b:a:1 64k -b:v:0 1000k \
2399 -map 0:a -map 0:a -map 0:v -f hls \
2400 -var_stream_map "a:0,agroup:aud_low,default:yes,language:ENG a:1,agroup:aud_low,language:CHN v:0,agroup:aud_low" \
2401 -master_pl_name master.m3u8 \
2402 http://example.com/live/out_%v.m3u8
2403
2404 This example creates two audio only and one video only variant
2405 streams. In addition to the #EXT-X-STREAM-INF tag for each variant
2406 stream in the master playlist, #EXT-X-MEDIA tag is also added for
2407 the two audio only variant streams and they are mapped to the one
2408 video only variant streams with audio group name 'aud_low', and the
2409 audio group have default stat is NO or YES, and one audio have and
2410 language is named ENG, the other audio language is named CHN.
2411
2412 By default, a single hls variant containing all the encoded streams
2413 is created.
2414
2415 ffmpeg -y -i input_with_subtitle.mkv \
2416 -b:v:0 5250k -c:v h264 -pix_fmt yuv420p -profile:v main -level 4.1 \
2417 -b:a:0 256k \
2418 -c:s webvtt -c:a mp2 -ar 48000 -ac 2 -map 0:v -map 0:a:0 -map 0:s:0 \
2419 -f hls -var_stream_map "v:0,a:0,s:0,sgroup:subtitle" \
2420 -master_pl_name master.m3u8 -t 300 -hls_time 10 -hls_init_time 4 -hls_list_size \
2421 10 -master_pl_publish_rate 10 -hls_flags \
2422 delete_segments+discont_start+split_by_time ./tmp/video.m3u8
2423
2424 This example adds "#EXT-X-MEDIA" tag with "TYPE=SUBTITLES" in the
2425 master playlist with webvtt subtitle group name 'subtitle'. Please
2426 make sure the input file has one text subtitle stream at least.
2427
2428 cc_stream_map
2429 Map string which specifies different closed captions groups and
2430 their attributes. The closed captions stream groups are separated
2431 by space. Expected string format is like this "ccgroup:<group
2432 name>,instreamid:<INSTREAM-ID>,language:<language code> ....".
2433 'ccgroup' and 'instreamid' are mandatory attributes. 'language' is
2434 an optional attribute. The closed captions groups configured using
2435 this option are mapped to different variant streams by providing
2436 the same 'ccgroup' name in the "var_stream_map" string. If
2437 "var_stream_map" is not set, then the first available ccgroup in
2438 "cc_stream_map" is mapped to the output variant stream. The
2439 examples for these two use cases are given below.
2440
2441 ffmpeg -re -i in.ts -b:v 1000k -b:a 64k -a53cc 1 -f hls \
2442 -cc_stream_map "ccgroup:cc,instreamid:CC1,language:en" \
2443 -master_pl_name master.m3u8 \
2444 http://example.com/live/out.m3u8
2445
2446 This example adds "#EXT-X-MEDIA" tag with "TYPE=CLOSED-CAPTIONS" in
2447 the master playlist with group name 'cc', language 'en' (english)
2448 and INSTREAM-ID 'CC1'. Also, it adds "CLOSED-CAPTIONS" attribute
2449 with group name 'cc' for the output variant stream.
2450
2451 ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
2452 -a53cc:0 1 -a53cc:1 1\
2453 -map 0:v -map 0:a -map 0:v -map 0:a -f hls \
2454 -cc_stream_map "ccgroup:cc,instreamid:CC1,language:en ccgroup:cc,instreamid:CC2,language:sp" \
2455 -var_stream_map "v:0,a:0,ccgroup:cc v:1,a:1,ccgroup:cc" \
2456 -master_pl_name master.m3u8 \
2457 http://example.com/live/out_%v.m3u8
2458
2459 This example adds two "#EXT-X-MEDIA" tags with
2460 "TYPE=CLOSED-CAPTIONS" in the master playlist for the INSTREAM-IDs
2461 'CC1' and 'CC2'. Also, it adds "CLOSED-CAPTIONS" attribute with
2462 group name 'cc' for the two output variant streams.
2463
2464 master_pl_name
2465 Create HLS master playlist with the given name.
2466
2467 ffmpeg -re -i in.ts -f hls -master_pl_name master.m3u8 http://example.com/live/out.m3u8
2468
2469 This example creates HLS master playlist with name master.m3u8 and
2470 it is published at http://example.com/live/
2471
2472 master_pl_publish_rate
2473 Publish master play list repeatedly every after specified number of
2474 segment intervals.
2475
2476 ffmpeg -re -i in.ts -f hls -master_pl_name master.m3u8 \
2477 -hls_time 2 -master_pl_publish_rate 30 http://example.com/live/out.m3u8
2478
2479 This example creates HLS master playlist with name master.m3u8 and
2480 keep publishing it repeatedly every after 30 segments i.e. every
2481 after 60s.
2482
2483 http_persistent
2484 Use persistent HTTP connections. Applicable only for HTTP output.
2485
2486 timeout
2487 Set timeout for socket I/O operations. Applicable only for HTTP
2488 output.
2489
2490 -ignore_io_errors
2491 Ignore IO errors during open, write and delete. Useful for long-
2492 duration runs with network output.
2493
2494 headers
2495 Set custom HTTP headers, can override built in default headers.
2496 Applicable only for HTTP output.
2497
2498 ico
2499 ICO file muxer.
2500
2501 Microsoft's icon file format (ICO) has some strict limitations that
2502 should be noted:
2503
2504 • Size cannot exceed 256 pixels in any dimension
2505
2506 • Only BMP and PNG images can be stored
2507
2508 • If a BMP image is used, it must be one of the following pixel
2509 formats:
2510
2511 BMP Bit Depth FFmpeg Pixel Format
2512 1bit pal8
2513 4bit pal8
2514 8bit pal8
2515 16bit rgb555le
2516 24bit bgr24
2517 32bit bgra
2518
2519 • If a BMP image is used, it must use the BITMAPINFOHEADER DIB header
2520
2521 • If a PNG image is used, it must use the rgba pixel format
2522
2523 image2
2524 Image file muxer.
2525
2526 The image file muxer writes video frames to image files.
2527
2528 The output filenames are specified by a pattern, which can be used to
2529 produce sequentially numbered series of files. The pattern may contain
2530 the string "%d" or "%0Nd", this string specifies the position of the
2531 characters representing a numbering in the filenames. If the form
2532 "%0Nd" is used, the string representing the number in each filename is
2533 0-padded to N digits. The literal character '%' can be specified in the
2534 pattern with the string "%%".
2535
2536 If the pattern contains "%d" or "%0Nd", the first filename of the file
2537 list specified will contain the number 1, all the following numbers
2538 will be sequential.
2539
2540 The pattern may contain a suffix which is used to automatically
2541 determine the format of the image files to write.
2542
2543 For example the pattern "img-%03d.bmp" will specify a sequence of
2544 filenames of the form img-001.bmp, img-002.bmp, ..., img-010.bmp, etc.
2545 The pattern "img%%-%d.jpg" will specify a sequence of filenames of the
2546 form img%-1.jpg, img%-2.jpg, ..., img%-10.jpg, etc.
2547
2548 The image muxer supports the .Y.U.V image file format. This format is
2549 special in that that each image frame consists of three files, for each
2550 of the YUV420P components. To read or write this image file format,
2551 specify the name of the '.Y' file. The muxer will automatically open
2552 the '.U' and '.V' files as required.
2553
2554 Options
2555
2556 frame_pts
2557 If set to 1, expand the filename with pts from pkt->pts. Default
2558 value is 0.
2559
2560 start_number
2561 Start the sequence from the specified number. Default value is 1.
2562
2563 update
2564 If set to 1, the filename will always be interpreted as just a
2565 filename, not a pattern, and the corresponding file will be
2566 continuously overwritten with new images. Default value is 0.
2567
2568 strftime
2569 If set to 1, expand the filename with date and time information
2570 from "strftime()". Default value is 0.
2571
2572 atomic_writing
2573 Write output to a temporary file, which is renamed to target
2574 filename once writing is completed. Default is disabled.
2575
2576 protocol_opts options_list
2577 Set protocol options as a :-separated list of key=value parameters.
2578 Values containing the ":" special character must be escaped.
2579
2580 Examples
2581
2582 The following example shows how to use ffmpeg for creating a sequence
2583 of files img-001.jpeg, img-002.jpeg, ..., taking one image every second
2584 from the input video:
2585
2586 ffmpeg -i in.avi -vsync cfr -r 1 -f image2 'img-%03d.jpeg'
2587
2588 Note that with ffmpeg, if the format is not specified with the "-f"
2589 option and the output filename specifies an image file format, the
2590 image2 muxer is automatically selected, so the previous command can be
2591 written as:
2592
2593 ffmpeg -i in.avi -vsync cfr -r 1 'img-%03d.jpeg'
2594
2595 Note also that the pattern must not necessarily contain "%d" or "%0Nd",
2596 for example to create a single image file img.jpeg from the start of
2597 the input video you can employ the command:
2598
2599 ffmpeg -i in.avi -f image2 -frames:v 1 img.jpeg
2600
2601 The strftime option allows you to expand the filename with date and
2602 time information. Check the documentation of the "strftime()" function
2603 for the syntax.
2604
2605 For example to generate image files from the "strftime()"
2606 "%Y-%m-%d_%H-%M-%S" pattern, the following ffmpeg command can be used:
2607
2608 ffmpeg -f v4l2 -r 1 -i /dev/video0 -f image2 -strftime 1 "%Y-%m-%d_%H-%M-%S.jpg"
2609
2610 You can set the file name with current frame's PTS:
2611
2612 ffmpeg -f v4l2 -r 1 -i /dev/video0 -copyts -f image2 -frame_pts true %d.jpg"
2613
2614 A more complex example is to publish contents of your desktop directly
2615 to a WebDAV server every second:
2616
2617 ffmpeg -f x11grab -framerate 1 -i :0.0 -q:v 6 -update 1 -protocol_opts method=PUT http://example.com/desktop.jpg
2618
2619 matroska
2620 Matroska container muxer.
2621
2622 This muxer implements the matroska and webm container specs.
2623
2624 Metadata
2625
2626 The recognized metadata settings in this muxer are:
2627
2628 title
2629 Set title name provided to a single track. This gets mapped to the
2630 FileDescription element for a stream written as attachment.
2631
2632 language
2633 Specify the language of the track in the Matroska languages form.
2634
2635 The language can be either the 3 letters bibliographic ISO-639-2
2636 (ISO 639-2/B) form (like "fre" for French), or a language code
2637 mixed with a country code for specialities in languages (like "fre-
2638 ca" for Canadian French).
2639
2640 stereo_mode
2641 Set stereo 3D video layout of two views in a single video track.
2642
2643 The following values are recognized:
2644
2645 mono
2646 video is not stereo
2647
2648 left_right
2649 Both views are arranged side by side, Left-eye view is on the
2650 left
2651
2652 bottom_top
2653 Both views are arranged in top-bottom orientation, Left-eye
2654 view is at bottom
2655
2656 top_bottom
2657 Both views are arranged in top-bottom orientation, Left-eye
2658 view is on top
2659
2660 checkerboard_rl
2661 Each view is arranged in a checkerboard interleaved pattern,
2662 Left-eye view being first
2663
2664 checkerboard_lr
2665 Each view is arranged in a checkerboard interleaved pattern,
2666 Right-eye view being first
2667
2668 row_interleaved_rl
2669 Each view is constituted by a row based interleaving, Right-eye
2670 view is first row
2671
2672 row_interleaved_lr
2673 Each view is constituted by a row based interleaving, Left-eye
2674 view is first row
2675
2676 col_interleaved_rl
2677 Both views are arranged in a column based interleaving manner,
2678 Right-eye view is first column
2679
2680 col_interleaved_lr
2681 Both views are arranged in a column based interleaving manner,
2682 Left-eye view is first column
2683
2684 anaglyph_cyan_red
2685 All frames are in anaglyph format viewable through red-cyan
2686 filters
2687
2688 right_left
2689 Both views are arranged side by side, Right-eye view is on the
2690 left
2691
2692 anaglyph_green_magenta
2693 All frames are in anaglyph format viewable through green-
2694 magenta filters
2695
2696 block_lr
2697 Both eyes laced in one Block, Left-eye view is first
2698
2699 block_rl
2700 Both eyes laced in one Block, Right-eye view is first
2701
2702 For example a 3D WebM clip can be created using the following command
2703 line:
2704
2705 ffmpeg -i sample_left_right_clip.mpg -an -c:v libvpx -metadata stereo_mode=left_right -y stereo_clip.webm
2706
2707 Options
2708
2709 This muxer supports the following options:
2710
2711 reserve_index_space
2712 By default, this muxer writes the index for seeking (called cues in
2713 Matroska terms) at the end of the file, because it cannot know in
2714 advance how much space to leave for the index at the beginning of
2715 the file. However for some use cases -- e.g. streaming where
2716 seeking is possible but slow -- it is useful to put the index at
2717 the beginning of the file.
2718
2719 If this option is set to a non-zero value, the muxer will reserve a
2720 given amount of space in the file header and then try to write the
2721 cues there when the muxing finishes. If the reserved space does not
2722 suffice, no Cues will be written, the file will be finalized and
2723 writing the trailer will return an error. A safe size for most use
2724 cases should be about 50kB per hour of video.
2725
2726 Note that cues are only written if the output is seekable and this
2727 option will have no effect if it is not.
2728
2729 cues_to_front
2730 If set, the muxer will write the index at the beginning of the file
2731 by shifting the main data if necessary. This can be combined with
2732 reserve_index_space in which case the data is only shifted if the
2733 initially reserved space turns out to be insufficient.
2734
2735 This option is ignored if the output is unseekable.
2736
2737 default_mode
2738 This option controls how the FlagDefault of the output tracks will
2739 be set. It influences which tracks players should play by default.
2740 The default mode is passthrough.
2741
2742 infer
2743 Every track with disposition default will have the FlagDefault
2744 set. Additionally, for each type of track (audio, video or
2745 subtitle), if no track with disposition default of this type
2746 exists, then the first track of this type will be marked as
2747 default (if existing). This ensures that the default flag is
2748 set in a sensible way even if the input originated from
2749 containers that lack the concept of default tracks.
2750
2751 infer_no_subs
2752 This mode is the same as infer except that if no subtitle track
2753 with disposition default exists, no subtitle track will be
2754 marked as default.
2755
2756 passthrough
2757 In this mode the FlagDefault is set if and only if the
2758 AV_DISPOSITION_DEFAULT flag is set in the disposition of the
2759 corresponding stream.
2760
2761 flipped_raw_rgb
2762 If set to true, store positive height for raw RGB bitmaps, which
2763 indicates bitmap is stored bottom-up. Note that this option does
2764 not flip the bitmap which has to be done manually beforehand, e.g.
2765 by using the vflip filter. Default is false and indicates bitmap
2766 is stored top down.
2767
2768 md5
2769 MD5 testing format.
2770
2771 This is a variant of the hash muxer. Unlike that muxer, it defaults to
2772 using the MD5 hash function.
2773
2774 Examples
2775
2776 To compute the MD5 hash of the input converted to raw audio and video,
2777 and store it in the file out.md5:
2778
2779 ffmpeg -i INPUT -f md5 out.md5
2780
2781 You can print the MD5 to stdout with the command:
2782
2783 ffmpeg -i INPUT -f md5 -
2784
2785 See also the hash and framemd5 muxers.
2786
2787 mov, mp4, ismv
2788 MOV/MP4/ISMV (Smooth Streaming) muxer.
2789
2790 The mov/mp4/ismv muxer supports fragmentation. Normally, a MOV/MP4 file
2791 has all the metadata about all packets stored in one location (written
2792 at the end of the file, it can be moved to the start for better
2793 playback by adding faststart to the movflags, or using the qt-faststart
2794 tool). A fragmented file consists of a number of fragments, where
2795 packets and metadata about these packets are stored together. Writing a
2796 fragmented file has the advantage that the file is decodable even if
2797 the writing is interrupted (while a normal MOV/MP4 is undecodable if it
2798 is not properly finished), and it requires less memory when writing
2799 very long files (since writing normal MOV/MP4 files stores info about
2800 every single packet in memory until the file is closed). The downside
2801 is that it is less compatible with other applications.
2802
2803 Options
2804
2805 Fragmentation is enabled by setting one of the AVOptions that define
2806 how to cut the file into fragments:
2807
2808 -moov_size bytes
2809 Reserves space for the moov atom at the beginning of the file
2810 instead of placing the moov atom at the end. If the space reserved
2811 is insufficient, muxing will fail.
2812
2813 -movflags frag_keyframe
2814 Start a new fragment at each video keyframe.
2815
2816 -frag_duration duration
2817 Create fragments that are duration microseconds long.
2818
2819 -frag_size size
2820 Create fragments that contain up to size bytes of payload data.
2821
2822 -movflags frag_custom
2823 Allow the caller to manually choose when to cut fragments, by
2824 calling "av_write_frame(ctx, NULL)" to write a fragment with the
2825 packets written so far. (This is only useful with other
2826 applications integrating libavformat, not from ffmpeg.)
2827
2828 -min_frag_duration duration
2829 Don't create fragments that are shorter than duration microseconds
2830 long.
2831
2832 If more than one condition is specified, fragments are cut when one of
2833 the specified conditions is fulfilled. The exception to this is
2834 "-min_frag_duration", which has to be fulfilled for any of the other
2835 conditions to apply.
2836
2837 Additionally, the way the output file is written can be adjusted
2838 through a few other options:
2839
2840 -movflags empty_moov
2841 Write an initial moov atom directly at the start of the file,
2842 without describing any samples in it. Generally, an mdat/moov pair
2843 is written at the start of the file, as a normal MOV/MP4 file,
2844 containing only a short portion of the file. With this option set,
2845 there is no initial mdat atom, and the moov atom only describes the
2846 tracks but has a zero duration.
2847
2848 This option is implicitly set when writing ismv (Smooth Streaming)
2849 files.
2850
2851 -movflags separate_moof
2852 Write a separate moof (movie fragment) atom for each track.
2853 Normally, packets for all tracks are written in a moof atom (which
2854 is slightly more efficient), but with this option set, the muxer
2855 writes one moof/mdat pair for each track, making it easier to
2856 separate tracks.
2857
2858 This option is implicitly set when writing ismv (Smooth Streaming)
2859 files.
2860
2861 -movflags skip_sidx
2862 Skip writing of sidx atom. When bitrate overhead due to sidx atom
2863 is high, this option could be used for cases where sidx atom is not
2864 mandatory. When global_sidx flag is enabled, this option will be
2865 ignored.
2866
2867 -movflags faststart
2868 Run a second pass moving the index (moov atom) to the beginning of
2869 the file. This operation can take a while, and will not work in
2870 various situations such as fragmented output, thus it is not
2871 enabled by default.
2872
2873 -movflags rtphint
2874 Add RTP hinting tracks to the output file.
2875
2876 -movflags disable_chpl
2877 Disable Nero chapter markers (chpl atom). Normally, both Nero
2878 chapters and a QuickTime chapter track are written to the file.
2879 With this option set, only the QuickTime chapter track will be
2880 written. Nero chapters can cause failures when the file is
2881 reprocessed with certain tagging programs, like mp3Tag 2.61a and
2882 iTunes 11.3, most likely other versions are affected as well.
2883
2884 -movflags omit_tfhd_offset
2885 Do not write any absolute base_data_offset in tfhd atoms. This
2886 avoids tying fragments to absolute byte positions in the
2887 file/streams.
2888
2889 -movflags default_base_moof
2890 Similarly to the omit_tfhd_offset, this flag avoids writing the
2891 absolute base_data_offset field in tfhd atoms, but does so by using
2892 the new default-base-is-moof flag instead. This flag is new from
2893 14496-12:2012. This may make the fragments easier to parse in
2894 certain circumstances (avoiding basing track fragment location
2895 calculations on the implicit end of the previous track fragment).
2896
2897 -write_tmcd
2898 Specify "on" to force writing a timecode track, "off" to disable it
2899 and "auto" to write a timecode track only for mov and mp4 output
2900 (default).
2901
2902 -movflags negative_cts_offsets
2903 Enables utilization of version 1 of the CTTS box, in which the CTS
2904 offsets can be negative. This enables the initial sample to have
2905 DTS/CTS of zero, and reduces the need for edit lists for some cases
2906 such as video tracks with B-frames. Additionally, eases conformance
2907 with the DASH-IF interoperability guidelines.
2908
2909 This option is implicitly set when writing ismv (Smooth Streaming)
2910 files.
2911
2912 -write_btrt bool
2913 Force or disable writing bitrate box inside stsd box of a track.
2914 The box contains decoding buffer size (in bytes), maximum bitrate
2915 and average bitrate for the track. The box will be skipped if none
2916 of these values can be computed. Default is "-1" or "auto", which
2917 will write the box only in MP4 mode.
2918
2919 -write_prft
2920 Write producer time reference box (PRFT) with a specified time
2921 source for the NTP field in the PRFT box. Set value as wallclock to
2922 specify timesource as wallclock time and pts to specify timesource
2923 as input packets' PTS values.
2924
2925 Setting value to pts is applicable only for a live encoding use
2926 case, where PTS values are set as as wallclock time at the source.
2927 For example, an encoding use case with decklink capture source
2928 where video_pts and audio_pts are set to abs_wallclock.
2929
2930 -empty_hdlr_name bool
2931 Enable to skip writing the name inside a "hdlr" box. Default is
2932 "false".
2933
2934 -movie_timescale scale
2935 Set the timescale written in the movie header box ("mvhd"). Range
2936 is 1 to INT_MAX. Default is 1000.
2937
2938 -video_track_timescale scale
2939 Set the timescale used for video tracks. Range is 0 to INT_MAX. If
2940 set to 0, the timescale is automatically set based on the native
2941 stream time base. Default is 0.
2942
2943 Example
2944
2945 Smooth Streaming content can be pushed in real time to a publishing
2946 point on IIS with this muxer. Example:
2947
2948 ffmpeg -re <<normal input/transcoding options>> -movflags isml+frag_keyframe -f ismv http://server/publishingpoint.isml/Streams(Encoder1)
2949
2950 mp3
2951 The MP3 muxer writes a raw MP3 stream with the following optional
2952 features:
2953
2954 • An ID3v2 metadata header at the beginning (enabled by default).
2955 Versions 2.3 and 2.4 are supported, the "id3v2_version" private
2956 option controls which one is used (3 or 4). Setting "id3v2_version"
2957 to 0 disables the ID3v2 header completely.
2958
2959 The muxer supports writing attached pictures (APIC frames) to the
2960 ID3v2 header. The pictures are supplied to the muxer in form of a
2961 video stream with a single packet. There can be any number of those
2962 streams, each will correspond to a single APIC frame. The stream
2963 metadata tags title and comment map to APIC description and picture
2964 type respectively. See <http://id3.org/id3v2.4.0-frames> for
2965 allowed picture types.
2966
2967 Note that the APIC frames must be written at the beginning, so the
2968 muxer will buffer the audio frames until it gets all the pictures.
2969 It is therefore advised to provide the pictures as soon as possible
2970 to avoid excessive buffering.
2971
2972 • A Xing/LAME frame right after the ID3v2 header (if present). It is
2973 enabled by default, but will be written only if the output is
2974 seekable. The "write_xing" private option can be used to disable
2975 it. The frame contains various information that may be useful to
2976 the decoder, like the audio duration or encoder delay.
2977
2978 • A legacy ID3v1 tag at the end of the file (disabled by default). It
2979 may be enabled with the "write_id3v1" private option, but as its
2980 capabilities are very limited, its usage is not recommended.
2981
2982 Examples:
2983
2984 Write an mp3 with an ID3v2.3 header and an ID3v1 footer:
2985
2986 ffmpeg -i INPUT -id3v2_version 3 -write_id3v1 1 out.mp3
2987
2988 To attach a picture to an mp3 file select both the audio and the
2989 picture stream with "map":
2990
2991 ffmpeg -i input.mp3 -i cover.png -c copy -map 0 -map 1
2992 -metadata:s:v title="Album cover" -metadata:s:v comment="Cover (Front)" out.mp3
2993
2994 Write a "clean" MP3 without any extra features:
2995
2996 ffmpeg -i input.wav -write_xing 0 -id3v2_version 0 out.mp3
2997
2998 mpegts
2999 MPEG transport stream muxer.
3000
3001 This muxer implements ISO 13818-1 and part of ETSI EN 300 468.
3002
3003 The recognized metadata settings in mpegts muxer are "service_provider"
3004 and "service_name". If they are not set the default for
3005 "service_provider" is FFmpeg and the default for "service_name" is
3006 Service01.
3007
3008 Options
3009
3010 The muxer options are:
3011
3012 mpegts_transport_stream_id integer
3013 Set the transport_stream_id. This identifies a transponder in DVB.
3014 Default is 0x0001.
3015
3016 mpegts_original_network_id integer
3017 Set the original_network_id. This is unique identifier of a network
3018 in DVB. Its main use is in the unique identification of a service
3019 through the path Original_Network_ID, Transport_Stream_ID. Default
3020 is 0x0001.
3021
3022 mpegts_service_id integer
3023 Set the service_id, also known as program in DVB. Default is
3024 0x0001.
3025
3026 mpegts_service_type integer
3027 Set the program service_type. Default is "digital_tv". Accepts the
3028 following options:
3029
3030 hex_value
3031 Any hexadecimal value between 0x01 and 0xff as defined in ETSI
3032 300 468.
3033
3034 digital_tv
3035 Digital TV service.
3036
3037 digital_radio
3038 Digital Radio service.
3039
3040 teletext
3041 Teletext service.
3042
3043 advanced_codec_digital_radio
3044 Advanced Codec Digital Radio service.
3045
3046 mpeg2_digital_hdtv
3047 MPEG2 Digital HDTV service.
3048
3049 advanced_codec_digital_sdtv
3050 Advanced Codec Digital SDTV service.
3051
3052 advanced_codec_digital_hdtv
3053 Advanced Codec Digital HDTV service.
3054
3055 mpegts_pmt_start_pid integer
3056 Set the first PID for PMTs. Default is 0x1000, minimum is 0x0020,
3057 maximum is 0x1ffa. This option has no effect in m2ts mode where the
3058 PMT PID is fixed 0x0100.
3059
3060 mpegts_start_pid integer
3061 Set the first PID for elementary streams. Default is 0x0100,
3062 minimum is 0x0020, maximum is 0x1ffa. This option has no effect in
3063 m2ts mode where the elementary stream PIDs are fixed.
3064
3065 mpegts_m2ts_mode boolean
3066 Enable m2ts mode if set to 1. Default value is "-1" which disables
3067 m2ts mode.
3068
3069 muxrate integer
3070 Set a constant muxrate. Default is VBR.
3071
3072 pes_payload_size integer
3073 Set minimum PES packet payload in bytes. Default is 2930.
3074
3075 mpegts_flags flags
3076 Set mpegts flags. Accepts the following options:
3077
3078 resend_headers
3079 Reemit PAT/PMT before writing the next packet.
3080
3081 latm
3082 Use LATM packetization for AAC.
3083
3084 pat_pmt_at_frames
3085 Reemit PAT and PMT at each video frame.
3086
3087 system_b
3088 Conform to System B (DVB) instead of System A (ATSC).
3089
3090 initial_discontinuity
3091 Mark the initial packet of each stream as discontinuity.
3092
3093 nit Emit NIT table.
3094
3095 mpegts_copyts boolean
3096 Preserve original timestamps, if value is set to 1. Default value
3097 is "-1", which results in shifting timestamps so that they start
3098 from 0.
3099
3100 omit_video_pes_length boolean
3101 Omit the PES packet length for video packets. Default is 1 (true).
3102
3103 pcr_period integer
3104 Override the default PCR retransmission time in milliseconds.
3105 Default is "-1" which means that the PCR interval will be
3106 determined automatically: 20 ms is used for CBR streams, the
3107 highest multiple of the frame duration which is less than 100 ms is
3108 used for VBR streams.
3109
3110 pat_period duration
3111 Maximum time in seconds between PAT/PMT tables. Default is 0.1.
3112
3113 sdt_period duration
3114 Maximum time in seconds between SDT tables. Default is 0.5.
3115
3116 nit_period duration
3117 Maximum time in seconds between NIT tables. Default is 0.5.
3118
3119 tables_version integer
3120 Set PAT, PMT, SDT and NIT version (default 0, valid values are from
3121 0 to 31, inclusively). This option allows updating stream
3122 structure so that standard consumer may detect the change. To do
3123 so, reopen output "AVFormatContext" (in case of API usage) or
3124 restart ffmpeg instance, cyclically changing tables_version value:
3125
3126 ffmpeg -i source1.ts -codec copy -f mpegts -tables_version 0 udp://1.1.1.1:1111
3127 ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udp://1.1.1.1:1111
3128 ...
3129 ffmpeg -i source3.ts -codec copy -f mpegts -tables_version 31 udp://1.1.1.1:1111
3130 ffmpeg -i source1.ts -codec copy -f mpegts -tables_version 0 udp://1.1.1.1:1111
3131 ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udp://1.1.1.1:1111
3132 ...
3133
3134 Example
3135
3136 ffmpeg -i file.mpg -c copy \
3137 -mpegts_original_network_id 0x1122 \
3138 -mpegts_transport_stream_id 0x3344 \
3139 -mpegts_service_id 0x5566 \
3140 -mpegts_pmt_start_pid 0x1500 \
3141 -mpegts_start_pid 0x150 \
3142 -metadata service_provider="Some provider" \
3143 -metadata service_name="Some Channel" \
3144 out.ts
3145
3146 mxf, mxf_d10, mxf_opatom
3147 MXF muxer.
3148
3149 Options
3150
3151 The muxer options are:
3152
3153 store_user_comments bool
3154 Set if user comments should be stored if available or never. IRT
3155 D-10 does not allow user comments. The default is thus to write
3156 them for mxf and mxf_opatom but not for mxf_d10
3157
3158 null
3159 Null muxer.
3160
3161 This muxer does not generate any output file, it is mainly useful for
3162 testing or benchmarking purposes.
3163
3164 For example to benchmark decoding with ffmpeg you can use the command:
3165
3166 ffmpeg -benchmark -i INPUT -f null out.null
3167
3168 Note that the above command does not read or write the out.null file,
3169 but specifying the output file is required by the ffmpeg syntax.
3170
3171 Alternatively you can write the command as:
3172
3173 ffmpeg -benchmark -i INPUT -f null -
3174
3175 nut
3176 -syncpoints flags
3177 Change the syncpoint usage in nut:
3178
3179 default use the normal low-overhead seeking aids.
3180 none do not use the syncpoints at all, reducing the overhead but
3181 making the stream non-seekable;
3182 Use of this option is not recommended, as the resulting files are very damage
3183 sensitive and seeking is not possible. Also in general the overhead from
3184 syncpoints is negligible. Note, -C<write_index> 0 can be used to disable
3185 all growing data tables, allowing to mux endless streams with limited memory
3186 and without these disadvantages.
3187
3188 timestamped extend the syncpoint with a wallclock field.
3189
3190 The none and timestamped flags are experimental.
3191
3192 -write_index bool
3193 Write index at the end, the default is to write an index.
3194
3195 ffmpeg -i INPUT -f_strict experimental -syncpoints none - | processor
3196
3197 ogg
3198 Ogg container muxer.
3199
3200 -page_duration duration
3201 Preferred page duration, in microseconds. The muxer will attempt to
3202 create pages that are approximately duration microseconds long.
3203 This allows the user to compromise between seek granularity and
3204 container overhead. The default is 1 second. A value of 0 will fill
3205 all segments, making pages as large as possible. A value of 1 will
3206 effectively use 1 packet-per-page in most situations, giving a
3207 small seek granularity at the cost of additional container
3208 overhead.
3209
3210 -serial_offset value
3211 Serial value from which to set the streams serial number. Setting
3212 it to different and sufficiently large values ensures that the
3213 produced ogg files can be safely chained.
3214
3215 raw muxers
3216 Raw muxers accept a single stream matching the designated codec. They
3217 do not store timestamps or metadata. The recognized extension is the
3218 same as the muxer name unless indicated otherwise.
3219
3220 ac3
3221
3222 Dolby Digital, also known as AC-3, audio.
3223
3224 adx
3225
3226 CRI Middleware ADX audio.
3227
3228 This muxer will write out the total sample count near the start of the
3229 first packet when the output is seekable and the count can be stored in
3230 32 bits.
3231
3232 aptx
3233
3234 aptX (Audio Processing Technology for Bluetooth) audio.
3235
3236 aptx_hd
3237
3238 aptX HD (Audio Processing Technology for Bluetooth) audio.
3239
3240 Extensions: aptxhd
3241
3242 avs2
3243
3244 AVS2-P2/IEEE1857.4 video.
3245
3246 Extensions: avs, avs2
3247
3248 cavsvideo
3249
3250 Chinese AVS (Audio Video Standard) video.
3251
3252 Extensions: cavs
3253
3254 codec2raw
3255
3256 Codec 2 audio.
3257
3258 No extension is registered so format name has to be supplied e.g. with
3259 the ffmpeg CLI tool "-f codec2raw".
3260
3261 data
3262
3263 Data muxer accepts a single stream with any codec of any type. The
3264 input stream has to be selected using the "-map" option with the ffmpeg
3265 CLI tool.
3266
3267 No extension is registered so format name has to be supplied e.g. with
3268 the ffmpeg CLI tool "-f data".
3269
3270 dirac
3271
3272 BBC Dirac video. The Dirac Pro codec is a subset and is standardized as
3273 SMPTE VC-2.
3274
3275 Extensions: drc, vc2
3276
3277 dnxhd
3278
3279 Avid DNxHD video. It is standardized as SMPTE VC-3. Accepts DNxHR
3280 streams.
3281
3282 Extensions: dnxhd, dnxhr
3283
3284 dts
3285
3286 DTS Coherent Acoustics (DCA) audio.
3287
3288 eac3
3289
3290 Dolby Digital Plus, also known as Enhanced AC-3, audio.
3291
3292 g722
3293
3294 ITU-T G.722 audio.
3295
3296 g723_1
3297
3298 ITU-T G.723.1 audio.
3299
3300 Extensions: tco, rco
3301
3302 g726
3303
3304 ITU-T G.726 big-endian ("left-justified") audio.
3305
3306 No extension is registered so format name has to be supplied e.g. with
3307 the ffmpeg CLI tool "-f g726".
3308
3309 g726le
3310
3311 ITU-T G.726 little-endian ("right-justified") audio.
3312
3313 No extension is registered so format name has to be supplied e.g. with
3314 the ffmpeg CLI tool "-f g726le".
3315
3316 gsm
3317
3318 Global System for Mobile Communications audio.
3319
3320 h261
3321
3322 ITU-T H.261 video.
3323
3324 h263
3325
3326 ITU-T H.263 / H.263-1996, H.263+ / H.263-1998 / H.263 version 2 video.
3327
3328 h264
3329
3330 ITU-T H.264 / MPEG-4 Part 10 AVC video. Bitstream shall be converted to
3331 Annex B syntax if it's in length-prefixed mode.
3332
3333 Extensions: h264, 264
3334
3335 hevc
3336
3337 ITU-T H.265 / MPEG-H Part 2 HEVC video. Bitstream shall be converted to
3338 Annex B syntax if it's in length-prefixed mode.
3339
3340 Extensions: hevc, h265, 265
3341
3342 m4v
3343
3344 MPEG-4 Part 2 video.
3345
3346 mjpeg
3347
3348 Motion JPEG video.
3349
3350 Extensions: mjpg, mjpeg
3351
3352 mlp
3353
3354 Meridian Lossless Packing, also known as Packed PCM, audio.
3355
3356 mp2
3357
3358 MPEG-1 Audio Layer II audio.
3359
3360 Extensions: mp2, m2a, mpa
3361
3362 mpeg1video
3363
3364 MPEG-1 Part 2 video.
3365
3366 Extensions: mpg, mpeg, m1v
3367
3368 mpeg2video
3369
3370 ITU-T H.262 / MPEG-2 Part 2 video.
3371
3372 Extensions: m2v
3373
3374 obu
3375
3376 AV1 low overhead Open Bitstream Units muxer. Temporal delimiter OBUs
3377 will be inserted in all temporal units of the stream.
3378
3379 rawvideo
3380
3381 Raw uncompressed video.
3382
3383 Extensions: yuv, rgb
3384
3385 sbc
3386
3387 Bluetooth SIG low-complexity subband codec audio.
3388
3389 Extensions: sbc, msbc
3390
3391 truehd
3392
3393 Dolby TrueHD audio.
3394
3395 Extensions: thd
3396
3397 vc1
3398
3399 SMPTE 421M / VC-1 video.
3400
3401 segment, stream_segment, ssegment
3402 Basic stream segmenter.
3403
3404 This muxer outputs streams to a number of separate files of nearly
3405 fixed duration. Output filename pattern can be set in a fashion similar
3406 to image2, or by using a "strftime" template if the strftime option is
3407 enabled.
3408
3409 "stream_segment" is a variant of the muxer used to write to streaming
3410 output formats, i.e. which do not require global headers, and is
3411 recommended for outputting e.g. to MPEG transport stream segments.
3412 "ssegment" is a shorter alias for "stream_segment".
3413
3414 Every segment starts with a keyframe of the selected reference stream,
3415 which is set through the reference_stream option.
3416
3417 Note that if you want accurate splitting for a video file, you need to
3418 make the input key frames correspond to the exact splitting times
3419 expected by the segmenter, or the segment muxer will start the new
3420 segment with the key frame found next after the specified start time.
3421
3422 The segment muxer works best with a single constant frame rate video.
3423
3424 Optionally it can generate a list of the created segments, by setting
3425 the option segment_list. The list type is specified by the
3426 segment_list_type option. The entry filenames in the segment list are
3427 set by default to the basename of the corresponding segment files.
3428
3429 See also the hls muxer, which provides a more specific implementation
3430 for HLS segmentation.
3431
3432 Options
3433
3434 The segment muxer supports the following options:
3435
3436 increment_tc 1|0
3437 if set to 1, increment timecode between each segment If this is
3438 selected, the input need to have a timecode in the first video
3439 stream. Default value is 0.
3440
3441 reference_stream specifier
3442 Set the reference stream, as specified by the string specifier. If
3443 specifier is set to "auto", the reference is chosen automatically.
3444 Otherwise it must be a stream specifier (see the ``Stream
3445 specifiers'' chapter in the ffmpeg manual) which specifies the
3446 reference stream. The default value is "auto".
3447
3448 segment_format format
3449 Override the inner container format, by default it is guessed by
3450 the filename extension.
3451
3452 segment_format_options options_list
3453 Set output format options using a :-separated list of key=value
3454 parameters. Values containing the ":" special character must be
3455 escaped.
3456
3457 segment_list name
3458 Generate also a listfile named name. If not specified no listfile
3459 is generated.
3460
3461 segment_list_flags flags
3462 Set flags affecting the segment list generation.
3463
3464 It currently supports the following flags:
3465
3466 cache
3467 Allow caching (only affects M3U8 list files).
3468
3469 live
3470 Allow live-friendly file generation.
3471
3472 segment_list_size size
3473 Update the list file so that it contains at most size segments. If
3474 0 the list file will contain all the segments. Default value is 0.
3475
3476 segment_list_entry_prefix prefix
3477 Prepend prefix to each entry. Useful to generate absolute paths.
3478 By default no prefix is applied.
3479
3480 segment_list_type type
3481 Select the listing format.
3482
3483 The following values are recognized:
3484
3485 flat
3486 Generate a flat list for the created segments, one segment per
3487 line.
3488
3489 csv, ext
3490 Generate a list for the created segments, one segment per line,
3491 each line matching the format (comma-separated values):
3492
3493 <segment_filename>,<segment_start_time>,<segment_end_time>
3494
3495 segment_filename is the name of the output file generated by
3496 the muxer according to the provided pattern. CSV escaping
3497 (according to RFC4180) is applied if required.
3498
3499 segment_start_time and segment_end_time specify the segment
3500 start and end time expressed in seconds.
3501
3502 A list file with the suffix ".csv" or ".ext" will auto-select
3503 this format.
3504
3505 ext is deprecated in favor or csv.
3506
3507 ffconcat
3508 Generate an ffconcat file for the created segments. The
3509 resulting file can be read using the FFmpeg concat demuxer.
3510
3511 A list file with the suffix ".ffcat" or ".ffconcat" will auto-
3512 select this format.
3513
3514 m3u8
3515 Generate an extended M3U8 file, version 3, compliant with
3516 <http://tools.ietf.org/id/draft-pantos-http-live-streaming>.
3517
3518 A list file with the suffix ".m3u8" will auto-select this
3519 format.
3520
3521 If not specified the type is guessed from the list file name
3522 suffix.
3523
3524 segment_time time
3525 Set segment duration to time, the value must be a duration
3526 specification. Default value is "2". See also the segment_times
3527 option.
3528
3529 Note that splitting may not be accurate, unless you force the
3530 reference stream key-frames at the given time. See the introductory
3531 notice and the examples below.
3532
3533 segment_atclocktime 1|0
3534 If set to "1" split at regular clock time intervals starting from
3535 00:00 o'clock. The time value specified in segment_time is used for
3536 setting the length of the splitting interval.
3537
3538 For example with segment_time set to "900" this makes it possible
3539 to create files at 12:00 o'clock, 12:15, 12:30, etc.
3540
3541 Default value is "0".
3542
3543 segment_clocktime_offset duration
3544 Delay the segment splitting times with the specified duration when
3545 using segment_atclocktime.
3546
3547 For example with segment_time set to "900" and
3548 segment_clocktime_offset set to "300" this makes it possible to
3549 create files at 12:05, 12:20, 12:35, etc.
3550
3551 Default value is "0".
3552
3553 segment_clocktime_wrap_duration duration
3554 Force the segmenter to only start a new segment if a packet reaches
3555 the muxer within the specified duration after the segmenting clock
3556 time. This way you can make the segmenter more resilient to
3557 backward local time jumps, such as leap seconds or transition to
3558 standard time from daylight savings time.
3559
3560 Default is the maximum possible duration which means starting a new
3561 segment regardless of the elapsed time since the last clock time.
3562
3563 segment_time_delta delta
3564 Specify the accuracy time when selecting the start time for a
3565 segment, expressed as a duration specification. Default value is
3566 "0".
3567
3568 When delta is specified a key-frame will start a new segment if its
3569 PTS satisfies the relation:
3570
3571 PTS >= start_time - time_delta
3572
3573 This option is useful when splitting video content, which is always
3574 split at GOP boundaries, in case a key frame is found just before
3575 the specified split time.
3576
3577 In particular may be used in combination with the ffmpeg option
3578 force_key_frames. The key frame times specified by force_key_frames
3579 may not be set accurately because of rounding issues, with the
3580 consequence that a key frame time may result set just before the
3581 specified time. For constant frame rate videos a value of
3582 1/(2*frame_rate) should address the worst case mismatch between the
3583 specified time and the time set by force_key_frames.
3584
3585 segment_times times
3586 Specify a list of split points. times contains a list of comma
3587 separated duration specifications, in increasing order. See also
3588 the segment_time option.
3589
3590 segment_frames frames
3591 Specify a list of split video frame numbers. frames contains a list
3592 of comma separated integer numbers, in increasing order.
3593
3594 This option specifies to start a new segment whenever a reference
3595 stream key frame is found and the sequential number (starting from
3596 0) of the frame is greater or equal to the next value in the list.
3597
3598 segment_wrap limit
3599 Wrap around segment index once it reaches limit.
3600
3601 segment_start_number number
3602 Set the sequence number of the first segment. Defaults to 0.
3603
3604 strftime 1|0
3605 Use the "strftime" function to define the name of the new segments
3606 to write. If this is selected, the output segment name must contain
3607 a "strftime" function template. Default value is 0.
3608
3609 break_non_keyframes 1|0
3610 If enabled, allow segments to start on frames other than keyframes.
3611 This improves behavior on some players when the time between
3612 keyframes is inconsistent, but may make things worse on others, and
3613 can cause some oddities during seeking. Defaults to 0.
3614
3615 reset_timestamps 1|0
3616 Reset timestamps at the beginning of each segment, so that each
3617 segment will start with near-zero timestamps. It is meant to ease
3618 the playback of the generated segments. May not work with some
3619 combinations of muxers/codecs. It is set to 0 by default.
3620
3621 initial_offset offset
3622 Specify timestamp offset to apply to the output packet timestamps.
3623 The argument must be a time duration specification, and defaults to
3624 0.
3625
3626 write_empty_segments 1|0
3627 If enabled, write an empty segment if there are no packets during
3628 the period a segment would usually span. Otherwise, the segment
3629 will be filled with the next packet written. Defaults to 0.
3630
3631 Make sure to require a closed GOP when encoding and to set the GOP size
3632 to fit your segment time constraint.
3633
3634 Examples
3635
3636 • Remux the content of file in.mkv to a list of segments out-000.nut,
3637 out-001.nut, etc., and write the list of generated segments to
3638 out.list:
3639
3640 ffmpeg -i in.mkv -codec hevc -flags +cgop -g 60 -map 0 -f segment -segment_list out.list out%03d.nut
3641
3642 • Segment input and set output format options for the output
3643 segments:
3644
3645 ffmpeg -i in.mkv -f segment -segment_time 10 -segment_format_options movflags=+faststart out%03d.mp4
3646
3647 • Segment the input file according to the split points specified by
3648 the segment_times option:
3649
3650 ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.csv -segment_times 1,2,3,5,8,13,21 out%03d.nut
3651
3652 • Use the ffmpeg force_key_frames option to force key frames in the
3653 input at the specified location, together with the segment option
3654 segment_time_delta to account for possible roundings operated when
3655 setting key frame times.
3656
3657 ffmpeg -i in.mkv -force_key_frames 1,2,3,5,8,13,21 -codec:v mpeg4 -codec:a pcm_s16le -map 0 \
3658 -f segment -segment_list out.csv -segment_times 1,2,3,5,8,13,21 -segment_time_delta 0.05 out%03d.nut
3659
3660 In order to force key frames on the input file, transcoding is
3661 required.
3662
3663 • Segment the input file by splitting the input file according to the
3664 frame numbers sequence specified with the segment_frames option:
3665
3666 ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.csv -segment_frames 100,200,300,500,800 out%03d.nut
3667
3668 • Convert the in.mkv to TS segments using the "libx264" and "aac"
3669 encoders:
3670
3671 ffmpeg -i in.mkv -map 0 -codec:v libx264 -codec:a aac -f ssegment -segment_list out.list out%03d.ts
3672
3673 • Segment the input file, and create an M3U8 live playlist (can be
3674 used as live HLS source):
3675
3676 ffmpeg -re -i in.mkv -codec copy -map 0 -f segment -segment_list playlist.m3u8 \
3677 -segment_list_flags +live -segment_time 10 out%03d.mkv
3678
3679 smoothstreaming
3680 Smooth Streaming muxer generates a set of files (Manifest, chunks)
3681 suitable for serving with conventional web server.
3682
3683 window_size
3684 Specify the number of fragments kept in the manifest. Default 0
3685 (keep all).
3686
3687 extra_window_size
3688 Specify the number of fragments kept outside of the manifest before
3689 removing from disk. Default 5.
3690
3691 lookahead_count
3692 Specify the number of lookahead fragments. Default 2.
3693
3694 min_frag_duration
3695 Specify the minimum fragment duration (in microseconds). Default
3696 5000000.
3697
3698 remove_at_exit
3699 Specify whether to remove all fragments when finished. Default 0
3700 (do not remove).
3701
3702 streamhash
3703 Per stream hash testing format.
3704
3705 This muxer computes and prints a cryptographic hash of all the input
3706 frames, on a per-stream basis. This can be used for equality checks
3707 without having to do a complete binary comparison.
3708
3709 By default audio frames are converted to signed 16-bit raw audio and
3710 video frames to raw video before computing the hash, but the output of
3711 explicit conversions to other codecs can also be used. Timestamps are
3712 ignored. It uses the SHA-256 cryptographic hash function by default,
3713 but supports several other algorithms.
3714
3715 The output of the muxer consists of one line per stream of the form:
3716 streamindex,streamtype,algo=hash, where streamindex is the index of the
3717 mapped stream, streamtype is a single character indicating the type of
3718 stream, algo is a short string representing the hash function used, and
3719 hash is a hexadecimal number representing the computed hash.
3720
3721 hash algorithm
3722 Use the cryptographic hash function specified by the string
3723 algorithm. Supported values include "MD5", "murmur3", "RIPEMD128",
3724 "RIPEMD160", "RIPEMD256", "RIPEMD320", "SHA160", "SHA224", "SHA256"
3725 (default), "SHA512/224", "SHA512/256", "SHA384", "SHA512", "CRC32"
3726 and "adler32".
3727
3728 Examples
3729
3730 To compute the SHA-256 hash of the input converted to raw audio and
3731 video, and store it in the file out.sha256:
3732
3733 ffmpeg -i INPUT -f streamhash out.sha256
3734
3735 To print an MD5 hash to stdout use the command:
3736
3737 ffmpeg -i INPUT -f streamhash -hash md5 -
3738
3739 See also the hash and framehash muxers.
3740
3741 tee
3742 The tee muxer can be used to write the same data to several outputs,
3743 such as files or streams. It can be used, for example, to stream a
3744 video over a network and save it to disk at the same time.
3745
3746 It is different from specifying several outputs to the ffmpeg command-
3747 line tool. With the tee muxer, the audio and video data will be encoded
3748 only once. With conventional multiple outputs, multiple encoding
3749 operations in parallel are initiated, which can be a very expensive
3750 process. The tee muxer is not useful when using the libavformat API
3751 directly because it is then possible to feed the same packets to
3752 several muxers directly.
3753
3754 Since the tee muxer does not represent any particular output format,
3755 ffmpeg cannot auto-select output streams. So all streams intended for
3756 output must be specified using "-map". See the examples below.
3757
3758 Some encoders may need different options depending on the output
3759 format; the auto-detection of this can not work with the tee muxer, so
3760 they need to be explicitly specified. The main example is the
3761 global_header flag.
3762
3763 The slave outputs are specified in the file name given to the muxer,
3764 separated by '|'. If any of the slave name contains the '|' separator,
3765 leading or trailing spaces or any special character, those must be
3766 escaped (see the "Quoting and escaping" section in the ffmpeg-utils(1)
3767 manual).
3768
3769 Options
3770
3771 use_fifo bool
3772 If set to 1, slave outputs will be processed in separate threads
3773 using the fifo muxer. This allows to compensate for different
3774 speed/latency/reliability of outputs and setup transparent
3775 recovery. By default this feature is turned off.
3776
3777 fifo_options
3778 Options to pass to fifo pseudo-muxer instances. See fifo.
3779
3780 Muxer options can be specified for each slave by prepending them as a
3781 list of key=value pairs separated by ':', between square brackets. If
3782 the options values contain a special character or the ':' separator,
3783 they must be escaped; note that this is a second level escaping.
3784
3785 The following special options are also recognized:
3786
3787 f Specify the format name. Required if it cannot be guessed from the
3788 output URL.
3789
3790 bsfs[/spec]
3791 Specify a list of bitstream filters to apply to the specified
3792 output.
3793
3794 It is possible to specify to which streams a given bitstream filter
3795 applies, by appending a stream specifier to the option separated by
3796 "/". spec must be a stream specifier (see Format stream
3797 specifiers).
3798
3799 If the stream specifier is not specified, the bitstream filters
3800 will be applied to all streams in the output. This will cause that
3801 output operation to fail if the output contains streams to which
3802 the bitstream filter cannot be applied e.g. "h264_mp4toannexb"
3803 being applied to an output containing an audio stream.
3804
3805 Options for a bitstream filter must be specified in the form of
3806 "opt=value".
3807
3808 Several bitstream filters can be specified, separated by ",".
3809
3810 use_fifo bool
3811 This allows to override tee muxer use_fifo option for individual
3812 slave muxer.
3813
3814 fifo_options
3815 This allows to override tee muxer fifo_options for individual slave
3816 muxer. See fifo.
3817
3818 select
3819 Select the streams that should be mapped to the slave output,
3820 specified by a stream specifier. If not specified, this defaults to
3821 all the mapped streams. This will cause that output operation to
3822 fail if the output format does not accept all mapped streams.
3823
3824 You may use multiple stream specifiers separated by commas (",")
3825 e.g.: "a:0,v"
3826
3827 onfail
3828 Specify behaviour on output failure. This can be set to either
3829 "abort" (which is default) or "ignore". "abort" will cause whole
3830 process to fail in case of failure on this slave output. "ignore"
3831 will ignore failure on this output, so other outputs will continue
3832 without being affected.
3833
3834 Examples
3835
3836 • Encode something and both archive it in a WebM file and stream it
3837 as MPEG-TS over UDP:
3838
3839 ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 0:a
3840 "archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/"
3841
3842 • As above, but continue streaming even if output to local file fails
3843 (for example local drive fills up):
3844
3845 ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 0:a
3846 "[onfail=ignore]archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/"
3847
3848 • Use ffmpeg to encode the input, and send the output to three
3849 different destinations. The "dump_extra" bitstream filter is used
3850 to add extradata information to all the output video keyframes
3851 packets, as requested by the MPEG-TS format. The select option is
3852 applied to out.aac in order to make it contain only audio packets.
3853
3854 ffmpeg -i ... -map 0 -flags +global_header -c:v libx264 -c:a aac
3855 -f tee "[bsfs/v=dump_extra=freq=keyframe]out.ts|[movflags=+faststart]out.mp4|[select=a]out.aac"
3856
3857 • As above, but select only stream "a:1" for the audio output. Note
3858 that a second level escaping must be performed, as ":" is a special
3859 character used to separate options.
3860
3861 ffmpeg -i ... -map 0 -flags +global_header -c:v libx264 -c:a aac
3862 -f tee "[bsfs/v=dump_extra=freq=keyframe]out.ts|[movflags=+faststart]out.mp4|[select=\'a:1\']out.aac"
3863
3864 webm_chunk
3865 WebM Live Chunk Muxer.
3866
3867 This muxer writes out WebM headers and chunks as separate files which
3868 can be consumed by clients that support WebM Live streams via DASH.
3869
3870 Options
3871
3872 This muxer supports the following options:
3873
3874 chunk_start_index
3875 Index of the first chunk (defaults to 0).
3876
3877 header
3878 Filename of the header where the initialization data will be
3879 written.
3880
3881 audio_chunk_duration
3882 Duration of each audio chunk in milliseconds (defaults to 5000).
3883
3884 Example
3885
3886 ffmpeg -f v4l2 -i /dev/video0 \
3887 -f alsa -i hw:0 \
3888 -map 0:0 \
3889 -c:v libvpx-vp9 \
3890 -s 640x360 -keyint_min 30 -g 30 \
3891 -f webm_chunk \
3892 -header webm_live_video_360.hdr \
3893 -chunk_start_index 1 \
3894 webm_live_video_360_%d.chk \
3895 -map 1:0 \
3896 -c:a libvorbis \
3897 -b:a 128k \
3898 -f webm_chunk \
3899 -header webm_live_audio_128.hdr \
3900 -chunk_start_index 1 \
3901 -audio_chunk_duration 1000 \
3902 webm_live_audio_128_%d.chk
3903
3904 webm_dash_manifest
3905 WebM DASH Manifest muxer.
3906
3907 This muxer implements the WebM DASH Manifest specification to generate
3908 the DASH manifest XML. It also supports manifest generation for DASH
3909 live streams.
3910
3911 For more information see:
3912
3913 • WebM DASH Specification:
3914 <https://sites.google.com/a/webmproject.org/wiki/adaptive-streaming/webm-dash-specification>
3915
3916 • ISO DASH Specification:
3917 <http://standards.iso.org/ittf/PubliclyAvailableStandards/c065274_ISO_IEC_23009-1_2014.zip>
3918
3919 Options
3920
3921 This muxer supports the following options:
3922
3923 adaptation_sets
3924 This option has the following syntax: "id=x,streams=a,b,c
3925 id=y,streams=d,e" where x and y are the unique identifiers of the
3926 adaptation sets and a,b,c,d and e are the indices of the
3927 corresponding audio and video streams. Any number of adaptation
3928 sets can be added using this option.
3929
3930 live
3931 Set this to 1 to create a live stream DASH Manifest. Default: 0.
3932
3933 chunk_start_index
3934 Start index of the first chunk. This will go in the startNumber
3935 attribute of the SegmentTemplate element in the manifest. Default:
3936 0.
3937
3938 chunk_duration_ms
3939 Duration of each chunk in milliseconds. This will go in the
3940 duration attribute of the SegmentTemplate element in the manifest.
3941 Default: 1000.
3942
3943 utc_timing_url
3944 URL of the page that will return the UTC timestamp in ISO format.
3945 This will go in the value attribute of the UTCTiming element in the
3946 manifest. Default: None.
3947
3948 time_shift_buffer_depth
3949 Smallest time (in seconds) shifting buffer for which any
3950 Representation is guaranteed to be available. This will go in the
3951 timeShiftBufferDepth attribute of the MPD element. Default: 60.
3952
3953 minimum_update_period
3954 Minimum update period (in seconds) of the manifest. This will go in
3955 the minimumUpdatePeriod attribute of the MPD element. Default: 0.
3956
3957 Example
3958
3959 ffmpeg -f webm_dash_manifest -i video1.webm \
3960 -f webm_dash_manifest -i video2.webm \
3961 -f webm_dash_manifest -i audio1.webm \
3962 -f webm_dash_manifest -i audio2.webm \
3963 -map 0 -map 1 -map 2 -map 3 \
3964 -c copy \
3965 -f webm_dash_manifest \
3966 -adaptation_sets "id=0,streams=0,1 id=1,streams=2,3" \
3967 manifest.xml
3968
3970 FFmpeg is able to dump metadata from media files into a simple
3971 UTF-8-encoded INI-like text file and then load it back using the
3972 metadata muxer/demuxer.
3973
3974 The file format is as follows:
3975
3976 1. A file consists of a header and a number of metadata tags divided
3977 into sections, each on its own line.
3978
3979 2. The header is a ;FFMETADATA string, followed by a version number
3980 (now 1).
3981
3982 3. Metadata tags are of the form key=value
3983
3984 4. Immediately after header follows global metadata
3985
3986 5. After global metadata there may be sections with
3987 per-stream/per-chapter metadata.
3988
3989 6. A section starts with the section name in uppercase (i.e. STREAM or
3990 CHAPTER) in brackets ([, ]) and ends with next section or end of
3991 file.
3992
3993 7. At the beginning of a chapter section there may be an optional
3994 timebase to be used for start/end values. It must be in form
3995 TIMEBASE=num/den, where num and den are integers. If the timebase
3996 is missing then start/end times are assumed to be in nanoseconds.
3997
3998 Next a chapter section must contain chapter start and end times in
3999 form START=num, END=num, where num is a positive integer.
4000
4001 8. Empty lines and lines starting with ; or # are ignored.
4002
4003 9. Metadata keys or values containing special characters (=, ;, #, \
4004 and a newline) must be escaped with a backslash \.
4005
4006 10. Note that whitespace in metadata (e.g. foo = bar) is considered to
4007 be a part of the tag (in the example above key is foo , value is
4008 bar).
4009
4010 A ffmetadata file might look like this:
4011
4012 ;FFMETADATA1
4013 title=bike\\shed
4014 ;this is a comment
4015 artist=FFmpeg troll team
4016
4017 [CHAPTER]
4018 TIMEBASE=1/1000
4019 START=0
4020 #chapter ends at 0:01:00
4021 END=60000
4022 title=chapter \#1
4023 [STREAM]
4024 title=multi\
4025 line
4026
4027 By using the ffmetadata muxer and demuxer it is possible to extract
4028 metadata from an input file to an ffmetadata file, and then transcode
4029 the file into an output file with the edited ffmetadata file.
4030
4031 Extracting an ffmetadata file with ffmpeg goes as follows:
4032
4033 ffmpeg -i INPUT -f ffmetadata FFMETADATAFILE
4034
4035 Reinserting edited metadata information from the FFMETADATAFILE file
4036 can be done as:
4037
4038 ffmpeg -i INPUT -i FFMETADATAFILE -map_metadata 1 -codec copy OUTPUT
4039
4041 ffmpeg(1), ffplay(1), ffprobe(1), libavformat(3)
4042
4044 The FFmpeg developers.
4045
4046 For details about the authorship, see the Git history of the project
4047 (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command git log in
4048 the FFmpeg source directory, or browsing the online repository at
4049 <http://source.ffmpeg.org>.
4050
4051 Maintainers for the specific components are listed in the file
4052 MAINTAINERS in the source code tree.
4053
4054
4055
4056 FFMPEG-FORMATS(1)