Compare commits
	
		
			266 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					1fd7fb9036 | ||
| 
						 | 
					9cc1d21e76 | ||
| 
						 | 
					0b0293ceaf | ||
| 
						 | 
					1b3332659a | ||
| 
						 | 
					07c9df792c | ||
| 
						 | 
					3b4e9dddcf | ||
| 
						 | 
					2ba1af5791 | ||
| 
						 | 
					51e880fed9 | ||
| 
						 | 
					86f4ac9365 | ||
| 
						 | 
					fe457ce4d1 | ||
| 
						 | 
					4506958289 | ||
| 
						 | 
					6300790144 | ||
| 
						 | 
					20a4cf0d09 | ||
| 
						 | 
					54b76eb595 | ||
| 
						 | 
					0787163cf3 | ||
| 
						 | 
					134ff88c6a | ||
| 
						 | 
					e2e145db89 | ||
| 
						 | 
					efdd30df06 | ||
| 
						 | 
					54e3aff10e | ||
| 
						 | 
					d9ec3070d1 | ||
| 
						 | 
					6ac156864c | ||
| 
						 | 
					0775653b4c | ||
| 
						 | 
					33c8bb2c6a | ||
| 
						 | 
					883795fb0f | ||
| 
						 | 
					849f55368c | ||
| 
						 | 
					b86c2640f6 | ||
| 
						 | 
					9b9411c1cf | ||
| 
						 | 
					54825047ab | ||
| 
						 | 
					a7c18b628f | ||
| 
						 | 
					81754d8f8b | ||
| 
						 | 
					36e6842aa6 | ||
| 
						 | 
					47e4a1ac6d | ||
| 
						 | 
					a058cbcfdf | ||
| 
						 | 
					4895211635 | ||
| 
						 | 
					58dc526ebf | ||
| 
						 | 
					eac49477aa | ||
| 
						 | 
					69a930b988 | ||
| 
						 | 
					55788572ea | ||
| 
						 | 
					aa7a19b417 | ||
| 
						 | 
					577f1feb3f | ||
| 
						 | 
					4afe2684d8 | ||
| 
						 | 
					5d1d143a4e | ||
| 
						 | 
					820f41e1a1 | ||
| 
						 | 
					14d6ea0c45 | ||
| 
						 | 
					0fb2b61614 | ||
| 
						 | 
					0d277be45a | ||
| 
						 | 
					3b332ef33c | ||
| 
						 | 
					787e4d12da | ||
| 
						 | 
					95c298b125 | ||
| 
						 | 
					fd72ff6f31 | ||
| 
						 | 
					82db2f2ac8 | ||
| 
						 | 
					f36b3c5df9 | ||
| 
						 | 
					117dcc2097 | ||
| 
						 | 
					c4e18917d4 | ||
| 
						 | 
					03fbc282ff | ||
| 
						 | 
					f30a89e15f | ||
| 
						 | 
					3ea49fc508 | ||
| 
						 | 
					9bafd6a8f6 | ||
| 
						 | 
					396195c505 | ||
| 
						 | 
					e2324b5b37 | ||
| 
						 | 
					bb97f243ba | ||
| 
						 | 
					b6dc16bd95 | ||
| 
						 | 
					a9c77e5c22 | ||
| 
						 | 
					de882ec2b1 | ||
| 
						 | 
					bd62554ad2 | ||
| 
						 | 
					cd51f41791 | ||
| 
						 | 
					da811dfc93 | ||
| 
						 | 
					dce726f091 | ||
| 
						 | 
					ea5b4c682c | ||
| 
						 | 
					65d426bddd | ||
| 
						 | 
					64fdce7802 | ||
| 
						 | 
					195e8ecacc | ||
| 
						 | 
					a4ffcf024e | ||
| 
						 | 
					da52c0ebc6 | ||
| 
						 | 
					8815ddc29f | ||
| 
						 | 
					5ceae49caf | ||
| 
						 | 
					864c0c50eb | ||
| 
						 | 
					89dbef7329 | ||
| 
						 | 
					93df243a59 | ||
| 
						 | 
					db61d34e83 | ||
| 
						 | 
					309609ce4d | ||
| 
						 | 
					6607057d0e | ||
| 
						 | 
					575dc3a1b2 | ||
| 
						 | 
					1cc6fef067 | ||
| 
						 | 
					60ccc1a748 | ||
| 
						 | 
					b31a3c6f26 | ||
| 
						 | 
					ce99ef48ea | ||
| 
						 | 
					dd2394754d | ||
| 
						 | 
					883f3e18dd | ||
| 
						 | 
					06336ce760 | ||
| 
						 | 
					6f580e8735 | ||
| 
						 | 
					5c2d8bbffa | ||
| 
						 | 
					4b8f3c5bf3 | ||
| 
						 | 
					18dba3d80d | ||
| 
						 | 
					2ba17ac96c | ||
| 
						 | 
					12e064d6c2 | ||
| 
						 | 
					f2595a6c38 | ||
| 
						 | 
					a654f483cd | ||
| 
						 | 
					991a203479 | ||
| 
						 | 
					8524009161 | ||
| 
						 | 
					47f345de1d | ||
| 
						 | 
					af0a95ee03 | ||
| 
						 | 
					2abc6e930b | ||
| 
						 | 
					3bb48296ef | ||
| 
						 | 
					a3fdc0b35b | ||
| 
						 | 
					cf8b91a28e | ||
| 
						 | 
					cfda2a677c | ||
| 
						 | 
					11dfd1fa20 | ||
| 
						 | 
					f7e9fcda2d | ||
| 
						 | 
					2719ba9ee3 | ||
| 
						 | 
					d48e0aed3c | ||
| 
						 | 
					89b52d25b4 | ||
| 
						 | 
					9984d492dc | ||
| 
						 | 
					56b84b023d | ||
| 
						 | 
					0e216ed407 | ||
| 
						 | 
					f783259fdb | ||
| 
						 | 
					b6691fba77 | ||
| 
						 | 
					15fd62110f | ||
| 
						 | 
					86b532898d | ||
| 
						 | 
					ca78ee73db | ||
| 
						 | 
					517ce1d09b | ||
| 
						 | 
					46a17d886b | ||
| 
						 | 
					944570906b | ||
| 
						 | 
					057ee35924 | ||
| 
						 | 
					e386241d54 | ||
| 
						 | 
					222236317b | ||
| 
						 | 
					633a2a082f | ||
| 
						 | 
					e5f5df37c8 | ||
| 
						 | 
					cc9c74ea87 | ||
| 
						 | 
					12700b0219 | ||
| 
						 | 
					3e0802e42b | ||
| 
						 | 
					56e11cbe32 | ||
| 
						 | 
					2be7d565bb | ||
| 
						 | 
					c7b64a904a | ||
| 
						 | 
					9798dc8061 | ||
| 
						 | 
					a5cc8775cf | ||
| 
						 | 
					f9ca1fecb0 | ||
| 
						 | 
					cd57d608a4 | ||
| 
						 | 
					043f326060 | ||
| 
						 | 
					9a641b909c | ||
| 
						 | 
					5405ba7b63 | ||
| 
						 | 
					70f6d553d9 | ||
| 
						 | 
					25fc3deed8 | ||
| 
						 | 
					a8a6cdfcd7 | ||
| 
						 | 
					39518589e7 | ||
| 
						 | 
					857e391697 | ||
| 
						 | 
					04aa2ffbcf | ||
| 
						 | 
					63523485f4 | ||
| 
						 | 
					35bc67503e | ||
| 
						 | 
					1f636a697f | ||
| 
						 | 
					24d725f455 | ||
| 
						 | 
					66fcf1fa40 | ||
| 
						 | 
					c7b7e0790c | ||
| 
						 | 
					3f3e5f8f60 | ||
| 
						 | 
					8e95ddbe82 | ||
| 
						 | 
					8cba067fe5 | ||
| 
						 | 
					73c6520c09 | ||
| 
						 | 
					ca47574e16 | ||
| 
						 | 
					045670a6f7 | ||
| 
						 | 
					30a0622a5d | ||
| 
						 | 
					e4d921dc71 | ||
| 
						 | 
					2185103bcd | ||
| 
						 | 
					bf7ee2524b | ||
| 
						 | 
					5a1efc7b85 | ||
| 
						 | 
					71af22097d | ||
| 
						 | 
					f3d34cff76 | ||
| 
						 | 
					81b38caf21 | ||
| 
						 | 
					20071ff1a4 | ||
| 
						 | 
					3b7db9c4f5 | ||
| 
						 | 
					0ddcee172e | ||
| 
						 | 
					13ecdb06f8 | ||
| 
						 | 
					ca8c62d187 | ||
| 
						 | 
					e443165c32 | ||
| 
						 | 
					0b41eeac45 | ||
| 
						 | 
					de31f85707 | ||
| 
						 | 
					d61454e7c1 | ||
| 
						 | 
					b02e4faa3e | ||
| 
						 | 
					09256527be | ||
| 
						 | 
					84d26ab6eb | ||
| 
						 | 
					1d99adc953 | ||
| 
						 | 
					67991f3a3e | ||
| 
						 | 
					32e8922faf | ||
| 
						 | 
					32dbd1f342 | ||
| 
						 | 
					eefc3ca7be | ||
| 
						 | 
					a16558e122 | ||
| 
						 | 
					506368f563 | ||
| 
						 | 
					c0c24bc9b3 | ||
| 
						 | 
					b89f279cd6 | ||
| 
						 | 
					7f90eef87a | ||
| 
						 | 
					71f0a3c4ad | ||
| 
						 | 
					d9bef14e41 | ||
| 
						 | 
					4b4ed88e89 | ||
| 
						 | 
					f6476944e1 | ||
| 
						 | 
					03d30d4c2c | ||
| 
						 | 
					853a27e345 | ||
| 
						 | 
					f7c0f8355e | ||
| 
						 | 
					6f5c505109 | ||
| 
						 | 
					b29f9897e3 | ||
| 
						 | 
					1d987a34d8 | ||
| 
						 | 
					6099d1ca0e | ||
| 
						 | 
					a9b9751bc8 | ||
| 
						 | 
					da5e52010c | ||
| 
						 | 
					e1fd837888 | ||
| 
						 | 
					1d10997488 | ||
| 
						 | 
					76a5cf1f80 | ||
| 
						 | 
					16c3d6d392 | ||
| 
						 | 
					9d79848f84 | ||
| 
						 | 
					b8d34604ff | ||
| 
						 | 
					7a02b9cb2d | ||
| 
						 | 
					ff6d440d10 | ||
| 
						 | 
					a88a57cd24 | ||
| 
						 | 
					0cda7baa8b | ||
| 
						 | 
					31baa6f199 | ||
| 
						 | 
					3b364ac18a | ||
| 
						 | 
					63660277fd | ||
| 
						 | 
					6101187c55 | ||
| 
						 | 
					91ff803a74 | ||
| 
						 | 
					4f4f78ea48 | ||
| 
						 | 
					ff24824a72 | ||
| 
						 | 
					570cefb02b | ||
| 
						 | 
					ce0972ecdd | ||
| 
						 | 
					09c848855a | ||
| 
						 | 
					e1ce4f805f | ||
| 
						 | 
					bb5c0ac922 | ||
| 
						 | 
					d389438296 | ||
| 
						 | 
					3b57d7769a | ||
| 
						 | 
					b7f2719951 | ||
| 
						 | 
					dc4e34a2f0 | ||
| 
						 | 
					d694ab846c | ||
| 
						 | 
					ab02548c8a | ||
| 
						 | 
					9eb442cca2 | ||
| 
						 | 
					b45ab61b24 | ||
| 
						 | 
					cc73b4f574 | ||
| 
						 | 
					8ac3b2cdb7 | ||
| 
						 | 
					ace90ee265 | ||
| 
						 | 
					703bd31647 | ||
| 
						 | 
					c16e80ee3d | ||
| 
						 | 
					66ac5b96e8 | ||
| 
						 | 
					547cad8c81 | ||
| 
						 | 
					55b1a1e9c1 | ||
| 
						 | 
					f851477889 | ||
| 
						 | 
					4f2d4b98fc | ||
| 
						 | 
					7d8ebb8774 | ||
| 
						 | 
					07b0ccf511 | ||
| 
						 | 
					9d3e69ae30 | ||
| 
						 | 
					480633c6c2 | ||
| 
						 | 
					b5d4f49e3c | ||
| 
						 | 
					4cde8bae49 | ||
| 
						 | 
					5b740d1eaa | ||
| 
						 | 
					152e09fde7 | ||
| 
						 | 
					110841c3ab | ||
| 
						 | 
					5694831e06 | ||
| 
						 | 
					1f52f82a55 | ||
| 
						 | 
					e62f08ca8d | ||
| 
						 | 
					ee099059e7 | ||
| 
						 | 
					e2a89f7f0f | ||
| 
						 | 
					7c46855074 | ||
| 
						 | 
					c2d6cc2971 | ||
| 
						 | 
					8c91414803 | ||
| 
						 | 
					0263750a0d | ||
| 
						 | 
					63795fe5b9 | ||
| 
						 | 
					d2bad216f7 | ||
| 
						 | 
					d04fb11868 | ||
| 
						 | 
					e8f2823f06 | ||
| 
						 | 
					7dfccac20c | ||
| 
						 | 
					04361427e6 | 
							
								
								
									
										5
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -28,7 +28,6 @@
 | 
			
		||||
/ffserver
 | 
			
		||||
/config.*
 | 
			
		||||
/coverage.info
 | 
			
		||||
/avversion.h
 | 
			
		||||
/doc/*.1
 | 
			
		||||
/doc/*.3
 | 
			
		||||
/doc/*.html
 | 
			
		||||
@@ -37,7 +36,6 @@
 | 
			
		||||
/doc/avoptions_codec.texi
 | 
			
		||||
/doc/avoptions_format.texi
 | 
			
		||||
/doc/doxy/html/
 | 
			
		||||
/doc/examples/avio_dir_cmd
 | 
			
		||||
/doc/examples/avio_reading
 | 
			
		||||
/doc/examples/decoding_encoding
 | 
			
		||||
/doc/examples/demuxing_decoding
 | 
			
		||||
@@ -63,11 +61,9 @@
 | 
			
		||||
/libavutil/ffversion.h
 | 
			
		||||
/tests/audiogen
 | 
			
		||||
/tests/base64
 | 
			
		||||
/tests/checkasm/checkasm
 | 
			
		||||
/tests/data/
 | 
			
		||||
/tests/pixfmts.mak
 | 
			
		||||
/tests/rotozoom
 | 
			
		||||
/tests/test_copy.ffmeta
 | 
			
		||||
/tests/tiny_psnr
 | 
			
		||||
/tests/tiny_ssim
 | 
			
		||||
/tests/videogen
 | 
			
		||||
@@ -86,7 +82,6 @@
 | 
			
		||||
/tools/pktdumper
 | 
			
		||||
/tools/probetest
 | 
			
		||||
/tools/qt-faststart
 | 
			
		||||
/tools/sidxindex
 | 
			
		||||
/tools/trasher
 | 
			
		||||
/tools/seek_print
 | 
			
		||||
/tools/uncoded_frame
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										611
									
								
								Changelog
									
									
									
									
									
								
							
							
						
						
									
										611
									
								
								Changelog
									
									
									
									
									
								
							@@ -1,454 +1,173 @@
 | 
			
		||||
Entries are sorted chronologically from oldest to youngest within each release,
 | 
			
		||||
releases are sorted from youngest to oldest.
 | 
			
		||||
 | 
			
		||||
version 2.8.7
 | 
			
		||||
- avcodec/motion_est: Attempt to fix "short data segment overflowed" on IA64
 | 
			
		||||
- avformat/ffmdec: Check pix_fmt
 | 
			
		||||
- avcodec/ttaenc: Reallocate packet if its too small
 | 
			
		||||
- pgssubdec: fix subpicture output colorspace and range
 | 
			
		||||
- avcodec/ac3dec: Reset SPX when switching from EAC3 to AC3
 | 
			
		||||
- avfilter/vf_drawtext: Check return code of load_glyph()
 | 
			
		||||
- avcodec/takdec: add code that got somehow lost in process of REing
 | 
			
		||||
- avcodec/apedec: fix decoding of stereo files with one channel full of silence
 | 
			
		||||
- avcodec/avpacket: Fix off by 5 error
 | 
			
		||||
- avcodec/h264: Fix for H.264 configuration parsing
 | 
			
		||||
- avcodec/bmp_parser: Ensure remaining_size is not too small in startcode packet crossing corner case
 | 
			
		||||
- avfilter/src_movie: fix how we check for overflows with seek_point
 | 
			
		||||
- avcodec/j2kenc: Add attribution to OpenJPEG project:
 | 
			
		||||
- avcodec/h264_slice: Check PPS more extensively when its not copied
 | 
			
		||||
- avcodec/libutvideodec: copy frame so it has reference counters when refcounted_frames is set
 | 
			
		||||
- avformat/rtpdec_jpeg: fix low contrast image on low quality setting
 | 
			
		||||
- avcodec/mjpegenc_common: Store approximate aspect if exact cannot be stored
 | 
			
		||||
- lavc/hevc: Allow arbitrary garbage in bytestream as long as at least one NAL unit is found.
 | 
			
		||||
- avcodec/resample: Remove disabled and faulty code
 | 
			
		||||
- indeo2: Fix banding artefacts
 | 
			
		||||
- indeo2data: K&R formatting cosmetics
 | 
			
		||||
- avcodec/imgconvert: Support non-planar colorspaces while padding
 | 
			
		||||
- avutil/random_seed: Add the runtime in cycles of the main loop to the entropy pool
 | 
			
		||||
- avutil/channel_layout: AV_CH_LAYOUT_6POINT1_BACK not reachable in parsing
 | 
			
		||||
- avformat/concatdec: set safe mode to enabled instead of auto
 | 
			
		||||
- avformat/utils: fix dts from pts code in compute_pkt_fields() during ascending delay
 | 
			
		||||
- avformat/rtpenc: Fix integer overflow in NTP_TO_RTP_FORMAT
 | 
			
		||||
- avformat/cache: Fix memleak of tree entries
 | 
			
		||||
- lavf/mov: downgrade sidx errors to non-fatal warnings; fixes trac #5216 (cherry picked from commit 22dbc1caaf13e4bb17c9e0164a5b1ccaf490e428)
 | 
			
		||||
- lavf/mov: fix sidx with edit lists (cherry picked from commit 3617e69d50dd9dd07b5011dfb9477a9d1a630354)
 | 
			
		||||
- avcodec/mjpegdec: Fix decoding slightly odd progressive jpeg
 | 
			
		||||
- libwebpenc_animencoder: print library messages in verbose log levels
 | 
			
		||||
- libwebpenc_animencoder: zero initialize the WebPAnimEncoderOptions struct
 | 
			
		||||
- doc/utils: fix typo for min() description
 | 
			
		||||
- avcodec/avpacket: clear priv in av_init_packet()
 | 
			
		||||
- swscale/utils: Fix chrSrcHSubSample for GBRAP16
 | 
			
		||||
- swscale/input: Fix GBRAP16 input
 | 
			
		||||
- postproc: fix unaligned access
 | 
			
		||||
- avutil/pixdesc: Make get_color_type() aware of CIE XYZ formats
 | 
			
		||||
- avcodec/h264: Execute error concealment before marking the frame as done.
 | 
			
		||||
- swscale/x86/output: Fix yuv2planeX_16* with unaligned destination
 | 
			
		||||
- swscale/x86/output: Move code into yuv2planeX_mainloop
 | 
			
		||||
- avutil/frame: Free destination qp_table_buf in frame_copy_props()
 | 
			
		||||
version <next>:
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
version 2.8.6
 | 
			
		||||
- avcodec/jpeg2000dec: More completely check cdef
 | 
			
		||||
- avutil/opt: check for and handle errors in av_opt_set_dict2()
 | 
			
		||||
- avcodec/flacenc: fix calculation of bits required in case of custom sample rate
 | 
			
		||||
- avformat: Document urls a bit
 | 
			
		||||
- avformat/libquvi: Set default demuxer and protocol limitations
 | 
			
		||||
- avformat/concat: Check protocol prefix
 | 
			
		||||
- doc/demuxers: Document enable_drefs and use_absolute_path
 | 
			
		||||
- avcodec/mjpegdec: Check for end for both bytes in unescaping
 | 
			
		||||
- avcodec/mpegvideo_enc: Check for integer overflow in ff_mpv_reallocate_putbitbuffer()
 | 
			
		||||
- avformat/avformat: Replace some references to filenames by urls
 | 
			
		||||
- avcodec/wmaenc: Check ff_wma_init() for failure
 | 
			
		||||
- avcodec/mpeg12enc: Move high resolution thread check to before initializing threads
 | 
			
		||||
- avformat/img2dec: Use AVOpenCallback
 | 
			
		||||
- avformat/avio: Limit url option parsing to the documented cases
 | 
			
		||||
- avformat/img2dec: do not interpret the filename by default if a IO context has been opened
 | 
			
		||||
- avcodec/ass_split: Fix null pointer dereference in ff_ass_style_get()
 | 
			
		||||
- mov: Add an option to toggle dref opening
 | 
			
		||||
- avcodec/gif: Fix lzw buffer size
 | 
			
		||||
- avcodec/put_bits: Assert buf_ptr in flush_put_bits()
 | 
			
		||||
- avcodec/tiff: Check subsample & rps values more completely
 | 
			
		||||
- swscale/swscale: Add some sanity checks for srcSlice* parameters
 | 
			
		||||
- swscale/x86/rgb2rgb_template: Fix planar2x() for short width
 | 
			
		||||
- swscale/swscale_unscaled: Fix odd height inputs for bayer_to_yv12_wrapper()
 | 
			
		||||
- swscale/swscale_unscaled: Fix odd height inputs for bayer_to_rgb24_wrapper()
 | 
			
		||||
- avcodec/aacenc: Check both channels for finiteness
 | 
			
		||||
- asfdec_o: check for too small size in asf_read_unknown
 | 
			
		||||
- asfdec_o: break if EOF is reached after asf_read_packet_header
 | 
			
		||||
- asfdec_o: make sure packet_size is non-zero before seeking
 | 
			
		||||
- asfdec_o: prevent overflow causing seekback
 | 
			
		||||
- asfdec_o: check avio_skip in asf_read_simple_index
 | 
			
		||||
- asfdec_o: reject size > INT64_MAX in asf_read_unknown
 | 
			
		||||
- asfdec_o: only set asf_pkt->data_size after sanity checks
 | 
			
		||||
- Merge commit '8375dc1dd101d51baa430f34c0bcadfa37873896'
 | 
			
		||||
- dca: fix misaligned access in avpriv_dca_convert_bitstream
 | 
			
		||||
- brstm: fix missing closing brace
 | 
			
		||||
- brstm: also allocate b->table in read_packet
 | 
			
		||||
- brstm: make sure an ADPC chunk was read for adpcm_thp
 | 
			
		||||
- vorbisdec: reject rangebits 0 with non-0 partitions
 | 
			
		||||
- vorbisdec: reject channel mapping with less than two channels
 | 
			
		||||
- ffmdec: reset packet_end in case of failure
 | 
			
		||||
- avformat/ipmovie: put video decoding_map_size into packet and use it in decoder
 | 
			
		||||
- avformat/brstm: fix overflow
 | 
			
		||||
version 2.4.6:
 | 
			
		||||
- doc/examples: fix lib math dep for decoding_encoding
 | 
			
		||||
- avformat/movenc: workaround bug in "PathScale EKOPath(tm) Compiler Suite Version 4.0.12.1"
 | 
			
		||||
- vp9: fix parser return values in error case
 | 
			
		||||
- ffmpeg: Clear error message array at init.
 | 
			
		||||
- avcodec/dvdsubdec: fix accessing dangling pointers
 | 
			
		||||
- avcodec/dvdsubdec: error on bitmaps with size 0
 | 
			
		||||
- avformat/mov: Fix mixed declaration and statement warning
 | 
			
		||||
- cmdutils: Use 64bit for file size/offset related variable in cmdutils_read_file()
 | 
			
		||||
- avformat/utils: Clear pointer in ff_alloc_extradata() to avoid leaving a stale pointer in memory
 | 
			
		||||
- avformat/matroskadec: Use av_freep() to avoid leaving stale pointers in memory
 | 
			
		||||
- lavfi: check av_strdup() return value
 | 
			
		||||
- mov: Fix negative size calculation in mov_read_default().
 | 
			
		||||
- avformat/mov: fix integer overflow in mov_read_udta_string()
 | 
			
		||||
- mov: Avoid overflow with mov_metadata_raw()
 | 
			
		||||
- avcodec/dvdsubdec: fix out of bounds accesses
 | 
			
		||||
- avfilter/vf_sab: fix filtering tiny images
 | 
			
		||||
- avformat/flvdec: Increase string array size
 | 
			
		||||
- avformat/flvdec: do not inject dts=0 metadata packets which failed to be parsed into a new data stream
 | 
			
		||||
- avformat/cdxl: Fix integer overflow of image_size
 | 
			
		||||
- avformat/segment: Use av_freep() avoid leaving stale pointers in memory
 | 
			
		||||
- avformat/mov: Fix memleaks for duplicate STCO/CO64/STSC atoms
 | 
			
		||||
- mov: avoid a memleak when multiple stss boxes are presen
 | 
			
		||||
 | 
			
		||||
version 2.4.5:
 | 
			
		||||
- lavu/frame: fix malloc error path in av_frame_copy_props()
 | 
			
		||||
- avformat/utils: Do not update programs streams from program-less streams in update_wrap_reference()
 | 
			
		||||
- avformat/aviobuf: Check that avio_seek() target is non negative
 | 
			
		||||
- swresample/soxr_resample: fix error handling
 | 
			
		||||
- avformat/flvdec: fix potential use of uninitialized variables
 | 
			
		||||
- avformat/matroskadec: fix handling of recursive SeekHead elements
 | 
			
		||||
- doc/examples/transcoding: check encoder before using it
 | 
			
		||||
- swscale/x86/rgb2rgb_template: fix crash with tiny size and nv12 output
 | 
			
		||||
- avformat/rmdec: Check codec_data_size
 | 
			
		||||
- avformat/aviobuf: Fix infinite loop in ff_get_line()
 | 
			
		||||
- vc1: Do not assume seek happens after decoding
 | 
			
		||||
- mmvideo: check frame dimensions
 | 
			
		||||
- jvdec: check frame dimensions
 | 
			
		||||
- avcodec/indeo3: ensure offsets are non negative
 | 
			
		||||
- avcodec/h264: Check *log2_weight_denom
 | 
			
		||||
- avcodec/hevc_ps: Check diff_cu_qp_delta_depth
 | 
			
		||||
- avcodec/h264: Clear delayed_pic on deallocation
 | 
			
		||||
- avcodec/hevc: clear filter_slice_edges() on allocation
 | 
			
		||||
- avcodec/dcadec: Check that the added xch channel isnt already there
 | 
			
		||||
- avcodec/indeo3: use signed variables to avoid underflow
 | 
			
		||||
- swscale: increase yuv2rgb table headroom
 | 
			
		||||
- avformat/mov: fix integer overflow of size
 | 
			
		||||
- avformat/mov: check atom nesting depth
 | 
			
		||||
- avcodec/utvideodec: Fix handling of slice_height=0
 | 
			
		||||
- avcodec/vmdvideo: Check len before using it in method 3
 | 
			
		||||
- avformat/flvdec: Use av_freep() avoid leaving stale pointers in memory
 | 
			
		||||
- avformat/hdsenc: Use av_freep() avoid leaving stale pointers in memory
 | 
			
		||||
- configure: create the tests directory like the doc directory
 | 
			
		||||
- v4l2: Make use of the VIDIOC_ENUM_FRAMESIZES ioctl on OpenBSD
 | 
			
		||||
- avcodec/motion_est: use 2x8x8 for interlaced qpel
 | 
			
		||||
- Treat all '*.pnm' files as non-text file
 | 
			
		||||
 | 
			
		||||
version 2.4.4:
 | 
			
		||||
- avformat: replace some odd 30-60 rates by higher less odd ones in  get_std_framerate()
 | 
			
		||||
- swscale: fix yuv2yuvX_8 assembly on x86
 | 
			
		||||
- avcodec/hevc_ps: Check num_long_term_ref_pics_sps
 | 
			
		||||
- avcodec/mjpegdec: Fix integer overflow in shift
 | 
			
		||||
- avcodec/hevc_ps: Check return code from pps_range_extensions()
 | 
			
		||||
- avcodec/rawdec: Check the return code of avpicture_get_size()
 | 
			
		||||
- avcodec/pngdec: Check IHDR/IDAT order
 | 
			
		||||
- avcodec/flacdec: Call ff_flacdsp_init() unconditionally
 | 
			
		||||
- avcodec/utils: Check that the data is complete in avpriv_bprint_to_extradata()
 | 
			
		||||
- avcodec/mjpegdec: Fix context fields becoming inconsistent
 | 
			
		||||
- avcodec/mjpegdec: Check for pixfmtid 0x42111100 || 0x24111100 with more than 8 bits
 | 
			
		||||
- swscale/x86/rgb2rgb_template: handle the first 2 lines with C in rgb24toyv12_*()
 | 
			
		||||
- doc/APIchanges: Fix some wrong versions
 | 
			
		||||
- avformat/hlsenc: Free context after hls_append_segment
 | 
			
		||||
- avcodec/mpeg4video_parser: fix spurious extradata parse warnings
 | 
			
		||||
- lavu/opt: fix av_opt_get function
 | 
			
		||||
- avcodec/wmaprodec: Fix integer overflow in sfb_offsets initialization
 | 
			
		||||
- avcodec/utvideodec: fix assumtation that slice_height >= 1
 | 
			
		||||
- avcodec/options_table fix min of audio channels and sample rate
 | 
			
		||||
- libavutil/thread.h: Support OS/2 threads
 | 
			
		||||
- fix Makefile objects for pulseaudio support
 | 
			
		||||
- opusdec: make sure all substreams have the same number of coded samples
 | 
			
		||||
- lavu: add wrappers for the pthreads mutex API
 | 
			
		||||
- avformat/avidec: fix handling dv in avi
 | 
			
		||||
- avfilter/vf_lut: gammaval709()
 | 
			
		||||
- cinedec: report white balance gain coefficients using metadata
 | 
			
		||||
- swscale/utils: support bayer input + scaling, and bayer input + any supported output
 | 
			
		||||
- swscale: support internal scaler cascades
 | 
			
		||||
- avformat/dtsdec: dts_probe: check reserved bit, check lfe, check sr_code similarity
 | 
			
		||||
- avformat/segment: export inner muxer timebase
 | 
			
		||||
- Remove fminf() emulation, fix build issues
 | 
			
		||||
- avcodec/mpegaudio_parser: fix off by 1 error in bitrate calculation
 | 
			
		||||
- Use -fno-optimize-sibling-calls on parisc also for gcc 4.9.
 | 
			
		||||
- ffmpeg_opt: store canvas size in decoder context
 | 
			
		||||
- avcodec/mpeg12dec: do not trust AVCodecContext input dimensions
 | 
			
		||||
 | 
			
		||||
version 2.4.3:
 | 
			
		||||
- avcodec/svq1dec: zero terminate embedded message before printing
 | 
			
		||||
- avcodec/cook: check that the subpacket sizes fit in block_align
 | 
			
		||||
- avcodec/g2meet: check tile dimensions to avoid integer overflow
 | 
			
		||||
- avcodec/utils: Align dimensions by at least their chroma sub-sampling factors.
 | 
			
		||||
- avcodec/dnxhddec: treat pix_fmt like width/height
 | 
			
		||||
- avcodec/dxa: check dimensions
 | 
			
		||||
- avcodec/dirac_arith: fix integer overflow
 | 
			
		||||
- avcodec/diracdec: Tighter checks on CODEBLOCKS_X/Y
 | 
			
		||||
- avcodec/diracdec: Use 64bit in calculation of codeblock coordinates
 | 
			
		||||
- avcodec/sgidec: fix count check
 | 
			
		||||
- avcodec/sgidec: fix linesize for 16bit
 | 
			
		||||
- avcodec/hevc_ps: Check default display window bitstream and skip if invalid
 | 
			
		||||
- avcodec/tiffenc: properly compute packet size
 | 
			
		||||
- lavd: export all symbols with av_ prefix
 | 
			
		||||
- avformat/mxfdec: Fix termination of mxf_data_essence_container_uls
 | 
			
		||||
- postproc: fix qp count
 | 
			
		||||
- postproc/postprocess: fix quant store for fq mode
 | 
			
		||||
- vf_drawtext: add missing clear of pointers after av_expr_free()
 | 
			
		||||
- utvideoenc: properly set slice height/last line
 | 
			
		||||
- swresample: fix sample drop loop end condition
 | 
			
		||||
- resample: Avoid off-by-1 errors in PTS calcs.
 | 
			
		||||
- imc: fix order of operations in coefficients read
 | 
			
		||||
- hevc_mvs: make sure to always initialize the temporal MV fully
 | 
			
		||||
- hevc_mvs: initialize the temporal MV in case of missing reference
 | 
			
		||||
 | 
			
		||||
version 2.4.2:
 | 
			
		||||
- avcodec/on2avc: Check number of channels
 | 
			
		||||
- avcodec/hevc: fix chroma transform_add size
 | 
			
		||||
- avcodec/h264: Check mode before considering mixed mode intra prediction
 | 
			
		||||
- avformat/mpegts: use a padded buffer in read_sl_header()
 | 
			
		||||
- avformat/mpegts: Check desc_len / get8() return code
 | 
			
		||||
- avcodec/vorbisdec: Fix off by 1 error in ptns_to_read
 | 
			
		||||
- sdp: add support for H.261
 | 
			
		||||
- avcodec/svq3: Do not memcpy AVFrame
 | 
			
		||||
- avcodec/smc: fix off by 1 error
 | 
			
		||||
- avcodec/qpeg: fix off by 1 error in MV bounds check
 | 
			
		||||
- avcodec/gifdec: factorize interleave end handling out
 | 
			
		||||
- avcodec/cinepak: fix integer underflow
 | 
			
		||||
- avcodec/pngdec: Check bits per pixel before setting monoblack pixel format
 | 
			
		||||
- avcodec/pngdec: Calculate MPNG bytewidth more defensively
 | 
			
		||||
- avcodec/tiff: more completely check bpp/bppcount
 | 
			
		||||
- avcodec/mmvideo: Bounds check 2nd line of HHV Intra blocks
 | 
			
		||||
- avcodec/h263dec: Fix decoding messenger.h263
 | 
			
		||||
- avcodec/utils: Add case for jv to avcodec_align_dimensions2()
 | 
			
		||||
- avcodec/mjpegdec: check bits per pixel for changes similar to dimensions
 | 
			
		||||
- avcodec/jpeglsdec: Check run value more completely in ls_decode_line()
 | 
			
		||||
- avformat/hlsenc: export inner muxer timebase
 | 
			
		||||
- configure: add noexecstack to linker options if supported.
 | 
			
		||||
- avcodec/ac3enc_template: fix out of array read
 | 
			
		||||
- avutil/x86/cpu: fix cpuid sub-leaf selection
 | 
			
		||||
- avformat/img2dec: enable generic seeking for image pipes
 | 
			
		||||
- avformat/img2dec: initialize pkt->pos for image pipes
 | 
			
		||||
- avformat/img2dec: pass error code and signal EOF
 | 
			
		||||
- avformat/img2dec: fix error code at EOF for pipes
 | 
			
		||||
- libavutil/opt: fix av_opt_set_channel_layout() to access correct memory address
 | 
			
		||||
- tests/fate-run.sh: Cat .err file in case of error with V>0
 | 
			
		||||
- avformat/riffenc: Filter out "BottomUp" in ff_put_bmp_header()
 | 
			
		||||
- avcodec/webp: fix default palette color 0xff000000 -> 0x00000000
 | 
			
		||||
- avcodec/asvenc: fix AAN scaling
 | 
			
		||||
- Fix compile error on arm4/arm5 platform
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
version 2.8.5
 | 
			
		||||
- avformat/hls: Even stricter URL checks
 | 
			
		||||
- avformat/hls: More strict url checks
 | 
			
		||||
- avcodec/pngenc: Fix mixed up linesizes
 | 
			
		||||
- avcodec/pngenc: Replace memcpy by av_image_copy()
 | 
			
		||||
- swscale/vscale: Check that 2 tap filters are bilinear before using bilinear code
 | 
			
		||||
- swscale: Move VScalerContext into vscale.c
 | 
			
		||||
- swscale/utils: Detect and skip unneeded sws_setColorspaceDetails() calls
 | 
			
		||||
- swscale/yuv2rgb: Increase YUV2RGB table headroom
 | 
			
		||||
- swscale/yuv2rgb: Factor YUVRGB_TABLE_LUMA_HEADROOM out
 | 
			
		||||
- avformat/hls: forbid all protocols except http(s) & file
 | 
			
		||||
- avformat/aviobuf: Fix end check in put_str16()
 | 
			
		||||
- avformat/asfenc: Check pts
 | 
			
		||||
- avcodec/mpeg4video: Check time_incr
 | 
			
		||||
- avcodec/wavpackenc: Check the number of channels
 | 
			
		||||
- avcodec/wavpackenc: Headers are per channel
 | 
			
		||||
- avcodec/aacdec_template: Check id_map
 | 
			
		||||
- avcodec/dvdec: Fix "left shift of negative value -254"
 | 
			
		||||
- avcodec/g2meet: Check for ff_els_decode_bit() failure in epic_decode_run_length()
 | 
			
		||||
- avcodec/mjpegdec: Fix negative shift
 | 
			
		||||
- avcodec/mss2: Check for repeat overflow
 | 
			
		||||
- avformat: Add integer fps from 31 to 60 to get_std_framerate()
 | 
			
		||||
- avformat/ivfenc: fix division by zero
 | 
			
		||||
- avcodec/mpegvideo_enc: Clip bits_per_raw_sample within valid range
 | 
			
		||||
- avfilter/vf_scale: set proper out frame color range
 | 
			
		||||
- avcodec/motion_est: Fix mv_penalty table size
 | 
			
		||||
- avcodec/h264_slice: Fix integer overflow in implicit weight computation
 | 
			
		||||
- swscale/utils: Use normal bilinear scaler if fast cannot be used due to tiny dimensions
 | 
			
		||||
- avcodec/put_bits: Always check buffer end before writing
 | 
			
		||||
- mjpegdec: extend check for incompatible values of s->rgb and s->ls
 | 
			
		||||
- swscale/utils: Fix intermediate format for cascaded alpha downscaling
 | 
			
		||||
- avformat/mov: Update handbrake_version threshold for full mp3 parsing
 | 
			
		||||
- x86/float_dsp: zero extend offset from ff_scalarproduct_float_sse
 | 
			
		||||
- avfilter/vf_zoompan: do not free frame we pushed to lavfi
 | 
			
		||||
- nuv: sanitize negative fps rate
 | 
			
		||||
- nutdec: reject negative value_len in read_sm_data
 | 
			
		||||
- xwddec: prevent overflow of lsize * avctx->height
 | 
			
		||||
- nutdec: only copy the header if it exists
 | 
			
		||||
- exr: fix out of bounds read in get_code
 | 
			
		||||
- on2avc: limit number of bits to 30 in get_egolomb
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
version 2.8.4
 | 
			
		||||
- rawdec: only exempt BIT0 with need_copy from buffer sanity check
 | 
			
		||||
- mlvdec: check that index_entries exist
 | 
			
		||||
- avcodec/mpeg4videodec: also for empty partitioned slices
 | 
			
		||||
- avcodec/h264_refs: Fix long_idx check
 | 
			
		||||
- avcodec/h264_mc_template: prefetch list1 only if it is used in the MB
 | 
			
		||||
- avcodec/h264_slice: Simplify ref2frm indexing
 | 
			
		||||
- avfilter/vf_mpdecimate: Add missing emms_c()
 | 
			
		||||
- sonic: make sure num_taps * channels is not larger than frame_size
 | 
			
		||||
- opus_silk: fix typo causing overflow in silk_stabilize_lsf
 | 
			
		||||
- ffm: reject invalid codec_id and codec_type
 | 
			
		||||
- golomb: always check for invalid UE golomb codes in get_ue_golomb
 | 
			
		||||
- sbr_qmf_analysis: sanitize input for 32-bit imdct
 | 
			
		||||
- sbrdsp_fixed: assert that input values are in the valid range
 | 
			
		||||
- aacsbr: ensure strictly monotone time borders
 | 
			
		||||
- aacenc: update max_sfb when num_swb changes
 | 
			
		||||
- aaccoder: prevent crash of anmr coder
 | 
			
		||||
- ffmdec: reject zero-sized chunks
 | 
			
		||||
- swscale/x86/rgb2rgb_template: Fallback to mmx in interleaveBytes() if the alignment is insufficient for SSE*
 | 
			
		||||
- swscale/x86/rgb2rgb_template: Do not crash on misaligend stride
 | 
			
		||||
- avformat/mxfenc: Do not crash if there is no packet in the first stream
 | 
			
		||||
- lavf/tee: fix side data double free.
 | 
			
		||||
- avformat/hlsenc: Check the return code of avformat_write_header()
 | 
			
		||||
- avformat/mov: Enable parser for mp3s by old HandBrake
 | 
			
		||||
- avformat/mxfenc: Fix integer overflow in length computation
 | 
			
		||||
- avformat/utils: estimate_timings_from_pts - increase retry counter, fixes invalid duration for ts files with hevc codec
 | 
			
		||||
- avformat/matroskaenc: Check codecdelay before use
 | 
			
		||||
- avutil/mathematics: Fix division by 0
 | 
			
		||||
- mjpegdec: consider chroma subsampling in size check
 | 
			
		||||
- libvpxenc: remove some unused ctrl id mappings
 | 
			
		||||
- avcodec/vp3: ensure header is parsed successfully before tables
 | 
			
		||||
- avcodec/jpeg2000dec: Check bpno in decode_cblk()
 | 
			
		||||
- avcodec/pgssubdec: Fix left shift of 255 by 24 places cannot be represented in type int
 | 
			
		||||
- swscale/utils: Fix for runtime error: left shift of negative value -1
 | 
			
		||||
- avcodec/hevc: Fix integer overflow of entry_point_offset
 | 
			
		||||
- avcodec/dirac_parser: Check that there is a previous PU before accessing it
 | 
			
		||||
- avcodec/dirac_parser: Add basic validity checks for next_pu_offset and prev_pu_offset
 | 
			
		||||
- avcodec/dirac_parser: Fix potential overflows in pointer checks
 | 
			
		||||
- avcodec/wmaprodec: Check bits per sample to be within the range not causing integer overflows
 | 
			
		||||
- avcodec/wmaprodec: Fix overflow of cutoff
 | 
			
		||||
- avformat/smacker: fix integer overflow with pts_inc
 | 
			
		||||
- avcodec/vp3: Fix "runtime error: left shift of negative value"
 | 
			
		||||
- avformat/riffdec: Initialize bitrate
 | 
			
		||||
- mpegencts: Fix overflow in cbr mode period calculations
 | 
			
		||||
- avutil/timecode: Fix fps check
 | 
			
		||||
- avutil/mathematics: return INT64_MIN (=AV_NOPTS_VALUE) from av_rescale_rnd() for overflows
 | 
			
		||||
- avcodec/apedec: Check length in long_filter_high_3800()
 | 
			
		||||
- avcodec/vp3: always set pix_fmt in theora_decode_header()
 | 
			
		||||
- avcodec/mpeg4videodec: Check available data before reading custom matrix
 | 
			
		||||
- avutil/mathematics: Do not treat INT64_MIN as positive in av_rescale_rnd
 | 
			
		||||
- avutil/integer: Fix av_mod_i() with negative dividend
 | 
			
		||||
- avformat/dump: Fix integer overflow in av_dump_format()
 | 
			
		||||
- avcodec/h264_refs: Check that long references match before use
 | 
			
		||||
- avcodec/utils: Clear dimensions in ff_get_buffer() on failure
 | 
			
		||||
- avcodec/utils: Use 64bit for aspect ratio calculation in avcodec_string()
 | 
			
		||||
- avcodec/hevc: Check max ctb addresses for WPP
 | 
			
		||||
- avcodec/vp3: Clear context on reinitialization failure
 | 
			
		||||
- avcodec/hevc: allocate entries unconditionally
 | 
			
		||||
- avcodec/hevc_cabac: Fix multiple integer overflows
 | 
			
		||||
- avcodec/jpeg2000dwt: Check ndeclevels before calling dwt_encode*()
 | 
			
		||||
- avcodec/jpeg2000dwt: Check ndeclevels before calling dwt_decode*()
 | 
			
		||||
- avcodec/hevc: Check entry_point_offsets
 | 
			
		||||
- lavf/rtpenc_jpeg: Less strict check for standard Huffman tables.
 | 
			
		||||
- avcodec/ffv1dec: Clear quant_table_count if its invalid
 | 
			
		||||
- avcodec/ffv1dec: Print an error if the quant table count is invalid
 | 
			
		||||
- doc/filters/drawtext: fix centering example
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
version 2.8.3
 | 
			
		||||
- avcodec/cabac: Check initial cabac decoder state
 | 
			
		||||
- avcodec/cabac_functions: Fix "left shift of negative value -31767"
 | 
			
		||||
- avcodec/h264_slice: Limit max_contexts when slice_context_count is initialized
 | 
			
		||||
- rtmpcrypt: Do the xtea decryption in little endian mode
 | 
			
		||||
- avformat/matroskadec: Check subtitle stream before dereferencing
 | 
			
		||||
- avcodec/pngdec: Replace assert by request for sample for unsupported TRNS cases
 | 
			
		||||
- avformat/utils: Do not init parser if probing is unfinished
 | 
			
		||||
- avcodec/jpeg2000dec: Fix potential integer overflow with tile dimensions
 | 
			
		||||
- avcodec/jpeg2000: Use av_image_check_size() in ff_jpeg2000_init_component()
 | 
			
		||||
- avcodec/wmaprodec: Check for overread in decode_packet()
 | 
			
		||||
- avcodec/smacker: Check that the data size is a multiple of a sample vector
 | 
			
		||||
- avcodec/takdec: Skip last p2 sample (which is unused)
 | 
			
		||||
- avcodec/dxtory: Fix input size check in dxtory_decode_v1_410()
 | 
			
		||||
- avcodec/dxtory: Fix input size check in dxtory_decode_v1_420()
 | 
			
		||||
- avcodec/error_resilience: avoid accessing previous or next frames tables beyond height
 | 
			
		||||
- avcodec/dpx: Move need_align to act per line
 | 
			
		||||
- avcodec/flashsv: Check size before updating it
 | 
			
		||||
- avcodec/ivi: Check image dimensions
 | 
			
		||||
- avcodec/utils: Better check for channels in av_get_audio_frame_duration()
 | 
			
		||||
- avcodec/jpeg2000dec: Check for duplicate SIZ marker
 | 
			
		||||
- aacsbr: don't call sbr_dequant twice without intermediate read_sbr_data
 | 
			
		||||
- hqx: correct type and size check of info_offset
 | 
			
		||||
- mxfdec: check edit_rate also for physical_track
 | 
			
		||||
- avcodec/jpeg2000: Change coord to 32bit to support larger than 32k width or height
 | 
			
		||||
- avcodec/jpeg2000dec: Check SIZ dimensions to be within the supported range
 | 
			
		||||
- avcodec/jpeg2000: Check comp coords to be within the supported size
 | 
			
		||||
- mpegvideo: clear overread in clear_context
 | 
			
		||||
- avcodec/avrndec: Use the AVFrame format instead of the context
 | 
			
		||||
- dds: disable palette flag for compressed images
 | 
			
		||||
- dds: validate compressed source buffer size
 | 
			
		||||
- dds: validate source buffer size before copying
 | 
			
		||||
- dvdsubdec: validate offset2 similar to offset1
 | 
			
		||||
- brstm: reject negative sample rate
 | 
			
		||||
- aacps: avoid division by zero in stereo_processing
 | 
			
		||||
- softfloat: assert when the argument of av_sqrt_sf is negative
 | 
			
		||||
 | 
			
		||||
version 2.8.2
 | 
			
		||||
- various fixes in the aac_fixed decoder
 | 
			
		||||
- various fixes in softfloat
 | 
			
		||||
- swresample/resample: increase precision for compensation
 | 
			
		||||
- lavf/mov: add support for sidx fragment indexes
 | 
			
		||||
- avformat/mxfenc: Only store user comment related tags when needed
 | 
			
		||||
- tests/fate/avformat: Fix fate-lavf
 | 
			
		||||
- doc/ffmpeg: Clarify that the sdp_file option requires an rtp output.
 | 
			
		||||
- ffmpeg: Don't try and write sdp info if none of the outputs had an rtp format.
 | 
			
		||||
- apng: use correct size for output buffer
 | 
			
		||||
- jvdec: avoid unsigned overflow in comparison
 | 
			
		||||
- avcodec/jpeg2000dec: Clip all tile coordinates
 | 
			
		||||
- avcodec/microdvddec: Check for string end in 'P' case
 | 
			
		||||
- avcodec/dirac_parser: Fix undefined memcpy() use
 | 
			
		||||
- avformat/xmv: Discard remainder of packet on error
 | 
			
		||||
- avformat/xmv: factor return check out of if/else
 | 
			
		||||
- avcodec/mpeg12dec: Do not call show_bits() with invalid bits
 | 
			
		||||
- avcodec/faxcompr: Add missing runs check in decode_uncompressed()
 | 
			
		||||
- libavutil/channel_layout: Check strtol*() for failure
 | 
			
		||||
- avformat/mpegts: Only start probing data streams within probe_packets
 | 
			
		||||
- avcodec/hevc_ps: Check chroma_format_idc
 | 
			
		||||
- avcodec/ffv1dec: Check for 0 quant tables
 | 
			
		||||
- avcodec/mjpegdec: Reinitialize IDCT on BPP changes
 | 
			
		||||
- avcodec/mjpegdec: Check index in ljpeg_decode_yuv_scan() before using it
 | 
			
		||||
- avutil/file_open: avoid file handle inheritance on Windows
 | 
			
		||||
- avcodec/h264_slice: Disable slice threads if there are multiple access units in a packet
 | 
			
		||||
- avformat/hls: update cookies on setcookie response
 | 
			
		||||
- opusdec: Don't run vector_fmul_scalar on zero length arrays
 | 
			
		||||
- avcodec/opusdec: Fix extra samples read index
 | 
			
		||||
- avcodec/ffv1: Initialize vlc_state on allocation
 | 
			
		||||
- avcodec/ffv1dec: update progress in case of broken pointer chains
 | 
			
		||||
- avcodec/ffv1dec: Clear slice coordinates if they are invalid or slice header decoding fails for other reasons
 | 
			
		||||
- rtsp: Allow $ as interleaved packet indicator before a complete response header
 | 
			
		||||
- videodsp: don't overread edges in vfix3 emu_edge.
 | 
			
		||||
- avformat/mp3dec: improve junk skipping heuristic
 | 
			
		||||
- concatdec: fix file_start_time calculation regression
 | 
			
		||||
- avcodec: loongson optimize h264dsp idct and loop filter with mmi
 | 
			
		||||
- avcodec/jpeg2000dec: Clear properties in jpeg2000_dec_cleanup() too
 | 
			
		||||
- avformat/hls: add support for EXT-X-MAP
 | 
			
		||||
- avformat/hls: fix segment selection regression on track changes of live streams
 | 
			
		||||
- configure: Require libkvazaar < 0.7.
 | 
			
		||||
- avcodec/vp8: Do not use num_coeff_partitions in thread/buffer setup
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
version 2.8.1:
 | 
			
		||||
- swscale: fix ticket #4881
 | 
			
		||||
- doc: fix spelling errors
 | 
			
		||||
- hls: only seek if there is an offset
 | 
			
		||||
- asfdec: add more checks for size left in asf packet buffer
 | 
			
		||||
- asfdec: alloc enough space for storing name in asf_read_metadata_obj
 | 
			
		||||
- avcodec/pngdec: Check blend_op.
 | 
			
		||||
- h264_mp4toannexb: fix pps offfset fault when there are more than one sps in avcc
 | 
			
		||||
- avcodec/h264_mp4toannexb_bsf: Use av_freep() to free spspps_buf
 | 
			
		||||
- avformat/avidec: Workaround broken initial frame
 | 
			
		||||
- avformat/hls: fix some cases of HLS streams which require cookies
 | 
			
		||||
- avcodec/pngdec: reset has_trns after every decode_frame_png()
 | 
			
		||||
- lavf/img2dec: Fix memory leak
 | 
			
		||||
- avcodec/mp3: fix skipping zeros
 | 
			
		||||
- avformat/srtdec: make sure we probe a number
 | 
			
		||||
- configure: check for ID3D11VideoContext
 | 
			
		||||
- avformat/vobsub: compare correct packet stream IDs
 | 
			
		||||
- avformat/srtdec: more lenient first line probing
 | 
			
		||||
- avformat/srtdec: fix number check for the first character
 | 
			
		||||
- avcodec/mips: build fix for MSA 64bit
 | 
			
		||||
- avcodec/mips: build fix for MSA
 | 
			
		||||
- avformat/httpauth: Add space after commas in HTTP/RTSP auth header
 | 
			
		||||
- libavformat/hlsenc: Use of uninitialized memory unlinking old files
 | 
			
		||||
- avcodec/x86/sbrdsp: Fix using uninitialized upper 32bit of noise
 | 
			
		||||
- avcodec/ffv1dec: Fix off by 1 error in quant_table_count check
 | 
			
		||||
- avcodec/ffv1dec: Explicitly check read_quant_table() return value
 | 
			
		||||
- dnxhddata: correct weight tables
 | 
			
		||||
- dnxhddec: decode and use interlace mb flag
 | 
			
		||||
- swscale: fix ticket #4877
 | 
			
		||||
- avcodec/rangecoder: Check e
 | 
			
		||||
- avcodec/ffv1: separate slice_count from max_slice_count
 | 
			
		||||
- swscale: fix ticket 4850
 | 
			
		||||
- cmdutils: Filter dst/srcw/h
 | 
			
		||||
- avutil/log: fix zero length gnu_printf format string warning
 | 
			
		||||
- lavf/webvttenc: Require webvtt file to contain exactly one WebVTT stream.
 | 
			
		||||
- swscale/swscale: Fix "unused variable" warning
 | 
			
		||||
- avcodec/mjpegdec: Fix decoding RGBA RCT LJPEG
 | 
			
		||||
- MAINTAINERS: add 2.8, drop 2.2
 | 
			
		||||
- doc: mention libavcodec can decode Opus natively
 | 
			
		||||
- hevc: properly handle no_rasl_output_flag when removing pictures from the DPB
 | 
			
		||||
- avfilter/af_ladspa: process all channels for nb_handles > 1
 | 
			
		||||
- configure: add libsoxr to swresample's pkgconfig
 | 
			
		||||
- lavc: Fix compilation with --disable-everything --enable-parser=mpeg4video.
 | 
			
		||||
 | 
			
		||||
version 2.8:
 | 
			
		||||
- colorkey video filter
 | 
			
		||||
- BFSTM/BCSTM demuxer
 | 
			
		||||
- little-endian ADPCM_THP decoder
 | 
			
		||||
- Hap decoder and encoder
 | 
			
		||||
- DirectDraw Surface image/texture decoder
 | 
			
		||||
- ssim filter
 | 
			
		||||
- optional new ASF demuxer
 | 
			
		||||
- showvolume filter
 | 
			
		||||
- Many improvements to the JPEG 2000 decoder
 | 
			
		||||
- Go2Meeting decoding support
 | 
			
		||||
- adrawgraph audio and drawgraph video filter
 | 
			
		||||
- removegrain video filter
 | 
			
		||||
- Intel QSV-accelerated MPEG-2 video and HEVC encoding
 | 
			
		||||
- Intel QSV-accelerated MPEG-2 video and HEVC decoding
 | 
			
		||||
- Intel QSV-accelerated VC-1 video decoding
 | 
			
		||||
- libkvazaar HEVC encoder
 | 
			
		||||
- erosion, dilation, deflate and inflate video filters
 | 
			
		||||
- Dynamic Audio Normalizer as dynaudnorm filter
 | 
			
		||||
- Reverse video and areverse audio filter
 | 
			
		||||
- Random filter
 | 
			
		||||
- deband filter
 | 
			
		||||
- AAC fixed-point decoding
 | 
			
		||||
- sidechaincompress audio filter
 | 
			
		||||
- bitstream filter for converting HEVC from MP4 to Annex B
 | 
			
		||||
- acrossfade audio filter
 | 
			
		||||
- allyuv and allrgb video sources
 | 
			
		||||
- atadenoise video filter
 | 
			
		||||
- OS X VideoToolbox support
 | 
			
		||||
- aphasemeter filter
 | 
			
		||||
- showfreqs filter
 | 
			
		||||
- vectorscope filter
 | 
			
		||||
- waveform filter
 | 
			
		||||
- hstack and vstack filter
 | 
			
		||||
- Support DNx100 (1440x1080@8)
 | 
			
		||||
- VAAPI hevc hwaccel
 | 
			
		||||
- VDPAU hevc hwaccel
 | 
			
		||||
- framerate filter
 | 
			
		||||
- Switched default encoders for webm to VP9 and Opus
 | 
			
		||||
- Removed experimental flag from the JPEG 2000 encoder
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
version 2.7:
 | 
			
		||||
- FFT video filter
 | 
			
		||||
- TDSC decoder
 | 
			
		||||
- DTS lossless extension (XLL) decoding (not lossless, disabled by default)
 | 
			
		||||
- showwavespic filter
 | 
			
		||||
- DTS decoding through libdcadec
 | 
			
		||||
- Drop support for nvenc API before 5.0
 | 
			
		||||
- nvenc HEVC encoder
 | 
			
		||||
- Detelecine filter
 | 
			
		||||
- Intel QSV-accelerated H.264 encoding
 | 
			
		||||
- MMAL-accelerated H.264 decoding
 | 
			
		||||
- basic APNG encoder and muxer with default extension "apng"
 | 
			
		||||
- unpack DivX-style packed B-frames in MPEG-4 bitstream filter
 | 
			
		||||
- WebM Live Chunk Muxer
 | 
			
		||||
- nvenc level and tier options
 | 
			
		||||
- chorus filter
 | 
			
		||||
- Canopus HQ/HQA decoder
 | 
			
		||||
- Automatically rotate videos based on metadata in ffmpeg
 | 
			
		||||
- improved Quickdraw compatibility
 | 
			
		||||
- VP9 high bit-depth and extended colorspaces decoding support
 | 
			
		||||
- WebPAnimEncoder API when available for encoding and muxing WebP
 | 
			
		||||
- Direct3D11-accelerated decoding
 | 
			
		||||
- Support Secure Transport
 | 
			
		||||
- Multipart JPEG demuxer
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
version 2.6:
 | 
			
		||||
- nvenc encoder
 | 
			
		||||
- 10bit spp filter
 | 
			
		||||
- colorlevels filter
 | 
			
		||||
- RIFX format for *.wav files
 | 
			
		||||
- RTP/mpegts muxer
 | 
			
		||||
- non continuous cache protocol support
 | 
			
		||||
- tblend filter
 | 
			
		||||
- cropdetect support for non 8bpp, absolute (if limit >= 1) and relative (if limit < 1.0) threshold
 | 
			
		||||
- Camellia symmetric block cipher
 | 
			
		||||
- OpenH264 encoder wrapper
 | 
			
		||||
- VOC seeking support
 | 
			
		||||
- Closed caption Decoder
 | 
			
		||||
- fspp, uspp, pp7 MPlayer postprocessing filters ported to native filters
 | 
			
		||||
- showpalette filter
 | 
			
		||||
- Twofish symmetric block cipher
 | 
			
		||||
- Support DNx100 (960x720@8)
 | 
			
		||||
- eq2 filter ported from libmpcodecs as eq filter
 | 
			
		||||
- removed libmpcodecs
 | 
			
		||||
- Changed default DNxHD colour range in QuickTime .mov derivatives to mpeg range
 | 
			
		||||
- ported softpulldown filter from libmpcodecs as repeatfields filter
 | 
			
		||||
- dcshift filter
 | 
			
		||||
- RTP depacketizer for loss tolerant payload format for MP3 audio (RFC 5219)
 | 
			
		||||
- RTP depacketizer for AC3 payload format (RFC 4184)
 | 
			
		||||
- palettegen and paletteuse filters
 | 
			
		||||
- VP9 RTP payload format (draft 0) experimental depacketizer
 | 
			
		||||
- RTP depacketizer for DV (RFC 6469)
 | 
			
		||||
- DXVA2-accelerated HEVC decoding
 | 
			
		||||
- AAC ELD 480 decoding
 | 
			
		||||
- Intel QSV-accelerated H.264 decoding
 | 
			
		||||
- DSS SP decoder and DSS demuxer
 | 
			
		||||
- Fix stsd atom corruption in DNxHD QuickTimes
 | 
			
		||||
- Canopus HQX decoder
 | 
			
		||||
- RTP depacketization of T.140 text (RFC 4103)
 | 
			
		||||
- Port MIPS optimizations to 64-bit
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
version 2.5:
 | 
			
		||||
- HEVC/H.265 RTP payload format (draft v6) packetizer
 | 
			
		||||
- SUP/PGS subtitle demuxer
 | 
			
		||||
- ffprobe -show_pixel_formats option
 | 
			
		||||
- CAST128 symmetric block cipher, ECB mode
 | 
			
		||||
- STL subtitle demuxer and decoder
 | 
			
		||||
- libutvideo YUV 4:2:2 10bit support
 | 
			
		||||
- XCB-based screen-grabber
 | 
			
		||||
- UDP-Lite support (RFC 3828)
 | 
			
		||||
- xBR scaling filter
 | 
			
		||||
- AVFoundation screen capturing support
 | 
			
		||||
- ffserver supports codec private options
 | 
			
		||||
- creating DASH compatible fragmented MP4, MPEG-DASH segmenting muxer
 | 
			
		||||
- WebP muxer with animated WebP support
 | 
			
		||||
- zygoaudio decoding support
 | 
			
		||||
- APNG demuxer
 | 
			
		||||
- postproc visualization support
 | 
			
		||||
version 2.4.1:
 | 
			
		||||
- swscale: Allow chroma samples to be above and to the left of luma samples
 | 
			
		||||
- avcodec/libilbc: support for latest git of libilbc
 | 
			
		||||
- avcodec/webp: treat out-of-bound palette index as translucent black
 | 
			
		||||
- vf_deshake: rename Transform.vector to Transform.vec to avoid compiler confusion
 | 
			
		||||
- apetag: Fix APE tag size check
 | 
			
		||||
- tools/crypto_bench: fix build when AV_READ_TIME is unavailable
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
version 2.4:
 | 
			
		||||
@@ -458,7 +177,7 @@ version 2.4:
 | 
			
		||||
- ICY metadata are now requested by default with the HTTP protocol
 | 
			
		||||
- support for using metadata in stream specifiers in fftools
 | 
			
		||||
- LZMA compression support in TIFF decoder
 | 
			
		||||
- H.261 RTP payload format (RFC 4587) depacketizer and experimental packetizer
 | 
			
		||||
- support for H.261 RTP payload format (RFC 4587)
 | 
			
		||||
- HEVC/H.265 RTP payload format (draft v6) depacketizer
 | 
			
		||||
- added codecview filter to visualize information exported by some codecs
 | 
			
		||||
- Matroska 3D support thorugh side data
 | 
			
		||||
@@ -938,7 +657,7 @@ easier to use. The changes are:
 | 
			
		||||
          all the stream in the first input file, except for the second audio
 | 
			
		||||
          stream'.
 | 
			
		||||
    * There is a new option -c (or -codec) for choosing the decoder/encoder to
 | 
			
		||||
      use, which makes it possible to precisely specify target stream(s) consistently with
 | 
			
		||||
      use, which allows to precisely specify target stream(s) consistently with
 | 
			
		||||
      other options. E.g. -c:v lib264 sets the codec for all video streams, -c:a:0
 | 
			
		||||
      libvorbis sets the codec for the first audio stream and -c copy copies all
 | 
			
		||||
      the streams without reencoding. Old -vcodec/-acodec/-scodec options are now
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										96
									
								
								LICENSE.md
									
									
									
									
									
								
							
							
						
						
									
										96
									
								
								LICENSE.md
									
									
									
									
									
								
							@@ -1,76 +1,69 @@
 | 
			
		||||
#FFmpeg:
 | 
			
		||||
 | 
			
		||||
Most files in FFmpeg are under the GNU Lesser General Public License version 2.1
 | 
			
		||||
or later (LGPL v2.1+). Read the file `COPYING.LGPLv2.1` for details. Some other
 | 
			
		||||
or later (LGPL v2.1+). Read the file COPYING.LGPLv2.1 for details. Some other
 | 
			
		||||
files have MIT/X11/BSD-style licenses. In combination the LGPL v2.1+ applies to
 | 
			
		||||
FFmpeg.
 | 
			
		||||
 | 
			
		||||
Some optional parts of FFmpeg are licensed under the GNU General Public License
 | 
			
		||||
version 2 or later (GPL v2+). See the file `COPYING.GPLv2` for details. None of
 | 
			
		||||
these parts are used by default, you have to explicitly pass `--enable-gpl` to
 | 
			
		||||
version 2 or later (GPL v2+). See the file COPYING.GPLv2 for details. None of
 | 
			
		||||
these parts are used by default, you have to explicitly pass --enable-gpl to
 | 
			
		||||
configure to activate them. In this case, FFmpeg's license changes to GPL v2+.
 | 
			
		||||
 | 
			
		||||
Specifically, the GPL parts of FFmpeg are:
 | 
			
		||||
 | 
			
		||||
- libpostproc
 | 
			
		||||
- libmpcodecs
 | 
			
		||||
- optional x86 optimizations in the files
 | 
			
		||||
  - `libavcodec/x86/flac_dsp_gpl.asm`
 | 
			
		||||
  - `libavcodec/x86/idct_mmx.c`
 | 
			
		||||
  - `libavfilter/x86/vf_removegrain.asm`
 | 
			
		||||
  libavcodec/x86/flac_dsp_gpl.asm
 | 
			
		||||
  libavcodec/x86/idct_mmx.c
 | 
			
		||||
- libutvideo encoding/decoding wrappers in
 | 
			
		||||
  `libavcodec/libutvideo*.cpp`
 | 
			
		||||
- the X11 grabber in `libavdevice/x11grab.c`
 | 
			
		||||
  libavcodec/libutvideo*.cpp
 | 
			
		||||
- the X11 grabber in libavdevice/x11grab.c
 | 
			
		||||
- the swresample test app in
 | 
			
		||||
  `libswresample/swresample-test.c`
 | 
			
		||||
- the `texi2pod.pl` tool
 | 
			
		||||
  libswresample/swresample-test.c
 | 
			
		||||
- the texi2pod.pl tool
 | 
			
		||||
- the following filters in libavfilter:
 | 
			
		||||
    - `f_ebur128.c`
 | 
			
		||||
    - `vf_blackframe.c`
 | 
			
		||||
    - `vf_boxblur.c`
 | 
			
		||||
    - `vf_colormatrix.c`
 | 
			
		||||
    - `vf_cover_rect.c`
 | 
			
		||||
    - `vf_cropdetect.c`
 | 
			
		||||
    - `vf_delogo.c`
 | 
			
		||||
    - `vf_eq.c`
 | 
			
		||||
    - `vf_find_rect.c`
 | 
			
		||||
    - `vf_fspp.c`
 | 
			
		||||
    - `vf_geq.c`
 | 
			
		||||
    - `vf_histeq.c`
 | 
			
		||||
    - `vf_hqdn3d.c`
 | 
			
		||||
    - `vf_interlace.c`
 | 
			
		||||
    - `vf_kerndeint.c`
 | 
			
		||||
    - `vf_mcdeint.c`
 | 
			
		||||
    - `vf_mpdecimate.c`
 | 
			
		||||
    - `vf_owdenoise.c`
 | 
			
		||||
    - `vf_perspective.c`
 | 
			
		||||
    - `vf_phase.c`
 | 
			
		||||
    - `vf_pp.c`
 | 
			
		||||
    - `vf_pp7.c`
 | 
			
		||||
    - `vf_pullup.c`
 | 
			
		||||
    - `vf_sab.c`
 | 
			
		||||
    - `vf_smartblur.c`
 | 
			
		||||
    - `vf_repeatfields.c`
 | 
			
		||||
    - `vf_spp.c`
 | 
			
		||||
    - `vf_stereo3d.c`
 | 
			
		||||
    - `vf_super2xsai.c`
 | 
			
		||||
    - `vf_tinterlace.c`
 | 
			
		||||
    - `vf_uspp.c`
 | 
			
		||||
    - `vsrc_mptestsrc.c`
 | 
			
		||||
    - f_ebur128.c
 | 
			
		||||
    - vf_blackframe.c
 | 
			
		||||
    - vf_boxblur.c
 | 
			
		||||
    - vf_colormatrix.c
 | 
			
		||||
    - vf_cropdetect.c
 | 
			
		||||
    - vf_decimate.c
 | 
			
		||||
    - vf_delogo.c
 | 
			
		||||
    - vf_geq.c
 | 
			
		||||
    - vf_histeq.c
 | 
			
		||||
    - vf_hqdn3d.c
 | 
			
		||||
    - vf_interlace.c
 | 
			
		||||
    - vf_kerndeint.c
 | 
			
		||||
    - vf_mcdeint.c
 | 
			
		||||
    - vf_mp.c
 | 
			
		||||
    - vf_owdenoise.c
 | 
			
		||||
    - vf_perspective.c
 | 
			
		||||
    - vf_phase.c
 | 
			
		||||
    - vf_pp.c
 | 
			
		||||
    - vf_pullup.c
 | 
			
		||||
    - vf_sab.c
 | 
			
		||||
    - vf_smartblur.c
 | 
			
		||||
    - vf_spp.c
 | 
			
		||||
    - vf_stereo3d.c
 | 
			
		||||
    - vf_super2xsai.c
 | 
			
		||||
    - vf_tinterlace.c
 | 
			
		||||
    - vsrc_mptestsrc.c
 | 
			
		||||
 | 
			
		||||
Should you, for whatever reason, prefer to use version 3 of the (L)GPL, then
 | 
			
		||||
the configure parameter `--enable-version3` will activate this licensing option
 | 
			
		||||
for you. Read the file `COPYING.LGPLv3` or, if you have enabled GPL parts,
 | 
			
		||||
`COPYING.GPLv3` to learn the exact legal terms that apply in this case.
 | 
			
		||||
the configure parameter --enable-version3 will activate this licensing option
 | 
			
		||||
for you. Read the file COPYING.LGPLv3 or, if you have enabled GPL parts,
 | 
			
		||||
COPYING.GPLv3 to learn the exact legal terms that apply in this case.
 | 
			
		||||
 | 
			
		||||
There are a handful of files under other licensing terms, namely:
 | 
			
		||||
 | 
			
		||||
* The files `libavcodec/jfdctfst.c`, `libavcodec/jfdctint_template.c` and
 | 
			
		||||
  `libavcodec/jrevdct.c` are taken from libjpeg, see the top of the files for
 | 
			
		||||
* The files libavcodec/jfdctfst.c, libavcodec/jfdctint_template.c and
 | 
			
		||||
  libavcodec/jrevdct.c are taken from libjpeg, see the top of the files for
 | 
			
		||||
  licensing details. Specifically note that you must credit the IJG in the
 | 
			
		||||
  documentation accompanying your program if you only distribute executables.
 | 
			
		||||
  You must also indicate any changes including additions and deletions to
 | 
			
		||||
  those three files in the documentation.
 | 
			
		||||
* `tests/reference.pnm` is under the expat license.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
external libraries
 | 
			
		||||
@@ -91,14 +84,13 @@ The following libraries are under GPL:
 | 
			
		||||
    - libx265
 | 
			
		||||
    - libxavs
 | 
			
		||||
    - libxvid
 | 
			
		||||
 | 
			
		||||
When combining them with FFmpeg, FFmpeg needs to be licensed as GPL as well by
 | 
			
		||||
passing `--enable-gpl` to configure.
 | 
			
		||||
passing --enable-gpl to configure.
 | 
			
		||||
 | 
			
		||||
The OpenCORE and VisualOn libraries are under the Apache License 2.0. That
 | 
			
		||||
license is incompatible with the LGPL v2.1 and the GPL v2, but not with
 | 
			
		||||
version 3 of those licenses. So to combine these libraries with FFmpeg, the
 | 
			
		||||
license version needs to be upgraded by passing `--enable-version3` to configure.
 | 
			
		||||
license version needs to be upgraded by passing --enable-version3 to configure.
 | 
			
		||||
 | 
			
		||||
incompatible libraries
 | 
			
		||||
----------------------
 | 
			
		||||
@@ -106,7 +98,7 @@ incompatible libraries
 | 
			
		||||
The Fraunhofer AAC library, FAAC and aacplus are under licenses which
 | 
			
		||||
are incompatible with the GPLv2 and v3. We do not know for certain if their
 | 
			
		||||
licenses are compatible with the LGPL.
 | 
			
		||||
If you wish to enable these libraries, pass `--enable-nonfree` to configure.
 | 
			
		||||
If you wish to enable these libraries, pass --enable-nonfree to configure.
 | 
			
		||||
But note that if you enable any of these libraries the resulting binary will
 | 
			
		||||
be under a complex license mix that is more restrictive than the LGPL and that
 | 
			
		||||
may result in additional obligations. It is possible that these
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										54
									
								
								MAINTAINERS
									
									
									
									
									
								
							
							
						
						
									
										54
									
								
								MAINTAINERS
									
									
									
									
									
								
							@@ -14,6 +14,7 @@ patches and related discussions.
 | 
			
		||||
Project Leader
 | 
			
		||||
==============
 | 
			
		||||
 | 
			
		||||
Michael Niedermayer
 | 
			
		||||
  final design decisions
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -42,9 +43,9 @@ QuickTime faststart:
 | 
			
		||||
Miscellaneous Areas
 | 
			
		||||
===================
 | 
			
		||||
 | 
			
		||||
documentation                           Stefano Sabatini, Mike Melanson, Timothy Gu, Lou Logan
 | 
			
		||||
documentation                           Stefano Sabatini, Mike Melanson, Timothy Gu
 | 
			
		||||
build system (configure, makefiles)     Diego Biurrun, Mans Rullgard
 | 
			
		||||
project server                          Árpád Gereöffy, Michael Niedermayer, Reimar Doeffinger, Alexander Strasser, Lou Logan
 | 
			
		||||
project server                          Árpád Gereöffy, Michael Niedermayer, Reimar Doeffinger, Alexander Strasser
 | 
			
		||||
presets                                 Robert Swain
 | 
			
		||||
metadata subsystem                      Aurelien Jacobs
 | 
			
		||||
release management                      Michael Niedermayer
 | 
			
		||||
@@ -58,7 +59,7 @@ fate.ffmpeg.org                         Timothy Gu
 | 
			
		||||
Trac bug tracker                        Alexander Strasser, Michael Niedermayer, Carl Eugen Hoyos, Lou Logan
 | 
			
		||||
mailing lists                           Michael Niedermayer, Baptiste Coudurier, Lou Logan
 | 
			
		||||
Google+                                 Paul B Mahol, Michael Niedermayer, Alexander Strasser
 | 
			
		||||
Twitter                                 Lou Logan, Reynaldo H. Verdejo Pinochet
 | 
			
		||||
Twitter                                 Lou Logan
 | 
			
		||||
Launchpad                               Timothy Gu
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -137,7 +138,6 @@ Codecs:
 | 
			
		||||
  4xm.c                                 Michael Niedermayer
 | 
			
		||||
  8bps.c                                Roberto Togni
 | 
			
		||||
  8svx.c                                Jaikrishnan Menon
 | 
			
		||||
  aacenc*, aaccoder.c                   Rostislav Pehlivanov
 | 
			
		||||
  aasc.c                                Kostya Shishkov
 | 
			
		||||
  ac3*                                  Justin Ruggles
 | 
			
		||||
  alacenc.c                             Jaikrishnan Menon
 | 
			
		||||
@@ -156,7 +156,6 @@ Codecs:
 | 
			
		||||
  celp_filters.*                        Vitor Sessak
 | 
			
		||||
  cinepak.c                             Roberto Togni
 | 
			
		||||
  cinepakenc.c                          Rl / Aetey G.T. AB
 | 
			
		||||
  ccaption_dec.c                        Anshul Maheshwari
 | 
			
		||||
  cljr                                  Alex Beregszaszi
 | 
			
		||||
  cllc.c                                Derek Buitenhuis
 | 
			
		||||
  cook.c, cookdata.h                    Benjamin Larsson
 | 
			
		||||
@@ -166,12 +165,10 @@ Codecs:
 | 
			
		||||
  dca.c                                 Kostya Shishkov, Benjamin Larsson
 | 
			
		||||
  dnxhd*                                Baptiste Coudurier
 | 
			
		||||
  dpcm.c                                Mike Melanson
 | 
			
		||||
  dss_sp.c                              Oleksij Rempel, Michael Niedermayer
 | 
			
		||||
  dv.c                                  Roman Shaposhnik
 | 
			
		||||
  dvbsubdec.c                           Anshul Maheshwari
 | 
			
		||||
  dxa.c                                 Kostya Shishkov
 | 
			
		||||
  eacmv*, eaidct*, eat*                 Peter Ross
 | 
			
		||||
  evrc*                                 Paul B Mahol
 | 
			
		||||
  exif.c, exif.h                        Thilo Borgmann
 | 
			
		||||
  ffv1*                                 Michael Niedermayer
 | 
			
		||||
  ffwavesynth.c                         Nicolas George
 | 
			
		||||
@@ -201,7 +198,6 @@ Codecs:
 | 
			
		||||
  libcelt_dec.c                         Nicolas George
 | 
			
		||||
  libdirac*                             David Conrad
 | 
			
		||||
  libgsm.c                              Michel Bardiaux
 | 
			
		||||
  libkvazaar.c                          Arttu Ylä-Outinen
 | 
			
		||||
  libopenjpeg.c                         Jaikrishnan Menon
 | 
			
		||||
  libopenjpegenc.c                      Michael Bradshaw
 | 
			
		||||
  libschroedinger*                      David Conrad
 | 
			
		||||
@@ -230,7 +226,6 @@ Codecs:
 | 
			
		||||
  msvideo1.c                            Mike Melanson
 | 
			
		||||
  nellymoserdec.c                       Benjamin Larsson
 | 
			
		||||
  nuv.c                                 Reimar Doeffinger
 | 
			
		||||
  nvenc.c                               Timo Rothenpieler
 | 
			
		||||
  paf.*                                 Paul B Mahol
 | 
			
		||||
  pcx.c                                 Ivo van Poorten
 | 
			
		||||
  pgssubdec.c                           Reimar Doeffinger
 | 
			
		||||
@@ -239,7 +234,6 @@ Codecs:
 | 
			
		||||
  qdm2.c, qdm2data.h                    Roberto Togni, Benjamin Larsson
 | 
			
		||||
  qdrw.c                                Kostya Shishkov
 | 
			
		||||
  qpeg.c                                Kostya Shishkov
 | 
			
		||||
  qsv*                                  Ivan Uskov
 | 
			
		||||
  qtrle.c                               Mike Melanson
 | 
			
		||||
  ra144.c, ra144.h, ra288.c, ra288.h    Roberto Togni
 | 
			
		||||
  resample2.c                           Michael Niedermayer
 | 
			
		||||
@@ -301,12 +295,11 @@ Codecs:
 | 
			
		||||
 | 
			
		||||
Hardware acceleration:
 | 
			
		||||
  crystalhd.c                           Philip Langdale
 | 
			
		||||
  dxva2*                                Hendrik Leppkes, Laurent Aimar
 | 
			
		||||
  dxva2*                                Laurent Aimar
 | 
			
		||||
  libstagefright.cpp                    Mohamed Naufal
 | 
			
		||||
  vaapi*                                Gwenole Beauchesne
 | 
			
		||||
  vda*                                  Sebastien Zwickert
 | 
			
		||||
  vdpau*                                Philip Langdale, Carl Eugen Hoyos
 | 
			
		||||
  videotoolbox*                         Sebastien Zwickert
 | 
			
		||||
  vdpau*                                Carl Eugen Hoyos
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
libavdevice
 | 
			
		||||
@@ -316,7 +309,6 @@ libavdevice
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  avfoundation.m                        Thilo Borgmann
 | 
			
		||||
  decklink*                             Deti Fliegl
 | 
			
		||||
  dshow.c                               Roger Pack (CC rogerdpack@gmail.com)
 | 
			
		||||
  fbdev_enc.c                           Lukasz Marek
 | 
			
		||||
  gdigrab.c                             Roger Pack (CC rogerdpack@gmail.com)
 | 
			
		||||
@@ -338,7 +330,6 @@ Generic parts:
 | 
			
		||||
  graphdump.c                           Nicolas George
 | 
			
		||||
 | 
			
		||||
Filters:
 | 
			
		||||
  f_drawgraph.c                         Paul B Mahol
 | 
			
		||||
  af_adelay.c                           Paul B Mahol
 | 
			
		||||
  af_aecho.c                            Paul B Mahol
 | 
			
		||||
  af_afade.c                            Paul B Mahol
 | 
			
		||||
@@ -349,21 +340,14 @@ Filters:
 | 
			
		||||
  af_astreamsync.c                      Nicolas George
 | 
			
		||||
  af_atempo.c                           Pavel Koshevoy
 | 
			
		||||
  af_biquads.c                          Paul B Mahol
 | 
			
		||||
  af_chorus.c                           Paul B Mahol
 | 
			
		||||
  af_compand.c                          Paul B Mahol
 | 
			
		||||
  af_ladspa.c                           Paul B Mahol
 | 
			
		||||
  af_pan.c                              Nicolas George
 | 
			
		||||
  af_sidechaincompress.c                Paul B Mahol
 | 
			
		||||
  af_silenceremove.c                    Paul B Mahol
 | 
			
		||||
  avf_aphasemeter.c                     Paul B Mahol
 | 
			
		||||
  avf_avectorscope.c                    Paul B Mahol
 | 
			
		||||
  avf_showcqt.c                         Muhammad Faiz
 | 
			
		||||
  vf_blend.c                            Paul B Mahol
 | 
			
		||||
  vf_colorchannelmixer.c                Paul B Mahol
 | 
			
		||||
  vf_colorbalance.c                     Paul B Mahol
 | 
			
		||||
  vf_colorkey.c                         Timo Rothenpieler
 | 
			
		||||
  vf_colorlevels.c                      Paul B Mahol
 | 
			
		||||
  vf_deband.c                           Paul B Mahol
 | 
			
		||||
  vf_dejudder.c                         Nicholas Robbins
 | 
			
		||||
  vf_delogo.c                           Jean Delvare (CC <khali@linux-fr.org>)
 | 
			
		||||
  vf_drawbox.c/drawgrid                 Andrey Utkin
 | 
			
		||||
@@ -374,16 +358,12 @@ Filters:
 | 
			
		||||
  vf_il.c                               Paul B Mahol
 | 
			
		||||
  vf_lenscorrection.c                   Daniel Oberhoff
 | 
			
		||||
  vf_mergeplanes.c                      Paul B Mahol
 | 
			
		||||
  vf_neighbor.c                         Paul B Mahol
 | 
			
		||||
  vf_psnr.c                             Paul B Mahol
 | 
			
		||||
  vf_random.c                           Paul B Mahol
 | 
			
		||||
  vf_scale.c                            Michael Niedermayer
 | 
			
		||||
  vf_separatefields.c                   Paul B Mahol
 | 
			
		||||
  vf_ssim.c                             Paul B Mahol
 | 
			
		||||
  vf_stereo3d.c                         Paul B Mahol
 | 
			
		||||
  vf_telecine.c                         Paul B Mahol
 | 
			
		||||
  vf_yadif.c                            Michael Niedermayer
 | 
			
		||||
  vf_zoompan.c                          Paul B Mahol
 | 
			
		||||
 | 
			
		||||
Sources:
 | 
			
		||||
  vsrc_mandelbrot.c                     Michael Niedermayer
 | 
			
		||||
@@ -400,13 +380,11 @@ Generic parts:
 | 
			
		||||
 | 
			
		||||
Muxers/Demuxers:
 | 
			
		||||
  4xm.c                                 Mike Melanson
 | 
			
		||||
  aadec.c                               Vesselin Bontchev (vesselin.bontchev at yandex dot com)
 | 
			
		||||
  adtsenc.c                             Robert Swain
 | 
			
		||||
  afc.c                                 Paul B Mahol
 | 
			
		||||
  aiffdec.c                             Baptiste Coudurier, Matthieu Bouron
 | 
			
		||||
  aiffenc.c                             Baptiste Coudurier, Matthieu Bouron
 | 
			
		||||
  ape.c                                 Kostya Shishkov
 | 
			
		||||
  apngdec.c                             Benoit Fouet
 | 
			
		||||
  ass*                                  Aurelien Jacobs
 | 
			
		||||
  astdec.c                              Paul B Mahol
 | 
			
		||||
  astenc.c                              James Almer
 | 
			
		||||
@@ -419,7 +397,6 @@ Muxers/Demuxers:
 | 
			
		||||
  cdxl.c                                Paul B Mahol
 | 
			
		||||
  crc.c                                 Michael Niedermayer
 | 
			
		||||
  daud.c                                Reimar Doeffinger
 | 
			
		||||
  dss.c                                 Oleksij Rempel, Michael Niedermayer
 | 
			
		||||
  dtshddec.c                            Paul B Mahol
 | 
			
		||||
  dv.c                                  Roman Shaposhnik
 | 
			
		||||
  dxa.c                                 Kostya Shishkov
 | 
			
		||||
@@ -432,7 +409,6 @@ Muxers/Demuxers:
 | 
			
		||||
  gxf.c                                 Reimar Doeffinger
 | 
			
		||||
  gxfenc.c                              Baptiste Coudurier
 | 
			
		||||
  hls.c                                 Anssi Hannula
 | 
			
		||||
  hls encryption (hlsenc.c)             Christian Suloway
 | 
			
		||||
  idcin.c                               Mike Melanson
 | 
			
		||||
  idroqdec.c                            Mike Melanson
 | 
			
		||||
  iff.c                                 Jaikrishnan Menon
 | 
			
		||||
@@ -485,13 +461,9 @@ Muxers/Demuxers:
 | 
			
		||||
  rmdec.c, rmenc.c                      Ronald S. Bultje, Kostya Shishkov
 | 
			
		||||
  rtmp*                                 Kostya Shishkov
 | 
			
		||||
  rtp.c, rtpenc.c                       Martin Storsjo
 | 
			
		||||
  rtpdec_ac3.*                          Gilles Chanteperdrix
 | 
			
		||||
  rtpdec_dv.*                           Thomas Volkert
 | 
			
		||||
  rtpdec_h261.*, rtpenc_h261.*          Thomas Volkert
 | 
			
		||||
  rtpdec_hevc.*, rtpenc_hevc.*          Thomas Volkert
 | 
			
		||||
  rtpdec_mpa_robust.*                   Gilles Chanteperdrix
 | 
			
		||||
  rtpdec_hevc.*                         Thomas Volkert
 | 
			
		||||
  rtpdec_asf.*                          Ronald S. Bultje
 | 
			
		||||
  rtpdec_vp9.c                          Thomas Volkert
 | 
			
		||||
  rtpenc_mpv.*, rtpenc_aac.*            Martin Storsjo
 | 
			
		||||
  rtsp.c                                Luca Barbato
 | 
			
		||||
  sbgdec.c                              Nicolas George
 | 
			
		||||
@@ -518,14 +490,12 @@ Muxers/Demuxers:
 | 
			
		||||
  wvenc.c                               Paul B Mahol
 | 
			
		||||
 | 
			
		||||
Protocols:
 | 
			
		||||
  async.c                               Zhang Rui
 | 
			
		||||
  bluray.c                              Petri Hintukainen
 | 
			
		||||
  ftp.c                                 Lukasz Marek
 | 
			
		||||
  http.c                                Ronald S. Bultje
 | 
			
		||||
  libssh.c                              Lukasz Marek
 | 
			
		||||
  mms*.c                                Ronald S. Bultje
 | 
			
		||||
  udp.c                                 Luca Abeni
 | 
			
		||||
  icecast.c                             Marvin Scholz
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
libswresample
 | 
			
		||||
@@ -554,22 +524,19 @@ Amiga / PowerPC                         Colin Ward
 | 
			
		||||
Linux / PowerPC                         Luca Barbato
 | 
			
		||||
Windows MinGW                           Alex Beregszaszi, Ramiro Polla
 | 
			
		||||
Windows Cygwin                          Victor Paesa
 | 
			
		||||
Windows MSVC                            Matthew Oliver, Hendrik Leppkes
 | 
			
		||||
Windows MSVC                            Matthew Oliver
 | 
			
		||||
Windows ICL                             Matthew Oliver
 | 
			
		||||
ADI/Blackfin DSP                        Marc Hoffman
 | 
			
		||||
Sparc                                   Roman Shaposhnik
 | 
			
		||||
x86                                     Michael Niedermayer
 | 
			
		||||
OS/2                                    KO Myung-Hun
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Releases
 | 
			
		||||
========
 | 
			
		||||
 | 
			
		||||
2.8                                     Michael Niedermayer
 | 
			
		||||
2.7                                     Michael Niedermayer
 | 
			
		||||
2.6                                     Michael Niedermayer
 | 
			
		||||
2.5                                     Michael Niedermayer
 | 
			
		||||
2.4                                     Michael Niedermayer
 | 
			
		||||
2.2                                     Michael Niedermayer
 | 
			
		||||
1.2                                     Michael Niedermayer
 | 
			
		||||
 | 
			
		||||
If you want to maintain an older release, please contact us
 | 
			
		||||
 | 
			
		||||
@@ -600,7 +567,6 @@ Michael Niedermayer           9FF2 128B 147E F673 0BAD F133 611E C787 040B 0FAB
 | 
			
		||||
Nicolas George                24CE 01CE 9ACC 5CEB 74D8 8D9D B063 D997 36E5 4C93
 | 
			
		||||
Panagiotis Issaris            6571 13A3 33D9 3726 F728 AA98 F643 B12E ECF3 E029
 | 
			
		||||
Peter Ross                    A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B
 | 
			
		||||
Philip Langdale               5DC5 8D66 5FBA 3A43 18EC 045E F8D6 B194 6A75 682E
 | 
			
		||||
Reimar Doeffinger             C61D 16E5 9E2C D10C 8958 38A4 0899 A2B9 06D4 D9C7
 | 
			
		||||
Reinhard Tartler              9300 5DC2 7E87 6C37 ED7B CA9A 9808 3544 9453 48A4
 | 
			
		||||
Reynaldo H. Verdejo Pinochet  6E27 CD34 170C C78E 4D4F 5F40 C18E 077F 3114 452A
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										13
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								Makefile
									
									
									
									
									
								
							@@ -31,11 +31,7 @@ $(foreach prog,$(AVBASENAMES),$(eval OBJS-$(prog)-$(CONFIG_OPENCL) += cmdutils_o
 | 
			
		||||
OBJS-ffmpeg                   += ffmpeg_opt.o ffmpeg_filter.o
 | 
			
		||||
OBJS-ffmpeg-$(HAVE_VDPAU_X11) += ffmpeg_vdpau.o
 | 
			
		||||
OBJS-ffmpeg-$(HAVE_DXVA2_LIB) += ffmpeg_dxva2.o
 | 
			
		||||
ifndef CONFIG_VIDEOTOOLBOX
 | 
			
		||||
OBJS-ffmpeg-$(CONFIG_VDA)     += ffmpeg_videotoolbox.o
 | 
			
		||||
endif
 | 
			
		||||
OBJS-ffmpeg-$(CONFIG_VIDEOTOOLBOX) += ffmpeg_videotoolbox.o
 | 
			
		||||
OBJS-ffserver                 += ffserver_config.o
 | 
			
		||||
OBJS-ffmpeg-$(CONFIG_VDA)     += ffmpeg_vda.o
 | 
			
		||||
 | 
			
		||||
TESTTOOLS   = audiogen videogen rotozoom tiny_psnr tiny_ssim base64
 | 
			
		||||
HOSTPROGS  := $(TESTTOOLS:%=tests/%) doc/print_options
 | 
			
		||||
@@ -63,7 +59,6 @@ include $(SRC_PATH)/common.mak
 | 
			
		||||
 | 
			
		||||
FF_EXTRALIBS := $(FFEXTRALIBS)
 | 
			
		||||
FF_DEP_LIBS  := $(DEP_LIBS)
 | 
			
		||||
FF_STATIC_DEP_LIBS := $(STATIC_DEP_LIBS)
 | 
			
		||||
 | 
			
		||||
all: $(AVPROGS)
 | 
			
		||||
 | 
			
		||||
@@ -84,8 +79,8 @@ SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS TOOLS      \
 | 
			
		||||
               HEADERS ARCH_HEADERS BUILT_HEADERS SKIPHEADERS            \
 | 
			
		||||
               ARMV5TE-OBJS ARMV6-OBJS ARMV8-OBJS VFP-OBJS NEON-OBJS     \
 | 
			
		||||
               ALTIVEC-OBJS MMX-OBJS YASM-OBJS                           \
 | 
			
		||||
               MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSPR1-OBJS MSA-OBJS       \
 | 
			
		||||
               MMI-OBJS OBJS SLIBOBJS HOSTOBJS TESTOBJS
 | 
			
		||||
               MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSPR1-OBJS MIPS32R2-OBJS  \
 | 
			
		||||
               OBJS SLIBOBJS HOSTOBJS TESTOBJS
 | 
			
		||||
 | 
			
		||||
define RESET
 | 
			
		||||
$(1) :=
 | 
			
		||||
@@ -179,7 +174,7 @@ clean::
 | 
			
		||||
 | 
			
		||||
distclean::
 | 
			
		||||
	$(RM) $(DISTCLEANSUFFIXES)
 | 
			
		||||
	$(RM) config.* .config libavutil/avconfig.h .version avversion.h version.h libavutil/ffversion.h libavcodec/codec_names.h
 | 
			
		||||
	$(RM) config.* .config libavutil/avconfig.h .version version.h libavutil/ffversion.h libavcodec/codec_names.h
 | 
			
		||||
 | 
			
		||||
config:
 | 
			
		||||
	$(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)
 | 
			
		||||
 
 | 
			
		||||
@@ -19,10 +19,8 @@ such as audio, video, subtitles and related metadata.
 | 
			
		||||
* [ffmpeg](http://ffmpeg.org/ffmpeg.html) is a command line toolbox to
 | 
			
		||||
  manipulate, convert and stream multimedia content.
 | 
			
		||||
* [ffplay](http://ffmpeg.org/ffplay.html) is a minimalistic multimedia player.
 | 
			
		||||
* [ffprobe](http://ffmpeg.org/ffprobe.html) is a simple analysis tool to inspect
 | 
			
		||||
* [ffprobe](http://ffmpeg.org/ffprobe.html) is a simple analisys tool to inspect
 | 
			
		||||
  multimedia content.
 | 
			
		||||
* [ffserver](http://ffmpeg.org/ffserver.html) is a multimedia streaming server
 | 
			
		||||
  for live broadcasts.
 | 
			
		||||
* Additional small tools such as `aviocat`, `ismindex` and `qt-faststart`.
 | 
			
		||||
 | 
			
		||||
## Documentation
 | 
			
		||||
@@ -34,7 +32,7 @@ and in the [wiki](http://trac.ffmpeg.org).
 | 
			
		||||
 | 
			
		||||
### Examples
 | 
			
		||||
 | 
			
		||||
Coding examples are available in the **doc/examples** directory.
 | 
			
		||||
Conding examples are available in the **doc/example** directory.
 | 
			
		||||
 | 
			
		||||
## License
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,15 +1,83 @@
 | 
			
		||||
 | 
			
		||||
 ┌────────────────────────────────────────┐
 | 
			
		||||
              │ RELEASE NOTES for FFmpeg 2.8 "Feynman" │
 | 
			
		||||
 │ RELEASE NOTES for FFmpeg 2.4 "Fresnel" │
 | 
			
		||||
 └────────────────────────────────────────┘
 | 
			
		||||
 | 
			
		||||
   The FFmpeg Project proudly presents FFmpeg 2.8 "Feynman", about 3
 | 
			
		||||
   months after the release of FFmpeg 2.7.
 | 
			
		||||
   The FFmpeg Project proudly presents FFmpeg 2.4 "Fresnel", just 2 months
 | 
			
		||||
   after the release of 2.3. Since this wasn't a long time ago, the Changelog
 | 
			
		||||
   is a bit short this time.
 | 
			
		||||
 | 
			
		||||
   A complete Changelog is available at the root of the project, and the
 | 
			
		||||
   complete Git history on http://source.ffmpeg.org.
 | 
			
		||||
   The most important thing in this release is the major version bump of the
 | 
			
		||||
   libraries.  This means that this release is neither ABI-compatible nor
 | 
			
		||||
   fully API-compatible. But on the other hand it is aligned with the Libav
 | 
			
		||||
   11 release series, and will as a result probably end up being maintained for
 | 
			
		||||
   a long time.
 | 
			
		||||
 | 
			
		||||
   We hope you will like this release as much as we enjoyed working on it, and
 | 
			
		||||
   as usual, if you have any questions about it, or any FFmpeg related topic,
 | 
			
		||||
   feel free to join us on the #ffmpeg IRC channel (on irc.freenode.net) or ask
 | 
			
		||||
   on the mailing-lists.
 | 
			
		||||
   As usual, if you have any question on this release or any FFmpeg related
 | 
			
		||||
   topic, feel free to join us on the #ffmpeg IRC channel (on
 | 
			
		||||
   irc.freenode.net).
 | 
			
		||||
 | 
			
		||||
   ┌────────────────────────────┐
 | 
			
		||||
   │ 🔨  API Information         │
 | 
			
		||||
   └────────────────────────────┘
 | 
			
		||||
 | 
			
		||||
     FFmpeg 2.4 includes the following library versions:
 | 
			
		||||
 | 
			
		||||
       • libavutil      54.7.100
 | 
			
		||||
       • libavcodec     56.1.100
 | 
			
		||||
       • libavformat    56.4.101
 | 
			
		||||
       • libavdevice    56.0.100
 | 
			
		||||
       • libavfilter     5.1.100
 | 
			
		||||
       • libswscale      3.0.100
 | 
			
		||||
       • libswresample   1.1.100
 | 
			
		||||
       • libpostproc    53.0.100
 | 
			
		||||
 | 
			
		||||
     Important API changes since 2.3:
 | 
			
		||||
 | 
			
		||||
       • The new field mime_type was added to AVProbeData, which can
 | 
			
		||||
         cause crashes, if it is not initialized.
 | 
			
		||||
       • Some deprecated functions were removed.
 | 
			
		||||
       • The avfilter_graph_parse function was made compatible with Libav.
 | 
			
		||||
       • The Matroska demuxer now outputs verbatim ASS packets.
 | 
			
		||||
 | 
			
		||||
     Please refer to the doc/APIchanges file for more information.
 | 
			
		||||
 | 
			
		||||
 ┌────────────────────────────┐
 | 
			
		||||
 │ ★  List of New Features    │
 | 
			
		||||
 └────────────────────────────┘
 | 
			
		||||
 | 
			
		||||
   ┌────────────────────────────┐
 | 
			
		||||
   │ libavformat                │
 | 
			
		||||
   └────────────────────────────┘
 | 
			
		||||
 | 
			
		||||
    • Icecast protocol.
 | 
			
		||||
    • API for live metadata updates through event flags.
 | 
			
		||||
    • UTF-16 support in text subtitles formats.
 | 
			
		||||
    • The ASS muxer now reorders the Dialogue events properly.
 | 
			
		||||
    • support for H.261 RTP payload format (RFC 4587)
 | 
			
		||||
    • HEVC/H.265 RTP payload format (draft v6) depacketizer
 | 
			
		||||
 | 
			
		||||
   ┌────────────────────────────┐
 | 
			
		||||
   │ libavfilter                │
 | 
			
		||||
   └────────────────────────────┘
 | 
			
		||||
 | 
			
		||||
    • Ported lenscorrection filter from frei0r filter.
 | 
			
		||||
    • Large optimizations in dctdnoiz to make it usable.
 | 
			
		||||
    • Added codecview filter to visualize information exported by some codecs.
 | 
			
		||||
    • Added silenceremove filter.
 | 
			
		||||
 | 
			
		||||
   ┌────────────────────────────┐
 | 
			
		||||
   │ libavutil                  │
 | 
			
		||||
   └────────────────────────────┘
 | 
			
		||||
 | 
			
		||||
    • Added clip() function in eval.
 | 
			
		||||
 | 
			
		||||
 ┌────────────────────────────┐
 | 
			
		||||
 │ ⚠  Behaviour changes       │
 | 
			
		||||
 └────────────────────────────┘
 | 
			
		||||
 | 
			
		||||
  • dctdnoiz filter now uses a block size of 8x8 instead of 16x16 by default
 | 
			
		||||
  • -vismv option is deprecated in favor of the codecview filter
 | 
			
		||||
  • libmodplug is now detected through pkg-config
 | 
			
		||||
  • HTML documentation generation through texi2html is deprecated in
 | 
			
		||||
    favor of makeinfo/texi2any
 | 
			
		||||
  • ICY metadata are now requested by default with the HTTP protocol
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										4
									
								
								arch.mak
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								arch.mak
									
									
									
									
									
								
							@@ -5,13 +5,11 @@ OBJS-$(HAVE_VFP)     += $(VFP-OBJS)     $(VFP-OBJS-yes)
 | 
			
		||||
OBJS-$(HAVE_NEON)    += $(NEON-OBJS)    $(NEON-OBJS-yes)
 | 
			
		||||
 | 
			
		||||
OBJS-$(HAVE_MIPSFPU)   += $(MIPSFPU-OBJS)    $(MIPSFPU-OBJS-yes)
 | 
			
		||||
OBJS-$(HAVE_MIPS32R2)  += $(MIPS32R2-OBJS)   $(MIPS32R2-OBJS-yes)
 | 
			
		||||
OBJS-$(HAVE_MIPSDSPR1) += $(MIPSDSPR1-OBJS)  $(MIPSDSPR1-OBJS-yes)
 | 
			
		||||
OBJS-$(HAVE_MIPSDSPR2) += $(MIPSDSPR2-OBJS)  $(MIPSDSPR2-OBJS-yes)
 | 
			
		||||
OBJS-$(HAVE_MSA)       += $(MSA-OBJS)        $(MSA-OBJS-yes)
 | 
			
		||||
OBJS-$(HAVE_MMI)   += $(MMI-OBJS)   $(MMI-OBJS-yes)
 | 
			
		||||
 | 
			
		||||
OBJS-$(HAVE_ALTIVEC) += $(ALTIVEC-OBJS) $(ALTIVEC-OBJS-yes)
 | 
			
		||||
OBJS-$(HAVE_VSX)     += $(VSX-OBJS) $(VSX-OBJS-yes)
 | 
			
		||||
 | 
			
		||||
OBJS-$(HAVE_MMX)     += $(MMX-OBJS)     $(MMX-OBJS-yes)
 | 
			
		||||
OBJS-$(HAVE_YASM)    += $(YASM-OBJS)    $(YASM-OBJS-yes)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										352
									
								
								cmdutils.c
									
									
									
									
									
								
							
							
						
						
									
										352
									
								
								cmdutils.c
									
									
									
									
									
								
							@@ -41,10 +41,8 @@
 | 
			
		||||
#include "libavutil/avassert.h"
 | 
			
		||||
#include "libavutil/avstring.h"
 | 
			
		||||
#include "libavutil/bprint.h"
 | 
			
		||||
#include "libavutil/display.h"
 | 
			
		||||
#include "libavutil/mathematics.h"
 | 
			
		||||
#include "libavutil/imgutils.h"
 | 
			
		||||
#include "libavutil/libm.h"
 | 
			
		||||
#include "libavutil/parseutils.h"
 | 
			
		||||
#include "libavutil/pixdesc.h"
 | 
			
		||||
#include "libavutil/eval.h"
 | 
			
		||||
@@ -63,7 +61,7 @@
 | 
			
		||||
 | 
			
		||||
static int init_report(const char *env);
 | 
			
		||||
 | 
			
		||||
AVDictionary *sws_dict;
 | 
			
		||||
struct SwsContext *sws_opts;
 | 
			
		||||
AVDictionary *swr_opts;
 | 
			
		||||
AVDictionary *format_opts, *codec_opts, *resample_opts;
 | 
			
		||||
 | 
			
		||||
@@ -73,13 +71,20 @@ int hide_banner = 0;
 | 
			
		||||
 | 
			
		||||
void init_opts(void)
 | 
			
		||||
{
 | 
			
		||||
    av_dict_set(&sws_dict, "flags", "bicubic", 0);
 | 
			
		||||
 | 
			
		||||
    if(CONFIG_SWSCALE)
 | 
			
		||||
        sws_opts = sws_getContext(16, 16, 0, 16, 16, 0, SWS_BICUBIC,
 | 
			
		||||
                              NULL, NULL, NULL);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void uninit_opts(void)
 | 
			
		||||
{
 | 
			
		||||
#if CONFIG_SWSCALE
 | 
			
		||||
    sws_freeContext(sws_opts);
 | 
			
		||||
    sws_opts = NULL;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    av_dict_free(&swr_opts);
 | 
			
		||||
    av_dict_free(&sws_dict);
 | 
			
		||||
    av_dict_free(&format_opts);
 | 
			
		||||
    av_dict_free(&codec_opts);
 | 
			
		||||
    av_dict_free(&resample_opts);
 | 
			
		||||
@@ -285,14 +290,10 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt,
 | 
			
		||||
    if (po->flags & OPT_SPEC) {
 | 
			
		||||
        SpecifierOpt **so = dst;
 | 
			
		||||
        char *p = strchr(opt, ':');
 | 
			
		||||
        char *str;
 | 
			
		||||
 | 
			
		||||
        dstcount = (int *)(so + 1);
 | 
			
		||||
        *so = grow_array(*so, sizeof(**so), dstcount, *dstcount + 1);
 | 
			
		||||
        str = av_strdup(p ? p + 1 : "");
 | 
			
		||||
        if (!str)
 | 
			
		||||
            return AVERROR(ENOMEM);
 | 
			
		||||
        (*so)[*dstcount - 1].specifier = str;
 | 
			
		||||
        (*so)[*dstcount - 1].specifier = av_strdup(p ? p + 1 : "");
 | 
			
		||||
        dst = &(*so)[*dstcount - 1].u;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -300,8 +301,6 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt,
 | 
			
		||||
        char *str;
 | 
			
		||||
        str = av_strdup(arg);
 | 
			
		||||
        av_freep(dst);
 | 
			
		||||
        if (!str)
 | 
			
		||||
            return AVERROR(ENOMEM);
 | 
			
		||||
        *(char **)dst = str;
 | 
			
		||||
    } else if (po->flags & OPT_BOOL || po->flags & OPT_INT) {
 | 
			
		||||
        *(int *)dst = parse_number_or_die(opt, arg, OPT_INT64, INT_MIN, INT_MAX);
 | 
			
		||||
@@ -445,7 +444,7 @@ int locate_option(int argc, char **argv, const OptionDef *options,
 | 
			
		||||
             (po->name && !strcmp(optname, po->name)))
 | 
			
		||||
            return i;
 | 
			
		||||
 | 
			
		||||
        if (!po->name || po->flags & HAS_ARG)
 | 
			
		||||
        if (po->flags & HAS_ARG)
 | 
			
		||||
            i++;
 | 
			
		||||
    }
 | 
			
		||||
    return 0;
 | 
			
		||||
@@ -475,22 +474,10 @@ static void dump_argument(const char *a)
 | 
			
		||||
    fputc('"', report_file);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void check_options(const OptionDef *po)
 | 
			
		||||
{
 | 
			
		||||
    while (po->name) {
 | 
			
		||||
        if (po->flags & OPT_PERFILE)
 | 
			
		||||
            av_assert0(po->flags & (OPT_INPUT | OPT_OUTPUT));
 | 
			
		||||
        po++;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void parse_loglevel(int argc, char **argv, const OptionDef *options)
 | 
			
		||||
{
 | 
			
		||||
    int idx = locate_option(argc, argv, options, "loglevel");
 | 
			
		||||
    const char *env;
 | 
			
		||||
 | 
			
		||||
    check_options(options);
 | 
			
		||||
 | 
			
		||||
    if (!idx)
 | 
			
		||||
        idx = locate_option(argc, argv, options, "v");
 | 
			
		||||
    if (idx && argv[idx + 1])
 | 
			
		||||
@@ -522,7 +509,7 @@ static const AVOption *opt_find(void *obj, const char *name, const char *unit,
 | 
			
		||||
    return o;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#define FLAGS (o->type == AV_OPT_TYPE_FLAGS && (arg[0]=='-' || arg[0]=='+')) ? AV_DICT_APPEND : 0
 | 
			
		||||
#define FLAGS (o->type == AV_OPT_TYPE_FLAGS) ? AV_DICT_APPEND : 0
 | 
			
		||||
int opt_default(void *optctx, const char *opt, const char *arg)
 | 
			
		||||
{
 | 
			
		||||
    const AVOption *o;
 | 
			
		||||
@@ -558,24 +545,14 @@ int opt_default(void *optctx, const char *opt, const char *arg)
 | 
			
		||||
    }
 | 
			
		||||
#if CONFIG_SWSCALE
 | 
			
		||||
    sc = sws_get_class();
 | 
			
		||||
    if (!consumed && (o = opt_find(&sc, opt, NULL, 0,
 | 
			
		||||
                         AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {
 | 
			
		||||
        struct SwsContext *sws = sws_alloc_context();
 | 
			
		||||
        int ret = av_opt_set(sws, opt, arg, 0);
 | 
			
		||||
        sws_freeContext(sws);
 | 
			
		||||
        if (!strcmp(opt, "srcw") || !strcmp(opt, "srch") ||
 | 
			
		||||
            !strcmp(opt, "dstw") || !strcmp(opt, "dsth") ||
 | 
			
		||||
            !strcmp(opt, "src_format") || !strcmp(opt, "dst_format")) {
 | 
			
		||||
            av_log(NULL, AV_LOG_ERROR, "Directly using swscale dimensions/format options is not supported, please use the -s or -pix_fmt options\n");
 | 
			
		||||
            return AVERROR(EINVAL);
 | 
			
		||||
        }
 | 
			
		||||
    if (!consumed && opt_find(&sc, opt, NULL, 0,
 | 
			
		||||
                         AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)) {
 | 
			
		||||
        // XXX we only support sws_flags, not arbitrary sws options
 | 
			
		||||
        int ret = av_opt_set(sws_opts, opt, arg, 0);
 | 
			
		||||
        if (ret < 0) {
 | 
			
		||||
            av_log(NULL, AV_LOG_ERROR, "Error setting option %s.\n", opt);
 | 
			
		||||
            return ret;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        av_dict_set(&sws_dict, opt, arg, FLAGS);
 | 
			
		||||
 | 
			
		||||
        consumed = 1;
 | 
			
		||||
    }
 | 
			
		||||
#else
 | 
			
		||||
@@ -649,7 +626,9 @@ static void finish_group(OptionParseContext *octx, int group_idx,
 | 
			
		||||
    *g             = octx->cur_group;
 | 
			
		||||
    g->arg         = arg;
 | 
			
		||||
    g->group_def   = l->group_def;
 | 
			
		||||
    g->sws_dict    = sws_dict;
 | 
			
		||||
#if CONFIG_SWSCALE
 | 
			
		||||
    g->sws_opts    = sws_opts;
 | 
			
		||||
#endif
 | 
			
		||||
    g->swr_opts    = swr_opts;
 | 
			
		||||
    g->codec_opts  = codec_opts;
 | 
			
		||||
    g->format_opts = format_opts;
 | 
			
		||||
@@ -658,7 +637,9 @@ static void finish_group(OptionParseContext *octx, int group_idx,
 | 
			
		||||
    codec_opts  = NULL;
 | 
			
		||||
    format_opts = NULL;
 | 
			
		||||
    resample_opts = NULL;
 | 
			
		||||
    sws_dict    = NULL;
 | 
			
		||||
#if CONFIG_SWSCALE
 | 
			
		||||
    sws_opts    = NULL;
 | 
			
		||||
#endif
 | 
			
		||||
    swr_opts    = NULL;
 | 
			
		||||
    init_opts();
 | 
			
		||||
 | 
			
		||||
@@ -714,8 +695,9 @@ void uninit_parse_context(OptionParseContext *octx)
 | 
			
		||||
            av_dict_free(&l->groups[j].codec_opts);
 | 
			
		||||
            av_dict_free(&l->groups[j].format_opts);
 | 
			
		||||
            av_dict_free(&l->groups[j].resample_opts);
 | 
			
		||||
 | 
			
		||||
            av_dict_free(&l->groups[j].sws_dict);
 | 
			
		||||
#if CONFIG_SWSCALE
 | 
			
		||||
            sws_freeContext(l->groups[j].sws_opts);
 | 
			
		||||
#endif
 | 
			
		||||
            av_dict_free(&l->groups[j].swr_opts);
 | 
			
		||||
        }
 | 
			
		||||
        av_freep(&l->groups);
 | 
			
		||||
@@ -857,7 +839,6 @@ int opt_loglevel(void *optctx, const char *opt, const char *arg)
 | 
			
		||||
        { "info"   , AV_LOG_INFO    },
 | 
			
		||||
        { "verbose", AV_LOG_VERBOSE },
 | 
			
		||||
        { "debug"  , AV_LOG_DEBUG   },
 | 
			
		||||
        { "trace"  , AV_LOG_TRACE   },
 | 
			
		||||
    };
 | 
			
		||||
    char *tail;
 | 
			
		||||
    int level;
 | 
			
		||||
@@ -978,10 +959,9 @@ static int init_report(const char *env)
 | 
			
		||||
 | 
			
		||||
    report_file = fopen(filename.str, "w");
 | 
			
		||||
    if (!report_file) {
 | 
			
		||||
        int ret = AVERROR(errno);
 | 
			
		||||
        av_log(NULL, AV_LOG_ERROR, "Failed to open report \"%s\": %s\n",
 | 
			
		||||
               filename.str, strerror(errno));
 | 
			
		||||
        return ret;
 | 
			
		||||
        return AVERROR(errno);
 | 
			
		||||
    }
 | 
			
		||||
    av_log_set_callback(log_callback_report);
 | 
			
		||||
    av_log(NULL, AV_LOG_INFO,
 | 
			
		||||
@@ -1094,7 +1074,8 @@ static void print_program_info(int flags, int level)
 | 
			
		||||
        av_log(NULL, level, " Copyright (c) %d-%d the FFmpeg developers",
 | 
			
		||||
               program_birth_year, CONFIG_THIS_YEAR);
 | 
			
		||||
    av_log(NULL, level, "\n");
 | 
			
		||||
    av_log(NULL, level, "%sbuilt with %s\n", indent, CC_IDENT);
 | 
			
		||||
    av_log(NULL, level, "%sbuilt on %s %s with %s\n",
 | 
			
		||||
           indent, __DATE__, __TIME__, CC_IDENT);
 | 
			
		||||
 | 
			
		||||
    av_log(NULL, level, "%sconfiguration: " FFMPEG_CONFIGURATION "\n", indent);
 | 
			
		||||
}
 | 
			
		||||
@@ -1231,7 +1212,12 @@ static int is_device(const AVClass *avclass)
 | 
			
		||||
{
 | 
			
		||||
    if (!avclass)
 | 
			
		||||
        return 0;
 | 
			
		||||
    return AV_IS_INPUT_DEVICE(avclass->category) || AV_IS_OUTPUT_DEVICE(avclass->category);
 | 
			
		||||
    return avclass->category == AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT ||
 | 
			
		||||
           avclass->category == AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT ||
 | 
			
		||||
           avclass->category == AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT ||
 | 
			
		||||
           avclass->category == AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT ||
 | 
			
		||||
           avclass->category == AV_CLASS_CATEGORY_DEVICE_OUTPUT ||
 | 
			
		||||
           avclass->category == AV_CLASS_CATEGORY_DEVICE_INPUT;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int show_formats_devices(void *optctx, const char *opt, const char *arg, int device_only)
 | 
			
		||||
@@ -1322,12 +1308,12 @@ static void print_codec(const AVCodec *c)
 | 
			
		||||
    if (c->type == AVMEDIA_TYPE_VIDEO ||
 | 
			
		||||
        c->type == AVMEDIA_TYPE_AUDIO) {
 | 
			
		||||
        printf("    Threading capabilities: ");
 | 
			
		||||
        switch (c->capabilities & (AV_CODEC_CAP_FRAME_THREADS |
 | 
			
		||||
                                   AV_CODEC_CAP_SLICE_THREADS)) {
 | 
			
		||||
        case AV_CODEC_CAP_FRAME_THREADS |
 | 
			
		||||
             AV_CODEC_CAP_SLICE_THREADS: printf("frame and slice"); break;
 | 
			
		||||
        case AV_CODEC_CAP_FRAME_THREADS: printf("frame");           break;
 | 
			
		||||
        case AV_CODEC_CAP_SLICE_THREADS: printf("slice");           break;
 | 
			
		||||
        switch (c->capabilities & (CODEC_CAP_FRAME_THREADS |
 | 
			
		||||
                                   CODEC_CAP_SLICE_THREADS)) {
 | 
			
		||||
        case CODEC_CAP_FRAME_THREADS |
 | 
			
		||||
             CODEC_CAP_SLICE_THREADS: printf("frame and slice"); break;
 | 
			
		||||
        case CODEC_CAP_FRAME_THREADS: printf("frame");           break;
 | 
			
		||||
        case CODEC_CAP_SLICE_THREADS: printf("slice");           break;
 | 
			
		||||
        default:                      printf("no");              break;
 | 
			
		||||
        }
 | 
			
		||||
        printf("\n");
 | 
			
		||||
@@ -1501,11 +1487,11 @@ static void print_codecs(int encoder)
 | 
			
		||||
 | 
			
		||||
        while ((codec = next_codec_for_id(desc->id, codec, encoder))) {
 | 
			
		||||
            printf(" %c", get_media_type_char(desc->type));
 | 
			
		||||
            printf((codec->capabilities & AV_CODEC_CAP_FRAME_THREADS) ? "F" : ".");
 | 
			
		||||
            printf((codec->capabilities & AV_CODEC_CAP_SLICE_THREADS) ? "S" : ".");
 | 
			
		||||
            printf((codec->capabilities & AV_CODEC_CAP_EXPERIMENTAL)  ? "X" : ".");
 | 
			
		||||
            printf((codec->capabilities & AV_CODEC_CAP_DRAW_HORIZ_BAND)?"B" : ".");
 | 
			
		||||
            printf((codec->capabilities & AV_CODEC_CAP_DR1)           ? "D" : ".");
 | 
			
		||||
            printf((codec->capabilities & CODEC_CAP_FRAME_THREADS) ? "F" : ".");
 | 
			
		||||
            printf((codec->capabilities & CODEC_CAP_SLICE_THREADS) ? "S" : ".");
 | 
			
		||||
            printf((codec->capabilities & CODEC_CAP_EXPERIMENTAL)  ? "X" : ".");
 | 
			
		||||
            printf((codec->capabilities & CODEC_CAP_DRAW_HORIZ_BAND)?"B" : ".");
 | 
			
		||||
            printf((codec->capabilities & CODEC_CAP_DR1)           ? "D" : ".");
 | 
			
		||||
 | 
			
		||||
            printf(" %-20s %s", codec->name, codec->long_name ? codec->long_name : "");
 | 
			
		||||
            if (strcmp(codec->name, desc->name))
 | 
			
		||||
@@ -1557,8 +1543,7 @@ int show_protocols(void *optctx, const char *opt, const char *arg)
 | 
			
		||||
 | 
			
		||||
int show_filters(void *optctx, const char *opt, const char *arg)
 | 
			
		||||
{
 | 
			
		||||
#if CONFIG_AVFILTER
 | 
			
		||||
    const AVFilter *filter = NULL;
 | 
			
		||||
    const AVFilter av_unused(*filter) = NULL;
 | 
			
		||||
    char descr[64], *descr_cur;
 | 
			
		||||
    int i, j;
 | 
			
		||||
    const AVFilterPad *pad;
 | 
			
		||||
@@ -1566,11 +1551,12 @@ int show_filters(void *optctx, const char *opt, const char *arg)
 | 
			
		||||
    printf("Filters:\n"
 | 
			
		||||
           "  T.. = Timeline support\n"
 | 
			
		||||
           "  .S. = Slice threading\n"
 | 
			
		||||
           "  ..C = Command support\n"
 | 
			
		||||
           "  ..C = Commmand support\n"
 | 
			
		||||
           "  A = Audio input/output\n"
 | 
			
		||||
           "  V = Video input/output\n"
 | 
			
		||||
           "  N = Dynamic number and/or type of input/output\n"
 | 
			
		||||
           "  | = Source or sink filter\n");
 | 
			
		||||
#if CONFIG_AVFILTER
 | 
			
		||||
    while ((filter = avfilter_next(filter))) {
 | 
			
		||||
        descr_cur = descr;
 | 
			
		||||
        for (i = 0; i < 2; i++) {
 | 
			
		||||
@@ -1579,10 +1565,10 @@ int show_filters(void *optctx, const char *opt, const char *arg)
 | 
			
		||||
                *(descr_cur++) = '>';
 | 
			
		||||
            }
 | 
			
		||||
            pad = i ? filter->outputs : filter->inputs;
 | 
			
		||||
            for (j = 0; pad && avfilter_pad_get_name(pad, j); j++) {
 | 
			
		||||
            for (j = 0; pad && pad[j].name; j++) {
 | 
			
		||||
                if (descr_cur >= descr + sizeof(descr) - 4)
 | 
			
		||||
                    break;
 | 
			
		||||
                *(descr_cur++) = get_media_type_char(avfilter_pad_get_type(pad, j));
 | 
			
		||||
                *(descr_cur++) = get_media_type_char(pad[j].type);
 | 
			
		||||
            }
 | 
			
		||||
            if (!j)
 | 
			
		||||
                *(descr_cur++) = ((!i && (filter->flags & AVFILTER_FLAG_DYNAMIC_INPUTS)) ||
 | 
			
		||||
@@ -1595,8 +1581,6 @@ int show_filters(void *optctx, const char *opt, const char *arg)
 | 
			
		||||
               filter->process_command                        ? 'C' : '.',
 | 
			
		||||
               filter->name, descr, filter->description);
 | 
			
		||||
    }
 | 
			
		||||
#else
 | 
			
		||||
    printf("No filters available: libavfilter disabled\n");
 | 
			
		||||
#endif
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
@@ -1834,8 +1818,6 @@ int show_help(void *optctx, const char *opt, const char *arg)
 | 
			
		||||
    av_log_set_callback(log_callback_help);
 | 
			
		||||
 | 
			
		||||
    topic = av_strdup(arg ? arg : "");
 | 
			
		||||
    if (!topic)
 | 
			
		||||
        return AVERROR(ENOMEM);
 | 
			
		||||
    par = strchr(topic, '=');
 | 
			
		||||
    if (par)
 | 
			
		||||
        *par++ = 0;
 | 
			
		||||
@@ -1873,6 +1855,48 @@ int read_yesno(void)
 | 
			
		||||
    return yesno;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int cmdutils_read_file(const char *filename, char **bufptr, size_t *size)
 | 
			
		||||
{
 | 
			
		||||
    int64_t ret;
 | 
			
		||||
    FILE *f = av_fopen_utf8(filename, "rb");
 | 
			
		||||
 | 
			
		||||
    if (!f) {
 | 
			
		||||
        av_log(NULL, AV_LOG_ERROR, "Cannot read file '%s': %s\n", filename,
 | 
			
		||||
               strerror(errno));
 | 
			
		||||
        return AVERROR(errno);
 | 
			
		||||
    }
 | 
			
		||||
    fseek(f, 0, SEEK_END);
 | 
			
		||||
    *size = ftell(f);
 | 
			
		||||
    fseek(f, 0, SEEK_SET);
 | 
			
		||||
    if (*size == (size_t)-1) {
 | 
			
		||||
        av_log(NULL, AV_LOG_ERROR, "IO error: %s\n", strerror(errno));
 | 
			
		||||
        fclose(f);
 | 
			
		||||
        return AVERROR(errno);
 | 
			
		||||
    }
 | 
			
		||||
    *bufptr = av_malloc(*size + 1);
 | 
			
		||||
    if (!*bufptr) {
 | 
			
		||||
        av_log(NULL, AV_LOG_ERROR, "Could not allocate file buffer\n");
 | 
			
		||||
        fclose(f);
 | 
			
		||||
        return AVERROR(ENOMEM);
 | 
			
		||||
    }
 | 
			
		||||
    ret = fread(*bufptr, 1, *size, f);
 | 
			
		||||
    if (ret < *size) {
 | 
			
		||||
        av_free(*bufptr);
 | 
			
		||||
        if (ferror(f)) {
 | 
			
		||||
            av_log(NULL, AV_LOG_ERROR, "Error while reading file '%s': %s\n",
 | 
			
		||||
                   filename, strerror(errno));
 | 
			
		||||
            ret = AVERROR(errno);
 | 
			
		||||
        } else
 | 
			
		||||
            ret = AVERROR_EOF;
 | 
			
		||||
    } else {
 | 
			
		||||
        ret = 0;
 | 
			
		||||
        (*bufptr)[(*size)++] = '\0';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    fclose(f);
 | 
			
		||||
    return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
FILE *get_preset_file(char *filename, size_t filename_size,
 | 
			
		||||
                      const char *preset_name, int is_path,
 | 
			
		||||
                      const char *codec_name)
 | 
			
		||||
@@ -1968,7 +1992,7 @@ AVDictionary *filter_codec_opts(AVDictionary *opts, enum AVCodecID codec_id,
 | 
			
		||||
            switch (check_stream_specifier(s, st, p + 1)) {
 | 
			
		||||
            case  1: *p = 0; break;
 | 
			
		||||
            case  0:         continue;
 | 
			
		||||
            default:         exit_program(1);
 | 
			
		||||
            default:         return NULL;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
        if (av_opt_find(&cc, t->key, NULL, flags, AV_OPT_SEARCH_FAKE_OBJ) ||
 | 
			
		||||
@@ -2015,7 +2039,7 @@ void *grow_array(void *array, int elem_size, int *size, int new_size)
 | 
			
		||||
        exit_program(1);
 | 
			
		||||
    }
 | 
			
		||||
    if (*size < new_size) {
 | 
			
		||||
        uint8_t *tmp = av_realloc_array(array, new_size, elem_size);
 | 
			
		||||
        uint8_t *tmp = av_realloc(array, new_size*elem_size);
 | 
			
		||||
        if (!tmp) {
 | 
			
		||||
            av_log(NULL, AV_LOG_ERROR, "Could not alloc buffer.\n");
 | 
			
		||||
            exit_program(1);
 | 
			
		||||
@@ -2026,189 +2050,3 @@ void *grow_array(void *array, int elem_size, int *size, int new_size)
 | 
			
		||||
    }
 | 
			
		||||
    return array;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
double get_rotation(AVStream *st)
 | 
			
		||||
{
 | 
			
		||||
    AVDictionaryEntry *rotate_tag = av_dict_get(st->metadata, "rotate", NULL, 0);
 | 
			
		||||
    uint8_t* displaymatrix = av_stream_get_side_data(st,
 | 
			
		||||
                                                     AV_PKT_DATA_DISPLAYMATRIX, NULL);
 | 
			
		||||
    double theta = 0;
 | 
			
		||||
 | 
			
		||||
    if (rotate_tag && *rotate_tag->value && strcmp(rotate_tag->value, "0")) {
 | 
			
		||||
        char *tail;
 | 
			
		||||
        theta = av_strtod(rotate_tag->value, &tail);
 | 
			
		||||
        if (*tail)
 | 
			
		||||
            theta = 0;
 | 
			
		||||
    }
 | 
			
		||||
    if (displaymatrix && !theta)
 | 
			
		||||
        theta = -av_display_rotation_get((int32_t*) displaymatrix);
 | 
			
		||||
 | 
			
		||||
    theta -= 360*floor(theta/360 + 0.9/360);
 | 
			
		||||
 | 
			
		||||
    if (fabs(theta - 90*round(theta/90)) > 2)
 | 
			
		||||
        av_log(NULL, AV_LOG_WARNING, "Odd rotation angle.\n"
 | 
			
		||||
               "If you want to help, upload a sample "
 | 
			
		||||
               "of this file to ftp://upload.ffmpeg.org/incoming/ "
 | 
			
		||||
               "and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)");
 | 
			
		||||
 | 
			
		||||
    return theta;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#if CONFIG_AVDEVICE
 | 
			
		||||
static int print_device_sources(AVInputFormat *fmt, AVDictionary *opts)
 | 
			
		||||
{
 | 
			
		||||
    int ret, i;
 | 
			
		||||
    AVDeviceInfoList *device_list = NULL;
 | 
			
		||||
 | 
			
		||||
    if (!fmt || !fmt->priv_class  || !AV_IS_INPUT_DEVICE(fmt->priv_class->category))
 | 
			
		||||
        return AVERROR(EINVAL);
 | 
			
		||||
 | 
			
		||||
    printf("Audo-detected sources for %s:\n", fmt->name);
 | 
			
		||||
    if (!fmt->get_device_list) {
 | 
			
		||||
        ret = AVERROR(ENOSYS);
 | 
			
		||||
        printf("Cannot list sources. Not implemented.\n");
 | 
			
		||||
        goto fail;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if ((ret = avdevice_list_input_sources(fmt, NULL, opts, &device_list)) < 0) {
 | 
			
		||||
        printf("Cannot list sources.\n");
 | 
			
		||||
        goto fail;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    for (i = 0; i < device_list->nb_devices; i++) {
 | 
			
		||||
        printf("%s %s [%s]\n", device_list->default_device == i ? "*" : " ",
 | 
			
		||||
               device_list->devices[i]->device_name, device_list->devices[i]->device_description);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  fail:
 | 
			
		||||
    avdevice_free_list_devices(&device_list);
 | 
			
		||||
    return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int print_device_sinks(AVOutputFormat *fmt, AVDictionary *opts)
 | 
			
		||||
{
 | 
			
		||||
    int ret, i;
 | 
			
		||||
    AVDeviceInfoList *device_list = NULL;
 | 
			
		||||
 | 
			
		||||
    if (!fmt || !fmt->priv_class  || !AV_IS_OUTPUT_DEVICE(fmt->priv_class->category))
 | 
			
		||||
        return AVERROR(EINVAL);
 | 
			
		||||
 | 
			
		||||
    printf("Audo-detected sinks for %s:\n", fmt->name);
 | 
			
		||||
    if (!fmt->get_device_list) {
 | 
			
		||||
        ret = AVERROR(ENOSYS);
 | 
			
		||||
        printf("Cannot list sinks. Not implemented.\n");
 | 
			
		||||
        goto fail;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if ((ret = avdevice_list_output_sinks(fmt, NULL, opts, &device_list)) < 0) {
 | 
			
		||||
        printf("Cannot list sinks.\n");
 | 
			
		||||
        goto fail;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    for (i = 0; i < device_list->nb_devices; i++) {
 | 
			
		||||
        printf("%s %s [%s]\n", device_list->default_device == i ? "*" : " ",
 | 
			
		||||
               device_list->devices[i]->device_name, device_list->devices[i]->device_description);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  fail:
 | 
			
		||||
    avdevice_free_list_devices(&device_list);
 | 
			
		||||
    return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int show_sinks_sources_parse_arg(const char *arg, char **dev, AVDictionary **opts)
 | 
			
		||||
{
 | 
			
		||||
    int ret;
 | 
			
		||||
    if (arg) {
 | 
			
		||||
        char *opts_str = NULL;
 | 
			
		||||
        av_assert0(dev && opts);
 | 
			
		||||
        *dev = av_strdup(arg);
 | 
			
		||||
        if (!*dev)
 | 
			
		||||
            return AVERROR(ENOMEM);
 | 
			
		||||
        if ((opts_str = strchr(*dev, ','))) {
 | 
			
		||||
            *(opts_str++) = '\0';
 | 
			
		||||
            if (opts_str[0] && ((ret = av_dict_parse_string(opts, opts_str, "=", ":", 0)) < 0)) {
 | 
			
		||||
                av_freep(dev);
 | 
			
		||||
                return ret;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    } else
 | 
			
		||||
        printf("\nDevice name is not provided.\n"
 | 
			
		||||
                "You can pass devicename[,opt1=val1[,opt2=val2...]] as an argument.\n\n");
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int show_sources(void *optctx, const char *opt, const char *arg)
 | 
			
		||||
{
 | 
			
		||||
    AVInputFormat *fmt = NULL;
 | 
			
		||||
    char *dev = NULL;
 | 
			
		||||
    AVDictionary *opts = NULL;
 | 
			
		||||
    int ret = 0;
 | 
			
		||||
    int error_level = av_log_get_level();
 | 
			
		||||
 | 
			
		||||
    av_log_set_level(AV_LOG_ERROR);
 | 
			
		||||
 | 
			
		||||
    if ((ret = show_sinks_sources_parse_arg(arg, &dev, &opts)) < 0)
 | 
			
		||||
        goto fail;
 | 
			
		||||
 | 
			
		||||
    do {
 | 
			
		||||
        fmt = av_input_audio_device_next(fmt);
 | 
			
		||||
        if (fmt) {
 | 
			
		||||
            if (!strcmp(fmt->name, "lavfi"))
 | 
			
		||||
                continue; //it's pointless to probe lavfi
 | 
			
		||||
            if (dev && !av_match_name(dev, fmt->name))
 | 
			
		||||
                continue;
 | 
			
		||||
            print_device_sources(fmt, opts);
 | 
			
		||||
        }
 | 
			
		||||
    } while (fmt);
 | 
			
		||||
    do {
 | 
			
		||||
        fmt = av_input_video_device_next(fmt);
 | 
			
		||||
        if (fmt) {
 | 
			
		||||
            if (dev && !av_match_name(dev, fmt->name))
 | 
			
		||||
                continue;
 | 
			
		||||
            print_device_sources(fmt, opts);
 | 
			
		||||
        }
 | 
			
		||||
    } while (fmt);
 | 
			
		||||
  fail:
 | 
			
		||||
    av_dict_free(&opts);
 | 
			
		||||
    av_free(dev);
 | 
			
		||||
    av_log_set_level(error_level);
 | 
			
		||||
    return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int show_sinks(void *optctx, const char *opt, const char *arg)
 | 
			
		||||
{
 | 
			
		||||
    AVOutputFormat *fmt = NULL;
 | 
			
		||||
    char *dev = NULL;
 | 
			
		||||
    AVDictionary *opts = NULL;
 | 
			
		||||
    int ret = 0;
 | 
			
		||||
    int error_level = av_log_get_level();
 | 
			
		||||
 | 
			
		||||
    av_log_set_level(AV_LOG_ERROR);
 | 
			
		||||
 | 
			
		||||
    if ((ret = show_sinks_sources_parse_arg(arg, &dev, &opts)) < 0)
 | 
			
		||||
        goto fail;
 | 
			
		||||
 | 
			
		||||
    do {
 | 
			
		||||
        fmt = av_output_audio_device_next(fmt);
 | 
			
		||||
        if (fmt) {
 | 
			
		||||
            if (dev && !av_match_name(dev, fmt->name))
 | 
			
		||||
                continue;
 | 
			
		||||
            print_device_sinks(fmt, opts);
 | 
			
		||||
        }
 | 
			
		||||
    } while (fmt);
 | 
			
		||||
    do {
 | 
			
		||||
        fmt = av_output_video_device_next(fmt);
 | 
			
		||||
        if (fmt) {
 | 
			
		||||
            if (dev && !av_match_name(dev, fmt->name))
 | 
			
		||||
                continue;
 | 
			
		||||
            print_device_sinks(fmt, opts);
 | 
			
		||||
        }
 | 
			
		||||
    } while (fmt);
 | 
			
		||||
  fail:
 | 
			
		||||
    av_dict_free(&opts);
 | 
			
		||||
    av_free(dev);
 | 
			
		||||
    av_log_set_level(error_level);
 | 
			
		||||
    return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										32
									
								
								cmdutils.h
									
									
									
									
									
								
							
							
						
						
									
										32
									
								
								cmdutils.h
									
									
									
									
									
								
							@@ -46,7 +46,7 @@ extern const int program_birth_year;
 | 
			
		||||
 | 
			
		||||
extern AVCodecContext *avcodec_opts[AVMEDIA_TYPE_NB];
 | 
			
		||||
extern AVFormatContext *avformat_opts;
 | 
			
		||||
extern AVDictionary *sws_dict;
 | 
			
		||||
extern struct SwsContext *sws_opts;
 | 
			
		||||
extern AVDictionary *swr_opts;
 | 
			
		||||
extern AVDictionary *format_opts, *codec_opts, *resample_opts;
 | 
			
		||||
extern int hide_banner;
 | 
			
		||||
@@ -277,7 +277,7 @@ typedef struct OptionGroup {
 | 
			
		||||
    AVDictionary *codec_opts;
 | 
			
		||||
    AVDictionary *format_opts;
 | 
			
		||||
    AVDictionary *resample_opts;
 | 
			
		||||
    AVDictionary *sws_dict;
 | 
			
		||||
    struct SwsContext *sws_opts;
 | 
			
		||||
    AVDictionary *swr_opts;
 | 
			
		||||
} OptionGroup;
 | 
			
		||||
 | 
			
		||||
@@ -443,20 +443,6 @@ int show_formats(void *optctx, const char *opt, const char *arg);
 | 
			
		||||
 */
 | 
			
		||||
int show_devices(void *optctx, const char *opt, const char *arg);
 | 
			
		||||
 | 
			
		||||
#if CONFIG_AVDEVICE
 | 
			
		||||
/**
 | 
			
		||||
 * Print a listing containing audodetected sinks of the output device.
 | 
			
		||||
 * Device name with options may be passed as an argument to limit results.
 | 
			
		||||
 */
 | 
			
		||||
int show_sinks(void *optctx, const char *opt, const char *arg);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Print a listing containing audodetected sources of the input device.
 | 
			
		||||
 * Device name with options may be passed as an argument to limit results.
 | 
			
		||||
 */
 | 
			
		||||
int show_sources(void *optctx, const char *opt, const char *arg);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Print a listing containing all the codecs supported by the
 | 
			
		||||
 * program.
 | 
			
		||||
@@ -529,6 +515,18 @@ int show_colors(void *optctx, const char *opt, const char *arg);
 | 
			
		||||
 */
 | 
			
		||||
int read_yesno(void);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Read the file with name filename, and put its content in a newly
 | 
			
		||||
 * allocated 0-terminated buffer.
 | 
			
		||||
 *
 | 
			
		||||
 * @param filename file to read from
 | 
			
		||||
 * @param bufptr location where pointer to buffer is returned
 | 
			
		||||
 * @param size   location where size of buffer is returned
 | 
			
		||||
 * @return >= 0 in case of success, a negative value corresponding to an
 | 
			
		||||
 * AVERROR error code in case of failure.
 | 
			
		||||
 */
 | 
			
		||||
int cmdutils_read_file(const char *filename, char **bufptr, size_t *size);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Get a file corresponding to a preset file.
 | 
			
		||||
 *
 | 
			
		||||
@@ -585,6 +583,4 @@ void *grow_array(void *array, int elem_size, int *size, int new_size);
 | 
			
		||||
    char name[128];\
 | 
			
		||||
    av_get_channel_layout_string(name, sizeof(name), 0, ch_layout);
 | 
			
		||||
 | 
			
		||||
double get_rotation(AVStream *st);
 | 
			
		||||
 | 
			
		||||
#endif /* CMDUTILS_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -27,9 +27,3 @@
 | 
			
		||||
    { "opencl_bench", OPT_EXIT, {.func_arg = opt_opencl_bench}, "run benchmark on all OpenCL devices and show results" },
 | 
			
		||||
    { "opencl_options", HAS_ARG, {.func_arg = opt_opencl},      "set OpenCL environment options" },
 | 
			
		||||
#endif
 | 
			
		||||
#if CONFIG_AVDEVICE
 | 
			
		||||
    { "sources"    , OPT_EXIT | HAS_ARG, { .func_arg = show_sources },
 | 
			
		||||
      "list sources of the input device", "device" },
 | 
			
		||||
    { "sinks"      , OPT_EXIT | HAS_ARG, { .func_arg = show_sinks },
 | 
			
		||||
      "list sinks of the output device", "device" },
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -22,7 +22,6 @@
 | 
			
		||||
#include "libavutil/time.h"
 | 
			
		||||
#include "libavutil/log.h"
 | 
			
		||||
#include "libavutil/opencl.h"
 | 
			
		||||
#include "libavutil/avstring.h"
 | 
			
		||||
#include "cmdutils.h"
 | 
			
		||||
 | 
			
		||||
typedef struct {
 | 
			
		||||
@@ -239,8 +238,7 @@ int opt_opencl_bench(void *optctx, const char *opt, const char *arg)
 | 
			
		||||
                devices[count].platform_idx = i;
 | 
			
		||||
                devices[count].device_idx = j;
 | 
			
		||||
                devices[count].runtime = score;
 | 
			
		||||
                av_strlcpy(devices[count].device_name, device_node->device_name,
 | 
			
		||||
                           sizeof(devices[count].device_name));
 | 
			
		||||
                strcpy(devices[count].device_name, device_node->device_name);
 | 
			
		||||
                count++;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										19
									
								
								common.mak
									
									
									
									
									
								
							
							
						
						
									
										19
									
								
								common.mak
									
									
									
									
									
								
							@@ -5,14 +5,6 @@
 | 
			
		||||
# first so "all" becomes default target
 | 
			
		||||
all: all-yes
 | 
			
		||||
 | 
			
		||||
DEFAULT_YASMD=.dbg
 | 
			
		||||
 | 
			
		||||
ifeq ($(DBG),1)
 | 
			
		||||
YASMD=$(DEFAULT_YASMD)
 | 
			
		||||
else
 | 
			
		||||
YASMD=
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
ifndef SUBDIR
 | 
			
		||||
 | 
			
		||||
ifndef V
 | 
			
		||||
@@ -118,9 +110,8 @@ TOOLOBJS  := $(TOOLS:%=tools/%.o)
 | 
			
		||||
TOOLS     := $(TOOLS:%=tools/%$(EXESUF))
 | 
			
		||||
HEADERS   += $(HEADERS-yes)
 | 
			
		||||
 | 
			
		||||
PATH_LIBNAME = $(foreach NAME,$(1),lib$(NAME)/$($(2)LIBNAME))
 | 
			
		||||
DEP_LIBS := $(foreach lib,$(FFLIBS),$(call PATH_LIBNAME,$(lib),$(CONFIG_SHARED:yes=S)))
 | 
			
		||||
STATIC_DEP_LIBS := $(foreach lib,$(FFLIBS),$(call PATH_LIBNAME,$(lib)))
 | 
			
		||||
PATH_LIBNAME = $(foreach NAME,$(1),lib$(NAME)/$($(CONFIG_SHARED:yes=S)LIBNAME))
 | 
			
		||||
DEP_LIBS := $(foreach lib,$(FFLIBS),$(call PATH_LIBNAME,$(lib)))
 | 
			
		||||
 | 
			
		||||
SRC_DIR    := $(SRC_PATH)/lib$(NAME)
 | 
			
		||||
ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h))
 | 
			
		||||
@@ -147,17 +138,17 @@ $(TOOLOBJS): | tools
 | 
			
		||||
 | 
			
		||||
OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(SLIBOBJS) $(TESTOBJS))
 | 
			
		||||
 | 
			
		||||
CLEANSUFFIXES     = *.d *.o *~ *.h.c *.map *.ver *.ho *.gcno *.gcda *$(DEFAULT_YASMD).asm
 | 
			
		||||
CLEANSUFFIXES     = *.d *.o *~ *.h.c *.map *.ver *.ho *.gcno *.gcda
 | 
			
		||||
DISTCLEANSUFFIXES = *.pc
 | 
			
		||||
LIBSUFFIXES       = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a
 | 
			
		||||
 | 
			
		||||
define RULES
 | 
			
		||||
clean::
 | 
			
		||||
	$(RM) $(OBJS) $(OBJS:.o=.d) $(OBJS:.o=$(DEFAULT_YASMD).d)
 | 
			
		||||
	$(RM) $(OBJS) $(OBJS:.o=.d)
 | 
			
		||||
	$(RM) $(HOSTPROGS)
 | 
			
		||||
	$(RM) $(TOOLS)
 | 
			
		||||
endef
 | 
			
		||||
 | 
			
		||||
$(eval $(RULES))
 | 
			
		||||
 | 
			
		||||
-include $(wildcard $(OBJS:.o=.d) $(HOSTOBJS:.o=.d) $(TESTOBJS:.o=.d) $(HOBJS:.o=.d) $(SLIBOBJS:.o=.d)) $(OBJS:.o=$(DEFAULT_YASMD).d)
 | 
			
		||||
-include $(wildcard $(OBJS:.o=.d) $(HOSTOBJS:.o=.d) $(TESTOBJS:.o=.d) $(HOBJS:.o=.d) $(SLIBOBJS:.o=.d))
 | 
			
		||||
 
 | 
			
		||||
@@ -38,9 +38,40 @@
 | 
			
		||||
#ifndef __AVISYNTH_C__
 | 
			
		||||
#define __AVISYNTH_C__
 | 
			
		||||
 | 
			
		||||
#include "avs/config.h"
 | 
			
		||||
#include "avs/capi.h"
 | 
			
		||||
#include "avs/types.h"
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
#  define EXTERN_C extern "C"
 | 
			
		||||
#else
 | 
			
		||||
#  define EXTERN_C
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define AVSC_USE_STDCALL 1
 | 
			
		||||
 | 
			
		||||
#ifndef AVSC_USE_STDCALL
 | 
			
		||||
#  define AVSC_CC __cdecl
 | 
			
		||||
#else
 | 
			
		||||
#  define AVSC_CC __stdcall
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define AVSC_INLINE static __inline
 | 
			
		||||
 | 
			
		||||
#ifdef AVISYNTH_C_EXPORTS
 | 
			
		||||
#  define AVSC_EXPORT EXTERN_C
 | 
			
		||||
#  define AVSC_API(ret, name) EXTERN_C __declspec(dllexport) ret AVSC_CC name
 | 
			
		||||
#else
 | 
			
		||||
#  define AVSC_EXPORT EXTERN_C __declspec(dllexport)
 | 
			
		||||
#  ifndef AVSC_NO_DECLSPEC
 | 
			
		||||
#    define AVSC_API(ret, name) EXTERN_C __declspec(dllimport) ret AVSC_CC name
 | 
			
		||||
#  else
 | 
			
		||||
#    define AVSC_API(ret, name) typedef ret (AVSC_CC *name##_func)
 | 
			
		||||
#  endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
typedef unsigned char BYTE;
 | 
			
		||||
#ifdef __GNUC__
 | 
			
		||||
typedef long long int INT64;
 | 
			
		||||
#else
 | 
			
		||||
typedef __int64 INT64;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/////////////////////////////////////////////////////////////////////
 | 
			
		||||
@@ -48,8 +79,8 @@
 | 
			
		||||
// Constants
 | 
			
		||||
//
 | 
			
		||||
 | 
			
		||||
#ifndef __AVISYNTH_6_H__
 | 
			
		||||
enum { AVISYNTH_INTERFACE_VERSION = 6 };
 | 
			
		||||
#ifndef __AVISYNTH_H__
 | 
			
		||||
enum { AVISYNTH_INTERFACE_VERSION = 4 };
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
enum {AVS_SAMPLE_INT8  = 1<<0,
 | 
			
		||||
@@ -81,8 +112,8 @@ enum {AVS_CS_BGR = 1<<28,
 | 
			
		||||
      AVS_CS_PLANAR = 1<<31,
 | 
			
		||||
 | 
			
		||||
      AVS_CS_SHIFT_SUB_WIDTH   = 0,
 | 
			
		||||
      AVS_CS_SHIFT_SUB_HEIGHT  = 8,
 | 
			
		||||
      AVS_CS_SHIFT_SAMPLE_BITS = 16,
 | 
			
		||||
      AVS_CS_SHIFT_SUB_HEIGHT  = 1 << 3,
 | 
			
		||||
      AVS_CS_SHIFT_SAMPLE_BITS = 1 << 4,
 | 
			
		||||
 | 
			
		||||
      AVS_CS_SUB_WIDTH_MASK    = 7 << AVS_CS_SHIFT_SUB_WIDTH,
 | 
			
		||||
      AVS_CS_SUB_WIDTH_1       = 3 << AVS_CS_SHIFT_SUB_WIDTH, // YV24
 | 
			
		||||
@@ -149,66 +180,15 @@ enum {  //SUBTYPES
 | 
			
		||||
  AVS_FILTER_OUTPUT_TYPE_DIFFERENT=4};
 | 
			
		||||
 | 
			
		||||
enum {
 | 
			
		||||
  // New 2.6 explicitly defined cache hints.
 | 
			
		||||
  AVS_CACHE_NOTHING=10, // Do not cache video.
 | 
			
		||||
  AVS_CACHE_WINDOW=11, // Hard protect upto X frames within a range of X from the current frame N.
 | 
			
		||||
  AVS_CACHE_GENERIC=12, // LRU cache upto X frames.
 | 
			
		||||
  AVS_CACHE_FORCE_GENERIC=13, // LRU cache upto X frames, override any previous CACHE_WINDOW.
 | 
			
		||||
 | 
			
		||||
  AVS_CACHE_GET_POLICY=30, // Get the current policy.
 | 
			
		||||
  AVS_CACHE_GET_WINDOW=31, // Get the current window h_span.
 | 
			
		||||
  AVS_CACHE_GET_RANGE=32, // Get the current generic frame range.
 | 
			
		||||
 | 
			
		||||
  AVS_CACHE_AUDIO=50, // Explicitly do cache audio, X byte cache.
 | 
			
		||||
  AVS_CACHE_AUDIO_NOTHING=51, // Explicitly do not cache audio.
 | 
			
		||||
  AVS_CACHE_AUDIO_NONE=52, // Audio cache off (auto mode), X byte intial cache.
 | 
			
		||||
  AVS_CACHE_AUDIO_AUTO=53, // Audio cache on (auto mode), X byte intial cache.
 | 
			
		||||
 | 
			
		||||
  AVS_CACHE_GET_AUDIO_POLICY=70, // Get the current audio policy.
 | 
			
		||||
  AVS_CACHE_GET_AUDIO_SIZE=71, // Get the current audio cache size.
 | 
			
		||||
 | 
			
		||||
  AVS_CACHE_PREFETCH_FRAME=100, // Queue request to prefetch frame N.
 | 
			
		||||
  AVS_CACHE_PREFETCH_GO=101, // Action video prefetches.
 | 
			
		||||
 | 
			
		||||
  AVS_CACHE_PREFETCH_AUDIO_BEGIN=120, // Begin queue request transaction to prefetch audio (take critical section).
 | 
			
		||||
  AVS_CACHE_PREFETCH_AUDIO_STARTLO=121, // Set low 32 bits of start.
 | 
			
		||||
  AVS_CACHE_PREFETCH_AUDIO_STARTHI=122, // Set high 32 bits of start.
 | 
			
		||||
  AVS_CACHE_PREFETCH_AUDIO_COUNT=123, // Set low 32 bits of length.
 | 
			
		||||
  AVS_CACHE_PREFETCH_AUDIO_COMMIT=124, // Enqueue request transaction to prefetch audio (release critical section).
 | 
			
		||||
  AVS_CACHE_PREFETCH_AUDIO_GO=125, // Action audio prefetches.
 | 
			
		||||
 | 
			
		||||
  AVS_CACHE_GETCHILD_CACHE_MODE=200, // Cache ask Child for desired video cache mode.
 | 
			
		||||
  AVS_CACHE_GETCHILD_CACHE_SIZE=201, // Cache ask Child for desired video cache size.
 | 
			
		||||
  AVS_CACHE_GETCHILD_AUDIO_MODE=202, // Cache ask Child for desired audio cache mode.
 | 
			
		||||
  AVS_CACHE_GETCHILD_AUDIO_SIZE=203, // Cache ask Child for desired audio cache size.
 | 
			
		||||
 | 
			
		||||
  AVS_CACHE_GETCHILD_COST=220, // Cache ask Child for estimated processing cost.
 | 
			
		||||
    AVS_CACHE_COST_ZERO=221, // Child response of zero cost (ptr arithmetic only).
 | 
			
		||||
    AVS_CACHE_COST_UNIT=222, // Child response of unit cost (less than or equal 1 full frame blit).
 | 
			
		||||
    AVS_CACHE_COST_LOW=223, // Child response of light cost. (Fast)
 | 
			
		||||
    AVS_CACHE_COST_MED=224, // Child response of medium cost. (Real time)
 | 
			
		||||
    AVS_CACHE_COST_HI=225, // Child response of heavy cost. (Slow)
 | 
			
		||||
 | 
			
		||||
  AVS_CACHE_GETCHILD_THREAD_MODE=240, // Cache ask Child for thread safetyness.
 | 
			
		||||
    AVS_CACHE_THREAD_UNSAFE=241, // Only 1 thread allowed for all instances. 2.5 filters default!
 | 
			
		||||
    AVS_CACHE_THREAD_CLASS=242, // Only 1 thread allowed for each instance. 2.6 filters default!
 | 
			
		||||
    AVS_CACHE_THREAD_SAFE=243, //  Allow all threads in any instance.
 | 
			
		||||
    AVS_CACHE_THREAD_OWN=244, // Safe but limit to 1 thread, internally threaded.
 | 
			
		||||
 | 
			
		||||
  AVS_CACHE_GETCHILD_ACCESS_COST=260, // Cache ask Child for preferred access pattern.
 | 
			
		||||
    AVS_CACHE_ACCESS_RAND=261, // Filter is access order agnostic.
 | 
			
		||||
    AVS_CACHE_ACCESS_SEQ0=262, // Filter prefers sequential access (low cost)
 | 
			
		||||
    AVS_CACHE_ACCESS_SEQ1=263, // Filter needs sequential access (high cost)
 | 
			
		||||
  AVS_CACHE_NOTHING=0,
 | 
			
		||||
  AVS_CACHE_RANGE=1,
 | 
			
		||||
  AVS_CACHE_ALL=2,
 | 
			
		||||
  AVS_CACHE_AUDIO=3,
 | 
			
		||||
  AVS_CACHE_AUDIO_NONE=4,
 | 
			
		||||
  AVS_CACHE_AUDIO_AUTO=5
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
#ifdef BUILDING_AVSCORE
 | 
			
		||||
struct AVS_ScriptEnvironment {
 | 
			
		||||
        IScriptEnvironment * env;
 | 
			
		||||
        const char * error;
 | 
			
		||||
        AVS_ScriptEnvironment(IScriptEnvironment * e = 0)
 | 
			
		||||
                : env(e), error(0) {}
 | 
			
		||||
};
 | 
			
		||||
#endif
 | 
			
		||||
#define AVS_FRAME_ALIGN 16
 | 
			
		||||
 | 
			
		||||
typedef struct AVS_Clip AVS_Clip;
 | 
			
		||||
typedef struct AVS_ScriptEnvironment AVS_ScriptEnvironment;
 | 
			
		||||
@@ -258,23 +238,29 @@ AVSC_INLINE int avs_is_yuv(const AVS_VideoInfo * p)
 | 
			
		||||
AVSC_INLINE int avs_is_yuy2(const AVS_VideoInfo * p)
 | 
			
		||||
        { return (p->pixel_type & AVS_CS_YUY2) == AVS_CS_YUY2; }
 | 
			
		||||
 | 
			
		||||
AVSC_API(int, avs_is_yv24)(const AVS_VideoInfo * p);
 | 
			
		||||
AVSC_INLINE int avs_is_yv24(const AVS_VideoInfo * p)
 | 
			
		||||
        { return (p->pixel_type & AVS_CS_PLANAR_MASK) == (AVS_CS_YV24  & AVS_CS_PLANAR_FILTER); }
 | 
			
		||||
 | 
			
		||||
AVSC_API(int, avs_is_yv16)(const AVS_VideoInfo * p);
 | 
			
		||||
AVSC_INLINE int avs_is_yv16(const AVS_VideoInfo * p)
 | 
			
		||||
        { return (p->pixel_type & AVS_CS_PLANAR_MASK) == (AVS_CS_YV16  & AVS_CS_PLANAR_FILTER); }
 | 
			
		||||
 | 
			
		||||
AVSC_API(int, avs_is_yv12)(const AVS_VideoInfo * p) ;
 | 
			
		||||
AVSC_INLINE int avs_is_yv12(const AVS_VideoInfo * p)
 | 
			
		||||
        { return (p->pixel_type & AVS_CS_PLANAR_MASK) == (AVS_CS_YV12  & AVS_CS_PLANAR_FILTER); }
 | 
			
		||||
 | 
			
		||||
AVSC_API(int, avs_is_yv411)(const AVS_VideoInfo * p);
 | 
			
		||||
AVSC_INLINE int avs_is_yv411(const AVS_VideoInfo * p)
 | 
			
		||||
        { return (p->pixel_type & AVS_CS_PLANAR_MASK) == (AVS_CS_YV411 & AVS_CS_PLANAR_FILTER); }
 | 
			
		||||
 | 
			
		||||
AVSC_API(int, avs_is_y8)(const AVS_VideoInfo * p);
 | 
			
		||||
AVSC_INLINE int avs_is_y8(const AVS_VideoInfo * p)
 | 
			
		||||
        { return (p->pixel_type & AVS_CS_PLANAR_MASK) == (AVS_CS_Y8    & AVS_CS_PLANAR_FILTER); }
 | 
			
		||||
 | 
			
		||||
AVSC_INLINE int avs_is_property(const AVS_VideoInfo * p, int property)
 | 
			
		||||
        { return ((p->image_type & property)==property ); }
 | 
			
		||||
        { return ((p->pixel_type & property)==property ); }
 | 
			
		||||
 | 
			
		||||
AVSC_INLINE int avs_is_planar(const AVS_VideoInfo * p)
 | 
			
		||||
        { return !!(p->pixel_type & AVS_CS_PLANAR); }
 | 
			
		||||
 | 
			
		||||
AVSC_API(int, avs_is_color_space)(const AVS_VideoInfo * p, int c_space);
 | 
			
		||||
AVSC_INLINE int avs_is_color_space(const AVS_VideoInfo * p, int c_space)
 | 
			
		||||
        { return avs_is_planar(p) ? ((p->pixel_type & AVS_CS_PLANAR_MASK) == (c_space & AVS_CS_PLANAR_FILTER)) : ((p->pixel_type & c_space) == c_space); }
 | 
			
		||||
 | 
			
		||||
AVSC_INLINE int avs_is_field_based(const AVS_VideoInfo * p)
 | 
			
		||||
        { return !!(p->image_type & AVS_IT_FIELDBASED); }
 | 
			
		||||
@@ -288,18 +274,25 @@ AVSC_INLINE int avs_is_bff(const AVS_VideoInfo * p)
 | 
			
		||||
AVSC_INLINE int avs_is_tff(const AVS_VideoInfo * p)
 | 
			
		||||
        { return !!(p->image_type & AVS_IT_TFF); }
 | 
			
		||||
 | 
			
		||||
AVSC_API(int, avs_get_plane_width_subsampling)(const AVS_VideoInfo * p, int plane);
 | 
			
		||||
AVSC_INLINE int avs_bits_per_pixel(const AVS_VideoInfo * p)
 | 
			
		||||
{
 | 
			
		||||
  switch (p->pixel_type) {
 | 
			
		||||
      case AVS_CS_BGR24: return 24;
 | 
			
		||||
      case AVS_CS_BGR32: return 32;
 | 
			
		||||
      case AVS_CS_YUY2:  return 16;
 | 
			
		||||
      case AVS_CS_YV12:
 | 
			
		||||
      case AVS_CS_I420:  return 12;
 | 
			
		||||
      default:           return 0;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
AVSC_INLINE int avs_bytes_from_pixels(const AVS_VideoInfo * p, int pixels)
 | 
			
		||||
        { return pixels * (avs_bits_per_pixel(p)>>3); }   // Will work on planar images, but will return only luma planes
 | 
			
		||||
 | 
			
		||||
AVSC_API(int, avs_get_plane_height_subsampling)(const AVS_VideoInfo * p, int plane);
 | 
			
		||||
AVSC_INLINE int avs_row_size(const AVS_VideoInfo * p)
 | 
			
		||||
        { return avs_bytes_from_pixels(p,p->width); }  // Also only returns first plane on planar images
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
AVSC_API(int, avs_bits_per_pixel)(const AVS_VideoInfo * p);
 | 
			
		||||
 | 
			
		||||
AVSC_API(int, avs_bytes_from_pixels)(const AVS_VideoInfo * p, int pixels);
 | 
			
		||||
 | 
			
		||||
AVSC_API(int, avs_row_size)(const AVS_VideoInfo * p, int plane);
 | 
			
		||||
 | 
			
		||||
AVSC_API(int, avs_bmp_size)(const AVS_VideoInfo * vi);
 | 
			
		||||
AVSC_INLINE int avs_bmp_size(const AVS_VideoInfo * vi)
 | 
			
		||||
        { if (avs_is_planar(vi)) {int p = vi->height * ((avs_row_size(vi)+3) & ~3); p+=p>>1; return p;  } return vi->height * ((avs_row_size(vi)+3) & ~3); }
 | 
			
		||||
 | 
			
		||||
AVSC_INLINE int avs_samples_per_second(const AVS_VideoInfo * p)
 | 
			
		||||
        { return p->audio_samples_per_second; }
 | 
			
		||||
@@ -357,13 +350,11 @@ AVSC_INLINE void avs_set_fps(AVS_VideoInfo * p, unsigned numerator, unsigned den
 | 
			
		||||
    p->fps_denominator = denominator/x;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#ifdef AVS_IMPLICIT_FUNCTION_DECLARATION_ERROR
 | 
			
		||||
AVSC_INLINE int avs_is_same_colorspace(AVS_VideoInfo * x, AVS_VideoInfo * y)
 | 
			
		||||
{
 | 
			
		||||
        return (x->pixel_type == y->pixel_type)
 | 
			
		||||
                || (avs_is_yv12(x) && avs_is_yv12(y));
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/////////////////////////////////////////////////////////////////////
 | 
			
		||||
//
 | 
			
		||||
@@ -400,38 +391,89 @@ typedef struct AVS_VideoFrame {
 | 
			
		||||
} AVS_VideoFrame;
 | 
			
		||||
 | 
			
		||||
// Access functions for AVS_VideoFrame
 | 
			
		||||
AVSC_API(int, avs_get_pitch_p)(const AVS_VideoFrame * p, int plane);
 | 
			
		||||
 | 
			
		||||
#ifdef AVS_IMPLICIT_FUNCTION_DECLARATION_ERROR
 | 
			
		||||
AVSC_INLINE int avs_get_pitch(const AVS_VideoFrame * p) {
 | 
			
		||||
        return avs_get_pitch_p(p, 0);}
 | 
			
		||||
#endif
 | 
			
		||||
        return p->pitch;}
 | 
			
		||||
 | 
			
		||||
AVSC_API(int, avs_get_row_size_p)(const AVS_VideoFrame * p, int plane);
 | 
			
		||||
AVSC_INLINE int avs_get_pitch_p(const AVS_VideoFrame * p, int plane) {
 | 
			
		||||
  switch (plane) {
 | 
			
		||||
  case AVS_PLANAR_U: case AVS_PLANAR_V: return p->pitchUV;}
 | 
			
		||||
  return p->pitch;}
 | 
			
		||||
 | 
			
		||||
AVSC_INLINE int avs_get_row_size(const AVS_VideoFrame * p) {
 | 
			
		||||
        return p->row_size; }
 | 
			
		||||
 | 
			
		||||
AVSC_API(int, avs_get_height_p)(const AVS_VideoFrame * p, int plane);
 | 
			
		||||
AVSC_INLINE int avs_get_row_size_p(const AVS_VideoFrame * p, int plane) {
 | 
			
		||||
        int r;
 | 
			
		||||
    switch (plane) {
 | 
			
		||||
    case AVS_PLANAR_U: case AVS_PLANAR_V:
 | 
			
		||||
                if (p->pitchUV) return p->row_sizeUV;
 | 
			
		||||
                else            return 0;
 | 
			
		||||
    case AVS_PLANAR_U_ALIGNED: case AVS_PLANAR_V_ALIGNED:
 | 
			
		||||
                if (p->pitchUV) {
 | 
			
		||||
                        r = (p->row_sizeUV+AVS_FRAME_ALIGN-1)&(~(AVS_FRAME_ALIGN-1)); // Aligned rowsize
 | 
			
		||||
                        if (r < p->pitchUV)
 | 
			
		||||
                                return r;
 | 
			
		||||
                        return p->row_sizeUV;
 | 
			
		||||
                } else return 0;
 | 
			
		||||
    case AVS_PLANAR_Y_ALIGNED:
 | 
			
		||||
                r = (p->row_size+AVS_FRAME_ALIGN-1)&(~(AVS_FRAME_ALIGN-1)); // Aligned rowsize
 | 
			
		||||
                if (r <= p->pitch)
 | 
			
		||||
                        return r;
 | 
			
		||||
                return p->row_size;
 | 
			
		||||
    }
 | 
			
		||||
    return p->row_size;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
AVSC_INLINE int avs_get_height(const AVS_VideoFrame * p) {
 | 
			
		||||
        return p->height;}
 | 
			
		||||
 | 
			
		||||
AVSC_API(const BYTE *, avs_get_read_ptr_p)(const AVS_VideoFrame * p, int plane);
 | 
			
		||||
AVSC_INLINE int avs_get_height_p(const AVS_VideoFrame * p, int plane) {
 | 
			
		||||
        switch (plane) {
 | 
			
		||||
                case AVS_PLANAR_U: case AVS_PLANAR_V:
 | 
			
		||||
                        if (p->pitchUV) return p->heightUV;
 | 
			
		||||
                        return 0;
 | 
			
		||||
        }
 | 
			
		||||
        return p->height;}
 | 
			
		||||
 | 
			
		||||
#ifdef AVS_IMPLICIT_FUNCTION_DECLARATION_ERROR
 | 
			
		||||
AVSC_INLINE const BYTE* avs_get_read_ptr(const AVS_VideoFrame * p) {
 | 
			
		||||
        return avs_get_read_ptr_p(p, 0);}
 | 
			
		||||
#endif
 | 
			
		||||
        return p->vfb->data + p->offset;}
 | 
			
		||||
 | 
			
		||||
AVSC_API(int, avs_is_writable)(const AVS_VideoFrame * p);
 | 
			
		||||
AVSC_INLINE const BYTE* avs_get_read_ptr_p(const AVS_VideoFrame * p, int plane)
 | 
			
		||||
{
 | 
			
		||||
        switch (plane) {
 | 
			
		||||
                case AVS_PLANAR_U: return p->vfb->data + p->offsetU;
 | 
			
		||||
                case AVS_PLANAR_V: return p->vfb->data + p->offsetV;
 | 
			
		||||
                default:           return p->vfb->data + p->offset;}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
AVSC_API(BYTE *, avs_get_write_ptr_p)(const AVS_VideoFrame * p, int plane);
 | 
			
		||||
AVSC_INLINE int avs_is_writable(const AVS_VideoFrame * p) {
 | 
			
		||||
        return (p->refcount == 1 && p->vfb->refcount == 1);}
 | 
			
		||||
 | 
			
		||||
AVSC_INLINE BYTE* avs_get_write_ptr(const AVS_VideoFrame * p)
 | 
			
		||||
{
 | 
			
		||||
        if (avs_is_writable(p)) {
 | 
			
		||||
                ++p->vfb->sequence_number;
 | 
			
		||||
                return p->vfb->data + p->offset;
 | 
			
		||||
        } else
 | 
			
		||||
                return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
AVSC_INLINE BYTE* avs_get_write_ptr_p(const AVS_VideoFrame * p, int plane)
 | 
			
		||||
{
 | 
			
		||||
        if (plane==AVS_PLANAR_Y && avs_is_writable(p)) {
 | 
			
		||||
                ++p->vfb->sequence_number;
 | 
			
		||||
                return p->vfb->data + p->offset;
 | 
			
		||||
        } else if (plane==AVS_PLANAR_Y) {
 | 
			
		||||
                return 0;
 | 
			
		||||
        } else {
 | 
			
		||||
                switch (plane) {
 | 
			
		||||
                        case AVS_PLANAR_U: return p->vfb->data + p->offsetU;
 | 
			
		||||
                        case AVS_PLANAR_V: return p->vfb->data + p->offsetV;
 | 
			
		||||
                        default:       return p->vfb->data + p->offset;
 | 
			
		||||
                }
 | 
			
		||||
        }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#ifdef AVS_IMPLICIT_FUNCTION_DECLARATION_ERROR
 | 
			
		||||
AVSC_INLINE BYTE* avs_get_write_ptr(const AVS_VideoFrame * p) {
 | 
			
		||||
        return avs_get_write_ptr_p(p, 0);}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
AVSC_API(void, avs_release_video_frame)(AVS_VideoFrame *);
 | 
			
		||||
// makes a shallow copy of a video frame
 | 
			
		||||
@@ -616,16 +658,12 @@ enum {
 | 
			
		||||
  AVS_CPUF_SSSE3      = 0x200,   //  Core 2
 | 
			
		||||
  AVS_CPUF_SSE4       = 0x400,   //  Penryn, Wolfdale, Yorkfield
 | 
			
		||||
  AVS_CPUF_SSE4_1     = 0x400,
 | 
			
		||||
//AVS_CPUF_AVX        = 0x800,   //  Sandy Bridge, Bulldozer
 | 
			
		||||
  AVS_CPUF_SSE4_2    = 0x1000,   //  Nehalem
 | 
			
		||||
//AVS_CPUF_AVX2      = 0x2000,   //  Haswell
 | 
			
		||||
//AVS_CPUF_AVX512    = 0x4000,   //  Knights Landing
 | 
			
		||||
  AVS_CPUF_SSE4_2     = 0x800,   //  Nehalem
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
AVSC_API(const char *, avs_get_error)(AVS_ScriptEnvironment *); // return 0 if no error
 | 
			
		||||
 | 
			
		||||
AVSC_API(int, avs_get_cpu_flags)(AVS_ScriptEnvironment *);
 | 
			
		||||
AVSC_API(long, avs_get_cpu_flags)(AVS_ScriptEnvironment *);
 | 
			
		||||
AVSC_API(int, avs_check_version)(AVS_ScriptEnvironment *, int version);
 | 
			
		||||
 | 
			
		||||
AVSC_API(char *, avs_save_string)(AVS_ScriptEnvironment *, const char* s, int length);
 | 
			
		||||
@@ -662,12 +700,12 @@ AVSC_API(AVS_VideoFrame *, avs_new_video_frame_a)(AVS_ScriptEnvironment *,
 | 
			
		||||
AVSC_INLINE
 | 
			
		||||
AVS_VideoFrame * avs_new_video_frame(AVS_ScriptEnvironment * env,
 | 
			
		||||
                                     const AVS_VideoInfo * vi)
 | 
			
		||||
  {return avs_new_video_frame_a(env,vi,FRAME_ALIGN);}
 | 
			
		||||
  {return avs_new_video_frame_a(env,vi,AVS_FRAME_ALIGN);}
 | 
			
		||||
 | 
			
		||||
AVSC_INLINE
 | 
			
		||||
AVS_VideoFrame * avs_new_frame(AVS_ScriptEnvironment * env,
 | 
			
		||||
                               const AVS_VideoInfo * vi)
 | 
			
		||||
  {return avs_new_video_frame_a(env,vi,FRAME_ALIGN);}
 | 
			
		||||
  {return avs_new_video_frame_a(env,vi,AVS_FRAME_ALIGN);}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -735,6 +773,7 @@ struct AVS_Library {
 | 
			
		||||
  AVSC_DECLARE_FUNC(avs_function_exists);
 | 
			
		||||
  AVSC_DECLARE_FUNC(avs_get_audio);
 | 
			
		||||
  AVSC_DECLARE_FUNC(avs_get_cpu_flags);
 | 
			
		||||
  AVSC_DECLARE_FUNC(avs_get_error);
 | 
			
		||||
  AVSC_DECLARE_FUNC(avs_get_frame);
 | 
			
		||||
  AVSC_DECLARE_FUNC(avs_get_parity);
 | 
			
		||||
  AVSC_DECLARE_FUNC(avs_get_var);
 | 
			
		||||
@@ -759,27 +798,6 @@ struct AVS_Library {
 | 
			
		||||
  AVSC_DECLARE_FUNC(avs_subframe_planar);
 | 
			
		||||
  AVSC_DECLARE_FUNC(avs_take_clip);
 | 
			
		||||
  AVSC_DECLARE_FUNC(avs_vsprintf);
 | 
			
		||||
 | 
			
		||||
  AVSC_DECLARE_FUNC(avs_get_error);
 | 
			
		||||
  AVSC_DECLARE_FUNC(avs_is_yv24);
 | 
			
		||||
  AVSC_DECLARE_FUNC(avs_is_yv16);
 | 
			
		||||
  AVSC_DECLARE_FUNC(avs_is_yv12);
 | 
			
		||||
  AVSC_DECLARE_FUNC(avs_is_yv411);
 | 
			
		||||
  AVSC_DECLARE_FUNC(avs_is_y8);
 | 
			
		||||
  AVSC_DECLARE_FUNC(avs_is_color_space);
 | 
			
		||||
 | 
			
		||||
  AVSC_DECLARE_FUNC(avs_get_plane_width_subsampling);
 | 
			
		||||
  AVSC_DECLARE_FUNC(avs_get_plane_height_subsampling);
 | 
			
		||||
  AVSC_DECLARE_FUNC(avs_bits_per_pixel);
 | 
			
		||||
  AVSC_DECLARE_FUNC(avs_bytes_from_pixels);
 | 
			
		||||
  AVSC_DECLARE_FUNC(avs_row_size);
 | 
			
		||||
  AVSC_DECLARE_FUNC(avs_bmp_size);
 | 
			
		||||
  AVSC_DECLARE_FUNC(avs_get_pitch_p);
 | 
			
		||||
  AVSC_DECLARE_FUNC(avs_get_row_size_p);
 | 
			
		||||
  AVSC_DECLARE_FUNC(avs_get_height_p);
 | 
			
		||||
  AVSC_DECLARE_FUNC(avs_get_read_ptr_p);
 | 
			
		||||
  AVSC_DECLARE_FUNC(avs_is_writable);
 | 
			
		||||
  AVSC_DECLARE_FUNC(avs_get_write_ptr_p);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#undef AVSC_DECLARE_FUNC
 | 
			
		||||
@@ -787,7 +805,7 @@ struct AVS_Library {
 | 
			
		||||
 | 
			
		||||
AVSC_INLINE AVS_Library * avs_load_library() {
 | 
			
		||||
  AVS_Library *library = (AVS_Library *)malloc(sizeof(AVS_Library));
 | 
			
		||||
  if (library == NULL)
 | 
			
		||||
  if (!library)
 | 
			
		||||
    return NULL;
 | 
			
		||||
  library->handle = LoadLibrary("avisynth");
 | 
			
		||||
  if (library->handle == NULL)
 | 
			
		||||
@@ -814,6 +832,7 @@ AVSC_INLINE AVS_Library * avs_load_library() {
 | 
			
		||||
  AVSC_LOAD_FUNC(avs_function_exists);
 | 
			
		||||
  AVSC_LOAD_FUNC(avs_get_audio);
 | 
			
		||||
  AVSC_LOAD_FUNC(avs_get_cpu_flags);
 | 
			
		||||
  AVSC_LOAD_FUNC(avs_get_error);
 | 
			
		||||
  AVSC_LOAD_FUNC(avs_get_frame);
 | 
			
		||||
  AVSC_LOAD_FUNC(avs_get_parity);
 | 
			
		||||
  AVSC_LOAD_FUNC(avs_get_var);
 | 
			
		||||
@@ -839,27 +858,6 @@ AVSC_INLINE AVS_Library * avs_load_library() {
 | 
			
		||||
  AVSC_LOAD_FUNC(avs_take_clip);
 | 
			
		||||
  AVSC_LOAD_FUNC(avs_vsprintf);
 | 
			
		||||
 | 
			
		||||
  AVSC_LOAD_FUNC(avs_get_error);
 | 
			
		||||
  AVSC_LOAD_FUNC(avs_is_yv24);
 | 
			
		||||
  AVSC_LOAD_FUNC(avs_is_yv16);
 | 
			
		||||
  AVSC_LOAD_FUNC(avs_is_yv12);
 | 
			
		||||
  AVSC_LOAD_FUNC(avs_is_yv411);
 | 
			
		||||
  AVSC_LOAD_FUNC(avs_is_y8);
 | 
			
		||||
  AVSC_LOAD_FUNC(avs_is_color_space);
 | 
			
		||||
 | 
			
		||||
  AVSC_LOAD_FUNC(avs_get_plane_width_subsampling);
 | 
			
		||||
  AVSC_LOAD_FUNC(avs_get_plane_height_subsampling);
 | 
			
		||||
  AVSC_LOAD_FUNC(avs_bits_per_pixel);
 | 
			
		||||
  AVSC_LOAD_FUNC(avs_bytes_from_pixels);
 | 
			
		||||
  AVSC_LOAD_FUNC(avs_row_size);
 | 
			
		||||
  AVSC_LOAD_FUNC(avs_bmp_size);
 | 
			
		||||
  AVSC_LOAD_FUNC(avs_get_pitch_p);
 | 
			
		||||
  AVSC_LOAD_FUNC(avs_get_row_size_p);
 | 
			
		||||
  AVSC_LOAD_FUNC(avs_get_height_p);
 | 
			
		||||
  AVSC_LOAD_FUNC(avs_get_read_ptr_p);
 | 
			
		||||
  AVSC_LOAD_FUNC(avs_is_writable);
 | 
			
		||||
  AVSC_LOAD_FUNC(avs_get_write_ptr_p);
 | 
			
		||||
 | 
			
		||||
#undef __AVSC_STRINGIFY
 | 
			
		||||
#undef AVSC_STRINGIFY
 | 
			
		||||
#undef AVSC_LOAD_FUNC
 | 
			
		||||
@@ -872,7 +870,7 @@ fail:
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
AVSC_INLINE void avs_free_library(AVS_Library *library) {
 | 
			
		||||
  if (library == NULL)
 | 
			
		||||
  if (!library)
 | 
			
		||||
    return;
 | 
			
		||||
  FreeLibrary(library->handle);
 | 
			
		||||
  free(library);
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										68
									
								
								compat/avisynth/avisynth_c_25.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										68
									
								
								compat/avisynth/avisynth_c_25.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,68 @@
 | 
			
		||||
//  Copyright (c) 2011 FFmpegSource Project
 | 
			
		||||
//
 | 
			
		||||
//  Permission is hereby granted, free of charge, to any person obtaining a copy
 | 
			
		||||
//  of this software and associated documentation files (the "Software"), to deal
 | 
			
		||||
//  in the Software without restriction, including without limitation the rights
 | 
			
		||||
//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 | 
			
		||||
//  copies of the Software, and to permit persons to whom the Software is
 | 
			
		||||
//  furnished to do so, subject to the following conditions:
 | 
			
		||||
//
 | 
			
		||||
//  The above copyright notice and this permission notice shall be included in
 | 
			
		||||
//  all copies or substantial portions of the Software.
 | 
			
		||||
//
 | 
			
		||||
//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 | 
			
		||||
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 | 
			
		||||
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 | 
			
		||||
//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 | 
			
		||||
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 | 
			
		||||
//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 | 
			
		||||
//  THE SOFTWARE.
 | 
			
		||||
 | 
			
		||||
/* these are defines/functions that are used and were changed in the switch to 2.6
 | 
			
		||||
 * and are needed to maintain full compatility with 2.5 */
 | 
			
		||||
 | 
			
		||||
enum {
 | 
			
		||||
  AVS_CS_YV12_25 = 1<<3 | AVS_CS_YUV | AVS_CS_PLANAR,  // y-v-u, planar
 | 
			
		||||
  AVS_CS_I420_25 = 1<<4 | AVS_CS_YUV | AVS_CS_PLANAR,  // y-u-v, planar
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
AVSC_INLINE int avs_get_height_p_25(const AVS_VideoFrame * p, int plane) {
 | 
			
		||||
    switch (plane)
 | 
			
		||||
    {
 | 
			
		||||
        case AVS_PLANAR_U: case AVS_PLANAR_V:
 | 
			
		||||
            if (p->pitchUV)
 | 
			
		||||
                return p->height>>1;
 | 
			
		||||
            return 0;
 | 
			
		||||
    }
 | 
			
		||||
    return p->height;}
 | 
			
		||||
 | 
			
		||||
AVSC_INLINE int avs_get_row_size_p_25(const AVS_VideoFrame * p, int plane) {
 | 
			
		||||
    int r;
 | 
			
		||||
    switch (plane)
 | 
			
		||||
    {
 | 
			
		||||
    case AVS_PLANAR_U: case AVS_PLANAR_V:
 | 
			
		||||
        if (p->pitchUV)
 | 
			
		||||
            return p->row_size>>1;
 | 
			
		||||
        else
 | 
			
		||||
            return 0;
 | 
			
		||||
    case AVS_PLANAR_U_ALIGNED: case AVS_PLANAR_V_ALIGNED:
 | 
			
		||||
        if (p->pitchUV)
 | 
			
		||||
        {
 | 
			
		||||
            r = ((p->row_size+AVS_FRAME_ALIGN-1)&(~(AVS_FRAME_ALIGN-1)) )>>1; // Aligned rowsize
 | 
			
		||||
            if (r < p->pitchUV)
 | 
			
		||||
                return r;
 | 
			
		||||
            return p->row_size>>1;
 | 
			
		||||
        }
 | 
			
		||||
        else
 | 
			
		||||
            return 0;
 | 
			
		||||
    case AVS_PLANAR_Y_ALIGNED:
 | 
			
		||||
        r = (p->row_size+AVS_FRAME_ALIGN-1)&(~(AVS_FRAME_ALIGN-1)); // Aligned rowsize
 | 
			
		||||
        if (r <= p->pitch)
 | 
			
		||||
            return r;
 | 
			
		||||
        return p->row_size;
 | 
			
		||||
    }
 | 
			
		||||
    return p->row_size;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
AVSC_INLINE int avs_is_yv12_25(const AVS_VideoInfo * p)
 | 
			
		||||
    { return ((p->pixel_type & AVS_CS_YV12_25) == AVS_CS_YV12_25)||((p->pixel_type & AVS_CS_I420_25) == AVS_CS_I420_25); }
 | 
			
		||||
@@ -1,62 +0,0 @@
 | 
			
		||||
// Avisynth C Interface Version 0.20
 | 
			
		||||
// Copyright 2003 Kevin Atkinson
 | 
			
		||||
 | 
			
		||||
// This program is free software; you can redistribute it and/or modify
 | 
			
		||||
// it under the terms of the GNU General Public License as published by
 | 
			
		||||
// the Free Software Foundation; either version 2 of the License, or
 | 
			
		||||
// (at your option) any later version.
 | 
			
		||||
//
 | 
			
		||||
// This program is distributed in the hope that it will be useful,
 | 
			
		||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
// GNU General Public License for more details.
 | 
			
		||||
//
 | 
			
		||||
// You should have received a copy of the GNU General Public License
 | 
			
		||||
// along with this program; if not, write to the Free Software
 | 
			
		||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit
 | 
			
		||||
// http://www.gnu.org/copyleft/gpl.html .
 | 
			
		||||
//
 | 
			
		||||
// As a special exception, I give you permission to link to the
 | 
			
		||||
// Avisynth C interface with independent modules that communicate with
 | 
			
		||||
// the Avisynth C interface solely through the interfaces defined in
 | 
			
		||||
// avisynth_c.h, regardless of the license terms of these independent
 | 
			
		||||
// modules, and to copy and distribute the resulting combined work
 | 
			
		||||
// under terms of your choice, provided that every copy of the
 | 
			
		||||
// combined work is accompanied by a complete copy of the source code
 | 
			
		||||
// of the Avisynth C interface and Avisynth itself (with the version
 | 
			
		||||
// used to produce the combined work), being distributed under the
 | 
			
		||||
// terms of the GNU General Public License plus this exception.  An
 | 
			
		||||
// independent module is a module which is not derived from or based
 | 
			
		||||
// on Avisynth C Interface, such as 3rd-party filters, import and
 | 
			
		||||
// export plugins, or graphical user interfaces.
 | 
			
		||||
 | 
			
		||||
#ifndef AVS_CAPI_H
 | 
			
		||||
#define AVS_CAPI_H
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
#  define EXTERN_C extern "C"
 | 
			
		||||
#else
 | 
			
		||||
#  define EXTERN_C
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifndef AVSC_USE_STDCALL
 | 
			
		||||
#  define AVSC_CC __cdecl
 | 
			
		||||
#else
 | 
			
		||||
#  define AVSC_CC __stdcall
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define AVSC_INLINE static __inline
 | 
			
		||||
 | 
			
		||||
#ifdef BUILDING_AVSCORE
 | 
			
		||||
#  define AVSC_EXPORT EXTERN_C
 | 
			
		||||
#  define AVSC_API(ret, name) EXTERN_C __declspec(dllexport) ret AVSC_CC name
 | 
			
		||||
#else
 | 
			
		||||
#  define AVSC_EXPORT EXTERN_C __declspec(dllexport)
 | 
			
		||||
#  ifndef AVSC_NO_DECLSPEC
 | 
			
		||||
#    define AVSC_API(ret, name) EXTERN_C __declspec(dllimport) ret AVSC_CC name
 | 
			
		||||
#  else
 | 
			
		||||
#    define AVSC_API(ret, name) typedef ret (AVSC_CC *name##_func)
 | 
			
		||||
#  endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif //AVS_CAPI_H
 | 
			
		||||
@@ -1,55 +0,0 @@
 | 
			
		||||
// Avisynth C Interface Version 0.20
 | 
			
		||||
// Copyright 2003 Kevin Atkinson
 | 
			
		||||
 | 
			
		||||
// This program is free software; you can redistribute it and/or modify
 | 
			
		||||
// it under the terms of the GNU General Public License as published by
 | 
			
		||||
// the Free Software Foundation; either version 2 of the License, or
 | 
			
		||||
// (at your option) any later version.
 | 
			
		||||
//
 | 
			
		||||
// This program is distributed in the hope that it will be useful,
 | 
			
		||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
// GNU General Public License for more details.
 | 
			
		||||
//
 | 
			
		||||
// You should have received a copy of the GNU General Public License
 | 
			
		||||
// along with this program; if not, write to the Free Software
 | 
			
		||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit
 | 
			
		||||
// http://www.gnu.org/copyleft/gpl.html .
 | 
			
		||||
//
 | 
			
		||||
// As a special exception, I give you permission to link to the
 | 
			
		||||
// Avisynth C interface with independent modules that communicate with
 | 
			
		||||
// the Avisynth C interface solely through the interfaces defined in
 | 
			
		||||
// avisynth_c.h, regardless of the license terms of these independent
 | 
			
		||||
// modules, and to copy and distribute the resulting combined work
 | 
			
		||||
// under terms of your choice, provided that every copy of the
 | 
			
		||||
// combined work is accompanied by a complete copy of the source code
 | 
			
		||||
// of the Avisynth C interface and Avisynth itself (with the version
 | 
			
		||||
// used to produce the combined work), being distributed under the
 | 
			
		||||
// terms of the GNU General Public License plus this exception.  An
 | 
			
		||||
// independent module is a module which is not derived from or based
 | 
			
		||||
// on Avisynth C Interface, such as 3rd-party filters, import and
 | 
			
		||||
// export plugins, or graphical user interfaces.
 | 
			
		||||
 | 
			
		||||
#ifndef AVS_CONFIG_H
 | 
			
		||||
#define AVS_CONFIG_H
 | 
			
		||||
 | 
			
		||||
// Undefine this to get cdecl calling convention
 | 
			
		||||
#define AVSC_USE_STDCALL 1
 | 
			
		||||
 | 
			
		||||
// NOTE TO PLUGIN AUTHORS:
 | 
			
		||||
// Because FRAME_ALIGN can be substantially higher than the alignment
 | 
			
		||||
// a plugin actually needs, plugins should not use FRAME_ALIGN to check for
 | 
			
		||||
// alignment. They should always request the exact alignment value they need.
 | 
			
		||||
// This is to make sure that plugins work over the widest range of AviSynth
 | 
			
		||||
// builds possible.
 | 
			
		||||
#define FRAME_ALIGN 32
 | 
			
		||||
 | 
			
		||||
#if   defined(_M_AMD64) || defined(__x86_64)
 | 
			
		||||
#   define X86_64
 | 
			
		||||
#elif defined(_M_IX86) || defined(__i386__)
 | 
			
		||||
#   define X86_32
 | 
			
		||||
#else
 | 
			
		||||
#   error Unsupported CPU architecture.
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif //AVS_CONFIG_H
 | 
			
		||||
@@ -1,51 +0,0 @@
 | 
			
		||||
// Avisynth C Interface Version 0.20
 | 
			
		||||
// Copyright 2003 Kevin Atkinson
 | 
			
		||||
 | 
			
		||||
// This program is free software; you can redistribute it and/or modify
 | 
			
		||||
// it under the terms of the GNU General Public License as published by
 | 
			
		||||
// the Free Software Foundation; either version 2 of the License, or
 | 
			
		||||
// (at your option) any later version.
 | 
			
		||||
//
 | 
			
		||||
// This program is distributed in the hope that it will be useful,
 | 
			
		||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
// GNU General Public License for more details.
 | 
			
		||||
//
 | 
			
		||||
// You should have received a copy of the GNU General Public License
 | 
			
		||||
// along with this program; if not, write to the Free Software
 | 
			
		||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit
 | 
			
		||||
// http://www.gnu.org/copyleft/gpl.html .
 | 
			
		||||
//
 | 
			
		||||
// As a special exception, I give you permission to link to the
 | 
			
		||||
// Avisynth C interface with independent modules that communicate with
 | 
			
		||||
// the Avisynth C interface solely through the interfaces defined in
 | 
			
		||||
// avisynth_c.h, regardless of the license terms of these independent
 | 
			
		||||
// modules, and to copy and distribute the resulting combined work
 | 
			
		||||
// under terms of your choice, provided that every copy of the
 | 
			
		||||
// combined work is accompanied by a complete copy of the source code
 | 
			
		||||
// of the Avisynth C interface and Avisynth itself (with the version
 | 
			
		||||
// used to produce the combined work), being distributed under the
 | 
			
		||||
// terms of the GNU General Public License plus this exception.  An
 | 
			
		||||
// independent module is a module which is not derived from or based
 | 
			
		||||
// on Avisynth C Interface, such as 3rd-party filters, import and
 | 
			
		||||
// export plugins, or graphical user interfaces.
 | 
			
		||||
 | 
			
		||||
#ifndef AVS_TYPES_H
 | 
			
		||||
#define AVS_TYPES_H
 | 
			
		||||
 | 
			
		||||
// Define all types necessary for interfacing with avisynth.dll
 | 
			
		||||
 | 
			
		||||
// Raster types used by VirtualDub & Avisynth
 | 
			
		||||
typedef unsigned int    Pixel32;
 | 
			
		||||
typedef unsigned char   BYTE;
 | 
			
		||||
 | 
			
		||||
// Audio Sample information
 | 
			
		||||
typedef float SFLOAT;
 | 
			
		||||
 | 
			
		||||
#ifdef __GNUC__
 | 
			
		||||
typedef long long int INT64;
 | 
			
		||||
#else
 | 
			
		||||
typedef __int64 INT64;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif //AVS_TYPES_H
 | 
			
		||||
@@ -513,21 +513,21 @@ AVSC_INLINE AVS_Value avs_array_elt(AVS_Value v, int index)
 | 
			
		||||
// only use these functions on am AVS_Value that does not already have
 | 
			
		||||
// an active value.  Remember, treat AVS_Value as a fat pointer.
 | 
			
		||||
AVSC_INLINE AVS_Value avs_new_value_bool(int v0)
 | 
			
		||||
        { AVS_Value v = {0}; v.type = 'b'; v.d.boolean = v0 == 0 ? 0 : 1; return v; }
 | 
			
		||||
        { AVS_Value v; v.type = 'b'; v.d.boolean = v0 == 0 ? 0 : 1; return v; }
 | 
			
		||||
AVSC_INLINE AVS_Value avs_new_value_int(int v0)
 | 
			
		||||
        { AVS_Value v = {0}; v.type = 'i'; v.d.integer = v0; return v; }
 | 
			
		||||
        { AVS_Value v; v.type = 'i'; v.d.integer = v0; return v; }
 | 
			
		||||
AVSC_INLINE AVS_Value avs_new_value_string(const char * v0)
 | 
			
		||||
        { AVS_Value v = {0}; v.type = 's'; v.d.string = v0; return v; }
 | 
			
		||||
        { AVS_Value v; v.type = 's'; v.d.string = v0; return v; }
 | 
			
		||||
AVSC_INLINE AVS_Value avs_new_value_float(float v0)
 | 
			
		||||
        { AVS_Value v = {0}; v.type = 'f'; v.d.floating_pt = v0; return v;}
 | 
			
		||||
        { AVS_Value v; v.type = 'f'; v.d.floating_pt = v0; return v;}
 | 
			
		||||
AVSC_INLINE AVS_Value avs_new_value_error(const char * v0)
 | 
			
		||||
        { AVS_Value v = {0}; v.type = 'e'; v.d.string = v0; return v; }
 | 
			
		||||
        { AVS_Value v; v.type = 'e'; v.d.string = v0; return v; }
 | 
			
		||||
#ifndef AVSC_NO_DECLSPEC
 | 
			
		||||
AVSC_INLINE AVS_Value avs_new_value_clip(AVS_Clip * v0)
 | 
			
		||||
        { AVS_Value v = {0}; avs_set_to_clip(&v, v0); return v; }
 | 
			
		||||
        { AVS_Value v; avs_set_to_clip(&v, v0); return v; }
 | 
			
		||||
#endif
 | 
			
		||||
AVSC_INLINE AVS_Value avs_new_value_array(AVS_Value * v0, int size)
 | 
			
		||||
        { AVS_Value v = {0}; v.type = 'a'; v.d.array = v0; v.array_size = size; return v; }
 | 
			
		||||
        { AVS_Value v; v.type = 'a'; v.d.array = v0; v.array_size = size; return v; }
 | 
			
		||||
 | 
			
		||||
/////////////////////////////////////////////////////////////////////
 | 
			
		||||
//
 | 
			
		||||
 
 | 
			
		||||
@@ -52,8 +52,8 @@ namespace avxsynth {
 | 
			
		||||
//
 | 
			
		||||
// Functions
 | 
			
		||||
//
 | 
			
		||||
#define MAKEDWORD(a,b,c,d) (((a) << 24) | ((b) << 16) | ((c) << 8) | (d))
 | 
			
		||||
#define MAKEWORD(a,b) (((a) << 8) | (b))
 | 
			
		||||
#define MAKEDWORD(a,b,c,d) ((a << 24) | (b << 16) | (c << 8) | (d))
 | 
			
		||||
#define MAKEWORD(a,b) ((a << 8) | (b))
 | 
			
		||||
 | 
			
		||||
#define lstrlen                             strlen
 | 
			
		||||
#define lstrcpy                             strcpy
 | 
			
		||||
 
 | 
			
		||||
@@ -66,8 +66,6 @@ static av_always_inline int pthread_create(pthread_t *thread, const pthread_attr
 | 
			
		||||
    struct thread_arg *thread_arg;
 | 
			
		||||
 | 
			
		||||
    thread_arg = av_mallocz(sizeof(struct thread_arg));
 | 
			
		||||
    if (!thread_arg)
 | 
			
		||||
        return ENOMEM;
 | 
			
		||||
 | 
			
		||||
    thread_arg->start_routine = start_routine;
 | 
			
		||||
    thread_arg->arg = arg;
 | 
			
		||||
 
 | 
			
		||||
@@ -55,17 +55,35 @@ typedef struct pthread_t {
 | 
			
		||||
 * not mutexes */
 | 
			
		||||
typedef CRITICAL_SECTION pthread_mutex_t;
 | 
			
		||||
 | 
			
		||||
/* This is the CONDITION_VARIABLE typedef for using Windows' native
 | 
			
		||||
 * conditional variables on kernels 6.0+. */
 | 
			
		||||
#if HAVE_CONDITION_VARIABLE_PTR
 | 
			
		||||
typedef CONDITION_VARIABLE pthread_cond_t;
 | 
			
		||||
#else
 | 
			
		||||
/* This is the CONDITIONAL_VARIABLE typedef for using Window's native
 | 
			
		||||
 * conditional variables on kernels 6.0+.
 | 
			
		||||
 * MinGW does not currently have this typedef. */
 | 
			
		||||
typedef struct pthread_cond_t {
 | 
			
		||||
    void *Ptr;
 | 
			
		||||
    void *ptr;
 | 
			
		||||
} pthread_cond_t;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if _WIN32_WINNT >= 0x0600
 | 
			
		||||
/* function pointers to conditional variable API on windows 6.0+ kernels */
 | 
			
		||||
#if _WIN32_WINNT < 0x0600
 | 
			
		||||
static void (WINAPI *cond_broadcast)(pthread_cond_t *cond);
 | 
			
		||||
static void (WINAPI *cond_init)(pthread_cond_t *cond);
 | 
			
		||||
static void (WINAPI *cond_signal)(pthread_cond_t *cond);
 | 
			
		||||
static BOOL (WINAPI *cond_wait)(pthread_cond_t *cond, pthread_mutex_t *mutex,
 | 
			
		||||
                                DWORD milliseconds);
 | 
			
		||||
#else
 | 
			
		||||
#define cond_init      InitializeConditionVariable
 | 
			
		||||
#define cond_broadcast WakeAllConditionVariable
 | 
			
		||||
#define cond_signal    WakeConditionVariable
 | 
			
		||||
#define cond_wait      SleepConditionVariableCS
 | 
			
		||||
 | 
			
		||||
#define CreateEvent(a, reset, init, name)                   \
 | 
			
		||||
    CreateEventEx(a, name,                                  \
 | 
			
		||||
                  (reset ? CREATE_EVENT_MANUAL_RESET : 0) | \
 | 
			
		||||
                  (init ? CREATE_EVENT_INITIAL_SET : 0),    \
 | 
			
		||||
                  EVENT_ALL_ACCESS)
 | 
			
		||||
// CreateSemaphoreExA seems to be desktop-only, but as long as we don't
 | 
			
		||||
// use named semaphores, it doesn't matter if we use the W version.
 | 
			
		||||
#define CreateSemaphore(a, b, c, d) \
 | 
			
		||||
    CreateSemaphoreExW(a, b, c, d, 0, SEMAPHORE_ALL_ACCESS)
 | 
			
		||||
#define InitializeCriticalSection(x) InitializeCriticalSectionEx(x, 0, 0)
 | 
			
		||||
#define WaitForSingleObject(a, b) WaitForSingleObjectEx(a, b, FALSE)
 | 
			
		||||
#endif
 | 
			
		||||
@@ -118,36 +136,6 @@ static inline int pthread_mutex_unlock(pthread_mutex_t *m)
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#if _WIN32_WINNT >= 0x0600
 | 
			
		||||
static inline int pthread_cond_init(pthread_cond_t *cond, const void *unused_attr)
 | 
			
		||||
{
 | 
			
		||||
    InitializeConditionVariable(cond);
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* native condition variables do not destroy */
 | 
			
		||||
static inline void pthread_cond_destroy(pthread_cond_t *cond)
 | 
			
		||||
{
 | 
			
		||||
    return;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static inline void pthread_cond_broadcast(pthread_cond_t *cond)
 | 
			
		||||
{
 | 
			
		||||
    WakeAllConditionVariable(cond);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static inline int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
 | 
			
		||||
{
 | 
			
		||||
    SleepConditionVariableCS(cond, mutex, INFINITE);
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static inline void pthread_cond_signal(pthread_cond_t *cond)
 | 
			
		||||
{
 | 
			
		||||
    WakeConditionVariable(cond);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#else // _WIN32_WINNT < 0x0600
 | 
			
		||||
/* for pre-Windows 6.0 platforms we need to define and use our own condition
 | 
			
		||||
 * variable and api */
 | 
			
		||||
typedef struct  win32_cond_t {
 | 
			
		||||
@@ -159,13 +147,6 @@ typedef struct  win32_cond_t {
 | 
			
		||||
    volatile int is_broadcast;
 | 
			
		||||
} win32_cond_t;
 | 
			
		||||
 | 
			
		||||
/* function pointers to conditional variable API on windows 6.0+ kernels */
 | 
			
		||||
static void (WINAPI *cond_broadcast)(pthread_cond_t *cond);
 | 
			
		||||
static void (WINAPI *cond_init)(pthread_cond_t *cond);
 | 
			
		||||
static void (WINAPI *cond_signal)(pthread_cond_t *cond);
 | 
			
		||||
static BOOL (WINAPI *cond_wait)(pthread_cond_t *cond, pthread_mutex_t *mutex,
 | 
			
		||||
                                DWORD milliseconds);
 | 
			
		||||
 | 
			
		||||
static av_unused int pthread_cond_init(pthread_cond_t *cond, const void *unused_attr)
 | 
			
		||||
{
 | 
			
		||||
    win32_cond_t *win32_cond = NULL;
 | 
			
		||||
@@ -178,7 +159,7 @@ static av_unused int pthread_cond_init(pthread_cond_t *cond, const void *unused_
 | 
			
		||||
    win32_cond = av_mallocz(sizeof(win32_cond_t));
 | 
			
		||||
    if (!win32_cond)
 | 
			
		||||
        return ENOMEM;
 | 
			
		||||
    cond->Ptr = win32_cond;
 | 
			
		||||
    cond->ptr = win32_cond;
 | 
			
		||||
    win32_cond->semaphore = CreateSemaphore(NULL, 0, 0x7fffffff, NULL);
 | 
			
		||||
    if (!win32_cond->semaphore)
 | 
			
		||||
        return ENOMEM;
 | 
			
		||||
@@ -193,7 +174,7 @@ static av_unused int pthread_cond_init(pthread_cond_t *cond, const void *unused_
 | 
			
		||||
 | 
			
		||||
static av_unused void pthread_cond_destroy(pthread_cond_t *cond)
 | 
			
		||||
{
 | 
			
		||||
    win32_cond_t *win32_cond = cond->Ptr;
 | 
			
		||||
    win32_cond_t *win32_cond = cond->ptr;
 | 
			
		||||
    /* native condition variables do not destroy */
 | 
			
		||||
    if (cond_init)
 | 
			
		||||
        return;
 | 
			
		||||
@@ -204,12 +185,12 @@ static av_unused void pthread_cond_destroy(pthread_cond_t *cond)
 | 
			
		||||
    pthread_mutex_destroy(&win32_cond->mtx_waiter_count);
 | 
			
		||||
    pthread_mutex_destroy(&win32_cond->mtx_broadcast);
 | 
			
		||||
    av_freep(&win32_cond);
 | 
			
		||||
    cond->Ptr = NULL;
 | 
			
		||||
    cond->ptr = NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static av_unused void pthread_cond_broadcast(pthread_cond_t *cond)
 | 
			
		||||
{
 | 
			
		||||
    win32_cond_t *win32_cond = cond->Ptr;
 | 
			
		||||
    win32_cond_t *win32_cond = cond->ptr;
 | 
			
		||||
    int have_waiter;
 | 
			
		||||
 | 
			
		||||
    if (cond_broadcast) {
 | 
			
		||||
@@ -240,7 +221,7 @@ static av_unused void pthread_cond_broadcast(pthread_cond_t *cond)
 | 
			
		||||
 | 
			
		||||
static av_unused int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
 | 
			
		||||
{
 | 
			
		||||
    win32_cond_t *win32_cond = cond->Ptr;
 | 
			
		||||
    win32_cond_t *win32_cond = cond->ptr;
 | 
			
		||||
    int last_waiter;
 | 
			
		||||
    if (cond_wait) {
 | 
			
		||||
        cond_wait(cond, mutex, INFINITE);
 | 
			
		||||
@@ -272,7 +253,7 @@ static av_unused int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mu
 | 
			
		||||
 | 
			
		||||
static av_unused void pthread_cond_signal(pthread_cond_t *cond)
 | 
			
		||||
{
 | 
			
		||||
    win32_cond_t *win32_cond = cond->Ptr;
 | 
			
		||||
    win32_cond_t *win32_cond = cond->ptr;
 | 
			
		||||
    int have_waiter;
 | 
			
		||||
    if (cond_signal) {
 | 
			
		||||
        cond_signal(cond);
 | 
			
		||||
@@ -294,7 +275,6 @@ static av_unused void pthread_cond_signal(pthread_cond_t *cond)
 | 
			
		||||
 | 
			
		||||
    pthread_mutex_unlock(&win32_cond->mtx_broadcast);
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
static av_unused void w32thread_init(void)
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
@@ -1,9 +0,0 @@
 | 
			
		||||
#!/bin/sh
 | 
			
		||||
 | 
			
		||||
LINK_EXE_PATH=$(dirname "$(command -v cl)")/link
 | 
			
		||||
if [ -x "$LINK_EXE_PATH" ]; then
 | 
			
		||||
    "$LINK_EXE_PATH" $@
 | 
			
		||||
else
 | 
			
		||||
    link $@
 | 
			
		||||
fi
 | 
			
		||||
exit $?
 | 
			
		||||
							
								
								
									
										221
									
								
								doc/APIchanges
									
									
									
									
									
								
							
							
						
						
									
										221
									
								
								doc/APIchanges
									
									
									
									
									
								
							@@ -15,202 +15,15 @@ libavutil:     2014-08-09
 | 
			
		||||
 | 
			
		||||
API changes, most recent first:
 | 
			
		||||
 | 
			
		||||
-------- 8< --------- FFmpeg 2.8 was cut here -------- 8< ---------
 | 
			
		||||
 | 
			
		||||
2015-08-27 - 1dd854e1 - lavc 56.58.100 - vaapi.h
 | 
			
		||||
  Deprecate old VA-API context (vaapi_context) fields that were only
 | 
			
		||||
  set and used by libavcodec. They are all managed internally now.
 | 
			
		||||
 | 
			
		||||
2015-08-19 - 9f8e57ef - lavu 54.31.100 - pixfmt.h
 | 
			
		||||
  Add a unique pixel format for VA-API (AV_PIX_FMT_VAAPI) that
 | 
			
		||||
  indicates the nature of the underlying storage: a VA surface. This
 | 
			
		||||
  yields the same value as AV_PIX_FMT_VAAPI_VLD.
 | 
			
		||||
  Deprecate old VA-API related pixel formats: AV_PIX_FMT_VAAPI_MOCO,
 | 
			
		||||
  AV_PIX_FMT_VAAPI_IDCT, AV_PIX_FMT_VAAPI_VLD.
 | 
			
		||||
 | 
			
		||||
2015-08-02 - lavu 54.30.100 / 54.17.0
 | 
			
		||||
  9ed59f1 / 7a7df34c -  Add av_blowfish_alloc().
 | 
			
		||||
  a130ec9 / ae365453 -  Add av_rc4_alloc().
 | 
			
		||||
  9ca1997 / 5d8bea3b -  Add av_xtea_alloc().
 | 
			
		||||
  3cf08e9 / d9e8b47e -  Add av_des_alloc().
 | 
			
		||||
 | 
			
		||||
2015-07-27 - lavc 56.56.100 / 56.35.0 - avcodec.h
 | 
			
		||||
  94d68a4 / 7c6eb0a1 - Rename CODEC_FLAG* defines to AV_CODEC_FLAG*.
 | 
			
		||||
  444e987 / def97856 - Rename CODEC_CAP_* defines to AV_CODEC_CAP_*.
 | 
			
		||||
  29d147c / 059a9348 - Rename FF_INPUT_BUFFER_PADDING_SIZE and FF_MIN_BUFFER_SIZE
 | 
			
		||||
              to AV_INPUT_BUFFER_PADDING_SIZE and AV_INPUT_BUFFER_MIN_SIZE.
 | 
			
		||||
 | 
			
		||||
2015-07-22 - c40ecff - lavc 56.51.100 - avcodec.h
 | 
			
		||||
  Add AV_PKT_DATA_QUALITY_STATS to export the quality value, PSNR, and pict_type
 | 
			
		||||
  of an AVPacket.
 | 
			
		||||
 | 
			
		||||
2015-07-16 - 8dad213 - lavc 56.49.100
 | 
			
		||||
  Add av_codec_get_codec_properties(), FF_CODEC_PROPERTY_LOSSLESS
 | 
			
		||||
  and FF_CODEC_PROPERTY_CLOSED_CAPTIONS
 | 
			
		||||
 | 
			
		||||
2015-07-03 - d563e13 / 83212943 - lavu 54.28.100 / 56.15.0
 | 
			
		||||
  Add av_version_info().
 | 
			
		||||
 | 
			
		||||
-------- 8< --------- FFmpeg 2.7 was cut here -------- 8< ---------
 | 
			
		||||
 | 
			
		||||
2015-06-04 - cc17b43 - lswr  1.2.100
 | 
			
		||||
  Add swr_get_out_samples()
 | 
			
		||||
 | 
			
		||||
2015-05-27 - c312bfa - lavu 54.26.100 - cpu.h
 | 
			
		||||
  Add AV_CPU_FLAG_AVXSLOW.
 | 
			
		||||
 | 
			
		||||
2015-05-26 - 1fb9b2a - lavu 54.25.100 - rational.h
 | 
			
		||||
  Add av_q2intfloat().
 | 
			
		||||
 | 
			
		||||
2015-05-13 - cc48409 / e7c5e17 - lavc 56.39.100 / 56.23.0
 | 
			
		||||
  Add av_vda_default_init2.
 | 
			
		||||
 | 
			
		||||
2015-05-11 - 541d75f - lavf 56.33.100 - avformat.h
 | 
			
		||||
  Add AVOpenCallback AVFormatContext.open_cb
 | 
			
		||||
 | 
			
		||||
2015-05-07 - a7dd933 - 56.38.100 - avcodec.h
 | 
			
		||||
  Add av_packet_side_data_name().
 | 
			
		||||
 | 
			
		||||
2015-05-07 - 01e59d4 - 56.37.102 - avcodec.h
 | 
			
		||||
  Add FF_PROFILE_VP9_2 and FF_PROFILE_VP9_3.
 | 
			
		||||
 | 
			
		||||
2015-05-04 - 079b7f6 - 56.37.100 - avcodec.h
 | 
			
		||||
  Add FF_PROFILE_VP9_0 and FF_PROFILE_VP9_1.
 | 
			
		||||
 | 
			
		||||
2015-04-22 - 748d481 - lavf 56.31.100 - avformat.h
 | 
			
		||||
  Add AVFMT_FLAG_FAST_SEEK flag. Some formats (initially mp3) use it to enable
 | 
			
		||||
  fast, but inaccurate seeking.
 | 
			
		||||
 | 
			
		||||
2015-04-20 - 8e8219e / c253340 - lavu 54.23.100 / 54.12.0 - log.h
 | 
			
		||||
  Add AV_LOG_TRACE for extremely verbose debugging.
 | 
			
		||||
 | 
			
		||||
2015-04-02 - 26e0e393 - lavf 56.29.100 - avio.h
 | 
			
		||||
  Add AVIODirEntryType.AVIO_ENTRY_SERVER.
 | 
			
		||||
  Add AVIODirEntryType.AVIO_ENTRY_SHARE.
 | 
			
		||||
  Add AVIODirEntryType.AVIO_ENTRY_WORKGROUP.
 | 
			
		||||
 | 
			
		||||
2015-03-31 - 3188696 - lavu 54.22.100 - avstring.h
 | 
			
		||||
  Add av_append_path_component()
 | 
			
		||||
 | 
			
		||||
2015-03-27 - 184084c - lavf 56.27.100 - avio.h url.h
 | 
			
		||||
  New directory listing API.
 | 
			
		||||
 | 
			
		||||
  Add AVIODirEntryType enum.
 | 
			
		||||
  Add AVIODirEntry, AVIODirContext structures.
 | 
			
		||||
  Add avio_open_dir(), avio_read_dir(), avio_close_dir(), avio_free_directory_entry().
 | 
			
		||||
  Add ff_alloc_dir_entry().
 | 
			
		||||
  Extend URLProtocol with url_open_dir(), url_read_dir(), url_close_dir().
 | 
			
		||||
 | 
			
		||||
2015-03-29 - 268ff17 / c484561 - lavu 54.21.100 / 54.10.0 - pixfmt.h
 | 
			
		||||
  Add AV_PIX_FMT_MMAL for MMAL hardware acceleration.
 | 
			
		||||
 | 
			
		||||
2015-03-19 - 11fe56c - 56.29.100 / lavc 56.22.0
 | 
			
		||||
  Add FF_PROFILE_DTS_EXPRESS.
 | 
			
		||||
 | 
			
		||||
-------- 8< --------- FFmpeg 2.6 was cut here -------- 8< ---------
 | 
			
		||||
 | 
			
		||||
2015-03-04 - cca4476 - lavf 56.25.100
 | 
			
		||||
  Add avformat_flush()
 | 
			
		||||
 | 
			
		||||
2015-03-03 - 81a9126 - lavf 56.24.100
 | 
			
		||||
  Add avio_put_str16be()
 | 
			
		||||
 | 
			
		||||
2015-02-19 - 560eb71 / 31d2039 - lavc 56.23.100 / 56.13.0
 | 
			
		||||
  Add width, height, coded_width, coded_height and format to
 | 
			
		||||
  AVCodecParserContext.
 | 
			
		||||
 | 
			
		||||
2015-02-19 - e375511 / 5b1d9ce - lavu 54.19.100 / 54.9.0
 | 
			
		||||
  Add AV_PIX_FMT_QSV for QSV hardware acceleration.
 | 
			
		||||
 | 
			
		||||
2015-02-14 - ba22295 - lavc 56.21.102
 | 
			
		||||
  Deprecate VIMA decoder.
 | 
			
		||||
 | 
			
		||||
2015-01-27 - 62a82c6 / 728685f - lavc 56.21.100 / 56.12.0, lavu 54.18.100 / 54.8.0 - avcodec.h, frame.h
 | 
			
		||||
  Add AV_PKT_DATA_AUDIO_SERVICE_TYPE and AV_FRAME_DATA_AUDIO_SERVICE_TYPE for
 | 
			
		||||
  storing the audio service type as side data.
 | 
			
		||||
 | 
			
		||||
2015-01-16 - a47c933 - lavf 56.19.100 - avformat.h
 | 
			
		||||
  Add data_codec and data_codec_id for storing codec of data stream
 | 
			
		||||
 | 
			
		||||
2015-01-11 - 007c33d - lavd 56.4.100 - avdevice.h
 | 
			
		||||
  Add avdevice_list_input_sources().
 | 
			
		||||
  Add avdevice_list_output_sinks().
 | 
			
		||||
 | 
			
		||||
2014-12-25 - d7aaeea / c220a60 - lavc 56.19.100 / 56.10.0 - vdpau.h
 | 
			
		||||
  Add av_vdpau_get_surface_parameters().
 | 
			
		||||
 | 
			
		||||
2014-12-25 - ddb9a24 / 6c99c92 - lavc 56.18.100 / 56.9.0 - avcodec.h
 | 
			
		||||
  Add AV_HWACCEL_FLAG_ALLOW_HIGH_DEPTH flag to av_vdpau_bind_context().
 | 
			
		||||
 | 
			
		||||
2014-12-25 - d16079a / 57b6704 - lavc 56.17.100 / 56.8.0 - avcodec.h
 | 
			
		||||
  Add AVCodecContext.sw_pix_fmt.
 | 
			
		||||
 | 
			
		||||
2014-12-04 - 6e9ac02 - lavc 56.14.100 - dv_profile.h
 | 
			
		||||
  Add av_dv_codec_profile2().
 | 
			
		||||
 | 
			
		||||
-------- 8< --------- FFmpeg 2.5 was cut here -------- 8< ---------
 | 
			
		||||
 | 
			
		||||
2014-11-21 - ab922f9 - lavu 54.15.100 - dict.h
 | 
			
		||||
   Add av_dict_get_string().
 | 
			
		||||
 | 
			
		||||
2014-11-18 - a54a51c - lavu 54.14.100 - float_dsp.h
 | 
			
		||||
  Add avpriv_float_dsp_alloc().
 | 
			
		||||
 | 
			
		||||
2014-11-16 - 6690d4c3 - lavf 56.13.100 - avformat.h
 | 
			
		||||
  Add AVStream.recommended_encoder_configuration with accessors.
 | 
			
		||||
 | 
			
		||||
2014-11-16 - bee5844d - lavu 54.13.100 - opt.h
 | 
			
		||||
  Add av_opt_serialize().
 | 
			
		||||
 | 
			
		||||
2014-11-16 - eec69332 - lavu 54.12.100 - opt.h
 | 
			
		||||
  Add av_opt_is_set_to_default().
 | 
			
		||||
 | 
			
		||||
2014-11-06 - 44fa267 / 5e80fb7 - lavc 56.11.100 / 56.6.0 - vorbis_parser.h
 | 
			
		||||
  Add a public API for parsing vorbis packets.
 | 
			
		||||
 | 
			
		||||
2014-10-15 - 17085a0 / 7ea1b34 - lavc 56.7.100 / 56.5.0 - avcodec.h
 | 
			
		||||
  Replace AVCodecContext.time_base used for decoding
 | 
			
		||||
  with AVCodecContext.framerate.
 | 
			
		||||
 | 
			
		||||
2014-10-15 - 51c810e / d565fef1 - lavc 56.6.100 / 56.4.0 - avcodec.h
 | 
			
		||||
  Add AV_HWACCEL_FLAG_IGNORE_LEVEL flag to av_vdpau_bind_context().
 | 
			
		||||
 | 
			
		||||
2014-10-13 - da21895 / 2df0c32e - lavc 56.5.100 / 56.3.0 - avcodec.h
 | 
			
		||||
  Add AVCodecContext.initial_padding. Deprecate the use of AVCodecContext.delay
 | 
			
		||||
  for audio encoding.
 | 
			
		||||
 | 
			
		||||
2014-10-08 - bb44f7d / 5a419b2 - lavu 54.10.100 / 54.4.0 - pixdesc.h
 | 
			
		||||
  Add API to return the name of frame and context color properties.
 | 
			
		||||
 | 
			
		||||
2014-10-06 - a61899a / e3e158e - lavc 56.3.100 / 56.2.0 - vdpau.h
 | 
			
		||||
  Add av_vdpau_bind_context(). This function should now be used for creating
 | 
			
		||||
  (or resetting) a AVVDPAUContext instead of av_vdpau_alloc_context().
 | 
			
		||||
 | 
			
		||||
2014-10-02 - cdd6f05 - lavc 56.2.100 - avcodec.h
 | 
			
		||||
2014-10-02 - cdd6f05 - lavu 54.9.100 - frame.h
 | 
			
		||||
  Add AV_FRAME_DATA_SKIP_SAMPLES. Add lavc CODEC_FLAG2_SKIP_MANUAL and
 | 
			
		||||
  AVOption "skip_manual", which makes lavc export skip information via
 | 
			
		||||
  AV_FRAME_DATA_SKIP_SAMPLES AVFrame side data, instead of skipping and
 | 
			
		||||
  discarding samples automatically.
 | 
			
		||||
 | 
			
		||||
2014-10-02 - 0d92b0d - lavu 54.8.100 - avstring.h
 | 
			
		||||
  Add av_match_list()
 | 
			
		||||
 | 
			
		||||
2014-09-24 - ac68295 - libpostproc 53.1.100
 | 
			
		||||
  Add visualization support
 | 
			
		||||
 | 
			
		||||
2014-09-19 - 6edd6a4 - lavc 56.1.101 - dv_profile.h
 | 
			
		||||
  deprecate avpriv_dv_frame_profile2(), which was made public by accident.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
-------- 8< --------- FFmpeg 2.4 was cut here -------- 8< ---------
 | 
			
		||||
 | 
			
		||||
2014-08-25 - 215db29 / b263f8f - lavf 56.3.100 / 56.3.0 - avformat.h
 | 
			
		||||
  Add AVFormatContext.max_ts_probe.
 | 
			
		||||
 | 
			
		||||
2014-08-28 - f30a815 / 9301486 - lavc 56.1.100 / 56.1.0 - avcodec.h
 | 
			
		||||
  Add AV_PKT_DATA_STEREO3D to export container-level stereo3d information.
 | 
			
		||||
 | 
			
		||||
2014-08-25 - 215db29 / b263f8f - lavf 56.3.100 / 56.3.0 - avformat.h
 | 
			
		||||
  Add AVFormatContext.max_ts_probe.
 | 
			
		||||
 | 
			
		||||
2014-08-23 - 8fc9bd0 - lavu 54.7.100 - dict.h
 | 
			
		||||
  AV_DICT_DONT_STRDUP_KEY and AV_DICT_DONT_STRDUP_VAL arguments are now
 | 
			
		||||
  freed even on error. This is consistent with the behaviour all users
 | 
			
		||||
@@ -335,7 +148,7 @@ API changes, most recent first:
 | 
			
		||||
  Increase FF_INPUT_BUFFER_PADDING_SIZE to 32 due to some corner cases needing
 | 
			
		||||
  it
 | 
			
		||||
 | 
			
		||||
2014-06-10 - 5482780 - lavf 55.43.100 - avformat.h
 | 
			
		||||
2014-06-10 - xxxxxxx - lavf 55.43.100 - avformat.h
 | 
			
		||||
  New field int64_t max_analyze_duration2 instead of deprecated
 | 
			
		||||
  int max_analyze_duration.
 | 
			
		||||
 | 
			
		||||
@@ -359,7 +172,7 @@ API changes, most recent first:
 | 
			
		||||
  Add strict_std_compliance and related AVOptions to support experimental
 | 
			
		||||
  muxing.
 | 
			
		||||
 | 
			
		||||
2014-05-26 - 55cc60c - lavu 52.87.100 - threadmessage.h
 | 
			
		||||
2014-05-26 - xxxxxxx - lavu 52.87.100 - threadmessage.h
 | 
			
		||||
  Add thread message queue API.
 | 
			
		||||
 | 
			
		||||
2014-05-26 - c37d179 - lavf 55.41.100 - avformat.h
 | 
			
		||||
@@ -369,7 +182,7 @@ API changes, most recent first:
 | 
			
		||||
  Add av_stream_get_side_data() to access stream-level side data
 | 
			
		||||
  in the same way as av_packet_get_side_data().
 | 
			
		||||
 | 
			
		||||
2014-05-20 - 7336e39 - lavu 52.86.100 - fifo.h
 | 
			
		||||
2014-05-xx - xxxxxxx - lavu 52.86.100 - fifo.h
 | 
			
		||||
  Add av_fifo_alloc_array() function.
 | 
			
		||||
 | 
			
		||||
2014-05-19 - ef1d4ee / bddd8cb - lavu 52.85.100 / 53.15.0 - frame.h, display.h
 | 
			
		||||
@@ -388,7 +201,7 @@ API changes, most recent first:
 | 
			
		||||
  Add avcodec_free_context(). From now on it should be used for freeing
 | 
			
		||||
  AVCodecContext.
 | 
			
		||||
 | 
			
		||||
2014-05-17 - 0eec06e / 1bd0bdc - lavu 52.84.100 / 54.5.0 - time.h
 | 
			
		||||
2014-05-17 - 0eec06e - lavu 52.84.100 - time.h
 | 
			
		||||
  Add av_gettime_relative() av_gettime_relative_is_monotonic()
 | 
			
		||||
 | 
			
		||||
2014-05-15 - eacf7d6 / 0c1959b - lavf 55.38.100 / 55.17.0 - avformat.h
 | 
			
		||||
@@ -401,7 +214,7 @@ API changes, most recent first:
 | 
			
		||||
2014-05-11 - 14aef38 / 66e6c8a - lavu 52.83.100 / 53.14.0 - pixfmt.h
 | 
			
		||||
  Add AV_PIX_FMT_VDA for new-style VDA acceleration.
 | 
			
		||||
 | 
			
		||||
2014-05-07 - 351f611 - lavu 52.82.100 - fifo.h
 | 
			
		||||
2014-05-xx - xxxxxxx - lavu 52.82.100 - fifo.h
 | 
			
		||||
  Add av_fifo_freep() function.
 | 
			
		||||
 | 
			
		||||
2014-05-02 - ba52fb11 - lavu 52.81.100 - opt.h
 | 
			
		||||
@@ -423,14 +236,10 @@ API changes, most recent first:
 | 
			
		||||
  Deprecate CODEC_FLAG_INPUT_PRESERVED. Its functionality is replaced by passing
 | 
			
		||||
  reference-counted frames to encoders.
 | 
			
		||||
 | 
			
		||||
2014-04-30 - 617e866 - lavu 52.81.100 - pixdesc.h
 | 
			
		||||
  Add av_find_best_pix_fmt_of_2(), av_get_pix_fmt_loss()
 | 
			
		||||
  Deprecate avcodec_get_pix_fmt_loss(), avcodec_find_best_pix_fmt_of_2()
 | 
			
		||||
 | 
			
		||||
2014-04-29 - 1bf6396 - lavc 55.60.100 - avcodec.h
 | 
			
		||||
  Add AVCodecDescriptor.mime_types field.
 | 
			
		||||
 | 
			
		||||
2014-04-29 - b804eb4 - lavu 52.80.100 - hash.h
 | 
			
		||||
2014-04-29 - xxxxxxx - lavu 52.80.0 - hash.h
 | 
			
		||||
  Add av_hash_final_bin(), av_hash_final_hex() and av_hash_final_b64().
 | 
			
		||||
 | 
			
		||||
2014-03-07 - 8b2a130 - lavc 55.50.0 / 55.53.100 - dxva2.h
 | 
			
		||||
@@ -442,7 +251,7 @@ API changes, most recent first:
 | 
			
		||||
2014-04-17 - a8d01a7 / 0983d48 - lavu 53.12.0 / 52.77.100 - crc.h
 | 
			
		||||
  Add AV_CRC_16_ANSI_LE crc variant.
 | 
			
		||||
 | 
			
		||||
2014-04-15 - ef818d8 - lavf 55.37.101 - avformat.h
 | 
			
		||||
2014-04-XX - xxxxxxx - lavf xx.xx.1xx - avformat.h
 | 
			
		||||
  Add av_format_inject_global_side_data()
 | 
			
		||||
 | 
			
		||||
2014-04-12 - 4f698be - lavu 52.76.100 - log.h
 | 
			
		||||
@@ -522,7 +331,7 @@ API changes, most recent first:
 | 
			
		||||
2014-02-19 - f4c8d00 / 6bb8720 - lavu 52.64.101 / 53.3.1 - opt.h
 | 
			
		||||
  Deprecate unused AV_OPT_FLAG_METADATA.
 | 
			
		||||
 | 
			
		||||
2014-02-16 - 81c3f81 - lavd 55.10.100 - avdevice.h
 | 
			
		||||
2014-02-xx - xxxxxxx - lavd 55.10.100 - avdevice.h
 | 
			
		||||
  Add avdevice_list_devices() and avdevice_free_list_devices()
 | 
			
		||||
 | 
			
		||||
2014-02-16 - db3c970 - lavf 55.33.100 - avio.h
 | 
			
		||||
@@ -563,7 +372,7 @@ API changes, most recent first:
 | 
			
		||||
2014-01-19 - 1a193c4 - lavf 55.25.100 - avformat.h
 | 
			
		||||
  Add avformat_get_mov_video_tags() and avformat_get_mov_audio_tags().
 | 
			
		||||
 | 
			
		||||
2014-01-19 - 3532dd5 - lavu 52.63.100 - rational.h
 | 
			
		||||
2014-01-19 - xxxxxxx - lavu 52.63.100 - rational.h
 | 
			
		||||
  Add av_make_q() function.
 | 
			
		||||
 | 
			
		||||
2014-01-05 - 4cf4da9 / 5b4797a - lavu 52.62.100 / 53.2.0 - frame.h
 | 
			
		||||
@@ -728,9 +537,6 @@ API changes, most recent first:
 | 
			
		||||
   av_ripemd_update()
 | 
			
		||||
   av_ripemd_final()
 | 
			
		||||
 | 
			
		||||
2013-06-10 - 82ef670 - lavu 52.35.101 - hmac.h
 | 
			
		||||
  Add AV_HMAC_SHA224, AV_HMAC_SHA256, AV_HMAC_SHA384, AV_HMAC_SHA512
 | 
			
		||||
 | 
			
		||||
2013-06-04 - 30b491f / fc962d4 - lavu 52.35.100 / 52.13.0 - mem.h
 | 
			
		||||
  Add av_realloc_array and av_reallocp_array
 | 
			
		||||
 | 
			
		||||
@@ -1056,9 +862,6 @@ lavd 54.4.100 / 54.0.0, lavfi 3.5.0
 | 
			
		||||
  avresample_read() are now uint8_t** instead of void**.
 | 
			
		||||
  Libavresample is now stable.
 | 
			
		||||
 | 
			
		||||
2012-09-26 - 3ba0dab7 / 1384df64 - lavf 54.29.101 / 56.06.3 - avformat.h
 | 
			
		||||
  Add AVFormatContext.avoid_negative_ts.
 | 
			
		||||
 | 
			
		||||
2012-09-24 - 46a3595 / a42aada - lavc 54.59.100 / 54.28.0 - avcodec.h
 | 
			
		||||
  Add avcodec_free_frame(). This function must now
 | 
			
		||||
  be used for freeing an AVFrame.
 | 
			
		||||
 
 | 
			
		||||
@@ -31,7 +31,7 @@ PROJECT_NAME           = FFmpeg
 | 
			
		||||
# This could be handy for archiving the generated documentation or
 | 
			
		||||
# if some version control system is used.
 | 
			
		||||
 | 
			
		||||
PROJECT_NUMBER         = 2.8.7
 | 
			
		||||
PROJECT_NUMBER         = 2.4.6
 | 
			
		||||
 | 
			
		||||
# With the PROJECT_LOGO tag one can specify a logo or icon that is included
 | 
			
		||||
# in the documentation. The maximum height of the logo should not exceed 55
 | 
			
		||||
 
 | 
			
		||||
@@ -36,7 +36,6 @@ DOCS-$(CONFIG_MANPAGES)  += $(MANPAGES)
 | 
			
		||||
DOCS-$(CONFIG_TXTPAGES)  += $(TXTPAGES)
 | 
			
		||||
DOCS = $(DOCS-yes)
 | 
			
		||||
 | 
			
		||||
DOC_EXAMPLES-$(CONFIG_AVIO_DIR_CMD_EXAMPLE)      += avio_dir_cmd
 | 
			
		||||
DOC_EXAMPLES-$(CONFIG_AVIO_READING_EXAMPLE)      += avio_reading
 | 
			
		||||
DOC_EXAMPLES-$(CONFIG_AVCODEC_EXAMPLE)           += avcodec
 | 
			
		||||
DOC_EXAMPLES-$(CONFIG_DECODING_ENCODING_EXAMPLE) += decoding_encoding
 | 
			
		||||
@@ -47,7 +46,6 @@ DOC_EXAMPLES-$(CONFIG_FILTERING_AUDIO_EXAMPLE)   += filtering_audio
 | 
			
		||||
DOC_EXAMPLES-$(CONFIG_FILTERING_VIDEO_EXAMPLE)   += filtering_video
 | 
			
		||||
DOC_EXAMPLES-$(CONFIG_METADATA_EXAMPLE)          += metadata
 | 
			
		||||
DOC_EXAMPLES-$(CONFIG_MUXING_EXAMPLE)            += muxing
 | 
			
		||||
DOC_EXAMPLES-$(CONFIG_QSVDEC_EXAMPLE)            += qsvdec
 | 
			
		||||
DOC_EXAMPLES-$(CONFIG_REMUXING_EXAMPLE)          += remuxing
 | 
			
		||||
DOC_EXAMPLES-$(CONFIG_RESAMPLING_AUDIO_EXAMPLE)  += resampling_audio
 | 
			
		||||
DOC_EXAMPLES-$(CONFIG_SCALING_VIDEO_EXAMPLE)     += scaling_video
 | 
			
		||||
@@ -116,9 +114,9 @@ doc/%-all.pod: doc/%.texi $(SRC_PATH)/doc/texi2pod.pl $(GENTEXI)
 | 
			
		||||
 | 
			
		||||
doc/%.1 doc/%.3: TAG = MAN
 | 
			
		||||
doc/%.1: doc/%.pod $(GENTEXI)
 | 
			
		||||
	$(M)pod2man --section=1 --center=" " --release=" " --date=" " $< > $@
 | 
			
		||||
	$(M)pod2man --section=1 --center=" " --release=" " $< > $@
 | 
			
		||||
doc/%.3: doc/%.pod $(GENTEXI)
 | 
			
		||||
	$(M)pod2man --section=3 --center=" " --release=" " --date=" " $< > $@
 | 
			
		||||
	$(M)pod2man --section=3 --center=" " --release=" " $< > $@
 | 
			
		||||
 | 
			
		||||
$(DOCS) doc/doxy/html: | doc/
 | 
			
		||||
$(DOC_EXAMPLES:%$(EXESUF)=%.o): | doc/examples
 | 
			
		||||
 
 | 
			
		||||
@@ -13,16 +13,7 @@ bitstream filter using the option @code{--disable-bsf=BSF}.
 | 
			
		||||
The option @code{-bsfs} of the ff* tools will display the list of
 | 
			
		||||
all the supported bitstream filters included in your build.
 | 
			
		||||
 | 
			
		||||
The ff* tools have a -bsf option applied per stream, taking a
 | 
			
		||||
comma-separated list of filters, whose parameters follow the filter
 | 
			
		||||
name after a '='.
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i INPUT -c:v copy -bsf:v filter1[=opt1=str1/opt2=str2][,filter2] OUTPUT
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Below is a description of the currently available bitstream filters,
 | 
			
		||||
with their parameters, if any.
 | 
			
		||||
Below is a description of the currently available bitstream filters.
 | 
			
		||||
 | 
			
		||||
@section aac_adtstoasc
 | 
			
		||||
 | 
			
		||||
@@ -139,41 +130,14 @@ ffmpeg -i frame_%d.jpg -c:v copy rotated.avi
 | 
			
		||||
 | 
			
		||||
@section mp3_header_decompress
 | 
			
		||||
 | 
			
		||||
@section mpeg4_unpack_bframes
 | 
			
		||||
 | 
			
		||||
Unpack DivX-style packed B-frames.
 | 
			
		||||
 | 
			
		||||
DivX-style packed B-frames are not valid MPEG-4 and were only a
 | 
			
		||||
workaround for the broken Video for Windows subsystem.
 | 
			
		||||
They use more space, can cause minor AV sync issues, require more
 | 
			
		||||
CPU power to decode (unless the player has some decoded picture queue
 | 
			
		||||
to compensate the 2,0,2,0 frame per packet style) and cause
 | 
			
		||||
trouble if copied into a standard container like mp4 or mpeg-ps/ts,
 | 
			
		||||
because MPEG-4 decoders may not be able to decode them, since they are
 | 
			
		||||
not valid MPEG-4.
 | 
			
		||||
 | 
			
		||||
For example to fix an AVI file containing an MPEG-4 stream with
 | 
			
		||||
DivX-style packed B-frames using @command{ffmpeg}, you can use the command:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i INPUT.avi -codec copy -bsf:v mpeg4_unpack_bframes OUTPUT.avi
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@section noise
 | 
			
		||||
 | 
			
		||||
Damages the contents of packets without damaging the container. Can be
 | 
			
		||||
used for fuzzing or testing error resilience/concealment.
 | 
			
		||||
 | 
			
		||||
Parameters:
 | 
			
		||||
A numeral string, whose value is related to how often output bytes will
 | 
			
		||||
be modified. Therefore, values below or equal to 0 are forbidden, and
 | 
			
		||||
the lower the more frequent bytes will be modified, with 1 meaning
 | 
			
		||||
every byte is modified.
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i INPUT -c copy -bsf noise[=1] output.mkv
 | 
			
		||||
ffmpeg -i INPUT -c copy -bsf noise output.mkv
 | 
			
		||||
@end example
 | 
			
		||||
applies the modification to every byte.
 | 
			
		||||
 | 
			
		||||
@section remove_extra
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -7,18 +7,10 @@ V
 | 
			
		||||
    Disable the default terse mode, the full command issued by make and its
 | 
			
		||||
    output will be shown on the screen.
 | 
			
		||||
 | 
			
		||||
DBG
 | 
			
		||||
    Preprocess x86 external assembler files to a .dbg.asm file in the object
 | 
			
		||||
    directory, which then gets compiled. Helps developping those assembler
 | 
			
		||||
    files.
 | 
			
		||||
 | 
			
		||||
DESTDIR
 | 
			
		||||
    Destination directory for the install targets, useful to prepare packages
 | 
			
		||||
    or install FFmpeg in cross-environments.
 | 
			
		||||
 | 
			
		||||
GEN
 | 
			
		||||
    Set to ‘1’ to generate the missing or mismatched references.
 | 
			
		||||
 | 
			
		||||
Makefile targets:
 | 
			
		||||
 | 
			
		||||
all
 | 
			
		||||
 
 | 
			
		||||
@@ -7,7 +7,7 @@ all the encoders and decoders. In addition each codec may support
 | 
			
		||||
so-called private options, which are specific for a given codec.
 | 
			
		||||
 | 
			
		||||
Sometimes, a global option may only affect a specific kind of codec,
 | 
			
		||||
and may be nonsensical or ignored by another, so you need to be aware
 | 
			
		||||
and may be unsensical or ignored by another, so you need to be aware
 | 
			
		||||
of the meaning of the specified options. Also some options are
 | 
			
		||||
meant only for decoding or encoding.
 | 
			
		||||
 | 
			
		||||
@@ -71,9 +71,7 @@ Force low delay.
 | 
			
		||||
@item global_header
 | 
			
		||||
Place global headers in extradata instead of every keyframe.
 | 
			
		||||
@item bitexact
 | 
			
		||||
Only write platform-, build- and time-independent data. (except (I)DCT).
 | 
			
		||||
This ensures that file and data checksums are reproducible and match between
 | 
			
		||||
platforms. Its primary use is for regression testing.
 | 
			
		||||
Use only bitexact stuff (except (I)DCT).
 | 
			
		||||
@item aic
 | 
			
		||||
Apply H263 advanced intra coding / mpeg4 ac prediction.
 | 
			
		||||
@item cbp
 | 
			
		||||
@@ -475,9 +473,6 @@ per-block quantization parameter (QP)
 | 
			
		||||
motion vector
 | 
			
		||||
@item dct_coeff
 | 
			
		||||
 | 
			
		||||
@item green_metadata
 | 
			
		||||
display complexity metadata for the upcoming frame, GoP or for a given duration.
 | 
			
		||||
 | 
			
		||||
@item skip
 | 
			
		||||
 | 
			
		||||
@item startcode
 | 
			
		||||
@@ -498,8 +493,6 @@ visualize block types
 | 
			
		||||
picture buffer allocations
 | 
			
		||||
@item thread_ops
 | 
			
		||||
threading operations
 | 
			
		||||
@item nomc
 | 
			
		||||
skip motion compensation
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@item vismv @var{integer} (@emph{decoding,video})
 | 
			
		||||
@@ -868,14 +861,6 @@ Possible values:
 | 
			
		||||
 | 
			
		||||
@item mpeg2_aac_he
 | 
			
		||||
 | 
			
		||||
@item mpeg4_sp
 | 
			
		||||
 | 
			
		||||
@item mpeg4_core
 | 
			
		||||
 | 
			
		||||
@item mpeg4_main
 | 
			
		||||
 | 
			
		||||
@item mpeg4_asp
 | 
			
		||||
 | 
			
		||||
@item dts
 | 
			
		||||
 | 
			
		||||
@item dts_es
 | 
			
		||||
@@ -1045,11 +1030,7 @@ Possible values:
 | 
			
		||||
@item color_primaries @var{integer} (@emph{decoding/encoding,video})
 | 
			
		||||
@item color_trc @var{integer} (@emph{decoding/encoding,video})
 | 
			
		||||
@item colorspace @var{integer} (@emph{decoding/encoding,video})
 | 
			
		||||
 | 
			
		||||
@item color_range @var{integer} (@emph{decoding/encoding,video})
 | 
			
		||||
If used as input parameter, it serves as a hint to the decoder, which
 | 
			
		||||
color_range the input has.
 | 
			
		||||
 | 
			
		||||
@item chroma_sample_location @var{integer} (@emph{decoding/encoding,video})
 | 
			
		||||
 | 
			
		||||
@item log_level_offset @var{integer}
 | 
			
		||||
@@ -1133,19 +1114,6 @@ Interlaced video, bottom coded first, top displayed first
 | 
			
		||||
Set to 1 to disable processing alpha (transparency). This works like the
 | 
			
		||||
@samp{gray} flag in the @option{flags} option which skips chroma information
 | 
			
		||||
instead of alpha. Default is 0.
 | 
			
		||||
 | 
			
		||||
@item codec_whitelist @var{list} (@emph{input})
 | 
			
		||||
"," separated List of allowed decoders. By default all are allowed.
 | 
			
		||||
 | 
			
		||||
@item dump_separator @var{string} (@emph{input})
 | 
			
		||||
Separator used to separate the fields printed on the command line about the
 | 
			
		||||
Stream parameters.
 | 
			
		||||
For example to separate the fields with newlines and indention:
 | 
			
		||||
@example
 | 
			
		||||
ffprobe -dump_separator "
 | 
			
		||||
                          "  -i ~/videos/matrixbench_mpeg2.mpg
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@c man end CODEC OPTIONS
 | 
			
		||||
 
 | 
			
		||||
@@ -25,13 +25,6 @@ enabled decoders.
 | 
			
		||||
A description of some of the currently available video decoders
 | 
			
		||||
follows.
 | 
			
		||||
 | 
			
		||||
@section hevc
 | 
			
		||||
 | 
			
		||||
HEVC / H.265 decoder.
 | 
			
		||||
 | 
			
		||||
Note: the @option{skip_loop_filter} option has effect only at level
 | 
			
		||||
@code{all}.
 | 
			
		||||
 | 
			
		||||
@section rawvideo
 | 
			
		||||
 | 
			
		||||
Raw video decoder.
 | 
			
		||||
@@ -90,23 +83,6 @@ Loud sounds are fully compressed.  Soft sounds are enhanced.
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section flac
 | 
			
		||||
 | 
			
		||||
FLAC audio decoder.
 | 
			
		||||
 | 
			
		||||
This decoder aims to implement the complete FLAC specification from Xiph.
 | 
			
		||||
 | 
			
		||||
@subsection FLAC Decoder options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item -use_buggy_lpc
 | 
			
		||||
The lavc FLAC encoder used to produce buggy streams with high lpc values
 | 
			
		||||
(like the default value). This option makes it possible to decode such streams
 | 
			
		||||
correctly by using lavc's old buggy lpc logic for decoding.
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section ffwavesynth
 | 
			
		||||
 | 
			
		||||
Internal wave synthetizer.
 | 
			
		||||
@@ -195,25 +171,6 @@ without this library.
 | 
			
		||||
@chapter Subtitles Decoders
 | 
			
		||||
@c man begin SUBTILES DECODERS
 | 
			
		||||
 | 
			
		||||
@section dvbsub
 | 
			
		||||
 | 
			
		||||
@subsection Options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
@item compute_clut
 | 
			
		||||
@table @option
 | 
			
		||||
@item -1
 | 
			
		||||
Compute clut if no matching CLUT is in the stream.
 | 
			
		||||
@item 0
 | 
			
		||||
Never compute CLUT
 | 
			
		||||
@item 1
 | 
			
		||||
Always compute CLUT and override the one provided in the stream.
 | 
			
		||||
@end table
 | 
			
		||||
@item dvb_substream
 | 
			
		||||
Selects the dvb substream, or all substreams if -1 which is default.
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section dvdsub
 | 
			
		||||
 | 
			
		||||
This codec decodes the bitmap subtitles used in DVDs; the same subtitles can
 | 
			
		||||
@@ -233,15 +190,6 @@ The format for this option is a string containing 16 24-bits hexadecimal
 | 
			
		||||
numbers (without 0x prefix) separated by comas, for example @code{0d00ee,
 | 
			
		||||
ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1,
 | 
			
		||||
7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b}.
 | 
			
		||||
 | 
			
		||||
@item ifo_palette
 | 
			
		||||
Specify the IFO file from which the global palette is obtained.
 | 
			
		||||
(experimental)
 | 
			
		||||
 | 
			
		||||
@item forced_subs_only
 | 
			
		||||
Only decode subtitle entries marked as forced. Some titles have forced
 | 
			
		||||
and non-forced subtitles in the same track. Setting this flag to @code{1}
 | 
			
		||||
will only keep the forced subtitles. Default value is @code{0}.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section libzvbi-teletext
 | 
			
		||||
 
 | 
			
		||||
@@ -18,12 +18,6 @@ enabled demuxers.
 | 
			
		||||
 | 
			
		||||
The description of some of the currently available demuxers follows.
 | 
			
		||||
 | 
			
		||||
@section aa
 | 
			
		||||
 | 
			
		||||
Audible Format 2, 3, and 4 demuxer.
 | 
			
		||||
 | 
			
		||||
This demuxer is used to demux Audible Format 2, 3, and 4 (.aa) files.
 | 
			
		||||
 | 
			
		||||
@section applehttp
 | 
			
		||||
 | 
			
		||||
Apple HTTP Live Streaming demuxer.
 | 
			
		||||
@@ -35,26 +29,6 @@ the caller can decide which variant streams to actually receive.
 | 
			
		||||
The total bitrate of the variant that the stream belongs to is
 | 
			
		||||
available in a metadata key named "variant_bitrate".
 | 
			
		||||
 | 
			
		||||
@section apng
 | 
			
		||||
 | 
			
		||||
Animated Portable Network Graphics demuxer.
 | 
			
		||||
 | 
			
		||||
This demuxer is used to demux APNG files.
 | 
			
		||||
All headers, but the PNG signature, up to (but not including) the first
 | 
			
		||||
fcTL chunk are transmitted as extradata.
 | 
			
		||||
Frames are then split as being all the chunks between two fcTL ones, or
 | 
			
		||||
between the last fcTL and IEND chunks.
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
@item -ignore_loop @var{bool}
 | 
			
		||||
Ignore the loop variable in the file if set.
 | 
			
		||||
@item -max_fps @var{int}
 | 
			
		||||
Maximum framerate in frames per second (0 for no limit).
 | 
			
		||||
@item -default_fps @var{int}
 | 
			
		||||
Default framerate in frames per second when none is specified in the file
 | 
			
		||||
(0 meaning as fast as possible).
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section asf
 | 
			
		||||
 | 
			
		||||
Advanced Systems Format demuxer.
 | 
			
		||||
@@ -104,7 +78,7 @@ All subsequent file-related directives apply to that file.
 | 
			
		||||
 | 
			
		||||
@item @code{ffconcat version 1.0}
 | 
			
		||||
Identify the script type and version. It also sets the @option{safe} option
 | 
			
		||||
to 1 if it was -1.
 | 
			
		||||
to 1 if it was to its default -1.
 | 
			
		||||
 | 
			
		||||
To make FFmpeg recognize the format automatically, this directive must
 | 
			
		||||
appears exactly as is (no extra space or byte-order-mark) on the very first
 | 
			
		||||
@@ -118,47 +92,6 @@ file is not available or accurate.
 | 
			
		||||
If the duration is set for all files, then it is possible to seek in the
 | 
			
		||||
whole concatenated video.
 | 
			
		||||
 | 
			
		||||
@item @code{inpoint @var{timestamp}}
 | 
			
		||||
In point of the file. When the demuxer opens the file it instantly seeks to the
 | 
			
		||||
specified timestamp. Seeking is done so that all streams can be presented
 | 
			
		||||
successfully at In point.
 | 
			
		||||
 | 
			
		||||
This directive works best with intra frame codecs, because for non-intra frame
 | 
			
		||||
ones you will usually get extra packets before the actual In point and the
 | 
			
		||||
decoded content will most likely contain frames before In point too.
 | 
			
		||||
 | 
			
		||||
For each file, packets before the file In point will have timestamps less than
 | 
			
		||||
the calculated start timestamp of the file (negative in case of the first
 | 
			
		||||
file), and the duration of the files (if not specified by the @code{duration}
 | 
			
		||||
directive) will be reduced based on their specified In point.
 | 
			
		||||
 | 
			
		||||
Because of potential packets before the specified In point, packet timestamps
 | 
			
		||||
may overlap between two concatenated files.
 | 
			
		||||
 | 
			
		||||
@item @code{outpoint @var{timestamp}}
 | 
			
		||||
Out point of the file. When the demuxer reaches the specified decoding
 | 
			
		||||
timestamp in any of the streams, it handles it as an end of file condition and
 | 
			
		||||
skips the current and all the remaining packets from all streams.
 | 
			
		||||
 | 
			
		||||
Out point is exclusive, which means that the demuxer will not output packets
 | 
			
		||||
with a decoding timestamp greater or equal to Out point.
 | 
			
		||||
 | 
			
		||||
This directive works best with intra frame codecs and formats where all streams
 | 
			
		||||
are tightly interleaved. For non-intra frame codecs you will usually get
 | 
			
		||||
additional packets with presentation timestamp after Out point therefore the
 | 
			
		||||
decoded content will most likely contain frames after Out point too. If your
 | 
			
		||||
streams are not tightly interleaved you may not get all the packets from all
 | 
			
		||||
streams before Out point and you may only will be able to decode the earliest
 | 
			
		||||
stream until Out point.
 | 
			
		||||
 | 
			
		||||
The duration of the files (if not specified by the @code{duration}
 | 
			
		||||
directive) will be reduced based on their specified Out point.
 | 
			
		||||
 | 
			
		||||
@item @code{file_packet_metadata @var{key=value}}
 | 
			
		||||
Metadata of the packets of the file. The specified metadata will be set for
 | 
			
		||||
each file packet. You can specify this directive multiple times to add multiple
 | 
			
		||||
metadata entries.
 | 
			
		||||
 | 
			
		||||
@item @code{stream}
 | 
			
		||||
Introduce a stream in the virtual file.
 | 
			
		||||
All subsequent stream-related directives apply to the last introduced
 | 
			
		||||
@@ -192,15 +125,12 @@ component.
 | 
			
		||||
 | 
			
		||||
If set to 0, any file name is accepted.
 | 
			
		||||
 | 
			
		||||
The default is 1.
 | 
			
		||||
 | 
			
		||||
-1 is equivalent to 1 if the format was automatically
 | 
			
		||||
The default is -1, it is equivalent to 1 if the format was automatically
 | 
			
		||||
probed and 0 otherwise.
 | 
			
		||||
 | 
			
		||||
@item auto_convert
 | 
			
		||||
If set to 1, try to perform automatic conversions on packet data to make the
 | 
			
		||||
streams concatenable.
 | 
			
		||||
The default is 1.
 | 
			
		||||
 | 
			
		||||
Currently, the only conversion is adding the h264_mp4toannexb bitstream
 | 
			
		||||
filter to H.264 streams in MP4 format. This is necessary in particular if
 | 
			
		||||
@@ -255,11 +185,6 @@ It accepts the following options:
 | 
			
		||||
Set the minimum valid delay between frames in hundredths of seconds.
 | 
			
		||||
Range is 0 to 6000. Default value is 2.
 | 
			
		||||
 | 
			
		||||
@item max_gif_delay
 | 
			
		||||
Set the maximum valid delay between frames in hundredth of seconds.
 | 
			
		||||
Range is 0 to 65535. Default value is 65535 (nearly eleven minutes),
 | 
			
		||||
the maximum value allowed by the specification.
 | 
			
		||||
 | 
			
		||||
@item default_delay
 | 
			
		||||
Set the default delay between frames in hundredths of seconds.
 | 
			
		||||
Range is 0 to 6000. Default value is 10.
 | 
			
		||||
@@ -308,10 +233,6 @@ Select the pattern type used to interpret the provided filename.
 | 
			
		||||
 | 
			
		||||
@var{pattern_type} accepts one of the following values.
 | 
			
		||||
@table @option
 | 
			
		||||
@item none
 | 
			
		||||
Disable pattern matching, therefore the video will only contain the specified
 | 
			
		||||
image. You should use this option if you do not want to create sequences from
 | 
			
		||||
multiple images and your filenames may contain special pattern characters.
 | 
			
		||||
@item sequence
 | 
			
		||||
Select a sequence pattern type, used to specify a sequence of files
 | 
			
		||||
indexed by sequential numbers.
 | 
			
		||||
@@ -418,47 +339,17 @@ ffmpeg -framerate 10 -pattern_type glob -i "*.png" out.mkv
 | 
			
		||||
@end example
 | 
			
		||||
@end itemize
 | 
			
		||||
 | 
			
		||||
@section mov/mp4/3gp/Quicktme
 | 
			
		||||
 | 
			
		||||
Quicktime / MP4 demuxer.
 | 
			
		||||
 | 
			
		||||
This demuxer accepts the following options:
 | 
			
		||||
@table @option
 | 
			
		||||
@item enable_drefs
 | 
			
		||||
Enable loading of external tracks, disabled by default.
 | 
			
		||||
Enabling this can theoretically leak information in some use cases.
 | 
			
		||||
 | 
			
		||||
@item use_absolute_path
 | 
			
		||||
Allows loading of external tracks via absolute paths, disabled by default.
 | 
			
		||||
Enabling this poses a security risk. It should only be enabled if the source
 | 
			
		||||
is known to be non malicious.
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section mpegts
 | 
			
		||||
 | 
			
		||||
MPEG-2 transport stream demuxer.
 | 
			
		||||
 | 
			
		||||
This demuxer accepts the following options:
 | 
			
		||||
@table @option
 | 
			
		||||
@item resync_size
 | 
			
		||||
Set size limit for looking up a new synchronization. Default value is
 | 
			
		||||
65536.
 | 
			
		||||
 | 
			
		||||
@item fix_teletext_pts
 | 
			
		||||
Override teletext packet PTS and DTS values with the timestamps calculated
 | 
			
		||||
Overrides teletext packet PTS and DTS values with the timestamps calculated
 | 
			
		||||
from the PCR of the first program which the teletext stream is part of and is
 | 
			
		||||
not discarded. Default value is 1, set this option to 0 if you want your
 | 
			
		||||
teletext packet PTS and DTS values untouched.
 | 
			
		||||
 | 
			
		||||
@item ts_packetsize
 | 
			
		||||
Output option carrying the raw packet size in bytes.
 | 
			
		||||
Show the detected raw packet size, cannot be set by the user.
 | 
			
		||||
 | 
			
		||||
@item scan_all_pmts
 | 
			
		||||
Scan and combine all PMTs. The value is an integer with value from -1
 | 
			
		||||
to 1 (-1 means automatic setting, 1 means enabled, 0 means
 | 
			
		||||
disabled). Default value is -1.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section rawvideo
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,4 @@
 | 
			
		||||
\input texinfo @c -*- texinfo -*-
 | 
			
		||||
@documentencoding UTF-8
 | 
			
		||||
 | 
			
		||||
@settitle Developer Documentation
 | 
			
		||||
@titlepage
 | 
			
		||||
@@ -228,7 +227,7 @@ autocmd InsertEnter * match ForbiddenWhitespace /\t\|\s\+\%#\@@<!$/
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
For Emacs, add these roughly equivalent lines to your @file{.emacs.d/init.el}:
 | 
			
		||||
@lisp
 | 
			
		||||
@example
 | 
			
		||||
(c-add-style "ffmpeg"
 | 
			
		||||
             '("k&r"
 | 
			
		||||
               (c-basic-offset . 4)
 | 
			
		||||
@@ -239,7 +238,7 @@ For Emacs, add these roughly equivalent lines to your @file{.emacs.d/init.el}:
 | 
			
		||||
               )
 | 
			
		||||
             )
 | 
			
		||||
(setq c-default-style "ffmpeg")
 | 
			
		||||
@end lisp
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@section Development Policy
 | 
			
		||||
 | 
			
		||||
@@ -543,10 +542,6 @@ tools/trasher, the noise bitstream filter, and
 | 
			
		||||
should not crash, end in a (near) infinite loop, or allocate ridiculous
 | 
			
		||||
amounts of memory when fed damaged data.
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
Did you test your decoder or demuxer against sample files?
 | 
			
		||||
Samples may be obtained at @url{http://samples.ffmpeg.org}.
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
Does the patch not mix functional and cosmetic changes?
 | 
			
		||||
 | 
			
		||||
@@ -637,10 +632,6 @@ not related to the comments received during review. Such patches will
 | 
			
		||||
be rejected. Instead, submit significant changes or new features as
 | 
			
		||||
separate patches.
 | 
			
		||||
 | 
			
		||||
Everyone is welcome to review patches. Also if you are waiting for your patch
 | 
			
		||||
to be reviewed, please consider helping to review other patches, that is a great
 | 
			
		||||
way to get everyone's patches reviewed sooner.
 | 
			
		||||
 | 
			
		||||
@anchor{Regression tests}
 | 
			
		||||
@section Regression tests
 | 
			
		||||
 | 
			
		||||
@@ -656,12 +647,12 @@ accordingly].
 | 
			
		||||
@subsection Adding files to the fate-suite dataset
 | 
			
		||||
 | 
			
		||||
When there is no muxer or encoder available to generate test media for a
 | 
			
		||||
specific test then the media has to be included in the fate-suite.
 | 
			
		||||
specific test then the media has to be inlcuded in the fate-suite.
 | 
			
		||||
First please make sure that the sample file is as small as possible to test the
 | 
			
		||||
respective decoder or demuxer sufficiently. Large files increase network
 | 
			
		||||
bandwidth and disk space requirements.
 | 
			
		||||
Once you have a working fate test and fate sample, provide in the commit
 | 
			
		||||
message or introductory message for the patch series that you post to
 | 
			
		||||
message or introductionary message for the patch series that you post to
 | 
			
		||||
the ffmpeg-devel mailing list, a direct link to download the sample media.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -6,16 +6,8 @@ DOXYGEN="${3}"
 | 
			
		||||
 | 
			
		||||
shift 3
 | 
			
		||||
 | 
			
		||||
if [ -e "$SRC_PATH/VERSION" ]; then
 | 
			
		||||
    VERSION=`cat "$SRC_PATH/VERSION"`
 | 
			
		||||
else
 | 
			
		||||
    VERSION=`cd "$SRC_PATH"; git describe`
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
$DOXYGEN - <<EOF
 | 
			
		||||
@INCLUDE        = ${DOXYFILE}
 | 
			
		||||
INPUT           = $@
 | 
			
		||||
EXAMPLE_PATH    = ${SRC_PATH}/doc/examples
 | 
			
		||||
HTML_TIMESTAMP  = NO
 | 
			
		||||
PROJECT_NUMBER  = $VERSION
 | 
			
		||||
EOF
 | 
			
		||||
 
 | 
			
		||||
@@ -494,85 +494,6 @@ Selected by Encoder (default)
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@anchor{flac}
 | 
			
		||||
@section flac
 | 
			
		||||
 | 
			
		||||
FLAC (Free Lossless Audio Codec) Encoder
 | 
			
		||||
 | 
			
		||||
@subsection Options
 | 
			
		||||
 | 
			
		||||
The following options are supported by FFmpeg's flac encoder.
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
@item compression_level
 | 
			
		||||
Sets the compression level, which chooses defaults for many other options
 | 
			
		||||
if they are not set explicitly.
 | 
			
		||||
 | 
			
		||||
@item frame_size
 | 
			
		||||
Sets the size of the frames in samples per channel.
 | 
			
		||||
 | 
			
		||||
@item lpc_coeff_precision
 | 
			
		||||
Sets the LPC coefficient precision, valid values are from 1 to 15, 15 is the
 | 
			
		||||
default.
 | 
			
		||||
 | 
			
		||||
@item lpc_type
 | 
			
		||||
Sets the first stage LPC algorithm
 | 
			
		||||
@table @samp
 | 
			
		||||
@item none
 | 
			
		||||
LPC is not used
 | 
			
		||||
 | 
			
		||||
@item fixed
 | 
			
		||||
fixed LPC coefficients
 | 
			
		||||
 | 
			
		||||
@item levinson
 | 
			
		||||
 | 
			
		||||
@item cholesky
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@item lpc_passes
 | 
			
		||||
Number of passes to use for Cholesky factorization during LPC analysis
 | 
			
		||||
 | 
			
		||||
@item min_partition_order
 | 
			
		||||
The minimum partition order
 | 
			
		||||
 | 
			
		||||
@item max_partition_order
 | 
			
		||||
The maximum partition order
 | 
			
		||||
 | 
			
		||||
@item prediction_order_method
 | 
			
		||||
@table @samp
 | 
			
		||||
@item estimation
 | 
			
		||||
@item 2level
 | 
			
		||||
@item 4level
 | 
			
		||||
@item 8level
 | 
			
		||||
@item search
 | 
			
		||||
Bruteforce search
 | 
			
		||||
@item log
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@item ch_mode
 | 
			
		||||
Channel mode
 | 
			
		||||
@table @samp
 | 
			
		||||
@item auto
 | 
			
		||||
The mode is chosen automatically for each frame
 | 
			
		||||
@item indep
 | 
			
		||||
Chanels are independently coded
 | 
			
		||||
@item left_side
 | 
			
		||||
@item right_side
 | 
			
		||||
@item mid_side
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@item exact_rice_parameters
 | 
			
		||||
Chooses if rice parameters are calculated exactly or approximately.
 | 
			
		||||
if set to 1 then they are chosen exactly, which slows the code down slightly and
 | 
			
		||||
improves compression slightly.
 | 
			
		||||
 | 
			
		||||
@item multi_dim_quant
 | 
			
		||||
Multi Dimensional Quantization. If set to 1 then a 2nd stage LPC algorithm is
 | 
			
		||||
applied after the first stage to finetune the coefficients. This is quite slow
 | 
			
		||||
and slightly improves compression.
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@anchor{libfaac}
 | 
			
		||||
@section libfaac
 | 
			
		||||
 | 
			
		||||
@@ -1342,30 +1263,6 @@ disabled
 | 
			
		||||
A description of some of the currently available video encoders
 | 
			
		||||
follows.
 | 
			
		||||
 | 
			
		||||
@section jpeg2000
 | 
			
		||||
 | 
			
		||||
The native jpeg 2000 encoder is lossy by default, the @code{-q:v}
 | 
			
		||||
option can be used to set the encoding quality. Lossless encoding
 | 
			
		||||
can be selected with @code{-pred 1}.
 | 
			
		||||
 | 
			
		||||
@subsection Options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
@item format
 | 
			
		||||
Can be set to either @code{j2k} or @code{jp2} (the default) that
 | 
			
		||||
makes it possible to store non-rgb pix_fmts.
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section snow
 | 
			
		||||
 | 
			
		||||
@subsection Options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
@item iterative_dia_size
 | 
			
		||||
dia size for the iterative motion estimation
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section libtheora
 | 
			
		||||
 | 
			
		||||
libtheora Theora encoder wrapper.
 | 
			
		||||
@@ -1440,153 +1337,113 @@ You need to explicitly configure the build with @code{--enable-libvpx}.
 | 
			
		||||
 | 
			
		||||
@subsection Options
 | 
			
		||||
 | 
			
		||||
The following options are supported by the libvpx wrapper. The
 | 
			
		||||
@command{vpxenc}-equivalent options or values are listed in parentheses
 | 
			
		||||
for easy migration.
 | 
			
		||||
 | 
			
		||||
To reduce the duplication of documentation, only the private options
 | 
			
		||||
and some others requiring special attention are documented here. For
 | 
			
		||||
the documentation of the undocumented generic options, see
 | 
			
		||||
@ref{codec-options,,the Codec Options chapter}.
 | 
			
		||||
 | 
			
		||||
To get more documentation of the libvpx options, invoke the command
 | 
			
		||||
@command{ffmpeg -h encoder=libvpx}, @command{ffmpeg -h encoder=libvpx-vp9} or
 | 
			
		||||
@command{vpxenc --help}. Further information is available in the libvpx API
 | 
			
		||||
documentation.
 | 
			
		||||
Mapping from FFmpeg to libvpx options with conversion notes in parentheses.
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item b (@emph{target-bitrate})
 | 
			
		||||
Set bitrate in bits/s. Note that FFmpeg's @option{b} option is
 | 
			
		||||
expressed in bits/s, while @command{vpxenc}'s @option{target-bitrate} is in
 | 
			
		||||
kilobits/s.
 | 
			
		||||
@item threads
 | 
			
		||||
g_threads
 | 
			
		||||
 | 
			
		||||
@item g (@emph{kf-max-dist})
 | 
			
		||||
@item profile
 | 
			
		||||
g_profile
 | 
			
		||||
 | 
			
		||||
@item keyint_min (@emph{kf-min-dist})
 | 
			
		||||
@item vb
 | 
			
		||||
rc_target_bitrate
 | 
			
		||||
 | 
			
		||||
@item qmin (@emph{min-q})
 | 
			
		||||
@item g
 | 
			
		||||
kf_max_dist
 | 
			
		||||
 | 
			
		||||
@item qmax (@emph{max-q})
 | 
			
		||||
@item keyint_min
 | 
			
		||||
kf_min_dist
 | 
			
		||||
 | 
			
		||||
@item bufsize (@emph{buf-sz}, @emph{buf-optimal-sz})
 | 
			
		||||
Set ratecontrol buffer size (in bits). Note @command{vpxenc}'s options are
 | 
			
		||||
specified in milliseconds, the libvpx wrapper converts this value as follows:
 | 
			
		||||
@code{buf-sz = bufsize * 1000 / bitrate},
 | 
			
		||||
@code{buf-optimal-sz = bufsize * 1000 / bitrate * 5 / 6}.
 | 
			
		||||
@item qmin
 | 
			
		||||
rc_min_quantizer
 | 
			
		||||
 | 
			
		||||
@item rc_init_occupancy (@emph{buf-initial-sz})
 | 
			
		||||
Set number of bits which should be loaded into the rc buffer before decoding
 | 
			
		||||
starts. Note @command{vpxenc}'s option is specified in milliseconds, the libvpx
 | 
			
		||||
wrapper converts this value as follows:
 | 
			
		||||
@code{rc_init_occupancy * 1000 / bitrate}.
 | 
			
		||||
@item qmax
 | 
			
		||||
rc_max_quantizer
 | 
			
		||||
 | 
			
		||||
@item undershoot-pct
 | 
			
		||||
Set datarate undershoot (min) percentage of the target bitrate.
 | 
			
		||||
@item bufsize, vb
 | 
			
		||||
rc_buf_sz
 | 
			
		||||
@code{(bufsize * 1000 / vb)}
 | 
			
		||||
 | 
			
		||||
@item overshoot-pct
 | 
			
		||||
Set datarate overshoot (max) percentage of the target bitrate.
 | 
			
		||||
rc_buf_optimal_sz
 | 
			
		||||
@code{(bufsize * 1000 / vb * 5 / 6)}
 | 
			
		||||
 | 
			
		||||
@item skip_threshold (@emph{drop-frame})
 | 
			
		||||
@item rc_init_occupancy, vb
 | 
			
		||||
rc_buf_initial_sz
 | 
			
		||||
@code{(rc_init_occupancy * 1000 / vb)}
 | 
			
		||||
 | 
			
		||||
@item qcomp (@emph{bias-pct})
 | 
			
		||||
@item rc_buffer_aggressivity
 | 
			
		||||
rc_undershoot_pct
 | 
			
		||||
 | 
			
		||||
@item maxrate (@emph{maxsection-pct})
 | 
			
		||||
Set GOP max bitrate in bits/s. Note @command{vpxenc}'s option is specified as a
 | 
			
		||||
percentage of the target bitrate, the libvpx wrapper converts this value as
 | 
			
		||||
follows: @code{(maxrate * 100 / bitrate)}.
 | 
			
		||||
@item skip_threshold
 | 
			
		||||
rc_dropframe_thresh
 | 
			
		||||
 | 
			
		||||
@item minrate (@emph{minsection-pct})
 | 
			
		||||
Set GOP min bitrate in bits/s. Note @command{vpxenc}'s option is specified as a
 | 
			
		||||
percentage of the target bitrate, the libvpx wrapper converts this value as
 | 
			
		||||
follows: @code{(minrate * 100 / bitrate)}.
 | 
			
		||||
@item qcomp
 | 
			
		||||
rc_2pass_vbr_bias_pct
 | 
			
		||||
 | 
			
		||||
@item minrate, maxrate, b @emph{end-usage=cbr}
 | 
			
		||||
@code{(minrate == maxrate == bitrate)}.
 | 
			
		||||
@item maxrate, vb
 | 
			
		||||
rc_2pass_vbr_maxsection_pct
 | 
			
		||||
@code{(maxrate * 100 / vb)}
 | 
			
		||||
 | 
			
		||||
@item crf (@emph{end-usage=cq}, @emph{cq-level})
 | 
			
		||||
@item minrate, vb
 | 
			
		||||
rc_2pass_vbr_minsection_pct
 | 
			
		||||
@code{(minrate * 100 / vb)}
 | 
			
		||||
 | 
			
		||||
@item quality, deadline (@emph{deadline})
 | 
			
		||||
@table @samp
 | 
			
		||||
@item best
 | 
			
		||||
Use best quality deadline. Poorly named and quite slow, this option should be
 | 
			
		||||
avoided as it may give worse quality output than good.
 | 
			
		||||
@item good
 | 
			
		||||
Use good quality deadline. This is a good trade-off between speed and quality
 | 
			
		||||
when used with the @option{cpu-used} option.
 | 
			
		||||
@item realtime
 | 
			
		||||
Use realtime quality deadline.
 | 
			
		||||
@item minrate, maxrate, vb
 | 
			
		||||
@code{VPX_CBR}
 | 
			
		||||
@code{(minrate == maxrate == vb)}
 | 
			
		||||
 | 
			
		||||
@item crf
 | 
			
		||||
@code{VPX_CQ}, @code{VP8E_SET_CQ_LEVEL}
 | 
			
		||||
 | 
			
		||||
@item quality
 | 
			
		||||
@table @option
 | 
			
		||||
@item @var{best}
 | 
			
		||||
@code{VPX_DL_BEST_QUALITY}
 | 
			
		||||
@item @var{good}
 | 
			
		||||
@code{VPX_DL_GOOD_QUALITY}
 | 
			
		||||
@item @var{realtime}
 | 
			
		||||
@code{VPX_DL_REALTIME}
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@item speed, cpu-used (@emph{cpu-used})
 | 
			
		||||
Set quality/speed ratio modifier. Higher values speed up the encode at the cost
 | 
			
		||||
of quality.
 | 
			
		||||
@item speed
 | 
			
		||||
@code{VP8E_SET_CPUUSED}
 | 
			
		||||
 | 
			
		||||
@item nr (@emph{noise-sensitivity})
 | 
			
		||||
@item nr
 | 
			
		||||
@code{VP8E_SET_NOISE_SENSITIVITY}
 | 
			
		||||
 | 
			
		||||
@item static-thresh
 | 
			
		||||
Set a change threshold on blocks below which they will be skipped by the
 | 
			
		||||
encoder.
 | 
			
		||||
@item mb_threshold
 | 
			
		||||
@code{VP8E_SET_STATIC_THRESHOLD}
 | 
			
		||||
 | 
			
		||||
@item slices (@emph{token-parts})
 | 
			
		||||
Note that FFmpeg's @option{slices} option gives the total number of partitions,
 | 
			
		||||
while @command{vpxenc}'s @option{token-parts} is given as
 | 
			
		||||
@code{log2(partitions)}.
 | 
			
		||||
@item slices
 | 
			
		||||
@code{VP8E_SET_TOKEN_PARTITIONS}
 | 
			
		||||
 | 
			
		||||
@item max-intra-rate
 | 
			
		||||
Set maximum I-frame bitrate as a percentage of the target bitrate. A value of 0
 | 
			
		||||
means unlimited.
 | 
			
		||||
@code{VP8E_SET_MAX_INTRA_BITRATE_PCT}
 | 
			
		||||
 | 
			
		||||
@item force_key_frames
 | 
			
		||||
@code{VPX_EFLAG_FORCE_KF}
 | 
			
		||||
 | 
			
		||||
@item Alternate reference frame related
 | 
			
		||||
@table @option
 | 
			
		||||
@item auto-alt-ref
 | 
			
		||||
Enable use of alternate reference frames (2-pass only).
 | 
			
		||||
@item arnr-max-frames
 | 
			
		||||
Set altref noise reduction max frame count.
 | 
			
		||||
@item arnr-type
 | 
			
		||||
Set altref noise reduction filter type: backward, forward, centered.
 | 
			
		||||
@item arnr-strength
 | 
			
		||||
Set altref noise reduction filter strength.
 | 
			
		||||
@item rc-lookahead, lag-in-frames (@emph{lag-in-frames})
 | 
			
		||||
Set number of frames to look ahead for frametype and ratecontrol.
 | 
			
		||||
@item vp8flags altref
 | 
			
		||||
@code{VP8E_SET_ENABLEAUTOALTREF}
 | 
			
		||||
@item @var{arnr_max_frames}
 | 
			
		||||
@code{VP8E_SET_ARNR_MAXFRAMES}
 | 
			
		||||
@item @var{arnr_type}
 | 
			
		||||
@code{VP8E_SET_ARNR_TYPE}
 | 
			
		||||
@item @var{arnr_strength}
 | 
			
		||||
@code{VP8E_SET_ARNR_STRENGTH}
 | 
			
		||||
@item @var{rc_lookahead}
 | 
			
		||||
g_lag_in_frames
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@item error-resilient
 | 
			
		||||
Enable error resiliency features.
 | 
			
		||||
@item vp8flags error_resilient
 | 
			
		||||
g_error_resilient
 | 
			
		||||
 | 
			
		||||
@item VP9-specific options
 | 
			
		||||
@table @option
 | 
			
		||||
@item lossless
 | 
			
		||||
Enable lossless mode.
 | 
			
		||||
@item tile-columns
 | 
			
		||||
Set number of tile columns to use. Note this is given as
 | 
			
		||||
@code{log2(tile_columns)}. For example, 8 tile columns would be requested by
 | 
			
		||||
setting the @option{tile-columns} option to 3.
 | 
			
		||||
@item tile-rows
 | 
			
		||||
Set number of tile rows to use. Note this is given as @code{log2(tile_rows)}.
 | 
			
		||||
For example, 4 tile rows would be requested by setting the @option{tile-rows}
 | 
			
		||||
option to 2.
 | 
			
		||||
@item frame-parallel
 | 
			
		||||
Enable frame parallel decodability features.
 | 
			
		||||
@item aq-mode
 | 
			
		||||
Set adaptive quantization mode (0: off (default), 1: variance 2: complexity, 3:
 | 
			
		||||
cyclic refresh).
 | 
			
		||||
@item colorspace @emph{color-space}
 | 
			
		||||
Set input color space. The VP9 bitstream supports signaling the following
 | 
			
		||||
colorspaces:
 | 
			
		||||
@table @option
 | 
			
		||||
@item @samp{rgb} @emph{sRGB}
 | 
			
		||||
@item @samp{bt709} @emph{bt709}
 | 
			
		||||
@item @samp{unspecified} @emph{unknown}
 | 
			
		||||
@item @samp{bt470bg} @emph{bt601}
 | 
			
		||||
@item @samp{smpte170m} @emph{smpte170}
 | 
			
		||||
@item @samp{smpte240m} @emph{smpte240}
 | 
			
		||||
@item @samp{bt2020_ncl} @emph{bt2020}
 | 
			
		||||
@end table
 | 
			
		||||
@end table
 | 
			
		||||
@item aq_mode
 | 
			
		||||
@code{VP9E_SET_AQ_MODE}
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@@ -1888,10 +1745,6 @@ Enable calculation and printing SSIM stats after the encoding.
 | 
			
		||||
Enable the use of Periodic Intra Refresh instead of IDR frames when set
 | 
			
		||||
to 1.
 | 
			
		||||
 | 
			
		||||
@item avcintra-class (@emph{class})
 | 
			
		||||
Configure the encoder to generate AVC-Intra.
 | 
			
		||||
Valid values are 50,100 and 200
 | 
			
		||||
 | 
			
		||||
@item bluray-compat (@emph{bluray-compat})
 | 
			
		||||
Configure the encoder to be compatible with the bluray standard.
 | 
			
		||||
It is a shorthand for setting "bluray-compat=1 force-cfr=1".
 | 
			
		||||
@@ -2029,34 +1882,6 @@ no-fast-pskip=1:subq=6:8x8dct=0:trellis=0 OUTPUT
 | 
			
		||||
Encoding ffpresets for common usages are provided so they can be used with the
 | 
			
		||||
general presets system (e.g. passing the @option{pre} option).
 | 
			
		||||
 | 
			
		||||
@section libx265
 | 
			
		||||
 | 
			
		||||
x265 H.265/HEVC encoder wrapper.
 | 
			
		||||
 | 
			
		||||
This encoder requires the presence of the libx265 headers and library
 | 
			
		||||
during configuration. You need to explicitly configure the build with
 | 
			
		||||
@option{--enable-libx265}.
 | 
			
		||||
 | 
			
		||||
@subsection Options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
@item preset
 | 
			
		||||
Set the x265 preset.
 | 
			
		||||
 | 
			
		||||
@item tune
 | 
			
		||||
Set the x265 tune parameter.
 | 
			
		||||
 | 
			
		||||
@item x265-params
 | 
			
		||||
Set x265 options using a list of @var{key}=@var{value} couples separated
 | 
			
		||||
by ":". See @command{x265 --help} for a list of options.
 | 
			
		||||
 | 
			
		||||
For example to specify libx265 encoding options with @option{-x265-params}:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i input -c:v libx265 -x265-params crf=26:psy-rd=1 output.mp4
 | 
			
		||||
@end example
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section libxvid
 | 
			
		||||
 | 
			
		||||
Xvid MPEG-4 Part 2 encoder wrapper.
 | 
			
		||||
@@ -2314,7 +2139,7 @@ Use @var{0} to disable alpha plane coding.
 | 
			
		||||
@subsection Speed considerations
 | 
			
		||||
 | 
			
		||||
In the default mode of operation the encoder has to honor frame constraints
 | 
			
		||||
(i.e. not produce frames with size bigger than requested) while still making
 | 
			
		||||
(i.e. not produc frames with size bigger than requested) while still making
 | 
			
		||||
output picture as good as possible.
 | 
			
		||||
A frame containing a lot of small details is harder to compress and the encoder
 | 
			
		||||
would spend more time searching for appropriate quantizers for each slice.
 | 
			
		||||
@@ -2324,30 +2149,6 @@ Setting a higher @option{bits_per_mb} limit will improve the speed.
 | 
			
		||||
For the fastest encoding speed set the @option{qscale} parameter (4 is the
 | 
			
		||||
recommended value) and do not set a size constraint.
 | 
			
		||||
 | 
			
		||||
@section libkvazaar
 | 
			
		||||
 | 
			
		||||
Kvazaar H.265/HEVC encoder.
 | 
			
		||||
 | 
			
		||||
Requires the presence of the libkvazaar headers and library during
 | 
			
		||||
configuration. You need to explicitly configure the build with
 | 
			
		||||
@option{--enable-libkvazaar}.
 | 
			
		||||
 | 
			
		||||
@subsection Options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item b
 | 
			
		||||
Set target video bitrate in bit/s and enable rate control.
 | 
			
		||||
 | 
			
		||||
@item threads
 | 
			
		||||
Set number of encoding threads.
 | 
			
		||||
 | 
			
		||||
@item kvazaar-params
 | 
			
		||||
Set kvazaar parameters as a list of @var{name}=@var{value} pairs separated
 | 
			
		||||
by commas (,). See kvazaar documentation for a list of options.
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@c man end VIDEO ENCODERS
 | 
			
		||||
 | 
			
		||||
@chapter Subtitles Encoders
 | 
			
		||||
 
 | 
			
		||||
@@ -11,14 +11,12 @@ CFLAGS += -Wall -g
 | 
			
		||||
CFLAGS := $(shell pkg-config --cflags $(FFMPEG_LIBS)) $(CFLAGS)
 | 
			
		||||
LDLIBS := $(shell pkg-config --libs $(FFMPEG_LIBS)) $(LDLIBS)
 | 
			
		||||
 | 
			
		||||
EXAMPLES=       avio_dir_cmd                       \
 | 
			
		||||
                avio_reading                       \
 | 
			
		||||
EXAMPLES=       avio_reading                       \
 | 
			
		||||
                decoding_encoding                  \
 | 
			
		||||
                demuxing_decoding                  \
 | 
			
		||||
                extract_mvs                        \
 | 
			
		||||
                filtering_video                    \
 | 
			
		||||
                filtering_audio                    \
 | 
			
		||||
                http_multiclient                   \
 | 
			
		||||
                metadata                           \
 | 
			
		||||
                muxing                             \
 | 
			
		||||
                remuxing                           \
 | 
			
		||||
 
 | 
			
		||||
@@ -1,180 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (c) 2014 Lukasz Marek
 | 
			
		||||
 *
 | 
			
		||||
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 | 
			
		||||
 * of this software and associated documentation files (the "Software"), to deal
 | 
			
		||||
 * in the Software without restriction, including without limitation the rights
 | 
			
		||||
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 | 
			
		||||
 * copies of the Software, and to permit persons to whom the Software is
 | 
			
		||||
 * furnished to do so, subject to the following conditions:
 | 
			
		||||
 *
 | 
			
		||||
 * The above copyright notice and this permission notice shall be included in
 | 
			
		||||
 * all copies or substantial portions of the Software.
 | 
			
		||||
 *
 | 
			
		||||
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 | 
			
		||||
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 | 
			
		||||
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
 | 
			
		||||
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 | 
			
		||||
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 | 
			
		||||
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 | 
			
		||||
 * THE SOFTWARE.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <libavcodec/avcodec.h>
 | 
			
		||||
#include <libavformat/avformat.h>
 | 
			
		||||
#include <libavformat/avio.h>
 | 
			
		||||
 | 
			
		||||
static const char *type_string(int type)
 | 
			
		||||
{
 | 
			
		||||
    switch (type) {
 | 
			
		||||
    case AVIO_ENTRY_DIRECTORY:
 | 
			
		||||
        return "<DIR>";
 | 
			
		||||
    case AVIO_ENTRY_FILE:
 | 
			
		||||
        return "<FILE>";
 | 
			
		||||
    case AVIO_ENTRY_BLOCK_DEVICE:
 | 
			
		||||
        return "<BLOCK DEVICE>";
 | 
			
		||||
    case AVIO_ENTRY_CHARACTER_DEVICE:
 | 
			
		||||
        return "<CHARACTER DEVICE>";
 | 
			
		||||
    case AVIO_ENTRY_NAMED_PIPE:
 | 
			
		||||
        return "<PIPE>";
 | 
			
		||||
    case AVIO_ENTRY_SYMBOLIC_LINK:
 | 
			
		||||
        return "<LINK>";
 | 
			
		||||
    case AVIO_ENTRY_SOCKET:
 | 
			
		||||
        return "<SOCKET>";
 | 
			
		||||
    case AVIO_ENTRY_SERVER:
 | 
			
		||||
        return "<SERVER>";
 | 
			
		||||
    case AVIO_ENTRY_SHARE:
 | 
			
		||||
        return "<SHARE>";
 | 
			
		||||
    case AVIO_ENTRY_WORKGROUP:
 | 
			
		||||
        return "<WORKGROUP>";
 | 
			
		||||
    case AVIO_ENTRY_UNKNOWN:
 | 
			
		||||
    default:
 | 
			
		||||
        break;
 | 
			
		||||
    }
 | 
			
		||||
    return "<UNKNOWN>";
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int list_op(const char *input_dir)
 | 
			
		||||
{
 | 
			
		||||
    AVIODirEntry *entry = NULL;
 | 
			
		||||
    AVIODirContext *ctx = NULL;
 | 
			
		||||
    int cnt, ret;
 | 
			
		||||
    char filemode[4], uid_and_gid[20];
 | 
			
		||||
 | 
			
		||||
    if ((ret = avio_open_dir(&ctx, input_dir, NULL)) < 0) {
 | 
			
		||||
        av_log(NULL, AV_LOG_ERROR, "Cannot open directory: %s.\n", av_err2str(ret));
 | 
			
		||||
        goto fail;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    cnt = 0;
 | 
			
		||||
    for (;;) {
 | 
			
		||||
        if ((ret = avio_read_dir(ctx, &entry)) < 0) {
 | 
			
		||||
            av_log(NULL, AV_LOG_ERROR, "Cannot list directory: %s.\n", av_err2str(ret));
 | 
			
		||||
            goto fail;
 | 
			
		||||
        }
 | 
			
		||||
        if (!entry)
 | 
			
		||||
            break;
 | 
			
		||||
        if (entry->filemode == -1) {
 | 
			
		||||
            snprintf(filemode, 4, "???");
 | 
			
		||||
        } else {
 | 
			
		||||
            snprintf(filemode, 4, "%3"PRIo64, entry->filemode);
 | 
			
		||||
        }
 | 
			
		||||
        snprintf(uid_and_gid, 20, "%"PRId64"(%"PRId64")", entry->user_id, entry->group_id);
 | 
			
		||||
        if (cnt == 0)
 | 
			
		||||
            av_log(NULL, AV_LOG_INFO, "%-9s %12s %30s %10s %s %16s %16s %16s\n",
 | 
			
		||||
                   "TYPE", "SIZE", "NAME", "UID(GID)", "UGO", "MODIFIED",
 | 
			
		||||
                   "ACCESSED", "STATUS_CHANGED");
 | 
			
		||||
        av_log(NULL, AV_LOG_INFO, "%-9s %12"PRId64" %30s %10s %s %16"PRId64" %16"PRId64" %16"PRId64"\n",
 | 
			
		||||
               type_string(entry->type),
 | 
			
		||||
               entry->size,
 | 
			
		||||
               entry->name,
 | 
			
		||||
               uid_and_gid,
 | 
			
		||||
               filemode,
 | 
			
		||||
               entry->modification_timestamp,
 | 
			
		||||
               entry->access_timestamp,
 | 
			
		||||
               entry->status_change_timestamp);
 | 
			
		||||
        avio_free_directory_entry(&entry);
 | 
			
		||||
        cnt++;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
  fail:
 | 
			
		||||
    avio_close_dir(&ctx);
 | 
			
		||||
    return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int del_op(const char *url)
 | 
			
		||||
{
 | 
			
		||||
    int ret = avpriv_io_delete(url);
 | 
			
		||||
    if (ret < 0)
 | 
			
		||||
        av_log(NULL, AV_LOG_ERROR, "Cannot delete '%s': %s.\n", url, av_err2str(ret));
 | 
			
		||||
    return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int move_op(const char *src, const char *dst)
 | 
			
		||||
{
 | 
			
		||||
    int ret = avpriv_io_move(src, dst);
 | 
			
		||||
    if (ret < 0)
 | 
			
		||||
        av_log(NULL, AV_LOG_ERROR, "Cannot move '%s' into '%s': %s.\n", src, dst, av_err2str(ret));
 | 
			
		||||
    return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void usage(const char *program_name)
 | 
			
		||||
{
 | 
			
		||||
    fprintf(stderr, "usage: %s OPERATION entry1 [entry2]\n"
 | 
			
		||||
            "API example program to show how to manipulate resources "
 | 
			
		||||
            "accessed through AVIOContext.\n"
 | 
			
		||||
            "OPERATIONS:\n"
 | 
			
		||||
            "list      list content of the directory\n"
 | 
			
		||||
            "move      rename content in directory\n"
 | 
			
		||||
            "del       delete content in directory\n",
 | 
			
		||||
            program_name);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int main(int argc, char *argv[])
 | 
			
		||||
{
 | 
			
		||||
    const char *op = NULL;
 | 
			
		||||
    int ret;
 | 
			
		||||
 | 
			
		||||
    av_log_set_level(AV_LOG_DEBUG);
 | 
			
		||||
 | 
			
		||||
    if (argc < 2) {
 | 
			
		||||
        usage(argv[0]);
 | 
			
		||||
        return 1;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* register codecs and formats and other lavf/lavc components*/
 | 
			
		||||
    av_register_all();
 | 
			
		||||
    avformat_network_init();
 | 
			
		||||
 | 
			
		||||
    op = argv[1];
 | 
			
		||||
    if (strcmp(op, "list") == 0) {
 | 
			
		||||
        if (argc < 3) {
 | 
			
		||||
            av_log(NULL, AV_LOG_INFO, "Missing argument for list operation.\n");
 | 
			
		||||
            ret = AVERROR(EINVAL);
 | 
			
		||||
        } else {
 | 
			
		||||
            ret = list_op(argv[2]);
 | 
			
		||||
        }
 | 
			
		||||
    } else if (strcmp(op, "del") == 0) {
 | 
			
		||||
        if (argc < 3) {
 | 
			
		||||
            av_log(NULL, AV_LOG_INFO, "Missing argument for del operation.\n");
 | 
			
		||||
            ret = AVERROR(EINVAL);
 | 
			
		||||
        } else {
 | 
			
		||||
            ret = del_op(argv[2]);
 | 
			
		||||
        }
 | 
			
		||||
    } else if (strcmp(op, "move") == 0) {
 | 
			
		||||
        if (argc < 4) {
 | 
			
		||||
            av_log(NULL, AV_LOG_INFO, "Missing argument for move operation.\n");
 | 
			
		||||
            ret = AVERROR(EINVAL);
 | 
			
		||||
        } else {
 | 
			
		||||
            ret = move_op(argv[2], argv[3]);
 | 
			
		||||
        }
 | 
			
		||||
    } else {
 | 
			
		||||
        av_log(NULL, AV_LOG_INFO, "Invalid operation %s\n", op);
 | 
			
		||||
        ret = AVERROR(EINVAL);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    avformat_network_deinit();
 | 
			
		||||
 | 
			
		||||
    return ret < 0 ? 1 : 0;
 | 
			
		||||
}
 | 
			
		||||
@@ -245,7 +245,7 @@ static void audio_decode_example(const char *outfilename, const char *filename)
 | 
			
		||||
    AVCodecContext *c= NULL;
 | 
			
		||||
    int len;
 | 
			
		||||
    FILE *f, *outfile;
 | 
			
		||||
    uint8_t inbuf[AUDIO_INBUF_SIZE + AV_INPUT_BUFFER_PADDING_SIZE];
 | 
			
		||||
    uint8_t inbuf[AUDIO_INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE];
 | 
			
		||||
    AVPacket avpkt;
 | 
			
		||||
    AVFrame *decoded_frame = NULL;
 | 
			
		||||
 | 
			
		||||
@@ -288,7 +288,6 @@ static void audio_decode_example(const char *outfilename, const char *filename)
 | 
			
		||||
    avpkt.size = fread(inbuf, 1, AUDIO_INBUF_SIZE, f);
 | 
			
		||||
 | 
			
		||||
    while (avpkt.size > 0) {
 | 
			
		||||
        int i, ch;
 | 
			
		||||
        int got_frame = 0;
 | 
			
		||||
 | 
			
		||||
        if (!decoded_frame) {
 | 
			
		||||
@@ -305,15 +304,15 @@ static void audio_decode_example(const char *outfilename, const char *filename)
 | 
			
		||||
        }
 | 
			
		||||
        if (got_frame) {
 | 
			
		||||
            /* if a frame has been decoded, output it */
 | 
			
		||||
            int data_size = av_get_bytes_per_sample(c->sample_fmt);
 | 
			
		||||
            int data_size = av_samples_get_buffer_size(NULL, c->channels,
 | 
			
		||||
                                                       decoded_frame->nb_samples,
 | 
			
		||||
                                                       c->sample_fmt, 1);
 | 
			
		||||
            if (data_size < 0) {
 | 
			
		||||
                /* This should not occur, checking just for paranoia */
 | 
			
		||||
                fprintf(stderr, "Failed to calculate data size\n");
 | 
			
		||||
                exit(1);
 | 
			
		||||
            }
 | 
			
		||||
            for (i=0; i<decoded_frame->nb_samples; i++)
 | 
			
		||||
                for (ch=0; ch<c->channels; ch++)
 | 
			
		||||
                    fwrite(decoded_frame->data[ch] + data_size*i, 1, data_size, outfile);
 | 
			
		||||
            fwrite(decoded_frame->data[0], 1, data_size, outfile);
 | 
			
		||||
        }
 | 
			
		||||
        avpkt.size -= len;
 | 
			
		||||
        avpkt.data += len;
 | 
			
		||||
@@ -521,7 +520,7 @@ static int decode_write_frame(const char *outfilename, AVCodecContext *avctx,
 | 
			
		||||
        /* the picture is allocated by the decoder, no need to free it */
 | 
			
		||||
        snprintf(buf, sizeof(buf), outfilename, *frame_count);
 | 
			
		||||
        pgm_save(frame->data[0], frame->linesize[0],
 | 
			
		||||
                 frame->width, frame->height, buf);
 | 
			
		||||
                 avctx->width, avctx->height, buf);
 | 
			
		||||
        (*frame_count)++;
 | 
			
		||||
    }
 | 
			
		||||
    if (pkt->data) {
 | 
			
		||||
@@ -538,13 +537,13 @@ static void video_decode_example(const char *outfilename, const char *filename)
 | 
			
		||||
    int frame_count;
 | 
			
		||||
    FILE *f;
 | 
			
		||||
    AVFrame *frame;
 | 
			
		||||
    uint8_t inbuf[INBUF_SIZE + AV_INPUT_BUFFER_PADDING_SIZE];
 | 
			
		||||
    uint8_t inbuf[INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE];
 | 
			
		||||
    AVPacket avpkt;
 | 
			
		||||
 | 
			
		||||
    av_init_packet(&avpkt);
 | 
			
		||||
 | 
			
		||||
    /* set end of buffer to 0 (this ensures that no overreading happens for damaged mpeg streams) */
 | 
			
		||||
    memset(inbuf + INBUF_SIZE, 0, AV_INPUT_BUFFER_PADDING_SIZE);
 | 
			
		||||
    memset(inbuf + INBUF_SIZE, 0, FF_INPUT_BUFFER_PADDING_SIZE);
 | 
			
		||||
 | 
			
		||||
    printf("Decode video file %s to %s\n", filename, outfilename);
 | 
			
		||||
 | 
			
		||||
@@ -561,8 +560,8 @@ static void video_decode_example(const char *outfilename, const char *filename)
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (codec->capabilities & AV_CODEC_CAP_TRUNCATED)
 | 
			
		||||
        c->flags |= AV_CODEC_FLAG_TRUNCATED; // we do not send complete frames
 | 
			
		||||
    if(codec->capabilities&CODEC_CAP_TRUNCATED)
 | 
			
		||||
        c->flags|= CODEC_FLAG_TRUNCATED; /* we do not send complete frames */
 | 
			
		||||
 | 
			
		||||
    /* For some codecs, such as msmpeg4 and mpeg4, width and height
 | 
			
		||||
       MUST be initialized there because this information is not
 | 
			
		||||
@@ -651,7 +650,7 @@ int main(int argc, char **argv)
 | 
			
		||||
        video_encode_example("test.h264", AV_CODEC_ID_H264);
 | 
			
		||||
    } else if (!strcmp(output_type, "mp2")) {
 | 
			
		||||
        audio_encode_example("test.mp2");
 | 
			
		||||
        audio_decode_example("test.pcm", "test.mp2");
 | 
			
		||||
        audio_decode_example("test.sw", "test.mp2");
 | 
			
		||||
    } else if (!strcmp(output_type, "mpg")) {
 | 
			
		||||
        video_encode_example("test.mpg", AV_CODEC_ID_MPEG1VIDEO);
 | 
			
		||||
        video_decode_example("test%02d.pgm", "test.mpg");
 | 
			
		||||
 
 | 
			
		||||
@@ -36,8 +36,6 @@
 | 
			
		||||
 | 
			
		||||
static AVFormatContext *fmt_ctx = NULL;
 | 
			
		||||
static AVCodecContext *video_dec_ctx = NULL, *audio_dec_ctx;
 | 
			
		||||
static int width, height;
 | 
			
		||||
static enum AVPixelFormat pix_fmt;
 | 
			
		||||
static AVStream *video_stream = NULL, *audio_stream = NULL;
 | 
			
		||||
static const char *src_filename = NULL;
 | 
			
		||||
static const char *video_dst_filename = NULL;
 | 
			
		||||
@@ -83,22 +81,6 @@ static int decode_packet(int *got_frame, int cached)
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (*got_frame) {
 | 
			
		||||
 | 
			
		||||
            if (frame->width != width || frame->height != height ||
 | 
			
		||||
                frame->format != pix_fmt) {
 | 
			
		||||
                /* To handle this change, one could call av_image_alloc again and
 | 
			
		||||
                 * decode the following frames into another rawvideo file. */
 | 
			
		||||
                fprintf(stderr, "Error: Width, height and pixel format have to be "
 | 
			
		||||
                        "constant in a rawvideo file, but the width, height or "
 | 
			
		||||
                        "pixel format of the input video changed:\n"
 | 
			
		||||
                        "old: width = %d, height = %d, format = %s\n"
 | 
			
		||||
                        "new: width = %d, height = %d, format = %s\n",
 | 
			
		||||
                        width, height, av_get_pix_fmt_name(pix_fmt),
 | 
			
		||||
                        frame->width, frame->height,
 | 
			
		||||
                        av_get_pix_fmt_name(frame->format));
 | 
			
		||||
                return -1;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            printf("video_frame%s n:%d coded_n:%d pts:%s\n",
 | 
			
		||||
                   cached ? "(cached)" : "",
 | 
			
		||||
                   video_frame_count++, frame->coded_picture_number,
 | 
			
		||||
@@ -108,7 +90,7 @@ static int decode_packet(int *got_frame, int cached)
 | 
			
		||||
             * this is required since rawvideo expects non aligned data */
 | 
			
		||||
            av_image_copy(video_dst_data, video_dst_linesize,
 | 
			
		||||
                          (const uint8_t **)(frame->data), frame->linesize,
 | 
			
		||||
                          pix_fmt, width, height);
 | 
			
		||||
                          video_dec_ctx->pix_fmt, video_dec_ctx->width, video_dec_ctx->height);
 | 
			
		||||
 | 
			
		||||
            /* write to rawvideo file */
 | 
			
		||||
            fwrite(video_dst_data[0], 1, video_dst_bufsize, video_dst_file);
 | 
			
		||||
@@ -156,7 +138,7 @@ static int decode_packet(int *got_frame, int cached)
 | 
			
		||||
static int open_codec_context(int *stream_idx,
 | 
			
		||||
                              AVFormatContext *fmt_ctx, enum AVMediaType type)
 | 
			
		||||
{
 | 
			
		||||
    int ret, stream_index;
 | 
			
		||||
    int ret;
 | 
			
		||||
    AVStream *st;
 | 
			
		||||
    AVCodecContext *dec_ctx = NULL;
 | 
			
		||||
    AVCodec *dec = NULL;
 | 
			
		||||
@@ -168,8 +150,8 @@ static int open_codec_context(int *stream_idx,
 | 
			
		||||
                av_get_media_type_string(type), src_filename);
 | 
			
		||||
        return ret;
 | 
			
		||||
    } else {
 | 
			
		||||
        stream_index = ret;
 | 
			
		||||
        st = fmt_ctx->streams[stream_index];
 | 
			
		||||
        *stream_idx = ret;
 | 
			
		||||
        st = fmt_ctx->streams[*stream_idx];
 | 
			
		||||
 | 
			
		||||
        /* find decoder for the stream */
 | 
			
		||||
        dec_ctx = st->codec;
 | 
			
		||||
@@ -188,7 +170,6 @@ static int open_codec_context(int *stream_idx,
 | 
			
		||||
                    av_get_media_type_string(type));
 | 
			
		||||
            return ret;
 | 
			
		||||
        }
 | 
			
		||||
        *stream_idx = stream_index;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
@@ -283,11 +264,9 @@ int main (int argc, char **argv)
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /* allocate image where the decoded image will be put */
 | 
			
		||||
        width = video_dec_ctx->width;
 | 
			
		||||
        height = video_dec_ctx->height;
 | 
			
		||||
        pix_fmt = video_dec_ctx->pix_fmt;
 | 
			
		||||
        ret = av_image_alloc(video_dst_data, video_dst_linesize,
 | 
			
		||||
                             width, height, pix_fmt, 1);
 | 
			
		||||
                             video_dec_ctx->width, video_dec_ctx->height,
 | 
			
		||||
                             video_dec_ctx->pix_fmt, 1);
 | 
			
		||||
        if (ret < 0) {
 | 
			
		||||
            fprintf(stderr, "Could not allocate raw video buffer\n");
 | 
			
		||||
            goto end;
 | 
			
		||||
@@ -362,7 +341,7 @@ int main (int argc, char **argv)
 | 
			
		||||
    if (video_stream) {
 | 
			
		||||
        printf("Play the output video file with the command:\n"
 | 
			
		||||
               "ffplay -f rawvideo -pix_fmt %s -video_size %dx%d %s\n",
 | 
			
		||||
               av_get_pix_fmt_name(pix_fmt), width, height,
 | 
			
		||||
               av_get_pix_fmt_name(video_dec_ctx->pix_fmt), video_dec_ctx->width, video_dec_ctx->height,
 | 
			
		||||
               video_dst_filename);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -145,28 +145,12 @@ static int init_filters(const char *filters_descr)
 | 
			
		||||
        goto end;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * Set the endpoints for the filter graph. The filter_graph will
 | 
			
		||||
     * be linked to the graph described by filters_descr.
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * The buffer source output must be connected to the input pad of
 | 
			
		||||
     * the first filter described by filters_descr; since the first
 | 
			
		||||
     * filter input label is not specified, it is set to "in" by
 | 
			
		||||
     * default.
 | 
			
		||||
     */
 | 
			
		||||
    /* Endpoints for the filter graph. */
 | 
			
		||||
    outputs->name       = av_strdup("in");
 | 
			
		||||
    outputs->filter_ctx = buffersrc_ctx;
 | 
			
		||||
    outputs->pad_idx    = 0;
 | 
			
		||||
    outputs->next       = NULL;
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * The buffer sink input must be connected to the output pad of
 | 
			
		||||
     * the last filter described by filters_descr; since the last
 | 
			
		||||
     * filter output label is not specified, it is set to "out" by
 | 
			
		||||
     * default.
 | 
			
		||||
     */
 | 
			
		||||
    inputs->name       = av_strdup("out");
 | 
			
		||||
    inputs->filter_ctx = buffersink_ctx;
 | 
			
		||||
    inputs->pad_idx    = 0;
 | 
			
		||||
 
 | 
			
		||||
@@ -38,10 +38,7 @@
 | 
			
		||||
#include <libavfilter/buffersrc.h>
 | 
			
		||||
#include <libavutil/opt.h>
 | 
			
		||||
 | 
			
		||||
const char *filter_descr = "scale=78:24,transpose=cclock";
 | 
			
		||||
/* other way:
 | 
			
		||||
   scale=78:24 [scl]; [scl] transpose=cclock // assumes "[in]" and "[out]" to be input output pads respectively
 | 
			
		||||
 */
 | 
			
		||||
const char *filter_descr = "scale=78:24";
 | 
			
		||||
 | 
			
		||||
static AVFormatContext *fmt_ctx;
 | 
			
		||||
static AVCodecContext *dec_ctx;
 | 
			
		||||
@@ -93,7 +90,6 @@ static int init_filters(const char *filters_descr)
 | 
			
		||||
    AVFilter *buffersink = avfilter_get_by_name("buffersink");
 | 
			
		||||
    AVFilterInOut *outputs = avfilter_inout_alloc();
 | 
			
		||||
    AVFilterInOut *inputs  = avfilter_inout_alloc();
 | 
			
		||||
    AVRational time_base = fmt_ctx->streams[video_stream_index]->time_base;
 | 
			
		||||
    enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE };
 | 
			
		||||
 | 
			
		||||
    filter_graph = avfilter_graph_alloc();
 | 
			
		||||
@@ -106,7 +102,7 @@ static int init_filters(const char *filters_descr)
 | 
			
		||||
    snprintf(args, sizeof(args),
 | 
			
		||||
            "video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:pixel_aspect=%d/%d",
 | 
			
		||||
            dec_ctx->width, dec_ctx->height, dec_ctx->pix_fmt,
 | 
			
		||||
            time_base.num, time_base.den,
 | 
			
		||||
            dec_ctx->time_base.num, dec_ctx->time_base.den,
 | 
			
		||||
            dec_ctx->sample_aspect_ratio.num, dec_ctx->sample_aspect_ratio.den);
 | 
			
		||||
 | 
			
		||||
    ret = avfilter_graph_create_filter(&buffersrc_ctx, buffersrc, "in",
 | 
			
		||||
@@ -131,28 +127,12 @@ static int init_filters(const char *filters_descr)
 | 
			
		||||
        goto end;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * Set the endpoints for the filter graph. The filter_graph will
 | 
			
		||||
     * be linked to the graph described by filters_descr.
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * The buffer source output must be connected to the input pad of
 | 
			
		||||
     * the first filter described by filters_descr; since the first
 | 
			
		||||
     * filter input label is not specified, it is set to "in" by
 | 
			
		||||
     * default.
 | 
			
		||||
     */
 | 
			
		||||
    /* Endpoints for the filter graph. */
 | 
			
		||||
    outputs->name       = av_strdup("in");
 | 
			
		||||
    outputs->filter_ctx = buffersrc_ctx;
 | 
			
		||||
    outputs->pad_idx    = 0;
 | 
			
		||||
    outputs->next       = NULL;
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * The buffer sink input must be connected to the output pad of
 | 
			
		||||
     * the last filter described by filters_descr; since the last
 | 
			
		||||
     * filter output label is not specified, it is set to "out" by
 | 
			
		||||
     * default.
 | 
			
		||||
     */
 | 
			
		||||
    inputs->name       = av_strdup("out");
 | 
			
		||||
    inputs->filter_ctx = buffersink_ctx;
 | 
			
		||||
    inputs->pad_idx    = 0;
 | 
			
		||||
 
 | 
			
		||||
@@ -1,155 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (c) 2015 Stephan Holljes
 | 
			
		||||
 *
 | 
			
		||||
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 | 
			
		||||
 * of this software and associated documentation files (the "Software"), to deal
 | 
			
		||||
 * in the Software without restriction, including without limitation the rights
 | 
			
		||||
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 | 
			
		||||
 * copies of the Software, and to permit persons to whom the Software is
 | 
			
		||||
 * furnished to do so, subject to the following conditions:
 | 
			
		||||
 *
 | 
			
		||||
 * The above copyright notice and this permission notice shall be included in
 | 
			
		||||
 * all copies or substantial portions of the Software.
 | 
			
		||||
 *
 | 
			
		||||
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 | 
			
		||||
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 | 
			
		||||
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
 | 
			
		||||
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 | 
			
		||||
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 | 
			
		||||
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 | 
			
		||||
 * THE SOFTWARE.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @file
 | 
			
		||||
 * libavformat multi-client network API usage example.
 | 
			
		||||
 *
 | 
			
		||||
 * @example http_multiclient.c
 | 
			
		||||
 * This example will serve a file without decoding or demuxing it over http.
 | 
			
		||||
 * Multiple clients can connect and will receive the same file.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <libavformat/avformat.h>
 | 
			
		||||
#include <libavutil/opt.h>
 | 
			
		||||
#include <unistd.h>
 | 
			
		||||
 | 
			
		||||
void process_client(AVIOContext *client, const char *in_uri)
 | 
			
		||||
{
 | 
			
		||||
    AVIOContext *input = NULL;
 | 
			
		||||
    uint8_t buf[1024];
 | 
			
		||||
    int ret, n, reply_code;
 | 
			
		||||
    char *resource = NULL;
 | 
			
		||||
    while ((ret = avio_handshake(client)) > 0) {
 | 
			
		||||
        av_opt_get(client, "resource", AV_OPT_SEARCH_CHILDREN, &resource);
 | 
			
		||||
        // check for strlen(resource) is necessary, because av_opt_get()
 | 
			
		||||
        // may return empty string.
 | 
			
		||||
        if (resource && strlen(resource))
 | 
			
		||||
            break;
 | 
			
		||||
    }
 | 
			
		||||
    if (ret < 0)
 | 
			
		||||
        goto end;
 | 
			
		||||
    av_log(client, AV_LOG_TRACE, "resource=%p\n", resource);
 | 
			
		||||
    if (resource && resource[0] == '/' && !strcmp((resource + 1), in_uri)) {
 | 
			
		||||
        reply_code = 200;
 | 
			
		||||
    } else {
 | 
			
		||||
        reply_code = AVERROR_HTTP_NOT_FOUND;
 | 
			
		||||
    }
 | 
			
		||||
    if ((ret = av_opt_set_int(client, "reply_code", reply_code, AV_OPT_SEARCH_CHILDREN)) < 0) {
 | 
			
		||||
        av_log(client, AV_LOG_ERROR, "Failed to set reply_code: %s.\n", av_err2str(ret));
 | 
			
		||||
        goto end;
 | 
			
		||||
    }
 | 
			
		||||
    av_log(client, AV_LOG_TRACE, "Set reply code to %d\n", reply_code);
 | 
			
		||||
 | 
			
		||||
    while ((ret = avio_handshake(client)) > 0);
 | 
			
		||||
 | 
			
		||||
    if (ret < 0)
 | 
			
		||||
        goto end;
 | 
			
		||||
 | 
			
		||||
    fprintf(stderr, "Handshake performed.\n");
 | 
			
		||||
    if (reply_code != 200)
 | 
			
		||||
        goto end;
 | 
			
		||||
    fprintf(stderr, "Opening input file.\n");
 | 
			
		||||
    if ((ret = avio_open2(&input, in_uri, AVIO_FLAG_READ, NULL, NULL)) < 0) {
 | 
			
		||||
        av_log(input, AV_LOG_ERROR, "Failed to open input: %s: %s.\n", in_uri,
 | 
			
		||||
               av_err2str(ret));
 | 
			
		||||
        goto end;
 | 
			
		||||
    }
 | 
			
		||||
    for(;;) {
 | 
			
		||||
        n = avio_read(input, buf, sizeof(buf));
 | 
			
		||||
        if (n < 0) {
 | 
			
		||||
            if (n == AVERROR_EOF)
 | 
			
		||||
                break;
 | 
			
		||||
            av_log(input, AV_LOG_ERROR, "Error reading from input: %s.\n",
 | 
			
		||||
                   av_err2str(n));
 | 
			
		||||
            break;
 | 
			
		||||
        }
 | 
			
		||||
        avio_write(client, buf, n);
 | 
			
		||||
        avio_flush(client);
 | 
			
		||||
    }
 | 
			
		||||
end:
 | 
			
		||||
    fprintf(stderr, "Flushing client\n");
 | 
			
		||||
    avio_flush(client);
 | 
			
		||||
    fprintf(stderr, "Closing client\n");
 | 
			
		||||
    avio_close(client);
 | 
			
		||||
    fprintf(stderr, "Closing input\n");
 | 
			
		||||
    avio_close(input);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int main(int argc, char **argv)
 | 
			
		||||
{
 | 
			
		||||
    av_log_set_level(AV_LOG_TRACE);
 | 
			
		||||
    AVDictionary *options = NULL;
 | 
			
		||||
    AVIOContext *client = NULL, *server = NULL;
 | 
			
		||||
    const char *in_uri, *out_uri;
 | 
			
		||||
    int ret, pid;
 | 
			
		||||
    if (argc < 3) {
 | 
			
		||||
        printf("usage: %s input http://hostname[:port]\n"
 | 
			
		||||
               "API example program to serve http to multiple clients.\n"
 | 
			
		||||
               "\n", argv[0]);
 | 
			
		||||
        return 1;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    in_uri = argv[1];
 | 
			
		||||
    out_uri = argv[2];
 | 
			
		||||
 | 
			
		||||
    av_register_all();
 | 
			
		||||
    avformat_network_init();
 | 
			
		||||
 | 
			
		||||
    if ((ret = av_dict_set(&options, "listen", "2", 0)) < 0) {
 | 
			
		||||
        fprintf(stderr, "Failed to set listen mode for server: %s\n", av_err2str(ret));
 | 
			
		||||
        return ret;
 | 
			
		||||
    }
 | 
			
		||||
    if ((ret = avio_open2(&server, out_uri, AVIO_FLAG_WRITE, NULL, &options)) < 0) {
 | 
			
		||||
        fprintf(stderr, "Failed to open server: %s\n", av_err2str(ret));
 | 
			
		||||
        return ret;
 | 
			
		||||
    }
 | 
			
		||||
    fprintf(stderr, "Entering main loop.\n");
 | 
			
		||||
    for(;;) {
 | 
			
		||||
        if ((ret = avio_accept(server, &client)) < 0)
 | 
			
		||||
            goto end;
 | 
			
		||||
        fprintf(stderr, "Accepted client, forking process.\n");
 | 
			
		||||
        // XXX: Since we don't reap our children and don't ignore signals
 | 
			
		||||
        //      this produces zombie processes.
 | 
			
		||||
        pid = fork();
 | 
			
		||||
        if (pid < 0) {
 | 
			
		||||
            perror("Fork failed");
 | 
			
		||||
            ret = AVERROR(errno);
 | 
			
		||||
            goto end;
 | 
			
		||||
        }
 | 
			
		||||
        if (pid == 0) {
 | 
			
		||||
            fprintf(stderr, "In child.\n");
 | 
			
		||||
            process_client(client, in_uri);
 | 
			
		||||
            avio_close(server);
 | 
			
		||||
            exit(0);
 | 
			
		||||
        }
 | 
			
		||||
        if (pid > 0)
 | 
			
		||||
            avio_close(client);
 | 
			
		||||
    }
 | 
			
		||||
end:
 | 
			
		||||
    avio_close(server);
 | 
			
		||||
    if (ret < 0 && ret != AVERROR_EOF) {
 | 
			
		||||
        fprintf(stderr, "Some errors occurred: %s\n", av_err2str(ret));
 | 
			
		||||
        return 1;
 | 
			
		||||
    }
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
@@ -172,7 +172,7 @@ static void add_stream(OutputStream *ost, AVFormatContext *oc,
 | 
			
		||||
 | 
			
		||||
    /* Some formats want stream headers to be separate. */
 | 
			
		||||
    if (oc->oformat->flags & AVFMT_GLOBALHEADER)
 | 
			
		||||
        c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
 | 
			
		||||
        c->flags |= CODEC_FLAG_GLOBAL_HEADER;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**************************************************************/
 | 
			
		||||
@@ -230,7 +230,7 @@ static void open_audio(AVFormatContext *oc, AVCodec *codec, OutputStream *ost, A
 | 
			
		||||
    /* increment frequency by 110 Hz per second */
 | 
			
		||||
    ost->tincr2 = 2 * M_PI * 110.0 / c->sample_rate / c->sample_rate;
 | 
			
		||||
 | 
			
		||||
    if (c->codec->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE)
 | 
			
		||||
    if (c->codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE)
 | 
			
		||||
        nb_samples = 10000;
 | 
			
		||||
    else
 | 
			
		||||
        nb_samples = c->frame_size;
 | 
			
		||||
@@ -661,7 +661,7 @@ int main(int argc, char **argv)
 | 
			
		||||
 | 
			
		||||
    if (!(fmt->flags & AVFMT_NOFILE))
 | 
			
		||||
        /* Close the output file. */
 | 
			
		||||
        avio_closep(&oc->pb);
 | 
			
		||||
        avio_close(oc->pb);
 | 
			
		||||
 | 
			
		||||
    /* free the stream */
 | 
			
		||||
    avformat_free_context(oc);
 | 
			
		||||
 
 | 
			
		||||
@@ -1,484 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (c) 2015 Anton Khirnov
 | 
			
		||||
 *
 | 
			
		||||
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 | 
			
		||||
 * of this software and associated documentation files (the "Software"), to deal
 | 
			
		||||
 * in the Software without restriction, including without limitation the rights
 | 
			
		||||
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 | 
			
		||||
 * copies of the Software, and to permit persons to whom the Software is
 | 
			
		||||
 * furnished to do so, subject to the following conditions:
 | 
			
		||||
 *
 | 
			
		||||
 * The above copyright notice and this permission notice shall be included in
 | 
			
		||||
 * all copies or substantial portions of the Software.
 | 
			
		||||
 *
 | 
			
		||||
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 | 
			
		||||
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 | 
			
		||||
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
 | 
			
		||||
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 | 
			
		||||
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 | 
			
		||||
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 | 
			
		||||
 * THE SOFTWARE.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @file
 | 
			
		||||
 * Intel QSV-accelerated H.264 decoding example.
 | 
			
		||||
 *
 | 
			
		||||
 * @example qsvdec.c
 | 
			
		||||
 * This example shows how to do QSV-accelerated H.264 decoding with output
 | 
			
		||||
 * frames in the VA-API video surfaces.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "config.h"
 | 
			
		||||
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
 | 
			
		||||
#include <mfx/mfxvideo.h>
 | 
			
		||||
 | 
			
		||||
#include <va/va.h>
 | 
			
		||||
#include <va/va_x11.h>
 | 
			
		||||
#include <X11/Xlib.h>
 | 
			
		||||
 | 
			
		||||
#include "libavformat/avformat.h"
 | 
			
		||||
#include "libavformat/avio.h"
 | 
			
		||||
 | 
			
		||||
#include "libavcodec/avcodec.h"
 | 
			
		||||
#include "libavcodec/qsv.h"
 | 
			
		||||
 | 
			
		||||
#include "libavutil/error.h"
 | 
			
		||||
#include "libavutil/mem.h"
 | 
			
		||||
 | 
			
		||||
typedef struct DecodeContext {
 | 
			
		||||
    mfxSession mfx_session;
 | 
			
		||||
    VADisplay va_dpy;
 | 
			
		||||
 | 
			
		||||
    VASurfaceID *surfaces;
 | 
			
		||||
    mfxMemId    *surface_ids;
 | 
			
		||||
    int         *surface_used;
 | 
			
		||||
    int       nb_surfaces;
 | 
			
		||||
 | 
			
		||||
    mfxFrameInfo frame_info;
 | 
			
		||||
} DecodeContext;
 | 
			
		||||
 | 
			
		||||
static mfxStatus frame_alloc(mfxHDL pthis, mfxFrameAllocRequest *req,
 | 
			
		||||
                             mfxFrameAllocResponse *resp)
 | 
			
		||||
{
 | 
			
		||||
    DecodeContext *decode = pthis;
 | 
			
		||||
    int err, i;
 | 
			
		||||
 | 
			
		||||
    if (decode->surfaces) {
 | 
			
		||||
        fprintf(stderr, "Multiple allocation requests.\n");
 | 
			
		||||
        return MFX_ERR_MEMORY_ALLOC;
 | 
			
		||||
    }
 | 
			
		||||
    if (!(req->Type & MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET)) {
 | 
			
		||||
        fprintf(stderr, "Unsupported surface type: %d\n", req->Type);
 | 
			
		||||
        return MFX_ERR_UNSUPPORTED;
 | 
			
		||||
    }
 | 
			
		||||
    if (req->Info.BitDepthLuma != 8 || req->Info.BitDepthChroma != 8 ||
 | 
			
		||||
        req->Info.Shift || req->Info.FourCC != MFX_FOURCC_NV12 ||
 | 
			
		||||
        req->Info.ChromaFormat != MFX_CHROMAFORMAT_YUV420) {
 | 
			
		||||
        fprintf(stderr, "Unsupported surface properties.\n");
 | 
			
		||||
        return MFX_ERR_UNSUPPORTED;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    decode->surfaces     = av_malloc_array (req->NumFrameSuggested, sizeof(*decode->surfaces));
 | 
			
		||||
    decode->surface_ids  = av_malloc_array (req->NumFrameSuggested, sizeof(*decode->surface_ids));
 | 
			
		||||
    decode->surface_used = av_mallocz_array(req->NumFrameSuggested, sizeof(*decode->surface_used));
 | 
			
		||||
    if (!decode->surfaces || !decode->surface_ids || !decode->surface_used)
 | 
			
		||||
        goto fail;
 | 
			
		||||
 | 
			
		||||
    err = vaCreateSurfaces(decode->va_dpy, VA_RT_FORMAT_YUV420,
 | 
			
		||||
                           req->Info.Width, req->Info.Height,
 | 
			
		||||
                           decode->surfaces, req->NumFrameSuggested,
 | 
			
		||||
                           NULL, 0);
 | 
			
		||||
    if (err != VA_STATUS_SUCCESS) {
 | 
			
		||||
        fprintf(stderr, "Error allocating VA surfaces\n");
 | 
			
		||||
        goto fail;
 | 
			
		||||
    }
 | 
			
		||||
    decode->nb_surfaces = req->NumFrameSuggested;
 | 
			
		||||
 | 
			
		||||
    for (i = 0; i < decode->nb_surfaces; i++)
 | 
			
		||||
        decode->surface_ids[i] = &decode->surfaces[i];
 | 
			
		||||
 | 
			
		||||
    resp->mids           = decode->surface_ids;
 | 
			
		||||
    resp->NumFrameActual = decode->nb_surfaces;
 | 
			
		||||
 | 
			
		||||
    decode->frame_info = req->Info;
 | 
			
		||||
 | 
			
		||||
    return MFX_ERR_NONE;
 | 
			
		||||
fail:
 | 
			
		||||
    av_freep(&decode->surfaces);
 | 
			
		||||
    av_freep(&decode->surface_ids);
 | 
			
		||||
    av_freep(&decode->surface_used);
 | 
			
		||||
 | 
			
		||||
    return MFX_ERR_MEMORY_ALLOC;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static mfxStatus frame_free(mfxHDL pthis, mfxFrameAllocResponse *resp)
 | 
			
		||||
{
 | 
			
		||||
    DecodeContext *decode = pthis;
 | 
			
		||||
 | 
			
		||||
    if (decode->surfaces)
 | 
			
		||||
        vaDestroySurfaces(decode->va_dpy, decode->surfaces, decode->nb_surfaces);
 | 
			
		||||
    av_freep(&decode->surfaces);
 | 
			
		||||
    av_freep(&decode->surface_ids);
 | 
			
		||||
    av_freep(&decode->surface_used);
 | 
			
		||||
    decode->nb_surfaces = 0;
 | 
			
		||||
 | 
			
		||||
    return MFX_ERR_NONE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static mfxStatus frame_lock(mfxHDL pthis, mfxMemId mid, mfxFrameData *ptr)
 | 
			
		||||
{
 | 
			
		||||
    return MFX_ERR_UNSUPPORTED;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static mfxStatus frame_unlock(mfxHDL pthis, mfxMemId mid, mfxFrameData *ptr)
 | 
			
		||||
{
 | 
			
		||||
    return MFX_ERR_UNSUPPORTED;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static mfxStatus frame_get_hdl(mfxHDL pthis, mfxMemId mid, mfxHDL *hdl)
 | 
			
		||||
{
 | 
			
		||||
    *hdl = mid;
 | 
			
		||||
    return MFX_ERR_NONE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void free_buffer(void *opaque, uint8_t *data)
 | 
			
		||||
{
 | 
			
		||||
    int *used = opaque;
 | 
			
		||||
    *used = 0;
 | 
			
		||||
    av_freep(&data);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
 | 
			
		||||
{
 | 
			
		||||
    DecodeContext *decode = avctx->opaque;
 | 
			
		||||
 | 
			
		||||
    mfxFrameSurface1 *surf;
 | 
			
		||||
    AVBufferRef *surf_buf;
 | 
			
		||||
    int idx;
 | 
			
		||||
 | 
			
		||||
    for (idx = 0; idx < decode->nb_surfaces; idx++) {
 | 
			
		||||
        if (!decode->surface_used[idx])
 | 
			
		||||
            break;
 | 
			
		||||
    }
 | 
			
		||||
    if (idx == decode->nb_surfaces) {
 | 
			
		||||
        fprintf(stderr, "No free surfaces\n");
 | 
			
		||||
        return AVERROR(ENOMEM);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    surf = av_mallocz(sizeof(*surf));
 | 
			
		||||
    if (!surf)
 | 
			
		||||
        return AVERROR(ENOMEM);
 | 
			
		||||
    surf_buf = av_buffer_create((uint8_t*)surf, sizeof(*surf), free_buffer,
 | 
			
		||||
                                &decode->surface_used[idx], AV_BUFFER_FLAG_READONLY);
 | 
			
		||||
    if (!surf_buf) {
 | 
			
		||||
        av_freep(&surf);
 | 
			
		||||
        return AVERROR(ENOMEM);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    surf->Info       = decode->frame_info;
 | 
			
		||||
    surf->Data.MemId = &decode->surfaces[idx];
 | 
			
		||||
 | 
			
		||||
    frame->buf[0]  = surf_buf;
 | 
			
		||||
    frame->data[3] = (uint8_t*)surf;
 | 
			
		||||
 | 
			
		||||
    decode->surface_used[idx] = 1;
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int get_format(AVCodecContext *avctx, const enum AVPixelFormat *pix_fmts)
 | 
			
		||||
{
 | 
			
		||||
    while (*pix_fmts != AV_PIX_FMT_NONE) {
 | 
			
		||||
        if (*pix_fmts == AV_PIX_FMT_QSV) {
 | 
			
		||||
            if (!avctx->hwaccel_context) {
 | 
			
		||||
                DecodeContext *decode = avctx->opaque;
 | 
			
		||||
                AVQSVContext *qsv = av_qsv_alloc_context();
 | 
			
		||||
                if (!qsv)
 | 
			
		||||
                    return AV_PIX_FMT_NONE;
 | 
			
		||||
 | 
			
		||||
                qsv->session   = decode->mfx_session;
 | 
			
		||||
                qsv->iopattern = MFX_IOPATTERN_OUT_VIDEO_MEMORY;
 | 
			
		||||
 | 
			
		||||
                avctx->hwaccel_context = qsv;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            return AV_PIX_FMT_QSV;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        pix_fmts++;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    fprintf(stderr, "The QSV pixel format not offered in get_format()\n");
 | 
			
		||||
 | 
			
		||||
    return AV_PIX_FMT_NONE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int decode_packet(DecodeContext *decode, AVCodecContext *decoder_ctx,
 | 
			
		||||
                         AVFrame *frame, AVPacket *pkt,
 | 
			
		||||
                         AVIOContext *output_ctx)
 | 
			
		||||
{
 | 
			
		||||
    int ret = 0;
 | 
			
		||||
    int got_frame = 1;
 | 
			
		||||
 | 
			
		||||
    while (pkt->size > 0 || (!pkt->data && got_frame)) {
 | 
			
		||||
        ret = avcodec_decode_video2(decoder_ctx, frame, &got_frame, pkt);
 | 
			
		||||
        if (ret < 0) {
 | 
			
		||||
            fprintf(stderr, "Error during decoding\n");
 | 
			
		||||
            return ret;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        pkt->data += ret;
 | 
			
		||||
        pkt->size -= ret;
 | 
			
		||||
 | 
			
		||||
        /* A real program would do something useful with the decoded frame here.
 | 
			
		||||
         * We just retrieve the raw data and write it to a file, which is rather
 | 
			
		||||
         * useless but pedagogic. */
 | 
			
		||||
        if (got_frame) {
 | 
			
		||||
            mfxFrameSurface1 *surf = (mfxFrameSurface1*)frame->data[3];
 | 
			
		||||
            VASurfaceID    surface = *(VASurfaceID*)surf->Data.MemId;
 | 
			
		||||
 | 
			
		||||
            VAImageFormat img_fmt = {
 | 
			
		||||
                .fourcc         = VA_FOURCC_NV12,
 | 
			
		||||
                .byte_order     = VA_LSB_FIRST,
 | 
			
		||||
                .bits_per_pixel = 8,
 | 
			
		||||
                .depth          = 8,
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
            VAImage img;
 | 
			
		||||
 | 
			
		||||
            VAStatus err;
 | 
			
		||||
            uint8_t *data;
 | 
			
		||||
            int i, j;
 | 
			
		||||
 | 
			
		||||
            img.buf      = VA_INVALID_ID;
 | 
			
		||||
            img.image_id = VA_INVALID_ID;
 | 
			
		||||
 | 
			
		||||
            err = vaCreateImage(decode->va_dpy, &img_fmt,
 | 
			
		||||
                                frame->width, frame->height, &img);
 | 
			
		||||
            if (err != VA_STATUS_SUCCESS) {
 | 
			
		||||
                fprintf(stderr, "Error creating an image: %s\n",
 | 
			
		||||
                        vaErrorStr(err));
 | 
			
		||||
                ret = AVERROR_UNKNOWN;
 | 
			
		||||
                goto fail;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            err = vaGetImage(decode->va_dpy, surface, 0, 0,
 | 
			
		||||
                             frame->width, frame->height,
 | 
			
		||||
                             img.image_id);
 | 
			
		||||
            if (err != VA_STATUS_SUCCESS) {
 | 
			
		||||
                fprintf(stderr, "Error getting an image: %s\n",
 | 
			
		||||
                        vaErrorStr(err));
 | 
			
		||||
                ret = AVERROR_UNKNOWN;
 | 
			
		||||
                goto fail;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            err = vaMapBuffer(decode->va_dpy, img.buf, (void**)&data);
 | 
			
		||||
            if (err != VA_STATUS_SUCCESS) {
 | 
			
		||||
                fprintf(stderr, "Error mapping the image buffer: %s\n",
 | 
			
		||||
                        vaErrorStr(err));
 | 
			
		||||
                ret = AVERROR_UNKNOWN;
 | 
			
		||||
                goto fail;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            for (i = 0; i < img.num_planes; i++)
 | 
			
		||||
                for (j = 0; j < (img.height >> (i > 0)); j++)
 | 
			
		||||
                    avio_write(output_ctx, data + img.offsets[i] + j * img.pitches[i], img.width);
 | 
			
		||||
 | 
			
		||||
fail:
 | 
			
		||||
            if (img.buf != VA_INVALID_ID)
 | 
			
		||||
                vaUnmapBuffer(decode->va_dpy, img.buf);
 | 
			
		||||
            if (img.image_id != VA_INVALID_ID)
 | 
			
		||||
                vaDestroyImage(decode->va_dpy, img.image_id);
 | 
			
		||||
            av_frame_unref(frame);
 | 
			
		||||
 | 
			
		||||
            if (ret < 0)
 | 
			
		||||
                return ret;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int main(int argc, char **argv)
 | 
			
		||||
{
 | 
			
		||||
    AVFormatContext *input_ctx = NULL;
 | 
			
		||||
    AVStream *video_st = NULL;
 | 
			
		||||
    AVCodecContext *decoder_ctx = NULL;
 | 
			
		||||
    const AVCodec *decoder;
 | 
			
		||||
 | 
			
		||||
    AVPacket pkt = { 0 };
 | 
			
		||||
    AVFrame *frame = NULL;
 | 
			
		||||
 | 
			
		||||
    DecodeContext decode = { NULL };
 | 
			
		||||
 | 
			
		||||
    Display *dpy = NULL;
 | 
			
		||||
    int va_ver_major, va_ver_minor;
 | 
			
		||||
 | 
			
		||||
    mfxIMPL mfx_impl = MFX_IMPL_AUTO_ANY;
 | 
			
		||||
    mfxVersion mfx_ver = { { 1, 1 } };
 | 
			
		||||
 | 
			
		||||
    mfxFrameAllocator frame_allocator = {
 | 
			
		||||
        .pthis = &decode,
 | 
			
		||||
        .Alloc = frame_alloc,
 | 
			
		||||
        .Lock  = frame_lock,
 | 
			
		||||
        .Unlock = frame_unlock,
 | 
			
		||||
        .GetHDL = frame_get_hdl,
 | 
			
		||||
        .Free   = frame_free,
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    AVIOContext *output_ctx = NULL;
 | 
			
		||||
 | 
			
		||||
    int ret, i, err;
 | 
			
		||||
 | 
			
		||||
    av_register_all();
 | 
			
		||||
 | 
			
		||||
    if (argc < 3) {
 | 
			
		||||
        fprintf(stderr, "Usage: %s <input file> <output file>\n", argv[0]);
 | 
			
		||||
        return 1;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* open the input file */
 | 
			
		||||
    ret = avformat_open_input(&input_ctx, argv[1], NULL, NULL);
 | 
			
		||||
    if (ret < 0) {
 | 
			
		||||
        fprintf(stderr, "Cannot open input file '%s': ", argv[1]);
 | 
			
		||||
        goto finish;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* find the first H.264 video stream */
 | 
			
		||||
    for (i = 0; i < input_ctx->nb_streams; i++) {
 | 
			
		||||
        AVStream *st = input_ctx->streams[i];
 | 
			
		||||
 | 
			
		||||
        if (st->codec->codec_id == AV_CODEC_ID_H264 && !video_st)
 | 
			
		||||
            video_st = st;
 | 
			
		||||
        else
 | 
			
		||||
            st->discard = AVDISCARD_ALL;
 | 
			
		||||
    }
 | 
			
		||||
    if (!video_st) {
 | 
			
		||||
        fprintf(stderr, "No H.264 video stream in the input file\n");
 | 
			
		||||
        goto finish;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* initialize VA-API */
 | 
			
		||||
    dpy = XOpenDisplay(NULL);
 | 
			
		||||
    if (!dpy) {
 | 
			
		||||
        fprintf(stderr, "Cannot open the X display\n");
 | 
			
		||||
        goto finish;
 | 
			
		||||
    }
 | 
			
		||||
    decode.va_dpy = vaGetDisplay(dpy);
 | 
			
		||||
    if (!decode.va_dpy) {
 | 
			
		||||
        fprintf(stderr, "Cannot open the VA display\n");
 | 
			
		||||
        goto finish;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    err = vaInitialize(decode.va_dpy, &va_ver_major, &va_ver_minor);
 | 
			
		||||
    if (err != VA_STATUS_SUCCESS) {
 | 
			
		||||
        fprintf(stderr, "Cannot initialize VA: %s\n", vaErrorStr(err));
 | 
			
		||||
        goto finish;
 | 
			
		||||
    }
 | 
			
		||||
    fprintf(stderr, "Initialized VA v%d.%d\n", va_ver_major, va_ver_minor);
 | 
			
		||||
 | 
			
		||||
    /* initialize an MFX session */
 | 
			
		||||
    err = MFXInit(mfx_impl, &mfx_ver, &decode.mfx_session);
 | 
			
		||||
    if (err != MFX_ERR_NONE) {
 | 
			
		||||
        fprintf(stderr, "Error initializing an MFX session\n");
 | 
			
		||||
        goto finish;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    MFXVideoCORE_SetHandle(decode.mfx_session, MFX_HANDLE_VA_DISPLAY, decode.va_dpy);
 | 
			
		||||
    MFXVideoCORE_SetFrameAllocator(decode.mfx_session, &frame_allocator);
 | 
			
		||||
 | 
			
		||||
    /* initialize the decoder */
 | 
			
		||||
    decoder = avcodec_find_decoder_by_name("h264_qsv");
 | 
			
		||||
    if (!decoder) {
 | 
			
		||||
        fprintf(stderr, "The QSV decoder is not present in libavcodec\n");
 | 
			
		||||
        goto finish;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    decoder_ctx = avcodec_alloc_context3(decoder);
 | 
			
		||||
    if (!decoder_ctx) {
 | 
			
		||||
        ret = AVERROR(ENOMEM);
 | 
			
		||||
        goto finish;
 | 
			
		||||
    }
 | 
			
		||||
    decoder_ctx->codec_id = AV_CODEC_ID_H264;
 | 
			
		||||
    if (video_st->codec->extradata_size) {
 | 
			
		||||
        decoder_ctx->extradata = av_mallocz(video_st->codec->extradata_size +
 | 
			
		||||
                                            AV_INPUT_BUFFER_PADDING_SIZE);
 | 
			
		||||
        if (!decoder_ctx->extradata) {
 | 
			
		||||
            ret = AVERROR(ENOMEM);
 | 
			
		||||
            goto finish;
 | 
			
		||||
        }
 | 
			
		||||
        memcpy(decoder_ctx->extradata, video_st->codec->extradata,
 | 
			
		||||
               video_st->codec->extradata_size);
 | 
			
		||||
        decoder_ctx->extradata_size = video_st->codec->extradata_size;
 | 
			
		||||
    }
 | 
			
		||||
    decoder_ctx->refcounted_frames = 1;
 | 
			
		||||
 | 
			
		||||
    decoder_ctx->opaque      = &decode;
 | 
			
		||||
    decoder_ctx->get_buffer2 = get_buffer;
 | 
			
		||||
    decoder_ctx->get_format  = get_format;
 | 
			
		||||
 | 
			
		||||
    ret = avcodec_open2(decoder_ctx, NULL, NULL);
 | 
			
		||||
    if (ret < 0) {
 | 
			
		||||
        fprintf(stderr, "Error opening the decoder: ");
 | 
			
		||||
        goto finish;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* open the output stream */
 | 
			
		||||
    ret = avio_open(&output_ctx, argv[2], AVIO_FLAG_WRITE);
 | 
			
		||||
    if (ret < 0) {
 | 
			
		||||
        fprintf(stderr, "Error opening the output context: ");
 | 
			
		||||
        goto finish;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    frame = av_frame_alloc();
 | 
			
		||||
    if (!frame) {
 | 
			
		||||
        ret = AVERROR(ENOMEM);
 | 
			
		||||
        goto finish;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* actual decoding */
 | 
			
		||||
    while (ret >= 0) {
 | 
			
		||||
        ret = av_read_frame(input_ctx, &pkt);
 | 
			
		||||
        if (ret < 0)
 | 
			
		||||
            break;
 | 
			
		||||
 | 
			
		||||
        if (pkt.stream_index == video_st->index)
 | 
			
		||||
            ret = decode_packet(&decode, decoder_ctx, frame, &pkt, output_ctx);
 | 
			
		||||
 | 
			
		||||
        av_packet_unref(&pkt);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* flush the decoder */
 | 
			
		||||
    pkt.data = NULL;
 | 
			
		||||
    pkt.size = 0;
 | 
			
		||||
    ret = decode_packet(&decode, decoder_ctx, frame, &pkt, output_ctx);
 | 
			
		||||
 | 
			
		||||
finish:
 | 
			
		||||
    if (ret < 0) {
 | 
			
		||||
        char buf[1024];
 | 
			
		||||
        av_strerror(ret, buf, sizeof(buf));
 | 
			
		||||
        fprintf(stderr, "%s\n", buf);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    avformat_close_input(&input_ctx);
 | 
			
		||||
 | 
			
		||||
    av_frame_free(&frame);
 | 
			
		||||
 | 
			
		||||
    if (decode.mfx_session)
 | 
			
		||||
        MFXClose(decode.mfx_session);
 | 
			
		||||
    if (decode.va_dpy)
 | 
			
		||||
        vaTerminate(decode.va_dpy);
 | 
			
		||||
    if (dpy)
 | 
			
		||||
        XCloseDisplay(dpy);
 | 
			
		||||
 | 
			
		||||
    if (decoder_ctx)
 | 
			
		||||
        av_freep(&decoder_ctx->hwaccel_context);
 | 
			
		||||
    avcodec_free_context(&decoder_ctx);
 | 
			
		||||
 | 
			
		||||
    avio_close(output_ctx);
 | 
			
		||||
 | 
			
		||||
    return ret;
 | 
			
		||||
}
 | 
			
		||||
@@ -101,7 +101,7 @@ int main(int argc, char **argv)
 | 
			
		||||
        }
 | 
			
		||||
        out_stream->codec->codec_tag = 0;
 | 
			
		||||
        if (ofmt_ctx->oformat->flags & AVFMT_GLOBALHEADER)
 | 
			
		||||
            out_stream->codec->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
 | 
			
		||||
            out_stream->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
 | 
			
		||||
    }
 | 
			
		||||
    av_dump_format(ofmt_ctx, 0, out_filename, 1);
 | 
			
		||||
 | 
			
		||||
@@ -153,7 +153,7 @@ end:
 | 
			
		||||
 | 
			
		||||
    /* close output */
 | 
			
		||||
    if (ofmt_ctx && !(ofmt->flags & AVFMT_NOFILE))
 | 
			
		||||
        avio_closep(&ofmt_ctx->pb);
 | 
			
		||||
        avio_close(ofmt_ctx->pb);
 | 
			
		||||
    avformat_free_context(ofmt_ctx);
 | 
			
		||||
 | 
			
		||||
    if (ret < 0 && ret != AVERROR_EOF) {
 | 
			
		||||
 
 | 
			
		||||
@@ -41,9 +41,11 @@
 | 
			
		||||
#include "libswresample/swresample.h"
 | 
			
		||||
 | 
			
		||||
/** The output bit rate in kbit/s */
 | 
			
		||||
#define OUTPUT_BIT_RATE 96000
 | 
			
		||||
#define OUTPUT_BIT_RATE 48000
 | 
			
		||||
/** The number of output channels */
 | 
			
		||||
#define OUTPUT_CHANNELS 2
 | 
			
		||||
/** The audio sample output format */
 | 
			
		||||
#define OUTPUT_SAMPLE_FORMAT AV_SAMPLE_FMT_S16
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Convert an error code into a text message.
 | 
			
		||||
@@ -167,7 +169,7 @@ static int open_output_file(const char *filename,
 | 
			
		||||
        goto cleanup;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /** Save the encoder context for easier access later. */
 | 
			
		||||
    /** Save the encoder context for easiert access later. */
 | 
			
		||||
    *output_codec_context = stream->codec;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@@ -177,22 +179,15 @@ static int open_output_file(const char *filename,
 | 
			
		||||
    (*output_codec_context)->channels       = OUTPUT_CHANNELS;
 | 
			
		||||
    (*output_codec_context)->channel_layout = av_get_default_channel_layout(OUTPUT_CHANNELS);
 | 
			
		||||
    (*output_codec_context)->sample_rate    = input_codec_context->sample_rate;
 | 
			
		||||
    (*output_codec_context)->sample_fmt     = output_codec->sample_fmts[0];
 | 
			
		||||
    (*output_codec_context)->sample_fmt     = AV_SAMPLE_FMT_S16;
 | 
			
		||||
    (*output_codec_context)->bit_rate       = OUTPUT_BIT_RATE;
 | 
			
		||||
 | 
			
		||||
    /** Allow the use of the experimental AAC encoder */
 | 
			
		||||
    (*output_codec_context)->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL;
 | 
			
		||||
 | 
			
		||||
    /** Set the sample rate for the container. */
 | 
			
		||||
    stream->time_base.den = input_codec_context->sample_rate;
 | 
			
		||||
    stream->time_base.num = 1;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Some container formats (like MP4) require global headers to be present
 | 
			
		||||
     * Mark the encoder so that it behaves accordingly.
 | 
			
		||||
     */
 | 
			
		||||
    if ((*output_format_context)->oformat->flags & AVFMT_GLOBALHEADER)
 | 
			
		||||
        (*output_codec_context)->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
 | 
			
		||||
        (*output_codec_context)->flags |= CODEC_FLAG_GLOBAL_HEADER;
 | 
			
		||||
 | 
			
		||||
    /** Open the encoder for the audio stream to use it later. */
 | 
			
		||||
    if ((error = avcodec_open2(*output_codec_context, output_codec, NULL)) < 0) {
 | 
			
		||||
@@ -204,7 +199,7 @@ static int open_output_file(const char *filename,
 | 
			
		||||
    return 0;
 | 
			
		||||
 | 
			
		||||
cleanup:
 | 
			
		||||
    avio_closep(&(*output_format_context)->pb);
 | 
			
		||||
    avio_close((*output_format_context)->pb);
 | 
			
		||||
    avformat_free_context(*output_format_context);
 | 
			
		||||
    *output_format_context = NULL;
 | 
			
		||||
    return error < 0 ? error : AVERROR_EXIT;
 | 
			
		||||
@@ -276,11 +271,10 @@ static int init_resampler(AVCodecContext *input_codec_context,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/** Initialize a FIFO buffer for the audio samples to be encoded. */
 | 
			
		||||
static int init_fifo(AVAudioFifo **fifo, AVCodecContext *output_codec_context)
 | 
			
		||||
static int init_fifo(AVAudioFifo **fifo)
 | 
			
		||||
{
 | 
			
		||||
    /** Create the FIFO buffer based on the specified output sample format. */
 | 
			
		||||
    if (!(*fifo = av_audio_fifo_alloc(output_codec_context->sample_fmt,
 | 
			
		||||
                                      output_codec_context->channels, 1))) {
 | 
			
		||||
    if (!(*fifo = av_audio_fifo_alloc(OUTPUT_SAMPLE_FORMAT, OUTPUT_CHANNELS, 1))) {
 | 
			
		||||
        fprintf(stderr, "Could not allocate FIFO\n");
 | 
			
		||||
        return AVERROR(ENOMEM);
 | 
			
		||||
    }
 | 
			
		||||
@@ -312,7 +306,7 @@ static int decode_audio_frame(AVFrame *frame,
 | 
			
		||||
 | 
			
		||||
    /** Read one audio frame from the input file into a temporary packet. */
 | 
			
		||||
    if ((error = av_read_frame(input_format_context, &input_packet)) < 0) {
 | 
			
		||||
        /** If we are at the end of the file, flush the decoder below. */
 | 
			
		||||
        /** If we are the the end of the file, flush the decoder below. */
 | 
			
		||||
        if (error == AVERROR_EOF)
 | 
			
		||||
            *finished = 1;
 | 
			
		||||
        else {
 | 
			
		||||
@@ -543,9 +537,6 @@ static int init_output_frame(AVFrame **frame,
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/** Global timestamp for the audio frames */
 | 
			
		||||
static int64_t pts = 0;
 | 
			
		||||
 | 
			
		||||
/** Encode one frame worth of audio to the output file. */
 | 
			
		||||
static int encode_audio_frame(AVFrame *frame,
 | 
			
		||||
                              AVFormatContext *output_format_context,
 | 
			
		||||
@@ -557,12 +548,6 @@ static int encode_audio_frame(AVFrame *frame,
 | 
			
		||||
    int error;
 | 
			
		||||
    init_packet(&output_packet);
 | 
			
		||||
 | 
			
		||||
    /** Set a timestamp based on the sample rate for the container. */
 | 
			
		||||
    if (frame) {
 | 
			
		||||
        frame->pts = pts;
 | 
			
		||||
        pts += frame->nb_samples;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Encode the audio frame and store it in the temporary packet.
 | 
			
		||||
     * The output audio stream encoder is used to do this.
 | 
			
		||||
@@ -674,7 +659,7 @@ int main(int argc, char **argv)
 | 
			
		||||
                       &resample_context))
 | 
			
		||||
        goto cleanup;
 | 
			
		||||
    /** Initialize the FIFO buffer to store audio samples to be encoded. */
 | 
			
		||||
    if (init_fifo(&fifo, output_codec_context))
 | 
			
		||||
    if (init_fifo(&fifo))
 | 
			
		||||
        goto cleanup;
 | 
			
		||||
    /** Write the header of the output file container. */
 | 
			
		||||
    if (write_output_file_header(output_format_context))
 | 
			
		||||
@@ -758,7 +743,7 @@ cleanup:
 | 
			
		||||
    if (output_codec_context)
 | 
			
		||||
        avcodec_close(output_codec_context);
 | 
			
		||||
    if (output_format_context) {
 | 
			
		||||
        avio_closep(&output_format_context->pb);
 | 
			
		||||
        avio_close(output_format_context->pb);
 | 
			
		||||
        avformat_free_context(output_format_context);
 | 
			
		||||
    }
 | 
			
		||||
    if (input_codec_context)
 | 
			
		||||
 
 | 
			
		||||
@@ -117,7 +117,7 @@ static int open_output_file(const char *filename)
 | 
			
		||||
            /* in this example, we choose transcoding to same codec */
 | 
			
		||||
            encoder = avcodec_find_encoder(dec_ctx->codec_id);
 | 
			
		||||
            if (!encoder) {
 | 
			
		||||
                av_log(NULL, AV_LOG_FATAL, "Necessary encoder not found\n");
 | 
			
		||||
                av_log(NULL, AV_LOG_FATAL, "Neccessary encoder not found\n");
 | 
			
		||||
                return AVERROR_INVALIDDATA;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
@@ -161,7 +161,7 @@ static int open_output_file(const char *filename)
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (ofmt_ctx->oformat->flags & AVFMT_GLOBALHEADER)
 | 
			
		||||
            enc_ctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
 | 
			
		||||
            enc_ctx->flags |= CODEC_FLAG_GLOBAL_HEADER;
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
    av_dump_format(ofmt_ctx, 0, filename, 1);
 | 
			
		||||
@@ -389,7 +389,15 @@ static int encode_write_frame(AVFrame *filt_frame, unsigned int stream_index, in
 | 
			
		||||
 | 
			
		||||
    /* prepare packet for muxing */
 | 
			
		||||
    enc_pkt.stream_index = stream_index;
 | 
			
		||||
    av_packet_rescale_ts(&enc_pkt,
 | 
			
		||||
    enc_pkt.dts = av_rescale_q_rnd(enc_pkt.dts,
 | 
			
		||||
            ofmt_ctx->streams[stream_index]->codec->time_base,
 | 
			
		||||
            ofmt_ctx->streams[stream_index]->time_base,
 | 
			
		||||
            AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
 | 
			
		||||
    enc_pkt.pts = av_rescale_q_rnd(enc_pkt.pts,
 | 
			
		||||
            ofmt_ctx->streams[stream_index]->codec->time_base,
 | 
			
		||||
            ofmt_ctx->streams[stream_index]->time_base,
 | 
			
		||||
            AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
 | 
			
		||||
    enc_pkt.duration = av_rescale_q(enc_pkt.duration,
 | 
			
		||||
            ofmt_ctx->streams[stream_index]->codec->time_base,
 | 
			
		||||
            ofmt_ctx->streams[stream_index]->time_base);
 | 
			
		||||
 | 
			
		||||
@@ -449,7 +457,7 @@ static int flush_encoder(unsigned int stream_index)
 | 
			
		||||
    int got_frame;
 | 
			
		||||
 | 
			
		||||
    if (!(ofmt_ctx->streams[stream_index]->codec->codec->capabilities &
 | 
			
		||||
                AV_CODEC_CAP_DELAY))
 | 
			
		||||
                CODEC_CAP_DELAY))
 | 
			
		||||
        return 0;
 | 
			
		||||
 | 
			
		||||
    while (1) {
 | 
			
		||||
@@ -505,9 +513,14 @@ int main(int argc, char **argv)
 | 
			
		||||
                ret = AVERROR(ENOMEM);
 | 
			
		||||
                break;
 | 
			
		||||
            }
 | 
			
		||||
            av_packet_rescale_ts(&packet,
 | 
			
		||||
            packet.dts = av_rescale_q_rnd(packet.dts,
 | 
			
		||||
                    ifmt_ctx->streams[stream_index]->time_base,
 | 
			
		||||
                                 ifmt_ctx->streams[stream_index]->codec->time_base);
 | 
			
		||||
                    ifmt_ctx->streams[stream_index]->codec->time_base,
 | 
			
		||||
                    AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
 | 
			
		||||
            packet.pts = av_rescale_q_rnd(packet.pts,
 | 
			
		||||
                    ifmt_ctx->streams[stream_index]->time_base,
 | 
			
		||||
                    ifmt_ctx->streams[stream_index]->codec->time_base,
 | 
			
		||||
                    AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
 | 
			
		||||
            dec_func = (type == AVMEDIA_TYPE_VIDEO) ? avcodec_decode_video2 :
 | 
			
		||||
                avcodec_decode_audio4;
 | 
			
		||||
            ret = dec_func(ifmt_ctx->streams[stream_index]->codec, frame,
 | 
			
		||||
@@ -529,9 +542,14 @@ int main(int argc, char **argv)
 | 
			
		||||
            }
 | 
			
		||||
        } else {
 | 
			
		||||
            /* remux this frame without reencoding */
 | 
			
		||||
            av_packet_rescale_ts(&packet,
 | 
			
		||||
            packet.dts = av_rescale_q_rnd(packet.dts,
 | 
			
		||||
                    ifmt_ctx->streams[stream_index]->time_base,
 | 
			
		||||
                                 ofmt_ctx->streams[stream_index]->time_base);
 | 
			
		||||
                    ofmt_ctx->streams[stream_index]->time_base,
 | 
			
		||||
                    AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
 | 
			
		||||
            packet.pts = av_rescale_q_rnd(packet.pts,
 | 
			
		||||
                    ifmt_ctx->streams[stream_index]->time_base,
 | 
			
		||||
                    ofmt_ctx->streams[stream_index]->time_base,
 | 
			
		||||
                    AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
 | 
			
		||||
 | 
			
		||||
            ret = av_interleaved_write_frame(ofmt_ctx, &packet);
 | 
			
		||||
            if (ret < 0)
 | 
			
		||||
@@ -573,7 +591,7 @@ end:
 | 
			
		||||
    av_free(filter_ctx);
 | 
			
		||||
    avformat_close_input(&ifmt_ctx);
 | 
			
		||||
    if (ofmt_ctx && !(ofmt_ctx->oformat->flags & AVFMT_NOFILE))
 | 
			
		||||
        avio_closep(&ofmt_ctx->pb);
 | 
			
		||||
        avio_close(ofmt_ctx->pb);
 | 
			
		||||
    avformat_free_context(ofmt_ctx);
 | 
			
		||||
 | 
			
		||||
    if (ret < 0)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										87
									
								
								doc/faq.texi
									
									
									
									
									
								
							
							
						
						
									
										87
									
								
								doc/faq.texi
									
									
									
									
									
								
							@@ -1,5 +1,4 @@
 | 
			
		||||
\input texinfo @c -*- texinfo -*-
 | 
			
		||||
@documentencoding UTF-8
 | 
			
		||||
 | 
			
		||||
@settitle FFmpeg FAQ
 | 
			
		||||
@titlepage
 | 
			
		||||
@@ -91,56 +90,6 @@ To build FFmpeg, you need to install the development package. It is usually
 | 
			
		||||
called @file{libfoo-dev} or @file{libfoo-devel}. You can remove it after the
 | 
			
		||||
build is finished, but be sure to keep the main package.
 | 
			
		||||
 | 
			
		||||
@section How do I make @command{pkg-config} find my libraries?
 | 
			
		||||
 | 
			
		||||
Somewhere along with your libraries, there is a @file{.pc} file (or several)
 | 
			
		||||
in a @file{pkgconfig} directory. You need to set environment variables to
 | 
			
		||||
point @command{pkg-config} to these files.
 | 
			
		||||
 | 
			
		||||
If you need to @emph{add} directories to @command{pkg-config}'s search list
 | 
			
		||||
(typical use case: library installed separately), add it to
 | 
			
		||||
@code{$PKG_CONFIG_PATH}:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
export PKG_CONFIG_PATH=/opt/x264/lib/pkgconfig:/opt/opus/lib/pkgconfig
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
If you need to @emph{replace} @command{pkg-config}'s search list
 | 
			
		||||
(typical use case: cross-compiling), set it in
 | 
			
		||||
@code{$PKG_CONFIG_LIBDIR}:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
export PKG_CONFIG_LIBDIR=/home/me/cross/usr/lib/pkgconfig:/home/me/cross/usr/local/lib/pkgconfig
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
If you need to know the library's internal dependencies (typical use: static
 | 
			
		||||
linking), add the @code{--static} option to @command{pkg-config}:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
./configure --pkg-config-flags=--static
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@section How do I use @command{pkg-config} when cross-compiling?
 | 
			
		||||
 | 
			
		||||
The best way is to install @command{pkg-config} in your cross-compilation
 | 
			
		||||
environment. It will automatically use the cross-compilation libraries.
 | 
			
		||||
 | 
			
		||||
You can also use @command{pkg-config} from the host environment by
 | 
			
		||||
specifying explicitly @code{--pkg-config=pkg-config} to @command{configure}.
 | 
			
		||||
In that case, you must point @command{pkg-config} to the correct directories
 | 
			
		||||
using the @code{PKG_CONFIG_LIBDIR}, as explained in the previous entry.
 | 
			
		||||
 | 
			
		||||
As an intermediate solution, you can place in your cross-compilation
 | 
			
		||||
environment a script that calls the host @command{pkg-config} with
 | 
			
		||||
@code{PKG_CONFIG_LIBDIR} set. That script can look like that:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
#!/bin/sh
 | 
			
		||||
PKG_CONFIG_LIBDIR=/path/to/cross/lib/pkgconfig
 | 
			
		||||
export PKG_CONFIG_LIBDIR
 | 
			
		||||
exec /usr/bin/pkg-config "$@@"
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@chapter Usage
 | 
			
		||||
 | 
			
		||||
@section ffmpeg does not work; what is wrong?
 | 
			
		||||
@@ -349,7 +298,7 @@ FFmpeg has a @url{http://ffmpeg.org/ffmpeg-protocols.html#concat,
 | 
			
		||||
@code{concat}} protocol designed specifically for that, with examples in the
 | 
			
		||||
documentation.
 | 
			
		||||
 | 
			
		||||
A few multimedia containers (MPEG-1, MPEG-2 PS, DV) allow one to concatenate
 | 
			
		||||
A few multimedia containers (MPEG-1, MPEG-2 PS, DV) allow to concatenate
 | 
			
		||||
video by merely concatenating the files containing them.
 | 
			
		||||
 | 
			
		||||
Hence you may concatenate your multimedia files by first transcoding them to
 | 
			
		||||
@@ -467,40 +416,6 @@ point acceptable for your tastes. The most common options to do that are
 | 
			
		||||
@option{-qscale} and @option{-qmax}, but you should peruse the documentation
 | 
			
		||||
of the encoder you chose.
 | 
			
		||||
 | 
			
		||||
@section I have a stretched video, why does scaling does not fix it?
 | 
			
		||||
 | 
			
		||||
A lot of video codecs and formats can store the @emph{aspect ratio} of the
 | 
			
		||||
video: this is the ratio between the width and the height of either the full
 | 
			
		||||
image (DAR, display aspect ratio) or individual pixels (SAR, sample aspect
 | 
			
		||||
ratio). For example, EGA screens at resolution 640×350 had 4:3 DAR and 35:48
 | 
			
		||||
SAR.
 | 
			
		||||
 | 
			
		||||
Most still image processing work with square pixels, i.e. 1:1 SAR, but a lot
 | 
			
		||||
of video standards, especially from the analogic-numeric transition era, use
 | 
			
		||||
non-square pixels.
 | 
			
		||||
 | 
			
		||||
Most processing filters in FFmpeg handle the aspect ratio to avoid
 | 
			
		||||
stretching the image: cropping adjusts the DAR to keep the SAR constant,
 | 
			
		||||
scaling adjusts the SAR to keep the DAR constant.
 | 
			
		||||
 | 
			
		||||
If you want to stretch, or “unstretch”, the image, you need to override the
 | 
			
		||||
information with the
 | 
			
		||||
@url{http://ffmpeg.org/ffmpeg-filters.html#setdar_002c-setsar, @code{setdar or setsar filters}}.
 | 
			
		||||
 | 
			
		||||
Do not forget to examine carefully the original video to check whether the
 | 
			
		||||
stretching comes from the image or from the aspect ratio information.
 | 
			
		||||
 | 
			
		||||
For example, to fix a badly encoded EGA capture, use the following commands,
 | 
			
		||||
either the first one to upscale to square pixels or the second one to set
 | 
			
		||||
the correct aspect ratio or the third one to avoid transcoding (may not work
 | 
			
		||||
depending on the format / codec / player / phase of the moon):
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i ega_screen.nut -vf scale=640:480,setsar=1 ega_screen_scaled.nut
 | 
			
		||||
ffmpeg -i ega_screen.nut -vf setdar=4/3 ega_screen_anamorphic.nut
 | 
			
		||||
ffmpeg -i ega_screen.nut -aspect 4/3 -c copy ega_screen_overridden.nut
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@chapter Development
 | 
			
		||||
 | 
			
		||||
@section Are there examples illustrating how to use the FFmpeg libraries, particularly libavcodec and libavformat?
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,4 @@
 | 
			
		||||
\input texinfo @c -*- texinfo -*-
 | 
			
		||||
@documentencoding UTF-8
 | 
			
		||||
 | 
			
		||||
@settitle FFmpeg Automated Testing Environment
 | 
			
		||||
@titlepage
 | 
			
		||||
@@ -54,8 +53,8 @@ make fate       SAMPLES=fate-suite/
 | 
			
		||||
  The above commands set the samples location by passing a makefile
 | 
			
		||||
variable via command line. It is also possible to set the samples
 | 
			
		||||
location at source configuration time by invoking configure with
 | 
			
		||||
@option{--samples=<path to the samples directory>}. Afterwards you can
 | 
			
		||||
invoke the makefile targets without setting the @var{SAMPLES} makefile
 | 
			
		||||
`--samples=<path to the samples directory>'. Afterwards you can
 | 
			
		||||
invoke the makefile targets without setting the SAMPLES makefile
 | 
			
		||||
variable. This is illustrated by the following commands:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
@@ -102,14 +101,14 @@ The mentioned configuration template is also available here:
 | 
			
		||||
@end ifhtml
 | 
			
		||||
 | 
			
		||||
  Create a configuration that suits your needs, based on the configuration
 | 
			
		||||
template. The @env{slot} configuration variable can be any string that is not
 | 
			
		||||
template. The `slot' configuration variable can be any string that is not
 | 
			
		||||
yet used, but it is suggested that you name it adhering to the following
 | 
			
		||||
pattern @samp{@var{arch}-@var{os}-@var{compiler}-@var{compiler version}}. The
 | 
			
		||||
configuration file itself will be sourced in a shell script, therefore all
 | 
			
		||||
shell features may be used. This enables you to setup the environment as you
 | 
			
		||||
need it for your build.
 | 
			
		||||
pattern <arch>-<os>-<compiler>-<compiler version>. The configuration file
 | 
			
		||||
itself will be sourced in a shell script, therefore all shell features may
 | 
			
		||||
be used. This enables you to setup the environment as you need it for your
 | 
			
		||||
build.
 | 
			
		||||
 | 
			
		||||
For your first test runs the @env{fate_recv} variable should be empty or
 | 
			
		||||
  For your first test runs the `fate_recv' variable should be empty or
 | 
			
		||||
commented out. This will run everything as normal except that it will omit
 | 
			
		||||
the submission of the results to the server. The following files should be
 | 
			
		||||
present in $workdir as specified in the configuration file:
 | 
			
		||||
@@ -132,7 +131,7 @@ of the server and to accept its host key. This can usually be achieved by
 | 
			
		||||
running your SSH client manually and killing it after you accepted the key.
 | 
			
		||||
The FATE server's fingerprint is:
 | 
			
		||||
 | 
			
		||||
@table @samp
 | 
			
		||||
@table @option
 | 
			
		||||
@item RSA
 | 
			
		||||
   d3:f1:83:97:a4:75:2b:a6:fb:d6:e8:aa:81:93:97:51
 | 
			
		||||
@item ECDSA
 | 
			
		||||
@@ -165,7 +164,7 @@ Run the FATE test suite (requires the fate-suite dataset).
 | 
			
		||||
 | 
			
		||||
@section Makefile variables
 | 
			
		||||
 | 
			
		||||
@table @env
 | 
			
		||||
@table @option
 | 
			
		||||
@item V
 | 
			
		||||
Verbosity level, can be set to 0, 1 or 2.
 | 
			
		||||
    @itemize
 | 
			
		||||
@@ -183,20 +182,20 @@ Specify how many threads to use while running regression tests, it is
 | 
			
		||||
quite useful to detect thread-related regressions.
 | 
			
		||||
 | 
			
		||||
@item THREAD_TYPE
 | 
			
		||||
Specify which threading strategy test, either @samp{slice} or @samp{frame},
 | 
			
		||||
by default @samp{slice+frame}
 | 
			
		||||
Specify which threading strategy test, either @var{slice} or @var{frame},
 | 
			
		||||
by default @var{slice+frame}
 | 
			
		||||
 | 
			
		||||
@item CPUFLAGS
 | 
			
		||||
Specify CPU flags.
 | 
			
		||||
 | 
			
		||||
@item TARGET_EXEC
 | 
			
		||||
Specify or override the wrapper used to run the tests.
 | 
			
		||||
The @env{TARGET_EXEC} option provides a way to run FATE wrapped in
 | 
			
		||||
The @var{TARGET_EXEC} option provides a way to run FATE wrapped in
 | 
			
		||||
@command{valgrind}, @command{qemu-user} or @command{wine} or on remote targets
 | 
			
		||||
through @command{ssh}.
 | 
			
		||||
 | 
			
		||||
@item GEN
 | 
			
		||||
Set to @samp{1} to generate the missing or mismatched references.
 | 
			
		||||
Set to @var{1} to generate the missing or mismatched references.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section Examples
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,5 @@
 | 
			
		||||
slot=                                    # some unique identifier
 | 
			
		||||
repo=git://source.ffmpeg.org/ffmpeg.git  # the source repository
 | 
			
		||||
#branch=release/2.6                       # the branch to test
 | 
			
		||||
samples=                                 # path to samples directory
 | 
			
		||||
workdir=                                 # directory in which to do all the work
 | 
			
		||||
#fate_recv="ssh -T fate@fate.ffmpeg.org" # command to submit report
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,4 @@
 | 
			
		||||
\input texinfo @c -*- texinfo -*-
 | 
			
		||||
@documentencoding UTF-8
 | 
			
		||||
 | 
			
		||||
@settitle FFmpeg Bitstream Filters Documentation
 | 
			
		||||
@titlepage
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,4 @@
 | 
			
		||||
\input texinfo @c -*- texinfo -*-
 | 
			
		||||
@documentencoding UTF-8
 | 
			
		||||
 | 
			
		||||
@settitle FFmpeg Codecs Documentation
 | 
			
		||||
@titlepage
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,4 @@
 | 
			
		||||
\input texinfo @c -*- texinfo -*-
 | 
			
		||||
@documentencoding UTF-8
 | 
			
		||||
 | 
			
		||||
@settitle FFmpeg Devices Documentation
 | 
			
		||||
@titlepage
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,4 @@
 | 
			
		||||
\input texinfo @c -*- texinfo -*-
 | 
			
		||||
@documentencoding UTF-8
 | 
			
		||||
 | 
			
		||||
@settitle FFmpeg Filters Documentation
 | 
			
		||||
@titlepage
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,4 @@
 | 
			
		||||
\input texinfo @c -*- texinfo -*-
 | 
			
		||||
@documentencoding UTF-8
 | 
			
		||||
 | 
			
		||||
@settitle FFmpeg Formats Documentation
 | 
			
		||||
@titlepage
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,4 @@
 | 
			
		||||
\input texinfo @c -*- texinfo -*-
 | 
			
		||||
@documentencoding UTF-8
 | 
			
		||||
 | 
			
		||||
@settitle FFmpeg Protocols Documentation
 | 
			
		||||
@titlepage
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,4 @@
 | 
			
		||||
\input texinfo @c -*- texinfo -*-
 | 
			
		||||
@documentencoding UTF-8
 | 
			
		||||
 | 
			
		||||
@settitle FFmpeg Resampler Documentation
 | 
			
		||||
@titlepage
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,4 @@
 | 
			
		||||
\input texinfo @c -*- texinfo -*-
 | 
			
		||||
@documentencoding UTF-8
 | 
			
		||||
 | 
			
		||||
@settitle FFmpeg Scaler Documentation
 | 
			
		||||
@titlepage
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,4 @@
 | 
			
		||||
\input texinfo @c -*- texinfo -*-
 | 
			
		||||
@documentencoding UTF-8
 | 
			
		||||
 | 
			
		||||
@settitle FFmpeg Utilities Documentation
 | 
			
		||||
@titlepage
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										181
									
								
								doc/ffmpeg.texi
									
									
									
									
									
								
							
							
						
						
									
										181
									
								
								doc/ffmpeg.texi
									
									
									
									
									
								
							@@ -1,5 +1,4 @@
 | 
			
		||||
\input texinfo @c -*- texinfo -*-
 | 
			
		||||
@documentencoding UTF-8
 | 
			
		||||
 | 
			
		||||
@settitle ffmpeg Documentation
 | 
			
		||||
@titlepage
 | 
			
		||||
@@ -80,7 +79,7 @@ The format option may be needed for raw input files.
 | 
			
		||||
The transcoding process in @command{ffmpeg} for each output can be described by
 | 
			
		||||
the following diagram:
 | 
			
		||||
 | 
			
		||||
@verbatim
 | 
			
		||||
@example
 | 
			
		||||
 _______              ______________
 | 
			
		||||
|       |            |              |
 | 
			
		||||
| input |  demuxer   | encoded data |   decoder
 | 
			
		||||
@@ -99,7 +98,7 @@ the following diagram:
 | 
			
		||||
|________|           |______________|
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@end verbatim
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@command{ffmpeg} calls the libavformat library (containing demuxers) to read
 | 
			
		||||
input files and get packets containing encoded data from them. When there are
 | 
			
		||||
@@ -124,7 +123,7 @@ Simple filtergraphs are those that have exactly one input and output, both of
 | 
			
		||||
the same type. In the above diagram they can be represented by simply inserting
 | 
			
		||||
an additional step between decoding and encoding:
 | 
			
		||||
 | 
			
		||||
@verbatim
 | 
			
		||||
@example
 | 
			
		||||
 _________                        ______________
 | 
			
		||||
|         |                      |              |
 | 
			
		||||
| decoded |                      | encoded data |
 | 
			
		||||
@@ -136,19 +135,19 @@ an additional step between decoding and encoding:
 | 
			
		||||
                | frames   |
 | 
			
		||||
                |__________|
 | 
			
		||||
 | 
			
		||||
@end verbatim
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Simple filtergraphs are configured with the per-stream @option{-filter} option
 | 
			
		||||
(with @option{-vf} and @option{-af} aliases for video and audio respectively).
 | 
			
		||||
A simple filtergraph for video can look for example like this:
 | 
			
		||||
 | 
			
		||||
@verbatim
 | 
			
		||||
@example
 | 
			
		||||
 _______        _____________        _______        ________
 | 
			
		||||
|       |      |             |      |       |      |        |
 | 
			
		||||
| input | ---> | deinterlace | ---> | scale | ---> | output |
 | 
			
		||||
|_______|      |_____________|      |_______|      |________|
 | 
			
		||||
 | 
			
		||||
@end verbatim
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Note that some filters change frame properties but not frame contents. E.g. the
 | 
			
		||||
@code{fps} filter in the example above changes number of frames, but does not
 | 
			
		||||
@@ -161,7 +160,7 @@ processing chain applied to one stream. This is the case, for example, when the
 | 
			
		||||
more than one input and/or output, or when output stream type is different from
 | 
			
		||||
input. They can be represented with the following diagram:
 | 
			
		||||
 | 
			
		||||
@verbatim
 | 
			
		||||
@example
 | 
			
		||||
 _________
 | 
			
		||||
|         |
 | 
			
		||||
| input 0 |\                    __________
 | 
			
		||||
@@ -179,7 +178,7 @@ input. They can be represented with the following diagram:
 | 
			
		||||
| input 2 |/
 | 
			
		||||
|_________|
 | 
			
		||||
 | 
			
		||||
@end verbatim
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Complex filtergraphs are configured with the @option{-filter_complex} option.
 | 
			
		||||
Note that this option is global, since a complex filtergraph, by its nature,
 | 
			
		||||
@@ -198,14 +197,14 @@ step for the specified stream, so it does only demuxing and muxing. It is useful
 | 
			
		||||
for changing the container format or modifying container-level metadata. The
 | 
			
		||||
diagram above will, in this case, simplify to this:
 | 
			
		||||
 | 
			
		||||
@verbatim
 | 
			
		||||
@example
 | 
			
		||||
 _______              ______________            ________
 | 
			
		||||
|       |            |              |          |        |
 | 
			
		||||
| input |  demuxer   | encoded data |  muxer   | output |
 | 
			
		||||
| file  | ---------> | packets      | -------> | file   |
 | 
			
		||||
|_______|            |______________|          |________|
 | 
			
		||||
 | 
			
		||||
@end verbatim
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Since there is no decoding or encoding, it is very fast and there is no quality
 | 
			
		||||
loss. However, it might not work in some cases because of many factors. Applying
 | 
			
		||||
@@ -280,15 +279,13 @@ data read from the input file.
 | 
			
		||||
When used as an output option (before an output filename), stop writing the
 | 
			
		||||
output after its duration reaches @var{duration}.
 | 
			
		||||
 | 
			
		||||
@var{duration} must be a time duration specification,
 | 
			
		||||
see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
 | 
			
		||||
@var{duration} may be a number in seconds, or in @code{hh:mm:ss[.xxx]} form.
 | 
			
		||||
 | 
			
		||||
-to and -t are mutually exclusive and -t has priority.
 | 
			
		||||
 | 
			
		||||
@item -to @var{position} (@emph{output})
 | 
			
		||||
Stop writing the output at @var{position}.
 | 
			
		||||
@var{position} must be a time duration specification,
 | 
			
		||||
see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
 | 
			
		||||
@var{position} may be a number in seconds, or in @code{hh:mm:ss[.xxx]} form.
 | 
			
		||||
 | 
			
		||||
-to and -t are mutually exclusive and -t has priority.
 | 
			
		||||
 | 
			
		||||
@@ -297,8 +294,8 @@ Set the file size limit, expressed in bytes.
 | 
			
		||||
 | 
			
		||||
@item -ss @var{position} (@emph{input/output})
 | 
			
		||||
When used as an input option (before @code{-i}), seeks in this input file to
 | 
			
		||||
@var{position}. Note that in most formats it is not possible to seek exactly,
 | 
			
		||||
so @command{ffmpeg} will seek to the closest seek point before @var{position}.
 | 
			
		||||
@var{position}. Note the in most formats it is not possible to seek exactly, so
 | 
			
		||||
@command{ffmpeg} will seek to the closest seek point before @var{position}.
 | 
			
		||||
When transcoding and @option{-accurate_seek} is enabled (the default), this
 | 
			
		||||
extra segment between the seek point and @var{position} will be decoded and
 | 
			
		||||
discarded. When doing stream copy or when @option{-noaccurate_seek} is used, it
 | 
			
		||||
@@ -307,13 +304,7 @@ will be preserved.
 | 
			
		||||
When used as an output option (before an output filename), decodes but discards
 | 
			
		||||
input until the timestamps reach @var{position}.
 | 
			
		||||
 | 
			
		||||
@var{position} must be a time duration specification,
 | 
			
		||||
see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
 | 
			
		||||
 | 
			
		||||
@item -sseof @var{position} (@emph{input/output})
 | 
			
		||||
 | 
			
		||||
Like the @code{-ss} option but relative to the "end of file". That is negative
 | 
			
		||||
values are earlier in the file, 0 is at EOF.
 | 
			
		||||
@var{position} may be either in seconds or in @code{hh:mm:ss[.xxx]} form.
 | 
			
		||||
 | 
			
		||||
@item -itsoffset @var{offset} (@emph{input})
 | 
			
		||||
Set the input time offset.
 | 
			
		||||
@@ -328,7 +319,7 @@ the time duration specified in @var{offset}.
 | 
			
		||||
@item -timestamp @var{date} (@emph{output})
 | 
			
		||||
Set the recording timestamp in the container.
 | 
			
		||||
 | 
			
		||||
@var{date} must be a date specification,
 | 
			
		||||
@var{date} must be a time duration specification,
 | 
			
		||||
see @ref{date syntax,,the Date section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
 | 
			
		||||
 | 
			
		||||
@item -metadata[:metadata_specifier] @var{key}=@var{value} (@emph{output,per-metadata})
 | 
			
		||||
@@ -369,7 +360,7 @@ ffmpeg -i myfile.avi -target vcd -bf 2 /tmp/vcd.mpg
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item -dframes @var{number} (@emph{output})
 | 
			
		||||
Set the number of data frames to output. This is an alias for @code{-frames:d}.
 | 
			
		||||
Set the number of data frames to record. This is an alias for @code{-frames:d}.
 | 
			
		||||
 | 
			
		||||
@item -frames[:@var{stream_specifier}] @var{framecount} (@emph{output,per-stream})
 | 
			
		||||
Stop writing to the stream after @var{framecount} frames.
 | 
			
		||||
@@ -470,16 +461,13 @@ Technical note -- attachments are implemented as codec extradata, so this
 | 
			
		||||
option can actually be used to extract extradata from any stream, not just
 | 
			
		||||
attachments.
 | 
			
		||||
 | 
			
		||||
@item -noautorotate
 | 
			
		||||
Disable automatically rotating video based on file metadata.
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section Video Options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
@item -vframes @var{number} (@emph{output})
 | 
			
		||||
Set the number of video frames to output. This is an alias for @code{-frames:v}.
 | 
			
		||||
Set the number of video frames to record. This is an alias for @code{-frames:v}.
 | 
			
		||||
@item -r[:@var{stream_specifier}] @var{fps} (@emph{input/output,per-stream})
 | 
			
		||||
Set frame rate (Hz value, fraction or abbreviation).
 | 
			
		||||
 | 
			
		||||
@@ -698,17 +686,13 @@ is not specified, the value of the @var{DISPLAY} environment variable is used
 | 
			
		||||
For DXVA2, this option should contain the number of the display adapter to use.
 | 
			
		||||
If this option is not specified, the default adapter is used.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@item -hwaccels
 | 
			
		||||
List all hardware acceleration methods supported in this build of ffmpeg.
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section Audio Options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
@item -aframes @var{number} (@emph{output})
 | 
			
		||||
Set the number of audio frames to output. This is an alias for @code{-frames:a}.
 | 
			
		||||
Set the number of audio frames to record. This is an alias for @code{-frames:a}.
 | 
			
		||||
@item -ar[:@var{stream_specifier}] @var{freq} (@emph{input/output,per-stream})
 | 
			
		||||
Set the audio sampling frequency. For output streams it is set by
 | 
			
		||||
default to the frequency of the corresponding input stream. For input
 | 
			
		||||
@@ -847,14 +831,6 @@ ffmpeg -i INPUT -map 0:m:language:eng OUTPUT
 | 
			
		||||
 | 
			
		||||
Note that using this option disables the default mappings for this output file.
 | 
			
		||||
 | 
			
		||||
@item -ignore_unknown
 | 
			
		||||
Ignore input streams with unknown type instead of failing if copying
 | 
			
		||||
such streams is attempted.
 | 
			
		||||
 | 
			
		||||
@item -copy_unknown
 | 
			
		||||
Allow input streams with unknown type to be copied instead of failing if copying
 | 
			
		||||
such streams is attempted.
 | 
			
		||||
 | 
			
		||||
@item -map_channel [@var{input_file_id}.@var{stream_specifier}.@var{channel_id}|-1][:@var{output_file_id}.@var{stream_specifier}]
 | 
			
		||||
Map an audio channel from a given input to an output. If
 | 
			
		||||
@var{output_file_id}.@var{stream_specifier} is not set, the audio channel will
 | 
			
		||||
@@ -1018,13 +994,6 @@ With -map you can select from which stream the timestamps should be
 | 
			
		||||
taken. You can leave either video or audio unchanged and sync the
 | 
			
		||||
remaining stream(s) to the unchanged one.
 | 
			
		||||
 | 
			
		||||
@item -frame_drop_threshold @var{parameter}
 | 
			
		||||
Frame drop threshold, which specifies how much behind video frames can
 | 
			
		||||
be before they are dropped. In frame rate units, so 1.0 is one frame.
 | 
			
		||||
The default is -1.1. One possible usecase is to avoid framedrops in case
 | 
			
		||||
of noisy timestamps or to increase frame drop precision in case of exact
 | 
			
		||||
timestamps.
 | 
			
		||||
 | 
			
		||||
@item -async @var{samples_per_second}
 | 
			
		||||
Audio sync method. "Stretches/squeezes" the audio stream to match the timestamps,
 | 
			
		||||
the parameter is the maximum samples per second by which the audio is changed.
 | 
			
		||||
@@ -1047,12 +1016,6 @@ processing (e.g. in case the format option @option{avoid_negative_ts}
 | 
			
		||||
is enabled) the output timestamps may mismatch with the input
 | 
			
		||||
timestamps even when this option is selected.
 | 
			
		||||
 | 
			
		||||
@item -start_at_zero
 | 
			
		||||
When used with @option{copyts}, shift input timestamps so they start at zero.
 | 
			
		||||
 | 
			
		||||
This means that using e.g. @code{-ss 50} will make output timestamps start at
 | 
			
		||||
50 seconds, regardless of what timestamp the input file started at.
 | 
			
		||||
 | 
			
		||||
@item -copytb @var{mode}
 | 
			
		||||
Specify how to set the encoder timebase when stream copying.  @var{mode} is an
 | 
			
		||||
integer numeric value, and can assume one of the following values:
 | 
			
		||||
@@ -1181,19 +1144,6 @@ This option enables or disables accurate seeking in input files with the
 | 
			
		||||
transcoding. Use @option{-noaccurate_seek} to disable it, which may be useful
 | 
			
		||||
e.g. when copying some streams and transcoding the others.
 | 
			
		||||
 | 
			
		||||
@item -seek_timestamp (@emph{input})
 | 
			
		||||
This option enables or disables seeking by timestamp in input files with the
 | 
			
		||||
@option{-ss} option. It is disabled by default. If enabled, the argument
 | 
			
		||||
to the @option{-ss} option is considered an actual timestamp, and is not
 | 
			
		||||
offset by the start time of the file. This matters only for files which do
 | 
			
		||||
not start from timestamp 0, such as transport streams.
 | 
			
		||||
 | 
			
		||||
@item -thread_queue_size @var{size} (@emph{input})
 | 
			
		||||
This option sets the maximum number of queued packets when reading from the
 | 
			
		||||
file or device. With low latency / high rate live streams, packets may be
 | 
			
		||||
discarded if they are not read in a timely manner; raising this value can
 | 
			
		||||
avoid it.
 | 
			
		||||
 | 
			
		||||
@item -override_ffserver (@emph{global})
 | 
			
		||||
Overrides the input specifications from @command{ffserver}. Using this
 | 
			
		||||
option you can map any input stream to @command{ffserver} and control
 | 
			
		||||
@@ -1204,11 +1154,6 @@ requested by @command{ffserver}.
 | 
			
		||||
The option is intended for cases where features are needed that cannot be
 | 
			
		||||
specified to @command{ffserver} but can be to @command{ffmpeg}.
 | 
			
		||||
 | 
			
		||||
@item -sdp_file @var{file} (@emph{global})
 | 
			
		||||
Print sdp information for an output stream to @var{file}.
 | 
			
		||||
This allows dumping sdp information when at least one output isn't an
 | 
			
		||||
rtp stream. (Requires at least one of the output formats to be rtp).
 | 
			
		||||
 | 
			
		||||
@item -discard (@emph{input})
 | 
			
		||||
Allows discarding specific streams or frames of streams at the demuxer.
 | 
			
		||||
Not all demuxers support this.
 | 
			
		||||
@@ -1233,9 +1178,6 @@ Discard all frames excepts keyframes.
 | 
			
		||||
Discard all frames.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@item -xerror (@emph{global})
 | 
			
		||||
Stop and exit on error
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
As a special exception, you can use a bitmap subtitle stream as input: it
 | 
			
		||||
@@ -1261,10 +1203,7 @@ awkward to specify on the command line. Lines starting with the hash
 | 
			
		||||
('#') character are ignored and are used to provide comments. Check
 | 
			
		||||
the @file{presets} directory in the FFmpeg source tree for examples.
 | 
			
		||||
 | 
			
		||||
There are two types of preset files: ffpreset and avpreset files.
 | 
			
		||||
 | 
			
		||||
@subsection ffpreset files
 | 
			
		||||
ffpreset files are specified with the @code{vpre}, @code{apre},
 | 
			
		||||
Preset files are specified with the @code{vpre}, @code{apre},
 | 
			
		||||
@code{spre}, and @code{fpre} options. The @code{fpre} option takes the
 | 
			
		||||
filename of the preset instead of a preset name as input and can be
 | 
			
		||||
used for any kind of codec. For the @code{vpre}, @code{apre}, and
 | 
			
		||||
@@ -1289,31 +1228,67 @@ directories, where @var{codec_name} is the name of the codec to which
 | 
			
		||||
the preset file options will be applied. For example, if you select
 | 
			
		||||
the video codec with @code{-vcodec libvpx} and use @code{-vpre 1080p},
 | 
			
		||||
then it will search for the file @file{libvpx-1080p.ffpreset}.
 | 
			
		||||
 | 
			
		||||
@subsection avpreset files
 | 
			
		||||
avpreset files are specified with the @code{pre} option. They work similar to
 | 
			
		||||
ffpreset files, but they only allow encoder- specific options. Therefore, an
 | 
			
		||||
@var{option}=@var{value} pair specifying an encoder cannot be used.
 | 
			
		||||
 | 
			
		||||
When the @code{pre} option is specified, ffmpeg will look for files with the
 | 
			
		||||
suffix .avpreset in the directories @file{$AVCONV_DATADIR} (if set), and
 | 
			
		||||
@file{$HOME/.avconv}, and in the datadir defined at configuration time (usually
 | 
			
		||||
@file{PREFIX/share/ffmpeg}), in that order.
 | 
			
		||||
 | 
			
		||||
First ffmpeg searches for a file named @var{codec_name}-@var{arg}.avpreset in
 | 
			
		||||
the above-mentioned directories, where @var{codec_name} is the name of the codec
 | 
			
		||||
to which the preset file options will be applied. For example, if you select the
 | 
			
		||||
video codec with @code{-vcodec libvpx} and use @code{-pre 1080p}, then it will
 | 
			
		||||
search for the file @file{libvpx-1080p.avpreset}.
 | 
			
		||||
 | 
			
		||||
If no such file is found, then ffmpeg will search for a file named
 | 
			
		||||
@var{arg}.avpreset in the same directories.
 | 
			
		||||
 | 
			
		||||
@c man end OPTIONS
 | 
			
		||||
 | 
			
		||||
@chapter Tips
 | 
			
		||||
@c man begin TIPS
 | 
			
		||||
 | 
			
		||||
@itemize
 | 
			
		||||
@item
 | 
			
		||||
For streaming at very low bitrates, use a low frame rate
 | 
			
		||||
and a small GOP size. This is especially true for RealVideo where
 | 
			
		||||
the Linux player does not seem to be very fast, so it can miss
 | 
			
		||||
frames. An example is:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -g 3 -r 3 -t 10 -b:v 50k -s qcif -f rv10 /tmp/b.rm
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
The parameter 'q' which is displayed while encoding is the current
 | 
			
		||||
quantizer. The value 1 indicates that a very good quality could
 | 
			
		||||
be achieved. The value 31 indicates the worst quality. If q=31 appears
 | 
			
		||||
too often, it means that the encoder cannot compress enough to meet
 | 
			
		||||
your bitrate. You must either increase the bitrate, decrease the
 | 
			
		||||
frame rate or decrease the frame size.
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
If your computer is not fast enough, you can speed up the
 | 
			
		||||
compression at the expense of the compression ratio. You can use
 | 
			
		||||
'-me zero' to speed up motion estimation, and '-g 0' to disable
 | 
			
		||||
motion estimation completely (you have only I-frames, which means it
 | 
			
		||||
is about as good as JPEG compression).
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
To have very low audio bitrates, reduce the sampling frequency
 | 
			
		||||
(down to 22050 Hz for MPEG audio, 22050 or 11025 for AC-3).
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
To have a constant quality (but a variable bitrate), use the option
 | 
			
		||||
'-qscale n' when 'n' is between 1 (excellent quality) and 31 (worst
 | 
			
		||||
quality).
 | 
			
		||||
 | 
			
		||||
@end itemize
 | 
			
		||||
@c man end TIPS
 | 
			
		||||
 | 
			
		||||
@chapter Examples
 | 
			
		||||
@c man begin EXAMPLES
 | 
			
		||||
 | 
			
		||||
@section Preset files
 | 
			
		||||
 | 
			
		||||
A preset file contains a sequence of @var{option=value} pairs, one for
 | 
			
		||||
each line, specifying a sequence of options which can be specified also on
 | 
			
		||||
the command line. Lines starting with the hash ('#') character are ignored and
 | 
			
		||||
are used to provide comments. Empty lines are also ignored. Check the
 | 
			
		||||
@file{presets} directory in the FFmpeg source tree for examples.
 | 
			
		||||
 | 
			
		||||
Preset files are specified with the @code{pre} option, this option takes a
 | 
			
		||||
preset name as input.  FFmpeg searches for a file named @var{preset_name}.avpreset in
 | 
			
		||||
the directories @file{$AVCONV_DATADIR} (if set), and @file{$HOME/.ffmpeg}, and in
 | 
			
		||||
the data directory defined at configuration time (usually @file{$PREFIX/share/ffmpeg})
 | 
			
		||||
in that order.  For example, if the argument is @code{libx264-max}, it will
 | 
			
		||||
search for the file @file{libx264-max.avpreset}.
 | 
			
		||||
 | 
			
		||||
@section Video and Audio grabbing
 | 
			
		||||
 | 
			
		||||
If you specify the input format and device then ffmpeg can grab video
 | 
			
		||||
@@ -1461,7 +1436,7 @@ combination with -ss to start extracting from a certain point in time.
 | 
			
		||||
 | 
			
		||||
For creating a video from many images:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -f image2 -framerate 12 -i foo-%03d.jpeg -s WxH foo.avi
 | 
			
		||||
ffmpeg -f image2 -i foo-%03d.jpeg -r 12 -s WxH foo.avi
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
The syntax @code{foo-%03d.jpeg} specifies to use a decimal number
 | 
			
		||||
@@ -1476,7 +1451,7 @@ image2-specific @code{-pattern_type glob} option.
 | 
			
		||||
For example, for creating a video from filenames matching the glob pattern
 | 
			
		||||
@code{foo-*.jpeg}:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -f image2 -pattern_type glob -framerate 12 -i 'foo-*.jpeg' -s WxH foo.avi
 | 
			
		||||
ffmpeg -f image2 -pattern_type glob -i 'foo-*.jpeg' -r 12 -s WxH foo.avi
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,4 @@
 | 
			
		||||
\input texinfo @c -*- texinfo -*-
 | 
			
		||||
@documentencoding UTF-8
 | 
			
		||||
 | 
			
		||||
@settitle ffplay Documentation
 | 
			
		||||
@titlepage
 | 
			
		||||
@@ -38,26 +37,14 @@ Force displayed height.
 | 
			
		||||
Set frame size (WxH or abbreviation), needed for videos which do
 | 
			
		||||
not contain a header with the frame size like raw YUV.  This option
 | 
			
		||||
has been deprecated in favor of private options, try -video_size.
 | 
			
		||||
@item -fs
 | 
			
		||||
Start in fullscreen mode.
 | 
			
		||||
@item -an
 | 
			
		||||
Disable audio.
 | 
			
		||||
@item -vn
 | 
			
		||||
Disable video.
 | 
			
		||||
@item -sn
 | 
			
		||||
Disable subtitles.
 | 
			
		||||
@item -ss @var{pos}
 | 
			
		||||
Seek to @var{pos}. Note that in most formats it is not possible to seek
 | 
			
		||||
exactly, so @command{ffplay} will seek to the nearest seek point to
 | 
			
		||||
@var{pos}.
 | 
			
		||||
 | 
			
		||||
@var{pos} must be a time duration specification,
 | 
			
		||||
see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
 | 
			
		||||
Seek to a given position in seconds.
 | 
			
		||||
@item -t @var{duration}
 | 
			
		||||
Play @var{duration} seconds of audio/video.
 | 
			
		||||
 | 
			
		||||
@var{duration} must be a time duration specification,
 | 
			
		||||
see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
 | 
			
		||||
play <duration> seconds of audio/video
 | 
			
		||||
@item -bytes
 | 
			
		||||
Seek by bytes.
 | 
			
		||||
@item -nodisp
 | 
			
		||||
@@ -122,10 +109,15 @@ duration, the codec parameters, the current position in the stream and
 | 
			
		||||
the audio/video synchronisation drift. It is on by default, to
 | 
			
		||||
explicitly disable it you need to specify @code{-nostats}.
 | 
			
		||||
 | 
			
		||||
@item -bug
 | 
			
		||||
Work around bugs.
 | 
			
		||||
@item -fast
 | 
			
		||||
Non-spec-compliant optimizations.
 | 
			
		||||
@item -genpts
 | 
			
		||||
Generate pts.
 | 
			
		||||
@item -rtp_tcp
 | 
			
		||||
Force RTP/TCP protocol usage instead of RTP/UDP. It is only meaningful
 | 
			
		||||
if you are streaming with the RTSP protocol.
 | 
			
		||||
@item -sync @var{type}
 | 
			
		||||
Set the master clock to audio (@code{type=audio}), video
 | 
			
		||||
(@code{type=video}) or external (@code{type=ext}). Default is audio. The
 | 
			
		||||
@@ -133,20 +125,23 @@ master clock is used to control audio-video synchronization. Most media
 | 
			
		||||
players use audio as master clock, but in some cases (streaming or high
 | 
			
		||||
quality broadcast) it is necessary to change that. This option is mainly
 | 
			
		||||
used for debugging purposes.
 | 
			
		||||
@item -ast @var{audio_stream_specifier}
 | 
			
		||||
Select the desired audio stream using the given stream specifier. The stream
 | 
			
		||||
specifiers are described in the @ref{Stream specifiers} chapter. If this option
 | 
			
		||||
is not specified, the "best" audio stream is selected in the program of the
 | 
			
		||||
already selected video stream.
 | 
			
		||||
@item -vst @var{video_stream_specifier}
 | 
			
		||||
Select the desired video stream using the given stream specifier. The stream
 | 
			
		||||
specifiers are described in the @ref{Stream specifiers} chapter. If this option
 | 
			
		||||
is not specified, the "best" video stream is selected.
 | 
			
		||||
@item -sst @var{subtitle_stream_specifier}
 | 
			
		||||
Select the desired subtitle stream using the given stream specifier. The stream
 | 
			
		||||
specifiers are described in the @ref{Stream specifiers} chapter. If this option
 | 
			
		||||
is not specified, the "best" subtitle stream is selected in the program of the
 | 
			
		||||
already selected video or audio stream.
 | 
			
		||||
@item -threads @var{count}
 | 
			
		||||
Set the thread count.
 | 
			
		||||
@item -ast @var{audio_stream_number}
 | 
			
		||||
Select the desired audio stream number, counting from 0. The number
 | 
			
		||||
refers to the list of all the input audio streams. If it is greater
 | 
			
		||||
than the number of audio streams minus one, then the last one is
 | 
			
		||||
selected, if it is negative the audio playback is disabled.
 | 
			
		||||
@item -vst @var{video_stream_number}
 | 
			
		||||
Select the desired video stream number, counting from 0. The number
 | 
			
		||||
refers to the list of all the input video streams. If it is greater
 | 
			
		||||
than the number of video streams minus one, then the last one is
 | 
			
		||||
selected, if it is negative the video playback is disabled.
 | 
			
		||||
@item -sst @var{subtitle_stream_number}
 | 
			
		||||
Select the desired subtitle stream number, counting from 0. The number
 | 
			
		||||
refers to the list of all the input subtitle streams. If it is greater
 | 
			
		||||
than the number of subtitle streams minus one, then the last one is
 | 
			
		||||
selected, if it is negative the subtitle rendering is disabled.
 | 
			
		||||
@item -autoexit
 | 
			
		||||
Exit when video is done playing.
 | 
			
		||||
@item -exitonkeydown
 | 
			
		||||
@@ -169,20 +164,8 @@ Force a specific video decoder.
 | 
			
		||||
Force a specific subtitle decoder.
 | 
			
		||||
 | 
			
		||||
@item -autorotate
 | 
			
		||||
Automatically rotate the video according to file metadata. Enabled by
 | 
			
		||||
default, use @option{-noautorotate} to disable it.
 | 
			
		||||
 | 
			
		||||
@item -framedrop
 | 
			
		||||
Drop video frames if video is out of sync. Enabled by default if the master
 | 
			
		||||
clock is not set to video. Use this option to enable frame dropping for all
 | 
			
		||||
master clock sources, use @option{-noframedrop} to disable it.
 | 
			
		||||
 | 
			
		||||
@item -infbuf
 | 
			
		||||
Do not limit the input buffer size, read as much data as possible from the
 | 
			
		||||
input as soon as possible. Enabled by default for realtime streams, where data
 | 
			
		||||
may be dropped if not read in time. Use this option to enable infinite buffers
 | 
			
		||||
for all inputs, use @option{-noinfbuf} to disable it.
 | 
			
		||||
 | 
			
		||||
Automatically rotate the video according to presentation metadata. Set by
 | 
			
		||||
default, use -noautorotate to disable.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section While playing
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,4 @@
 | 
			
		||||
\input texinfo @c -*- texinfo -*-
 | 
			
		||||
@documentencoding UTF-8
 | 
			
		||||
 | 
			
		||||
@settitle ffprobe Documentation
 | 
			
		||||
@titlepage
 | 
			
		||||
@@ -322,12 +321,6 @@ Show information related to program and library versions. This is the
 | 
			
		||||
equivalent of setting both @option{-show_program_version} and
 | 
			
		||||
@option{-show_library_versions} options.
 | 
			
		||||
 | 
			
		||||
@item -show_pixel_formats
 | 
			
		||||
Show information about all pixel formats supported by FFmpeg.
 | 
			
		||||
 | 
			
		||||
Pixel format information for each format is printed within a section
 | 
			
		||||
with name "PIXEL_FORMAT".
 | 
			
		||||
 | 
			
		||||
@item -bitexact
 | 
			
		||||
Force bitexact output, useful to produce output which is not dependent
 | 
			
		||||
on the specific build.
 | 
			
		||||
@@ -447,17 +440,17 @@ writer).
 | 
			
		||||
It can assume one of the following values:
 | 
			
		||||
@table @option
 | 
			
		||||
@item c
 | 
			
		||||
Perform C-like escaping. Strings containing a newline (@samp{\n}), carriage
 | 
			
		||||
return (@samp{\r}), a tab (@samp{\t}), a form feed (@samp{\f}), the escaping
 | 
			
		||||
character (@samp{\}) or the item separator character @var{SEP} are escaped
 | 
			
		||||
using C-like fashioned escaping, so that a newline is converted to the
 | 
			
		||||
sequence @samp{\n}, a carriage return to @samp{\r}, @samp{\} to @samp{\\} and
 | 
			
		||||
the separator @var{SEP} is converted to @samp{\@var{SEP}}.
 | 
			
		||||
Perform C-like escaping. Strings containing a newline ('\n'), carriage
 | 
			
		||||
return ('\r'), a tab ('\t'), a form feed ('\f'), the escaping
 | 
			
		||||
character ('\') or the item separator character @var{SEP} are escaped using C-like fashioned
 | 
			
		||||
escaping, so that a newline is converted to the sequence "\n", a
 | 
			
		||||
carriage return to "\r", '\' to "\\" and the separator @var{SEP} is
 | 
			
		||||
converted to "\@var{SEP}".
 | 
			
		||||
 | 
			
		||||
@item csv
 | 
			
		||||
Perform CSV-like escaping, as described in RFC4180.  Strings
 | 
			
		||||
containing a newline (@samp{\n}), a carriage return (@samp{\r}), a double quote
 | 
			
		||||
(@samp{"}), or @var{SEP} are enclosed in double-quotes.
 | 
			
		||||
containing a newline ('\n'), a carriage return ('\r'), a double quote
 | 
			
		||||
('"'), or @var{SEP} are enclosed in double-quotes.
 | 
			
		||||
 | 
			
		||||
@item none
 | 
			
		||||
Perform no escaping.
 | 
			
		||||
@@ -485,7 +478,7 @@ The description of the accepted options follows.
 | 
			
		||||
Separator character used to separate the chapter, the section name, IDs and
 | 
			
		||||
potential tags in the printed field key.
 | 
			
		||||
 | 
			
		||||
Default value is @samp{.}.
 | 
			
		||||
Default value is '.'.
 | 
			
		||||
 | 
			
		||||
@item hierarchical, h
 | 
			
		||||
Specify if the section name specification should be hierarchical. If
 | 
			
		||||
@@ -507,22 +500,21 @@ The following conventions are adopted:
 | 
			
		||||
@item
 | 
			
		||||
all key and values are UTF-8
 | 
			
		||||
@item
 | 
			
		||||
@samp{.} is the subgroup separator
 | 
			
		||||
'.' is the subgroup separator
 | 
			
		||||
@item
 | 
			
		||||
newline, @samp{\t}, @samp{\f}, @samp{\b} and the following characters are
 | 
			
		||||
escaped
 | 
			
		||||
newline, '\t', '\f', '\b' and the following characters are escaped
 | 
			
		||||
@item
 | 
			
		||||
@samp{\} is the escape character
 | 
			
		||||
'\' is the escape character
 | 
			
		||||
@item
 | 
			
		||||
@samp{#} is the comment indicator
 | 
			
		||||
'#' is the comment indicator
 | 
			
		||||
@item
 | 
			
		||||
@samp{=} is the key/value separator
 | 
			
		||||
'=' is the key/value separator
 | 
			
		||||
@item
 | 
			
		||||
@samp{:} is not used but usually parsed as key/value separator
 | 
			
		||||
':' is not used but usually parsed as key/value separator
 | 
			
		||||
@end itemize
 | 
			
		||||
 | 
			
		||||
This writer accepts options as a list of @var{key}=@var{value} pairs,
 | 
			
		||||
separated by @samp{:}.
 | 
			
		||||
separated by ":".
 | 
			
		||||
 | 
			
		||||
The description of the accepted options follows.
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -10,10 +10,8 @@
 | 
			
		||||
        <xsd:sequence>
 | 
			
		||||
            <xsd:element name="program_version"  type="ffprobe:programVersionType"  minOccurs="0" maxOccurs="1" />
 | 
			
		||||
            <xsd:element name="library_versions" type="ffprobe:libraryVersionsType" minOccurs="0" maxOccurs="1" />
 | 
			
		||||
            <xsd:element name="pixel_formats"    type="ffprobe:pixelFormatsType"    minOccurs="0" maxOccurs="1" />
 | 
			
		||||
            <xsd:element name="packets"  type="ffprobe:packetsType" minOccurs="0" maxOccurs="1" />
 | 
			
		||||
            <xsd:element name="frames"   type="ffprobe:framesType"  minOccurs="0" maxOccurs="1" />
 | 
			
		||||
            <xsd:element name="packets_and_frames" type="ffprobe:packetsAndFramesType" minOccurs="0" maxOccurs="1" />
 | 
			
		||||
            <xsd:element name="programs" type="ffprobe:programsType" minOccurs="0" maxOccurs="1" />
 | 
			
		||||
            <xsd:element name="streams"  type="ffprobe:streamsType" minOccurs="0" maxOccurs="1" />
 | 
			
		||||
            <xsd:element name="chapters" type="ffprobe:chaptersType" minOccurs="0" maxOccurs="1" />
 | 
			
		||||
@@ -37,22 +35,7 @@
 | 
			
		||||
        </xsd:sequence>
 | 
			
		||||
    </xsd:complexType>
 | 
			
		||||
 | 
			
		||||
    <xsd:complexType name="packetsAndFramesType">
 | 
			
		||||
        <xsd:sequence>
 | 
			
		||||
            <xsd:choice minOccurs="0" maxOccurs="unbounded">
 | 
			
		||||
                <xsd:element name="packet" type="ffprobe:packetType" minOccurs="0" maxOccurs="unbounded"/>
 | 
			
		||||
                <xsd:element name="frame" type="ffprobe:frameType" minOccurs="0" maxOccurs="unbounded"/>
 | 
			
		||||
                <xsd:element name="subtitle" type="ffprobe:subtitleType" minOccurs="0" maxOccurs="unbounded"/>
 | 
			
		||||
            </xsd:choice>
 | 
			
		||||
        </xsd:sequence>
 | 
			
		||||
    </xsd:complexType>
 | 
			
		||||
 | 
			
		||||
    <xsd:complexType name="packetType">
 | 
			
		||||
      <xsd:sequence>
 | 
			
		||||
        <xsd:element name="tag" type="ffprobe:tagType" minOccurs="0" maxOccurs="unbounded"/>
 | 
			
		||||
        <xsd:element name="side_data_list" type="ffprobe:packetSideDataListType"   minOccurs="0" maxOccurs="1" />
 | 
			
		||||
      </xsd:sequence>
 | 
			
		||||
 | 
			
		||||
      <xsd:attribute name="codec_type"    type="xsd:string" use="required" />
 | 
			
		||||
      <xsd:attribute name="stream_index"  type="xsd:int" use="required" />
 | 
			
		||||
      <xsd:attribute name="pts"           type="xsd:long"  />
 | 
			
		||||
@@ -70,16 +53,6 @@
 | 
			
		||||
      <xsd:attribute name="data_hash"     type="xsd:string" />
 | 
			
		||||
    </xsd:complexType>
 | 
			
		||||
 | 
			
		||||
    <xsd:complexType name="packetSideDataListType">
 | 
			
		||||
        <xsd:sequence>
 | 
			
		||||
            <xsd:element name="side_data" type="ffprobe:packetSideDataType" minOccurs="1" maxOccurs="unbounded"/>
 | 
			
		||||
        </xsd:sequence>
 | 
			
		||||
    </xsd:complexType>
 | 
			
		||||
    <xsd:complexType name="packetSideDataType">
 | 
			
		||||
        <xsd:attribute name="side_data_type"              type="xsd:string"/>
 | 
			
		||||
        <xsd:attribute name="side_data_size"              type="xsd:int"   />
 | 
			
		||||
    </xsd:complexType>
 | 
			
		||||
 | 
			
		||||
    <xsd:complexType name="frameType">
 | 
			
		||||
      <xsd:sequence>
 | 
			
		||||
            <xsd:element name="tag" type="ffprobe:tagType" minOccurs="0" maxOccurs="unbounded"/>
 | 
			
		||||
@@ -87,7 +60,6 @@
 | 
			
		||||
      </xsd:sequence>
 | 
			
		||||
 | 
			
		||||
      <xsd:attribute name="media_type"    type="xsd:string" use="required"/>
 | 
			
		||||
      <xsd:attribute name="stream_index"  type="xsd:int"  />
 | 
			
		||||
      <xsd:attribute name="key_frame"     type="xsd:int"    use="required"/>
 | 
			
		||||
      <xsd:attribute name="pts"           type="xsd:long" />
 | 
			
		||||
      <xsd:attribute name="pts_time"      type="xsd:float"/>
 | 
			
		||||
@@ -171,7 +143,6 @@
 | 
			
		||||
      <xsd:sequence>
 | 
			
		||||
        <xsd:element name="disposition" type="ffprobe:streamDispositionType" minOccurs="0" maxOccurs="1"/>
 | 
			
		||||
        <xsd:element name="tag" type="ffprobe:tagType" minOccurs="0" maxOccurs="unbounded"/>
 | 
			
		||||
        <xsd:element name="side_data_list" type="ffprobe:packetSideDataListType"   minOccurs="0" maxOccurs="1" />
 | 
			
		||||
      </xsd:sequence>
 | 
			
		||||
 | 
			
		||||
      <xsd:attribute name="index"            type="xsd:int" use="required"/>
 | 
			
		||||
@@ -188,8 +159,6 @@
 | 
			
		||||
      <!-- video attributes -->
 | 
			
		||||
      <xsd:attribute name="width"                type="xsd:int"/>
 | 
			
		||||
      <xsd:attribute name="height"               type="xsd:int"/>
 | 
			
		||||
      <xsd:attribute name="coded_width"          type="xsd:int"/>
 | 
			
		||||
      <xsd:attribute name="coded_height"         type="xsd:int"/>
 | 
			
		||||
      <xsd:attribute name="has_b_frames"         type="xsd:int"/>
 | 
			
		||||
      <xsd:attribute name="sample_aspect_ratio"  type="xsd:string"/>
 | 
			
		||||
      <xsd:attribute name="display_aspect_ratio" type="xsd:string"/>
 | 
			
		||||
@@ -197,11 +166,7 @@
 | 
			
		||||
      <xsd:attribute name="level"                type="xsd:int"/>
 | 
			
		||||
      <xsd:attribute name="color_range"          type="xsd:string"/>
 | 
			
		||||
      <xsd:attribute name="color_space"          type="xsd:string"/>
 | 
			
		||||
      <xsd:attribute name="color_transfer"       type="xsd:string"/>
 | 
			
		||||
      <xsd:attribute name="color_primaries"      type="xsd:string"/>
 | 
			
		||||
      <xsd:attribute name="chroma_location"      type="xsd:string"/>
 | 
			
		||||
      <xsd:attribute name="timecode"             type="xsd:string"/>
 | 
			
		||||
      <xsd:attribute name="refs"                 type="xsd:int"/>
 | 
			
		||||
 | 
			
		||||
      <!-- audio attributes -->
 | 
			
		||||
      <xsd:attribute name="sample_fmt"       type="xsd:string"/>
 | 
			
		||||
@@ -273,8 +238,8 @@
 | 
			
		||||
    <xsd:complexType name="programVersionType">
 | 
			
		||||
      <xsd:attribute name="version"          type="xsd:string" use="required"/>
 | 
			
		||||
      <xsd:attribute name="copyright"        type="xsd:string" use="required"/>
 | 
			
		||||
      <xsd:attribute name="build_date"       type="xsd:string"/>
 | 
			
		||||
      <xsd:attribute name="build_time"       type="xsd:string"/>
 | 
			
		||||
      <xsd:attribute name="build_date"       type="xsd:string" use="required"/>
 | 
			
		||||
      <xsd:attribute name="build_time"       type="xsd:string" use="required"/>
 | 
			
		||||
      <xsd:attribute name="compiler_ident"   type="xsd:string" use="required"/>
 | 
			
		||||
      <xsd:attribute name="configuration"    type="xsd:string" use="required"/>
 | 
			
		||||
    </xsd:complexType>
 | 
			
		||||
@@ -312,45 +277,4 @@
 | 
			
		||||
          <xsd:element name="library_version" type="ffprobe:libraryVersionType" minOccurs="0" maxOccurs="unbounded"/>
 | 
			
		||||
        </xsd:sequence>
 | 
			
		||||
    </xsd:complexType>
 | 
			
		||||
 | 
			
		||||
    <xsd:complexType name="pixelFormatFlagsType">
 | 
			
		||||
      <xsd:attribute name="big_endian" type="xsd:int" use="required"/>
 | 
			
		||||
      <xsd:attribute name="palette"    type="xsd:int" use="required"/>
 | 
			
		||||
      <xsd:attribute name="bitstream"  type="xsd:int" use="required"/>
 | 
			
		||||
      <xsd:attribute name="hwaccel"    type="xsd:int" use="required"/>
 | 
			
		||||
      <xsd:attribute name="planar"     type="xsd:int" use="required"/>
 | 
			
		||||
      <xsd:attribute name="rgb"        type="xsd:int" use="required"/>
 | 
			
		||||
      <xsd:attribute name="pseudopal"  type="xsd:int" use="required"/>
 | 
			
		||||
      <xsd:attribute name="alpha"      type="xsd:int" use="required"/>
 | 
			
		||||
    </xsd:complexType>
 | 
			
		||||
 | 
			
		||||
    <xsd:complexType name="pixelFormatComponentType">
 | 
			
		||||
      <xsd:attribute name="index"      type="xsd:int" use="required"/>
 | 
			
		||||
      <xsd:attribute name="bit_depth"  type="xsd:int" use="required"/>
 | 
			
		||||
    </xsd:complexType>
 | 
			
		||||
 | 
			
		||||
    <xsd:complexType name="pixelFormatComponentsType">
 | 
			
		||||
      <xsd:sequence>
 | 
			
		||||
        <xsd:element name="component" type="ffprobe:pixelFormatComponentType" minOccurs="0" maxOccurs="unbounded"/>
 | 
			
		||||
      </xsd:sequence>
 | 
			
		||||
    </xsd:complexType>
 | 
			
		||||
 | 
			
		||||
    <xsd:complexType name="pixelFormatType">
 | 
			
		||||
      <xsd:sequence>
 | 
			
		||||
        <xsd:element name="flags" type="ffprobe:pixelFormatFlagsType" minOccurs="0" maxOccurs="1"/>
 | 
			
		||||
        <xsd:element name="components" type="ffprobe:pixelFormatComponentsType" minOccurs="0" maxOccurs="1"/>
 | 
			
		||||
      </xsd:sequence>
 | 
			
		||||
 | 
			
		||||
      <xsd:attribute name="name"                type="xsd:string" use="required"/>
 | 
			
		||||
      <xsd:attribute name="nb_components"       type="xsd:int"    use="required"/>
 | 
			
		||||
      <xsd:attribute name="log2_chroma_w"       type="xsd:int"/>
 | 
			
		||||
      <xsd:attribute name="log2_chroma_h"       type="xsd:int"/>
 | 
			
		||||
      <xsd:attribute name="bits_per_pixel"      type="xsd:int"/>
 | 
			
		||||
    </xsd:complexType>
 | 
			
		||||
 | 
			
		||||
    <xsd:complexType name="pixelFormatsType">
 | 
			
		||||
      <xsd:sequence>
 | 
			
		||||
        <xsd:element name="pixel_format" type="ffprobe:pixelFormatType" minOccurs="0" maxOccurs="unbounded"/>
 | 
			
		||||
      </xsd:sequence>
 | 
			
		||||
    </xsd:complexType>
 | 
			
		||||
</xsd:schema>
 | 
			
		||||
 
 | 
			
		||||
@@ -82,7 +82,6 @@ Feed feed1.ffm
 | 
			
		||||
# ra         : RealNetworks-compatible stream. Audio only.
 | 
			
		||||
# mpjpeg     : Multipart JPEG (works with Netscape without any plugin)
 | 
			
		||||
# jpeg       : Generate a single JPEG image.
 | 
			
		||||
# mjpeg      : Generate a M-JPEG stream.
 | 
			
		||||
# asf        : ASF compatible streaming (Windows Media Player format).
 | 
			
		||||
# swf        : Macromedia Flash compatible stream
 | 
			
		||||
# avi        : AVI format (MPEG-4 video, MPEG audio sound)
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,4 @@
 | 
			
		||||
\input texinfo @c -*- texinfo -*-
 | 
			
		||||
@documentencoding UTF-8
 | 
			
		||||
 | 
			
		||||
@settitle ffserver Documentation
 | 
			
		||||
@titlepage
 | 
			
		||||
@@ -72,7 +71,7 @@ the HTTP server (configured through the @option{HTTPPort} option), and
 | 
			
		||||
configuration file.
 | 
			
		||||
 | 
			
		||||
Each feed is associated to a file which is stored on disk. This stored
 | 
			
		||||
file is used to send pre-recorded data to a player as fast as
 | 
			
		||||
file is used to allow to send pre-recorded data to a player as fast as
 | 
			
		||||
possible when new content is added in real-time to the stream.
 | 
			
		||||
 | 
			
		||||
A "live-stream" or "stream" is a resource published by
 | 
			
		||||
@@ -118,8 +117,7 @@ Multiple streams can be connected to the same feed.
 | 
			
		||||
 | 
			
		||||
For example, you can have a situation described by the following
 | 
			
		||||
graph:
 | 
			
		||||
 | 
			
		||||
@verbatim
 | 
			
		||||
@example
 | 
			
		||||
               _________       __________
 | 
			
		||||
              |         |     |          |
 | 
			
		||||
ffmpeg 1 -----| feed 1  |-----| stream 1 |
 | 
			
		||||
@@ -144,8 +142,7 @@ ffmpeg 2 -----| feed 3  |-----| stream 4 |
 | 
			
		||||
              |         |     |          |
 | 
			
		||||
              | file 1  |-----| stream 5 |
 | 
			
		||||
              |_________|     |__________|
 | 
			
		||||
 | 
			
		||||
@end verbatim
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@anchor{FFM}
 | 
			
		||||
@section FFM, FFM2 formats
 | 
			
		||||
@@ -411,12 +408,6 @@ ignored, and the log is written to standard output.
 | 
			
		||||
Set no-daemon mode. This option is currently ignored since now
 | 
			
		||||
@command{ffserver} will always work in no-daemon mode, and is
 | 
			
		||||
deprecated.
 | 
			
		||||
 | 
			
		||||
@item UseDefaults
 | 
			
		||||
@item NoDefaults
 | 
			
		||||
Control whether default codec options are used for the all streams or not.
 | 
			
		||||
Each stream may overwrite this setting for its own. Default is @var{UseDefaults}.
 | 
			
		||||
The lastest occurrence overrides previous if multiple definitions.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section Feed section
 | 
			
		||||
@@ -580,11 +571,6 @@ deprecated in favor of @option{Metadata}.
 | 
			
		||||
@item Metadata @var{key} @var{value}
 | 
			
		||||
Set metadata value on the output stream.
 | 
			
		||||
 | 
			
		||||
@item UseDefaults
 | 
			
		||||
@item NoDefaults
 | 
			
		||||
Control whether default codec options are used for the stream or not.
 | 
			
		||||
Default is @var{UseDefaults} unless disabled globally.
 | 
			
		||||
 | 
			
		||||
@item NoAudio
 | 
			
		||||
@item NoVideo
 | 
			
		||||
Suppress audio/video.
 | 
			
		||||
@@ -603,9 +589,8 @@ Set sampling frequency for audio. When using low bitrates, you should
 | 
			
		||||
lower this frequency to 22050 or 11025. The supported frequencies
 | 
			
		||||
depend on the selected audio codec.
 | 
			
		||||
 | 
			
		||||
@item AVOptionAudio [@var{codec}:]@var{option} @var{value} (@emph{encoding,audio})
 | 
			
		||||
Set generic or private option for audio stream.
 | 
			
		||||
Private option must be prefixed with codec name or codec must be defined before.
 | 
			
		||||
@item AVOptionAudio @var{option} @var{value} (@emph{encoding,audio})
 | 
			
		||||
Set generic option for audio stream.
 | 
			
		||||
 | 
			
		||||
@item AVPresetAudio @var{preset} (@emph{encoding,audio})
 | 
			
		||||
Set preset for audio stream.
 | 
			
		||||
@@ -682,9 +667,8 @@ Set video @option{qdiff} encoding option.
 | 
			
		||||
@item DarkMask @var{float} (@emph{encoding,video})
 | 
			
		||||
Set @option{lumi_mask}/@option{dark_mask} encoding options.
 | 
			
		||||
 | 
			
		||||
@item AVOptionVideo [@var{codec}:]@var{option} @var{value} (@emph{encoding,video})
 | 
			
		||||
Set generic or private option for video stream.
 | 
			
		||||
Private option must be prefixed with codec name or codec must be defined before.
 | 
			
		||||
@item AVOptionVideo @var{option} @var{value} (@emph{encoding,video})
 | 
			
		||||
Set generic option for video stream.
 | 
			
		||||
 | 
			
		||||
@item AVPresetVideo @var{preset} (@emph{encoding,video})
 | 
			
		||||
Set preset for video stream.
 | 
			
		||||
 
 | 
			
		||||
@@ -36,10 +36,8 @@ Possible forms of stream specifiers are:
 | 
			
		||||
Matches the stream with this index. E.g. @code{-threads:1 4} would set the
 | 
			
		||||
thread count for the second stream to 4.
 | 
			
		||||
@item @var{stream_type}[:@var{stream_index}]
 | 
			
		||||
@var{stream_type} is one of following: 'v' or 'V' for video, 'a' for audio, 's'
 | 
			
		||||
for subtitle, 'd' for data, and 't' for attachments. 'v' matches all video
 | 
			
		||||
streams, 'V' only matches video streams which are not attached pictures, video
 | 
			
		||||
thumbnails or cover arts.  If @var{stream_index} is given, then it matches
 | 
			
		||||
@var{stream_type} is one of following: 'v' for video, 'a' for audio, 's' for subtitle,
 | 
			
		||||
'd' for data, and 't' for attachments. If @var{stream_index} is given, then it matches
 | 
			
		||||
stream number @var{stream_index} of this type. Otherwise, it matches all
 | 
			
		||||
streams of this type.
 | 
			
		||||
@item p:@var{program_id}[:@var{stream_index}]
 | 
			
		||||
@@ -52,9 +50,6 @@ Match the stream by stream id (e.g. PID in MPEG-TS container).
 | 
			
		||||
Matches streams with the metadata tag @var{key} having the specified value. If
 | 
			
		||||
@var{value} is not given, matches streams that contain the given tag with any
 | 
			
		||||
value.
 | 
			
		||||
@item u
 | 
			
		||||
Matches streams with usable configuration, the codec must be defined and the
 | 
			
		||||
essential information such as video dimension or audio sample rate must be present.
 | 
			
		||||
 | 
			
		||||
Note that in @command{ffmpeg}, matching by metadata will only work properly for
 | 
			
		||||
input files.
 | 
			
		||||
@@ -108,10 +103,7 @@ Print detailed information about the filter name @var{filter_name}. Use the
 | 
			
		||||
Show version.
 | 
			
		||||
 | 
			
		||||
@item -formats
 | 
			
		||||
Show available formats (including devices).
 | 
			
		||||
 | 
			
		||||
@item -devices
 | 
			
		||||
Show available devices.
 | 
			
		||||
Show available formats.
 | 
			
		||||
 | 
			
		||||
@item -codecs
 | 
			
		||||
Show all codecs known to libavcodec.
 | 
			
		||||
@@ -146,22 +138,6 @@ Show channel names and standard channel layouts.
 | 
			
		||||
@item -colors
 | 
			
		||||
Show recognized color names.
 | 
			
		||||
 | 
			
		||||
@item -sources @var{device}[,@var{opt1}=@var{val1}[,@var{opt2}=@var{val2}]...]
 | 
			
		||||
Show autodetected sources of the intput device.
 | 
			
		||||
Some devices may provide system-dependent source names that cannot be autodetected.
 | 
			
		||||
The returned list cannot be assumed to be always complete.
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -sources pulse,server=192.168.0.4
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item -sinks @var{device}[,@var{opt1}=@var{val1}[,@var{opt2}=@var{val2}]...]
 | 
			
		||||
Show autodetected sinks of the output device.
 | 
			
		||||
Some devices may provide system-dependent sink names that cannot be autodetected.
 | 
			
		||||
The returned list cannot be assumed to be always complete.
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -sinks pulse,server=192.168.0.4
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item -loglevel [repeat+]@var{loglevel} | -v [repeat+]@var{loglevel}
 | 
			
		||||
Set the logging level used by the library.
 | 
			
		||||
Adding "repeat+" indicates that repeated log output should not be compressed
 | 
			
		||||
@@ -170,29 +146,28 @@ omitted. "repeat" can also be used alone.
 | 
			
		||||
If "repeat" is used alone, and with no prior loglevel set, the default
 | 
			
		||||
loglevel will be used. If multiple loglevel parameters are given, using
 | 
			
		||||
'repeat' will not change the loglevel.
 | 
			
		||||
@var{loglevel} is a string or a number containing one of the following values:
 | 
			
		||||
@var{loglevel} is a number or a string containing one of the following values:
 | 
			
		||||
@table @samp
 | 
			
		||||
@item quiet, -8
 | 
			
		||||
@item quiet
 | 
			
		||||
Show nothing at all; be silent.
 | 
			
		||||
@item panic, 0
 | 
			
		||||
@item panic
 | 
			
		||||
Only show fatal errors which could lead the process to crash, such as
 | 
			
		||||
and assert failure. This is not currently used for anything.
 | 
			
		||||
@item fatal, 8
 | 
			
		||||
@item fatal
 | 
			
		||||
Only show fatal errors. These are errors after which the process absolutely
 | 
			
		||||
cannot continue after.
 | 
			
		||||
@item error, 16
 | 
			
		||||
@item error
 | 
			
		||||
Show all errors, including ones which can be recovered from.
 | 
			
		||||
@item warning, 24
 | 
			
		||||
@item warning
 | 
			
		||||
Show all warnings and errors. Any message related to possibly
 | 
			
		||||
incorrect or unexpected events will be shown.
 | 
			
		||||
@item info, 32
 | 
			
		||||
@item info
 | 
			
		||||
Show informative messages during processing. This is in addition to
 | 
			
		||||
warnings and errors. This is the default value.
 | 
			
		||||
@item verbose, 40
 | 
			
		||||
@item verbose
 | 
			
		||||
Same as @code{info}, except more verbose.
 | 
			
		||||
@item debug, 48
 | 
			
		||||
@item debug
 | 
			
		||||
Show everything, including debugging information.
 | 
			
		||||
@item trace, 56
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
By default the program logs to stderr, if coloring is supported by the
 | 
			
		||||
@@ -210,29 +185,21 @@ directory.
 | 
			
		||||
This file can be useful for bug reports.
 | 
			
		||||
It also implies @code{-loglevel verbose}.
 | 
			
		||||
 | 
			
		||||
Setting the environment variable @env{FFREPORT} to any value has the
 | 
			
		||||
Setting the environment variable @code{FFREPORT} to any value has the
 | 
			
		||||
same effect. If the value is a ':'-separated key=value sequence, these
 | 
			
		||||
options will affect the report; option values must be escaped if they
 | 
			
		||||
options will affect the report; options values must be escaped if they
 | 
			
		||||
contain special characters or the options delimiter ':' (see the
 | 
			
		||||
``Quoting and escaping'' section in the ffmpeg-utils manual).
 | 
			
		||||
 | 
			
		||||
The following options are recognized:
 | 
			
		||||
``Quoting and escaping'' section in the ffmpeg-utils manual). The
 | 
			
		||||
following option is recognized:
 | 
			
		||||
@table @option
 | 
			
		||||
@item file
 | 
			
		||||
set the file name to use for the report; @code{%p} is expanded to the name
 | 
			
		||||
of the program, @code{%t} is expanded to a timestamp, @code{%%} is expanded
 | 
			
		||||
to a plain @code{%}
 | 
			
		||||
@item level
 | 
			
		||||
set the log verbosity level using a numerical value (see @code{-loglevel}).
 | 
			
		||||
set the log level
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
For example, to output a report to a file named @file{ffreport.log}
 | 
			
		||||
using a log level of @code{32} (alias for log level @code{info}):
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
FFREPORT=file=ffreport.log:level=32 ffmpeg -i input output
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Errors in parsing the environment variable are not fatal, and will not
 | 
			
		||||
appear in the report.
 | 
			
		||||
 | 
			
		||||
@@ -267,14 +234,10 @@ Possible flags for this option are:
 | 
			
		||||
@item sse4.1
 | 
			
		||||
@item sse4.2
 | 
			
		||||
@item avx
 | 
			
		||||
@item avx2
 | 
			
		||||
@item xop
 | 
			
		||||
@item fma3
 | 
			
		||||
@item fma4
 | 
			
		||||
@item 3dnow
 | 
			
		||||
@item 3dnowext
 | 
			
		||||
@item bmi1
 | 
			
		||||
@item bmi2
 | 
			
		||||
@item cmov
 | 
			
		||||
@end table
 | 
			
		||||
@item ARM
 | 
			
		||||
@@ -285,13 +248,6 @@ Possible flags for this option are:
 | 
			
		||||
@item vfp
 | 
			
		||||
@item vfpv3
 | 
			
		||||
@item neon
 | 
			
		||||
@item setend
 | 
			
		||||
@end table
 | 
			
		||||
@item AArch64
 | 
			
		||||
@table @samp
 | 
			
		||||
@item armv8
 | 
			
		||||
@item vfp
 | 
			
		||||
@item neon
 | 
			
		||||
@end table
 | 
			
		||||
@item PowerPC
 | 
			
		||||
@table @samp
 | 
			
		||||
@@ -311,41 +267,8 @@ Possible flags for this option are:
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@item -opencl_bench
 | 
			
		||||
This option is used to benchmark all available OpenCL devices and print the
 | 
			
		||||
results. This option is only available when FFmpeg has been compiled with
 | 
			
		||||
@code{--enable-opencl}.
 | 
			
		||||
 | 
			
		||||
When FFmpeg is configured with @code{--enable-opencl}, the options for the
 | 
			
		||||
global OpenCL context are set via @option{-opencl_options}. See the
 | 
			
		||||
"OpenCL Options" section in the ffmpeg-utils manual for the complete list of
 | 
			
		||||
supported options. Amongst others, these options include the ability to select
 | 
			
		||||
a specific platform and device to run the OpenCL code on. By default, FFmpeg
 | 
			
		||||
will run on the first device of the first platform. While the options for the
 | 
			
		||||
global OpenCL context provide flexibility to the user in selecting the OpenCL
 | 
			
		||||
device of their choice, most users would probably want to select the fastest
 | 
			
		||||
OpenCL device for their system.
 | 
			
		||||
 | 
			
		||||
This option assists the selection of the most efficient configuration by
 | 
			
		||||
identifying the appropriate device for the user's system. The built-in
 | 
			
		||||
benchmark is run on all the OpenCL devices and the performance is measured for
 | 
			
		||||
each device. The devices in the results list are sorted based on their
 | 
			
		||||
performance with the fastest device listed first. The user can subsequently
 | 
			
		||||
invoke @command{ffmpeg} using the device deemed most appropriate via
 | 
			
		||||
@option{-opencl_options} to obtain the best performance for the OpenCL
 | 
			
		||||
accelerated code.
 | 
			
		||||
 | 
			
		||||
Typical usage to use the fastest OpenCL device involve the following steps.
 | 
			
		||||
 | 
			
		||||
Run the command:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -opencl_bench
 | 
			
		||||
@end example
 | 
			
		||||
Note down the platform ID (@var{pidx}) and device ID (@var{didx}) of the first
 | 
			
		||||
i.e. fastest device in the list.
 | 
			
		||||
Select the platform and device using the command:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -opencl_options platform_idx=@var{pidx}:device_idx=@var{didx} ...
 | 
			
		||||
@end example
 | 
			
		||||
Benchmark all available OpenCL devices and show the results. This option
 | 
			
		||||
is only available when FFmpeg has been compiled with @code{--enable-opencl}.
 | 
			
		||||
 | 
			
		||||
@item -opencl_options options (@emph{global})
 | 
			
		||||
Set OpenCL environment options. This option is only available when
 | 
			
		||||
 
 | 
			
		||||
@@ -98,7 +98,7 @@ Buffer references ownership and permissions
 | 
			
		||||
    The AVFilterLink structure has a few AVFilterBufferRef fields. The
 | 
			
		||||
    cur_buf and out_buf were used with the deprecated
 | 
			
		||||
    start_frame/draw_slice/end_frame API and should no longer be used.
 | 
			
		||||
    src_buf and partial_buf are used by libavfilter internally
 | 
			
		||||
    src_buf, cur_buf_copy and partial_buf are used by libavfilter internally
 | 
			
		||||
    and must not be accessed by filters.
 | 
			
		||||
 | 
			
		||||
  Reference permissions
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2600
									
								
								doc/filters.texi
									
									
									
									
									
								
							
							
						
						
									
										2600
									
								
								doc/filters.texi
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -23,7 +23,7 @@ Reduce buffering.
 | 
			
		||||
 | 
			
		||||
@item probesize @var{integer} (@emph{input})
 | 
			
		||||
Set probing size in bytes, i.e. the size of the data to analyze to get
 | 
			
		||||
stream information. A higher value will enable detecting more
 | 
			
		||||
stream information. A higher value will allow to detect more
 | 
			
		||||
information in case it is dispersed into the stream, but will increase
 | 
			
		||||
latency. Must be an integer not lesser than 32. It is 5000000 by default.
 | 
			
		||||
 | 
			
		||||
@@ -37,8 +37,6 @@ Possible values:
 | 
			
		||||
@table @samp
 | 
			
		||||
@item ignidx
 | 
			
		||||
Ignore index.
 | 
			
		||||
@item fastseek
 | 
			
		||||
Enable fast, but inaccurate seeks for some formats.
 | 
			
		||||
@item genpts
 | 
			
		||||
Generate PTS.
 | 
			
		||||
@item nofillin
 | 
			
		||||
@@ -57,10 +55,6 @@ Do not merge side data.
 | 
			
		||||
Enable RTP MP4A-LATM payload.
 | 
			
		||||
@item nobuffer
 | 
			
		||||
Reduce the latency introduced by optional buffering
 | 
			
		||||
@item bitexact
 | 
			
		||||
Only write platform-, build- and time-independent data.
 | 
			
		||||
This ensures that file and data checksums are reproducible and match between
 | 
			
		||||
platforms. Its primary use is for regression testing.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@item seek2any @var{integer} (@emph{input})
 | 
			
		||||
@@ -69,7 +63,7 @@ Default is 0.
 | 
			
		||||
 | 
			
		||||
@item analyzeduration @var{integer} (@emph{input})
 | 
			
		||||
Specify how many microseconds are analyzed to probe the input. A
 | 
			
		||||
higher value will enable detecting more accurate information, but will
 | 
			
		||||
higher value will allow to detect more accurate information, but will
 | 
			
		||||
increase latency. It defaults to 5,000,000 microseconds = 5 seconds.
 | 
			
		||||
 | 
			
		||||
@item cryptokey @var{hexadecimal string} (@emph{input})
 | 
			
		||||
@@ -127,25 +121,6 @@ Consider all spec non compliancies as errors.
 | 
			
		||||
Consider things that a sane encoder should not do as an error.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@item max_interleave_delta @var{integer} (@emph{output})
 | 
			
		||||
Set maximum buffering duration for interleaving. The duration is
 | 
			
		||||
expressed in microseconds, and defaults to 1000000 (1 second).
 | 
			
		||||
 | 
			
		||||
To ensure all the streams are interleaved correctly, libavformat will
 | 
			
		||||
wait until it has at least one packet for each stream before actually
 | 
			
		||||
writing any packets to the output file. When some streams are
 | 
			
		||||
"sparse" (i.e. there are large gaps between successive packets), this
 | 
			
		||||
can result in excessive buffering.
 | 
			
		||||
 | 
			
		||||
This field specifies the maximum difference between the timestamps of the
 | 
			
		||||
first and the last packet in the muxing queue, above which libavformat
 | 
			
		||||
will output a packet regardless of whether it has queued a packet for all
 | 
			
		||||
the streams.
 | 
			
		||||
 | 
			
		||||
If set to 0, libavformat will continue buffering packets until it has
 | 
			
		||||
a packet for each stream, regardless of the maximum timestamp
 | 
			
		||||
difference between the buffered packets.
 | 
			
		||||
 | 
			
		||||
@item use_wallclock_as_timestamps @var{integer} (@emph{input})
 | 
			
		||||
Use wallclock as timestamps.
 | 
			
		||||
 | 
			
		||||
@@ -193,18 +168,6 @@ The offset is added by the muxer to the output timestamps.
 | 
			
		||||
Specifying a positive offset means that the corresponding streams are
 | 
			
		||||
delayed bt the time duration specified in @var{offset}. Default value
 | 
			
		||||
is @code{0} (meaning that no offset is applied).
 | 
			
		||||
 | 
			
		||||
@item format_whitelist @var{list} (@emph{input})
 | 
			
		||||
"," separated List of allowed demuxers. By default all are allowed.
 | 
			
		||||
 | 
			
		||||
@item dump_separator @var{string} (@emph{input})
 | 
			
		||||
Separator used to separate the fields printed on the command line about the
 | 
			
		||||
Stream parameters.
 | 
			
		||||
For example to separate the fields with newlines and indention:
 | 
			
		||||
@example
 | 
			
		||||
ffprobe -dump_separator "
 | 
			
		||||
                          "  -i ~/videos/matrixbench_mpeg2.mpg
 | 
			
		||||
@end example
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@c man end FORMAT OPTIONS
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,4 @@
 | 
			
		||||
\input texinfo @c -*- texinfo -*-
 | 
			
		||||
@documentencoding UTF-8
 | 
			
		||||
 | 
			
		||||
@settitle General Documentation
 | 
			
		||||
@titlepage
 | 
			
		||||
@@ -109,14 +108,6 @@ Go to @url{http://www.wavpack.com/} and follow the instructions for
 | 
			
		||||
installing the library. Then pass @code{--enable-libwavpack} to configure to
 | 
			
		||||
enable it.
 | 
			
		||||
 | 
			
		||||
@section OpenH264
 | 
			
		||||
 | 
			
		||||
FFmpeg can make use of the OpenH264 library for H.264 encoding.
 | 
			
		||||
 | 
			
		||||
Go to @url{http://www.openh264.org/} and follow the instructions for
 | 
			
		||||
installing the library. Then pass @code{--enable-libopenh264} to configure to
 | 
			
		||||
enable it.
 | 
			
		||||
 | 
			
		||||
@section x264
 | 
			
		||||
 | 
			
		||||
FFmpeg can make use of the x264 library for H.264 encoding.
 | 
			
		||||
@@ -145,14 +136,6 @@ x265 is under the GNU Public License Version 2 or later
 | 
			
		||||
details), you must upgrade FFmpeg's license to GPL in order to use it.
 | 
			
		||||
@end float
 | 
			
		||||
 | 
			
		||||
@section kvazaar
 | 
			
		||||
 | 
			
		||||
FFmpeg can make use of the kvazaar library for HEVC encoding.
 | 
			
		||||
 | 
			
		||||
Go to @url{https://github.com/ultravideo/kvazaar} and follow the
 | 
			
		||||
instructions for installing the library. Then pass
 | 
			
		||||
@code{--enable-libkvazaar} to configure to enable it.
 | 
			
		||||
 | 
			
		||||
@section libilbc
 | 
			
		||||
 | 
			
		||||
iLBC is a narrowband speech codec that has been made freely available
 | 
			
		||||
@@ -160,7 +143,7 @@ by Google as part of the WebRTC project. libilbc is a packaging friendly
 | 
			
		||||
copy of the iLBC codec. FFmpeg can make use of the libilbc library for
 | 
			
		||||
iLBC encoding and decoding.
 | 
			
		||||
 | 
			
		||||
Go to @url{https://github.com/TimothyGu/libilbc} and follow the instructions for
 | 
			
		||||
Go to @url{https://github.com/dekkers/libilbc} and follow the instructions for
 | 
			
		||||
installing the library. Then pass @code{--enable-libilbc} to configure to
 | 
			
		||||
enable it.
 | 
			
		||||
 | 
			
		||||
@@ -187,8 +170,8 @@ included in compat/avisynth/, which allows the user to enable support
 | 
			
		||||
without needing to search for these headers themselves.
 | 
			
		||||
 | 
			
		||||
For Windows, supported AviSynth variants are
 | 
			
		||||
@url{http://avisynth.nl, AviSynth 2.6 RC1 or higher} for 32-bit builds and
 | 
			
		||||
@url{http://avs-plus.net, AviSynth+ r1718 or higher} for 32-bit and 64-bit builds.
 | 
			
		||||
@url{http://avisynth.nl, AviSynth 2.5 or 2.6} for 32-bit builds and
 | 
			
		||||
@url{http://avs-plus.net, AviSynth+ 0.1} for 32-bit and 64-bit builds.
 | 
			
		||||
 | 
			
		||||
For Linux and OS X, the supported AviSynth variant is
 | 
			
		||||
@url{https://github.com/avxsynth/avxsynth, AvxSynth}.
 | 
			
		||||
@@ -200,17 +183,6 @@ end user having AviSynth or AvxSynth installed - they'll only need to be
 | 
			
		||||
installed to use AviSynth scripts (obviously).
 | 
			
		||||
@end float
 | 
			
		||||
 | 
			
		||||
@section Intel QuickSync Video
 | 
			
		||||
 | 
			
		||||
FFmpeg can use Intel QuickSync Video (QSV) for accelerated encoding and decoding
 | 
			
		||||
of multiple codecs. To use QSV, FFmpeg must be linked against the @code{libmfx}
 | 
			
		||||
dispatcher, which loads the actual decoding libraries.
 | 
			
		||||
 | 
			
		||||
The dispatcher is open source and can be downloaded from
 | 
			
		||||
@url{https://github.com/lu-zero/mfx_dispatch.git}. FFmpeg needs to be configured
 | 
			
		||||
with the @code{--enable-libmfx} option and @code{pkg-config} needs to be able to
 | 
			
		||||
locate the dispatcher's @code{.pc} files.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@chapter Supported File Formats, Codecs or Features
 | 
			
		||||
 | 
			
		||||
@@ -226,10 +198,6 @@ library:
 | 
			
		||||
@item 4xm                       @tab   @tab X
 | 
			
		||||
    @tab 4X Technologies format, used in some games.
 | 
			
		||||
@item 8088flex TMV              @tab   @tab X
 | 
			
		||||
@item AAX                       @tab   @tab X
 | 
			
		||||
    @tab Audible Enhanced Audio format, used in audiobooks.
 | 
			
		||||
@item AA                        @tab   @tab X
 | 
			
		||||
    @tab Audible Format 2, 3, and 4, used in audiobooks.
 | 
			
		||||
@item ACT Voice                 @tab   @tab X
 | 
			
		||||
    @tab contains G.729 audio
 | 
			
		||||
@item Adobe Filmstrip           @tab X @tab X
 | 
			
		||||
@@ -245,7 +213,6 @@ library:
 | 
			
		||||
    @tab Audio format used on the Nintendo Gamecube.
 | 
			
		||||
@item AFC                       @tab   @tab X
 | 
			
		||||
    @tab Audio format used on the Nintendo Gamecube.
 | 
			
		||||
@item APNG                      @tab X @tab X
 | 
			
		||||
@item ASF                       @tab X @tab X
 | 
			
		||||
@item AST                       @tab X @tab X
 | 
			
		||||
    @tab Audio format used on the Nintendo Wii.
 | 
			
		||||
@@ -266,8 +233,6 @@ library:
 | 
			
		||||
    @tab Used in Z and Z95 games.
 | 
			
		||||
@item Brute Force & Ignorance   @tab   @tab X
 | 
			
		||||
    @tab Used in the game Flash Traffic: City of Angels.
 | 
			
		||||
@item BFSTM                     @tab   @tab X
 | 
			
		||||
    @tab Audio format used on the Nintendo WiiU (based on BRSTM).
 | 
			
		||||
@item BRSTM                     @tab   @tab X
 | 
			
		||||
    @tab Audio format used on the Nintendo Wii.
 | 
			
		||||
@item BWF                       @tab X @tab X
 | 
			
		||||
@@ -278,10 +243,6 @@ library:
 | 
			
		||||
    @tab Used in the game Cyberia from Interplay.
 | 
			
		||||
@item Delphine Software International CIN @tab   @tab X
 | 
			
		||||
    @tab Multimedia format used by Delphine Software games.
 | 
			
		||||
@item Digital Speech Standard (DSS) @tab   @tab X
 | 
			
		||||
@item Canopus HQ                @tab   @tab X
 | 
			
		||||
@item Canopus HQA               @tab   @tab X
 | 
			
		||||
@item Canopus HQX               @tab   @tab X
 | 
			
		||||
@item CD+G                      @tab   @tab X
 | 
			
		||||
    @tab Video format used by CD+G karaoke disks
 | 
			
		||||
@item Phantom Cine              @tab   @tab X
 | 
			
		||||
@@ -298,7 +259,6 @@ library:
 | 
			
		||||
@item Deluxe Paint Animation    @tab   @tab X
 | 
			
		||||
@item DFA                       @tab   @tab X
 | 
			
		||||
    @tab This format is used in Chronomaster game
 | 
			
		||||
@item DirectDraw Surface        @tab   @tab X
 | 
			
		||||
@item DSD Stream File (DSF)     @tab   @tab X
 | 
			
		||||
@item DV video                  @tab X @tab X
 | 
			
		||||
@item DXA                       @tab   @tab X
 | 
			
		||||
@@ -494,8 +454,6 @@ library:
 | 
			
		||||
@item Sony Wave64 (W64)         @tab X @tab X
 | 
			
		||||
@item SoX native format         @tab X @tab X
 | 
			
		||||
@item SUN AU format             @tab X @tab X
 | 
			
		||||
@item SUP raw PGS subtitles     @tab   @tab X
 | 
			
		||||
@item TDSC                      @tab   @tab X
 | 
			
		||||
@item Text files                @tab   @tab X
 | 
			
		||||
@item THP                       @tab   @tab X
 | 
			
		||||
    @tab Used on the Nintendo GameCube.
 | 
			
		||||
@@ -503,7 +461,6 @@ library:
 | 
			
		||||
    @tab Tiertex .seq files used in the DOS CD-ROM version of the game Flashback.
 | 
			
		||||
@item True Audio                @tab   @tab X
 | 
			
		||||
@item VC-1 test bitstream       @tab X @tab X
 | 
			
		||||
@item Vidvox Hap                @tab X @tab X
 | 
			
		||||
@item Vivo                      @tab   @tab X
 | 
			
		||||
@item WAV                       @tab X @tab X
 | 
			
		||||
@item WavPack                   @tab X @tab X
 | 
			
		||||
@@ -538,7 +495,6 @@ following image formats are supported:
 | 
			
		||||
@item Alias PIX    @tab X @tab X
 | 
			
		||||
    @tab Alias/Wavefront PIX image format
 | 
			
		||||
@item animated GIF @tab X @tab X
 | 
			
		||||
@item APNG         @tab X @tab X
 | 
			
		||||
@item BMP          @tab X @tab X
 | 
			
		||||
    @tab Microsoft BMP image
 | 
			
		||||
@item BRender PIX  @tab   @tab X
 | 
			
		||||
@@ -690,17 +646,15 @@ following image formats are supported:
 | 
			
		||||
    @tab Sorenson H.263 used in Flash
 | 
			
		||||
@item Forward Uncompressed   @tab     @tab  X
 | 
			
		||||
@item Fraps                  @tab     @tab  X
 | 
			
		||||
@item Go2Meeting             @tab     @tab  X
 | 
			
		||||
    @tab fourcc: G2M2, G2M3
 | 
			
		||||
@item Go2Webinar             @tab     @tab  X
 | 
			
		||||
    @tab fourcc: G2M4
 | 
			
		||||
@item H.261                  @tab  X  @tab  X
 | 
			
		||||
@item H.263 / H.263-1996     @tab  X  @tab  X
 | 
			
		||||
@item H.263+ / H.263-1998 / H.263 version 2  @tab  X  @tab  X
 | 
			
		||||
@item H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10  @tab  E  @tab  X
 | 
			
		||||
    @tab encoding supported through external library libx264 and OpenH264
 | 
			
		||||
    @tab encoding supported through external library libx264
 | 
			
		||||
@item HEVC                   @tab  X  @tab  X
 | 
			
		||||
    @tab encoding supported through external library libx265 and libkvazaar
 | 
			
		||||
    @tab encoding supported through the external library libx265
 | 
			
		||||
@item HNM version 4          @tab     @tab  X
 | 
			
		||||
@item HuffYUV                @tab  X  @tab  X
 | 
			
		||||
@item HuffYUV FFmpeg variant @tab  X  @tab  X
 | 
			
		||||
@@ -865,7 +819,7 @@ following image formats are supported:
 | 
			
		||||
@item Name @tab Encoding @tab Decoding @tab Comments
 | 
			
		||||
@item 8SVX exponential       @tab     @tab  X
 | 
			
		||||
@item 8SVX fibonacci         @tab     @tab  X
 | 
			
		||||
@item AAC+                   @tab  E  @tab  IX
 | 
			
		||||
@item AAC+                   @tab  E  @tab  X
 | 
			
		||||
    @tab encoding supported through external library libaacplus
 | 
			
		||||
@item AAC                    @tab  E  @tab  X
 | 
			
		||||
    @tab encoding supported through external library libfaac and libvo-aacenc
 | 
			
		||||
@@ -905,7 +859,7 @@ following image formats are supported:
 | 
			
		||||
@item ADPCM MS IMA           @tab  X  @tab  X
 | 
			
		||||
@item ADPCM Nintendo Gamecube AFC  @tab     @tab  X
 | 
			
		||||
@item ADPCM Nintendo Gamecube DTK  @tab     @tab  X
 | 
			
		||||
@item ADPCM Nintendo THP  @tab     @tab  X
 | 
			
		||||
@item ADPCM Nintendo Gamecube THP  @tab     @tab  X
 | 
			
		||||
@item ADPCM QT IMA           @tab  X  @tab  X
 | 
			
		||||
@item ADPCM SEGA CRI ADX     @tab  X  @tab  X
 | 
			
		||||
    @tab Used in Sega Dreamcast games.
 | 
			
		||||
@@ -934,12 +888,10 @@ following image formats are supported:
 | 
			
		||||
    @tab decoding supported through external library libcelt
 | 
			
		||||
@item Delphine Software International CIN audio  @tab     @tab  X
 | 
			
		||||
    @tab Codec used in Delphine Software International games.
 | 
			
		||||
@item Digital Speech Standard - Standard Play mode (DSS SP) @tab     @tab  X
 | 
			
		||||
@item Discworld II BMV Audio @tab     @tab  X
 | 
			
		||||
@item COOK                   @tab     @tab  X
 | 
			
		||||
    @tab All versions except 5.1 are supported.
 | 
			
		||||
@item DCA (DTS Coherent Acoustics)  @tab  X  @tab  X
 | 
			
		||||
    @tab supported extensions: XCh, XLL (partially)
 | 
			
		||||
@item DPCM id RoQ            @tab  X  @tab  X
 | 
			
		||||
    @tab Used in Quake III, Jedi Knight 2 and other computer games.
 | 
			
		||||
@item DPCM Interplay         @tab     @tab  X
 | 
			
		||||
@@ -983,8 +935,8 @@ following image formats are supported:
 | 
			
		||||
@item Musepack SV8           @tab     @tab  X
 | 
			
		||||
@item Nellymoser Asao        @tab  X  @tab  X
 | 
			
		||||
@item On2 AVC (Audio for Video Codec) @tab     @tab  X
 | 
			
		||||
@item Opus                   @tab  E  @tab  X
 | 
			
		||||
    @tab encoding supported through external library libopus
 | 
			
		||||
@item Opus                   @tab  E  @tab  E
 | 
			
		||||
    @tab supported through external library libopus
 | 
			
		||||
@item PCM A-law              @tab  X  @tab  X
 | 
			
		||||
@item PCM mu-law             @tab  X  @tab  X
 | 
			
		||||
@item PCM signed 8-bit planar  @tab  X  @tab  X
 | 
			
		||||
@@ -1078,7 +1030,6 @@ performance on systems without hardware floating point support).
 | 
			
		||||
@item PJS (Phoenix)    @tab   @tab X @tab   @tab X
 | 
			
		||||
@item RealText         @tab   @tab X @tab   @tab X
 | 
			
		||||
@item SAMI             @tab   @tab X @tab   @tab X
 | 
			
		||||
@item Spruce format (STL) @tab   @tab X @tab   @tab X
 | 
			
		||||
@item SSA/ASS          @tab X @tab X @tab X @tab X
 | 
			
		||||
@item SubRip (SRT)     @tab X @tab X @tab X @tab X
 | 
			
		||||
@item SubViewer v1     @tab   @tab X @tab   @tab X
 | 
			
		||||
 
 | 
			
		||||
@@ -1,10 +1,9 @@
 | 
			
		||||
\input texinfo @c -*- texinfo -*-
 | 
			
		||||
@documentencoding UTF-8
 | 
			
		||||
 | 
			
		||||
@settitle Using Git to develop FFmpeg
 | 
			
		||||
@settitle Using git to develop FFmpeg
 | 
			
		||||
 | 
			
		||||
@titlepage
 | 
			
		||||
@center @titlefont{Using Git to develop FFmpeg}
 | 
			
		||||
@center @titlefont{Using git to develop FFmpeg}
 | 
			
		||||
@end titlepage
 | 
			
		||||
 | 
			
		||||
@top
 | 
			
		||||
@@ -13,9 +12,9 @@
 | 
			
		||||
 | 
			
		||||
@chapter Introduction
 | 
			
		||||
 | 
			
		||||
This document aims in giving some quick references on a set of useful Git
 | 
			
		||||
This document aims in giving some quick references on a set of useful git
 | 
			
		||||
commands. You should always use the extensive and detailed documentation
 | 
			
		||||
provided directly by Git:
 | 
			
		||||
provided directly by git:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
git --help
 | 
			
		||||
@@ -32,21 +31,22 @@ man git-<command>
 | 
			
		||||
shows information about the subcommand <command>.
 | 
			
		||||
 | 
			
		||||
Additional information could be found on the
 | 
			
		||||
@url{http://gitref.org, Git Reference} website.
 | 
			
		||||
@url{http://gitref.org, Git Reference} website
 | 
			
		||||
 | 
			
		||||
For more information about the Git project, visit the
 | 
			
		||||
@url{http://git-scm.com/, Git website}.
 | 
			
		||||
 | 
			
		||||
@url{http://git-scm.com/, Git website}
 | 
			
		||||
 | 
			
		||||
Consult these resources whenever you have problems, they are quite exhaustive.
 | 
			
		||||
 | 
			
		||||
What follows now is a basic introduction to Git and some FFmpeg-specific
 | 
			
		||||
guidelines to ease the contribution to the project.
 | 
			
		||||
guidelines to ease the contribution to the project
 | 
			
		||||
 | 
			
		||||
@chapter Basics Usage
 | 
			
		||||
 | 
			
		||||
@section Get Git
 | 
			
		||||
@section Get GIT
 | 
			
		||||
 | 
			
		||||
You can get Git from @url{http://git-scm.com/}
 | 
			
		||||
You can get git from @url{http://git-scm.com/}
 | 
			
		||||
Most distribution and operating system provide a package for it.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -74,7 +74,6 @@ git config --global core.autocrlf false
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@anchor{Updating the source tree to the latest revision}
 | 
			
		||||
@section Updating the source tree to the latest revision
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
@@ -107,7 +106,7 @@ git add [-A] <filename/dirname>
 | 
			
		||||
git rm [-r] <filename/dirname>
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Git needs to get notified of all changes you make to your working
 | 
			
		||||
GIT needs to get notified of all changes you make to your working
 | 
			
		||||
directory that makes files appear or disappear.
 | 
			
		||||
Line moves across files are automatically tracked.
 | 
			
		||||
 | 
			
		||||
@@ -127,8 +126,8 @@ will show all local modifications in your working directory as unified diff.
 | 
			
		||||
git log <filename(s)>
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
You may also use the graphical tools like @command{gitview} or @command{gitk}
 | 
			
		||||
or the web interface available at @url{http://source.ffmpeg.org/}.
 | 
			
		||||
You may also use the graphical tools like gitview or gitk or the web
 | 
			
		||||
interface available at http://source.ffmpeg.org/
 | 
			
		||||
 | 
			
		||||
@section Checking source tree status
 | 
			
		||||
 | 
			
		||||
@@ -149,7 +148,6 @@ git diff --check
 | 
			
		||||
to double check your changes before committing them to avoid trouble later
 | 
			
		||||
on. All experienced developers do this on each and every commit, no matter
 | 
			
		||||
how small.
 | 
			
		||||
 | 
			
		||||
Every one of them has been saved from looking like a fool by this many times.
 | 
			
		||||
It's very easy for stray debug output or cosmetic modifications to slip in,
 | 
			
		||||
please avoid problems through this extra level of scrutiny.
 | 
			
		||||
@@ -172,14 +170,14 @@ to make sure you don't have untracked files or deletions.
 | 
			
		||||
git add [-i|-p|-A] <filenames/dirnames>
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Make sure you have told Git your name and email address
 | 
			
		||||
Make sure you have told git your name and email address
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
git config --global user.name "My Name"
 | 
			
		||||
git config --global user.email my@@email.invalid
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Use @option{--global} to set the global configuration for all your Git checkouts.
 | 
			
		||||
Use @var{--global} to set the global configuration for all your git checkouts.
 | 
			
		||||
 | 
			
		||||
Git will select the changes to the files for commit. Optionally you can use
 | 
			
		||||
the interactive or the patch mode to select hunk by hunk what should be
 | 
			
		||||
@@ -210,7 +208,7 @@ include filenames in log messages, Git provides that information.
 | 
			
		||||
 | 
			
		||||
Possibly make the commit message have a terse, descriptive first line, an
 | 
			
		||||
empty line and then a full description. The first line will be used to name
 | 
			
		||||
the patch by @command{git format-patch}.
 | 
			
		||||
the patch by git format-patch.
 | 
			
		||||
 | 
			
		||||
@section Preparing a patchset
 | 
			
		||||
 | 
			
		||||
@@ -326,14 +324,12 @@ faulty commit disappear from the history.
 | 
			
		||||
@section Pushing changes to remote trees
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
git push origin master --dry-run
 | 
			
		||||
git push
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Will simulate a push of the local master branch to the default remote
 | 
			
		||||
(@var{origin}). And list which branches and ranges or commits would have been
 | 
			
		||||
pushed.
 | 
			
		||||
Will push the changes to the default remote (@var{origin}).
 | 
			
		||||
Git will prevent you from pushing changes if the local and remote trees are
 | 
			
		||||
out of sync. Refer to @ref{Updating the source tree to the latest revision}.
 | 
			
		||||
out of sync. Refer to and to sync the local tree.
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
git remote add <name> <url>
 | 
			
		||||
@@ -352,24 +348,23 @@ branches matching the local ones.
 | 
			
		||||
 | 
			
		||||
@section Finding a specific svn revision
 | 
			
		||||
 | 
			
		||||
Since version 1.7.1 Git supports @samp{:/foo} syntax for specifying commits
 | 
			
		||||
Since version 1.7.1 git supports @var{:/foo} syntax for specifying commits
 | 
			
		||||
based on a regular expression. see man gitrevisions
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
git show :/'as revision 23456'
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
will show the svn changeset @samp{r23456}. With older Git versions searching in
 | 
			
		||||
will show the svn changeset @var{r23456}. With older git versions searching in
 | 
			
		||||
the @command{git log} output is the easiest option (especially if a pager with
 | 
			
		||||
search capabilities is used).
 | 
			
		||||
 | 
			
		||||
This commit can be checked out with
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
git checkout -b svn_23456 :/'as revision 23456'
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
or for Git < 1.7.1 with
 | 
			
		||||
or for git < 1.7.1 with
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
git checkout -b svn_23456 $SHA1
 | 
			
		||||
@@ -378,7 +373,7 @@ git checkout -b svn_23456 $SHA1
 | 
			
		||||
where @var{$SHA1} is the commit hash from the @command{git log} output.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@chapter Pre-push checklist
 | 
			
		||||
@chapter pre-push checklist
 | 
			
		||||
 | 
			
		||||
Once you have a set of commits that you feel are ready for pushing,
 | 
			
		||||
work through the following checklist to doublecheck everything is in
 | 
			
		||||
@@ -389,7 +384,7 @@ Apply your common sense, but if in doubt, err on the side of caution.
 | 
			
		||||
First, make sure that the commits and branches you are going to push
 | 
			
		||||
match what you want pushed and that nothing is missing, extraneous or
 | 
			
		||||
wrong. You can see what will be pushed by running the git push command
 | 
			
		||||
with @option{--dry-run} first. And then inspecting the commits listed with
 | 
			
		||||
with --dry-run first. And then inspecting the commits listed with
 | 
			
		||||
@command{git log -p 1234567..987654}. The @command{git status} command
 | 
			
		||||
may help in finding local changes that have been forgotten to be added.
 | 
			
		||||
 | 
			
		||||
@@ -398,7 +393,7 @@ Next let the code pass through a full run of our testsuite.
 | 
			
		||||
@itemize
 | 
			
		||||
@item @command{make distclean}
 | 
			
		||||
@item @command{/path/to/ffmpeg/configure}
 | 
			
		||||
@item @command{make fate}
 | 
			
		||||
@item @command{make check}
 | 
			
		||||
@item if fate fails due to missing samples run @command{make fate-rsync} and retry
 | 
			
		||||
@end itemize
 | 
			
		||||
 | 
			
		||||
@@ -416,5 +411,5 @@ recommended.
 | 
			
		||||
 | 
			
		||||
@chapter Server Issues
 | 
			
		||||
 | 
			
		||||
Contact the project admins at @email{root@@ffmpeg.org} if you have technical
 | 
			
		||||
problems with the Git server.
 | 
			
		||||
Contact the project admins @email{root@@ffmpeg.org} if you have technical
 | 
			
		||||
problems with the GIT server.
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										505
									
								
								doc/indevs.texi
									
									
									
									
									
								
							
							
						
						
									
										505
									
								
								doc/indevs.texi
									
									
									
									
									
								
							@@ -1,7 +1,7 @@
 | 
			
		||||
@chapter Input Devices
 | 
			
		||||
@c man begin INPUT DEVICES
 | 
			
		||||
 | 
			
		||||
Input devices are configured elements in FFmpeg which enable accessing
 | 
			
		||||
Input devices are configured elements in FFmpeg which allow to access
 | 
			
		||||
the data coming from a multimedia device attached to your system.
 | 
			
		||||
 | 
			
		||||
When you configure your FFmpeg build, all the supported input devices
 | 
			
		||||
@@ -51,18 +51,6 @@ ffmpeg -f alsa -i hw:0 alsaout.wav
 | 
			
		||||
For more information see:
 | 
			
		||||
@url{http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html}
 | 
			
		||||
 | 
			
		||||
@subsection Options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item sample_rate
 | 
			
		||||
Set the sample rate in Hz. Default is 48000.
 | 
			
		||||
 | 
			
		||||
@item channels
 | 
			
		||||
Set the number of channels. Default is 2.
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section avfoundation
 | 
			
		||||
 | 
			
		||||
AVFoundation input device.
 | 
			
		||||
@@ -70,204 +58,38 @@ AVFoundation input device.
 | 
			
		||||
AVFoundation is the currently recommended framework by Apple for streamgrabbing on OSX >= 10.7 as well as on iOS.
 | 
			
		||||
The older QTKit framework has been marked deprecated since OSX version 10.7.
 | 
			
		||||
 | 
			
		||||
The input filename has to be given in the following syntax:
 | 
			
		||||
@example
 | 
			
		||||
-i "[[VIDEO]:[AUDIO]]"
 | 
			
		||||
@end example
 | 
			
		||||
The first entry selects the video input while the latter selects the audio input.
 | 
			
		||||
The stream has to be specified by the device name or the device index as shown by the device list.
 | 
			
		||||
Alternatively, the video and/or audio input device can be chosen by index using the
 | 
			
		||||
@option{
 | 
			
		||||
    -video_device_index <INDEX>
 | 
			
		||||
}
 | 
			
		||||
and/or
 | 
			
		||||
@option{
 | 
			
		||||
    -audio_device_index <INDEX>
 | 
			
		||||
}
 | 
			
		||||
, overriding any
 | 
			
		||||
device name or index given in the input filename.
 | 
			
		||||
 | 
			
		||||
All available devices can be enumerated by using @option{-list_devices true}, listing
 | 
			
		||||
all device names and corresponding indices.
 | 
			
		||||
 | 
			
		||||
There are two device name aliases:
 | 
			
		||||
@table @code
 | 
			
		||||
 | 
			
		||||
@item default
 | 
			
		||||
Select the AVFoundation default device of the corresponding type.
 | 
			
		||||
 | 
			
		||||
@item none
 | 
			
		||||
Do not record the corresponding media type.
 | 
			
		||||
This is equivalent to specifying an empty device name or index.
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@subsection Options
 | 
			
		||||
 | 
			
		||||
AVFoundation supports the following options:
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item -list_devices <TRUE|FALSE>
 | 
			
		||||
If set to true, a list of all available input devices is given showing all
 | 
			
		||||
device names and indices.
 | 
			
		||||
 | 
			
		||||
@item -video_device_index <INDEX>
 | 
			
		||||
Specify the video device by its index. Overrides anything given in the input filename.
 | 
			
		||||
 | 
			
		||||
@item -audio_device_index <INDEX>
 | 
			
		||||
Specify the audio device by its index. Overrides anything given in the input filename.
 | 
			
		||||
 | 
			
		||||
@item -pixel_format <FORMAT>
 | 
			
		||||
Request the video device to use a specific pixel format.
 | 
			
		||||
If the specified format is not supported, a list of available formats is given
 | 
			
		||||
und the first one in this list is used instead. Available pixel formats are:
 | 
			
		||||
@code{monob, rgb555be, rgb555le, rgb565be, rgb565le, rgb24, bgr24, 0rgb, bgr0, 0bgr, rgb0,
 | 
			
		||||
The filename passed as input is parsed to contain either a device name or index.
 | 
			
		||||
The device index can also be given by using -video_device_index.
 | 
			
		||||
A given device index will override any given device name.
 | 
			
		||||
If the desired device consists of numbers only, use -video_device_index to identify it.
 | 
			
		||||
The default device will be chosen if an empty string  or the device name "default" is given.
 | 
			
		||||
The available devices can be enumerated by using -list_devices.
 | 
			
		||||
The pixel format can be set using -pixel_format.
 | 
			
		||||
Available formats:
 | 
			
		||||
 monob, rgb555be, rgb555le, rgb565be, rgb565le, rgb24, bgr24, 0rgb, bgr0, 0bgr, rgb0,
 | 
			
		||||
 bgr48be, uyvy422, yuva444p, yuva444p16le, yuv444p, yuv422p16, yuv422p10, yuv444p10,
 | 
			
		||||
 yuv420p, nv12, yuyv422, gray}
 | 
			
		||||
 yuv420p, nv12, yuyv422, gray
 | 
			
		||||
 | 
			
		||||
@item -framerate
 | 
			
		||||
Set the grabbing frame rate. Default is @code{ntsc}, corresponding to a
 | 
			
		||||
frame rate of @code{30000/1001}.
 | 
			
		||||
 | 
			
		||||
@item -video_size
 | 
			
		||||
Set the video frame size.
 | 
			
		||||
 | 
			
		||||
@item -capture_cursor
 | 
			
		||||
Capture the mouse pointer. Default is 0.
 | 
			
		||||
 | 
			
		||||
@item -capture_mouse_clicks
 | 
			
		||||
Capture the screen mouse clicks. Default is 0.
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@subsection Examples
 | 
			
		||||
 | 
			
		||||
@itemize
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
Print the list of AVFoundation supported devices and exit:
 | 
			
		||||
@example
 | 
			
		||||
$ ffmpeg -f avfoundation -list_devices true -i ""
 | 
			
		||||
ffmpeg -f avfoundation -i "0" out.mpg
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
Record video from video device 0 and audio from audio device 0 into out.avi:
 | 
			
		||||
@example
 | 
			
		||||
$ ffmpeg -f avfoundation -i "0:0" out.avi
 | 
			
		||||
ffmpeg -f avfoundation -video_device_index 0 -i "" out.mpg
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
Record video from video device 2 and audio from audio device 1 into out.avi:
 | 
			
		||||
@example
 | 
			
		||||
$ ffmpeg -f avfoundation -video_device_index 2 -i ":1" out.avi
 | 
			
		||||
ffmpeg -f avfoundation -pixel_format bgr0 -i "default" out.mpg
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
Record video from the system default video device using the pixel format bgr0 and do not record any audio into out.avi:
 | 
			
		||||
@example
 | 
			
		||||
$ ffmpeg -f avfoundation -pixel_format bgr0 -i "default:none" out.avi
 | 
			
		||||
ffmpeg -f avfoundation -list_devices true -i ""
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@end itemize
 | 
			
		||||
 | 
			
		||||
@section bktr
 | 
			
		||||
 | 
			
		||||
BSD video input device.
 | 
			
		||||
 | 
			
		||||
@subsection Options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item framerate
 | 
			
		||||
Set the frame rate.
 | 
			
		||||
 | 
			
		||||
@item video_size
 | 
			
		||||
Set the video frame size. Default is @code{vga}.
 | 
			
		||||
 | 
			
		||||
@item standard
 | 
			
		||||
 | 
			
		||||
Available values are:
 | 
			
		||||
@table @samp
 | 
			
		||||
@item pal
 | 
			
		||||
 | 
			
		||||
@item ntsc
 | 
			
		||||
 | 
			
		||||
@item secam
 | 
			
		||||
 | 
			
		||||
@item paln
 | 
			
		||||
 | 
			
		||||
@item palm
 | 
			
		||||
 | 
			
		||||
@item ntscj
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section decklink
 | 
			
		||||
 | 
			
		||||
The decklink input device provides capture capabilities for Blackmagic
 | 
			
		||||
DeckLink devices.
 | 
			
		||||
 | 
			
		||||
To enable this input device, you need the Blackmagic DeckLink SDK and you
 | 
			
		||||
need to configure with the appropriate @code{--extra-cflags}
 | 
			
		||||
and @code{--extra-ldflags}.
 | 
			
		||||
On Windows, you need to run the IDL files through @command{widl}.
 | 
			
		||||
 | 
			
		||||
DeckLink is very picky about the formats it supports. Pixel format is
 | 
			
		||||
uyvy422 or v210, framerate and video size must be determined for your device with
 | 
			
		||||
@command{-list_formats 1}. Audio sample rate is always 48 kHz and the number
 | 
			
		||||
of channels can be 2, 8 or 16.
 | 
			
		||||
 | 
			
		||||
@subsection Options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item list_devices
 | 
			
		||||
If set to @option{true}, print a list of devices and exit.
 | 
			
		||||
Defaults to @option{false}.
 | 
			
		||||
 | 
			
		||||
@item list_formats
 | 
			
		||||
If set to @option{true}, print a list of supported formats and exit.
 | 
			
		||||
Defaults to @option{false}.
 | 
			
		||||
 | 
			
		||||
@item bm_v210
 | 
			
		||||
If set to @samp{1}, video is captured in 10 bit v210 instead
 | 
			
		||||
of uyvy422. Not all Blackmagic devices support this option.
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@subsection Examples
 | 
			
		||||
 | 
			
		||||
@itemize
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
List input devices:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -f decklink -list_devices 1 -i dummy
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
List supported formats:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -f decklink -list_formats 1 -i 'Intensity Pro'
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
Capture video clip at 1080i50 (format 11):
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -f decklink -i 'Intensity Pro@@11' -acodec copy -vcodec copy output.avi
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
Capture video clip at 1080i50 10 bit:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -bm_v210 1 -f decklink -i 'UltraStudio Mini Recorder@@11' -acodec copy -vcodec copy output.avi
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@end itemize
 | 
			
		||||
 | 
			
		||||
@section dshow
 | 
			
		||||
 | 
			
		||||
Windows DirectShow input device.
 | 
			
		||||
@@ -285,7 +107,7 @@ The input name should be in the format:
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
where @var{TYPE} can be either @var{audio} or @var{video},
 | 
			
		||||
and @var{NAME} is the device's name or alternative name..
 | 
			
		||||
and @var{NAME} is the device's name.
 | 
			
		||||
 | 
			
		||||
@subsection Options
 | 
			
		||||
 | 
			
		||||
@@ -318,11 +140,11 @@ If set to @option{true}, print a list of selected device's options
 | 
			
		||||
and exit.
 | 
			
		||||
 | 
			
		||||
@item video_device_number
 | 
			
		||||
Set video device number for devices with the same name (starts at 0,
 | 
			
		||||
Set video device number for devices with same name (starts at 0,
 | 
			
		||||
defaults to 0).
 | 
			
		||||
 | 
			
		||||
@item audio_device_number
 | 
			
		||||
Set audio device number for devices with the same name (starts at 0,
 | 
			
		||||
Set audio device number for devices with same name (starts at 0,
 | 
			
		||||
defaults to 0).
 | 
			
		||||
 | 
			
		||||
@item pixel_format
 | 
			
		||||
@@ -338,85 +160,6 @@ Setting this value too low can degrade performance.
 | 
			
		||||
See also
 | 
			
		||||
@url{http://msdn.microsoft.com/en-us/library/windows/desktop/dd377582(v=vs.85).aspx}
 | 
			
		||||
 | 
			
		||||
@item video_pin_name
 | 
			
		||||
Select video capture pin to use by name or alternative name.
 | 
			
		||||
 | 
			
		||||
@item audio_pin_name
 | 
			
		||||
Select audio capture pin to use by name or alternative name.
 | 
			
		||||
 | 
			
		||||
@item crossbar_video_input_pin_number
 | 
			
		||||
Select video input pin number for crossbar device. This will be
 | 
			
		||||
routed to the crossbar device's Video Decoder output pin.
 | 
			
		||||
Note that changing this value can affect future invocations
 | 
			
		||||
(sets a new default) until system reboot occurs.
 | 
			
		||||
 | 
			
		||||
@item crossbar_audio_input_pin_number
 | 
			
		||||
Select audio input pin number for crossbar device. This will be
 | 
			
		||||
routed to the crossbar device's Audio Decoder output pin.
 | 
			
		||||
Note that changing this value can affect future invocations
 | 
			
		||||
(sets a new default) until system reboot occurs.
 | 
			
		||||
 | 
			
		||||
@item show_video_device_dialog
 | 
			
		||||
If set to @option{true}, before capture starts, popup a display dialog
 | 
			
		||||
to the end user, allowing them to change video filter properties
 | 
			
		||||
and configurations manually.
 | 
			
		||||
Note that for crossbar devices, adjusting values in this dialog
 | 
			
		||||
may be needed at times to toggle between PAL (25 fps) and NTSC (29.97)
 | 
			
		||||
input frame rates, sizes, interlacing, etc.  Changing these values can
 | 
			
		||||
enable different scan rates/frame rates and avoiding green bars at
 | 
			
		||||
the bottom, flickering scan lines, etc.
 | 
			
		||||
Note that with some devices, changing these properties can also affect future
 | 
			
		||||
invocations (sets new defaults) until system reboot occurs.
 | 
			
		||||
 | 
			
		||||
@item show_audio_device_dialog
 | 
			
		||||
If set to @option{true}, before capture starts, popup a display dialog
 | 
			
		||||
to the end user, allowing them to change audio filter properties
 | 
			
		||||
and configurations manually.
 | 
			
		||||
 | 
			
		||||
@item show_video_crossbar_connection_dialog
 | 
			
		||||
If set to @option{true}, before capture starts, popup a display
 | 
			
		||||
dialog to the end user, allowing them to manually
 | 
			
		||||
modify crossbar pin routings, when it opens a video device.
 | 
			
		||||
 | 
			
		||||
@item show_audio_crossbar_connection_dialog
 | 
			
		||||
If set to @option{true}, before capture starts, popup a display
 | 
			
		||||
dialog to the end user, allowing them to manually
 | 
			
		||||
modify crossbar pin routings, when it opens an audio device.
 | 
			
		||||
 | 
			
		||||
@item show_analog_tv_tuner_dialog
 | 
			
		||||
If set to @option{true}, before capture starts, popup a display
 | 
			
		||||
dialog to the end user, allowing them to manually
 | 
			
		||||
modify TV channels and frequencies.
 | 
			
		||||
 | 
			
		||||
@item show_analog_tv_tuner_audio_dialog
 | 
			
		||||
If set to @option{true}, before capture starts, popup a display
 | 
			
		||||
dialog to the end user, allowing them to manually
 | 
			
		||||
modify TV audio (like mono vs. stereo, Language A,B or C).
 | 
			
		||||
 | 
			
		||||
@item audio_device_load
 | 
			
		||||
Load an audio capture filter device from file instead of searching
 | 
			
		||||
it by name. It may load additional parameters too, if the filter
 | 
			
		||||
supports the serialization of its properties to.
 | 
			
		||||
To use this an audio capture source has to be specified, but it can
 | 
			
		||||
be anything even fake one.
 | 
			
		||||
 | 
			
		||||
@item audio_device_save
 | 
			
		||||
Save the currently used audio capture filter device and its
 | 
			
		||||
parameters (if the filter supports it) to a file.
 | 
			
		||||
If a file with the same name exists it will be overwritten.
 | 
			
		||||
 | 
			
		||||
@item video_device_load
 | 
			
		||||
Load a video capture filter device from file instead of searching
 | 
			
		||||
it by name. It may load additional parameters too, if the filter
 | 
			
		||||
supports the serialization of its properties to.
 | 
			
		||||
To use this a video capture source has to be specified, but it can
 | 
			
		||||
be anything even fake one.
 | 
			
		||||
 | 
			
		||||
@item video_device_save
 | 
			
		||||
Save the currently used video capture filter device and its
 | 
			
		||||
parameters (if the filter supports it) to a file.
 | 
			
		||||
If a file with the same name exists it will be overwritten.
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@subsection Examples
 | 
			
		||||
@@ -453,46 +196,12 @@ Print the list of supported options in selected device and exit:
 | 
			
		||||
$ ffmpeg -list_options true -f dshow -i video="Camera"
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
Specify pin names to capture by name or alternative name, specify alternative device name:
 | 
			
		||||
@example
 | 
			
		||||
$ ffmpeg -f dshow -audio_pin_name "Audio Out" -video_pin_name 2 -i video=video="@@device_pnp_\\?\pci#ven_1a0a&dev_6200&subsys_62021461&rev_01#4&e2c7dd6&0&00e1#@{65e8773d-8f56-11d0-a3b9-00a0c9223196@}\@{ca465100-deb0-4d59-818f-8c477184adf6@}":audio="Microphone"
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
Configure a crossbar device, specifying crossbar pins, allow user to adjust video capture properties at startup:
 | 
			
		||||
@example
 | 
			
		||||
$ ffmpeg -f dshow -show_video_device_dialog true -crossbar_video_input_pin_number 0
 | 
			
		||||
     -crossbar_audio_input_pin_number 3 -i video="AVerMedia BDA Analog Capture":audio="AVerMedia BDA Analog Capture"
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@end itemize
 | 
			
		||||
 | 
			
		||||
@section dv1394
 | 
			
		||||
 | 
			
		||||
Linux DV 1394 input device.
 | 
			
		||||
 | 
			
		||||
@subsection Options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item framerate
 | 
			
		||||
Set the frame rate. Default is 25.
 | 
			
		||||
 | 
			
		||||
@item standard
 | 
			
		||||
 | 
			
		||||
Available values are:
 | 
			
		||||
@table @samp
 | 
			
		||||
@item pal
 | 
			
		||||
 | 
			
		||||
@item ntsc
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
Default value is @code{ntsc}.
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section fbdev
 | 
			
		||||
 | 
			
		||||
Linux framebuffer input device.
 | 
			
		||||
@@ -505,27 +214,18 @@ console. It is accessed through a file device node, usually
 | 
			
		||||
For more detailed information read the file
 | 
			
		||||
Documentation/fb/framebuffer.txt included in the Linux source tree.
 | 
			
		||||
 | 
			
		||||
See also @url{http://linux-fbdev.sourceforge.net/}, and fbset(1).
 | 
			
		||||
 | 
			
		||||
To record from the framebuffer device @file{/dev/fb0} with
 | 
			
		||||
@command{ffmpeg}:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -f fbdev -framerate 10 -i /dev/fb0 out.avi
 | 
			
		||||
ffmpeg -f fbdev -r 10 -i /dev/fb0 out.avi
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
You can take a single screenshot image with the command:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -f fbdev -framerate 1 -i /dev/fb0 -frames:v 1 screenshot.jpeg
 | 
			
		||||
ffmpeg -f fbdev -frames:v 1 -r 1 -i /dev/fb0 screenshot.jpeg
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@subsection Options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item framerate
 | 
			
		||||
Set the frame rate. Default is 25.
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
See also @url{http://linux-fbdev.sourceforge.net/}, and fbset(1).
 | 
			
		||||
 | 
			
		||||
@section gdigrab
 | 
			
		||||
 | 
			
		||||
@@ -630,7 +330,7 @@ not work and result in undefined behavior.
 | 
			
		||||
The values @option{auto}, @option{dv} and @option{hdv} are supported.
 | 
			
		||||
 | 
			
		||||
@item dvbuffer
 | 
			
		||||
Set maximum size of buffer for incoming data, in frames. For DV, this
 | 
			
		||||
Set maxiumum size of buffer for incoming data, in frames. For DV, this
 | 
			
		||||
is an exact value. For HDV, it is not frame exact, since HDV does
 | 
			
		||||
not have a fixed frame size.
 | 
			
		||||
 | 
			
		||||
@@ -711,15 +411,6 @@ $ jack_connect metro:120_bpm ffmpeg:input_1
 | 
			
		||||
For more information read:
 | 
			
		||||
@url{http://jackaudio.org/}
 | 
			
		||||
 | 
			
		||||
@subsection Options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item channels
 | 
			
		||||
Set the number of channels. Default is 2.
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section lavfi
 | 
			
		||||
 | 
			
		||||
Libavfilter input virtual device.
 | 
			
		||||
@@ -744,14 +435,6 @@ generated by the device.
 | 
			
		||||
The first unlabelled output is automatically assigned to the "out0"
 | 
			
		||||
label, but all the others need to be specified explicitly.
 | 
			
		||||
 | 
			
		||||
The suffix "+subcc" can be appended to the output label to create an extra
 | 
			
		||||
stream with the closed captions packets attached to that output
 | 
			
		||||
(experimental; only for EIA-608 / CEA-708 for now).
 | 
			
		||||
The subcc streams are created after all the normal streams, in the order of
 | 
			
		||||
the corresponding stream.
 | 
			
		||||
For example, if there is "out19+subcc", "out7+subcc" and up to "out42", the
 | 
			
		||||
stream #43 is subcc for stream #7 and stream #44 is subcc for stream #19.
 | 
			
		||||
 | 
			
		||||
If not specified defaults to the filename specified for the input
 | 
			
		||||
device.
 | 
			
		||||
 | 
			
		||||
@@ -760,9 +443,6 @@ Set the filename of the filtergraph to be read and sent to the other
 | 
			
		||||
filters. Syntax of the filtergraph is the same as the one specified by
 | 
			
		||||
the option @var{graph}.
 | 
			
		||||
 | 
			
		||||
@item dumpgraph
 | 
			
		||||
Dump graph to stderr.
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@subsection Examples
 | 
			
		||||
@@ -801,57 +481,24 @@ Read an audio stream and a video stream and play it back with
 | 
			
		||||
ffplay -f lavfi "movie=test.avi[out0];amovie=test.wav[out1]"
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
Dump decoded frames to images and closed captions to a file (experimental):
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -f lavfi -i "movie=test.ts[out0+subcc]" -map v frame%08d.png -map s -c copy -f rawvideo subcc.bin
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@end itemize
 | 
			
		||||
 | 
			
		||||
@section libcdio
 | 
			
		||||
 | 
			
		||||
Audio-CD input device based on libcdio.
 | 
			
		||||
Audio-CD input device based on cdio.
 | 
			
		||||
 | 
			
		||||
To enable this input device during configuration you need libcdio
 | 
			
		||||
installed on your system. It requires the configure option
 | 
			
		||||
installed on your system. Requires the configure option
 | 
			
		||||
@code{--enable-libcdio}.
 | 
			
		||||
 | 
			
		||||
This device allows playing and grabbing from an Audio-CD.
 | 
			
		||||
 | 
			
		||||
For example to copy with @command{ffmpeg} the entire Audio-CD in @file{/dev/sr0},
 | 
			
		||||
For example to copy with @command{ffmpeg} the entire Audio-CD in /dev/sr0,
 | 
			
		||||
you may run the command:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -f libcdio -i /dev/sr0 cd.wav
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@subsection Options
 | 
			
		||||
@table @option
 | 
			
		||||
@item speed
 | 
			
		||||
Set drive reading speed. Default value is 0.
 | 
			
		||||
 | 
			
		||||
The speed is specified CD-ROM speed units. The speed is set through
 | 
			
		||||
the libcdio @code{cdio_cddap_speed_set} function. On many CD-ROM
 | 
			
		||||
drives, specifying a value too large will result in using the fastest
 | 
			
		||||
speed.
 | 
			
		||||
 | 
			
		||||
@item paranoia_mode
 | 
			
		||||
Set paranoia recovery mode flags. It accepts one of the following values:
 | 
			
		||||
 | 
			
		||||
@table @samp
 | 
			
		||||
@item disable
 | 
			
		||||
@item verify
 | 
			
		||||
@item overlap
 | 
			
		||||
@item neverskip
 | 
			
		||||
@item full
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
Default value is @samp{disable}.
 | 
			
		||||
 | 
			
		||||
For more information about the available recovery modes, consult the
 | 
			
		||||
paranoia project documentation.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section libdc1394
 | 
			
		||||
 | 
			
		||||
IIDC1394 input device, based on libdc1394 and libraw1394.
 | 
			
		||||
@@ -964,19 +611,6 @@ ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
 | 
			
		||||
For more information about OSS see:
 | 
			
		||||
@url{http://manuals.opensound.com/usersguide/dsp.html}
 | 
			
		||||
 | 
			
		||||
@subsection Options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item sample_rate
 | 
			
		||||
Set the sample rate in Hz. Default is 48000.
 | 
			
		||||
 | 
			
		||||
@item channels
 | 
			
		||||
Set the number of channels. Default is 2.
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section pulse
 | 
			
		||||
 | 
			
		||||
PulseAudio input device.
 | 
			
		||||
@@ -1017,10 +651,6 @@ Specify the number of bytes per frame, by default it is set to 1024.
 | 
			
		||||
@item fragment_size
 | 
			
		||||
Specify the minimal buffering fragment in PulseAudio, it will affect the
 | 
			
		||||
audio latency. By default it is unset.
 | 
			
		||||
 | 
			
		||||
@item wallclock
 | 
			
		||||
Set the initial PTS using the current time. Default is 1.
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@subsection Examples
 | 
			
		||||
@@ -1056,22 +686,6 @@ ffmpeg -f qtkit -i "default" out.mpg
 | 
			
		||||
ffmpeg -f qtkit -list_devices true -i ""
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@subsection Options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item frame_rate
 | 
			
		||||
Set frame rate. Default is 30.
 | 
			
		||||
 | 
			
		||||
@item list_devices
 | 
			
		||||
If set to @code{true}, print a list of devices and exit. Default is
 | 
			
		||||
@code{false}.
 | 
			
		||||
 | 
			
		||||
@item video_device_index
 | 
			
		||||
Select the video device by index for devices with the same name (starts at 0).
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section sndio
 | 
			
		||||
 | 
			
		||||
sndio input device.
 | 
			
		||||
@@ -1089,18 +703,6 @@ command:
 | 
			
		||||
ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@subsection Options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item sample_rate
 | 
			
		||||
Set the sample rate in Hz. Default is 48000.
 | 
			
		||||
 | 
			
		||||
@item channels
 | 
			
		||||
Set the number of channels. Default is 2.
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section video4linux2, v4l2
 | 
			
		||||
 | 
			
		||||
Video4Linux2 input video device.
 | 
			
		||||
@@ -1133,12 +735,6 @@ conversion into the real time clock.
 | 
			
		||||
Some usage examples of the video4linux2 device with @command{ffmpeg}
 | 
			
		||||
and @command{ffplay}:
 | 
			
		||||
@itemize
 | 
			
		||||
@item
 | 
			
		||||
List supported formats for a video4linux2 device:
 | 
			
		||||
@example
 | 
			
		||||
ffplay -f video4linux2 -list_formats all /dev/video0
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
Grab and show the input of a video4linux2 device:
 | 
			
		||||
@example
 | 
			
		||||
@@ -1223,10 +819,6 @@ Force conversion from monotonic to absolute timestamps.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
Default value is @code{default}.
 | 
			
		||||
 | 
			
		||||
@item use_libv4l2
 | 
			
		||||
Use libv4l2 (v4l-utils) conversion functions. Default is 0.
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section vfwcap
 | 
			
		||||
@@ -1237,29 +829,12 @@ The filename passed as input is the capture driver number, ranging from
 | 
			
		||||
0 to 9. You may use "list" as filename to print a list of drivers. Any
 | 
			
		||||
other filename will be interpreted as device number 0.
 | 
			
		||||
 | 
			
		||||
@subsection Options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item video_size
 | 
			
		||||
Set the video frame size.
 | 
			
		||||
 | 
			
		||||
@item framerate
 | 
			
		||||
Set the grabbing frame rate. Default value is @code{ntsc},
 | 
			
		||||
corresponding to a frame rate of @code{30000/1001}.
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section x11grab
 | 
			
		||||
 | 
			
		||||
X11 video input device.
 | 
			
		||||
 | 
			
		||||
To enable this input device during configuration you need libxcb
 | 
			
		||||
installed on your system. It will be automatically detected during
 | 
			
		||||
configuration.
 | 
			
		||||
 | 
			
		||||
Alternatively, the configure option @option{--enable-x11grab} exists
 | 
			
		||||
for legacy Xlib users.
 | 
			
		||||
Depends on X11, Xext, and Xfixes. Requires the configure option
 | 
			
		||||
@code{--enable-x11grab}.
 | 
			
		||||
 | 
			
		||||
This device allows one to capture a region of an X11 display.
 | 
			
		||||
 | 
			
		||||
@@ -1277,12 +852,10 @@ omitted, and defaults to "localhost". The environment variable
 | 
			
		||||
area with respect to the top-left border of the X11 screen. They
 | 
			
		||||
default to 0.
 | 
			
		||||
 | 
			
		||||
Check the X11 documentation (e.g. @command{man X}) for more detailed
 | 
			
		||||
information.
 | 
			
		||||
Check the X11 documentation (e.g. man X) for more detailed information.
 | 
			
		||||
 | 
			
		||||
Use the @command{xdpyinfo} program for getting basic information about
 | 
			
		||||
the properties of your X11 display (e.g. grep for "name" or
 | 
			
		||||
"dimensions").
 | 
			
		||||
Use the @command{dpyinfo} program for getting basic information about the
 | 
			
		||||
properties of your X11 display (e.g. grep for "name" or "dimensions").
 | 
			
		||||
 | 
			
		||||
For example to grab from @file{:0.0} using @command{ffmpeg}:
 | 
			
		||||
@example
 | 
			
		||||
@@ -1331,10 +904,6 @@ If @var{show_region} is specified with @code{1}, then the grabbing
 | 
			
		||||
region will be indicated on screen. With this option, it is easy to
 | 
			
		||||
know what is being grabbed if only a portion of the screen is grabbed.
 | 
			
		||||
 | 
			
		||||
@item region_border
 | 
			
		||||
Set the region border thickness if @option{-show_region 1} is used.
 | 
			
		||||
Range is 1 to 128 and default is 3 (XCB-based x11grab only).
 | 
			
		||||
 | 
			
		||||
For example:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -f x11grab -show_region 1 -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
 | 
			
		||||
@@ -1350,19 +919,7 @@ Set the video frame size. Default value is @code{vga}.
 | 
			
		||||
 | 
			
		||||
@item use_shm
 | 
			
		||||
Use the MIT-SHM extension for shared memory. Default value is @code{1}.
 | 
			
		||||
It may be necessary to disable it for remote displays (legacy x11grab
 | 
			
		||||
only).
 | 
			
		||||
It may be necessary to disable it for remote displays.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@subsection @var{grab_x} @var{grab_y} AVOption
 | 
			
		||||
 | 
			
		||||
The syntax is:
 | 
			
		||||
@example
 | 
			
		||||
-grab_x @var{x_offset} -grab_y @var{y_offset}
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Set the grabbing region coordinates. They are expressed as offset from the top left
 | 
			
		||||
corner of the X11 window. The default value is 0.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@c man end INPUT DEVICES
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,4 @@
 | 
			
		||||
\input texinfo @c -*- texinfo -*-
 | 
			
		||||
@documentencoding UTF-8
 | 
			
		||||
 | 
			
		||||
@settitle Libavcodec Documentation
 | 
			
		||||
@titlepage
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,4 @@
 | 
			
		||||
\input texinfo @c -*- texinfo -*-
 | 
			
		||||
@documentencoding UTF-8
 | 
			
		||||
 | 
			
		||||
@settitle Libavdevice Documentation
 | 
			
		||||
@titlepage
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,4 @@
 | 
			
		||||
\input texinfo @c -*- texinfo -*-
 | 
			
		||||
@documentencoding UTF-8
 | 
			
		||||
 | 
			
		||||
@settitle Libavfilter Documentation
 | 
			
		||||
@titlepage
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,4 @@
 | 
			
		||||
\input texinfo @c -*- texinfo -*-
 | 
			
		||||
@documentencoding UTF-8
 | 
			
		||||
 | 
			
		||||
@settitle Libavformat Documentation
 | 
			
		||||
@titlepage
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,4 @@
 | 
			
		||||
\input texinfo @c -*- texinfo -*-
 | 
			
		||||
@documentencoding UTF-8
 | 
			
		||||
 | 
			
		||||
@settitle Libavutil Documentation
 | 
			
		||||
@titlepage
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,4 @@
 | 
			
		||||
\input texinfo @c -*- texinfo -*-
 | 
			
		||||
@documentencoding UTF-8
 | 
			
		||||
 | 
			
		||||
@settitle Libswresample Documentation
 | 
			
		||||
@titlepage
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,4 @@
 | 
			
		||||
\input texinfo @c -*- texinfo -*-
 | 
			
		||||
@documentencoding UTF-8
 | 
			
		||||
 | 
			
		||||
@settitle Libswscale Documentation
 | 
			
		||||
@titlepage
 | 
			
		||||
 
 | 
			
		||||
@@ -12,10 +12,10 @@ A file consists of a header and a number of metadata tags divided into sections,
 | 
			
		||||
each on its own line.
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
The header is a @samp{;FFMETADATA} string, followed by a version number (now 1).
 | 
			
		||||
The header is a ';FFMETADATA' string, followed by a version number (now 1).
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
Metadata tags are of the form @samp{key=value}
 | 
			
		||||
Metadata tags are of the form 'key=value'
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
Immediately after header follows global metadata
 | 
			
		||||
@@ -26,30 +26,26 @@ metadata.
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in
 | 
			
		||||
brackets (@samp{[}, @samp{]}) and ends with next section or end of file.
 | 
			
		||||
brackets ('[', ']') and ends with next section or end of file.
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
At the beginning of a chapter section there may be an optional timebase to be
 | 
			
		||||
used for start/end values. It must be in form
 | 
			
		||||
@samp{TIMEBASE=@var{num}/@var{den}}, where @var{num} and @var{den} are
 | 
			
		||||
integers. If the timebase is missing then start/end times are assumed to
 | 
			
		||||
used for start/end values. It must be in form 'TIMEBASE=num/den', where num and
 | 
			
		||||
den are integers. If the timebase is missing then start/end times are assumed to
 | 
			
		||||
be in milliseconds.
 | 
			
		||||
 | 
			
		||||
Next a chapter section must contain chapter start and end times in form
 | 
			
		||||
@samp{START=@var{num}}, @samp{END=@var{num}}, where @var{num} is a positive
 | 
			
		||||
integer.
 | 
			
		||||
'START=num', 'END=num', where num is a positive integer.
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
Empty lines and lines starting with @samp{;} or @samp{#} are ignored.
 | 
			
		||||
Empty lines and lines starting with ';' or '#' are ignored.
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
Metadata keys or values containing special characters (@samp{=}, @samp{;},
 | 
			
		||||
@samp{#}, @samp{\} and a newline) must be escaped with a backslash @samp{\}.
 | 
			
		||||
Metadata keys or values containing special characters ('=', ';', '#', '\' and a
 | 
			
		||||
newline) must be escaped with a backslash '\'.
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
Note that whitespace in metadata (e.g. @samp{foo = bar}) is considered to be
 | 
			
		||||
a part of the tag (in the example above key is @samp{foo }, value is
 | 
			
		||||
@samp{ bar}).
 | 
			
		||||
Note that whitespace in metadata (e.g. foo = bar) is considered to be a part of
 | 
			
		||||
the tag (in the example above key is 'foo ', value is ' bar').
 | 
			
		||||
@end enumerate
 | 
			
		||||
 | 
			
		||||
A ffmetadata file might look like this:
 | 
			
		||||
 
 | 
			
		||||
@@ -47,16 +47,12 @@ Files that have MIPS copyright notice in them:
 | 
			
		||||
* libavutil/mips/
 | 
			
		||||
      float_dsp_mips.c
 | 
			
		||||
      libm_mips.h
 | 
			
		||||
      softfloat_tables.h
 | 
			
		||||
* libavcodec/
 | 
			
		||||
      fft_fixed_32.c
 | 
			
		||||
      fft_init_table.c
 | 
			
		||||
      fft_table.h
 | 
			
		||||
      mdct_fixed_32.c
 | 
			
		||||
* libavcodec/mips/
 | 
			
		||||
      aacdec_fixed.c
 | 
			
		||||
      aacsbr_fixed.c
 | 
			
		||||
      aacsbr_template.c
 | 
			
		||||
      aaccoder_mips.c
 | 
			
		||||
      aacpsy_mips.h
 | 
			
		||||
      ac3dsp_mips.c
 | 
			
		||||
 
 | 
			
		||||
@@ -54,7 +54,7 @@ thread.
 | 
			
		||||
If the codec allocates writable tables in its init(), add an init_thread_copy()
 | 
			
		||||
which re-allocates them for other threads.
 | 
			
		||||
 | 
			
		||||
Add AV_CODEC_CAP_FRAME_THREADS to the codec capabilities. There will be very little
 | 
			
		||||
Add CODEC_CAP_FRAME_THREADS to the codec capabilities. There will be very little
 | 
			
		||||
speed gain at this point but it should work.
 | 
			
		||||
 | 
			
		||||
If there are inter-frame dependencies, so the codec calls
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										322
									
								
								doc/muxers.texi
									
									
									
									
									
								
							
							
						
						
									
										322
									
								
								doc/muxers.texi
									
									
									
									
									
								
							@@ -194,19 +194,15 @@ can not be smaller than one centi second.
 | 
			
		||||
Apple HTTP Live Streaming muxer that segments MPEG-TS according to
 | 
			
		||||
the HTTP Live Streaming (HLS) specification.
 | 
			
		||||
 | 
			
		||||
It creates a playlist file, and one or more segment files. The output filename
 | 
			
		||||
specifies the playlist filename.
 | 
			
		||||
 | 
			
		||||
By default, the muxer creates a file for each segment produced. These files
 | 
			
		||||
have the same name as the playlist, followed by a sequential number and a
 | 
			
		||||
.ts extension.
 | 
			
		||||
It creates a playlist file and numbered segment files. The output
 | 
			
		||||
filename specifies the playlist filename; the segment filenames
 | 
			
		||||
receive the same basename as the playlist, a sequential number and
 | 
			
		||||
a .ts extension.
 | 
			
		||||
 | 
			
		||||
For example, to convert an input file with @command{ffmpeg}:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i in.nut out.m3u8
 | 
			
		||||
@end example
 | 
			
		||||
This example will produce the playlist, @file{out.m3u8}, and segment files:
 | 
			
		||||
@file{out0.ts}, @file{out1.ts}, @file{out2.ts}, etc.
 | 
			
		||||
 | 
			
		||||
See also the @ref{segment} muxer, which provides a more generic and
 | 
			
		||||
flexible implementation of a segmenter, and can be used to perform HLS
 | 
			
		||||
@@ -224,11 +220,6 @@ Set the segment length in seconds. Default value is 2.
 | 
			
		||||
Set the maximum number of playlist entries. If set to 0 the list file
 | 
			
		||||
will contain all the segments. Default value is 5.
 | 
			
		||||
 | 
			
		||||
@item hls_ts_options @var{options_list}
 | 
			
		||||
Set output format options using a :-separated list of key=value
 | 
			
		||||
parameters. Values containing @code{:} special characters must be
 | 
			
		||||
escaped.
 | 
			
		||||
 | 
			
		||||
@item hls_wrap @var{wrap}
 | 
			
		||||
Set the number after which the segment filename number (the number
 | 
			
		||||
specified in each segment file) wraps. If set to 0 the number will be
 | 
			
		||||
@@ -242,9 +233,6 @@ to @var{wrap}.
 | 
			
		||||
Start the playlist sequence number from @var{number}. Default value is
 | 
			
		||||
0.
 | 
			
		||||
 | 
			
		||||
@item hls_allow_cache @var{allowcache}
 | 
			
		||||
Explicitly set whether the client MAY (1) or MUST NOT (0) cache media segments.
 | 
			
		||||
 | 
			
		||||
@item hls_base_url @var{baseurl}
 | 
			
		||||
Append @var{baseurl} to every entry in the playlist.
 | 
			
		||||
Useful to generate playlists with absolute paths.
 | 
			
		||||
@@ -253,86 +241,6 @@ Note that the playlist sequence number must be unique for each segment
 | 
			
		||||
and it is not to be confused with the segment filename sequence number
 | 
			
		||||
which can be cyclic, for example if the @option{wrap} option is
 | 
			
		||||
specified.
 | 
			
		||||
 | 
			
		||||
@item hls_segment_filename @var{filename}
 | 
			
		||||
Set the segment filename. Unless hls_flags single_file is set @var{filename}
 | 
			
		||||
is used as a string format with the segment number:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg in.nut -hls_segment_filename 'file%03d.ts' out.m3u8
 | 
			
		||||
@end example
 | 
			
		||||
This example will produce the playlist, @file{out.m3u8}, and segment files:
 | 
			
		||||
@file{file000.ts}, @file{file001.ts}, @file{file002.ts}, etc.
 | 
			
		||||
 | 
			
		||||
@item hls_key_info_file @var{key_info_file}
 | 
			
		||||
Use the information in @var{key_info_file} for segment encryption. The first
 | 
			
		||||
line of @var{key_info_file} specifies the key URI written to the playlist. The
 | 
			
		||||
key URL is used to access the encryption key during playback. The second line
 | 
			
		||||
specifies the path to the key file used to obtain the key during the encryption
 | 
			
		||||
process. The key file is read as a single packed array of 16 octets in binary
 | 
			
		||||
format. The optional third line specifies the initialization vector (IV) as a
 | 
			
		||||
hexadecimal string to be used instead of the segment sequence number (default)
 | 
			
		||||
for encryption. Changes to @var{key_info_file} will result in segment
 | 
			
		||||
encryption with the new key/IV and an entry in the playlist for the new key
 | 
			
		||||
URI/IV.
 | 
			
		||||
 | 
			
		||||
Key info file format:
 | 
			
		||||
@example
 | 
			
		||||
@var{key URI}
 | 
			
		||||
@var{key file path}
 | 
			
		||||
@var{IV} (optional)
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Example key URIs:
 | 
			
		||||
@example
 | 
			
		||||
http://server/file.key
 | 
			
		||||
/path/to/file.key
 | 
			
		||||
file.key
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Example key file paths:
 | 
			
		||||
@example
 | 
			
		||||
file.key
 | 
			
		||||
/path/to/file.key
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Example IV:
 | 
			
		||||
@example
 | 
			
		||||
0123456789ABCDEF0123456789ABCDEF
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Key info file example:
 | 
			
		||||
@example
 | 
			
		||||
http://server/file.key
 | 
			
		||||
/path/to/file.key
 | 
			
		||||
0123456789ABCDEF0123456789ABCDEF
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Example shell script:
 | 
			
		||||
@example
 | 
			
		||||
#!/bin/sh
 | 
			
		||||
BASE_URL=$@{1:-'.'@}
 | 
			
		||||
openssl rand 16 > file.key
 | 
			
		||||
echo $BASE_URL/file.key > file.keyinfo
 | 
			
		||||
echo file.key >> file.keyinfo
 | 
			
		||||
echo $(openssl rand -hex 16) >> file.keyinfo
 | 
			
		||||
ffmpeg -f lavfi -re -i testsrc -c:v h264 -hls_flags delete_segments \
 | 
			
		||||
  -hls_key_info_file file.keyinfo out.m3u8
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item hls_flags single_file
 | 
			
		||||
If this flag is set, the muxer will store all segments in a single MPEG-TS
 | 
			
		||||
file, and will use byte ranges in the playlist. HLS playlists generated with
 | 
			
		||||
this way will have the version number 4.
 | 
			
		||||
For example:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i in.nut -hls_flags single_file out.m3u8
 | 
			
		||||
@end example
 | 
			
		||||
Will produce the playlist, @file{out.m3u8}, and a single segment file,
 | 
			
		||||
@file{out.ts}.
 | 
			
		||||
 | 
			
		||||
@item hls_flags delete_segments
 | 
			
		||||
Segment files removed from the playlist are deleted after a period of time
 | 
			
		||||
equal to the duration of the segment plus the duration of the playlist.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@anchor{ico}
 | 
			
		||||
@@ -437,7 +345,8 @@ ffmpeg -f v4l2 -r 1 -i /dev/video0 -f image2 -strftime 1 "%Y-%m-%d_%H-%M-%S.jpg"
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
@item start_number
 | 
			
		||||
Start the sequence from the specified number. Default value is 0.
 | 
			
		||||
Start the sequence from the specified number. Default value is 1. Must
 | 
			
		||||
be a non-negative number.
 | 
			
		||||
 | 
			
		||||
@item update
 | 
			
		||||
If set to 1, the filename will always be interpreted as just a
 | 
			
		||||
@@ -627,6 +536,7 @@ a short portion of the file. With this option set, there is no initial
 | 
			
		||||
mdat atom, and the moov atom only describes the tracks but has
 | 
			
		||||
a zero duration.
 | 
			
		||||
 | 
			
		||||
Files written with this option set do not work in QuickTime.
 | 
			
		||||
This option is implicitly set when writing ismv (Smooth Streaming) files.
 | 
			
		||||
@item -movflags separate_moof
 | 
			
		||||
Write a separate moof (movie fragment) atom for each track. Normally,
 | 
			
		||||
@@ -647,16 +557,6 @@ and a QuickTime chapter track are written to the file. With this option
 | 
			
		||||
set, only the QuickTime chapter track will be written. Nero chapters can
 | 
			
		||||
cause failures when the file is reprocessed with certain tagging programs, like
 | 
			
		||||
mp3Tag 2.61a and iTunes 11.3, most likely other versions are affected as well.
 | 
			
		||||
@item -movflags omit_tfhd_offset
 | 
			
		||||
Do not write any absolute base_data_offset in tfhd atoms. This avoids
 | 
			
		||||
tying fragments to absolute byte positions in the file/streams.
 | 
			
		||||
@item -movflags default_base_moof
 | 
			
		||||
Similarly to the omit_tfhd_offset, this flag avoids writing the
 | 
			
		||||
absolute base_data_offset field in tfhd atoms, but does so by using
 | 
			
		||||
the new default-base-is-moof flag instead. This flag is new from
 | 
			
		||||
14496-12:2012. This may make the fragments easier to parse in certain
 | 
			
		||||
circumstances (avoiding basing track fragment location calculations
 | 
			
		||||
on the implicit end of the previous track fragment).
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@subsection Example
 | 
			
		||||
@@ -667,47 +567,31 @@ point on IIS with this muxer. Example:
 | 
			
		||||
ffmpeg -re @var{<normal input/transcoding options>} -movflags isml+frag_keyframe -f ismv http://server/publishingpoint.isml/Streams(Encoder1)
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@subsection Audible AAX
 | 
			
		||||
 | 
			
		||||
Audible AAX files are encrypted M4B files, and they can be decrypted by specifying a 4 byte activation secret.
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -activation_bytes 1CEB00DA -i test.aax -vn -c:a copy output.mp4
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@section mp3
 | 
			
		||||
 | 
			
		||||
The MP3 muxer writes a raw MP3 stream with the following optional features:
 | 
			
		||||
@itemize @bullet
 | 
			
		||||
@item
 | 
			
		||||
An ID3v2 metadata header at the beginning (enabled by default). Versions 2.3 and
 | 
			
		||||
2.4 are supported, the @code{id3v2_version} private option controls which one is
 | 
			
		||||
used (3 or 4). Setting @code{id3v2_version} to 0 disables the ID3v2 header
 | 
			
		||||
completely.
 | 
			
		||||
The MP3 muxer writes a raw MP3 stream with an ID3v2 header at the beginning and
 | 
			
		||||
optionally an ID3v1 tag at the end. ID3v2.3 and ID3v2.4 are supported, the
 | 
			
		||||
@code{id3v2_version} option controls which one is used. Setting
 | 
			
		||||
@code{id3v2_version} to 0 will disable the ID3v2 header completely. The legacy
 | 
			
		||||
ID3v1 tag is not written by default, but may be enabled with the
 | 
			
		||||
@code{write_id3v1} option.
 | 
			
		||||
 | 
			
		||||
The muxer supports writing attached pictures (APIC frames) to the ID3v2 header.
 | 
			
		||||
The pictures are supplied to the muxer in form of a video stream with a single
 | 
			
		||||
packet. There can be any number of those streams, each will correspond to a
 | 
			
		||||
single APIC frame.  The stream metadata tags @var{title} and @var{comment} map
 | 
			
		||||
to APIC @var{description} and @var{picture type} respectively. See
 | 
			
		||||
The muxer may also write a Xing frame at the beginning, which contains the
 | 
			
		||||
number of frames in the file. It is useful for computing duration of VBR files.
 | 
			
		||||
The Xing frame is written if the output stream is seekable and if the
 | 
			
		||||
@code{write_xing} option is set to 1 (the default).
 | 
			
		||||
 | 
			
		||||
The muxer supports writing ID3v2 attached pictures (APIC frames). The pictures
 | 
			
		||||
are supplied to the muxer in form of a video stream with a single packet. There
 | 
			
		||||
can be any number of those streams, each will correspond to a single APIC frame.
 | 
			
		||||
The stream metadata tags @var{title} and @var{comment} map to APIC
 | 
			
		||||
@var{description} and @var{picture type} respectively. See
 | 
			
		||||
@url{http://id3.org/id3v2.4.0-frames} for allowed picture types.
 | 
			
		||||
 | 
			
		||||
Note that the APIC frames must be written at the beginning, so the muxer will
 | 
			
		||||
buffer the audio frames until it gets all the pictures. It is therefore advised
 | 
			
		||||
to provide the pictures as soon as possible to avoid excessive buffering.
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
A Xing/LAME frame right after the ID3v2 header (if present). It is enabled by
 | 
			
		||||
default, but will be written only if the output is seekable. The
 | 
			
		||||
@code{write_xing} private option can be used to disable it.  The frame contains
 | 
			
		||||
various information that may be useful to the decoder, like the audio duration
 | 
			
		||||
or encoder delay.
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
A legacy ID3v1 tag at the end of the file (disabled by default). It may be
 | 
			
		||||
enabled with the @code{write_id3v1} private option, but as its capabilities are
 | 
			
		||||
very limited, its usage is not recommended.
 | 
			
		||||
@end itemize
 | 
			
		||||
 | 
			
		||||
Examples:
 | 
			
		||||
 | 
			
		||||
Write an mp3 with an ID3v2.3 header and an ID3v1 footer:
 | 
			
		||||
@@ -752,9 +636,6 @@ Set the transport_stream_id (default 0x0001). This identifies a
 | 
			
		||||
transponder in DVB.
 | 
			
		||||
@item -mpegts_service_id @var{number}
 | 
			
		||||
Set the service_id (default 0x0001) also known as program in DVB.
 | 
			
		||||
@item -mpegts_service_type @var{number}
 | 
			
		||||
Set the program service_type (default @var{digital_tv}), see below
 | 
			
		||||
a list of pre defined values.
 | 
			
		||||
@item -mpegts_pmt_start_pid @var{number}
 | 
			
		||||
Set the first PID for PMT (default 0x1000, max 0x1f00).
 | 
			
		||||
@item -mpegts_start_pid @var{number}
 | 
			
		||||
@@ -766,10 +647,6 @@ Set a constant muxrate (default VBR).
 | 
			
		||||
@item -pcr_period @var{numer}
 | 
			
		||||
Override the default PCR retransmission time (default 20ms), ignored
 | 
			
		||||
if variable muxrate is selected.
 | 
			
		||||
@item pat_period @var{number}
 | 
			
		||||
Maximal time in seconds between PAT/PMT tables.
 | 
			
		||||
@item sdt_period @var{number}
 | 
			
		||||
Maximal time in seconds between SDT tables.
 | 
			
		||||
@item -pes_payload_size @var{number}
 | 
			
		||||
Set minimum PES packet payload in bytes.
 | 
			
		||||
@item -mpegts_flags @var{flags}
 | 
			
		||||
@@ -793,27 +670,6 @@ ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udp://1.1.1.1:1111
 | 
			
		||||
@end example
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
Option mpegts_service_type accepts the following values:
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
@item hex_value
 | 
			
		||||
Any hexdecimal value between 0x01 to 0xff as defined in ETSI 300 468.
 | 
			
		||||
@item digital_tv
 | 
			
		||||
Digital TV service.
 | 
			
		||||
@item digital_radio
 | 
			
		||||
Digital Radio service.
 | 
			
		||||
@item teletext
 | 
			
		||||
Teletext service.
 | 
			
		||||
@item advanced_codec_digital_radio
 | 
			
		||||
Advanced Codec Digital Radio service.
 | 
			
		||||
@item mpeg2_digital_hdtv
 | 
			
		||||
MPEG2 Digital HDTV service.
 | 
			
		||||
@item advanced_codec_digital_sdtv
 | 
			
		||||
Advanced Codec Digital SDTV service.
 | 
			
		||||
@item advanced_codec_digital_hdtv
 | 
			
		||||
Advanced Codec Digital HDTV service.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
Option mpegts_flags may take a set of such flags:
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
@@ -821,8 +677,6 @@ Option mpegts_flags may take a set of such flags:
 | 
			
		||||
Reemit PAT/PMT before writing the next packet.
 | 
			
		||||
@item latm
 | 
			
		||||
Use LATM packetization for AAC.
 | 
			
		||||
@item pat_pmt_at_frames
 | 
			
		||||
Reemit PAT and PMT at each video frame.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@subsection Example
 | 
			
		||||
@@ -839,21 +693,6 @@ ffmpeg -i file.mpg -c copy \
 | 
			
		||||
     -y out.ts
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@section mxf, mxf_d10
 | 
			
		||||
 | 
			
		||||
MXF muxer.
 | 
			
		||||
 | 
			
		||||
@subsection Options
 | 
			
		||||
 | 
			
		||||
The muxer options are:
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
@item store_user_comments @var{bool}
 | 
			
		||||
Set if user comments should be stored if available or never.
 | 
			
		||||
IRT D-10 does not allow user comments. The default is thus to write them for
 | 
			
		||||
mxf but not for mxf_d10
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section null
 | 
			
		||||
 | 
			
		||||
Null muxer.
 | 
			
		||||
@@ -888,7 +727,7 @@ Change the syncpoint usage in nut:
 | 
			
		||||
    sensitive and seeking is not possible. Also in general the overhead from
 | 
			
		||||
    syncpoints is negligible. Note, -@code{write_index} 0 can be used to disable
 | 
			
		||||
    all growing data tables, allowing to mux endless streams with limited memory
 | 
			
		||||
    and without these disadvantages.
 | 
			
		||||
    and wihout these disadvantages.
 | 
			
		||||
@item @var{timestamped} extend the syncpoint with a wallclock field.
 | 
			
		||||
@end table
 | 
			
		||||
The @var{none} and @var{timestamped} flags are experimental.
 | 
			
		||||
@@ -913,11 +752,6 @@ is 1 second. A value of 0 will fill all segments, making pages as large as
 | 
			
		||||
possible. A value of 1 will effectively use 1 packet-per-page in most
 | 
			
		||||
situations, giving a small seek granularity at the cost of additional container
 | 
			
		||||
overhead.
 | 
			
		||||
@item -serial_offset @var{value}
 | 
			
		||||
Serial value from which to set the streams serial number.
 | 
			
		||||
Setting it to different and sufficiently large values ensures that the produced
 | 
			
		||||
ogg files can be safely chained.
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@anchor{segment}
 | 
			
		||||
@@ -926,9 +760,8 @@ ogg files can be safely chained.
 | 
			
		||||
Basic stream segmenter.
 | 
			
		||||
 | 
			
		||||
This muxer outputs streams to a number of separate files of nearly
 | 
			
		||||
fixed duration. Output filename pattern can be set in a fashion
 | 
			
		||||
similar to @ref{image2}, or by using a @code{strftime} template if
 | 
			
		||||
the @option{strftime} option is enabled.
 | 
			
		||||
fixed duration. Output filename pattern can be set in a fashion similar to
 | 
			
		||||
@ref{image2}.
 | 
			
		||||
 | 
			
		||||
@code{stream_segment} is a variant of the muxer used to write to
 | 
			
		||||
streaming output formats, i.e. which do not require global headers,
 | 
			
		||||
@@ -992,6 +825,13 @@ Allow caching (only affects M3U8 list files).
 | 
			
		||||
Allow live-friendly file generation.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@item segment_list_type @var{type}
 | 
			
		||||
Select the listing format.
 | 
			
		||||
@table @option
 | 
			
		||||
@item @var{flat} use a simple flat list of entries.
 | 
			
		||||
@item @var{hls} use a m3u8-like structure.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@item segment_list_size @var{size}
 | 
			
		||||
Update the list file so that it contains at most @var{size}
 | 
			
		||||
segments. If 0 the list file will contain all the segments. Default
 | 
			
		||||
@@ -1001,9 +841,6 @@ value is 0.
 | 
			
		||||
Prepend @var{prefix} to each entry. Useful to generate absolute paths.
 | 
			
		||||
By default no prefix is applied.
 | 
			
		||||
 | 
			
		||||
@item segment_list_type @var{type}
 | 
			
		||||
Select the listing format.
 | 
			
		||||
 | 
			
		||||
The following values are recognized:
 | 
			
		||||
@table @samp
 | 
			
		||||
@item flat
 | 
			
		||||
@@ -1104,18 +941,6 @@ Wrap around segment index once it reaches @var{limit}.
 | 
			
		||||
@item segment_start_number @var{number}
 | 
			
		||||
Set the sequence number of the first segment. Defaults to @code{0}.
 | 
			
		||||
 | 
			
		||||
@item strftime @var{1|0}
 | 
			
		||||
Use the @code{strftime} function to define the name of the new
 | 
			
		||||
segments to write. If this is selected, the output segment name must
 | 
			
		||||
contain a @code{strftime} function template. Default value is
 | 
			
		||||
@code{0}.
 | 
			
		||||
 | 
			
		||||
@item break_non_keyframes @var{1|0}
 | 
			
		||||
If enabled, allow segments to start on frames other than keyframes. This
 | 
			
		||||
improves behavior on some players when the time between keyframes is
 | 
			
		||||
inconsistent, but may make things worse on others, and can cause some oddities
 | 
			
		||||
during seeking. Defaults to @code{0}.
 | 
			
		||||
 | 
			
		||||
@item reset_timestamps @var{1|0}
 | 
			
		||||
Reset timestamps at the begin of each segment, so that each segment
 | 
			
		||||
will start with near-zero timestamps. It is meant to ease the playback
 | 
			
		||||
@@ -1296,17 +1121,7 @@ is the @option{global_header} flag.
 | 
			
		||||
 | 
			
		||||
WebM DASH Manifest muxer.
 | 
			
		||||
 | 
			
		||||
This muxer implements the WebM DASH Manifest specification to generate the DASH
 | 
			
		||||
manifest XML. It also supports manifest generation for DASH live streams.
 | 
			
		||||
 | 
			
		||||
For more information see:
 | 
			
		||||
 | 
			
		||||
@itemize @bullet
 | 
			
		||||
@item
 | 
			
		||||
WebM DASH Specification: @url{https://sites.google.com/a/webmproject.org/wiki/adaptive-streaming/webm-dash-specification}
 | 
			
		||||
@item
 | 
			
		||||
ISO DASH Specification: @url{http://standards.iso.org/ittf/PubliclyAvailableStandards/c065274_ISO_IEC_23009-1_2014.zip}
 | 
			
		||||
@end itemize
 | 
			
		||||
This muxer implements the WebM DASH Manifest specification to generate the DASH manifest XML.
 | 
			
		||||
 | 
			
		||||
@subsection Options
 | 
			
		||||
 | 
			
		||||
@@ -1317,32 +1132,6 @@ This muxer supports the following options:
 | 
			
		||||
This option has the following syntax: "id=x,streams=a,b,c id=y,streams=d,e" where x and y are the
 | 
			
		||||
unique identifiers of the adaptation sets and a,b,c,d and e are the indices of the corresponding
 | 
			
		||||
audio and video streams. Any number of adaptation sets can be added using this option.
 | 
			
		||||
 | 
			
		||||
@item live
 | 
			
		||||
Set this to 1 to create a live stream DASH Manifest. Default: 0.
 | 
			
		||||
 | 
			
		||||
@item chunk_start_index
 | 
			
		||||
Start index of the first chunk. This will go in the @samp{startNumber} attribute
 | 
			
		||||
of the @samp{SegmentTemplate} element in the manifest. Default: 0.
 | 
			
		||||
 | 
			
		||||
@item chunk_duration_ms
 | 
			
		||||
Duration of each chunk in milliseconds. This will go in the @samp{duration}
 | 
			
		||||
attribute of the @samp{SegmentTemplate} element in the manifest. Default: 1000.
 | 
			
		||||
 | 
			
		||||
@item utc_timing_url
 | 
			
		||||
URL of the page that will return the UTC timestamp in ISO format. This will go
 | 
			
		||||
in the @samp{value} attribute of the @samp{UTCTiming} element in the manifest.
 | 
			
		||||
Default: None.
 | 
			
		||||
 | 
			
		||||
@item time_shift_buffer_depth
 | 
			
		||||
Smallest time (in seconds) shifting buffer for which any Representation is
 | 
			
		||||
guaranteed to be available. This will go in the @samp{timeShiftBufferDepth}
 | 
			
		||||
attribute of the @samp{MPD} element. Default: 60.
 | 
			
		||||
 | 
			
		||||
@item minimum_update_period
 | 
			
		||||
Minimum update period (in seconds) of the manifest. This will go in the
 | 
			
		||||
@samp{minimumUpdatePeriod} attribute of the @samp{MPD} element. Default: 0.
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@subsection Example
 | 
			
		||||
@@ -1358,47 +1147,4 @@ ffmpeg -f webm_dash_manifest -i video1.webm \
 | 
			
		||||
       manifest.xml
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@section webm_chunk
 | 
			
		||||
 | 
			
		||||
WebM Live Chunk Muxer.
 | 
			
		||||
 | 
			
		||||
This muxer writes out WebM headers and chunks as separate files which can be
 | 
			
		||||
consumed by clients that support WebM Live streams via DASH.
 | 
			
		||||
 | 
			
		||||
@subsection Options
 | 
			
		||||
 | 
			
		||||
This muxer supports the following options:
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
@item chunk_start_index
 | 
			
		||||
Index of the first chunk (defaults to 0).
 | 
			
		||||
 | 
			
		||||
@item header
 | 
			
		||||
Filename of the header where the initialization data will be written.
 | 
			
		||||
 | 
			
		||||
@item audio_chunk_duration
 | 
			
		||||
Duration of each audio chunk in milliseconds (defaults to 5000).
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@subsection Example
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -f v4l2 -i /dev/video0 \
 | 
			
		||||
       -f alsa -i hw:0 \
 | 
			
		||||
       -map 0:0 \
 | 
			
		||||
       -c:v libvpx-vp9 \
 | 
			
		||||
       -s 640x360 -keyint_min 30 -g 30 \
 | 
			
		||||
       -f webm_chunk \
 | 
			
		||||
       -header webm_live_video_360.hdr \
 | 
			
		||||
       -chunk_start_index 1 \
 | 
			
		||||
       webm_live_video_360_%d.chk \
 | 
			
		||||
       -map 1:0 \
 | 
			
		||||
       -c:a libvorbis \
 | 
			
		||||
       -b:a 128k \
 | 
			
		||||
       -f webm_chunk \
 | 
			
		||||
       -header webm_live_audio_128.hdr \
 | 
			
		||||
       -chunk_start_index 1 \
 | 
			
		||||
       -audio_chunk_duration 1000 \
 | 
			
		||||
       webm_live_audio_128_%d.chk
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@c man end MUXERS
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,4 @@
 | 
			
		||||
\input texinfo @c -*- texinfo -*-
 | 
			
		||||
@documentencoding UTF-8
 | 
			
		||||
 | 
			
		||||
@settitle NUT
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -191,11 +191,6 @@ __asm__() block.
 | 
			
		||||
Use external asm (nasm/yasm) or inline asm (__asm__()), do not use intrinsics.
 | 
			
		||||
The latter requires a good optimizing compiler which gcc is not.
 | 
			
		||||
 | 
			
		||||
When debugging a x86 external asm compilation issue, if lost in the macro
 | 
			
		||||
expansions, add DBG=1 to your make command-line: the input file will be
 | 
			
		||||
preprocessed, stripped of the debug/empty lines, then compiled, showing the
 | 
			
		||||
actual lines causing issues.
 | 
			
		||||
 | 
			
		||||
Inline asm vs. external asm
 | 
			
		||||
---------------------------
 | 
			
		||||
Both inline asm (__asm__("..") in a .c file, handled by a compiler such as gcc)
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,4 @@
 | 
			
		||||
\input texinfo @c -*- texinfo -*-
 | 
			
		||||
@documentencoding UTF-8
 | 
			
		||||
 | 
			
		||||
@settitle Platform Specific Information
 | 
			
		||||
@titlepage
 | 
			
		||||
@@ -97,9 +96,9 @@ the FFmpeg Windows Help Forum at @url{http://ffmpeg.zeranoe.com/forum/}.
 | 
			
		||||
 | 
			
		||||
@section Native Windows compilation using MinGW or MinGW-w64
 | 
			
		||||
 | 
			
		||||
FFmpeg can be built to run natively on Windows using the MinGW-w64
 | 
			
		||||
toolchain. Install the latest versions of MSYS2 and MinGW-w64 from
 | 
			
		||||
@url{http://msys2.github.io/} and/or @url{http://mingw-w64.sourceforge.net/}.
 | 
			
		||||
FFmpeg can be built to run natively on Windows using the MinGW or MinGW-w64
 | 
			
		||||
toolchains. Install the latest versions of MSYS and MinGW or MinGW-w64 from
 | 
			
		||||
@url{http://www.mingw.org/} or @url{http://mingw-w64.sourceforge.net/}.
 | 
			
		||||
You can find detailed installation instructions in the download section and
 | 
			
		||||
the FAQ.
 | 
			
		||||
 | 
			
		||||
@@ -107,7 +106,7 @@ Notes:
 | 
			
		||||
 | 
			
		||||
@itemize
 | 
			
		||||
 | 
			
		||||
@item Building natively using MSYS2 can be sped up by disabling implicit rules
 | 
			
		||||
@item Building natively using MSYS can be sped up by disabling implicit rules
 | 
			
		||||
in the Makefile by calling @code{make -r} instead of plain @code{make}. This
 | 
			
		||||
speed up is close to non-existent for normal one-off builds and is only
 | 
			
		||||
noticeable when running make for a second time (for example during
 | 
			
		||||
@@ -134,12 +133,13 @@ You will need the following prerequisites:
 | 
			
		||||
(if using MSVC 2012 or earlier)
 | 
			
		||||
@item @uref{http://code.google.com/p/msinttypes/, msinttypes}
 | 
			
		||||
(if using MSVC 2012 or earlier)
 | 
			
		||||
@item @uref{http://msys2.github.io/, MSYS2}
 | 
			
		||||
@item @uref{http://www.mingw.org/, MSYS}
 | 
			
		||||
@item @uref{http://yasm.tortall.net/, YASM}
 | 
			
		||||
(Also available via MSYS2's package manager.)
 | 
			
		||||
@item @uref{http://gnuwin32.sourceforge.net/packages/bc.htm, bc for Windows} if
 | 
			
		||||
you want to run @uref{fate.html, FATE}.
 | 
			
		||||
@end itemize
 | 
			
		||||
 | 
			
		||||
To set up a proper environment in MSYS2, you need to run @code{msys_shell.bat} from
 | 
			
		||||
To set up a proper environment in MSYS, you need to run @code{msys.bat} from
 | 
			
		||||
the Visual Studio or Intel Compiler command prompt.
 | 
			
		||||
 | 
			
		||||
Place @code{yasm.exe} somewhere in your @code{PATH}. If using MSVC 2012 or
 | 
			
		||||
@@ -175,6 +175,12 @@ Notes:
 | 
			
		||||
 | 
			
		||||
@itemize
 | 
			
		||||
 | 
			
		||||
@item It is possible that coreutils' @code{link.exe} conflicts with MSVC's linker.
 | 
			
		||||
You can find out by running @code{which link} to see which @code{link.exe} you
 | 
			
		||||
are using. If it is located at @code{/bin/link.exe}, then you have the wrong one
 | 
			
		||||
in your @code{PATH}. Either move or remove that copy, or make sure MSVC's
 | 
			
		||||
@code{link.exe} takes precedence in your @code{PATH} over coreutils'.
 | 
			
		||||
 | 
			
		||||
@item If you wish to build with zlib support, you will have to grab a compatible
 | 
			
		||||
zlib binary from somewhere, with an MSVC import lib, or if you wish to link
 | 
			
		||||
statically, you can follow the instructions below to build a compatible
 | 
			
		||||
@@ -277,7 +283,7 @@ binutils, gcc4-core, make, git, mingw-runtime, texinfo
 | 
			
		||||
 | 
			
		||||
In order to run FATE you will also need the following "Utils" packages:
 | 
			
		||||
@example
 | 
			
		||||
diffutils
 | 
			
		||||
bc, diffutils
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
If you want to build FFmpeg with additional libraries, download Cygwin
 | 
			
		||||
 
 | 
			
		||||
@@ -26,10 +26,6 @@
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include <float.h>
 | 
			
		||||
 | 
			
		||||
// print_options is build for the host, os_support.h isn't needed and is setup
 | 
			
		||||
// for the target. without this build breaks on mingw
 | 
			
		||||
#define AVFORMAT_OS_SUPPORT_H
 | 
			
		||||
 | 
			
		||||
#include "libavformat/avformat.h"
 | 
			
		||||
#include "libavformat/options_table.h"
 | 
			
		||||
#include "libavcodec/avcodec.h"
 | 
			
		||||
 
 | 
			
		||||
@@ -19,18 +19,6 @@ supported protocols.
 | 
			
		||||
 | 
			
		||||
A description of the currently available protocols follows.
 | 
			
		||||
 | 
			
		||||
@section async
 | 
			
		||||
 | 
			
		||||
Asynchronous data filling wrapper for input stream.
 | 
			
		||||
 | 
			
		||||
Fill data in a background thread, to decouple I/O operation from demux thread.
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
async:@var{URL}
 | 
			
		||||
async:http://host/resource
 | 
			
		||||
async:cache:http://host/resource
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@section bluray
 | 
			
		||||
 | 
			
		||||
Read BluRay playlist.
 | 
			
		||||
@@ -75,7 +63,7 @@ cache:@var{URL}
 | 
			
		||||
 | 
			
		||||
Physical concatenation protocol.
 | 
			
		||||
 | 
			
		||||
Read and seek from many resources in sequence as if they were
 | 
			
		||||
Allow to read and seek from many resource in sequence as if they were
 | 
			
		||||
a unique resource.
 | 
			
		||||
 | 
			
		||||
A URL accepted by this protocol has the syntax:
 | 
			
		||||
@@ -129,7 +117,7 @@ ffmpeg -i "data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP/////////////
 | 
			
		||||
 | 
			
		||||
File access protocol.
 | 
			
		||||
 | 
			
		||||
Read from or write to a file.
 | 
			
		||||
Allow to read from or write to a file.
 | 
			
		||||
 | 
			
		||||
A file URL can have the form:
 | 
			
		||||
@example
 | 
			
		||||
@@ -167,7 +155,7 @@ time, which is valuable for files on slow medium.
 | 
			
		||||
 | 
			
		||||
FTP (File Transfer Protocol).
 | 
			
		||||
 | 
			
		||||
Read from or write to remote resources using FTP protocol.
 | 
			
		||||
Allow to read from or write to remote resources using FTP protocol.
 | 
			
		||||
 | 
			
		||||
Following syntax is required.
 | 
			
		||||
@example
 | 
			
		||||
@@ -289,43 +277,6 @@ Set initial byte offset.
 | 
			
		||||
 | 
			
		||||
@item end_offset
 | 
			
		||||
Try to limit the request to bytes preceding this offset.
 | 
			
		||||
 | 
			
		||||
@item method
 | 
			
		||||
When used as a client option it sets the HTTP method for the request.
 | 
			
		||||
 | 
			
		||||
When used as a server option it sets the HTTP method that is going to be
 | 
			
		||||
expected from the client(s).
 | 
			
		||||
If the expected and the received HTTP method do not match the client will
 | 
			
		||||
be given a Bad Request response.
 | 
			
		||||
When unset the HTTP method is not checked for now. This will be replaced by
 | 
			
		||||
autodetection in the future.
 | 
			
		||||
 | 
			
		||||
@item listen
 | 
			
		||||
If set to 1 enables experimental HTTP server. This can be used to send data when
 | 
			
		||||
used as an output option, or read data from a client with HTTP POST when used as
 | 
			
		||||
an input option.
 | 
			
		||||
If set to 2 enables experimental mutli-client HTTP server. This is not yet implemented
 | 
			
		||||
in ffmpeg.c or ffserver.c and thus must not be used as a command line option.
 | 
			
		||||
@example
 | 
			
		||||
# Server side (sending):
 | 
			
		||||
ffmpeg -i somefile.ogg -c copy -listen 1 -f ogg http://@var{server}:@var{port}
 | 
			
		||||
 | 
			
		||||
# Client side (receiving):
 | 
			
		||||
ffmpeg -i http://@var{server}:@var{port} -c copy somefile.ogg
 | 
			
		||||
 | 
			
		||||
# Client can also be done with wget:
 | 
			
		||||
wget http://@var{server}:@var{port} -O somefile.ogg
 | 
			
		||||
 | 
			
		||||
# Server side (receiving):
 | 
			
		||||
ffmpeg -listen 1 -i http://@var{server}:@var{port} -c copy somefile.ogg
 | 
			
		||||
 | 
			
		||||
# Client side (sending):
 | 
			
		||||
ffmpeg -i somefile.ogg -chunked_post 0 -c copy -f ogg http://@var{server}:@var{port}
 | 
			
		||||
 | 
			
		||||
# Client can also be done with wget:
 | 
			
		||||
wget --post-file=somefile.ogg http://@var{server}:@var{port}
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@subsection HTTP Cookies
 | 
			
		||||
@@ -423,7 +374,7 @@ be seekable, so they will fail with the MD5 output protocol.
 | 
			
		||||
 | 
			
		||||
UNIX pipe access protocol.
 | 
			
		||||
 | 
			
		||||
Read and write from UNIX pipes.
 | 
			
		||||
Allow to read and write from UNIX pipes.
 | 
			
		||||
 | 
			
		||||
The accepted syntax is:
 | 
			
		||||
@example
 | 
			
		||||
@@ -663,7 +614,7 @@ For more information see: @url{http://www.samba.org/}.
 | 
			
		||||
 | 
			
		||||
Secure File Transfer Protocol via libssh
 | 
			
		||||
 | 
			
		||||
Read from or write to remote resources using SFTP protocol.
 | 
			
		||||
Allow to read from or write to remote resources using SFTP protocol.
 | 
			
		||||
 | 
			
		||||
Following syntax is required.
 | 
			
		||||
 | 
			
		||||
@@ -799,7 +750,7 @@ port will be used for the local RTP and RTCP ports.
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
If @option{localrtcpport} (the local RTCP port) is not set it will be
 | 
			
		||||
set to the local RTP port value plus 1.
 | 
			
		||||
set to the the local RTP port value plus 1.
 | 
			
		||||
@end enumerate
 | 
			
		||||
 | 
			
		||||
@section rtsp
 | 
			
		||||
@@ -1104,9 +1055,7 @@ subfile,,start,153391104,end,268142592,,:/media/dvd/VIDEO_TS/VTS_08_1.VOB
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Play an AVI file directly from a TAR archive:
 | 
			
		||||
@example
 | 
			
		||||
subfile,,start,183241728,end,366490624,,:archive.tar
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@section tcp
 | 
			
		||||
 | 
			
		||||
@@ -1132,8 +1081,8 @@ Set raise error timeout, expressed in microseconds.
 | 
			
		||||
This option is only relevant in read mode: if no data arrived in more
 | 
			
		||||
than this time interval, raise error.
 | 
			
		||||
 | 
			
		||||
@item listen_timeout=@var{milliseconds}
 | 
			
		||||
Set listen timeout, expressed in milliseconds.
 | 
			
		||||
@item listen_timeout=@var{microseconds}
 | 
			
		||||
Set listen timeout, expressed in microseconds.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
The following example shows how to setup a listening TCP connection
 | 
			
		||||
 
 | 
			
		||||
@@ -122,22 +122,6 @@ a_dither).
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@item alphablend
 | 
			
		||||
Set the alpha blending to use when the input has alpha but the output does not.
 | 
			
		||||
Default value is @samp{none}.
 | 
			
		||||
 | 
			
		||||
@table @samp
 | 
			
		||||
@item uniform_color
 | 
			
		||||
Blend onto a uniform background color
 | 
			
		||||
 | 
			
		||||
@item checkerboard
 | 
			
		||||
Blend onto a checkerboard
 | 
			
		||||
 | 
			
		||||
@item none
 | 
			
		||||
No blending
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@c man end SCALER OPTIONS
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										122
									
								
								doc/t2h.pm
									
									
									
									
									
								
							
							
						
						
									
										122
									
								
								doc/t2h.pm
									
									
									
									
									
								
							@@ -23,108 +23,8 @@
 | 
			
		||||
# no navigation elements
 | 
			
		||||
set_from_init_file('HEADERS', 0);
 | 
			
		||||
 | 
			
		||||
sub ffmpeg_heading_command($$$$$)
 | 
			
		||||
{
 | 
			
		||||
    my $self = shift;
 | 
			
		||||
    my $cmdname = shift;
 | 
			
		||||
    my $command = shift;
 | 
			
		||||
    my $args = shift;
 | 
			
		||||
    my $content = shift;
 | 
			
		||||
 | 
			
		||||
    my $result = '';
 | 
			
		||||
 | 
			
		||||
    # not clear that it may really happen
 | 
			
		||||
    if ($self->in_string) {
 | 
			
		||||
        $result .= $self->command_string($command) ."\n" if ($cmdname ne 'node');
 | 
			
		||||
        $result .= $content if (defined($content));
 | 
			
		||||
        return $result;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    my $element_id = $self->command_id($command);
 | 
			
		||||
    $result .= "<a name=\"$element_id\"></a>\n"
 | 
			
		||||
        if (defined($element_id) and $element_id ne '');
 | 
			
		||||
 | 
			
		||||
    print STDERR "Process $command "
 | 
			
		||||
        .Texinfo::Structuring::_print_root_command_texi($command)."\n"
 | 
			
		||||
            if ($self->get_conf('DEBUG'));
 | 
			
		||||
    my $element;
 | 
			
		||||
    if ($Texinfo::Common::root_commands{$command->{'cmdname'}}
 | 
			
		||||
        and $command->{'parent'}
 | 
			
		||||
        and $command->{'parent'}->{'type'}
 | 
			
		||||
        and $command->{'parent'}->{'type'} eq 'element') {
 | 
			
		||||
        $element = $command->{'parent'};
 | 
			
		||||
    }
 | 
			
		||||
    if ($element) {
 | 
			
		||||
        $result .= &{$self->{'format_element_header'}}($self, $cmdname,
 | 
			
		||||
                                                       $command, $element);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    my $heading_level;
 | 
			
		||||
    # node is used as heading if there is nothing else.
 | 
			
		||||
    if ($cmdname eq 'node') {
 | 
			
		||||
        if (!$element or (!$element->{'extra'}->{'section'}
 | 
			
		||||
            and $element->{'extra'}->{'node'}
 | 
			
		||||
            and $element->{'extra'}->{'node'} eq $command
 | 
			
		||||
             # bogus node may not have been normalized
 | 
			
		||||
            and defined($command->{'extra'}->{'normalized'}))) {
 | 
			
		||||
            if ($command->{'extra'}->{'normalized'} eq 'Top') {
 | 
			
		||||
                $heading_level = 0;
 | 
			
		||||
            } else {
 | 
			
		||||
                $heading_level = 3;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    } else {
 | 
			
		||||
        $heading_level = $command->{'level'};
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    my $heading = $self->command_text($command);
 | 
			
		||||
    # $heading not defined may happen if the command is a @node, for example
 | 
			
		||||
    # if there is an error in the node.
 | 
			
		||||
    if (defined($heading) and $heading ne '' and defined($heading_level)) {
 | 
			
		||||
 | 
			
		||||
        if ($Texinfo::Common::root_commands{$cmdname}
 | 
			
		||||
            and $Texinfo::Common::sectioning_commands{$cmdname}) {
 | 
			
		||||
            my $content_href = $self->command_contents_href($command, 'contents',
 | 
			
		||||
                                                            $self->{'current_filename'});
 | 
			
		||||
            if ($content_href) {
 | 
			
		||||
                my $this_href = $content_href =~ s/^\#toc-/\#/r;
 | 
			
		||||
                $heading .= '<span class="pull-right">'.
 | 
			
		||||
                              '<a class="anchor hidden-xs" '.
 | 
			
		||||
                                 "href=\"$this_href\" aria-hidden=\"true\">".
 | 
			
		||||
            ($ENV{"FA_ICONS"} ? '<i class="fa fa-link"></i>'
 | 
			
		||||
                              : '#').
 | 
			
		||||
                              '</a> '.
 | 
			
		||||
                              '<a class="anchor hidden-xs"'.
 | 
			
		||||
                                 "href=\"$content_href\" aria-hidden=\"true\">".
 | 
			
		||||
            ($ENV{"FA_ICONS"} ? '<i class="fa fa-navicon"></i>'
 | 
			
		||||
                              : 'TOC').
 | 
			
		||||
                              '</a>'.
 | 
			
		||||
                            '</span>';
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if ($self->in_preformatted()) {
 | 
			
		||||
            $result .= $heading."\n";
 | 
			
		||||
        } else {
 | 
			
		||||
            # if the level was changed, set the command name right
 | 
			
		||||
            if ($cmdname ne 'node'
 | 
			
		||||
                and $heading_level ne $Texinfo::Common::command_structuring_level{$cmdname}) {
 | 
			
		||||
                $cmdname
 | 
			
		||||
                    = $Texinfo::Common::level_to_structuring_command{$cmdname}->[$heading_level];
 | 
			
		||||
            }
 | 
			
		||||
            $result .= &{$self->{'format_heading_text'}}(
 | 
			
		||||
                        $self, $cmdname, $heading,
 | 
			
		||||
                        $heading_level +
 | 
			
		||||
                        $self->get_conf('CHAPTER_HEADER_LEVEL') - 1, $command);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    $result .= $content if (defined($content));
 | 
			
		||||
    return $result;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
foreach my $command (keys(%Texinfo::Common::sectioning_commands), 'node') {
 | 
			
		||||
    texinfo_register_command_formatting($command, \&ffmpeg_heading_command);
 | 
			
		||||
}
 | 
			
		||||
# TOC and Chapter headings link
 | 
			
		||||
set_from_init_file('TOC_LINKS', 1);
 | 
			
		||||
 | 
			
		||||
# print the TOC where @contents is used
 | 
			
		||||
set_from_init_file('INLINE_CONTENTS', 1);
 | 
			
		||||
@@ -169,7 +69,6 @@ EOT
 | 
			
		||||
 | 
			
		||||
    my $head2 = $ENV{"FFMPEG_HEADER2"} || <<EOT;
 | 
			
		||||
    </title>
 | 
			
		||||
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
 | 
			
		||||
    <link rel="stylesheet" type="text/css" href="bootstrap.min.css">
 | 
			
		||||
    <link rel="stylesheet" type="text/css" href="style.min.css">
 | 
			
		||||
  </head>
 | 
			
		||||
@@ -186,23 +85,6 @@ EOT
 | 
			
		||||
}
 | 
			
		||||
texinfo_register_formatting_function('begin_file', \&ffmpeg_begin_file);
 | 
			
		||||
 | 
			
		||||
sub ffmpeg_program_string($)
 | 
			
		||||
{
 | 
			
		||||
  my $self = shift;
 | 
			
		||||
  if (defined($self->get_conf('PROGRAM'))
 | 
			
		||||
      and $self->get_conf('PROGRAM') ne ''
 | 
			
		||||
      and defined($self->get_conf('PACKAGE_URL'))) {
 | 
			
		||||
    return $self->convert_tree(
 | 
			
		||||
      $self->gdt('This document was generated using @uref{{program_homepage}, @emph{{program}}}.',
 | 
			
		||||
         { 'program_homepage' => $self->get_conf('PACKAGE_URL'),
 | 
			
		||||
           'program' => $self->get_conf('PROGRAM') }));
 | 
			
		||||
  } else {
 | 
			
		||||
    return $self->convert_tree(
 | 
			
		||||
      $self->gdt('This document was generated automatically.'));
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
texinfo_register_formatting_function('program_string', \&ffmpeg_program_string);
 | 
			
		||||
 | 
			
		||||
# Customized file ending
 | 
			
		||||
sub ffmpeg_end_file($)
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
@@ -166,7 +166,7 @@ INF: while(<$inf>) {
 | 
			
		||||
        if ($ended =~ /^(?:ifset|ifclear|ignore|menu|iftex|ifhtml|ifnothtml)$/) {
 | 
			
		||||
            $skipping = pop @skstack;
 | 
			
		||||
            next;
 | 
			
		||||
        } elsif ($ended =~ /^(?:example|smallexample|verbatim|display)$/) {
 | 
			
		||||
        } elsif ($ended =~ /^(?:example|smallexample|display)$/) {
 | 
			
		||||
            $shift = "";
 | 
			
		||||
            $_ = "";        # need a paragraph break
 | 
			
		||||
        } elsif ($ended =~ /^(?:itemize|enumerate|(?:multi|[fv])?table)$/) {
 | 
			
		||||
@@ -290,7 +290,7 @@ INF: while(<$inf>) {
 | 
			
		||||
        $_ = "\n=over 4\n";
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    /^\@((?:small)?example|verbatim|display)/ and do {
 | 
			
		||||
    /^\@((?:small)?example|display)/ and do {
 | 
			
		||||
        push @endwstack, $endw;
 | 
			
		||||
        $endw = $1;
 | 
			
		||||
        $shift = "\t";
 | 
			
		||||
@@ -384,7 +384,7 @@ sub postprocess
 | 
			
		||||
    # @* is also impossible in .pod; we discard it and any newline that
 | 
			
		||||
    # follows it.  Similarly, our macro @gol must be discarded.
 | 
			
		||||
 | 
			
		||||
    s/\@anchor\{(?:[^\}]*)\}//g;
 | 
			
		||||
    s/\@anchor{(?:[^\}]*)\}//g;
 | 
			
		||||
    s/\(?\@xref\{(?:[^\}]*)\}(?:[^.<]|(?:<[^<>]*>))*\.\)?//g;
 | 
			
		||||
    s/\s+\(\@pxref\{(?:[^\}]*)\}\)//g;
 | 
			
		||||
    s/;\s+\@pxref\{(?:[^\}]*)\}//g;
 | 
			
		||||
 
 | 
			
		||||
@@ -12,17 +12,17 @@ explicitly specified. The following rules are applied:
 | 
			
		||||
 | 
			
		||||
@itemize
 | 
			
		||||
@item
 | 
			
		||||
@samp{'} and @samp{\} are special characters (respectively used for
 | 
			
		||||
@code{'} and @code{\} are special characters (respectively used for
 | 
			
		||||
quoting and escaping). In addition to them, there might be other
 | 
			
		||||
special characters depending on the specific syntax where the escaping
 | 
			
		||||
and quoting are employed.
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
A special character is escaped by prefixing it with a @samp{\}.
 | 
			
		||||
A special character is escaped by prefixing it with a '\'.
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
All characters enclosed between @samp{''} are included literally in the
 | 
			
		||||
parsed string. The quote character @samp{'} itself cannot be quoted,
 | 
			
		||||
All characters enclosed between '' are included literally in the
 | 
			
		||||
parsed string. The quote character @code{'} itself cannot be quoted,
 | 
			
		||||
so you may need to close the quote and escape it.
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
@@ -71,7 +71,7 @@ Escaping and quoting can be mixed together:
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
To include a literal @samp{\} you can use either escaping or quoting:
 | 
			
		||||
To include a literal @code{\} you can use either escaping or quoting:
 | 
			
		||||
@example
 | 
			
		||||
'c:\foo' can be written as c:\\foo
 | 
			
		||||
@end example
 | 
			
		||||
@@ -238,14 +238,6 @@ The following abbreviations are recognized:
 | 
			
		||||
480x320
 | 
			
		||||
@item qhd
 | 
			
		||||
960x540
 | 
			
		||||
@item 2kdci
 | 
			
		||||
2048x1080
 | 
			
		||||
@item 4kdci
 | 
			
		||||
4096x2160
 | 
			
		||||
@item uhd2160
 | 
			
		||||
3840x2160
 | 
			
		||||
@item uhd4320
 | 
			
		||||
7680x4320
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@anchor{video rate syntax}
 | 
			
		||||
@@ -852,7 +844,7 @@ Return 1.0 if @var{x} is +/-INFINITY, 0.0 otherwise.
 | 
			
		||||
Return 1.0 if @var{x} is NAN, 0.0 otherwise.
 | 
			
		||||
 | 
			
		||||
@item ld(var)
 | 
			
		||||
Load the value of the internal variable with number
 | 
			
		||||
Allow to load the value of the internal variable with number
 | 
			
		||||
@var{var}, which was previously stored with st(@var{var}, @var{expr}).
 | 
			
		||||
The function returns the loaded value.
 | 
			
		||||
 | 
			
		||||
@@ -869,7 +861,7 @@ Return 1 if @var{x} is lesser than or equal to @var{y}, 0 otherwise.
 | 
			
		||||
Return the maximum between @var{x} and @var{y}.
 | 
			
		||||
 | 
			
		||||
@item min(x, y)
 | 
			
		||||
Return the minimum between @var{x} and @var{y}.
 | 
			
		||||
Return the maximum between @var{x} and @var{y}.
 | 
			
		||||
 | 
			
		||||
@item mod(x, y)
 | 
			
		||||
Compute the remainder of division of @var{x} by @var{y}.
 | 
			
		||||
@@ -920,7 +912,7 @@ Compute the square root of @var{expr}. This is equivalent to
 | 
			
		||||
Compute expression @code{1/(1 + exp(4*x))}.
 | 
			
		||||
 | 
			
		||||
@item st(var, expr)
 | 
			
		||||
Store the value of the expression @var{expr} in an internal
 | 
			
		||||
Allow to store the value of the expression @var{expr} in an internal
 | 
			
		||||
variable. @var{var} specifies the number of the variable where to
 | 
			
		||||
store the value, and it is a value ranging from 0 to 9. The function
 | 
			
		||||
returns the value stored in the internal variable.
 | 
			
		||||
 
 | 
			
		||||
@@ -16,15 +16,16 @@ outputs the modified frame. The most simple way of doing this is to take a
 | 
			
		||||
similar filter.  We'll pick edgedetect, but any other should do. You can look
 | 
			
		||||
for others using the `./ffmpeg -v 0 -filters|grep ' V->V '` command.
 | 
			
		||||
 | 
			
		||||
 - sed 's/edgedetect/foobar/g;s/EdgeDetect/Foobar/g' libavfilter/vf_edgedetect.c > libavfilter/vf_foobar.c
 | 
			
		||||
 - cp libavfilter/vf_{edgedetect,foobar}.c
 | 
			
		||||
 - sed -i s/edgedetect/foobar/g -i libavfilter/vf_foobar.c
 | 
			
		||||
 - sed -i s/EdgeDetect/Foobar/g -i libavfilter/vf_foobar.c
 | 
			
		||||
 - edit libavfilter/Makefile, and add an entry for "foobar" following the
 | 
			
		||||
   pattern of the other filters.
 | 
			
		||||
 - edit libavfilter/allfilters.c, and add an entry for "foobar" following the
 | 
			
		||||
   pattern of the other filters.
 | 
			
		||||
 - ./configure ...
 | 
			
		||||
 - make -j<whatever> ffmpeg
 | 
			
		||||
 - ./ffmpeg -i http://samples.ffmpeg.org/image-samples/lena.pnm -vf foobar foobar.png
 | 
			
		||||
   Note here: you can obviously use a random local image instead of a remote URL.
 | 
			
		||||
 - ./ffmpeg -i tests/lena.pnm -vf foobar foobar.png
 | 
			
		||||
 | 
			
		||||
If everything went right, you should get a foobar.png with Lena edge-detected.
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										36
									
								
								ffmpeg.h
									
									
									
									
									
								
							
							
						
						
									
										36
									
								
								ffmpeg.h
									
									
									
									
									
								
							@@ -63,7 +63,6 @@ enum HWAccelID {
 | 
			
		||||
    HWACCEL_VDPAU,
 | 
			
		||||
    HWACCEL_DXVA2,
 | 
			
		||||
    HWACCEL_VDA,
 | 
			
		||||
    HWACCEL_VIDEOTOOLBOX,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef struct HWAccel {
 | 
			
		||||
@@ -93,8 +92,6 @@ typedef struct OptionsContext {
 | 
			
		||||
 | 
			
		||||
    /* input/output options */
 | 
			
		||||
    int64_t start_time;
 | 
			
		||||
    int64_t start_time_eof;
 | 
			
		||||
    int seek_timestamp;
 | 
			
		||||
    const char *format;
 | 
			
		||||
 | 
			
		||||
    SpecifierOpt *codec_names;
 | 
			
		||||
@@ -114,7 +111,6 @@ typedef struct OptionsContext {
 | 
			
		||||
    int64_t input_ts_offset;
 | 
			
		||||
    int rate_emu;
 | 
			
		||||
    int accurate_seek;
 | 
			
		||||
    int thread_queue_size;
 | 
			
		||||
 | 
			
		||||
    SpecifierOpt *ts_scale;
 | 
			
		||||
    int        nb_ts_scale;
 | 
			
		||||
@@ -124,8 +120,6 @@ typedef struct OptionsContext {
 | 
			
		||||
    int        nb_hwaccels;
 | 
			
		||||
    SpecifierOpt *hwaccel_devices;
 | 
			
		||||
    int        nb_hwaccel_devices;
 | 
			
		||||
    SpecifierOpt *autorotate;
 | 
			
		||||
    int        nb_autorotate;
 | 
			
		||||
 | 
			
		||||
    /* output options */
 | 
			
		||||
    StreamMap *stream_maps;
 | 
			
		||||
@@ -212,8 +206,6 @@ typedef struct OptionsContext {
 | 
			
		||||
    int        nb_apad;
 | 
			
		||||
    SpecifierOpt *discard;
 | 
			
		||||
    int        nb_discard;
 | 
			
		||||
    SpecifierOpt *disposition;
 | 
			
		||||
    int        nb_disposition;
 | 
			
		||||
} OptionsContext;
 | 
			
		||||
 | 
			
		||||
typedef struct InputFilter {
 | 
			
		||||
@@ -231,7 +223,6 @@ typedef struct OutputFilter {
 | 
			
		||||
 | 
			
		||||
    /* temporary storage until stream maps are processed */
 | 
			
		||||
    AVFilterInOut       *out_tmp;
 | 
			
		||||
    enum AVMediaType     type;
 | 
			
		||||
} OutputFilter;
 | 
			
		||||
 | 
			
		||||
typedef struct FilterGraph {
 | 
			
		||||
@@ -281,7 +272,6 @@ typedef struct InputStream {
 | 
			
		||||
    int top_field_first;
 | 
			
		||||
    int guess_layout_max;
 | 
			
		||||
 | 
			
		||||
    int autorotate;
 | 
			
		||||
    int resample_height;
 | 
			
		||||
    int resample_width;
 | 
			
		||||
    int resample_pix_fmt;
 | 
			
		||||
@@ -346,7 +336,6 @@ typedef struct InputFile {
 | 
			
		||||
    int64_t ts_offset;
 | 
			
		||||
    int64_t last_ts;
 | 
			
		||||
    int64_t start_time;   /* user-specified start time in AV_TIME_BASE or AV_NOPTS_VALUE */
 | 
			
		||||
    int seek_timestamp;
 | 
			
		||||
    int64_t recording_time;
 | 
			
		||||
    int nb_streams;       /* number of stream that ffmpeg is aware of; may be different
 | 
			
		||||
                             from ctx.nb_streams if new streams appear during av_read_frame() */
 | 
			
		||||
@@ -359,7 +348,6 @@ typedef struct InputFile {
 | 
			
		||||
    pthread_t thread;           /* thread reading from this file */
 | 
			
		||||
    int non_blocking;           /* reading packets from the thread should not block */
 | 
			
		||||
    int joined;                 /* the thread has been joined */
 | 
			
		||||
    int thread_queue_size;      /* maximum number of queued packets */
 | 
			
		||||
#endif
 | 
			
		||||
} InputFile;
 | 
			
		||||
 | 
			
		||||
@@ -400,15 +388,11 @@ typedef struct OutputStream {
 | 
			
		||||
    AVCodec *enc;
 | 
			
		||||
    int64_t max_frames;
 | 
			
		||||
    AVFrame *filtered_frame;
 | 
			
		||||
    AVFrame *last_frame;
 | 
			
		||||
    int last_droped;
 | 
			
		||||
    int last_nb0_frames[3];
 | 
			
		||||
 | 
			
		||||
    /* video only */
 | 
			
		||||
    AVRational frame_rate;
 | 
			
		||||
    int force_fps;
 | 
			
		||||
    int top_field_first;
 | 
			
		||||
    int rotate_overridden;
 | 
			
		||||
 | 
			
		||||
    AVRational frame_aspect_ratio;
 | 
			
		||||
 | 
			
		||||
@@ -432,11 +416,10 @@ typedef struct OutputStream {
 | 
			
		||||
    char *filters;         ///< filtergraph associated to the -filter option
 | 
			
		||||
    char *filters_script;  ///< filtergraph script associated to the -filter_script option
 | 
			
		||||
 | 
			
		||||
    int64_t sws_flags;
 | 
			
		||||
    AVDictionary *encoder_opts;
 | 
			
		||||
    AVDictionary *sws_dict;
 | 
			
		||||
    AVDictionary *swr_opts;
 | 
			
		||||
    AVDictionary *resample_opts;
 | 
			
		||||
    AVDictionary *bsf_args;
 | 
			
		||||
    char *apad;
 | 
			
		||||
    OSTFinished finished;        /* no more packets should be written for this stream */
 | 
			
		||||
    int unavailable;                     /* true if the steram is unavailable (possibly temporarily) */
 | 
			
		||||
@@ -444,7 +427,6 @@ typedef struct OutputStream {
 | 
			
		||||
    const char *attachment_filename;
 | 
			
		||||
    int copy_initial_nonkeyframes;
 | 
			
		||||
    int copy_prior_start;
 | 
			
		||||
    char *disposition;
 | 
			
		||||
 | 
			
		||||
    int keep_pix_fmt;
 | 
			
		||||
 | 
			
		||||
@@ -458,15 +440,6 @@ typedef struct OutputStream {
 | 
			
		||||
    // number of frames/samples sent to the encoder
 | 
			
		||||
    uint64_t frames_encoded;
 | 
			
		||||
    uint64_t samples_encoded;
 | 
			
		||||
 | 
			
		||||
    /* packet quality factor */
 | 
			
		||||
    int quality;
 | 
			
		||||
 | 
			
		||||
    /* packet picture type */
 | 
			
		||||
    int pict_type;
 | 
			
		||||
 | 
			
		||||
    /* frame encode sum of squared error values */
 | 
			
		||||
    int64_t error[4];
 | 
			
		||||
} OutputStream;
 | 
			
		||||
 | 
			
		||||
typedef struct OutputFile {
 | 
			
		||||
@@ -494,7 +467,6 @@ extern FilterGraph **filtergraphs;
 | 
			
		||||
extern int        nb_filtergraphs;
 | 
			
		||||
 | 
			
		||||
extern char *vstats_filename;
 | 
			
		||||
extern char *sdp_filename;
 | 
			
		||||
 | 
			
		||||
extern float audio_drift_threshold;
 | 
			
		||||
extern float dts_delta_threshold;
 | 
			
		||||
@@ -503,14 +475,12 @@ extern float dts_error_threshold;
 | 
			
		||||
extern int audio_volume;
 | 
			
		||||
extern int audio_sync_method;
 | 
			
		||||
extern int video_sync_method;
 | 
			
		||||
extern float frame_drop_threshold;
 | 
			
		||||
extern int do_benchmark;
 | 
			
		||||
extern int do_benchmark_all;
 | 
			
		||||
extern int do_deinterlace;
 | 
			
		||||
extern int do_hex_dump;
 | 
			
		||||
extern int do_pkt_dump;
 | 
			
		||||
extern int copy_ts;
 | 
			
		||||
extern int start_at_zero;
 | 
			
		||||
extern int copy_tb;
 | 
			
		||||
extern int debug_ts;
 | 
			
		||||
extern int exit_on_error;
 | 
			
		||||
@@ -520,8 +490,6 @@ extern int stdin_interaction;
 | 
			
		||||
extern int frame_bits_per_raw_sample;
 | 
			
		||||
extern AVIOContext *progress_avio;
 | 
			
		||||
extern float max_error_rate;
 | 
			
		||||
extern int vdpau_api_ver;
 | 
			
		||||
extern char *videotoolbox_pixfmt;
 | 
			
		||||
 | 
			
		||||
extern const AVIOInterruptCB int_cb;
 | 
			
		||||
 | 
			
		||||
@@ -549,13 +517,11 @@ int configure_filtergraph(FilterGraph *fg);
 | 
			
		||||
int configure_output_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out);
 | 
			
		||||
int ist_in_filtergraph(FilterGraph *fg, InputStream *ist);
 | 
			
		||||
FilterGraph *init_simple_filtergraph(InputStream *ist, OutputStream *ost);
 | 
			
		||||
int init_complex_filtergraph(FilterGraph *fg);
 | 
			
		||||
 | 
			
		||||
int ffmpeg_parse_options(int argc, char **argv);
 | 
			
		||||
 | 
			
		||||
int vdpau_init(AVCodecContext *s);
 | 
			
		||||
int dxva2_init(AVCodecContext *s);
 | 
			
		||||
int vda_init(AVCodecContext *s);
 | 
			
		||||
int videotoolbox_init(AVCodecContext *s);
 | 
			
		||||
 | 
			
		||||
#endif /* FFMPEG_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -52,7 +52,6 @@ DEFINE_GUID(DXVA2_ModeH264_F,         0x1b81be69, 0xa0c7,0x11d3,0xb9,0x84,0x00,0
 | 
			
		||||
DEFINE_GUID(DXVADDI_Intel_ModeH264_E, 0x604F8E68, 0x4951,0x4C54,0x88,0xFE,0xAB,0xD2,0x5C,0x15,0xB3,0xD6);
 | 
			
		||||
DEFINE_GUID(DXVA2_ModeVC1_D,          0x1b81beA3, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
 | 
			
		||||
DEFINE_GUID(DXVA2_ModeVC1_D2010,      0x1b81beA4, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
 | 
			
		||||
DEFINE_GUID(DXVA2_ModeHEVC_VLD_Main,  0x5b11d51b, 0x2f4c,0x4452,0xbc,0xc3,0x09,0xf2,0xa1,0x16,0x0c,0xc0);
 | 
			
		||||
DEFINE_GUID(DXVA2_NoEncrypt,          0x1b81beD0, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
 | 
			
		||||
DEFINE_GUID(GUID_NULL,                0x00000000, 0x0000,0x0000,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
 | 
			
		||||
 | 
			
		||||
@@ -81,9 +80,6 @@ static const dxva2_mode dxva2_modes[] = {
 | 
			
		||||
    { &DXVA2_ModeVC1_D,          AV_CODEC_ID_VC1  },
 | 
			
		||||
    { &DXVA2_ModeVC1_D,          AV_CODEC_ID_WMV3 },
 | 
			
		||||
 | 
			
		||||
    /* HEVC/H.265 */
 | 
			
		||||
    { &DXVA2_ModeHEVC_VLD_Main,  AV_CODEC_ID_HEVC },
 | 
			
		||||
 | 
			
		||||
    { NULL,                      0 },
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@@ -364,7 +360,7 @@ static int dxva2_alloc(AVCodecContext *s)
 | 
			
		||||
    d3dpp.SwapEffect       = D3DSWAPEFFECT_DISCARD;
 | 
			
		||||
    d3dpp.Flags            = D3DPRESENTFLAG_VIDEO;
 | 
			
		||||
 | 
			
		||||
    hr = IDirect3D9_CreateDevice(ctx->d3d9, adapter, D3DDEVTYPE_HAL, GetDesktopWindow(),
 | 
			
		||||
    hr = IDirect3D9_CreateDevice(ctx->d3d9, adapter, D3DDEVTYPE_HAL, GetShellWindow(),
 | 
			
		||||
                                 D3DCREATE_SOFTWARE_VERTEXPROCESSING | D3DCREATE_MULTITHREADED | D3DCREATE_FPU_PRESERVE,
 | 
			
		||||
                                 &d3dpp, &ctx->d3d9device);
 | 
			
		||||
    if (FAILED(hr)) {
 | 
			
		||||
@@ -530,10 +526,6 @@ static int dxva2_create_decoder(AVCodecContext *s)
 | 
			
		||||
       but it causes issues for H.264 on certain AMD GPUs..... */
 | 
			
		||||
    if (s->codec_id == AV_CODEC_ID_MPEG2VIDEO)
 | 
			
		||||
        surface_alignment = 32;
 | 
			
		||||
    /* the HEVC DXVA2 spec asks for 128 pixel aligned surfaces to ensure
 | 
			
		||||
       all coding features have enough room to work with */
 | 
			
		||||
    else if  (s->codec_id == AV_CODEC_ID_HEVC)
 | 
			
		||||
        surface_alignment = 128;
 | 
			
		||||
    else
 | 
			
		||||
        surface_alignment = 16;
 | 
			
		||||
 | 
			
		||||
@@ -541,7 +533,7 @@ static int dxva2_create_decoder(AVCodecContext *s)
 | 
			
		||||
    ctx->num_surfaces = 4;
 | 
			
		||||
 | 
			
		||||
    /* add surfaces based on number of possible refs */
 | 
			
		||||
    if (s->codec_id == AV_CODEC_ID_H264 || s->codec_id == AV_CODEC_ID_HEVC)
 | 
			
		||||
    if (s->codec_id == AV_CODEC_ID_H264)
 | 
			
		||||
        ctx->num_surfaces += 16;
 | 
			
		||||
    else
 | 
			
		||||
        ctx->num_surfaces += 2;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										185
									
								
								ffmpeg_filter.c
									
									
									
									
									
								
							
							
						
						
									
										185
									
								
								ffmpeg_filter.c
									
									
									
									
									
								
							@@ -31,7 +31,6 @@
 | 
			
		||||
#include "libavutil/avstring.h"
 | 
			
		||||
#include "libavutil/bprint.h"
 | 
			
		||||
#include "libavutil/channel_layout.h"
 | 
			
		||||
#include "libavutil/display.h"
 | 
			
		||||
#include "libavutil/opt.h"
 | 
			
		||||
#include "libavutil/pixdesc.h"
 | 
			
		||||
#include "libavutil/pixfmt.h"
 | 
			
		||||
@@ -85,7 +84,7 @@ void choose_sample_fmt(AVStream *st, AVCodec *codec)
 | 
			
		||||
                break;
 | 
			
		||||
        }
 | 
			
		||||
        if (*p == -1) {
 | 
			
		||||
            if((codec->capabilities & AV_CODEC_CAP_LOSSLESS) && av_get_sample_fmt_name(st->codec->sample_fmt) > av_get_sample_fmt_name(codec->sample_fmts[0]))
 | 
			
		||||
            if((codec->capabilities & CODEC_CAP_LOSSLESS) && av_get_sample_fmt_name(st->codec->sample_fmt) > av_get_sample_fmt_name(codec->sample_fmts[0]))
 | 
			
		||||
                av_log(NULL, AV_LOG_ERROR, "Conversion will not be lossless.\n");
 | 
			
		||||
            if(av_get_sample_fmt_name(st->codec->sample_fmt))
 | 
			
		||||
            av_log(NULL, AV_LOG_WARNING,
 | 
			
		||||
@@ -289,45 +288,6 @@ static void init_input_filter(FilterGraph *fg, AVFilterInOut *in)
 | 
			
		||||
    ist->filters[ist->nb_filters - 1] = fg->inputs[fg->nb_inputs - 1];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int init_complex_filtergraph(FilterGraph *fg)
 | 
			
		||||
{
 | 
			
		||||
    AVFilterInOut *inputs, *outputs, *cur;
 | 
			
		||||
    AVFilterGraph *graph;
 | 
			
		||||
    int ret = 0;
 | 
			
		||||
 | 
			
		||||
    /* this graph is only used for determining the kinds of inputs
 | 
			
		||||
     * and outputs we have, and is discarded on exit from this function */
 | 
			
		||||
    graph = avfilter_graph_alloc();
 | 
			
		||||
    if (!graph)
 | 
			
		||||
        return AVERROR(ENOMEM);
 | 
			
		||||
 | 
			
		||||
    ret = avfilter_graph_parse2(graph, fg->graph_desc, &inputs, &outputs);
 | 
			
		||||
    if (ret < 0)
 | 
			
		||||
        goto fail;
 | 
			
		||||
 | 
			
		||||
    for (cur = inputs; cur; cur = cur->next)
 | 
			
		||||
        init_input_filter(fg, cur);
 | 
			
		||||
 | 
			
		||||
    for (cur = outputs; cur;) {
 | 
			
		||||
        GROW_ARRAY(fg->outputs, fg->nb_outputs);
 | 
			
		||||
        fg->outputs[fg->nb_outputs - 1] = av_mallocz(sizeof(*fg->outputs[0]));
 | 
			
		||||
        if (!fg->outputs[fg->nb_outputs - 1])
 | 
			
		||||
            exit_program(1);
 | 
			
		||||
 | 
			
		||||
        fg->outputs[fg->nb_outputs - 1]->graph   = fg;
 | 
			
		||||
        fg->outputs[fg->nb_outputs - 1]->out_tmp = cur;
 | 
			
		||||
        fg->outputs[fg->nb_outputs - 1]->type    = avfilter_pad_get_type(cur->filter_ctx->output_pads,
 | 
			
		||||
                                                                         cur->pad_idx);
 | 
			
		||||
        cur = cur->next;
 | 
			
		||||
        fg->outputs[fg->nb_outputs - 1]->out_tmp->next = NULL;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
fail:
 | 
			
		||||
    avfilter_inout_free(&inputs);
 | 
			
		||||
    avfilter_graph_free(&graph);
 | 
			
		||||
    return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int insert_trim(int64_t start_time, int64_t duration,
 | 
			
		||||
                       AVFilterContext **last_filter, int *pad_idx,
 | 
			
		||||
                       const char *filter_name)
 | 
			
		||||
@@ -379,28 +339,6 @@ static int insert_trim(int64_t start_time, int64_t duration,
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int insert_filter(AVFilterContext **last_filter, int *pad_idx,
 | 
			
		||||
                         const char *filter_name, const char *args)
 | 
			
		||||
{
 | 
			
		||||
    AVFilterGraph *graph = (*last_filter)->graph;
 | 
			
		||||
    AVFilterContext *ctx;
 | 
			
		||||
    int ret;
 | 
			
		||||
 | 
			
		||||
    ret = avfilter_graph_create_filter(&ctx,
 | 
			
		||||
                                       avfilter_get_by_name(filter_name),
 | 
			
		||||
                                       filter_name, args, NULL, graph);
 | 
			
		||||
    if (ret < 0)
 | 
			
		||||
        return ret;
 | 
			
		||||
 | 
			
		||||
    ret = avfilter_link(*last_filter, *pad_idx, ctx, 0);
 | 
			
		||||
    if (ret < 0)
 | 
			
		||||
        return ret;
 | 
			
		||||
 | 
			
		||||
    *last_filter = ctx;
 | 
			
		||||
    *pad_idx     = 0;
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int configure_output_video_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out)
 | 
			
		||||
{
 | 
			
		||||
    char *pix_fmts;
 | 
			
		||||
@@ -423,17 +361,11 @@ static int configure_output_video_filter(FilterGraph *fg, OutputFilter *ofilter,
 | 
			
		||||
    if (codec->width || codec->height) {
 | 
			
		||||
        char args[255];
 | 
			
		||||
        AVFilterContext *filter;
 | 
			
		||||
        AVDictionaryEntry *e = NULL;
 | 
			
		||||
 | 
			
		||||
        snprintf(args, sizeof(args), "%d:%d",
 | 
			
		||||
        snprintf(args, sizeof(args), "%d:%d:0x%X",
 | 
			
		||||
                 codec->width,
 | 
			
		||||
                 codec->height);
 | 
			
		||||
 | 
			
		||||
        while ((e = av_dict_get(ost->sws_dict, "", e,
 | 
			
		||||
                                AV_DICT_IGNORE_SUFFIX))) {
 | 
			
		||||
            av_strlcatf(args, sizeof(args), ":%s=%s", e->key, e->value);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
                 codec->height,
 | 
			
		||||
                 (unsigned)ost->sws_flags);
 | 
			
		||||
        snprintf(name, sizeof(name), "scaler for output stream %d:%d",
 | 
			
		||||
                 ost->file_index, ost->index);
 | 
			
		||||
        if ((ret = avfilter_graph_create_filter(&filter, avfilter_get_by_name("scale"),
 | 
			
		||||
@@ -452,7 +384,8 @@ static int configure_output_video_filter(FilterGraph *fg, OutputFilter *ofilter,
 | 
			
		||||
                 ost->file_index, ost->index);
 | 
			
		||||
        ret = avfilter_graph_create_filter(&filter,
 | 
			
		||||
                                                avfilter_get_by_name("format"),
 | 
			
		||||
                                           "format", pix_fmts, NULL, fg->graph);
 | 
			
		||||
                                                "format", pix_fmts, NULL,
 | 
			
		||||
                                                fg->graph);
 | 
			
		||||
        av_freep(&pix_fmts);
 | 
			
		||||
        if (ret < 0)
 | 
			
		||||
            return ret;
 | 
			
		||||
@@ -544,7 +477,7 @@ static int configure_output_audio_filter(FilterGraph *fg, OutputFilter *ofilter,
 | 
			
		||||
                   av_get_default_channel_layout(ost->audio_channels_mapped));
 | 
			
		||||
        for (i = 0; i < ost->audio_channels_mapped; i++)
 | 
			
		||||
            if (ost->audio_channels_map[i] != -1)
 | 
			
		||||
                av_bprintf(&pan_buf, "|c%d=c%d", i, ost->audio_channels_map[i]);
 | 
			
		||||
                av_bprintf(&pan_buf, ":c%d=c%d", i, ost->audio_channels_map[i]);
 | 
			
		||||
 | 
			
		||||
        AUTO_INSERT_FILTER("-map_channel", "pan", pan_buf.str);
 | 
			
		||||
        av_bprint_finalize(&pan_buf, NULL);
 | 
			
		||||
@@ -647,11 +580,6 @@ int configure_output_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOu
 | 
			
		||||
    av_freep(&ofilter->name);
 | 
			
		||||
    DESCRIBE_FILTER_LINK(ofilter, out, 0);
 | 
			
		||||
 | 
			
		||||
    if (!ofilter->ost) {
 | 
			
		||||
        av_log(NULL, AV_LOG_FATAL, "Filter %s has a unconnected output\n", ofilter->name);
 | 
			
		||||
        exit_program(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    switch (avfilter_pad_get_type(out->filter_ctx->output_pads, out->pad_idx)) {
 | 
			
		||||
    case AVMEDIA_TYPE_VIDEO: return configure_output_video_filter(fg, ofilter, out);
 | 
			
		||||
    case AVMEDIA_TYPE_AUDIO: return configure_output_audio_filter(fg, ofilter, out);
 | 
			
		||||
@@ -682,8 +610,8 @@ static int sub2video_prepare(InputStream *ist)
 | 
			
		||||
        }
 | 
			
		||||
        av_log(avf, AV_LOG_INFO, "sub2video: using %dx%d canvas\n", w, h);
 | 
			
		||||
    }
 | 
			
		||||
    ist->sub2video.w = ist->resample_width  = w;
 | 
			
		||||
    ist->sub2video.h = ist->resample_height = h;
 | 
			
		||||
    ist->sub2video.w = ist->dec_ctx->width  = ist->resample_width  = w;
 | 
			
		||||
    ist->sub2video.h = ist->dec_ctx->height = ist->resample_height = h;
 | 
			
		||||
 | 
			
		||||
    /* rectangles are AV_PIX_FMT_PAL8, but we have no guarantee that the
 | 
			
		||||
       palettes for all rectangles are identical or compatible */
 | 
			
		||||
@@ -692,7 +620,6 @@ static int sub2video_prepare(InputStream *ist)
 | 
			
		||||
    ist->sub2video.frame = av_frame_alloc();
 | 
			
		||||
    if (!ist->sub2video.frame)
 | 
			
		||||
        return AVERROR(ENOMEM);
 | 
			
		||||
    ist->sub2video.last_pts = INT64_MIN;
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -710,7 +637,6 @@ static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
 | 
			
		||||
    AVBPrint args;
 | 
			
		||||
    char name[255];
 | 
			
		||||
    int ret, pad_idx = 0;
 | 
			
		||||
    int64_t tsoffset = 0;
 | 
			
		||||
 | 
			
		||||
    if (ist->dec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) {
 | 
			
		||||
        av_log(NULL, AV_LOG_ERROR, "Cannot connect video filter to audio input\n");
 | 
			
		||||
@@ -738,7 +664,7 @@ static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
 | 
			
		||||
             ist->resample_height,
 | 
			
		||||
             ist->hwaccel_retrieve_data ? ist->hwaccel_retrieved_pix_fmt : ist->resample_pix_fmt,
 | 
			
		||||
             tb.num, tb.den, sar.num, sar.den,
 | 
			
		||||
             SWS_BILINEAR + ((ist->dec_ctx->flags&AV_CODEC_FLAG_BITEXACT) ? SWS_BITEXACT:0));
 | 
			
		||||
             SWS_BILINEAR + ((ist->dec_ctx->flags&CODEC_FLAG_BITEXACT) ? SWS_BITEXACT:0));
 | 
			
		||||
    if (fr.num && fr.den)
 | 
			
		||||
        av_bprintf(&args, ":frame_rate=%d/%d", fr.num, fr.den);
 | 
			
		||||
    snprintf(name, sizeof(name), "graph %d input from stream %d:%d", fg->index,
 | 
			
		||||
@@ -749,27 +675,6 @@ static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
 | 
			
		||||
        return ret;
 | 
			
		||||
    last_filter = ifilter->filter;
 | 
			
		||||
 | 
			
		||||
    if (ist->autorotate) {
 | 
			
		||||
        double theta = get_rotation(ist->st);
 | 
			
		||||
 | 
			
		||||
        if (fabs(theta - 90) < 1.0) {
 | 
			
		||||
            ret = insert_filter(&last_filter, &pad_idx, "transpose", "clock");
 | 
			
		||||
        } else if (fabs(theta - 180) < 1.0) {
 | 
			
		||||
            ret = insert_filter(&last_filter, &pad_idx, "hflip", NULL);
 | 
			
		||||
            if (ret < 0)
 | 
			
		||||
                return ret;
 | 
			
		||||
            ret = insert_filter(&last_filter, &pad_idx, "vflip", NULL);
 | 
			
		||||
        } else if (fabs(theta - 270) < 1.0) {
 | 
			
		||||
            ret = insert_filter(&last_filter, &pad_idx, "transpose", "cclock");
 | 
			
		||||
        } else if (fabs(theta) > 1.0) {
 | 
			
		||||
            char rotate_buf[64];
 | 
			
		||||
            snprintf(rotate_buf, sizeof(rotate_buf), "%f*PI/180", theta);
 | 
			
		||||
            ret = insert_filter(&last_filter, &pad_idx, "rotate", rotate_buf);
 | 
			
		||||
        }
 | 
			
		||||
        if (ret < 0)
 | 
			
		||||
            return ret;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (ist->framerate.num) {
 | 
			
		||||
        AVFilterContext *setpts;
 | 
			
		||||
 | 
			
		||||
@@ -806,14 +711,8 @@ static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
 | 
			
		||||
 | 
			
		||||
    snprintf(name, sizeof(name), "trim for input stream %d:%d",
 | 
			
		||||
             ist->file_index, ist->st->index);
 | 
			
		||||
    if (copy_ts) {
 | 
			
		||||
        tsoffset = f->start_time == AV_NOPTS_VALUE ? 0 : f->start_time;
 | 
			
		||||
        if (!start_at_zero && f->ctx->start_time != AV_NOPTS_VALUE)
 | 
			
		||||
            tsoffset += f->ctx->start_time;
 | 
			
		||||
    }
 | 
			
		||||
    ret = insert_trim(((f->start_time == AV_NOPTS_VALUE) || !f->accurate_seek) ?
 | 
			
		||||
                      AV_NOPTS_VALUE : tsoffset, f->recording_time,
 | 
			
		||||
                      &last_filter, &pad_idx, name);
 | 
			
		||||
                      AV_NOPTS_VALUE : 0, f->recording_time, &last_filter, &pad_idx, name);
 | 
			
		||||
    if (ret < 0)
 | 
			
		||||
        return ret;
 | 
			
		||||
 | 
			
		||||
@@ -832,7 +731,6 @@ static int configure_input_audio_filter(FilterGraph *fg, InputFilter *ifilter,
 | 
			
		||||
    AVBPrint args;
 | 
			
		||||
    char name[255];
 | 
			
		||||
    int ret, pad_idx = 0;
 | 
			
		||||
    int64_t tsoffset = 0;
 | 
			
		||||
 | 
			
		||||
    if (ist->dec_ctx->codec_type != AVMEDIA_TYPE_AUDIO) {
 | 
			
		||||
        av_log(NULL, AV_LOG_ERROR, "Cannot connect audio filter to non audio input\n");
 | 
			
		||||
@@ -915,14 +813,8 @@ static int configure_input_audio_filter(FilterGraph *fg, InputFilter *ifilter,
 | 
			
		||||
 | 
			
		||||
    snprintf(name, sizeof(name), "trim for input stream %d:%d",
 | 
			
		||||
             ist->file_index, ist->st->index);
 | 
			
		||||
    if (copy_ts) {
 | 
			
		||||
        tsoffset = f->start_time == AV_NOPTS_VALUE ? 0 : f->start_time;
 | 
			
		||||
        if (!start_at_zero && f->ctx->start_time != AV_NOPTS_VALUE)
 | 
			
		||||
            tsoffset += f->ctx->start_time;
 | 
			
		||||
    }
 | 
			
		||||
    ret = insert_trim(((f->start_time == AV_NOPTS_VALUE) || !f->accurate_seek) ?
 | 
			
		||||
                      AV_NOPTS_VALUE : tsoffset, f->recording_time,
 | 
			
		||||
                      &last_filter, &pad_idx, name);
 | 
			
		||||
                      AV_NOPTS_VALUE : 0, f->recording_time, &last_filter, &pad_idx, name);
 | 
			
		||||
    if (ret < 0)
 | 
			
		||||
        return ret;
 | 
			
		||||
 | 
			
		||||
@@ -954,7 +846,7 @@ static int configure_input_filter(FilterGraph *fg, InputFilter *ifilter,
 | 
			
		||||
int configure_filtergraph(FilterGraph *fg)
 | 
			
		||||
{
 | 
			
		||||
    AVFilterInOut *inputs, *outputs, *cur;
 | 
			
		||||
    int ret, i, simple = !fg->graph_desc;
 | 
			
		||||
    int ret, i, init = !fg->graph, simple = !fg->graph_desc;
 | 
			
		||||
    const char *graph_desc = simple ? fg->outputs[0]->ost->avfilter :
 | 
			
		||||
                                      fg->graph_desc;
 | 
			
		||||
 | 
			
		||||
@@ -967,13 +859,7 @@ int configure_filtergraph(FilterGraph *fg)
 | 
			
		||||
        char args[512];
 | 
			
		||||
        AVDictionaryEntry *e = NULL;
 | 
			
		||||
 | 
			
		||||
        args[0] = 0;
 | 
			
		||||
        while ((e = av_dict_get(ost->sws_dict, "", e,
 | 
			
		||||
                                AV_DICT_IGNORE_SUFFIX))) {
 | 
			
		||||
            av_strlcatf(args, sizeof(args), "%s=%s:", e->key, e->value);
 | 
			
		||||
        }
 | 
			
		||||
        if (strlen(args))
 | 
			
		||||
            args[strlen(args)-1] = 0;
 | 
			
		||||
        snprintf(args, sizeof(args), "flags=0x%X", (unsigned)ost->sws_flags);
 | 
			
		||||
        fg->graph->scale_sws_opts = av_strdup(args);
 | 
			
		||||
 | 
			
		||||
        args[0] = 0;
 | 
			
		||||
@@ -1003,30 +889,14 @@ int configure_filtergraph(FilterGraph *fg)
 | 
			
		||||
        return ret;
 | 
			
		||||
 | 
			
		||||
    if (simple && (!inputs || inputs->next || !outputs || outputs->next)) {
 | 
			
		||||
        const char *num_inputs;
 | 
			
		||||
        const char *num_outputs;
 | 
			
		||||
        if (!outputs) {
 | 
			
		||||
            num_outputs = "0";
 | 
			
		||||
        } else if (outputs->next) {
 | 
			
		||||
            num_outputs = ">1";
 | 
			
		||||
        } else {
 | 
			
		||||
            num_outputs = "1";
 | 
			
		||||
        }
 | 
			
		||||
        if (!inputs) {
 | 
			
		||||
            num_inputs = "0";
 | 
			
		||||
        } else if (inputs->next) {
 | 
			
		||||
            num_inputs = ">1";
 | 
			
		||||
        } else {
 | 
			
		||||
            num_inputs = "1";
 | 
			
		||||
        }
 | 
			
		||||
        av_log(NULL, AV_LOG_ERROR, "Simple filtergraph '%s' was expected "
 | 
			
		||||
               "to have exactly 1 input and 1 output."
 | 
			
		||||
               " However, it had %s input(s) and %s output(s)."
 | 
			
		||||
               " Please adjust, or use a complex filtergraph (-filter_complex) instead.\n",
 | 
			
		||||
               graph_desc, num_inputs, num_outputs);
 | 
			
		||||
        av_log(NULL, AV_LOG_ERROR, "Simple filtergraph '%s' does not have "
 | 
			
		||||
               "exactly one input and output.\n", graph_desc);
 | 
			
		||||
        return AVERROR(EINVAL);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    for (cur = inputs; !simple && init && cur; cur = cur->next)
 | 
			
		||||
        init_input_filter(fg, cur);
 | 
			
		||||
 | 
			
		||||
    for (cur = inputs, i = 0; cur; cur = cur->next, i++)
 | 
			
		||||
        if ((ret = configure_input_filter(fg, fg->inputs[i], cur)) < 0) {
 | 
			
		||||
            avfilter_inout_free(&inputs);
 | 
			
		||||
@@ -1035,12 +905,27 @@ int configure_filtergraph(FilterGraph *fg)
 | 
			
		||||
        }
 | 
			
		||||
    avfilter_inout_free(&inputs);
 | 
			
		||||
 | 
			
		||||
    if (!init || simple) {
 | 
			
		||||
        /* we already know the mappings between lavfi outputs and output streams,
 | 
			
		||||
         * so we can finish the setup */
 | 
			
		||||
        for (cur = outputs, i = 0; cur; cur = cur->next, i++)
 | 
			
		||||
            configure_output_filter(fg, fg->outputs[i], cur);
 | 
			
		||||
        avfilter_inout_free(&outputs);
 | 
			
		||||
 | 
			
		||||
        if ((ret = avfilter_graph_config(fg->graph, NULL)) < 0)
 | 
			
		||||
            return ret;
 | 
			
		||||
    } else {
 | 
			
		||||
        /* wait until output mappings are processed */
 | 
			
		||||
        for (cur = outputs; cur;) {
 | 
			
		||||
            GROW_ARRAY(fg->outputs, fg->nb_outputs);
 | 
			
		||||
            if (!(fg->outputs[fg->nb_outputs - 1] = av_mallocz(sizeof(*fg->outputs[0]))))
 | 
			
		||||
                exit_program(1);
 | 
			
		||||
            fg->outputs[fg->nb_outputs - 1]->graph   = fg;
 | 
			
		||||
            fg->outputs[fg->nb_outputs - 1]->out_tmp = cur;
 | 
			
		||||
            cur = cur->next;
 | 
			
		||||
            fg->outputs[fg->nb_outputs - 1]->out_tmp->next = NULL;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    fg->reconfiguration = 1;
 | 
			
		||||
 | 
			
		||||
@@ -1048,7 +933,7 @@ int configure_filtergraph(FilterGraph *fg)
 | 
			
		||||
        OutputStream *ost = fg->outputs[i]->ost;
 | 
			
		||||
        if (ost &&
 | 
			
		||||
            ost->enc->type == AVMEDIA_TYPE_AUDIO &&
 | 
			
		||||
            !(ost->enc->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE))
 | 
			
		||||
            !(ost->enc->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE))
 | 
			
		||||
            av_buffersink_set_frame_size(ost->filter->filter,
 | 
			
		||||
                                         ost->enc_ctx->frame_size);
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										420
									
								
								ffmpeg_opt.c
									
									
									
									
									
								
							
							
						
						
									
										420
									
								
								ffmpeg_opt.c
									
									
									
									
									
								
							@@ -40,9 +40,6 @@
 | 
			
		||||
#include "libavutil/parseutils.h"
 | 
			
		||||
#include "libavutil/pixdesc.h"
 | 
			
		||||
#include "libavutil/pixfmt.h"
 | 
			
		||||
#include "libavutil/time_internal.h"
 | 
			
		||||
 | 
			
		||||
#define DEFAULT_PASS_LOGFILENAME_PREFIX "ffmpeg2pass"
 | 
			
		||||
 | 
			
		||||
#define MATCH_PER_STREAM_OPT(name, type, outvar, fmtctx, st)\
 | 
			
		||||
{\
 | 
			
		||||
@@ -74,16 +71,12 @@ const HWAccel hwaccels[] = {
 | 
			
		||||
    { "dxva2", dxva2_init, HWACCEL_DXVA2, AV_PIX_FMT_DXVA2_VLD },
 | 
			
		||||
#endif
 | 
			
		||||
#if CONFIG_VDA
 | 
			
		||||
    { "vda",   videotoolbox_init,   HWACCEL_VDA,   AV_PIX_FMT_VDA },
 | 
			
		||||
#endif
 | 
			
		||||
#if CONFIG_VIDEOTOOLBOX
 | 
			
		||||
    { "videotoolbox",   videotoolbox_init,   HWACCEL_VIDEOTOOLBOX,   AV_PIX_FMT_VIDEOTOOLBOX },
 | 
			
		||||
    { "vda",   vda_init,   HWACCEL_VDA,   AV_PIX_FMT_VDA },
 | 
			
		||||
#endif
 | 
			
		||||
    { 0 },
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
char *vstats_filename;
 | 
			
		||||
char *sdp_filename;
 | 
			
		||||
 | 
			
		||||
float audio_drift_threshold = 0.1;
 | 
			
		||||
float dts_delta_threshold   = 10;
 | 
			
		||||
@@ -92,14 +85,12 @@ float dts_error_threshold   = 3600*30;
 | 
			
		||||
int audio_volume      = 256;
 | 
			
		||||
int audio_sync_method = 0;
 | 
			
		||||
int video_sync_method = VSYNC_AUTO;
 | 
			
		||||
float frame_drop_threshold = 0;
 | 
			
		||||
int do_deinterlace    = 0;
 | 
			
		||||
int do_benchmark      = 0;
 | 
			
		||||
int do_benchmark_all  = 0;
 | 
			
		||||
int do_hex_dump       = 0;
 | 
			
		||||
int do_pkt_dump       = 0;
 | 
			
		||||
int copy_ts           = 0;
 | 
			
		||||
int start_at_zero     = 0;
 | 
			
		||||
int copy_tb           = -1;
 | 
			
		||||
int debug_ts          = 0;
 | 
			
		||||
int exit_on_error     = 0;
 | 
			
		||||
@@ -116,9 +107,6 @@ static int no_file_overwrite  = 0;
 | 
			
		||||
static int do_psnr            = 0;
 | 
			
		||||
static int input_sync;
 | 
			
		||||
static int override_ffserver  = 0;
 | 
			
		||||
static int input_stream_potentially_available = 0;
 | 
			
		||||
static int ignore_unknown_streams = 0;
 | 
			
		||||
static int copy_unknown_streams = 0;
 | 
			
		||||
 | 
			
		||||
static void uninit_options(OptionsContext *o)
 | 
			
		||||
{
 | 
			
		||||
@@ -159,25 +147,12 @@ static void init_options(OptionsContext *o)
 | 
			
		||||
    o->stop_time = INT64_MAX;
 | 
			
		||||
    o->mux_max_delay  = 0.7;
 | 
			
		||||
    o->start_time     = AV_NOPTS_VALUE;
 | 
			
		||||
    o->start_time_eof = AV_NOPTS_VALUE;
 | 
			
		||||
    o->recording_time = INT64_MAX;
 | 
			
		||||
    o->limit_filesize = UINT64_MAX;
 | 
			
		||||
    o->chapters_input_file = INT_MAX;
 | 
			
		||||
    o->accurate_seek  = 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int show_hwaccels(void *optctx, const char *opt, const char *arg)
 | 
			
		||||
{
 | 
			
		||||
    int i;
 | 
			
		||||
 | 
			
		||||
    printf("Hardware acceleration methods:\n");
 | 
			
		||||
    for (i = 0; i < FF_ARRAY_ELEMS(hwaccels) - 1; i++) {
 | 
			
		||||
        printf("%s\n", hwaccels[i].name);
 | 
			
		||||
    }
 | 
			
		||||
    printf("\n");
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* return a copy of the input with the stream specifiers removed from the keys */
 | 
			
		||||
static AVDictionary *strip_specifiers(AVDictionary *dict)
 | 
			
		||||
{
 | 
			
		||||
@@ -249,15 +224,12 @@ static int opt_map(void *optctx, const char *opt, const char *arg)
 | 
			
		||||
    int sync_file_idx = -1, sync_stream_idx = 0;
 | 
			
		||||
    char *p, *sync;
 | 
			
		||||
    char *map;
 | 
			
		||||
    char *allow_unused;
 | 
			
		||||
 | 
			
		||||
    if (*arg == '-') {
 | 
			
		||||
        negative = 1;
 | 
			
		||||
        arg++;
 | 
			
		||||
    }
 | 
			
		||||
    map = av_strdup(arg);
 | 
			
		||||
    if (!map)
 | 
			
		||||
        return AVERROR(ENOMEM);
 | 
			
		||||
 | 
			
		||||
    /* parse sync stream first, just pick first matching stream */
 | 
			
		||||
    if (sync = strchr(map, ',')) {
 | 
			
		||||
@@ -294,8 +266,6 @@ static int opt_map(void *optctx, const char *opt, const char *arg)
 | 
			
		||||
            exit_program(1);
 | 
			
		||||
        }
 | 
			
		||||
    } else {
 | 
			
		||||
        if (allow_unused = strchr(map, '?'))
 | 
			
		||||
            *allow_unused = 0;
 | 
			
		||||
        file_idx = strtol(map, &p, 0);
 | 
			
		||||
        if (file_idx >= nb_input_files || file_idx < 0) {
 | 
			
		||||
            av_log(NULL, AV_LOG_FATAL, "Invalid input file index: %d.\n", file_idx);
 | 
			
		||||
@@ -333,14 +303,9 @@ static int opt_map(void *optctx, const char *opt, const char *arg)
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (!m) {
 | 
			
		||||
        if (allow_unused) {
 | 
			
		||||
            av_log(NULL, AV_LOG_VERBOSE, "Stream map '%s' matches no streams; ignoring.\n", arg);
 | 
			
		||||
        } else {
 | 
			
		||||
            av_log(NULL, AV_LOG_FATAL, "Stream map '%s' matches no streams.\n"
 | 
			
		||||
                                       "To ignore this, add a trailing '?' to the map.\n", arg);
 | 
			
		||||
        av_log(NULL, AV_LOG_FATAL, "Stream map '%s' matches no streams.\n", arg);
 | 
			
		||||
        exit_program(1);
 | 
			
		||||
    }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    av_freep(&map);
 | 
			
		||||
    return 0;
 | 
			
		||||
@@ -413,13 +378,6 @@ static int opt_map_channel(void *optctx, const char *opt, const char *arg)
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int opt_sdp_file(void *optctx, const char *opt, const char *arg)
 | 
			
		||||
{
 | 
			
		||||
    av_free(sdp_filename);
 | 
			
		||||
    sdp_filename = av_strdup(arg);
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Parse a metadata specifier passed as 'arg' parameter.
 | 
			
		||||
 * @param arg  metadata string to parse
 | 
			
		||||
@@ -550,8 +508,7 @@ static int opt_recording_timestamp(void *optctx, const char *opt, const char *ar
 | 
			
		||||
    char buf[128];
 | 
			
		||||
    int64_t recording_timestamp = parse_time_or_die(opt, arg, 0) / 1E6;
 | 
			
		||||
    struct tm time = *gmtime((time_t*)&recording_timestamp);
 | 
			
		||||
    if (!strftime(buf, sizeof(buf), "creation_time=%Y-%m-%dT%H:%M:%S%z", &time))
 | 
			
		||||
        return -1;
 | 
			
		||||
    strftime(buf, sizeof(buf), "creation_time=%FT%T%z", &time);
 | 
			
		||||
    parse_option(o, "metadata", buf, options);
 | 
			
		||||
 | 
			
		||||
    av_log(NULL, AV_LOG_WARNING, "%s is deprecated, set the 'creation_time' metadata "
 | 
			
		||||
@@ -631,9 +588,6 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
 | 
			
		||||
        ist->ts_scale = 1.0;
 | 
			
		||||
        MATCH_PER_STREAM_OPT(ts_scale, dbl, ist->ts_scale, ic, st);
 | 
			
		||||
 | 
			
		||||
        ist->autorotate = 1;
 | 
			
		||||
        MATCH_PER_STREAM_OPT(autorotate, i, ist->autorotate, ic, st);
 | 
			
		||||
 | 
			
		||||
        MATCH_PER_STREAM_OPT(codec_tags, str, codec_tag, ic, st);
 | 
			
		||||
        if (codec_tag) {
 | 
			
		||||
            uint32_t tag = strtol(codec_tag, &next, 0);
 | 
			
		||||
@@ -674,11 +628,9 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
 | 
			
		||||
        case AVMEDIA_TYPE_VIDEO:
 | 
			
		||||
            if(!ist->dec)
 | 
			
		||||
                ist->dec = avcodec_find_decoder(dec->codec_id);
 | 
			
		||||
#if FF_API_EMU_EDGE
 | 
			
		||||
            if (av_codec_get_lowres(dec)) {
 | 
			
		||||
                dec->flags |= CODEC_FLAG_EMU_EDGE;
 | 
			
		||||
            }
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
            ist->resample_height  = ist->dec_ctx->height;
 | 
			
		||||
            ist->resample_width   = ist->dec_ctx->width;
 | 
			
		||||
@@ -840,8 +792,6 @@ static int open_input_file(OptionsContext *o, const char *filename)
 | 
			
		||||
    char *   video_codec_name = NULL;
 | 
			
		||||
    char *   audio_codec_name = NULL;
 | 
			
		||||
    char *subtitle_codec_name = NULL;
 | 
			
		||||
    char *    data_codec_name = NULL;
 | 
			
		||||
    int scan_all_pmts_set = 0;
 | 
			
		||||
 | 
			
		||||
    if (o->format) {
 | 
			
		||||
        if (!(file_iformat = av_find_input_format(o->format))) {
 | 
			
		||||
@@ -894,7 +844,6 @@ static int open_input_file(OptionsContext *o, const char *filename)
 | 
			
		||||
    MATCH_PER_TYPE_OPT(codec_names, str,    video_codec_name, ic, "v");
 | 
			
		||||
    MATCH_PER_TYPE_OPT(codec_names, str,    audio_codec_name, ic, "a");
 | 
			
		||||
    MATCH_PER_TYPE_OPT(codec_names, str, subtitle_codec_name, ic, "s");
 | 
			
		||||
    MATCH_PER_TYPE_OPT(codec_names, str,     data_codec_name, ic, "d");
 | 
			
		||||
 | 
			
		||||
    ic->video_codec_id   = video_codec_name ?
 | 
			
		||||
        find_codec_or_die(video_codec_name   , AVMEDIA_TYPE_VIDEO   , 0)->id : AV_CODEC_ID_NONE;
 | 
			
		||||
@@ -902,8 +851,6 @@ static int open_input_file(OptionsContext *o, const char *filename)
 | 
			
		||||
        find_codec_or_die(audio_codec_name   , AVMEDIA_TYPE_AUDIO   , 0)->id : AV_CODEC_ID_NONE;
 | 
			
		||||
    ic->subtitle_codec_id= subtitle_codec_name ?
 | 
			
		||||
        find_codec_or_die(subtitle_codec_name, AVMEDIA_TYPE_SUBTITLE, 0)->id : AV_CODEC_ID_NONE;
 | 
			
		||||
    ic->data_codec_id    = data_codec_name ?
 | 
			
		||||
        find_codec_or_die(data_codec_name, AVMEDIA_TYPE_DATA, 0)->id : AV_CODEC_ID_NONE;
 | 
			
		||||
 | 
			
		||||
    if (video_codec_name)
 | 
			
		||||
        av_format_set_video_codec   (ic, find_codec_or_die(video_codec_name   , AVMEDIA_TYPE_VIDEO   , 0));
 | 
			
		||||
@@ -911,24 +858,16 @@ static int open_input_file(OptionsContext *o, const char *filename)
 | 
			
		||||
        av_format_set_audio_codec   (ic, find_codec_or_die(audio_codec_name   , AVMEDIA_TYPE_AUDIO   , 0));
 | 
			
		||||
    if (subtitle_codec_name)
 | 
			
		||||
        av_format_set_subtitle_codec(ic, find_codec_or_die(subtitle_codec_name, AVMEDIA_TYPE_SUBTITLE, 0));
 | 
			
		||||
    if (data_codec_name)
 | 
			
		||||
        av_format_set_data_codec(ic, find_codec_or_die(data_codec_name, AVMEDIA_TYPE_DATA, 0));
 | 
			
		||||
 | 
			
		||||
    ic->flags |= AVFMT_FLAG_NONBLOCK;
 | 
			
		||||
    ic->interrupt_callback = int_cb;
 | 
			
		||||
 | 
			
		||||
    if (!av_dict_get(o->g->format_opts, "scan_all_pmts", NULL, AV_DICT_MATCH_CASE)) {
 | 
			
		||||
        av_dict_set(&o->g->format_opts, "scan_all_pmts", "1", AV_DICT_DONT_OVERWRITE);
 | 
			
		||||
        scan_all_pmts_set = 1;
 | 
			
		||||
    }
 | 
			
		||||
    /* open the input file with generic avformat function */
 | 
			
		||||
    err = avformat_open_input(&ic, filename, file_iformat, &o->g->format_opts);
 | 
			
		||||
    if (err < 0) {
 | 
			
		||||
        print_error(filename, err);
 | 
			
		||||
        exit_program(1);
 | 
			
		||||
    }
 | 
			
		||||
    if (scan_all_pmts_set)
 | 
			
		||||
        av_dict_set(&o->g->format_opts, "scan_all_pmts", NULL, AV_DICT_MATCH_CASE);
 | 
			
		||||
    remove_avoptions(&o->g->format_opts, o->g->codec_opts);
 | 
			
		||||
    assert_avoptions(o->g->format_opts);
 | 
			
		||||
 | 
			
		||||
@@ -951,33 +890,14 @@ static int open_input_file(OptionsContext *o, const char *filename)
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (o->start_time_eof != AV_NOPTS_VALUE) {
 | 
			
		||||
        if (ic->duration>0) {
 | 
			
		||||
            o->start_time = o->start_time_eof + ic->duration;
 | 
			
		||||
        } else
 | 
			
		||||
            av_log(NULL, AV_LOG_WARNING, "Cannot use -sseof, duration of %s not known\n", filename);
 | 
			
		||||
    }
 | 
			
		||||
    timestamp = (o->start_time == AV_NOPTS_VALUE) ? 0 : o->start_time;
 | 
			
		||||
    /* add the stream start time */
 | 
			
		||||
    if (!o->seek_timestamp && ic->start_time != AV_NOPTS_VALUE)
 | 
			
		||||
    if (ic->start_time != AV_NOPTS_VALUE)
 | 
			
		||||
        timestamp += ic->start_time;
 | 
			
		||||
 | 
			
		||||
    /* if seeking requested, we execute it */
 | 
			
		||||
    if (o->start_time != AV_NOPTS_VALUE) {
 | 
			
		||||
        int64_t seek_timestamp = timestamp;
 | 
			
		||||
 | 
			
		||||
        if (!(ic->iformat->flags & AVFMT_SEEK_TO_PTS)) {
 | 
			
		||||
            int dts_heuristic = 0;
 | 
			
		||||
            for (i=0; i<ic->nb_streams; i++) {
 | 
			
		||||
                AVCodecContext *avctx = ic->streams[i]->codec;
 | 
			
		||||
                if (avctx->has_b_frames)
 | 
			
		||||
                    dts_heuristic = 1;
 | 
			
		||||
            }
 | 
			
		||||
            if (dts_heuristic) {
 | 
			
		||||
                seek_timestamp -= 3*AV_TIME_BASE / 23;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        ret = avformat_seek_file(ic, -1, INT64_MIN, seek_timestamp, seek_timestamp, 0);
 | 
			
		||||
        ret = avformat_seek_file(ic, -1, INT64_MIN, timestamp, timestamp, 0);
 | 
			
		||||
        if (ret < 0) {
 | 
			
		||||
            av_log(NULL, AV_LOG_WARNING, "%s: could not seek to position %0.3f\n",
 | 
			
		||||
                   filename, (double)timestamp / AV_TIME_BASE);
 | 
			
		||||
@@ -1001,13 +921,10 @@ static int open_input_file(OptionsContext *o, const char *filename)
 | 
			
		||||
    f->start_time = o->start_time;
 | 
			
		||||
    f->recording_time = o->recording_time;
 | 
			
		||||
    f->input_ts_offset = o->input_ts_offset;
 | 
			
		||||
    f->ts_offset  = o->input_ts_offset - (copy_ts ? (start_at_zero && ic->start_time != AV_NOPTS_VALUE ? ic->start_time : 0) : timestamp);
 | 
			
		||||
    f->ts_offset  = o->input_ts_offset - (copy_ts ? 0 : timestamp);
 | 
			
		||||
    f->nb_streams = ic->nb_streams;
 | 
			
		||||
    f->rate_emu   = o->rate_emu;
 | 
			
		||||
    f->accurate_seek = o->accurate_seek;
 | 
			
		||||
#if HAVE_PTHREADS
 | 
			
		||||
    f->thread_queue_size = o->thread_queue_size > 0 ? o->thread_queue_size : 8;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    /* check if all codec options have been used */
 | 
			
		||||
    unused_opts = strip_specifiers(o->g->codec_opts);
 | 
			
		||||
@@ -1062,8 +979,6 @@ static int open_input_file(OptionsContext *o, const char *filename)
 | 
			
		||||
        av_dict_free(&opts[i]);
 | 
			
		||||
    av_freep(&opts);
 | 
			
		||||
 | 
			
		||||
    input_stream_potentially_available = 1;
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -1187,7 +1102,7 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
 | 
			
		||||
                av_dict_set(&ost->encoder_opts, buf, arg, AV_DICT_DONT_OVERWRITE);
 | 
			
		||||
                av_free(buf);
 | 
			
		||||
            } while (!s->eof_reached);
 | 
			
		||||
            avio_closep(&s);
 | 
			
		||||
            avio_close(s);
 | 
			
		||||
        }
 | 
			
		||||
        if (ret) {
 | 
			
		||||
            av_log(NULL, AV_LOG_FATAL,
 | 
			
		||||
@@ -1214,11 +1129,8 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
 | 
			
		||||
 | 
			
		||||
    MATCH_PER_STREAM_OPT(bitstream_filters, str, bsf, oc, st);
 | 
			
		||||
    while (bsf) {
 | 
			
		||||
        char *arg = NULL;
 | 
			
		||||
        if (next = strchr(bsf, ','))
 | 
			
		||||
            *next++ = 0;
 | 
			
		||||
        if (arg = strchr(bsf, '='))
 | 
			
		||||
            *arg++ = 0;
 | 
			
		||||
        if (!(bsfc = av_bitstream_filter_init(bsf))) {
 | 
			
		||||
            av_log(NULL, AV_LOG_FATAL, "Unknown bitstream filter %s\n", bsf);
 | 
			
		||||
            exit_program(1);
 | 
			
		||||
@@ -1227,7 +1139,6 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
 | 
			
		||||
            bsfc_prev->next = bsfc;
 | 
			
		||||
        else
 | 
			
		||||
            ost->bitstream_filters = bsfc;
 | 
			
		||||
        av_dict_set(&ost->bsf_args, bsfc->filter->name, arg, 0);
 | 
			
		||||
 | 
			
		||||
        bsfc_prev = bsfc;
 | 
			
		||||
        bsf       = next;
 | 
			
		||||
@@ -1238,23 +1149,19 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
 | 
			
		||||
        uint32_t tag = strtol(codec_tag, &next, 0);
 | 
			
		||||
        if (*next)
 | 
			
		||||
            tag = AV_RL32(codec_tag);
 | 
			
		||||
        ost->st->codec->codec_tag =
 | 
			
		||||
        ost->enc_ctx->codec_tag = tag;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    MATCH_PER_STREAM_OPT(qscale, dbl, qscale, oc, st);
 | 
			
		||||
    if (qscale >= 0) {
 | 
			
		||||
        ost->enc_ctx->flags |= AV_CODEC_FLAG_QSCALE;
 | 
			
		||||
        ost->enc_ctx->flags |= CODEC_FLAG_QSCALE;
 | 
			
		||||
        ost->enc_ctx->global_quality = FF_QP2LAMBDA * qscale;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    MATCH_PER_STREAM_OPT(disposition, str, ost->disposition, oc, st);
 | 
			
		||||
    ost->disposition = av_strdup(ost->disposition);
 | 
			
		||||
 | 
			
		||||
    if (oc->oformat->flags & AVFMT_GLOBALHEADER)
 | 
			
		||||
        ost->enc_ctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
 | 
			
		||||
        ost->enc_ctx->flags |= CODEC_FLAG_GLOBAL_HEADER;
 | 
			
		||||
 | 
			
		||||
    av_dict_copy(&ost->sws_dict, o->g->sws_dict, 0);
 | 
			
		||||
    av_opt_get_int(o->g->sws_opts, "sws_flags", 0, &ost->sws_flags);
 | 
			
		||||
 | 
			
		||||
    av_dict_copy(&ost->swr_opts, o->g->swr_opts, 0);
 | 
			
		||||
    if (ost->enc && av_get_exact_bits_per_sample(ost->enc->id) == 24)
 | 
			
		||||
@@ -1369,8 +1276,6 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in
 | 
			
		||||
        av_log(NULL, AV_LOG_FATAL, "Invalid framerate value: %s\n", frame_rate);
 | 
			
		||||
        exit_program(1);
 | 
			
		||||
    }
 | 
			
		||||
    if (frame_rate && video_sync_method == VSYNC_PASSTHROUGH)
 | 
			
		||||
        av_log(NULL, AV_LOG_ERROR, "Using -vsync 0 and -r can produce invalid output files\n");
 | 
			
		||||
 | 
			
		||||
    MATCH_PER_STREAM_OPT(frame_aspect_ratios, str, frame_aspect_ratio, oc, st);
 | 
			
		||||
    if (frame_aspect_ratio) {
 | 
			
		||||
@@ -1451,13 +1356,10 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in
 | 
			
		||||
                av_log(NULL, AV_LOG_FATAL, "error parsing rc_override\n");
 | 
			
		||||
                exit_program(1);
 | 
			
		||||
            }
 | 
			
		||||
            /* FIXME realloc failure */
 | 
			
		||||
            video_enc->rc_override =
 | 
			
		||||
                av_realloc_array(video_enc->rc_override,
 | 
			
		||||
                                 i + 1, sizeof(RcOverride));
 | 
			
		||||
            if (!video_enc->rc_override) {
 | 
			
		||||
                av_log(NULL, AV_LOG_FATAL, "Could not (re)allocate memory for rc_override.\n");
 | 
			
		||||
                exit_program(1);
 | 
			
		||||
            }
 | 
			
		||||
                av_realloc(video_enc->rc_override,
 | 
			
		||||
                           sizeof(RcOverride) * (i + 1));
 | 
			
		||||
            video_enc->rc_override[i].start_frame = start;
 | 
			
		||||
            video_enc->rc_override[i].end_frame   = end;
 | 
			
		||||
            if (q > 0) {
 | 
			
		||||
@@ -1474,17 +1376,17 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in
 | 
			
		||||
        video_enc->rc_override_count = i;
 | 
			
		||||
 | 
			
		||||
        if (do_psnr)
 | 
			
		||||
            video_enc->flags|= AV_CODEC_FLAG_PSNR;
 | 
			
		||||
            video_enc->flags|= CODEC_FLAG_PSNR;
 | 
			
		||||
 | 
			
		||||
        /* two pass mode */
 | 
			
		||||
        MATCH_PER_STREAM_OPT(pass, i, do_pass, oc, st);
 | 
			
		||||
        if (do_pass) {
 | 
			
		||||
            if (do_pass & 1) {
 | 
			
		||||
                video_enc->flags |= AV_CODEC_FLAG_PASS1;
 | 
			
		||||
                video_enc->flags |= CODEC_FLAG_PASS1;
 | 
			
		||||
                av_dict_set(&ost->encoder_opts, "flags", "+pass1", AV_DICT_APPEND);
 | 
			
		||||
            }
 | 
			
		||||
            if (do_pass & 2) {
 | 
			
		||||
                video_enc->flags |= AV_CODEC_FLAG_PASS2;
 | 
			
		||||
                video_enc->flags |= CODEC_FLAG_PASS2;
 | 
			
		||||
                av_dict_set(&ost->encoder_opts, "flags", "+pass2", AV_DICT_APPEND);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
@@ -1494,40 +1396,6 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in
 | 
			
		||||
            !(ost->logfile_prefix = av_strdup(ost->logfile_prefix)))
 | 
			
		||||
            exit_program(1);
 | 
			
		||||
 | 
			
		||||
        if (do_pass) {
 | 
			
		||||
            char logfilename[1024];
 | 
			
		||||
            FILE *f;
 | 
			
		||||
 | 
			
		||||
            snprintf(logfilename, sizeof(logfilename), "%s-%d.log",
 | 
			
		||||
                     ost->logfile_prefix ? ost->logfile_prefix :
 | 
			
		||||
                                           DEFAULT_PASS_LOGFILENAME_PREFIX,
 | 
			
		||||
                     i);
 | 
			
		||||
            if (!strcmp(ost->enc->name, "libx264")) {
 | 
			
		||||
                av_dict_set(&ost->encoder_opts, "stats", logfilename, AV_DICT_DONT_OVERWRITE);
 | 
			
		||||
            } else {
 | 
			
		||||
                if (video_enc->flags & AV_CODEC_FLAG_PASS2) {
 | 
			
		||||
                    char  *logbuffer = read_file(logfilename);
 | 
			
		||||
 | 
			
		||||
                    if (!logbuffer) {
 | 
			
		||||
                        av_log(NULL, AV_LOG_FATAL, "Error reading log file '%s' for pass-2 encoding\n",
 | 
			
		||||
                               logfilename);
 | 
			
		||||
                        exit_program(1);
 | 
			
		||||
                    }
 | 
			
		||||
                    video_enc->stats_in = logbuffer;
 | 
			
		||||
                }
 | 
			
		||||
                if (video_enc->flags & AV_CODEC_FLAG_PASS1) {
 | 
			
		||||
                    f = av_fopen_utf8(logfilename, "wb");
 | 
			
		||||
                    if (!f) {
 | 
			
		||||
                        av_log(NULL, AV_LOG_FATAL,
 | 
			
		||||
                               "Cannot write log file '%s' for pass-1 encoding: %s\n",
 | 
			
		||||
                               logfilename, strerror(errno));
 | 
			
		||||
                        exit_program(1);
 | 
			
		||||
                    }
 | 
			
		||||
                    ost->logfile = f;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        MATCH_PER_STREAM_OPT(forced_key_frames, str, ost->forced_keyframes, oc, st);
 | 
			
		||||
        if (ost->forced_keyframes)
 | 
			
		||||
            ost->forced_keyframes = av_strdup(ost->forced_keyframes);
 | 
			
		||||
@@ -1637,19 +1505,6 @@ static OutputStream *new_data_stream(OptionsContext *o, AVFormatContext *oc, int
 | 
			
		||||
    return ost;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static OutputStream *new_unknown_stream(OptionsContext *o, AVFormatContext *oc, int source_index)
 | 
			
		||||
{
 | 
			
		||||
    OutputStream *ost;
 | 
			
		||||
 | 
			
		||||
    ost = new_output_stream(o, oc, AVMEDIA_TYPE_UNKNOWN, source_index);
 | 
			
		||||
    if (!ost->stream_copy) {
 | 
			
		||||
        av_log(NULL, AV_LOG_FATAL, "Unknown stream encoding not supported yet (only streamcopy)\n");
 | 
			
		||||
        exit_program(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return ost;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static OutputStream *new_attachment_stream(OptionsContext *o, AVFormatContext *oc, int source_index)
 | 
			
		||||
{
 | 
			
		||||
    OutputStream *ost = new_output_stream(o, oc, AVMEDIA_TYPE_ATTACHMENT, source_index);
 | 
			
		||||
@@ -1765,36 +1620,27 @@ static int read_ffserver_streams(OptionsContext *o, AVFormatContext *s, const ch
 | 
			
		||||
        AVStream *st;
 | 
			
		||||
        OutputStream *ost;
 | 
			
		||||
        AVCodec *codec;
 | 
			
		||||
        const char *enc_config;
 | 
			
		||||
        AVCodecContext *avctx;
 | 
			
		||||
 | 
			
		||||
        codec = avcodec_find_encoder(ic->streams[i]->codec->codec_id);
 | 
			
		||||
        if (!codec) {
 | 
			
		||||
            av_log(s, AV_LOG_ERROR, "no encoder found for codec id %i\n", ic->streams[i]->codec->codec_id);
 | 
			
		||||
            return AVERROR(EINVAL);
 | 
			
		||||
        }
 | 
			
		||||
        if (codec->type == AVMEDIA_TYPE_AUDIO)
 | 
			
		||||
            opt_audio_codec(o, "c:a", codec->name);
 | 
			
		||||
        else if (codec->type == AVMEDIA_TYPE_VIDEO)
 | 
			
		||||
            opt_video_codec(o, "c:v", codec->name);
 | 
			
		||||
        ost   = new_output_stream(o, s, codec->type, -1);
 | 
			
		||||
        st    = ost->st;
 | 
			
		||||
        avctx = st->codec;
 | 
			
		||||
        ost->enc = codec;
 | 
			
		||||
 | 
			
		||||
        avcodec_get_context_defaults3(st->codec, codec);
 | 
			
		||||
        enc_config = av_stream_get_recommended_encoder_configuration(ic->streams[i]);
 | 
			
		||||
        if (enc_config) {
 | 
			
		||||
            AVDictionary *opts = NULL;
 | 
			
		||||
            av_dict_parse_string(&opts, enc_config, "=", ",", 0);
 | 
			
		||||
            av_opt_set_dict2(st->codec, &opts, AV_OPT_SEARCH_CHILDREN);
 | 
			
		||||
            av_dict_free(&opts);
 | 
			
		||||
        }
 | 
			
		||||
        // FIXME: a more elegant solution is needed
 | 
			
		||||
        memcpy(st, ic->streams[i], sizeof(AVStream));
 | 
			
		||||
        st->cur_dts = 0;
 | 
			
		||||
        st->info = av_malloc(sizeof(*st->info));
 | 
			
		||||
        memcpy(st->info, ic->streams[i]->info, sizeof(*st->info));
 | 
			
		||||
        st->codec= avctx;
 | 
			
		||||
        avcodec_copy_context(st->codec, ic->streams[i]->codec);
 | 
			
		||||
 | 
			
		||||
        if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO && !ost->stream_copy)
 | 
			
		||||
            choose_sample_fmt(st, codec);
 | 
			
		||||
        else if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO && !ost->stream_copy)
 | 
			
		||||
            choose_pixel_fmt(st, st->codec, codec, st->codec->pix_fmt);
 | 
			
		||||
        avcodec_copy_context(ost->enc_ctx, st->codec);
 | 
			
		||||
        if (enc_config)
 | 
			
		||||
            av_dict_parse_string(&ost->encoder_opts, enc_config, "=", ",", 0);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    avformat_close_input(&ic);
 | 
			
		||||
@@ -1806,7 +1652,8 @@ static void init_output_filter(OutputFilter *ofilter, OptionsContext *o,
 | 
			
		||||
{
 | 
			
		||||
    OutputStream *ost;
 | 
			
		||||
 | 
			
		||||
    switch (ofilter->type) {
 | 
			
		||||
    switch (avfilter_pad_get_type(ofilter->out_tmp->filter_ctx->output_pads,
 | 
			
		||||
                                  ofilter->out_tmp->pad_idx)) {
 | 
			
		||||
    case AVMEDIA_TYPE_VIDEO: ost = new_video_stream(o, oc, -1); break;
 | 
			
		||||
    case AVMEDIA_TYPE_AUDIO: ost = new_audio_stream(o, oc, -1); break;
 | 
			
		||||
    default:
 | 
			
		||||
@@ -1839,21 +1686,13 @@ static void init_output_filter(OutputFilter *ofilter, OptionsContext *o,
 | 
			
		||||
        exit_program(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (configure_output_filter(ofilter->graph, ofilter, ofilter->out_tmp) < 0) {
 | 
			
		||||
        av_log(NULL, AV_LOG_FATAL, "Error configuring filter.\n");
 | 
			
		||||
        exit_program(1);
 | 
			
		||||
    }
 | 
			
		||||
    avfilter_inout_free(&ofilter->out_tmp);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int init_complex_filters(void)
 | 
			
		||||
{
 | 
			
		||||
    int i, ret = 0;
 | 
			
		||||
 | 
			
		||||
    for (i = 0; i < nb_filtergraphs; i++) {
 | 
			
		||||
        ret = init_complex_filtergraph(filtergraphs[i]);
 | 
			
		||||
        if (ret < 0)
 | 
			
		||||
            return ret;
 | 
			
		||||
    }
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int configure_complex_filters(void)
 | 
			
		||||
{
 | 
			
		||||
    int i, ret = 0;
 | 
			
		||||
@@ -1876,6 +1715,10 @@ static int open_output_file(OptionsContext *o, const char *filename)
 | 
			
		||||
    AVDictionary *unused_opts = NULL;
 | 
			
		||||
    AVDictionaryEntry *e = NULL;
 | 
			
		||||
 | 
			
		||||
    if (configure_complex_filters() < 0) {
 | 
			
		||||
        av_log(NULL, AV_LOG_FATAL, "Error configuring filters.\n");
 | 
			
		||||
        exit_program(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (o->stop_time != INT64_MAX && o->recording_time != INT64_MAX) {
 | 
			
		||||
        o->stop_time = INT64_MAX;
 | 
			
		||||
@@ -1885,8 +1728,8 @@ static int open_output_file(OptionsContext *o, const char *filename)
 | 
			
		||||
    if (o->stop_time != INT64_MAX && o->recording_time == INT64_MAX) {
 | 
			
		||||
        int64_t start_time = o->start_time == AV_NOPTS_VALUE ? 0 : o->start_time;
 | 
			
		||||
        if (o->stop_time <= start_time) {
 | 
			
		||||
            av_log(NULL, AV_LOG_ERROR, "-to value smaller than -ss; aborting.\n");
 | 
			
		||||
            exit_program(1);
 | 
			
		||||
            av_log(NULL, AV_LOG_WARNING, "-to value smaller than -ss; ignoring -to.\n");
 | 
			
		||||
            o->stop_time = INT64_MAX;
 | 
			
		||||
        } else {
 | 
			
		||||
            o->recording_time = o->stop_time - start_time;
 | 
			
		||||
        }
 | 
			
		||||
@@ -1930,7 +1773,8 @@ static int open_output_file(OptionsContext *o, const char *filename)
 | 
			
		||||
            if (!ofilter->out_tmp || ofilter->out_tmp->name)
 | 
			
		||||
                continue;
 | 
			
		||||
 | 
			
		||||
            switch (ofilter->type) {
 | 
			
		||||
            switch (avfilter_pad_get_type(ofilter->out_tmp->filter_ctx->output_pads,
 | 
			
		||||
                                          ofilter->out_tmp->pad_idx)) {
 | 
			
		||||
            case AVMEDIA_TYPE_VIDEO:    o->video_disable    = 1; break;
 | 
			
		||||
            case AVMEDIA_TYPE_AUDIO:    o->audio_disable    = 1; break;
 | 
			
		||||
            case AVMEDIA_TYPE_SUBTITLE: o->subtitle_disable = 1; break;
 | 
			
		||||
@@ -1989,7 +1833,7 @@ static int open_output_file(OptionsContext *o, const char *filename)
 | 
			
		||||
            for (i = 0; i < nb_input_streams; i++) {
 | 
			
		||||
                int new_area;
 | 
			
		||||
                ist = input_streams[i];
 | 
			
		||||
                new_area = ist->st->codec->width * ist->st->codec->height + 100000000*!!ist->st->codec_info_nb_frames;
 | 
			
		||||
                new_area = ist->st->codec->width * ist->st->codec->height;
 | 
			
		||||
                if((qcr!=MKTAG('A', 'P', 'I', 'C')) && (ist->st->disposition & AV_DISPOSITION_ATTACHED_PIC))
 | 
			
		||||
                    new_area = 1;
 | 
			
		||||
                if (ist->st->codec->codec_type == AVMEDIA_TYPE_VIDEO &&
 | 
			
		||||
@@ -2006,14 +1850,12 @@ static int open_output_file(OptionsContext *o, const char *filename)
 | 
			
		||||
 | 
			
		||||
        /* audio: most channels */
 | 
			
		||||
        if (!o->audio_disable && av_guess_codec(oc->oformat, NULL, filename, NULL, AVMEDIA_TYPE_AUDIO) != AV_CODEC_ID_NONE) {
 | 
			
		||||
            int best_score = 0, idx = -1;
 | 
			
		||||
            int channels = 0, idx = -1;
 | 
			
		||||
            for (i = 0; i < nb_input_streams; i++) {
 | 
			
		||||
                int score;
 | 
			
		||||
                ist = input_streams[i];
 | 
			
		||||
                score = ist->st->codec->channels + 100000000*!!ist->st->codec_info_nb_frames;
 | 
			
		||||
                if (ist->st->codec->codec_type == AVMEDIA_TYPE_AUDIO &&
 | 
			
		||||
                    score > best_score) {
 | 
			
		||||
                    best_score = score;
 | 
			
		||||
                    ist->st->codec->channels > channels) {
 | 
			
		||||
                    channels = ist->st->codec->channels;
 | 
			
		||||
                    idx = i;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
@@ -2049,15 +1891,7 @@ static int open_output_file(OptionsContext *o, const char *filename)
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
        }
 | 
			
		||||
        /* Data only if codec id match */
 | 
			
		||||
        if (!o->data_disable ) {
 | 
			
		||||
            enum AVCodecID codec_id = av_guess_codec(oc->oformat, NULL, filename, NULL, AVMEDIA_TYPE_DATA);
 | 
			
		||||
            for (i = 0; codec_id != AV_CODEC_ID_NONE && i < nb_input_streams; i++) {
 | 
			
		||||
                if (input_streams[i]->st->codec->codec_type == AVMEDIA_TYPE_DATA
 | 
			
		||||
                    && input_streams[i]->st->codec->codec_id == codec_id )
 | 
			
		||||
                    new_data_stream(o, oc, i);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        /* do something with data? */
 | 
			
		||||
    } else {
 | 
			
		||||
        for (i = 0; i < o->nb_stream_maps; i++) {
 | 
			
		||||
            StreamMap *map = &o->stream_maps[i];
 | 
			
		||||
@@ -2100,34 +1934,18 @@ loop_end:
 | 
			
		||||
                if(o->    data_disable && ist->st->codec->codec_type == AVMEDIA_TYPE_DATA)
 | 
			
		||||
                    continue;
 | 
			
		||||
 | 
			
		||||
                ost = NULL;
 | 
			
		||||
                switch (ist->st->codec->codec_type) {
 | 
			
		||||
                case AVMEDIA_TYPE_VIDEO:      ost = new_video_stream     (o, oc, src_idx); break;
 | 
			
		||||
                case AVMEDIA_TYPE_AUDIO:      ost = new_audio_stream     (o, oc, src_idx); break;
 | 
			
		||||
                case AVMEDIA_TYPE_SUBTITLE:   ost = new_subtitle_stream  (o, oc, src_idx); break;
 | 
			
		||||
                case AVMEDIA_TYPE_DATA:       ost = new_data_stream      (o, oc, src_idx); break;
 | 
			
		||||
                case AVMEDIA_TYPE_ATTACHMENT: ost = new_attachment_stream(o, oc, src_idx); break;
 | 
			
		||||
                case AVMEDIA_TYPE_UNKNOWN:
 | 
			
		||||
                    if (copy_unknown_streams) {
 | 
			
		||||
                        ost = new_unknown_stream   (o, oc, src_idx);
 | 
			
		||||
                        break;
 | 
			
		||||
                    }
 | 
			
		||||
                default:
 | 
			
		||||
                    av_log(NULL, ignore_unknown_streams ? AV_LOG_WARNING : AV_LOG_FATAL,
 | 
			
		||||
                           "Cannot map stream #%d:%d - unsupported type.\n",
 | 
			
		||||
                    av_log(NULL, AV_LOG_FATAL, "Cannot map stream #%d:%d - unsupported type.\n",
 | 
			
		||||
                           map->file_index, map->stream_index);
 | 
			
		||||
                    if (!ignore_unknown_streams) {
 | 
			
		||||
                        av_log(NULL, AV_LOG_FATAL,
 | 
			
		||||
                               "If you want unsupported types ignored instead "
 | 
			
		||||
                               "of failing, please use the -ignore_unknown option\n"
 | 
			
		||||
                               "If you want them copied, please use -copy_unknown\n");
 | 
			
		||||
                    exit_program(1);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
                if (ost)
 | 
			
		||||
                    ost->sync_ist = input_streams[  input_files[map->sync_file_index]->ist_index
 | 
			
		||||
                                                  + map->sync_stream_index];
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -2156,15 +1974,15 @@ loop_end:
 | 
			
		||||
        avio_read(pb, attachment, len);
 | 
			
		||||
 | 
			
		||||
        ost = new_attachment_stream(o, oc, -1);
 | 
			
		||||
        ost->stream_copy               = 1;
 | 
			
		||||
        ost->stream_copy               = 0;
 | 
			
		||||
        ost->attachment_filename       = o->attachments[i];
 | 
			
		||||
        ost->finished                  = 1;
 | 
			
		||||
        ost->st->codec->extradata      = attachment;
 | 
			
		||||
        ost->st->codec->extradata_size = len;
 | 
			
		||||
        ost->enc_ctx->extradata      = attachment;
 | 
			
		||||
        ost->enc_ctx->extradata_size = len;
 | 
			
		||||
 | 
			
		||||
        p = strrchr(o->attachments[i], '/');
 | 
			
		||||
        av_dict_set(&ost->st->metadata, "filename", (p && *p) ? p + 1 : o->attachments[i], AV_DICT_DONT_OVERWRITE);
 | 
			
		||||
        avio_closep(&pb);
 | 
			
		||||
        avio_close(pb);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    for (i = nb_output_streams - oc->nb_streams; i < nb_output_streams; i++) { //for all streams of this output file
 | 
			
		||||
@@ -2178,12 +1996,6 @@ loop_end:
 | 
			
		||||
                exit_program(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (!oc->nb_streams && !(oc->oformat->flags & AVFMT_NOSTREAMS)) {
 | 
			
		||||
        av_dump_format(oc, nb_output_files - 1, oc->filename, 1);
 | 
			
		||||
        av_log(NULL, AV_LOG_ERROR, "Output file #%d does not contain any stream\n", nb_output_files - 1);
 | 
			
		||||
        exit_program(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* check if all codec options have been used */
 | 
			
		||||
    unused_opts = strip_specifiers(o->g->codec_opts);
 | 
			
		||||
    for (i = of->ost_index; i < nb_output_streams; i++) {
 | 
			
		||||
@@ -2226,17 +2038,6 @@ loop_end:
 | 
			
		||||
    }
 | 
			
		||||
    av_dict_free(&unused_opts);
 | 
			
		||||
 | 
			
		||||
    /* set the encoding/decoding_needed flags */
 | 
			
		||||
    for (i = of->ost_index; i < nb_output_streams; i++) {
 | 
			
		||||
        OutputStream *ost = output_streams[i];
 | 
			
		||||
 | 
			
		||||
        ost->encoding_needed = !ost->stream_copy;
 | 
			
		||||
        if (ost->encoding_needed && ost->source_index >= 0) {
 | 
			
		||||
            InputStream *ist = input_streams[ost->source_index];
 | 
			
		||||
            ist->decoding_needed |= DECODING_FOR_OST;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* check filename in case of an image number is expected */
 | 
			
		||||
    if (oc->oformat->flags & AVFMT_NEEDNUMBER) {
 | 
			
		||||
        if (!av_filename_number_test(oc->filename)) {
 | 
			
		||||
@@ -2245,12 +2046,6 @@ loop_end:
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (!(oc->oformat->flags & AVFMT_NOSTREAMS) && !input_stream_potentially_available) {
 | 
			
		||||
        av_log(NULL, AV_LOG_ERROR,
 | 
			
		||||
               "No input streams but output needs an input stream\n");
 | 
			
		||||
        exit_program(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (!(oc->oformat->flags & AVFMT_NOFILE)) {
 | 
			
		||||
        /* test if it already exists to avoid losing precious files */
 | 
			
		||||
        assert_file_overwrite(filename);
 | 
			
		||||
@@ -2319,11 +2114,8 @@ loop_end:
 | 
			
		||||
                continue;
 | 
			
		||||
            ist = input_streams[output_streams[i]->source_index];
 | 
			
		||||
            av_dict_copy(&output_streams[i]->st->metadata, ist->st->metadata, AV_DICT_DONT_OVERWRITE);
 | 
			
		||||
            if (!output_streams[i]->stream_copy) {
 | 
			
		||||
            if (!output_streams[i]->stream_copy)
 | 
			
		||||
                av_dict_set(&output_streams[i]->st->metadata, "encoder", NULL, 0);
 | 
			
		||||
                if (ist->autorotate)
 | 
			
		||||
                    av_dict_set(&output_streams[i]->st->metadata, "rotate", NULL, 0);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    /* process manually set metadata */
 | 
			
		||||
@@ -2332,7 +2124,6 @@ loop_end:
 | 
			
		||||
        char type, *val;
 | 
			
		||||
        const char *stream_spec;
 | 
			
		||||
        int index = 0, j, ret = 0;
 | 
			
		||||
        char now_time[256];
 | 
			
		||||
 | 
			
		||||
        val = strchr(o->metadata[i].u.str, '=');
 | 
			
		||||
        if (!val) {
 | 
			
		||||
@@ -2342,26 +2133,11 @@ loop_end:
 | 
			
		||||
        }
 | 
			
		||||
        *val++ = 0;
 | 
			
		||||
 | 
			
		||||
        if (!strcmp(o->metadata[i].u.str, "creation_time") &&
 | 
			
		||||
            !strcmp(val, "now")) {
 | 
			
		||||
            time_t now = time(0);
 | 
			
		||||
            struct tm *ptm, tmbuf;
 | 
			
		||||
            ptm = localtime_r(&now, &tmbuf);
 | 
			
		||||
            if (ptm) {
 | 
			
		||||
                if (strftime(now_time, sizeof(now_time), "%Y-%m-%d %H:%M:%S", ptm))
 | 
			
		||||
                    val = now_time;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        parse_meta_type(o->metadata[i].specifier, &type, &index, &stream_spec);
 | 
			
		||||
        if (type == 's') {
 | 
			
		||||
            for (j = 0; j < oc->nb_streams; j++) {
 | 
			
		||||
                ost = output_streams[nb_output_streams - oc->nb_streams + j];
 | 
			
		||||
                if ((ret = check_stream_specifier(oc, oc->streams[j], stream_spec)) > 0) {
 | 
			
		||||
                    av_dict_set(&oc->streams[j]->metadata, o->metadata[i].u.str, *val ? val : NULL, 0);
 | 
			
		||||
                    if (!strcmp(o->metadata[i].u.str, "rotate")) {
 | 
			
		||||
                        ost->rotate_overridden = 1;
 | 
			
		||||
                    }
 | 
			
		||||
                } else if (ret < 0)
 | 
			
		||||
                    exit_program(1);
 | 
			
		||||
            }
 | 
			
		||||
@@ -2448,9 +2224,9 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
 | 
			
		||||
        opt_default(NULL, "g", norm == PAL ? "15" : "18");
 | 
			
		||||
 | 
			
		||||
        opt_default(NULL, "b:v", "1150000");
 | 
			
		||||
        opt_default(NULL, "maxrate:v", "1150000");
 | 
			
		||||
        opt_default(NULL, "minrate:v", "1150000");
 | 
			
		||||
        opt_default(NULL, "bufsize:v", "327680"); // 40*1024*8;
 | 
			
		||||
        opt_default(NULL, "maxrate", "1150000");
 | 
			
		||||
        opt_default(NULL, "minrate", "1150000");
 | 
			
		||||
        opt_default(NULL, "bufsize", "327680"); // 40*1024*8;
 | 
			
		||||
 | 
			
		||||
        opt_default(NULL, "b:a", "224000");
 | 
			
		||||
        parse_option(o, "ar", "44100", options);
 | 
			
		||||
@@ -2477,9 +2253,9 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
 | 
			
		||||
        opt_default(NULL, "g", norm == PAL ? "15" : "18");
 | 
			
		||||
 | 
			
		||||
        opt_default(NULL, "b:v", "2040000");
 | 
			
		||||
        opt_default(NULL, "maxrate:v", "2516000");
 | 
			
		||||
        opt_default(NULL, "minrate:v", "0"); // 1145000;
 | 
			
		||||
        opt_default(NULL, "bufsize:v", "1835008"); // 224*1024*8;
 | 
			
		||||
        opt_default(NULL, "maxrate", "2516000");
 | 
			
		||||
        opt_default(NULL, "minrate", "0"); // 1145000;
 | 
			
		||||
        opt_default(NULL, "bufsize", "1835008"); // 224*1024*8;
 | 
			
		||||
        opt_default(NULL, "scan_offset", "1");
 | 
			
		||||
 | 
			
		||||
        opt_default(NULL, "b:a", "224000");
 | 
			
		||||
@@ -2499,9 +2275,9 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
 | 
			
		||||
        opt_default(NULL, "g", norm == PAL ? "15" : "18");
 | 
			
		||||
 | 
			
		||||
        opt_default(NULL, "b:v", "6000000");
 | 
			
		||||
        opt_default(NULL, "maxrate:v", "9000000");
 | 
			
		||||
        opt_default(NULL, "minrate:v", "0"); // 1500000;
 | 
			
		||||
        opt_default(NULL, "bufsize:v", "1835008"); // 224*1024*8;
 | 
			
		||||
        opt_default(NULL, "maxrate", "9000000");
 | 
			
		||||
        opt_default(NULL, "minrate", "0"); // 1500000;
 | 
			
		||||
        opt_default(NULL, "bufsize", "1835008"); // 224*1024*8;
 | 
			
		||||
 | 
			
		||||
        opt_default(NULL, "packetsize", "2048");  // from www.mpucoder.com: DVD sectors contain 2048 bytes of data, this is also the size of one pack.
 | 
			
		||||
        opt_default(NULL, "muxrate", "10080000"); // from mplex project: data_rate = 1260000. mux_rate = data_rate * 8
 | 
			
		||||
@@ -2545,11 +2321,6 @@ static int opt_vstats(void *optctx, const char *opt, const char *arg)
 | 
			
		||||
    time_t today2 = time(NULL);
 | 
			
		||||
    struct tm *today = localtime(&today2);
 | 
			
		||||
 | 
			
		||||
    if (!today) { // maybe tomorrow
 | 
			
		||||
        av_log(NULL, AV_LOG_FATAL, "Unable to get current time: %s\n", strerror(errno));
 | 
			
		||||
        exit_program(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min,
 | 
			
		||||
             today->tm_sec);
 | 
			
		||||
    return opt_vstats_file(NULL, opt, filename);
 | 
			
		||||
@@ -2779,9 +2550,6 @@ static int opt_filter_complex(void *optctx, const char *opt, const char *arg)
 | 
			
		||||
    filtergraphs[nb_filtergraphs - 1]->graph_desc = av_strdup(arg);
 | 
			
		||||
    if (!filtergraphs[nb_filtergraphs - 1]->graph_desc)
 | 
			
		||||
        return AVERROR(ENOMEM);
 | 
			
		||||
 | 
			
		||||
    input_stream_potentially_available = 1;
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -2796,9 +2564,6 @@ static int opt_filter_complex_script(void *optctx, const char *opt, const char *
 | 
			
		||||
        return AVERROR(ENOMEM);
 | 
			
		||||
    filtergraphs[nb_filtergraphs - 1]->index      = nb_filtergraphs - 1;
 | 
			
		||||
    filtergraphs[nb_filtergraphs - 1]->graph_desc = graph_desc;
 | 
			
		||||
 | 
			
		||||
    input_stream_potentially_available = 1;
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -2950,13 +2715,6 @@ int ffmpeg_parse_options(int argc, char **argv)
 | 
			
		||||
        goto fail;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* create the complex filtergraphs */
 | 
			
		||||
    ret = init_complex_filters();
 | 
			
		||||
    if (ret < 0) {
 | 
			
		||||
        av_log(NULL, AV_LOG_FATAL, "Error initializing complex filters.\n");
 | 
			
		||||
        goto fail;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* open output files */
 | 
			
		||||
    ret = open_files(&octx.groups[GROUP_OUTFILE], "output", open_output_file);
 | 
			
		||||
    if (ret < 0) {
 | 
			
		||||
@@ -2964,13 +2722,6 @@ int ffmpeg_parse_options(int argc, char **argv)
 | 
			
		||||
        goto fail;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* configure the complex filtergraphs */
 | 
			
		||||
    ret = configure_complex_filters();
 | 
			
		||||
    if (ret < 0) {
 | 
			
		||||
        av_log(NULL, AV_LOG_FATAL, "Error configuring complex filters.\n");
 | 
			
		||||
        goto fail;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
fail:
 | 
			
		||||
    uninit_parse_context(&octx);
 | 
			
		||||
    if (ret < 0) {
 | 
			
		||||
@@ -3008,10 +2759,6 @@ const OptionDef options[] = {
 | 
			
		||||
        "overwrite output files" },
 | 
			
		||||
    { "n",              OPT_BOOL,                                    {              &no_file_overwrite },
 | 
			
		||||
        "never overwrite output files" },
 | 
			
		||||
    { "ignore_unknown", OPT_BOOL,                                    {              &ignore_unknown_streams },
 | 
			
		||||
        "Ignore unknown stream types" },
 | 
			
		||||
    { "copy_unknown",   OPT_BOOL | OPT_EXPERT,                       {              ©_unknown_streams },
 | 
			
		||||
        "Copy unknown stream types" },
 | 
			
		||||
    { "c",              HAS_ARG | OPT_STRING | OPT_SPEC |
 | 
			
		||||
                        OPT_INPUT | OPT_OUTPUT,                      { .off       = OFFSET(codec_names) },
 | 
			
		||||
        "codec name", "codec" },
 | 
			
		||||
@@ -3045,12 +2792,6 @@ const OptionDef options[] = {
 | 
			
		||||
    { "ss",             HAS_ARG | OPT_TIME | OPT_OFFSET |
 | 
			
		||||
                        OPT_INPUT | OPT_OUTPUT,                      { .off = OFFSET(start_time) },
 | 
			
		||||
        "set the start time offset", "time_off" },
 | 
			
		||||
    { "sseof",          HAS_ARG | OPT_TIME | OPT_OFFSET |
 | 
			
		||||
                        OPT_INPUT | OPT_OUTPUT,                      { .off = OFFSET(start_time_eof) },
 | 
			
		||||
        "set the start time offset relative to EOF", "time_off" },
 | 
			
		||||
    { "seek_timestamp", HAS_ARG | OPT_INT | OPT_OFFSET |
 | 
			
		||||
                        OPT_INPUT,                                   { .off = OFFSET(seek_timestamp) },
 | 
			
		||||
        "enable/disable seeking by timestamp with -ss" },
 | 
			
		||||
    { "accurate_seek",  OPT_BOOL | OPT_OFFSET | OPT_EXPERT |
 | 
			
		||||
                        OPT_INPUT,                                   { .off = OFFSET(accurate_seek) },
 | 
			
		||||
        "enable/disable accurate seeking with -ss" },
 | 
			
		||||
@@ -3060,13 +2801,13 @@ const OptionDef options[] = {
 | 
			
		||||
    { "itsscale",       HAS_ARG | OPT_DOUBLE | OPT_SPEC |
 | 
			
		||||
                        OPT_EXPERT | OPT_INPUT,                      { .off = OFFSET(ts_scale) },
 | 
			
		||||
        "set the input ts scale", "scale" },
 | 
			
		||||
    { "timestamp",      HAS_ARG | OPT_PERFILE | OPT_OUTPUT,          { .func_arg = opt_recording_timestamp },
 | 
			
		||||
    { "timestamp",      HAS_ARG | OPT_PERFILE,                       { .func_arg = opt_recording_timestamp },
 | 
			
		||||
        "set the recording timestamp ('now' to set the current time)", "time" },
 | 
			
		||||
    { "metadata",       HAS_ARG | OPT_STRING | OPT_SPEC | OPT_OUTPUT, { .off = OFFSET(metadata) },
 | 
			
		||||
        "add metadata", "string=string" },
 | 
			
		||||
    { "dframes",        HAS_ARG | OPT_PERFILE | OPT_EXPERT |
 | 
			
		||||
                        OPT_OUTPUT,                                  { .func_arg = opt_data_frames },
 | 
			
		||||
        "set the number of data frames to output", "number" },
 | 
			
		||||
        "set the number of data frames to record", "number" },
 | 
			
		||||
    { "benchmark",      OPT_BOOL | OPT_EXPERT,                       { &do_benchmark },
 | 
			
		||||
        "add timings for benchmarking" },
 | 
			
		||||
    { "benchmark_all",  OPT_BOOL | OPT_EXPERT,                       { &do_benchmark_all },
 | 
			
		||||
@@ -3085,20 +2826,16 @@ const OptionDef options[] = {
 | 
			
		||||
                        OPT_INPUT,                                   { .off = OFFSET(rate_emu) },
 | 
			
		||||
        "read input at native frame rate", "" },
 | 
			
		||||
    { "target",         HAS_ARG | OPT_PERFILE | OPT_OUTPUT,          { .func_arg = opt_target },
 | 
			
		||||
        "specify target file type (\"vcd\", \"svcd\", \"dvd\", \"dv\" or \"dv50\" "
 | 
			
		||||
        "with optional prefixes \"pal-\", \"ntsc-\" or \"film-\")", "type" },
 | 
			
		||||
        "specify target file type (\"vcd\", \"svcd\", \"dvd\","
 | 
			
		||||
        " \"dv\", \"dv50\", \"pal-vcd\", \"ntsc-svcd\", ...)", "type" },
 | 
			
		||||
    { "vsync",          HAS_ARG | OPT_EXPERT,                        { opt_vsync },
 | 
			
		||||
        "video sync method", "" },
 | 
			
		||||
    { "frame_drop_threshold", HAS_ARG | OPT_FLOAT | OPT_EXPERT,      { &frame_drop_threshold },
 | 
			
		||||
        "frame drop threshold", "" },
 | 
			
		||||
    { "async",          HAS_ARG | OPT_INT | OPT_EXPERT,              { &audio_sync_method },
 | 
			
		||||
        "audio sync method", "" },
 | 
			
		||||
    { "adrift_threshold", HAS_ARG | OPT_FLOAT | OPT_EXPERT,          { &audio_drift_threshold },
 | 
			
		||||
        "audio drift threshold", "threshold" },
 | 
			
		||||
    { "copyts",         OPT_BOOL | OPT_EXPERT,                       { ©_ts },
 | 
			
		||||
        "copy timestamps" },
 | 
			
		||||
    { "start_at_zero",  OPT_BOOL | OPT_EXPERT,                       { &start_at_zero },
 | 
			
		||||
        "shift input timestamps to start at 0 when using copyts" },
 | 
			
		||||
    { "copytb",         HAS_ARG | OPT_INT | OPT_EXPERT,              { ©_tb },
 | 
			
		||||
        "copy input stream time base when stream copying", "mode" },
 | 
			
		||||
    { "shortest",       OPT_BOOL | OPT_EXPERT | OPT_OFFSET |
 | 
			
		||||
@@ -3119,7 +2856,7 @@ const OptionDef options[] = {
 | 
			
		||||
    { "copypriorss",    OPT_INT | HAS_ARG | OPT_EXPERT | OPT_SPEC | OPT_OUTPUT,   { .off = OFFSET(copy_prior_start) },
 | 
			
		||||
        "copy or discard frames before start time" },
 | 
			
		||||
    { "frames",         OPT_INT64 | HAS_ARG | OPT_SPEC | OPT_OUTPUT, { .off = OFFSET(max_frames) },
 | 
			
		||||
        "set the number of frames to output", "number" },
 | 
			
		||||
        "set the number of frames to record", "number" },
 | 
			
		||||
    { "tag",            OPT_STRING | HAS_ARG | OPT_SPEC |
 | 
			
		||||
                        OPT_EXPERT | OPT_OUTPUT | OPT_INPUT,         { .off = OFFSET(codec_tags) },
 | 
			
		||||
        "force codec tag/fourcc", "fourcc/tag" },
 | 
			
		||||
@@ -3158,16 +2895,10 @@ const OptionDef options[] = {
 | 
			
		||||
    { "discard",        OPT_STRING | HAS_ARG | OPT_SPEC |
 | 
			
		||||
                        OPT_INPUT,                                   { .off = OFFSET(discard) },
 | 
			
		||||
        "discard", "" },
 | 
			
		||||
    { "disposition",    OPT_STRING | HAS_ARG | OPT_SPEC |
 | 
			
		||||
                        OPT_OUTPUT,                                  { .off = OFFSET(disposition) },
 | 
			
		||||
        "disposition", "" },
 | 
			
		||||
    { "thread_queue_size", HAS_ARG | OPT_INT | OPT_OFFSET | OPT_EXPERT | OPT_INPUT,
 | 
			
		||||
                                                                     { .off = OFFSET(thread_queue_size) },
 | 
			
		||||
        "set the maximum number of queued packets from the demuxer" },
 | 
			
		||||
 | 
			
		||||
    /* video options */
 | 
			
		||||
    { "vframes",      OPT_VIDEO | HAS_ARG  | OPT_PERFILE | OPT_OUTPUT,           { .func_arg = opt_video_frames },
 | 
			
		||||
        "set the number of video frames to output", "number" },
 | 
			
		||||
        "set the number of video frames to record", "number" },
 | 
			
		||||
    { "r",            OPT_VIDEO | HAS_ARG  | OPT_STRING | OPT_SPEC |
 | 
			
		||||
                      OPT_INPUT | OPT_OUTPUT,                                    { .off = OFFSET(frame_rates) },
 | 
			
		||||
        "set frame rate (Hz value, fraction or abbreviation)", "rate" },
 | 
			
		||||
@@ -3226,7 +2957,7 @@ const OptionDef options[] = {
 | 
			
		||||
                      OPT_INPUT | OPT_OUTPUT,                                    { .off = OFFSET(top_field_first) },
 | 
			
		||||
        "top=1/bottom=0/auto=-1 field first", "" },
 | 
			
		||||
    { "vtag",         OPT_VIDEO | HAS_ARG | OPT_EXPERT  | OPT_PERFILE |
 | 
			
		||||
                      OPT_INPUT | OPT_OUTPUT,                                    { .func_arg = opt_old2new },
 | 
			
		||||
                      OPT_OUTPUT,                                                { .func_arg = opt_old2new },
 | 
			
		||||
        "force video tag/fourcc", "fourcc/tag" },
 | 
			
		||||
    { "qphist",       OPT_VIDEO | OPT_BOOL | OPT_EXPERT ,                        { &qp_hist },
 | 
			
		||||
        "show QP histogram" },
 | 
			
		||||
@@ -3248,22 +2979,11 @@ const OptionDef options[] = {
 | 
			
		||||
        "use HW accelerated decoding", "hwaccel name" },
 | 
			
		||||
    { "hwaccel_device",   OPT_VIDEO | OPT_STRING | HAS_ARG | OPT_EXPERT |
 | 
			
		||||
                          OPT_SPEC | OPT_INPUT,                                  { .off = OFFSET(hwaccel_devices) },
 | 
			
		||||
        "select a device for HW acceleration", "devicename" },
 | 
			
		||||
#if HAVE_VDPAU_X11
 | 
			
		||||
    { "vdpau_api_ver", HAS_ARG | OPT_INT | OPT_EXPERT, { &vdpau_api_ver }, "" },
 | 
			
		||||
#endif
 | 
			
		||||
#if CONFIG_VDA || CONFIG_VIDEOTOOLBOX
 | 
			
		||||
    { "videotoolbox_pixfmt", HAS_ARG | OPT_STRING | OPT_EXPERT, { &videotoolbox_pixfmt}, "" },
 | 
			
		||||
#endif
 | 
			
		||||
    { "hwaccels",         OPT_EXIT,                                              { .func_arg = show_hwaccels },
 | 
			
		||||
        "show available HW acceleration methods" },
 | 
			
		||||
    { "autorotate",       HAS_ARG | OPT_BOOL | OPT_SPEC |
 | 
			
		||||
                          OPT_EXPERT | OPT_INPUT,                                { .off = OFFSET(autorotate) },
 | 
			
		||||
        "automatically insert correct rotate filters" },
 | 
			
		||||
        "select a device for HW acceleration" "devicename" },
 | 
			
		||||
 | 
			
		||||
    /* audio options */
 | 
			
		||||
    { "aframes",        OPT_AUDIO | HAS_ARG  | OPT_PERFILE | OPT_OUTPUT,           { .func_arg = opt_audio_frames },
 | 
			
		||||
        "set the number of audio frames to output", "number" },
 | 
			
		||||
        "set the number of audio frames to record", "number" },
 | 
			
		||||
    { "aq",             OPT_AUDIO | HAS_ARG  | OPT_PERFILE | OPT_OUTPUT,           { .func_arg = opt_audio_qscale },
 | 
			
		||||
        "set audio quality (codec-specific)", "quality", },
 | 
			
		||||
    { "ar",             OPT_AUDIO | HAS_ARG  | OPT_INT | OPT_SPEC |
 | 
			
		||||
@@ -3319,8 +3039,6 @@ const OptionDef options[] = {
 | 
			
		||||
        "set the initial demux-decode delay", "seconds" },
 | 
			
		||||
    { "override_ffserver", OPT_BOOL | OPT_EXPERT | OPT_OUTPUT, { &override_ffserver },
 | 
			
		||||
        "override the options from ffserver", "" },
 | 
			
		||||
    { "sdp_file", HAS_ARG | OPT_EXPERT | OPT_OUTPUT, { opt_sdp_file },
 | 
			
		||||
        "specify a file in which to print sdp information", "file" },
 | 
			
		||||
 | 
			
		||||
    { "bsf", HAS_ARG | OPT_STRING | OPT_SPEC | OPT_EXPERT | OPT_OUTPUT, { .off = OFFSET(bitstream_filters) },
 | 
			
		||||
        "A comma-separated list of bitstream filters", "bitstream_filters" },
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										134
									
								
								ffmpeg_vda.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										134
									
								
								ffmpeg_vda.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,134 @@
 | 
			
		||||
/*
 | 
			
		||||
 * This file is part of FFmpeg.
 | 
			
		||||
 *
 | 
			
		||||
 * FFmpeg is free software; you can redistribute it and/or
 | 
			
		||||
 * modify it under the terms of the GNU Lesser General Public
 | 
			
		||||
 * License as published by the Free Software Foundation; either
 | 
			
		||||
 * version 2.1 of the License, or (at your option) any later version.
 | 
			
		||||
 *
 | 
			
		||||
 * FFmpeg is distributed in the hope that it will be useful,
 | 
			
		||||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 | 
			
		||||
 * Lesser General Public License for more details.
 | 
			
		||||
 *
 | 
			
		||||
 * You should have received a copy of the GNU Lesser General Public
 | 
			
		||||
 * License along with FFmpeg; if not, write to the Free Software
 | 
			
		||||
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "libavcodec/avcodec.h"
 | 
			
		||||
#include "libavcodec/vda.h"
 | 
			
		||||
#include "libavutil/imgutils.h"
 | 
			
		||||
 | 
			
		||||
#include "ffmpeg.h"
 | 
			
		||||
 | 
			
		||||
typedef struct VDAContext {
 | 
			
		||||
    AVFrame *tmp_frame;
 | 
			
		||||
} VDAContext;
 | 
			
		||||
 | 
			
		||||
static int vda_retrieve_data(AVCodecContext *s, AVFrame *frame)
 | 
			
		||||
{
 | 
			
		||||
    InputStream *ist = s->opaque;
 | 
			
		||||
    VDAContext  *vda = ist->hwaccel_ctx;
 | 
			
		||||
    CVPixelBufferRef pixbuf = (CVPixelBufferRef)frame->data[3];
 | 
			
		||||
    OSType pixel_format = CVPixelBufferGetPixelFormatType(pixbuf);
 | 
			
		||||
    CVReturn err;
 | 
			
		||||
    uint8_t *data[4] = { 0 };
 | 
			
		||||
    int linesize[4] = { 0 };
 | 
			
		||||
    int planes, ret, i;
 | 
			
		||||
 | 
			
		||||
    av_frame_unref(vda->tmp_frame);
 | 
			
		||||
 | 
			
		||||
    switch (pixel_format) {
 | 
			
		||||
    case kCVPixelFormatType_420YpCbCr8Planar: vda->tmp_frame->format = AV_PIX_FMT_YUV420P; break;
 | 
			
		||||
    case kCVPixelFormatType_422YpCbCr8:       vda->tmp_frame->format = AV_PIX_FMT_UYVY422; break;
 | 
			
		||||
    default:
 | 
			
		||||
        av_log(NULL, AV_LOG_ERROR,
 | 
			
		||||
               "Unsupported pixel format: %u\n", pixel_format);
 | 
			
		||||
        return AVERROR(ENOSYS);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    vda->tmp_frame->width  = frame->width;
 | 
			
		||||
    vda->tmp_frame->height = frame->height;
 | 
			
		||||
    ret = av_frame_get_buffer(vda->tmp_frame, 32);
 | 
			
		||||
    if (ret < 0)
 | 
			
		||||
        return ret;
 | 
			
		||||
 | 
			
		||||
    err = CVPixelBufferLockBaseAddress(pixbuf, kCVPixelBufferLock_ReadOnly);
 | 
			
		||||
    if (err != kCVReturnSuccess) {
 | 
			
		||||
        av_log(NULL, AV_LOG_ERROR, "Error locking the pixel buffer.\n");
 | 
			
		||||
        return AVERROR_UNKNOWN;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (CVPixelBufferIsPlanar(pixbuf)) {
 | 
			
		||||
 | 
			
		||||
        planes = CVPixelBufferGetPlaneCount(pixbuf);
 | 
			
		||||
        for (i = 0; i < planes; i++) {
 | 
			
		||||
            data[i]     = CVPixelBufferGetBaseAddressOfPlane(pixbuf, i);
 | 
			
		||||
            linesize[i] = CVPixelBufferGetBytesPerRowOfPlane(pixbuf, i);
 | 
			
		||||
        }
 | 
			
		||||
    } else {
 | 
			
		||||
        data[0] = CVPixelBufferGetBaseAddress(pixbuf);
 | 
			
		||||
        linesize[0] = CVPixelBufferGetBytesPerRow(pixbuf);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    av_image_copy(vda->tmp_frame->data, vda->tmp_frame->linesize,
 | 
			
		||||
                  data, linesize, vda->tmp_frame->format,
 | 
			
		||||
                  frame->width, frame->height);
 | 
			
		||||
 | 
			
		||||
    ret = av_frame_copy_props(vda->tmp_frame, frame);
 | 
			
		||||
    if (ret < 0)
 | 
			
		||||
        return ret;
 | 
			
		||||
 | 
			
		||||
    av_frame_unref(frame);
 | 
			
		||||
    av_frame_move_ref(frame, vda->tmp_frame);
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void vda_uninit(AVCodecContext *s)
 | 
			
		||||
{
 | 
			
		||||
    InputStream *ist = s->opaque;
 | 
			
		||||
    VDAContext  *vda = ist->hwaccel_ctx;
 | 
			
		||||
 | 
			
		||||
    ist->hwaccel_uninit        = NULL;
 | 
			
		||||
    ist->hwaccel_retrieve_data = NULL;
 | 
			
		||||
 | 
			
		||||
    av_frame_free(&vda->tmp_frame);
 | 
			
		||||
 | 
			
		||||
    av_vda_default_free(s);
 | 
			
		||||
    av_freep(&ist->hwaccel_ctx);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int vda_init(AVCodecContext *s)
 | 
			
		||||
{
 | 
			
		||||
    InputStream *ist = s->opaque;
 | 
			
		||||
    int loglevel = (ist->hwaccel_id == HWACCEL_AUTO) ? AV_LOG_VERBOSE : AV_LOG_ERROR;
 | 
			
		||||
    VDAContext *vda;
 | 
			
		||||
    int ret;
 | 
			
		||||
 | 
			
		||||
    vda = av_mallocz(sizeof(*vda));
 | 
			
		||||
    if (!vda)
 | 
			
		||||
        return AVERROR(ENOMEM);
 | 
			
		||||
 | 
			
		||||
    ist->hwaccel_ctx           = vda;
 | 
			
		||||
    ist->hwaccel_uninit        = vda_uninit;
 | 
			
		||||
    ist->hwaccel_retrieve_data = vda_retrieve_data;
 | 
			
		||||
 | 
			
		||||
    vda->tmp_frame = av_frame_alloc();
 | 
			
		||||
    if (!vda->tmp_frame) {
 | 
			
		||||
        ret = AVERROR(ENOMEM);
 | 
			
		||||
        goto fail;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    ret = av_vda_default_init(s);
 | 
			
		||||
    if (ret < 0) {
 | 
			
		||||
        av_log(NULL, loglevel, "Error creating VDA decoder.\n");
 | 
			
		||||
        goto fail;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
fail:
 | 
			
		||||
    vda_uninit(s);
 | 
			
		||||
    return ret;
 | 
			
		||||
}
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user