| 
									
										
										
										
											2011-01-09 10:22:21 +00:00
										 |  |  | @chapter Demuxers | 
					
						
							|  |  |  | @c man begin DEMUXERS | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-03-17 16:55:58 +01:00
										 |  |  | Demuxers are configured elements in FFmpeg which allow to read the | 
					
						
							| 
									
										
										
										
											2011-01-09 10:22:21 +00:00
										 |  |  | multimedia streams from a particular type of file. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-03-17 16:55:58 +01:00
										 |  |  | When you configure your FFmpeg build, all the supported demuxers | 
					
						
							| 
									
										
										
										
											2011-01-09 10:22:21 +00:00
										 |  |  | are enabled by default. You can list all available ones using the | 
					
						
							|  |  |  | configure option "--list-demuxers". | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | You can disable all the demuxers using the configure option | 
					
						
							|  |  |  | "--disable-demuxers", and selectively enable a single demuxer with | 
					
						
							|  |  |  | the option "--enable-demuxer=@var{DEMUXER}", or disable it | 
					
						
							|  |  |  | with the option "--disable-demuxer=@var{DEMUXER}". | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | The option "-formats" of the ff* tools will display the list of | 
					
						
							|  |  |  | enabled demuxers. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | The description of some of the currently available demuxers follows. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-01-09 10:22:23 +00:00
										 |  |  | @section image2 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Image file demuxer. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | This demuxer reads from a list of image files specified by a pattern. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-01-21 13:54:14 +01:00
										 |  |  | The pattern may contain the string "%d" or "%0@var{N}d", which | 
					
						
							|  |  |  | specifies the position of the characters representing a sequential | 
					
						
							| 
									
										
										
										
											2011-01-09 10:22:23 +00:00
										 |  |  | number in each filename matched by the pattern. If the form | 
					
						
							|  |  |  | "%d0@var{N}d" is used, the string representing the number in each | 
					
						
							|  |  |  | filename is 0-padded and @var{N} is the total number of 0-padded | 
					
						
							|  |  |  | digits representing the number. The literal character '%' can be | 
					
						
							|  |  |  | specified in the pattern with the string "%%". | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-01-21 13:54:14 +01:00
										 |  |  | If the pattern contains "%d" or "%0@var{N}d", the first filename of | 
					
						
							|  |  |  | the file list specified by the pattern must contain a number | 
					
						
							|  |  |  | inclusively contained between 0 and 4, all the following numbers must | 
					
						
							|  |  |  | be sequential. This limitation may be hopefully fixed. | 
					
						
							| 
									
										
										
										
											2011-01-09 10:22:23 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | The pattern may contain a suffix which is used to automatically | 
					
						
							|  |  |  | determine the format of the images contained in the files. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | For example the pattern "img-%03d.bmp" will match a sequence of | 
					
						
							|  |  |  | filenames of the form @file{img-001.bmp}, @file{img-002.bmp}, ..., | 
					
						
							|  |  |  | @file{img-010.bmp}, etc.; the pattern "i%%m%%g-%d.jpg" will match a | 
					
						
							|  |  |  | sequence of filenames of the form @file{i%m%g-1.jpg}, | 
					
						
							|  |  |  | @file{i%m%g-2.jpg}, ..., @file{i%m%g-10.jpg}, etc. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | The size, the pixel format, and the format of each image must be the | 
					
						
							|  |  |  | same for all the files in the sequence. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-12-10 01:25:15 +01:00
										 |  |  | The following example shows how to use @command{ffmpeg} for creating a | 
					
						
							| 
									
										
										
										
											2011-01-09 10:22:23 +00:00
										 |  |  | video from the images in the file sequence @file{img-001.jpeg}, | 
					
						
							| 
									
										
										
										
											2011-11-29 17:54:49 +01:00
										 |  |  | @file{img-002.jpeg}, ..., assuming an input frame rate of 10 frames per | 
					
						
							| 
									
										
										
										
											2011-01-09 10:22:23 +00:00
										 |  |  | second: | 
					
						
							|  |  |  | @example | 
					
						
							| 
									
										
										
										
											2011-12-10 01:25:15 +01:00
										 |  |  | ffmpeg -i 'img-%03d.jpeg' -r 10 out.mkv | 
					
						
							| 
									
										
										
										
											2011-01-09 10:22:23 +00:00
										 |  |  | @end example | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-01-21 13:54:14 +01:00
										 |  |  | Note that the pattern must not necessarily contain "%d" or | 
					
						
							|  |  |  | "%0@var{N}d", for example to convert a single image file | 
					
						
							|  |  |  | @file{img.jpeg} you can employ the command: | 
					
						
							|  |  |  | @example | 
					
						
							| 
									
										
										
										
											2011-12-10 01:25:15 +01:00
										 |  |  | ffmpeg -i img.jpeg img.png | 
					
						
							| 
									
										
										
										
											2011-01-21 13:54:14 +01:00
										 |  |  | @end example | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-04-20 23:04:31 +03:00
										 |  |  | @section applehttp | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Apple HTTP Live Streaming demuxer. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | This demuxer presents all AVStreams from all variant streams. | 
					
						
							|  |  |  | The id field is set to the bitrate variant index number. By setting | 
					
						
							|  |  |  | the discard flags on AVStreams (by pressing 'a' or 'v' in ffplay), | 
					
						
							|  |  |  | the caller can decide which variant streams to actually receive. | 
					
						
							| 
									
										
										
										
											2011-04-20 10:10:10 +03:00
										 |  |  | The total bitrate of the variant that the stream belongs to is | 
					
						
							|  |  |  | available in a metadata key named "variant_bitrate". | 
					
						
							| 
									
										
										
										
											2011-04-20 23:04:31 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-11-02 16:30:27 +01:00
										 |  |  | @section sbg | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | SBaGen script demuxer. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | This demuxer reads the script language used by SBaGen | 
					
						
							|  |  |  | @url{http://uazu.net/sbagen/} to generate binaural beats sessions. A SBG | 
					
						
							|  |  |  | script looks like that: | 
					
						
							|  |  |  | @example | 
					
						
							|  |  |  | -SE | 
					
						
							|  |  |  | a: 300-2.5/3 440+4.5/0 | 
					
						
							|  |  |  | b: 300-2.5/0 440+4.5/3 | 
					
						
							|  |  |  | off: - | 
					
						
							|  |  |  | NOW      == a | 
					
						
							|  |  |  | +0:07:00 == b | 
					
						
							|  |  |  | +0:14:00 == a | 
					
						
							|  |  |  | +0:21:00 == b | 
					
						
							|  |  |  | +0:30:00    off | 
					
						
							|  |  |  | @end example | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | A SBG script can mix absolute and relative timestamps. If the script uses | 
					
						
							|  |  |  | either only absolute timestamps (including the script start time) or only | 
					
						
							|  |  |  | relative ones, then its layout is fixed, and the conversion is | 
					
						
							|  |  |  | straightforward. On the other hand, if the script mixes both kind of | 
					
						
							|  |  |  | timestamps, then the @var{NOW} reference for relative timestamps will be | 
					
						
							|  |  |  | taken from the current time of day at the time the script is read, and the | 
					
						
							|  |  |  | script layout will be frozen according to that reference. That means that if | 
					
						
							|  |  |  | the script is directly played, the actual times will match the absolute | 
					
						
							|  |  |  | timestamps up to the sound controller's clock accuracy, but if the user | 
					
						
							|  |  |  | somehow pauses the playback or seeks, all times will be shifted accordingly. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-01-09 10:22:21 +00:00
										 |  |  | @c man end INPUT DEVICES |