Compare commits
	
		
			260 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					9eaec5b8f0 | ||
| 
						 | 
					48ef116631 | ||
| 
						 | 
					cc511b36f3 | ||
| 
						 | 
					85b22a8924 | ||
| 
						 | 
					6ec1d3b3ba | ||
| 
						 | 
					d843e7dc94 | ||
| 
						 | 
					acc665f22c | ||
| 
						 | 
					4c223fe519 | ||
| 
						 | 
					5a9588b088 | ||
| 
						 | 
					02cd93f4ad | ||
| 
						 | 
					f8a31e2113 | ||
| 
						 | 
					8ba939fcda | ||
| 
						 | 
					79674d27d9 | ||
| 
						 | 
					b061ee9a5d | ||
| 
						 | 
					baba561c0b | ||
| 
						 | 
					f6147effd2 | ||
| 
						 | 
					b990187f99 | ||
| 
						 | 
					ae6c57859c | ||
| 
						 | 
					5629c39101 | ||
| 
						 | 
					7867cbaf6c | ||
| 
						 | 
					0bf8e22cdb | ||
| 
						 | 
					7944a87ba8 | ||
| 
						 | 
					a55db1fc49 | ||
| 
						 | 
					123e925956 | ||
| 
						 | 
					96c6b3a11c | ||
| 
						 | 
					5e3cd42b6d | ||
| 
						 | 
					f73106256d | ||
| 
						 | 
					782c3ab777 | ||
| 
						 | 
					4b2e02a4c4 | ||
| 
						 | 
					79fbcd9f03 | ||
| 
						 | 
					468cc41d6d | ||
| 
						 | 
					6c9b404dba | ||
| 
						 | 
					b2ac7e585e | ||
| 
						 | 
					8bb3ba5541 | ||
| 
						 | 
					5a92aa378d | ||
| 
						 | 
					c4e8c99507 | ||
| 
						 | 
					479869c499 | ||
| 
						 | 
					ec4979e16e | ||
| 
						 | 
					056c909d9d | ||
| 
						 | 
					bde4b66063 | ||
| 
						 | 
					0fda37cff9 | ||
| 
						 | 
					2e693be7e9 | ||
| 
						 | 
					8e101086eb | ||
| 
						 | 
					f13de3c653 | ||
| 
						 | 
					1eb7872238 | ||
| 
						 | 
					15df4428d2 | ||
| 
						 | 
					ec0124203c | ||
| 
						 | 
					6b01bcebb9 | ||
| 
						 | 
					efd453d82d | ||
| 
						 | 
					7209c2b13f | ||
| 
						 | 
					7ee536e87a | ||
| 
						 | 
					665421f3b1 | ||
| 
						 | 
					3eb6983dbc | ||
| 
						 | 
					e75056bc54 | ||
| 
						 | 
					8755a7890e | ||
| 
						 | 
					d0688fdd31 | ||
| 
						 | 
					0e05292a6c | ||
| 
						 | 
					23f228a0d0 | ||
| 
						 | 
					110aff4b24 | ||
| 
						 | 
					4a1c3df592 | ||
| 
						 | 
					185abfb218 | ||
| 
						 | 
					280590e338 | ||
| 
						 | 
					9767ea7aa7 | ||
| 
						 | 
					771ceb19f2 | ||
| 
						 | 
					7739947671 | ||
| 
						 | 
					8abf1d882e | ||
| 
						 | 
					1a53095406 | ||
| 
						 | 
					60eebf5c12 | ||
| 
						 | 
					30ee6c1995 | ||
| 
						 | 
					b769df8ff2 | ||
| 
						 | 
					cc2580e6e9 | ||
| 
						 | 
					4b0f8aed13 | ||
| 
						 | 
					2c8ac66456 | ||
| 
						 | 
					4f209fe960 | ||
| 
						 | 
					037b1142cd | ||
| 
						 | 
					37cc48861d | ||
| 
						 | 
					0cd61bfa6d | ||
| 
						 | 
					16ea6af381 | ||
| 
						 | 
					8bd374858f | ||
| 
						 | 
					d39cc3c092 | ||
| 
						 | 
					e124c3c298 | ||
| 
						 | 
					8acc0546bb | ||
| 
						 | 
					36e4be0a0a | ||
| 
						 | 
					c603cf5170 | ||
| 
						 | 
					e1a46eff7a | ||
| 
						 | 
					23aaa82b1d | ||
| 
						 | 
					58087a4e64 | ||
| 
						 | 
					8d1fa1c97e | ||
| 
						 | 
					2eb5f77bc8 | ||
| 
						 | 
					ddbbe500b0 | ||
| 
						 | 
					d1a5b53ede | ||
| 
						 | 
					8e6173c76a | ||
| 
						 | 
					1a6f024520 | ||
| 
						 | 
					3699a46ed7 | ||
| 
						 | 
					62da9203fd | ||
| 
						 | 
					2e1e3c1e41 | ||
| 
						 | 
					635256a324 | ||
| 
						 | 
					240546a185 | ||
| 
						 | 
					07df40db6e | ||
| 
						 | 
					b24c2e59fe | ||
| 
						 | 
					25bc1108c2 | ||
| 
						 | 
					8ef917c033 | ||
| 
						 | 
					1883249be3 | ||
| 
						 | 
					648dc68098 | ||
| 
						 | 
					10da0edddc | ||
| 
						 | 
					d6bf79993f | ||
| 
						 | 
					0f2735e839 | ||
| 
						 | 
					9463a28792 | ||
| 
						 | 
					1330a8a1cb | ||
| 
						 | 
					8135c35528 | ||
| 
						 | 
					38423fe0b7 | ||
| 
						 | 
					71132596ae | ||
| 
						 | 
					d6f8b65417 | ||
| 
						 | 
					d8439f0452 | ||
| 
						 | 
					eb6b0ed8be | ||
| 
						 | 
					6108f04d4f | ||
| 
						 | 
					b261ebfd22 | ||
| 
						 | 
					03db051b43 | ||
| 
						 | 
					cc885682e3 | ||
| 
						 | 
					1415ebf031 | ||
| 
						 | 
					4e0315b30e | ||
| 
						 | 
					a9ded3d272 | ||
| 
						 | 
					ef93642aac | ||
| 
						 | 
					9cda3d7915 | ||
| 
						 | 
					52b8edc94c | ||
| 
						 | 
					f936799f0b | ||
| 
						 | 
					f6d3dfe78b | ||
| 
						 | 
					2e17744a90 | ||
| 
						 | 
					19431d4d4e | ||
| 
						 | 
					ecd6fa11c2 | ||
| 
						 | 
					7cb35d4954 | ||
| 
						 | 
					457f869b73 | ||
| 
						 | 
					70f01f1262 | ||
| 
						 | 
					80fb9f2c57 | ||
| 
						 | 
					46f9a6203a | ||
| 
						 | 
					e9210b4e17 | ||
| 
						 | 
					4f07a3aa2c | ||
| 
						 | 
					04888edef3 | ||
| 
						 | 
					24cd7c5df7 | ||
| 
						 | 
					8210ee22e2 | ||
| 
						 | 
					eed5697f99 | ||
| 
						 | 
					52ee20f2aa | ||
| 
						 | 
					f17b892787 | ||
| 
						 | 
					18c5fe919f | ||
| 
						 | 
					c5898d7c1d | ||
| 
						 | 
					2c4d6aeabc | ||
| 
						 | 
					31c8dcedb2 | ||
| 
						 | 
					2adad90ae7 | ||
| 
						 | 
					808f9ce727 | ||
| 
						 | 
					8069e2f6fb | ||
| 
						 | 
					f7494394ee | ||
| 
						 | 
					04847a06c2 | ||
| 
						 | 
					329e816ed7 | ||
| 
						 | 
					d6860fb653 | ||
| 
						 | 
					e332c41670 | ||
| 
						 | 
					11f6eebdd3 | ||
| 
						 | 
					9109a58867 | ||
| 
						 | 
					44511b17cb | ||
| 
						 | 
					48b086b0ef | ||
| 
						 | 
					c9864adf34 | ||
| 
						 | 
					7d10059aeb | ||
| 
						 | 
					69e8b43812 | ||
| 
						 | 
					2f504d7a90 | ||
| 
						 | 
					2dea9a1266 | ||
| 
						 | 
					84e6629de3 | ||
| 
						 | 
					fc038df32e | ||
| 
						 | 
					021054a196 | ||
| 
						 | 
					ee20f19b20 | ||
| 
						 | 
					2fcb56dab9 | ||
| 
						 | 
					96ca078b22 | ||
| 
						 | 
					7fd4cbb519 | ||
| 
						 | 
					557e065d5f | ||
| 
						 | 
					461243731d | ||
| 
						 | 
					fe95afe1e2 | ||
| 
						 | 
					775aa5f38c | ||
| 
						 | 
					578c32814c | ||
| 
						 | 
					c46038f6b7 | ||
| 
						 | 
					306eefc49f | ||
| 
						 | 
					eade5150e4 | ||
| 
						 | 
					6d767afb7c | ||
| 
						 | 
					015a7d7362 | ||
| 
						 | 
					922c55a09b | ||
| 
						 | 
					4c83c13bc8 | ||
| 
						 | 
					bd7e30ea00 | ||
| 
						 | 
					4fb58ecea8 | ||
| 
						 | 
					a317cd5722 | ||
| 
						 | 
					8e2149d7df | ||
| 
						 | 
					9d9f1ecfaa | ||
| 
						 | 
					53b90bb25e | ||
| 
						 | 
					a0244ae347 | ||
| 
						 | 
					26f74e832b | ||
| 
						 | 
					9593c80062 | ||
| 
						 | 
					48b98cdc67 | ||
| 
						 | 
					9d442d2d7d | ||
| 
						 | 
					afc97d4735 | ||
| 
						 | 
					e5bea45df7 | ||
| 9e3935dfd8 | |||
| 4f5ee3f87b | |||
| 736d36b792 | |||
| dc5cc27d5a | |||
| eb70d77e1e | |||
| b8ec4c49bd | |||
| 49487dfd78 | |||
| 0d3f25eb48 | |||
| 9ef13f70f4 | |||
| 
						 | 
					beb0dc5f36 | ||
| 
						 | 
					f3fd428697 | ||
| 8811fe6987 | |||
| 
						 | 
					3835603e7e | ||
| 
						 | 
					4b360ee2ca | ||
| 
						 | 
					ab546a7463 | ||
| 
						 | 
					acac7858bd | ||
| 
						 | 
					c42640b200 | ||
| 
						 | 
					ef84190a1a | ||
| 
						 | 
					7db16a8173 | ||
| 
						 | 
					e91ba7dc9d | ||
| 
						 | 
					95f90d27d2 | ||
| 
						 | 
					1e9ac36f66 | ||
| 
						 | 
					7d061cfe17 | ||
| 
						 | 
					e21e76a914 | ||
| 
						 | 
					b18806f811 | ||
| 
						 | 
					478394bab7 | ||
| 
						 | 
					de3196da60 | ||
| 
						 | 
					49549033fd | ||
| 
						 | 
					15dfbc503d | ||
| 
						 | 
					f5c694972e | ||
| 
						 | 
					a9785f58c6 | ||
| 
						 | 
					7a5e131735 | ||
| 
						 | 
					93229681b5 | ||
| 
						 | 
					8819b9c600 | ||
| 
						 | 
					5d62141092 | ||
| 
						 | 
					44b20d1d74 | ||
| 
						 | 
					9ad437eafb | ||
| 
						 | 
					4fcef88c4d | ||
| 
						 | 
					dd2089dfd8 | ||
| 
						 | 
					df0ff1a029 | ||
| 
						 | 
					41a4fd7a61 | ||
| 
						 | 
					a4d8ebfaa1 | ||
| 
						 | 
					0ae7dcae2c | ||
| 
						 | 
					d6c23ec06a | ||
| 
						 | 
					3499f0f3e3 | ||
| 
						 | 
					7056dd763f | ||
| 
						 | 
					eade41f3ec | ||
| 
						 | 
					2f14399e40 | ||
| 
						 | 
					4f3ce00704 | ||
| 
						 | 
					d8ef221893 | ||
| 
						 | 
					8d003e22ca | ||
| 
						 | 
					b0b57fa13b | ||
| 
						 | 
					266f6af570 | ||
| 
						 | 
					241c55aabe | ||
| 
						 | 
					030896c76a | ||
| 
						 | 
					beb93f987c | ||
| 
						 | 
					8e8813a0a1 | ||
| 
						 | 
					c3c2325adc | ||
| 
						 | 
					f8429ed58c | ||
| 
						 | 
					df4763a782 | ||
| 
						 | 
					58af0caf04 | ||
| 
						 | 
					3aafe82485 | ||
| 
						 | 
					07679e680c | ||
| 
						 | 
					da835cc8a3 | 
							
								
								
									
										96
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										96
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -1,60 +1,46 @@
 | 
			
		||||
*.a
 | 
			
		||||
.config
 | 
			
		||||
.version
 | 
			
		||||
*.o
 | 
			
		||||
*.d
 | 
			
		||||
*.def
 | 
			
		||||
*.dll
 | 
			
		||||
*.exe
 | 
			
		||||
*.h.c
 | 
			
		||||
*.lib
 | 
			
		||||
*.pc
 | 
			
		||||
*.so
 | 
			
		||||
*.so.*
 | 
			
		||||
*.ver
 | 
			
		||||
*.d
 | 
			
		||||
*.exe
 | 
			
		||||
*.ho
 | 
			
		||||
*-example
 | 
			
		||||
*-test
 | 
			
		||||
*_g
 | 
			
		||||
/.config
 | 
			
		||||
/.version
 | 
			
		||||
/ffmpeg
 | 
			
		||||
/ffplay
 | 
			
		||||
/ffprobe
 | 
			
		||||
/ffserver
 | 
			
		||||
/config.*
 | 
			
		||||
/version.h
 | 
			
		||||
/doc/*.1
 | 
			
		||||
/doc/*.html
 | 
			
		||||
/doc/*.pod
 | 
			
		||||
/doc/avoptions_codec.texi
 | 
			
		||||
/doc/avoptions_format.texi
 | 
			
		||||
/doc/examples/decoding_encoding
 | 
			
		||||
/doc/examples/demuxing
 | 
			
		||||
/doc/examples/filtering_audio
 | 
			
		||||
/doc/examples/filtering_video
 | 
			
		||||
/doc/examples/metadata
 | 
			
		||||
/doc/examples/muxing
 | 
			
		||||
/doc/examples/scaling_video
 | 
			
		||||
/doc/fate.txt
 | 
			
		||||
/doc/print_options
 | 
			
		||||
/doxy/
 | 
			
		||||
/libavcodec/*_tablegen
 | 
			
		||||
/libavcodec/*_tables.c
 | 
			
		||||
/libavcodec/*_tables.h
 | 
			
		||||
/libavutil/avconfig.h
 | 
			
		||||
/tests/audiogen
 | 
			
		||||
/tests/base64
 | 
			
		||||
/tests/data/
 | 
			
		||||
/tests/rotozoom
 | 
			
		||||
/tests/tiny_psnr
 | 
			
		||||
/tests/videogen
 | 
			
		||||
/tests/vsynth1/
 | 
			
		||||
/tools/aviocat
 | 
			
		||||
/tools/ffbisect
 | 
			
		||||
/tools/bisect.need
 | 
			
		||||
/tools/cws2fws
 | 
			
		||||
/tools/ffeval
 | 
			
		||||
/tools/graph2dot
 | 
			
		||||
/tools/ismindex
 | 
			
		||||
/tools/pktdumper
 | 
			
		||||
/tools/probetest
 | 
			
		||||
/tools/qt-faststart
 | 
			
		||||
/tools/trasher
 | 
			
		||||
config.*
 | 
			
		||||
doc/*.1
 | 
			
		||||
doc/*.html
 | 
			
		||||
doc/*.pod
 | 
			
		||||
doxy
 | 
			
		||||
ffmpeg
 | 
			
		||||
ffplay
 | 
			
		||||
ffprobe
 | 
			
		||||
ffserver
 | 
			
		||||
libavcodec/libavcodec*
 | 
			
		||||
libavcore/libavcore*
 | 
			
		||||
libavdevice/libavdevice*
 | 
			
		||||
libavfilter/libavfilter*
 | 
			
		||||
libavformat/libavformat*
 | 
			
		||||
libavutil/avconfig.h
 | 
			
		||||
libavutil/libavutil*
 | 
			
		||||
libpostproc/libpostproc*
 | 
			
		||||
libswscale/libswscale*
 | 
			
		||||
tests/audiogen
 | 
			
		||||
tests/base64
 | 
			
		||||
tests/data
 | 
			
		||||
tests/rotozoom
 | 
			
		||||
tests/seek_test
 | 
			
		||||
tests/tiny_psnr
 | 
			
		||||
tests/videogen
 | 
			
		||||
tests/vsynth1
 | 
			
		||||
tests/vsynth2
 | 
			
		||||
tools/cws2fws
 | 
			
		||||
tools/graph2dot
 | 
			
		||||
tools/lavfi-showfiltfmts
 | 
			
		||||
tools/pktdumper
 | 
			
		||||
tools/probetest
 | 
			
		||||
tools/qt-faststart
 | 
			
		||||
tools/trasher
 | 
			
		||||
tools/trasher*.d
 | 
			
		||||
version.h
 | 
			
		||||
 
 | 
			
		||||
@@ -500,3 +500,5 @@ necessary.  Here is a sample; alter the names:
 | 
			
		||||
  Ty Coon, President of Vice
 | 
			
		||||
 | 
			
		||||
That's all there is to it!
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										9
									
								
								CREDITS
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								CREDITS
									
									
									
									
									
								
							@@ -1,7 +1,5 @@
 | 
			
		||||
This file contains the names of some of the people who have contributed to
 | 
			
		||||
FFmpeg. The names are sorted alphabetically by last name.  As this file is
 | 
			
		||||
currently quite outdated and git serves as a much better tool for determining
 | 
			
		||||
authorship, it remains here for historical reasons only.
 | 
			
		||||
This file contains the name of the people who have contributed to
 | 
			
		||||
FFmpeg. The names are sorted alphabetically by last name.
 | 
			
		||||
 | 
			
		||||
Dénes Balatoni
 | 
			
		||||
Michel Bardiaux
 | 
			
		||||
@@ -9,10 +7,8 @@ Fabrice Bellard
 | 
			
		||||
Patrice Bensoussan
 | 
			
		||||
Alex Beregszaszi
 | 
			
		||||
BERO
 | 
			
		||||
Thilo Borgmann
 | 
			
		||||
Mario Brito
 | 
			
		||||
Ronald Bultje
 | 
			
		||||
Alex Converse
 | 
			
		||||
Maarten Daniels
 | 
			
		||||
Reimar Doeffinger
 | 
			
		||||
Tim Ferguson
 | 
			
		||||
@@ -41,7 +37,6 @@ Michael Niedermayer
 | 
			
		||||
François Revol
 | 
			
		||||
Peter Ross
 | 
			
		||||
Måns Rullgård
 | 
			
		||||
Stefano Sabatini
 | 
			
		||||
Roman Shaposhnik
 | 
			
		||||
Oded Shimon
 | 
			
		||||
Dieter Shirley
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										599
									
								
								Changelog
									
									
									
									
									
								
							
							
						
						
									
										599
									
								
								Changelog
									
									
									
									
									
								
							@@ -1,501 +1,127 @@
 | 
			
		||||
Entries are sorted chronologically from oldest to youngest within each release,
 | 
			
		||||
releases are sorted from youngest to oldest.
 | 
			
		||||
 | 
			
		||||
version next:
 | 
			
		||||
 | 
			
		||||
version 0.5.9:
 | 
			
		||||
- dpcm: ignore extra unpaired bytes in stereo streams (CVE-2011-3951)
 | 
			
		||||
- h264: Add check for invalid chroma_format_idc (CVE-2012-0851)
 | 
			
		||||
- adpcm: ADPCM Electronic Arts has always two channels (CVE-2012-0852)
 | 
			
		||||
- kmvc: Check palsize (CVE-2011-3952)
 | 
			
		||||
- qdm2: clip array indices returned by qdm2_get_vlc()
 | 
			
		||||
- configure: properly check for mingw-w64 through installed headers
 | 
			
		||||
- Replace every usage of -lvfw32 with what is particularly necessary for that case
 | 
			
		||||
- mingw32: properly check if vfw capture is supported by the system headers
 | 
			
		||||
- mingw32: merge checks for mingw-w64 and mingw32-runtime >= 3.15 into one
 | 
			
		||||
- vfwcap: Include windows.h before vfw.h since the latter requires defines from the former
 | 
			
		||||
- ea: check chunk_size for validity
 | 
			
		||||
- eatqi: move "block" variable into context to ensure sufficient alignment for idct_put
 | 
			
		||||
- tqi: Pass errors from the MB decoder
 | 
			
		||||
- png: check bit depth for PAL8/Y400A pixel formats.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
version 1.0:
 | 
			
		||||
- INI and flat output in ffprobe
 | 
			
		||||
- Scene detection in libavfilter
 | 
			
		||||
- Indeo Audio decoder
 | 
			
		||||
- channelsplit audio filter
 | 
			
		||||
- setnsamples audio filter
 | 
			
		||||
- atempo filter
 | 
			
		||||
- ffprobe -show_data option
 | 
			
		||||
- RTMPT protocol support
 | 
			
		||||
- iLBC encoding/decoding via libilbc
 | 
			
		||||
- Microsoft Screen 1 decoder
 | 
			
		||||
- join audio filter
 | 
			
		||||
- audio channel mapping filter
 | 
			
		||||
- Microsoft ATC Screen decoder
 | 
			
		||||
- RTSP listen mode
 | 
			
		||||
- TechSmith Screen Codec 2 decoder
 | 
			
		||||
- AAC encoding via libfdk-aac
 | 
			
		||||
- Microsoft Expression Encoder Screen decoder
 | 
			
		||||
- RTMPS protocol support
 | 
			
		||||
- RTMPTS protocol support
 | 
			
		||||
- RTMPE protocol support
 | 
			
		||||
- RTMPTE protocol support
 | 
			
		||||
- showwaves and showspectrum filter
 | 
			
		||||
- LucasArts SMUSH playback support
 | 
			
		||||
- SAMI, RealText and SubViewer demuxers and decoders
 | 
			
		||||
- Heart Of Darkness PAF playback support
 | 
			
		||||
- iec61883 device
 | 
			
		||||
- asettb filter
 | 
			
		||||
- new option: -progress
 | 
			
		||||
- 3GPP Timed Text encoder/decoder
 | 
			
		||||
- GeoTIFF decoder support
 | 
			
		||||
- ffmpeg -(no)stdin option
 | 
			
		||||
- Opus decoder using libopus
 | 
			
		||||
- caca output device using libcaca
 | 
			
		||||
- alphaextract and alphamerge filters
 | 
			
		||||
- concat filter
 | 
			
		||||
- flite filter
 | 
			
		||||
- Canopus Lossless Codec decoder
 | 
			
		||||
- bitmap subtitles in filters (experimental and temporary)
 | 
			
		||||
- MP2 encoding via TwoLAME
 | 
			
		||||
- bmp parser
 | 
			
		||||
- smptebars source
 | 
			
		||||
- asetpts filter
 | 
			
		||||
- hue filter
 | 
			
		||||
- ICO muxer
 | 
			
		||||
- SubRip encoder and decoder without embedded timing
 | 
			
		||||
- edge detection filter
 | 
			
		||||
- framestep filter
 | 
			
		||||
- ffmpeg -shortest option is now per-output file
 | 
			
		||||
  -pass and -passlogfile are now per-output stream
 | 
			
		||||
- volume measurement filter
 | 
			
		||||
- Ut Video encoder
 | 
			
		||||
- Microsoft Screen 2 decoder
 | 
			
		||||
- Matroska demuxer now identifies SRT subtitles as AV_CODEC_ID_SUBRIP
 | 
			
		||||
  instead of AV_CODEC_ID_TEXT
 | 
			
		||||
- smartblur filter ported from MPlayer
 | 
			
		||||
- CPiA decoder
 | 
			
		||||
- decimate filter ported from MPlayer
 | 
			
		||||
- RTP depacketization of JPEG
 | 
			
		||||
- Smooth Streaming live segmenter muxer
 | 
			
		||||
- F4V muxer
 | 
			
		||||
- sendcmd and asendcmd filters
 | 
			
		||||
- WebVTT demuxer and decoder (simple tags supported)
 | 
			
		||||
- RTP packetization of JPEG
 | 
			
		||||
- faststart option in the MOV/MP4 muxer
 | 
			
		||||
version 0.5.8:
 | 
			
		||||
 | 
			
		||||
- id3v2: fix skipping extended header in id3v2.4
 | 
			
		||||
- nsvdec: Several bugfixes related to CVE-2011-3940
 | 
			
		||||
- dv: check stype
 | 
			
		||||
- dv: Fix null pointer dereference due to ach=0
 | 
			
		||||
- dv: Fix small stack overread related to CVE-2011-3929 and CVE-2011-3936.
 | 
			
		||||
- atrac3: Fix crash in tonal component decoding, fixes CVE-2012-0853
 | 
			
		||||
- mjpegbdec: Fix overflow in SOS, fixes CVE-2011-3947
 | 
			
		||||
- motionpixels: Clip YUV values after applying a gradient.
 | 
			
		||||
- vqavideo: return error if image size is not a multiple of block size,
 | 
			
		||||
  fixes CVE-2012-0947.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
version 0.11:
 | 
			
		||||
 | 
			
		||||
- Fixes: CVE-2012-2772, CVE-2012-2774, CVE-2012-2775, CVE-2012-2776, CVE-2012-2777,
 | 
			
		||||
         CVE-2012-2779, CVE-2012-2782, CVE-2012-2783, CVE-2012-2784, CVE-2012-2785,
 | 
			
		||||
         CVE-2012-2786, CVE-2012-2787, CVE-2012-2788, CVE-2012-2789, CVE-2012-2790,
 | 
			
		||||
         CVE-2012-2791, CVE-2012-2792, CVE-2012-2793, CVE-2012-2794, CVE-2012-2795,
 | 
			
		||||
         CVE-2012-2796, CVE-2012-2797, CVE-2012-2798, CVE-2012-2799, CVE-2012-2800,
 | 
			
		||||
         CVE-2012-2801, CVE-2012-2802, CVE-2012-2803, CVE-2012-2804,
 | 
			
		||||
- v408 Quicktime and Microsoft AYUV Uncompressed 4:4:4:4 encoder and decoder
 | 
			
		||||
- setfield filter
 | 
			
		||||
- CDXL demuxer and decoder
 | 
			
		||||
- Apple ProRes encoder
 | 
			
		||||
- ffprobe -count_packets and -count_frames options
 | 
			
		||||
- Sun Rasterfile Encoder
 | 
			
		||||
- ID3v2 attached pictures reading and writing
 | 
			
		||||
- WMA Lossless decoder
 | 
			
		||||
- bluray protocol
 | 
			
		||||
- blackdetect filter
 | 
			
		||||
- libutvideo encoder wrapper (--enable-libutvideo)
 | 
			
		||||
- swapuv filter
 | 
			
		||||
- bbox filter
 | 
			
		||||
- XBM encoder and decoder
 | 
			
		||||
- RealAudio Lossless decoder
 | 
			
		||||
- ZeroCodec decoder
 | 
			
		||||
- tile video filter
 | 
			
		||||
- Metal Gear Solid: The Twin Snakes demuxer
 | 
			
		||||
- OpenEXR image decoder
 | 
			
		||||
- removelogo filter
 | 
			
		||||
- drop support for ffmpeg without libavfilter
 | 
			
		||||
- drawtext video filter: fontconfig support
 | 
			
		||||
- ffmpeg -benchmark_all option
 | 
			
		||||
- super2xsai filter ported from libmpcodecs
 | 
			
		||||
- add libavresample audio conversion library for compatibility
 | 
			
		||||
- MicroDVD decoder
 | 
			
		||||
- Avid Meridien (AVUI) encoder and decoder
 | 
			
		||||
- accept + prefix to -pix_fmt option to disable automatic conversions.
 | 
			
		||||
- complete audio filtering in libavfilter and ffmpeg
 | 
			
		||||
- add fps filter
 | 
			
		||||
- vorbis parser
 | 
			
		||||
- png parser
 | 
			
		||||
- audio mix filter
 | 
			
		||||
version 0.5.7:
 | 
			
		||||
- vorbis: An additional defense in the Vorbis codec. (CVE-2011-3895)
 | 
			
		||||
- vorbisdec: Fix decoding bug with channel handling.
 | 
			
		||||
- matroskadec: Fix a bug where a pointer was cached to an array that might
 | 
			
		||||
  later move due to a realloc(). (CVE-2011-3893)
 | 
			
		||||
- vorbis: Avoid some out-of-bounds reads. (CVE-2011-3893)
 | 
			
		||||
- vp3: fix oob read for negative tokens and memleaks on error, (CVE-2011-3892)
 | 
			
		||||
- vp3: fix streams with non-zero last coefficient.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
version 0.10:
 | 
			
		||||
 | 
			
		||||
- Fixes: CVE-2011-3929, CVE-2011-3934, CVE-2011-3935, CVE-2011-3936,
 | 
			
		||||
         CVE-2011-3937, CVE-2011-3940, CVE-2011-3941, CVE-2011-3944,
 | 
			
		||||
         CVE-2011-3945, CVE-2011-3946, CVE-2011-3947, CVE-2011-3949,
 | 
			
		||||
         CVE-2011-3950, CVE-2011-3951, CVE-2011-3952
 | 
			
		||||
- v410 Quicktime Uncompressed 4:4:4 10-bit encoder and decoder
 | 
			
		||||
- SBaGen (SBG) binaural beats script demuxer
 | 
			
		||||
- OpenMG Audio muxer
 | 
			
		||||
- Timecode extraction in DV and MOV
 | 
			
		||||
- thumbnail video filter
 | 
			
		||||
- XML output in ffprobe
 | 
			
		||||
- asplit audio filter
 | 
			
		||||
- tinterlace video filter
 | 
			
		||||
- astreamsync audio filter
 | 
			
		||||
- amerge audio filter
 | 
			
		||||
- ISMV (Smooth Streaming) muxer
 | 
			
		||||
- GSM audio parser
 | 
			
		||||
- SMJPEG muxer
 | 
			
		||||
- XWD encoder and decoder
 | 
			
		||||
- Automatic thread count based on detection number of (available) CPU cores
 | 
			
		||||
- y41p Brooktree Uncompressed 4:1:1 12-bit encoder and decoder
 | 
			
		||||
- ffprobe -show_error option
 | 
			
		||||
- Avid 1:1 10-bit RGB Packer codec
 | 
			
		||||
- v308 Quicktime Uncompressed 4:4:4 encoder and decoder
 | 
			
		||||
- yuv4 libquicktime packed 4:2:0 encoder and decoder
 | 
			
		||||
- ffprobe -show_frames option
 | 
			
		||||
- silencedetect audio filter
 | 
			
		||||
- ffprobe -show_program_version, -show_library_versions, -show_versions options
 | 
			
		||||
- rv34: frame-level multi-threading
 | 
			
		||||
- optimized iMDCT transform on x86 using SSE for for mpegaudiodec
 | 
			
		||||
- Improved PGS subtitle decoder
 | 
			
		||||
- dumpgraph option to lavfi device
 | 
			
		||||
- r210 and r10k encoders
 | 
			
		||||
- ffwavesynth decoder
 | 
			
		||||
- aviocat tool
 | 
			
		||||
- ffeval tool
 | 
			
		||||
version 0.5.6:
 | 
			
		||||
- svq1dec: call avcodec_set_dimensions() after dimensions changed. (NGS00148, CVE-2011-4579)
 | 
			
		||||
- vmd: fix segfaults on corruped streams (CVE-2011-4364)
 | 
			
		||||
- commits related to CVE-2011-4353:
 | 
			
		||||
  - vp6: partially propagate huffman tree building errors during coeff model parsing and fix misspelling
 | 
			
		||||
  - Plug some memory leaks in the VP6 decoder
 | 
			
		||||
  - vp6: Reset the internal state when aborting key frames header parsing
 | 
			
		||||
  - vp6: Fix illegal read.
 | 
			
		||||
  - vp6: Fix illegal read.
 | 
			
		||||
  - Fix out of bound reads in the QDM2 decoder.
 | 
			
		||||
- commits related to CVE-2011-4351:
 | 
			
		||||
  - Check for out of bound writes in the QDM2 decoder.
 | 
			
		||||
  - qdm2: check output buffer size before decoding
 | 
			
		||||
  - Fix qdm2 decoder packet handling to match the api
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
version 0.9:
 | 
			
		||||
version 0.5.5:
 | 
			
		||||
 | 
			
		||||
- openal input device added
 | 
			
		||||
- boxblur filter added
 | 
			
		||||
- BWF muxer
 | 
			
		||||
- Flash Screen Video 2 decoder
 | 
			
		||||
- lavfi input device added
 | 
			
		||||
- added avconv, which is almost the same for now, except
 | 
			
		||||
for a few incompatible changes in the options, which will hopefully make them
 | 
			
		||||
easier to use. The changes are:
 | 
			
		||||
    * The options placement is now strictly enforced! While in theory the
 | 
			
		||||
      options for ffmpeg should be given in [input options] -i INPUT [output
 | 
			
		||||
      options] OUTPUT order, in practice it was possible to give output options
 | 
			
		||||
      before the -i and it mostly worked. Except when it didn't - the behavior was
 | 
			
		||||
      a bit inconsistent. In avconv, it is not possible to mix input and output
 | 
			
		||||
      options. All non-global options are reset after an input or output filename.
 | 
			
		||||
    * All per-file options are now truly per-file - they apply only to the next
 | 
			
		||||
      input or output file and specifying different values for different files
 | 
			
		||||
      will now work properly (notably -ss and -t options).
 | 
			
		||||
    * All per-stream options are now truly per-stream - it is possible to
 | 
			
		||||
      specify which stream(s) should a given option apply to. See the Stream
 | 
			
		||||
      specifiers section in the avconv manual for details.
 | 
			
		||||
    * In ffmpeg some options (like -newvideo/-newaudio/...) are irregular in the
 | 
			
		||||
      sense that they're specified after the output filename instead of before,
 | 
			
		||||
      like all other options. In avconv this irregularity is removed, all options
 | 
			
		||||
      apply to the next input or output file.
 | 
			
		||||
    * -newvideo/-newaudio/-newsubtitle options were removed. Not only were they
 | 
			
		||||
      irregular and highly confusing, they were also redundant. In avconv the -map
 | 
			
		||||
      option will create new streams in the output file and map input streams to
 | 
			
		||||
      them. E.g. avconv -i INPUT -map 0 OUTPUT will create an output stream for
 | 
			
		||||
      each stream in the first input file.
 | 
			
		||||
    * The -map option now has slightly different and more powerful syntax:
 | 
			
		||||
        + Colons (':') are used to separate file index/stream type/stream index
 | 
			
		||||
          instead of dots. Comma (',') is used to separate the sync stream instead
 | 
			
		||||
          of colon.. This is done for consistency with other options.
 | 
			
		||||
        + It's possible to specify stream type. E.g. -map 0:a:2 creates an
 | 
			
		||||
          output stream from the third input audio stream.
 | 
			
		||||
        + Omitting the stream index now maps all the streams of the given type,
 | 
			
		||||
          not just the first. E.g. -map 0:s creates output streams for all the
 | 
			
		||||
          subtitle streams in the first input file.
 | 
			
		||||
        + Since -map can now match multiple streams, negative mappings were
 | 
			
		||||
          introduced. Negative mappings disable some streams from an already
 | 
			
		||||
          defined map. E.g. '-map 0 -map -0:a:1' means 'create output streams for
 | 
			
		||||
          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 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
 | 
			
		||||
      aliases to -c:v/a/s
 | 
			
		||||
    * It is now possible to precisely specify which stream should an AVOption
 | 
			
		||||
      apply to. E.g. -b:v:0 2M sets the bitrate for the first video stream, while
 | 
			
		||||
      -b:a 128k sets the bitrate for all audio streams. Note that the old -ab 128k
 | 
			
		||||
      syntax is deprecated and will stop working soon.
 | 
			
		||||
    * -map_chapters now takes only an input file index and applies to the next
 | 
			
		||||
      output file. This is consistent with how all the other options work.
 | 
			
		||||
    * -map_metadata now takes only an input metadata specifier and applies to
 | 
			
		||||
      the next output file. Output metadata specifier is now part of the option
 | 
			
		||||
      name, similarly to the AVOptions/map/codec feature above.
 | 
			
		||||
    * -metadata can now be used to set metadata on streams and chapters, e.g.
 | 
			
		||||
      -metadata:s:1 language=eng sets the language of the first stream to 'eng'.
 | 
			
		||||
      This made -vlang/-alang/-slang options redundant, so they were removed.
 | 
			
		||||
    * -qscale option now uses stream specifiers and applies to all streams, not
 | 
			
		||||
      just video. I.e. plain -qscale number would now apply to all streams. To get
 | 
			
		||||
      the old behavior, use -qscale:v. Also there is now a shortcut -q for -qscale
 | 
			
		||||
      and -aq is now an alias for -q:a.
 | 
			
		||||
    * -vbsf/-absf/-sbsf options were removed and replaced by a -bsf option which
 | 
			
		||||
      uses stream specifiers. Use -bsf:v/a/s instead of the old options.
 | 
			
		||||
    * -itsscale option now uses stream specifiers, so its argument is only the
 | 
			
		||||
      scale parameter.
 | 
			
		||||
    * -intra option was removed, use -g 0 for the same effect.
 | 
			
		||||
    * -psnr option was removed, use -flags +psnr for the same effect.
 | 
			
		||||
    * -vf option is now an alias to the new -filter option, which uses stream specifiers.
 | 
			
		||||
    * -vframes/-aframes/-dframes options are now aliases to the new -frames option.
 | 
			
		||||
    * -vtag/-atag/-stag options are now aliases to the new -tag option.
 | 
			
		||||
- XMV demuxer
 | 
			
		||||
- LOAS demuxer
 | 
			
		||||
- ashowinfo filter added
 | 
			
		||||
- Windows Media Image decoder
 | 
			
		||||
- amovie source added
 | 
			
		||||
- LATM muxer/demuxer
 | 
			
		||||
- Speex encoder via libspeex
 | 
			
		||||
- JSON output in ffprobe
 | 
			
		||||
- WTV muxer
 | 
			
		||||
- Optional C++ Support (needed for libstagefright)
 | 
			
		||||
- H.264 Decoding on Android via Stagefright
 | 
			
		||||
- Prores decoder
 | 
			
		||||
- BIN/XBIN/ADF/IDF text file decoder
 | 
			
		||||
- aconvert audio filter added
 | 
			
		||||
- audio support to lavfi input device added
 | 
			
		||||
- libcdio-paranoia input device for audio CD grabbing
 | 
			
		||||
- Apple ProRes decoder
 | 
			
		||||
- CELT in Ogg demuxing
 | 
			
		||||
- G.723.1 demuxer and decoder
 | 
			
		||||
- libmodplug support (--enable-libmodplug)
 | 
			
		||||
- VC-1 interlaced decoding
 | 
			
		||||
- libutvideo wrapper (--enable-libutvideo)
 | 
			
		||||
- aevalsrc audio source added
 | 
			
		||||
- Ut Video decoder
 | 
			
		||||
- Speex encoding via libspeex
 | 
			
		||||
- 4:2:2 H.264 decoding support
 | 
			
		||||
- 4:2:2 and 4:4:4 H.264 encoding with libx264
 | 
			
		||||
- Pulseaudio input device
 | 
			
		||||
- Prores encoder
 | 
			
		||||
- Video Decoder Acceleration (VDA) HWAccel module.
 | 
			
		||||
- replacement Indeo 3 decoder
 | 
			
		||||
- new ffmpeg option: -map_channel
 | 
			
		||||
- volume audio filter added
 | 
			
		||||
- earwax audio filter added
 | 
			
		||||
- libv4l2 support (--enable-libv4l2)
 | 
			
		||||
- TLS/SSL and HTTPS protocol support
 | 
			
		||||
- AVOptions API rewritten and documented
 | 
			
		||||
- most of CODEC_FLAG2_*, some CODEC_FLAG_* and many codec-specific fields in
 | 
			
		||||
  AVCodecContext deprecated. Codec private options should be used instead.
 | 
			
		||||
- Properly working defaults in libx264 wrapper, support for native presets.
 | 
			
		||||
- Encrypted OMA files support
 | 
			
		||||
- Discworld II BMV decoding support
 | 
			
		||||
- VBLE Decoder
 | 
			
		||||
- OS X Video Decoder Acceleration (VDA) support
 | 
			
		||||
- compact and csv output in ffprobe
 | 
			
		||||
- pan audio filter
 | 
			
		||||
- IFF Amiga Continuous Bitmap (ACBM) decoder
 | 
			
		||||
- ass filter
 | 
			
		||||
- CRI ADX audio format muxer and demuxer
 | 
			
		||||
- Playstation Portable PMP format demuxer
 | 
			
		||||
- Microsoft Windows ICO demuxer
 | 
			
		||||
- life source
 | 
			
		||||
- PCM format support in OMA demuxer
 | 
			
		||||
- CLJR encoder
 | 
			
		||||
- new option: -report
 | 
			
		||||
- Dxtory capture format decoder
 | 
			
		||||
- cellauto source
 | 
			
		||||
- Simple segmenting muxer
 | 
			
		||||
- Indeo 4 decoder
 | 
			
		||||
- SMJPEG demuxer
 | 
			
		||||
- Fix memory (re)allocation in matroskadec.c (MSVR11-011/CVE-2011-3504)
 | 
			
		||||
- Fix some crashes with invalid bitstreams in the CAVS decoder
 | 
			
		||||
  (CVE-2011-3362, CVE-2011-3973, CVE-2011-3974)
 | 
			
		||||
- Compilation fixes for gcc-4.6, testsuite now passes again
 | 
			
		||||
- Detect and handle overreads in the MJPEG decoder.
 | 
			
		||||
- multiple other security fixes.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
version 0.8:
 | 
			
		||||
 | 
			
		||||
- many many things we forgot because we rather write code than changelogs
 | 
			
		||||
- WebM support in Matroska de/muxer
 | 
			
		||||
- low overhead Ogg muxing
 | 
			
		||||
- MMS-TCP support
 | 
			
		||||
- VP8 de/encoding via libvpx
 | 
			
		||||
- Demuxer for On2's IVF format
 | 
			
		||||
- Pictor/PC Paint decoder
 | 
			
		||||
- HE-AAC v2 decoder
 | 
			
		||||
- HE-AAC v2 encoding with libaacplus
 | 
			
		||||
- libfaad2 wrapper removed
 | 
			
		||||
- DTS-ES extension (XCh) decoding support
 | 
			
		||||
- native VP8 decoder
 | 
			
		||||
- RTSP tunneling over HTTP
 | 
			
		||||
- RTP depacketization of SVQ3
 | 
			
		||||
- -strict inofficial replaced by -strict unofficial
 | 
			
		||||
- ffplay -exitonkeydown and -exitonmousedown options added
 | 
			
		||||
- native GSM / GSM MS decoder
 | 
			
		||||
- RTP depacketization of QDM2
 | 
			
		||||
- ANSI/ASCII art playback system
 | 
			
		||||
- Lego Mindstorms RSO de/muxer
 | 
			
		||||
- libavcore added (and subsequently removed)
 | 
			
		||||
- SubRip subtitle file muxer and demuxer
 | 
			
		||||
- Chinese AVS encoding via libxavs
 | 
			
		||||
- ffprobe -show_packets option added
 | 
			
		||||
- RTP packetization of Theora and Vorbis
 | 
			
		||||
- RTP depacketization of MP4A-LATM
 | 
			
		||||
- RTP packetization and depacketization of VP8
 | 
			
		||||
- hflip filter
 | 
			
		||||
- Apple HTTP Live Streaming demuxer
 | 
			
		||||
- a64 codec
 | 
			
		||||
- MMS-HTTP support
 | 
			
		||||
- G.722 ADPCM audio encoder/decoder
 | 
			
		||||
- R10k video decoder
 | 
			
		||||
- ocv_smooth filter
 | 
			
		||||
- frei0r wrapper filter
 | 
			
		||||
- change crop filter syntax to width:height:x:y
 | 
			
		||||
- make the crop filter accept parametric expressions
 | 
			
		||||
- make ffprobe accept AVFormatContext options
 | 
			
		||||
- yadif filter
 | 
			
		||||
- blackframe filter
 | 
			
		||||
- Demuxer for Leitch/Harris' VR native stream format (LXF)
 | 
			
		||||
- RTP depacketization of the X-QT QuickTime format
 | 
			
		||||
- SAP (Session Announcement Protocol, RFC 2974) muxer and demuxer
 | 
			
		||||
- cropdetect filter
 | 
			
		||||
- ffmpeg -crop* options removed
 | 
			
		||||
- transpose filter added
 | 
			
		||||
- ffmpeg -force_key_frames option added
 | 
			
		||||
- demuxer for receiving raw rtp:// URLs without an SDP description
 | 
			
		||||
- single stream LATM/LOAS decoder
 | 
			
		||||
- setpts filter added
 | 
			
		||||
- Win64 support for optimized x86 assembly functions
 | 
			
		||||
- MJPEG/AVI1 to JPEG/JFIF bitstream filter
 | 
			
		||||
- ASS subtitle encoder and decoder
 | 
			
		||||
- IEC 61937 encapsulation for E-AC-3, TrueHD, DTS-HD (for HDMI passthrough)
 | 
			
		||||
- overlay filter added
 | 
			
		||||
- rename aspect filter to setdar, and pixelaspect to setsar
 | 
			
		||||
- IEC 61937 demuxer
 | 
			
		||||
- Mobotix .mxg demuxer
 | 
			
		||||
- frei0r source added
 | 
			
		||||
- hqdn3d filter added
 | 
			
		||||
- RTP depacketization of QCELP
 | 
			
		||||
- FLAC parser added
 | 
			
		||||
- gradfun filter added
 | 
			
		||||
- AMR-WB decoder
 | 
			
		||||
- replace the ocv_smooth filter with a more generic ocv filter
 | 
			
		||||
- Windows Televison (WTV) demuxer
 | 
			
		||||
- FFmpeg metadata format muxer and demuxer
 | 
			
		||||
- SubRip (srt) subtitle encoder and decoder
 | 
			
		||||
- floating-point AC-3 encoder added
 | 
			
		||||
- Lagarith decoder
 | 
			
		||||
- ffmpeg -copytb option added
 | 
			
		||||
- IVF muxer added
 | 
			
		||||
- Wing Commander IV movies decoder added
 | 
			
		||||
- movie source added
 | 
			
		||||
- Bink version 'b' audio and video decoder
 | 
			
		||||
- Bitmap Brothers JV playback system
 | 
			
		||||
- Apple HTTP Live Streaming protocol handler
 | 
			
		||||
- sndio support for playback and record
 | 
			
		||||
- Linux framebuffer input device added
 | 
			
		||||
- Chronomaster DFA decoder
 | 
			
		||||
- DPX image encoder
 | 
			
		||||
- MicroDVD subtitle file muxer and demuxer
 | 
			
		||||
- Playstation Portable PMP format demuxer
 | 
			
		||||
- fieldorder video filter added
 | 
			
		||||
- AAC encoding via libvo-aacenc
 | 
			
		||||
- AMR-WB encoding via libvo-amrwbenc
 | 
			
		||||
- xWMA demuxer
 | 
			
		||||
- Mobotix MxPEG decoder
 | 
			
		||||
- VP8 frame-multithreading
 | 
			
		||||
- NEON optimizations for VP8
 | 
			
		||||
- Lots of deprecated API cruft removed
 | 
			
		||||
- fft and imdct optimizations for AVX (Sandy Bridge) processors
 | 
			
		||||
- showinfo filter added
 | 
			
		||||
- SMPTE 302M AES3 audio decoder
 | 
			
		||||
- Apple Core Audio Format muxer
 | 
			
		||||
- 9bit and 10bit per sample support in the H.264 decoder
 | 
			
		||||
- 9bit and 10bit FFV1 encoding / decoding
 | 
			
		||||
- split filter added
 | 
			
		||||
- select filter added
 | 
			
		||||
- sdl output device added
 | 
			
		||||
- libmpcodecs video filter support (3 times as many filters than before)
 | 
			
		||||
- mpeg2 aspect ratio dection fixed
 | 
			
		||||
- libxvid aspect pickiness fixed
 | 
			
		||||
- Frame multithreaded decoding
 | 
			
		||||
- E-AC-3 audio encoder
 | 
			
		||||
- ac3enc: add channel coupling support
 | 
			
		||||
- floating-point sample format support to the ac3, eac3, dca, aac, and vorbis decoders.
 | 
			
		||||
- H264/MPEG frame-level multi-threading
 | 
			
		||||
- All av_metadata_* functions renamed to av_dict_* and moved to libavutil
 | 
			
		||||
- 4:4:4 H.264 decoding support
 | 
			
		||||
- 10-bit H.264 optimizations for x86
 | 
			
		||||
- lut, lutrgb, and lutyuv filters added
 | 
			
		||||
- buffersink libavfilter sink added
 | 
			
		||||
- Bump libswscale for recently reported ABI break
 | 
			
		||||
- New J2K encoder (via OpenJPEG)
 | 
			
		||||
version 0.5.4:
 | 
			
		||||
 | 
			
		||||
- Fix memory corruption in WMV parsing (addresses CVE-2010-3908)
 | 
			
		||||
- Fix heap corruption crashes (addresses CVE-2011-0722)
 | 
			
		||||
- Fix crashes in Vorbis decoding found by zzuf (addresses CVE-2010-4704)
 | 
			
		||||
- Fix another crash in Vorbis decoding (addresses CVE-2011-0480, Chrome issue 68115)
 | 
			
		||||
- Fix invalid reads in VC-1 decoding (related to CVE-2011-0723)
 | 
			
		||||
- Do not attempt to decode APE file with no frames
 | 
			
		||||
  (adresses http://packetstorm.linuxsecurity.com/1103-exploits/vlc105-dos.txt)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
version 0.7:
 | 
			
		||||
 | 
			
		||||
- all the changes for 0.8, but keeping API/ABI compatibility with the 0.6 release
 | 
			
		||||
version 0.5.3:
 | 
			
		||||
 | 
			
		||||
- build system improvements
 | 
			
		||||
- performance fix for seekable HTTP
 | 
			
		||||
- fix several potentially exploitable issues in the FLIC decoder
 | 
			
		||||
  (addresses CVE-2010-3429)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
version 0.6:
 | 
			
		||||
 | 
			
		||||
- PB-frame decoding for H.263
 | 
			
		||||
- deprecated vhook subsystem removed
 | 
			
		||||
- deprecated old scaler removed
 | 
			
		||||
- VQF demuxer
 | 
			
		||||
- Alpha channel scaler
 | 
			
		||||
- PCX encoder
 | 
			
		||||
- RTP packetization of H.263
 | 
			
		||||
- RTP packetization of AMR
 | 
			
		||||
- RTP depacketization of Vorbis
 | 
			
		||||
- CorePNG decoding support
 | 
			
		||||
- Cook multichannel decoding support
 | 
			
		||||
- introduced avlanguage helpers in libavformat
 | 
			
		||||
- 8088flex TMV demuxer and decoder
 | 
			
		||||
- per-stream language-tags extraction in asfdec
 | 
			
		||||
- V210 decoder and encoder
 | 
			
		||||
version 0.5.2:
 | 
			
		||||
 | 
			
		||||
- Hurd support
 | 
			
		||||
- PowerPC without AltiVec compilation issues
 | 
			
		||||
- validate channels and samplerate in the Vorbis decoder
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
version 0.5.1:
 | 
			
		||||
 | 
			
		||||
- build system updates
 | 
			
		||||
- documentation updates
 | 
			
		||||
- libswscale now is LGPL except for x86 optimizations
 | 
			
		||||
- fix for GPL code in libswscale that was erroneously activated
 | 
			
		||||
- AltiVec code in libswscale is now LGPL
 | 
			
		||||
- remaining GPL parts in AC-3 decoder converted to LGPL
 | 
			
		||||
- QCP demuxer
 | 
			
		||||
- SoX native format muxer and demuxer
 | 
			
		||||
- (L)GPL license upgrade support
 | 
			
		||||
- AMR-NB decoding/encoding, AMR-WB decoding via OpenCORE libraries
 | 
			
		||||
- DPX image decoder
 | 
			
		||||
- Electronic Arts Madcow decoder
 | 
			
		||||
- DivX (XSUB) subtitle encoder
 | 
			
		||||
- nonfree libamr support for AMR-NB/WB decoding/encoding removed
 | 
			
		||||
- experimental AAC encoder
 | 
			
		||||
- RTP depacketization of ASF and RTSP from WMS servers
 | 
			
		||||
- RTMP support in libavformat
 | 
			
		||||
- noX handling for OPT_BOOL X options
 | 
			
		||||
- Wave64 demuxer
 | 
			
		||||
- IEC-61937 compatible Muxer
 | 
			
		||||
- TwinVQ decoder
 | 
			
		||||
- Bluray (PGS) subtitle decoder
 | 
			
		||||
- LPCM support in MPEG-TS (HDMV RID as found on Blu-ray disks)
 | 
			
		||||
- WMA Pro decoder
 | 
			
		||||
- Core Audio Format demuxer
 | 
			
		||||
- Atrac1 decoder
 | 
			
		||||
- MD STUDIO audio demuxer
 | 
			
		||||
- RF64 support in WAV demuxer
 | 
			
		||||
- MPEG-4 Audio Lossless Coding (ALS) decoder
 | 
			
		||||
- -formats option split into -formats, -codecs, -bsfs, and -protocols
 | 
			
		||||
- IV8 demuxer
 | 
			
		||||
- CDG demuxer and decoder
 | 
			
		||||
- R210 decoder
 | 
			
		||||
- Auravision Aura 1 and 2 decoders
 | 
			
		||||
- Deluxe Paint Animation playback system
 | 
			
		||||
- SIPR decoder
 | 
			
		||||
- Adobe Filmstrip muxer and demuxer
 | 
			
		||||
- RTP depacketization of H.263
 | 
			
		||||
- Bink demuxer and audio/video decoders
 | 
			
		||||
- enable symbol versioning by default for linkers that support it
 | 
			
		||||
- IFF PBM/ILBM bitmap decoder
 | 
			
		||||
- concat protocol
 | 
			
		||||
- Indeo 5 decoder
 | 
			
		||||
- RTP depacketization of AMR
 | 
			
		||||
- WMA Voice decoder
 | 
			
		||||
- ffprobe tool
 | 
			
		||||
- AMR-NB decoder
 | 
			
		||||
- RTSP muxer
 | 
			
		||||
- HE-AAC v1 decoder
 | 
			
		||||
- Kega Game Video (KGV1) decoder
 | 
			
		||||
- VorbisComment writing for FLAC, Ogg FLAC and Ogg Speex files
 | 
			
		||||
- RTP depacketization of Theora
 | 
			
		||||
- HTTP Digest authentication
 | 
			
		||||
- RTMP/RTMPT/RTMPS/RTMPE/RTMPTE protocol support via librtmp
 | 
			
		||||
- Psygnosis YOP demuxer and video decoder
 | 
			
		||||
- spectral extension support in the E-AC-3 decoder
 | 
			
		||||
- unsharp video filter
 | 
			
		||||
- RTP hinting in the mov/3gp/mp4 muxer
 | 
			
		||||
- Dirac in Ogg demuxing
 | 
			
		||||
- seek to keyframes in Ogg
 | 
			
		||||
- 4:2:2 and 4:4:4 Theora decoding
 | 
			
		||||
- 35% faster VP3/Theora decoding
 | 
			
		||||
- faster AAC decoding
 | 
			
		||||
- faster H.264 decoding
 | 
			
		||||
- RealAudio 1.0 (14.4K) encoder
 | 
			
		||||
- backport av_lockmgr_register(), see doc/APIchanges for details
 | 
			
		||||
- security fixes for:
 | 
			
		||||
  - ASF, Ogg and MOV demuxers
 | 
			
		||||
  - FFv1, H.264, HuffYUV, MLP, MPEG audio and Snow decoders
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
version 0.5:
 | 
			
		||||
 | 
			
		||||
- The "device" muxers and demuxers are now in a new libavdevice library
 | 
			
		||||
- DV50 AKA DVCPRO50 encoder, decoder, muxer and demuxer
 | 
			
		||||
- DV100 AKA DVCPRO HD decoder and demuxer
 | 
			
		||||
- TechSmith Camtasia (TSCC) video decoder
 | 
			
		||||
- IBM Ultimotion (ULTI) video decoder
 | 
			
		||||
- Sierra Online audio file demuxer and decoder
 | 
			
		||||
@@ -515,7 +141,7 @@ version 0.5:
 | 
			
		||||
- Fraps FPS1 video decoder
 | 
			
		||||
- Snow video encoder/decoder
 | 
			
		||||
- Sonic audio encoder/decoder
 | 
			
		||||
- Vorbis audio decoder
 | 
			
		||||
- Vorbis audio encoder/decoder
 | 
			
		||||
- Macromedia ADPCM decoder
 | 
			
		||||
- Duck TrueMotion 2 video decoder
 | 
			
		||||
- support for decoding FLX and DTA extensions in FLIC files
 | 
			
		||||
@@ -526,19 +152,18 @@ version 0.5:
 | 
			
		||||
- TrueSpeech audio decoder
 | 
			
		||||
- WMA2 audio decoder fixed, now all files should play correctly
 | 
			
		||||
- RealAudio 14.4 and 28.8 decoders fixed
 | 
			
		||||
- JPEG-LS decoder
 | 
			
		||||
- JPEG-LS encoder and decoder
 | 
			
		||||
- CamStudio video decoder
 | 
			
		||||
- build system improvements
 | 
			
		||||
- tabs and trailing whitespace removed from the codebase
 | 
			
		||||
- CamStudio video decoder
 | 
			
		||||
- AIFF/AIFF-C audio format, encoding and decoding
 | 
			
		||||
- ADTS AAC file reading and writing
 | 
			
		||||
- Creative VOC file reading and writing
 | 
			
		||||
- American Laser Games multimedia (*.mm) playback system
 | 
			
		||||
- Zip Motion Blocks Video decoder
 | 
			
		||||
- Zip Blocks Motion Video decoder and encoder
 | 
			
		||||
- improved Theora/VP3 decoder
 | 
			
		||||
- True Audio (TTA) decoder
 | 
			
		||||
- AVS demuxer and video decoder
 | 
			
		||||
- JPEG-LS encoder
 | 
			
		||||
- Smacker demuxer and decoder
 | 
			
		||||
- NuppelVideo/MythTV demuxer and RTjpeg decoder
 | 
			
		||||
- KMVC decoder
 | 
			
		||||
@@ -557,14 +182,12 @@ version 0.5:
 | 
			
		||||
- VP6 video decoder
 | 
			
		||||
- WavPack lossless audio decoder
 | 
			
		||||
- Targa (.TGA) picture decoder
 | 
			
		||||
- Vorbis audio encoder
 | 
			
		||||
- Delphine Software .cin demuxer/audio and video decoder
 | 
			
		||||
- Tiertex .seq demuxer/video decoder
 | 
			
		||||
- MTV demuxer
 | 
			
		||||
- TIFF picture encoder and decoder
 | 
			
		||||
- GIF picture decoder
 | 
			
		||||
- Intel Music Coder decoder
 | 
			
		||||
- Zip Motion Blocks Video encoder
 | 
			
		||||
- Musepack decoder
 | 
			
		||||
- Flash Screen Video encoder
 | 
			
		||||
- Theora encoding via libtheora
 | 
			
		||||
@@ -591,10 +214,10 @@ version 0.5:
 | 
			
		||||
- OS/2 support removed and restored again
 | 
			
		||||
- AC-3 decoder
 | 
			
		||||
- NUT muxer
 | 
			
		||||
- additional SPARC (VIS) optimizations
 | 
			
		||||
- Matroska muxer
 | 
			
		||||
- slice-based parallel H.264 decoding
 | 
			
		||||
- Monkey's Audio demuxer and decoder
 | 
			
		||||
- additional SPARC (VIS) optimizations
 | 
			
		||||
- AMV audio and video decoder
 | 
			
		||||
- DNxHD encoder
 | 
			
		||||
- H.264 PAFF decoding
 | 
			
		||||
@@ -603,7 +226,6 @@ version 0.5:
 | 
			
		||||
- libvorbis Vorbis decoding removed in favor of native decoder
 | 
			
		||||
- IntraX8 (J-Frame) subdecoder for WMV2 and VC-1
 | 
			
		||||
- Ogg (Theora, Vorbis and FLAC) muxer
 | 
			
		||||
- The "device" muxers and demuxers are now in a new libavdevice library
 | 
			
		||||
- PC Paintbrush PCX decoder
 | 
			
		||||
- Sun Rasterfile decoder
 | 
			
		||||
- TechnoTrend PVA demuxer
 | 
			
		||||
@@ -633,7 +255,6 @@ version 0.5:
 | 
			
		||||
- AAC decoder
 | 
			
		||||
- floating point PCM encoder/decoder
 | 
			
		||||
- MXF muxer
 | 
			
		||||
- DV100 AKA DVCPRO HD decoder and demuxer
 | 
			
		||||
- E-AC-3 support added to AC-3 decoder
 | 
			
		||||
- Nellymoser ASAO encoder
 | 
			
		||||
- ASS and SSA demuxer and muxer
 | 
			
		||||
@@ -641,9 +262,8 @@ version 0.5:
 | 
			
		||||
- SVQ3 watermark decoding support
 | 
			
		||||
- Speex decoding via libspeex
 | 
			
		||||
- Electronic Arts TGQ decoder
 | 
			
		||||
- RV40 decoder
 | 
			
		||||
- RV30 and RV40 decoder
 | 
			
		||||
- QCELP / PureVoice decoder
 | 
			
		||||
- RV30 decoder
 | 
			
		||||
- hybrid WavPack support
 | 
			
		||||
- R3D REDCODE demuxer
 | 
			
		||||
- ALSA support for playback and record
 | 
			
		||||
@@ -653,7 +273,6 @@ version 0.5:
 | 
			
		||||
- Gopher client support
 | 
			
		||||
- MXF D-10 muxer
 | 
			
		||||
- generic metadata API
 | 
			
		||||
- flash ScreenVideo2 encoder
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
version 0.4.9-pre1:
 | 
			
		||||
@@ -739,7 +358,6 @@ version 0.4.9-pre1:
 | 
			
		||||
- many optimizations and bugfixes
 | 
			
		||||
- FunCom ISS audio file demuxer and according ADPCM decoding
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
version 0.4.8:
 | 
			
		||||
 | 
			
		||||
- MPEG-2 video encoding (Michael)
 | 
			
		||||
@@ -750,7 +368,6 @@ version 0.4.8:
 | 
			
		||||
- Interplay MVE playback subsystem (Mike Melanson)
 | 
			
		||||
- Duck DK3 and DK4 ADPCM audio decoders (Mike Melanson)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
version 0.4.7:
 | 
			
		||||
 | 
			
		||||
- RealAudio 1.0 (14_4) and 2.0 (28_8) native decoders. Author unknown, code from mplayerhq
 | 
			
		||||
@@ -791,7 +408,6 @@ version 0.4.7:
 | 
			
		||||
 | 
			
		||||
.. And lots more new enhancements and fixes.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
version 0.4.6:
 | 
			
		||||
 | 
			
		||||
- completely new integer only MPEG audio layer 1/2/3 decoder rewritten
 | 
			
		||||
@@ -828,7 +444,6 @@ version 0.4.6:
 | 
			
		||||
- simple stats output (Juanjo)
 | 
			
		||||
- 16-bit and 15-bit RGB/BGR/GBR support (Bisqwit)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
version 0.4.5:
 | 
			
		||||
 | 
			
		||||
- some header fixes (Zdenek Kabelac <kabi at informatics.muni.cz>)
 | 
			
		||||
@@ -856,10 +471,9 @@ version 0.4.5:
 | 
			
		||||
- MPEG-4 vol header fixes (Jonathan Marsden <snmjbm at pacbell.net>)
 | 
			
		||||
- ARM optimizations (Lionel Ulmer <lionel.ulmer at free.fr>).
 | 
			
		||||
- Windows porting of file converter
 | 
			
		||||
- added MJPEG raw format (input/output)
 | 
			
		||||
- added MJPEG raw format (input/ouput)
 | 
			
		||||
- added JPEG image format support (input/output)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
version 0.4.4:
 | 
			
		||||
 | 
			
		||||
- fixed some std header definitions (Bjorn Lindgren
 | 
			
		||||
@@ -884,7 +498,6 @@ version 0.4.4:
 | 
			
		||||
- codecs are no longer searched by read_header() (should fix ffserver
 | 
			
		||||
  segfault)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
version 0.4.3:
 | 
			
		||||
 | 
			
		||||
- BGR24 patch (initial patch by Jeroen Vreeken <pe1rxq at amsat.org>)
 | 
			
		||||
@@ -905,7 +518,6 @@ version 0.4.3:
 | 
			
		||||
  <lists at reserv.at>, but changed completely since we use a format
 | 
			
		||||
  instead of a protocol)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
version 0.4.2:
 | 
			
		||||
 | 
			
		||||
- added H.263/MPEG-4/MSMPEG4 decoding support. MPEG-4 decoding support
 | 
			
		||||
@@ -922,7 +534,6 @@ version 0.4.2:
 | 
			
		||||
- added file overwrite confirmation (can be disabled with -y)
 | 
			
		||||
- added custom size picture to H.263 using H.263+ (Juanjo)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
version 0.4.1:
 | 
			
		||||
 | 
			
		||||
- added MSMPEG4 (aka DivX) compatible encoder. Changed default codec
 | 
			
		||||
@@ -935,7 +546,6 @@ version 0.4.1:
 | 
			
		||||
- improved dct_quantize speed
 | 
			
		||||
- factorized some motion estimation code
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
version 0.4.0:
 | 
			
		||||
 | 
			
		||||
- removing grab code from ffserver and moved it to ffmpeg. Added
 | 
			
		||||
@@ -963,12 +573,10 @@ version 0.4.0:
 | 
			
		||||
- changed directories: libav for format handling, libavcodec for
 | 
			
		||||
  codecs
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
version 0.3.4:
 | 
			
		||||
 | 
			
		||||
- added stereo in MPEG audio encoder
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
version 0.3.3:
 | 
			
		||||
 | 
			
		||||
- added 'high quality' mode which use motion vectors. It can be used in
 | 
			
		||||
@@ -976,18 +584,15 @@ version 0.3.3:
 | 
			
		||||
- fixed rounding problems which caused quality problems at high
 | 
			
		||||
  bitrates and large GOP size
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
version 0.3.2: small fixes
 | 
			
		||||
 | 
			
		||||
- ASF fixes
 | 
			
		||||
- put_seek bug fix
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
version 0.3.1: added avi/divx support
 | 
			
		||||
 | 
			
		||||
- added AVI support
 | 
			
		||||
- added MPEG-4 codec compatible with OpenDivX. It is based on the H.263 codec
 | 
			
		||||
- added sound for flash format (not tested)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
version 0.3: initial public release
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										4
									
								
								INSTALL
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								INSTALL
									
									
									
									
									
								
							@@ -9,7 +9,3 @@ path when launching 'configure', e.g. '/ffmpegdir/ffmpeg/configure'.
 | 
			
		||||
2) Then type 'make' to build FFmpeg. GNU Make 3.81 or later is required.
 | 
			
		||||
 | 
			
		||||
3) Type 'make install' to install all binaries and libraries you built.
 | 
			
		||||
 | 
			
		||||
NOTICE
 | 
			
		||||
 | 
			
		||||
 - Non system dependencies (e.g. libx264, libvpx) are disabled by default.
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										69
									
								
								LICENSE
									
									
									
									
									
								
							
							
						
						
									
										69
									
								
								LICENSE
									
									
									
									
									
								
							@@ -1,4 +1,5 @@
 | 
			
		||||
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
 | 
			
		||||
@@ -13,36 +14,17 @@ configure to activate them. In this case, FFmpeg's license changes to GPL v2+.
 | 
			
		||||
Specifically, the GPL parts of FFmpeg are
 | 
			
		||||
 | 
			
		||||
- libpostproc
 | 
			
		||||
- libmpcodecs
 | 
			
		||||
- some x86 optimizations in libswscale
 | 
			
		||||
- optional x86 optimizations in the files
 | 
			
		||||
  libavcodec/x86/h264_deblock_sse2.asm
 | 
			
		||||
  libavcodec/x86/h264_idct_sse2.asm
 | 
			
		||||
  libavcodec/x86/idct_mmx.c
 | 
			
		||||
- libutvideo encoding/decoding wrappers in
 | 
			
		||||
  libavcodec/libutvideo*.cpp
 | 
			
		||||
- the X11 grabber in libavdevice/x11grab.c
 | 
			
		||||
- the swresample test app in
 | 
			
		||||
  libswresample/swresample-test.c
 | 
			
		||||
- the texi2pod.pl tool
 | 
			
		||||
- the following filters in libavfilter:
 | 
			
		||||
    - vf_blackframe.c
 | 
			
		||||
    - vf_boxblur.c
 | 
			
		||||
    - vf_colormatrix.c
 | 
			
		||||
    - vf_cropdetect.c
 | 
			
		||||
    - vf_delogo.c
 | 
			
		||||
    - vf_hqdn3d.c
 | 
			
		||||
    - vf_mp.c
 | 
			
		||||
    - vf_super2xsai.c
 | 
			
		||||
    - vf_tinterlace.c
 | 
			
		||||
    - vf_yadif.c
 | 
			
		||||
    - vsrc_mptestsrc.c
 | 
			
		||||
 | 
			
		||||
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
 | 
			
		||||
  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.
 | 
			
		||||
* The files libavcodec/jfdctfst.c, libavcodec/jfdctint.c, libavcodec/jrevdct.c
 | 
			
		||||
  are taken from libjpeg, see the top of the files for licensing details.
 | 
			
		||||
 | 
			
		||||
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
 | 
			
		||||
@@ -50,32 +32,19 @@ 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.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
external libraries
 | 
			
		||||
==================
 | 
			
		||||
external libraries:
 | 
			
		||||
-------------------
 | 
			
		||||
 | 
			
		||||
FFmpeg can be combined with a number of external libraries, which sometimes
 | 
			
		||||
affect the licensing of binaries resulting from the combination.
 | 
			
		||||
Some external libraries, e.g. libx264, are under GPL and can be used in
 | 
			
		||||
conjunction with FFmpeg. They require --enable-gpl to be passed to configure
 | 
			
		||||
as well.
 | 
			
		||||
 | 
			
		||||
compatible libraries
 | 
			
		||||
--------------------
 | 
			
		||||
The OpenCORE external 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 the OpenCORE libraries with FFmpeg, the license
 | 
			
		||||
version needs to be upgraded by passing --enable-version3 to configure.
 | 
			
		||||
 | 
			
		||||
The libcdio, libx264, libxavs and libxvid libraries are under GPL. When
 | 
			
		||||
combining them with FFmpeg, FFmpeg needs to be licensed as GPL as well by
 | 
			
		||||
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.
 | 
			
		||||
 | 
			
		||||
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.
 | 
			
		||||
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
 | 
			
		||||
restrictions cause the resulting binary to be unredistributeable.
 | 
			
		||||
The nonfree external libraries libamrnb, libamrwb and libfaac can be hooked up
 | 
			
		||||
in FFmpeg. You need to pass --enable-nonfree to configure to enable them. Employ
 | 
			
		||||
this option with care as FFmpeg then becomes nonfree and unredistributable.
 | 
			
		||||
Note that libfaac claims to be LGPL, but is not.
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										184
									
								
								MAINTAINERS
									
									
									
									
									
								
							
							
						
						
									
										184
									
								
								MAINTAINERS
									
									
									
									
									
								
							@@ -4,12 +4,6 @@ FFmpeg maintainers
 | 
			
		||||
Below is a list of the people maintaining different parts of the
 | 
			
		||||
FFmpeg code.
 | 
			
		||||
 | 
			
		||||
Please try to keep entries where you are the maintainer up to date!
 | 
			
		||||
 | 
			
		||||
Names in () mean that the maintainer currently has no time to maintain the code.
 | 
			
		||||
A CC after the name means that the maintainer prefers to be CC-ed on patches
 | 
			
		||||
and related discussions.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Project Leader
 | 
			
		||||
==============
 | 
			
		||||
@@ -24,11 +18,17 @@ Applications
 | 
			
		||||
ffmpeg:
 | 
			
		||||
  ffmpeg.c                              Michael Niedermayer
 | 
			
		||||
 | 
			
		||||
ffplay:
 | 
			
		||||
  ffplay.c                              Marton Balint
 | 
			
		||||
  Video Hooks:
 | 
			
		||||
    vhook
 | 
			
		||||
    vhook/watermark.c                   Marcus Engene
 | 
			
		||||
    vhook/ppm.c
 | 
			
		||||
    vhook/drawtext.c
 | 
			
		||||
    vhook/fish.c
 | 
			
		||||
    vhook/null.c
 | 
			
		||||
    vhook/imlib2.c
 | 
			
		||||
 | 
			
		||||
ffprobe:
 | 
			
		||||
  ffprobe.c                             Stefano Sabatini
 | 
			
		||||
ffplay:
 | 
			
		||||
  ffplay.c                              Michael Niedermayer
 | 
			
		||||
 | 
			
		||||
ffserver:
 | 
			
		||||
  ffserver.c, ffserver.h                Baptiste Coudurier
 | 
			
		||||
@@ -37,20 +37,19 @@ Commandline utility code:
 | 
			
		||||
  cmdutils.c, cmdutils.h                Michael Niedermayer
 | 
			
		||||
 | 
			
		||||
QuickTime faststart:
 | 
			
		||||
  tools/qt-faststart.c                  Baptiste Coudurier
 | 
			
		||||
  qt-faststart.c                        Mike Melanson
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Miscellaneous Areas
 | 
			
		||||
===================
 | 
			
		||||
 | 
			
		||||
documentation                           Mike Melanson
 | 
			
		||||
website                                 Robert Swain, Lou Logan
 | 
			
		||||
documentation                           Mike Melanson, Diego Biurrun
 | 
			
		||||
website                                 Robert Swain
 | 
			
		||||
build system (configure,Makefiles)      Diego Biurrun, Mans Rullgard
 | 
			
		||||
project server                          Árpád Gereöffy, Michael Niedermayer, Reimar Döffinger
 | 
			
		||||
mailinglists                            Michael Niedermayer, Baptiste Coudurier, Lou Logan
 | 
			
		||||
project server                          Diego Biurrun, Mans Rullgard
 | 
			
		||||
mailinglists                            Michael Niedermayer, Baptiste Coudurier
 | 
			
		||||
presets                                 Robert Swain
 | 
			
		||||
metadata subsystem                      Aurelien Jacobs
 | 
			
		||||
release management                      Michael Niedermayer
 | 
			
		||||
release management                      Diego Biurrun, Reinhard Tartler
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
libavutil
 | 
			
		||||
@@ -87,8 +86,6 @@ Generic Parts:
 | 
			
		||||
    bitstream.c, bitstream.h            Michael Niedermayer
 | 
			
		||||
  CABAC:
 | 
			
		||||
    cabac.h, cabac.c                    Michael Niedermayer
 | 
			
		||||
  codec names:
 | 
			
		||||
    codec_names.sh                      Nicolas George
 | 
			
		||||
  DSP utilities:
 | 
			
		||||
    dsputils.c, dsputils.h              Michael Niedermayer
 | 
			
		||||
  entropy coding:
 | 
			
		||||
@@ -109,33 +106,25 @@ Generic Parts:
 | 
			
		||||
    simple_idct.c, simple_idct.h        Michael Niedermayer
 | 
			
		||||
  postprocessing:
 | 
			
		||||
    libpostproc/*                       Michael Niedermayer
 | 
			
		||||
  table generation:
 | 
			
		||||
    tableprint.c, tableprint.h          Reimar Doeffinger
 | 
			
		||||
  vdpau:
 | 
			
		||||
    vdpau*                              Carl Eugen Hoyos
 | 
			
		||||
 | 
			
		||||
Codecs:
 | 
			
		||||
  4xm.c                                 Michael Niedermayer
 | 
			
		||||
  8bps.c                                Roberto Togni
 | 
			
		||||
  8svx.c                                Jaikrishnan Menon
 | 
			
		||||
  aasc.c                                Kostya Shishkov
 | 
			
		||||
  aac.[ch], aactab.[ch], aacdectab.h    Robert Swain
 | 
			
		||||
  ac3*                                  Justin Ruggles
 | 
			
		||||
  alacenc.c                             Jaikrishnan Menon
 | 
			
		||||
  alsdec.c                              Thilo Borgmann
 | 
			
		||||
  apedec.c                              Kostya Shishkov
 | 
			
		||||
  ass*                                  Aurelien Jacobs
 | 
			
		||||
  asv*                                  Michael Niedermayer
 | 
			
		||||
  atrac3*                               Benjamin Larsson
 | 
			
		||||
  bgmc.c, bgmc.h                        Thilo Borgmann
 | 
			
		||||
  bink.c                                Kostya Shishkov
 | 
			
		||||
  binkaudio.c                           Peter Ross
 | 
			
		||||
  bmp.c                                 Mans Rullgard, Kostya Shishkov
 | 
			
		||||
  cavs*                                 Stefan Gehrer
 | 
			
		||||
  celp_filters.*                        Vitor Sessak
 | 
			
		||||
  cinepak.c                             Roberto Togni
 | 
			
		||||
  cljr                                  Alex Beregszaszi
 | 
			
		||||
  cllc.c                                Derek Buitenhuis
 | 
			
		||||
  cook.c, cookdata.h                    Benjamin Larsson
 | 
			
		||||
  cpia.c                                Stephan Hilb
 | 
			
		||||
  crystalhd.c                           Philip Langdale
 | 
			
		||||
  cscd.c                                Reimar Doeffinger
 | 
			
		||||
  dca.c                                 Kostya Shishkov, Benjamin Larsson
 | 
			
		||||
  dnxhd*                                Baptiste Coudurier
 | 
			
		||||
@@ -144,11 +133,10 @@ Codecs:
 | 
			
		||||
  dv.c                                  Roman Shaposhnik
 | 
			
		||||
  eacmv*, eaidct*, eat*                 Peter Ross
 | 
			
		||||
  ffv1.c                                Michael Niedermayer
 | 
			
		||||
  ffwavesynth.c                         Nicolas George
 | 
			
		||||
  flac*                                 Justin Ruggles
 | 
			
		||||
  flacdec.c                             Alex Beregszaszi, Justin Ruggles
 | 
			
		||||
  flacenc.c                             Justin Ruggles
 | 
			
		||||
  flashsv*                              Benjamin Larsson
 | 
			
		||||
  flicvideo.c                           Mike Melanson
 | 
			
		||||
  g722.c                                Martin Storsjo
 | 
			
		||||
  g726.c                                Roman Shaposhnik
 | 
			
		||||
  gifdec.c                              Baptiste Coudurier
 | 
			
		||||
  h264*                                 Loren Merritt, Michael Niedermayer
 | 
			
		||||
@@ -158,32 +146,18 @@ Codecs:
 | 
			
		||||
  idcinvideo.c                          Mike Melanson
 | 
			
		||||
  imc*                                  Benjamin Larsson
 | 
			
		||||
  indeo2*                               Kostya Shishkov
 | 
			
		||||
  indeo5*                               Kostya Shishkov
 | 
			
		||||
  interplayvideo.c                      Mike Melanson
 | 
			
		||||
  ivi*                                  Kostya Shishkov
 | 
			
		||||
  jacosub*                              Clément Bœsch
 | 
			
		||||
  jpeg_ls.c                             Kostya Shishkov
 | 
			
		||||
  jvdec.c                               Peter Ross
 | 
			
		||||
  kmvc.c                                Kostya Shishkov
 | 
			
		||||
  lcl*.c                                Roberto Togni, Reimar Doeffinger
 | 
			
		||||
  libcelt_dec.c                         Nicolas George
 | 
			
		||||
  lcl*.c                                Roberto Togni
 | 
			
		||||
  libgsm.c                              Michel Bardiaux
 | 
			
		||||
  libdirac*                             David Conrad
 | 
			
		||||
  libopenjpeg.c                         Jaikrishnan Menon
 | 
			
		||||
  libopenjpegenc.c                      Michael Bradshaw
 | 
			
		||||
  libschroedinger*                      David Conrad
 | 
			
		||||
  libspeexdec.c                         Justin Ruggles
 | 
			
		||||
  libtheoraenc.c                        David Conrad
 | 
			
		||||
  libutvideo*                           Derek Buitenhuis
 | 
			
		||||
  libvorbis.c                           David Conrad
 | 
			
		||||
  libxavs.c                             Stefan Gehrer
 | 
			
		||||
  libx264.c                             Mans Rullgard, Jason Garrett-Glaser
 | 
			
		||||
  loco.c                                Kostya Shishkov
 | 
			
		||||
  lzo.h, lzo.c                          Reimar Doeffinger
 | 
			
		||||
  mdec.c                                Michael Niedermayer
 | 
			
		||||
  mimic.c                               Ramiro Polla
 | 
			
		||||
  mjpeg.c                               Michael Niedermayer
 | 
			
		||||
  mlp*                                  Ramiro Polla
 | 
			
		||||
  mmvideo.c                             Peter Ross
 | 
			
		||||
  mpc*                                  Kostya Shishkov
 | 
			
		||||
  mpeg12.c, mpeg12data.h                Michael Niedermayer
 | 
			
		||||
@@ -194,7 +168,6 @@ Codecs:
 | 
			
		||||
  nellymoserdec.c                       Benjamin Larsson
 | 
			
		||||
  nuv.c                                 Reimar Doeffinger
 | 
			
		||||
  pcx.c                                 Ivo van Poorten
 | 
			
		||||
  pgssubdec.c                           Reimar Doeffinger
 | 
			
		||||
  ptx.c                                 Ivo van Poorten
 | 
			
		||||
  qcelp*                                Reynaldo H. Verdejo Pinochet
 | 
			
		||||
  qdm2.c, qdm2data.h                    Roberto Togni, Benjamin Larsson
 | 
			
		||||
@@ -210,11 +183,9 @@ Codecs:
 | 
			
		||||
  rv3*                                  Kostya Shishkov
 | 
			
		||||
  rv4*                                  Kostya Shishkov
 | 
			
		||||
  s3tc*                                 Ivo van Poorten
 | 
			
		||||
  smacker.c                             Kostya Shishkov
 | 
			
		||||
  smc.c                                 Mike Melanson
 | 
			
		||||
  snow.c                                Michael Niedermayer, Loren Merritt
 | 
			
		||||
  sonic.c                               Alex Beregszaszi
 | 
			
		||||
  srt*                                  Aurelien Jacobs
 | 
			
		||||
  sunrast.c                             Ivo van Poorten
 | 
			
		||||
  svq3.c                                Michael Niedermayer
 | 
			
		||||
  targa.c                               Kostya Shishkov
 | 
			
		||||
@@ -223,42 +194,27 @@ Codecs:
 | 
			
		||||
  truemotion2*                          Kostya Shishkov
 | 
			
		||||
  truespeech.c                          Kostya Shishkov
 | 
			
		||||
  tscc.c                                Kostya Shishkov
 | 
			
		||||
  tta.c                                 Alex Beregszaszi, Jaikrishnan Menon
 | 
			
		||||
  tta.c                                 Alex Beregszaszi
 | 
			
		||||
  txd.c                                 Ivo van Poorten
 | 
			
		||||
  ulti*                                 Kostya Shishkov
 | 
			
		||||
  v410*.c                               Derek Buitenhuis
 | 
			
		||||
  vb.c                                  Kostya Shishkov
 | 
			
		||||
  vble.c                                Derek Buitenhuis
 | 
			
		||||
  vc1*                                  Kostya Shishkov
 | 
			
		||||
  vcr1.c                                Michael Niedermayer
 | 
			
		||||
  vda_h264_dec.c                        Xidorn Quan
 | 
			
		||||
  vmnc.c                                Kostya Shishkov
 | 
			
		||||
  vorbis_enc.c                          Oded Shimon
 | 
			
		||||
  vorbis_dec.c                          Denes Balatoni, David Conrad
 | 
			
		||||
  vorbis_dec.c                          Denes Balatoni
 | 
			
		||||
  vp3*                                  Mike Melanson
 | 
			
		||||
  vp5                                   Aurelien Jacobs
 | 
			
		||||
  vp6                                   Aurelien Jacobs
 | 
			
		||||
  vp8                                   David Conrad, Jason Garrett-Glaser, Ronald Bultje
 | 
			
		||||
  vqavideo.c                            Mike Melanson
 | 
			
		||||
  wavpack.c                             Kostya Shishkov
 | 
			
		||||
  wmaprodec.c                           Sascha Sommer
 | 
			
		||||
  wmavoice.c                            Ronald S. Bultje
 | 
			
		||||
  wmv2.c                                Michael Niedermayer
 | 
			
		||||
  wnv1.c                                Kostya Shishkov
 | 
			
		||||
  xan.c                                 Mike Melanson
 | 
			
		||||
  xl.c                                  Kostya Shishkov
 | 
			
		||||
  xvmc.c                                Ivan Kalvachev
 | 
			
		||||
  zerocodec.c                           Derek Buitenhuis
 | 
			
		||||
  zmbv*                                 Kostya Shishkov
 | 
			
		||||
 | 
			
		||||
Hardware acceleration:
 | 
			
		||||
  crystalhd.c                           Philip Langdale
 | 
			
		||||
  dxva2*                                Laurent Aimar
 | 
			
		||||
  libstagefright.cpp                    Mohamed Naufal
 | 
			
		||||
  vaapi*                                Gwenole Beauchesne
 | 
			
		||||
  vda*                                  Sebastien Zwickert
 | 
			
		||||
  vdpau*                                Carl Eugen Hoyos
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
libavdevice
 | 
			
		||||
===========
 | 
			
		||||
@@ -266,28 +222,11 @@ libavdevice
 | 
			
		||||
    libavdevice/avdevice.h
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  iec61883.c                            Georg Lippitsch
 | 
			
		||||
  libdc1394.c                           Roman Shaposhnik
 | 
			
		||||
  v4l2.c                                Luca Abeni
 | 
			
		||||
  vfwcap.c                              Ramiro Polla
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
libavfilter
 | 
			
		||||
===========
 | 
			
		||||
 | 
			
		||||
Generic parts:
 | 
			
		||||
  graphdump.c                           Nicolas George
 | 
			
		||||
 | 
			
		||||
Filters:
 | 
			
		||||
  af_amerge.c                           Nicolas George
 | 
			
		||||
  af_astreamsync.c                      Nicolas George
 | 
			
		||||
  af_atempo.c                           Pavel Koshevoy
 | 
			
		||||
  af_pan.c                              Nicolas George
 | 
			
		||||
  vf_yadif.c                            Michael Niedermayer
 | 
			
		||||
 | 
			
		||||
Sources:
 | 
			
		||||
  vsrc_mandelbrot.c                     Michael Niedermayer
 | 
			
		||||
 | 
			
		||||
libavformat
 | 
			
		||||
===========
 | 
			
		||||
 | 
			
		||||
@@ -303,15 +242,11 @@ Muxers/Demuxers:
 | 
			
		||||
  adtsenc.c                             Robert Swain
 | 
			
		||||
  aiff.c                                Baptiste Coudurier
 | 
			
		||||
  ape.c                                 Kostya Shishkov
 | 
			
		||||
  ass*                                  Aurelien Jacobs
 | 
			
		||||
  avi*                                  Michael Niedermayer
 | 
			
		||||
  bink.c                                Peter Ross
 | 
			
		||||
  caf*                                  Peter Ross
 | 
			
		||||
  crc.c                                 Michael Niedermayer
 | 
			
		||||
  daud.c                                Reimar Doeffinger
 | 
			
		||||
  dv.c                                  Roman Shaposhnik
 | 
			
		||||
  dxa.c                                 Kostya Shishkov
 | 
			
		||||
  electronicarts.c                      Peter Ross
 | 
			
		||||
  ffm*                                  Baptiste Coudurier
 | 
			
		||||
  flac*                                 Justin Ruggles
 | 
			
		||||
  flic.c                                Mike Melanson
 | 
			
		||||
@@ -319,58 +254,44 @@ Muxers/Demuxers:
 | 
			
		||||
  gxf.c                                 Reimar Doeffinger
 | 
			
		||||
  gxfenc.c                              Baptiste Coudurier
 | 
			
		||||
  idcin.c                               Mike Melanson
 | 
			
		||||
  idroqdec.c                            Mike Melanson
 | 
			
		||||
  idroq.c                               Mike Melanson
 | 
			
		||||
  iff.c                                 Jaikrishnan Menon
 | 
			
		||||
  ipmovie.c                             Mike Melanson
 | 
			
		||||
  img2.c                                Michael Niedermayer
 | 
			
		||||
  iss.c                                 Stefan Gehrer
 | 
			
		||||
  jacosub*                              Clément Bœsch
 | 
			
		||||
  jvdec.c                               Peter Ross
 | 
			
		||||
  libmodplug.c                          Clément Bœsch
 | 
			
		||||
  libnut.c                              Oded Shimon
 | 
			
		||||
  lmlm4.c                               Ivo van Poorten
 | 
			
		||||
  lxfdec.c                              Tomas Härdin
 | 
			
		||||
  matroska.c                            Aurelien Jacobs
 | 
			
		||||
  matroskadec.c                         Aurelien Jacobs
 | 
			
		||||
  matroskaenc.c                         David Conrad
 | 
			
		||||
  metadata*                             Aurelien Jacobs
 | 
			
		||||
  microdvd*                             Aurelien Jacobs
 | 
			
		||||
  mm.c                                  Peter Ross
 | 
			
		||||
  mov.c                                 Michael Niedermayer, Baptiste Coudurier
 | 
			
		||||
  movenc.c                              Michael Niedermayer, Baptiste Coudurier
 | 
			
		||||
  mpc.c                                 Kostya Shishkov
 | 
			
		||||
  mpeg.c                                Michael Niedermayer
 | 
			
		||||
  mpegenc.c                             Michael Niedermayer
 | 
			
		||||
  mpegts*                               Baptiste Coudurier
 | 
			
		||||
  mpegts*                               Mans Rullgard
 | 
			
		||||
  msnwc_tcp.c                           Ramiro Polla
 | 
			
		||||
  mtv.c                                 Reynaldo H. Verdejo Pinochet
 | 
			
		||||
  mxf*                                  Baptiste Coudurier
 | 
			
		||||
  mxfdec.c                              Tomas Härdin
 | 
			
		||||
  nsvdec.c                              Francois Revol
 | 
			
		||||
  nut.c                                 Michael Niedermayer
 | 
			
		||||
  nuv.c                                 Reimar Doeffinger
 | 
			
		||||
  oggdec.c, oggdec.h                    David Conrad
 | 
			
		||||
  oggdec.c, oggdec.h                    Mans Rullgard
 | 
			
		||||
  oggenc.c                              Baptiste Coudurier
 | 
			
		||||
  oggparse*.c                           David Conrad
 | 
			
		||||
  oma.c                                 Maxim Poliakovski
 | 
			
		||||
  oggparsevorbis.c                      Mans Rullgard
 | 
			
		||||
  oggparseogm.c                         Mans Rullgard
 | 
			
		||||
  psxstr.c                              Mike Melanson
 | 
			
		||||
  pva.c                                 Ivo van Poorten
 | 
			
		||||
  r3d.c                                 Baptiste Coudurier
 | 
			
		||||
  raw.c                                 Michael Niedermayer
 | 
			
		||||
  rdt.c                                 Ronald S. Bultje
 | 
			
		||||
  rl2.c                                 Sascha Sommer
 | 
			
		||||
  rmdec.c, rmenc.c                      Ronald S. Bultje, Kostya Shishkov
 | 
			
		||||
  rtmp*                                 Kostya Shishkov
 | 
			
		||||
  rtp.c, rtpenc.c                       Martin Storsjo
 | 
			
		||||
  rtpdec_asf.*                          Ronald S. Bultje
 | 
			
		||||
  rtpenc_mpv.*, rtpenc_aac.*            Martin Storsjo
 | 
			
		||||
  rm.c                                  Roberto Togni
 | 
			
		||||
  rtp.c, rtpenc.c                       Luca Abeni
 | 
			
		||||
  rtp_mpv.*, rtp_aac.*                  Luca Abeni
 | 
			
		||||
  rtsp.c                                Luca Barbato
 | 
			
		||||
  sbgdec.c                              Nicolas George
 | 
			
		||||
  sdp.c                                 Martin Storsjo
 | 
			
		||||
  sdp.c                                 Luca Abeni
 | 
			
		||||
  segafilm.c                            Mike Melanson
 | 
			
		||||
  siff.c                                Kostya Shishkov
 | 
			
		||||
  smacker.c                             Kostya Shishkov
 | 
			
		||||
  srtdec.c                              Aurelien Jacobs
 | 
			
		||||
  swf.c                                 Baptiste Coudurier
 | 
			
		||||
  tta.c                                 Alex Beregszaszi
 | 
			
		||||
  txd.c                                 Ivo van Poorten
 | 
			
		||||
@@ -378,13 +299,9 @@ Muxers/Demuxers:
 | 
			
		||||
  wav.c                                 Michael Niedermayer
 | 
			
		||||
  wc3movie.c                            Mike Melanson
 | 
			
		||||
  westwood.c                            Mike Melanson
 | 
			
		||||
  wtv.c                                 Peter Ross
 | 
			
		||||
  wv.c                                  Kostya Shishkov
 | 
			
		||||
 | 
			
		||||
Protocols:
 | 
			
		||||
  bluray.c                              Petri Hintukainen
 | 
			
		||||
  http.c                                Ronald S. Bultje
 | 
			
		||||
  mms*.c                                Ronald S. Bultje
 | 
			
		||||
  udp.c                                 Luca Abeni
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -393,8 +310,7 @@ Operating systems / CPU architectures
 | 
			
		||||
 | 
			
		||||
Alpha                                   Mans Rullgard, Falk Hueffner
 | 
			
		||||
ARM                                     Mans Rullgard
 | 
			
		||||
AVR32                                   Mans Rullgard
 | 
			
		||||
MIPS                                    Mans Rullgard
 | 
			
		||||
BeOS                                    Francois Revol
 | 
			
		||||
Mac OS X / PowerPC                      Romain Dolbeau, Guillaume Poirier
 | 
			
		||||
Amiga / PowerPC                         Colin Ward
 | 
			
		||||
Linux / PowerPC                         Luca Barbato
 | 
			
		||||
@@ -405,43 +321,15 @@ Sparc                                   Roman Shaposhnik
 | 
			
		||||
x86                                     Michael Niedermayer
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Releases
 | 
			
		||||
========
 | 
			
		||||
GnuPG Fingerprints of maintainers and others who have svn write access
 | 
			
		||||
======================================================================
 | 
			
		||||
 | 
			
		||||
1.2                                     Michael Niedermayer
 | 
			
		||||
1.1                                     Michael Niedermayer
 | 
			
		||||
1.0                                     Michael Niedermayer
 | 
			
		||||
 | 
			
		||||
If you want to maintain an older release, please contact us
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
GnuPG Fingerprints of maintainers and contributors
 | 
			
		||||
==================================================
 | 
			
		||||
 | 
			
		||||
Anssi Hannula                 1A92 FF42 2DD9 8D2E 8AF7 65A9 4278 C520 513D F3CB
 | 
			
		||||
Anton Khirnov                 6D0C 6625 56F8 65D1 E5F5 814B B50A 1241 C067 07AB
 | 
			
		||||
Attila Kinali                 11F0 F9A6 A1D2 11F6 C745 D10C 6520 BCDD F2DF E765
 | 
			
		||||
Baptiste Coudurier            8D77 134D 20CC 9220 201F C5DB 0AC9 325C 5C1A BAAA
 | 
			
		||||
Ben Littler                   3EE3 3723 E560 3214 A8CD 4DEB 2CDB FCE7 768C 8D2C
 | 
			
		||||
Benoit Fouet                  B22A 4F4F 43EF 636B BB66 FCDC 0023 AE1E 2985 49C8
 | 
			
		||||
Bœsch Clément                 52D0 3A82 D445 F194 DB8B 2B16 87EE 2CB8 F4B8 FCF9
 | 
			
		||||
Daniel Verkamp                78A6 07ED 782C 653E C628 B8B9 F0EB 8DD8 2F0E 21C7
 | 
			
		||||
Diego Biurrun                 8227 1E31 B6D9 4994 7427 E220 9CAE D6CC 4757 FCC5
 | 
			
		||||
Gwenole Beauchesne            2E63 B3A6 3E44 37E2 017D 2704 53C7 6266 B153 99C4
 | 
			
		||||
Jaikrishnan Menon             61A1 F09F 01C9 2D45 78E1 C862 25DC 8831 AF70 D368
 | 
			
		||||
Justin Ruggles                3136 ECC0 C10D 6C04 5F43 CA29 FCBE CD2A 3787 1EBF
 | 
			
		||||
Loren Merritt                 ABD9 08F4 C920 3F65 D8BE 35D7 1540 DAA7 060F 56DE
 | 
			
		||||
Lou Logan                     7D68 DC73 CBEF EABB 671A B6CF 621C 2E28 82F8 DC3A
 | 
			
		||||
Luca Barbato                  6677 4209 213C 8843 5B67 29E7 E84C 78C2 84E9 0E34
 | 
			
		||||
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
 | 
			
		||||
Reimar Döffinger              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
 | 
			
		||||
Robert Swain                  EE7A 56EA 4A81 A7B5 2001 A521 67FA 362D A2FC 3E71
 | 
			
		||||
Sascha Sommer                 38A0 F88B 868E 9D3A 97D4 D6A0 E823 706F 1E07 0D3C
 | 
			
		||||
Stefano Sabatini              9A43 10F8 D32C D33C 48E7 C52C 5DF2 8E4D B2EE 066B
 | 
			
		||||
Stephan Hilb                  4F38 0B3A 5F39 B99B F505 E562 8D5C 5554 4E17 8863
 | 
			
		||||
Tomas Härdin                  D133 29CA 4EEC 9DB4 7076 F697 B04B 7403 3313 41FD
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										419
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										419
									
								
								Makefile
									
									
									
									
									
								
							@@ -1,79 +1,54 @@
 | 
			
		||||
MAIN_MAKEFILE=1
 | 
			
		||||
include config.mak
 | 
			
		||||
 | 
			
		||||
vpath %.c    $(SRC_PATH)
 | 
			
		||||
vpath %.cpp  $(SRC_PATH)
 | 
			
		||||
vpath %.h    $(SRC_PATH)
 | 
			
		||||
vpath %.S    $(SRC_PATH)
 | 
			
		||||
vpath %.asm  $(SRC_PATH)
 | 
			
		||||
vpath %.v    $(SRC_PATH)
 | 
			
		||||
vpath %.texi $(SRC_PATH)
 | 
			
		||||
vpath %/fate_config.sh.template $(SRC_PATH)
 | 
			
		||||
SRC_DIR = $(SRC_PATH_BARE)
 | 
			
		||||
 | 
			
		||||
vpath %.texi $(SRC_PATH_BARE)
 | 
			
		||||
 | 
			
		||||
PROGS-$(CONFIG_FFMPEG)   += ffmpeg
 | 
			
		||||
PROGS-$(CONFIG_FFPLAY)   += ffplay
 | 
			
		||||
PROGS-$(CONFIG_FFPROBE)  += ffprobe
 | 
			
		||||
PROGS-$(CONFIG_FFSERVER) += ffserver
 | 
			
		||||
 | 
			
		||||
PROGS      := $(PROGS-yes:%=%$(PROGSSUF)$(EXESUF))
 | 
			
		||||
INSTPROGS   = $(PROGS-yes:%=%$(PROGSSUF)$(EXESUF))
 | 
			
		||||
OBJS        = cmdutils.o
 | 
			
		||||
OBJS-ffmpeg = ffmpeg_opt.o ffmpeg_filter.o
 | 
			
		||||
TESTTOOLS   = audiogen videogen rotozoom tiny_psnr base64
 | 
			
		||||
HOSTPROGS  := $(TESTTOOLS:%=tests/%) doc/print_options
 | 
			
		||||
TOOLS       = qt-faststart trasher
 | 
			
		||||
TOOLS-$(CONFIG_ZLIB) += cws2fws
 | 
			
		||||
PROGS       = $(addsuffix   $(EXESUF), $(PROGS-yes))
 | 
			
		||||
PROGS_G     = $(addsuffix _g$(EXESUF), $(PROGS-yes))
 | 
			
		||||
OBJS        = $(addsuffix .o,          $(PROGS-yes)) cmdutils.o
 | 
			
		||||
MANPAGES    = $(addprefix doc/, $(addsuffix .1, $(PROGS-yes)))
 | 
			
		||||
 | 
			
		||||
BASENAMES   = ffmpeg ffplay ffprobe ffserver
 | 
			
		||||
ALLPROGS    = $(BASENAMES:%=%$(PROGSSUF)$(EXESUF))
 | 
			
		||||
ALLPROGS_G  = $(BASENAMES:%=%$(PROGSSUF)_g$(EXESUF))
 | 
			
		||||
ALLMANPAGES = $(BASENAMES:%=%.1)
 | 
			
		||||
BASENAMES   = ffmpeg ffplay ffserver
 | 
			
		||||
ALLPROGS    = $(addsuffix   $(EXESUF), $(BASENAMES))
 | 
			
		||||
ALLPROGS_G  = $(addsuffix _g$(EXESUF), $(BASENAMES))
 | 
			
		||||
ALLMANPAGES = $(addsuffix .1, $(BASENAMES))
 | 
			
		||||
 | 
			
		||||
FFLIBS-$(CONFIG_AVDEVICE) += avdevice
 | 
			
		||||
FFLIBS-$(CONFIG_AVFILTER) += avfilter
 | 
			
		||||
FFLIBS-$(CONFIG_AVFORMAT) += avformat
 | 
			
		||||
FFLIBS-$(CONFIG_AVRESAMPLE) += avresample
 | 
			
		||||
FFLIBS-$(CONFIG_AVCODEC)  += avcodec
 | 
			
		||||
FFLIBS-$(CONFIG_POSTPROC) += postproc
 | 
			
		||||
FFLIBS-$(CONFIG_SWRESAMPLE)+= swresample
 | 
			
		||||
FFLIBS-$(CONFIG_SWSCALE)  += swscale
 | 
			
		||||
 | 
			
		||||
FFLIBS := avutil
 | 
			
		||||
FFLIBS := avdevice avformat avcodec avutil
 | 
			
		||||
 | 
			
		||||
DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.ffpreset) $(SRC_PATH)/doc/ffprobe.xsd
 | 
			
		||||
EXAMPLES_FILES := $(wildcard $(SRC_PATH)/doc/examples/*.c) $(SRC_PATH)/doc/examples/Makefile
 | 
			
		||||
DATA_FILES := $(wildcard $(SRC_DIR)/ffpresets/*.ffpreset)
 | 
			
		||||
 | 
			
		||||
SKIPHEADERS = cmdutils_common_opts.h
 | 
			
		||||
 | 
			
		||||
include $(SRC_PATH)/common.mak
 | 
			
		||||
include common.mak
 | 
			
		||||
 | 
			
		||||
FF_LDFLAGS   := $(FFLDFLAGS)
 | 
			
		||||
FF_EXTRALIBS := $(FFEXTRALIBS)
 | 
			
		||||
FF_DEP_LIBS  := $(DEP_LIBS)
 | 
			
		||||
 | 
			
		||||
all: $(PROGS)
 | 
			
		||||
ALL_TARGETS-$(CONFIG_VHOOK) += videohook
 | 
			
		||||
ALL_TARGETS-$(BUILD_DOC)    += documentation
 | 
			
		||||
 | 
			
		||||
INSTALL_TARGETS-$(CONFIG_VHOOK) += install-vhook
 | 
			
		||||
ifneq ($(PROGS),)
 | 
			
		||||
INSTALL_TARGETS-yes             += install-progs install-data
 | 
			
		||||
INSTALL_TARGETS-$(BUILD_DOC)    += install-man
 | 
			
		||||
endif
 | 
			
		||||
INSTALL_PROGS_TARGETS-$(BUILD_SHARED) = install-libs
 | 
			
		||||
 | 
			
		||||
all: $(FF_DEP_LIBS) $(PROGS) $(ALL_TARGETS-yes)
 | 
			
		||||
 | 
			
		||||
$(PROGS): %$(EXESUF): %_g$(EXESUF)
 | 
			
		||||
	$(CP) $< $@
 | 
			
		||||
	cp -p $< $@
 | 
			
		||||
	$(STRIP) $@
 | 
			
		||||
 | 
			
		||||
$(TOOLS): %$(EXESUF): %.o
 | 
			
		||||
	$(LD) $(LDFLAGS) $(LD_O) $< $(ELIBS)
 | 
			
		||||
 | 
			
		||||
tools/cws2fws$(EXESUF): ELIBS = $(ZLIB)
 | 
			
		||||
 | 
			
		||||
config.h: .config
 | 
			
		||||
.config: $(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c))
 | 
			
		||||
	@-tput bold 2>/dev/null
 | 
			
		||||
	@-printf '\nWARNING: $(?F) newer than config.h, rerun configure\n\n'
 | 
			
		||||
	@-tput sgr0 2>/dev/null
 | 
			
		||||
 | 
			
		||||
SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS TOOLS      \
 | 
			
		||||
               ARCH_HEADERS BUILT_HEADERS SKIPHEADERS                    \
 | 
			
		||||
               ARMV5TE-OBJS ARMV6-OBJS ARMVFP-OBJS NEON-OBJS             \
 | 
			
		||||
               MMI-OBJS ALTIVEC-OBJS VIS-OBJS                            \
 | 
			
		||||
               MMX-OBJS YASM-OBJS                                        \
 | 
			
		||||
               MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSPR1-OBJS MIPS32R2-OBJS  \
 | 
			
		||||
               OBJS HOSTOBJS TESTOBJS
 | 
			
		||||
SUBDIR_VARS := OBJS FFLIBS CLEANFILES DIRS TESTS
 | 
			
		||||
 | 
			
		||||
define RESET
 | 
			
		||||
$(1) :=
 | 
			
		||||
@@ -83,111 +58,303 @@ endef
 | 
			
		||||
define DOSUBDIR
 | 
			
		||||
$(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
 | 
			
		||||
SUBDIR := $(1)/
 | 
			
		||||
include $(SRC_PATH)/$(1)/Makefile
 | 
			
		||||
-include $(SRC_PATH)/$(1)/$(ARCH)/Makefile
 | 
			
		||||
include $(SRC_PATH)/library.mak
 | 
			
		||||
include $(1)/Makefile
 | 
			
		||||
endef
 | 
			
		||||
 | 
			
		||||
$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
 | 
			
		||||
 | 
			
		||||
define DOPROG
 | 
			
		||||
OBJS-$(1) += $(1).o
 | 
			
		||||
$(1)$(PROGSSUF)_g$(EXESUF): $(OBJS-$(1))
 | 
			
		||||
$$(OBJS-$(1)): CFLAGS  += $(CFLAGS-$(1))
 | 
			
		||||
$(1)$(PROGSSUF)_g$(EXESUF): LDFLAGS += $(LDFLAGS-$(1))
 | 
			
		||||
$(1)$(PROGSSUF)_g$(EXESUF): FF_EXTRALIBS += $(LIBS-$(1))
 | 
			
		||||
-include $$(OBJS-$(1):.o=.d)
 | 
			
		||||
endef
 | 
			
		||||
ffplay_g$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS)
 | 
			
		||||
ffserver_g$(EXESUF): FF_LDFLAGS += $(FFSERVERLDFLAGS)
 | 
			
		||||
 | 
			
		||||
$(foreach P,$(PROGS-yes),$(eval $(call DOPROG,$(P))))
 | 
			
		||||
%_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
 | 
			
		||||
	$(CC) $(FF_LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
 | 
			
		||||
 | 
			
		||||
%$(PROGSSUF)_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
 | 
			
		||||
	$(LD) $(LDFLAGS) $(LD_O) $(OBJS-$*) cmdutils.o $(FF_EXTRALIBS)
 | 
			
		||||
output_example$(EXESUF): output_example.o $(FF_DEP_LIBS)
 | 
			
		||||
	$(CC) $(CFLAGS) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
 | 
			
		||||
 | 
			
		||||
OBJDIRS += tools
 | 
			
		||||
tools/%$(EXESUF): tools/%.c
 | 
			
		||||
	$(CC) $(CFLAGS) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
 | 
			
		||||
 | 
			
		||||
-include $(wildcard tools/*.d)
 | 
			
		||||
ffplay.o ffplay.d: CFLAGS += $(SDL_CFLAGS)
 | 
			
		||||
 | 
			
		||||
VERSION_SH  = $(SRC_PATH)/version.sh
 | 
			
		||||
GIT_LOG     = $(SRC_PATH)/.git/logs/HEAD
 | 
			
		||||
cmdutils.o cmdutils.d: version.h
 | 
			
		||||
 | 
			
		||||
.version: $(wildcard $(GIT_LOG)) $(VERSION_SH) config.mak
 | 
			
		||||
.version: M=@
 | 
			
		||||
alltools: $(addsuffix $(EXESUF),$(addprefix tools/, cws2fws pktdumper qt-faststart trasher))
 | 
			
		||||
 | 
			
		||||
version.h .version:
 | 
			
		||||
	$(M)$(VERSION_SH) $(SRC_PATH) version.h $(EXTRA_VERSION)
 | 
			
		||||
	$(Q)touch .version
 | 
			
		||||
VHOOKCFLAGS += $(filter-out -mdynamic-no-pic,$(CFLAGS))
 | 
			
		||||
 | 
			
		||||
# force version.sh to run whenever version might have changed
 | 
			
		||||
-include .version
 | 
			
		||||
BASEHOOKS = fish null watermark
 | 
			
		||||
ALLHOOKS = $(BASEHOOKS) drawtext imlib2 ppm
 | 
			
		||||
ALLHOOKS_SRCS = $(addprefix vhook/, $(addsuffix .c, $(ALLHOOKS)))
 | 
			
		||||
 | 
			
		||||
ifdef PROGS
 | 
			
		||||
install: install-progs install-data
 | 
			
		||||
endif
 | 
			
		||||
HOOKS-$(HAVE_FORK)      += ppm
 | 
			
		||||
HOOKS-$(HAVE_IMLIB2)    += imlib2
 | 
			
		||||
HOOKS-$(HAVE_FREETYPE2) += drawtext
 | 
			
		||||
 | 
			
		||||
install: install-libs install-headers
 | 
			
		||||
HOOKS = $(addprefix vhook/, $(addsuffix $(SLIBSUF), $(BASEHOOKS) $(HOOKS-yes)))
 | 
			
		||||
 | 
			
		||||
install-libs: install-libs-yes
 | 
			
		||||
VHOOKCFLAGS-$(HAVE_IMLIB2) += `imlib2-config --cflags`
 | 
			
		||||
LIBS_imlib2$(SLIBSUF)       = `imlib2-config --libs`
 | 
			
		||||
 | 
			
		||||
install-progs-yes:
 | 
			
		||||
install-progs-$(CONFIG_SHARED): install-libs
 | 
			
		||||
VHOOKCFLAGS-$(HAVE_FREETYPE2) += `freetype-config --cflags`
 | 
			
		||||
LIBS_drawtext$(SLIBSUF)        = `freetype-config --libs`
 | 
			
		||||
 | 
			
		||||
install-progs: install-progs-yes $(PROGS)
 | 
			
		||||
	$(Q)mkdir -p "$(BINDIR)"
 | 
			
		||||
	$(INSTALL) -c -m 755 $(INSTPROGS) "$(BINDIR)"
 | 
			
		||||
VHOOKCFLAGS += $(VHOOKCFLAGS-yes)
 | 
			
		||||
 | 
			
		||||
install-data: $(DATA_FILES) $(EXAMPLES_FILES)
 | 
			
		||||
	$(Q)mkdir -p "$(DATADIR)/examples"
 | 
			
		||||
	$(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
 | 
			
		||||
	$(INSTALL) -m 644 $(EXAMPLES_FILES) "$(DATADIR)/examples"
 | 
			
		||||
vhook/%.o vhook/%.d: CFLAGS:=$(VHOOKCFLAGS)
 | 
			
		||||
 | 
			
		||||
uninstall: uninstall-libs uninstall-headers uninstall-progs uninstall-data
 | 
			
		||||
# vhooks compile fine without libav*, but need them nonetheless.
 | 
			
		||||
videohook: $(FF_DEP_LIBS) $(HOOKS)
 | 
			
		||||
 | 
			
		||||
$(eval VHOOKSHFLAGS=$(VHOOKSHFLAGS))
 | 
			
		||||
vhook/%$(SLIBSUF): vhook/%.o
 | 
			
		||||
	$(CC) $(LDFLAGS) -o $@ $(VHOOKSHFLAGS) $< $(VHOOKLIBS) $(LIBS_$(@F))
 | 
			
		||||
 | 
			
		||||
VHOOK_DEPS = $(HOOKS:$(SLIBSUF)=.d)
 | 
			
		||||
depend dep: $(VHOOK_DEPS)
 | 
			
		||||
 | 
			
		||||
documentation: $(addprefix doc/, ffmpeg-doc.html faq.html ffserver-doc.html \
 | 
			
		||||
                                 ffplay-doc.html general.html hooks.html \
 | 
			
		||||
                                 $(ALLMANPAGES))
 | 
			
		||||
 | 
			
		||||
doc/%.html: doc/%.texi
 | 
			
		||||
	texi2html -monolithic -number $<
 | 
			
		||||
	mv $(@F) $@
 | 
			
		||||
 | 
			
		||||
doc/%.pod: doc/%-doc.texi
 | 
			
		||||
	doc/texi2pod.pl $< $@
 | 
			
		||||
 | 
			
		||||
doc/%.1: doc/%.pod
 | 
			
		||||
	pod2man --section=1 --center=" " --release=" " $< > $@
 | 
			
		||||
 | 
			
		||||
install: $(INSTALL_TARGETS-yes)
 | 
			
		||||
 | 
			
		||||
install-progs: $(PROGS) $(INSTALL_PROGS_TARGETS-yes)
 | 
			
		||||
	install -d "$(BINDIR)"
 | 
			
		||||
	install -c -m 755 $(PROGS) "$(BINDIR)"
 | 
			
		||||
 | 
			
		||||
install-data: $(DATA_FILES)
 | 
			
		||||
	install -d "$(DATADIR)"
 | 
			
		||||
	install -m 644 $(DATA_FILES) "$(DATADIR)"
 | 
			
		||||
 | 
			
		||||
install-man: $(MANPAGES)
 | 
			
		||||
	install -d "$(MANDIR)/man1"
 | 
			
		||||
	install -m 644 $(MANPAGES) "$(MANDIR)/man1"
 | 
			
		||||
 | 
			
		||||
install-vhook: videohook
 | 
			
		||||
	install -d "$(SHLIBDIR)/vhook"
 | 
			
		||||
	install -m 755 $(HOOKS) "$(SHLIBDIR)/vhook"
 | 
			
		||||
 | 
			
		||||
uninstall: uninstall-progs uninstall-data uninstall-man uninstall-vhook
 | 
			
		||||
 | 
			
		||||
uninstall-progs:
 | 
			
		||||
	$(RM) $(addprefix "$(BINDIR)/", $(ALLPROGS))
 | 
			
		||||
	rm -f $(addprefix "$(BINDIR)/", $(ALLPROGS))
 | 
			
		||||
 | 
			
		||||
uninstall-data:
 | 
			
		||||
	$(RM) -r "$(DATADIR)"
 | 
			
		||||
	rm -rf "$(DATADIR)"
 | 
			
		||||
 | 
			
		||||
clean::
 | 
			
		||||
	$(RM) $(ALLPROGS) $(ALLPROGS_G)
 | 
			
		||||
	$(RM) $(CLEANSUFFIXES)
 | 
			
		||||
	$(RM) $(TOOLS)
 | 
			
		||||
	$(RM) $(CLEANSUFFIXES:%=tools/%)
 | 
			
		||||
	$(RM) coverage.info
 | 
			
		||||
	$(RM) -r coverage-html
 | 
			
		||||
uninstall-man:
 | 
			
		||||
	rm -f $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
 | 
			
		||||
 | 
			
		||||
uninstall-vhook:
 | 
			
		||||
	rm -f $(addprefix "$(SHLIBDIR)/",$(ALLHOOKS_SRCS:.c=$(SLIBSUF)))
 | 
			
		||||
	-rmdir "$(SHLIBDIR)/vhook/"
 | 
			
		||||
 | 
			
		||||
testclean:
 | 
			
		||||
	rm -rf tests/vsynth1 tests/vsynth2 tests/data tests/asynth1.sw tests/*~
 | 
			
		||||
 | 
			
		||||
clean:: testclean
 | 
			
		||||
	rm -f $(ALLPROGS) $(ALLPROGS_G) output_example$(EXESUF)
 | 
			
		||||
	rm -f doc/*.html doc/*.pod doc/*.1
 | 
			
		||||
	rm -f $(addprefix tests/,$(addsuffix $(EXESUF),audiogen videogen rotozoom seek_test tiny_psnr))
 | 
			
		||||
	rm -f $(addprefix tools/,$(addsuffix $(EXESUF),cws2fws pktdumper qt-faststart trasher))
 | 
			
		||||
	rm -f vhook/*.o vhook/*~ vhook/*.so vhook/*.dylib vhook/*.dll
 | 
			
		||||
 | 
			
		||||
distclean::
 | 
			
		||||
	$(RM) $(DISTCLEANSUFFIXES)
 | 
			
		||||
	$(RM) config.* .version version.h libavutil/avconfig.h libavcodec/codec_names.h
 | 
			
		||||
	rm -f version.h config.* vhook/*.d
 | 
			
		||||
 | 
			
		||||
config:
 | 
			
		||||
	$(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)
 | 
			
		||||
# regression tests
 | 
			
		||||
 | 
			
		||||
# Without the sed genthml thinks "libavutil" and "./libavutil" are two different things
 | 
			
		||||
coverage.info: $(wildcard *.gcda *.gcno */*.gcda */*.gcno */*/*.gcda */*/*.gcno)
 | 
			
		||||
	$(Q)lcov -c -d . -b . | sed -e 's#/./#/#g' > $@
 | 
			
		||||
check: test checkheaders
 | 
			
		||||
 | 
			
		||||
coverage-html: coverage.info
 | 
			
		||||
	$(Q)mkdir -p $@
 | 
			
		||||
	$(Q)genhtml -o $@ $<
 | 
			
		||||
	$(Q)touch $@
 | 
			
		||||
fulltest test: codectest libavtest seektest
 | 
			
		||||
 | 
			
		||||
check: all alltools examples testprogs fate
 | 
			
		||||
FFMPEG_REFFILE   = $(SRC_PATH)/tests/ffmpeg.regression.ref
 | 
			
		||||
FFSERVER_REFFILE = $(SRC_PATH)/tests/ffserver.regression.ref
 | 
			
		||||
LIBAV_REFFILE    = $(SRC_PATH)/tests/libav.regression.ref
 | 
			
		||||
ROTOZOOM_REFFILE = $(SRC_PATH)/tests/rotozoom.regression.ref
 | 
			
		||||
SEEK_REFFILE     = $(SRC_PATH)/tests/seek.regression.ref
 | 
			
		||||
 | 
			
		||||
include $(SRC_PATH)/doc/Makefile
 | 
			
		||||
include $(SRC_PATH)/tests/Makefile
 | 
			
		||||
CODEC_TESTS = $(addprefix regtest-,             \
 | 
			
		||||
        mpeg                                    \
 | 
			
		||||
        mpeg2                                   \
 | 
			
		||||
        mpeg2thread                             \
 | 
			
		||||
        msmpeg4v2                               \
 | 
			
		||||
        msmpeg4                                 \
 | 
			
		||||
        wmv1                                    \
 | 
			
		||||
        wmv2                                    \
 | 
			
		||||
        h261                                    \
 | 
			
		||||
        h263                                    \
 | 
			
		||||
        h263p                                   \
 | 
			
		||||
        mpeg4                                   \
 | 
			
		||||
        huffyuv                                 \
 | 
			
		||||
        rc                                      \
 | 
			
		||||
        mpeg4adv                                \
 | 
			
		||||
        mpeg4thread                             \
 | 
			
		||||
        error                                   \
 | 
			
		||||
        mpeg4nr                                 \
 | 
			
		||||
        mpeg1b                                  \
 | 
			
		||||
        mjpeg                                   \
 | 
			
		||||
        ljpeg                                   \
 | 
			
		||||
        jpegls                                  \
 | 
			
		||||
        rv10                                    \
 | 
			
		||||
        rv20                                    \
 | 
			
		||||
        asv1                                    \
 | 
			
		||||
        asv2                                    \
 | 
			
		||||
        flv                                     \
 | 
			
		||||
        ffv1                                    \
 | 
			
		||||
        snow                                    \
 | 
			
		||||
        snowll                                  \
 | 
			
		||||
        dv                                      \
 | 
			
		||||
        dv50                                    \
 | 
			
		||||
        svq1                                    \
 | 
			
		||||
        flashsv                                 \
 | 
			
		||||
        mp2                                     \
 | 
			
		||||
        ac3                                     \
 | 
			
		||||
        g726                                    \
 | 
			
		||||
        adpcm_ima_wav                           \
 | 
			
		||||
        adpcm_ima_qt                            \
 | 
			
		||||
        adpcm_ms                                \
 | 
			
		||||
        adpcm_yam                               \
 | 
			
		||||
        adpcm_swf                               \
 | 
			
		||||
        flac                                    \
 | 
			
		||||
        wma                                     \
 | 
			
		||||
        pcm                                     \
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
$(sort $(OBJDIRS)):
 | 
			
		||||
	$(Q)mkdir -p $@
 | 
			
		||||
LAVF_TESTS = $(addprefix regtest-,              \
 | 
			
		||||
        avi                                     \
 | 
			
		||||
        asf                                     \
 | 
			
		||||
        rm                                      \
 | 
			
		||||
        mpg                                     \
 | 
			
		||||
        ts                                      \
 | 
			
		||||
        swf                                     \
 | 
			
		||||
        ffm                                     \
 | 
			
		||||
        flv_fmt                                 \
 | 
			
		||||
        mov                                     \
 | 
			
		||||
        dv_fmt                                  \
 | 
			
		||||
        gxf                                     \
 | 
			
		||||
        nut                                     \
 | 
			
		||||
        mkv                                     \
 | 
			
		||||
        pbmpipe                                 \
 | 
			
		||||
        pgmpipe                                 \
 | 
			
		||||
        ppmpipe                                 \
 | 
			
		||||
        gif                                     \
 | 
			
		||||
        yuv4mpeg                                \
 | 
			
		||||
        pgm                                     \
 | 
			
		||||
        ppm                                     \
 | 
			
		||||
        bmp                                     \
 | 
			
		||||
        tga                                     \
 | 
			
		||||
        tiff                                    \
 | 
			
		||||
        sgi                                     \
 | 
			
		||||
        jpg                                     \
 | 
			
		||||
        wav                                     \
 | 
			
		||||
        alaw                                    \
 | 
			
		||||
        mulaw                                   \
 | 
			
		||||
        au                                      \
 | 
			
		||||
        mmf                                     \
 | 
			
		||||
        aiff                                    \
 | 
			
		||||
        voc                                     \
 | 
			
		||||
        ogg                                     \
 | 
			
		||||
        pixfmt                                  \
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
# Dummy rule to stop make trying to rebuild removed or renamed headers
 | 
			
		||||
%.h:
 | 
			
		||||
	@:
 | 
			
		||||
REGFILES = $(addprefix tests/data/,$(addsuffix .$(1),$(2:regtest-%=%)))
 | 
			
		||||
 | 
			
		||||
# Disable suffix rules.  Most of the builtin rules are suffix rules,
 | 
			
		||||
# so this saves some time on slow systems.
 | 
			
		||||
.SUFFIXES:
 | 
			
		||||
CODEC_ROTOZOOM = $(call REGFILES,rotozoom.regression,$(CODEC_TESTS))
 | 
			
		||||
CODEC_VSYNTH   = $(call REGFILES,vsynth.regression,$(CODEC_TESTS))
 | 
			
		||||
 | 
			
		||||
.PHONY: all all-yes alltools check *clean config install*
 | 
			
		||||
.PHONY: testprogs uninstall*
 | 
			
		||||
LAVF_REGFILES = $(call REGFILES,lavf.regression,$(LAVF_TESTS))
 | 
			
		||||
 | 
			
		||||
LAVF_REG     = tests/data/lavf.regression
 | 
			
		||||
ROTOZOOM_REG = tests/data/rotozoom.regression
 | 
			
		||||
VSYNTH_REG   = tests/data/vsynth.regression
 | 
			
		||||
 | 
			
		||||
ifneq ($(CONFIG_SWSCALE),yes)
 | 
			
		||||
servertest codectest $(CODEC_TESTS) libavtest: swscale-error
 | 
			
		||||
swscale-error:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo "This regression test requires --enable-swscale."
 | 
			
		||||
	@echo
 | 
			
		||||
	@exit 1
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
ifneq ($(CONFIG_ZLIB),yes)
 | 
			
		||||
regtest-flashsv codectest: zlib-error
 | 
			
		||||
endif
 | 
			
		||||
zlib-error:
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo "This regression test requires zlib."
 | 
			
		||||
	@echo
 | 
			
		||||
	@exit 1
 | 
			
		||||
 | 
			
		||||
codectest: $(VSYNTH_REG) $(ROTOZOOM_REG)
 | 
			
		||||
	diff -u -w $(FFMPEG_REFFILE)   $(VSYNTH_REG)
 | 
			
		||||
	diff -u -w $(ROTOZOOM_REFFILE) $(ROTOZOOM_REG)
 | 
			
		||||
 | 
			
		||||
libavtest: $(LAVF_REG)
 | 
			
		||||
	diff -u -w $(LIBAV_REFFILE) $(LAVF_REG)
 | 
			
		||||
 | 
			
		||||
$(VSYNTH_REG) $(ROTOZOOM_REG) $(LAVF_REG):
 | 
			
		||||
	cat $^ > $@
 | 
			
		||||
 | 
			
		||||
$(LAVF_REG):     $(LAVF_REGFILES)
 | 
			
		||||
$(ROTOZOOM_REG): $(CODEC_ROTOZOOM)
 | 
			
		||||
$(VSYNTH_REG):   $(CODEC_VSYNTH)
 | 
			
		||||
 | 
			
		||||
$(CODEC_VSYNTH) $(CODEC_ROTOZOOM): $(CODEC_TESTS)
 | 
			
		||||
 | 
			
		||||
$(LAVF_REGFILES): $(LAVF_TESTS)
 | 
			
		||||
 | 
			
		||||
$(CODEC_TESTS) $(LAVF_TESTS): regtest-ref
 | 
			
		||||
 | 
			
		||||
regtest-ref: ffmpeg$(EXESUF) tests/vsynth1/00.pgm tests/vsynth2/00.pgm tests/asynth1.sw
 | 
			
		||||
 | 
			
		||||
$(CODEC_TESTS) regtest-ref: tests/tiny_psnr$(EXESUF)
 | 
			
		||||
	$(SRC_PATH)/tests/regression.sh $@ vsynth   tests/vsynth1 a "$(TARGET_EXEC)" "$(TARGET_PATH)"
 | 
			
		||||
	$(SRC_PATH)/tests/regression.sh $@ rotozoom tests/vsynth2 a "$(TARGET_EXEC)" "$(TARGET_PATH)"
 | 
			
		||||
 | 
			
		||||
$(LAVF_TESTS):
 | 
			
		||||
	$(SRC_PATH)/tests/regression.sh $@ lavf tests/vsynth1 b "$(TARGET_EXEC)" "$(TARGET_PATH)"
 | 
			
		||||
 | 
			
		||||
seektest: codectest libavtest tests/seek_test$(EXESUF)
 | 
			
		||||
	$(SRC_PATH)/tests/seek_test.sh $(SEEK_REFFILE) "$(TARGET_EXEC)" "$(TARGET_PATH)"
 | 
			
		||||
 | 
			
		||||
servertest: ffserver$(EXESUF) tests/vsynth1/00.pgm tests/asynth1.sw
 | 
			
		||||
	@echo
 | 
			
		||||
	@echo "Unfortunately ffserver is broken and therefore its regression"
 | 
			
		||||
	@echo "test fails randomly. Treat the results accordingly."
 | 
			
		||||
	@echo
 | 
			
		||||
	$(SRC_PATH)/tests/server-regression.sh $(FFSERVER_REFFILE) $(SRC_PATH)/tests/test.conf
 | 
			
		||||
 | 
			
		||||
tests/vsynth1/00.pgm: tests/videogen$(EXESUF)
 | 
			
		||||
	mkdir -p tests/vsynth1
 | 
			
		||||
	$(BUILD_ROOT)/$< 'tests/vsynth1/'
 | 
			
		||||
 | 
			
		||||
tests/vsynth2/00.pgm: tests/rotozoom$(EXESUF)
 | 
			
		||||
	mkdir -p tests/vsynth2
 | 
			
		||||
	$(BUILD_ROOT)/$< 'tests/vsynth2/' $(SRC_PATH)/tests/lena.pnm
 | 
			
		||||
 | 
			
		||||
tests/asynth1.sw: tests/audiogen$(EXESUF)
 | 
			
		||||
	$(BUILD_ROOT)/$< $@
 | 
			
		||||
 | 
			
		||||
tests/%$(EXESUF): tests/%.c
 | 
			
		||||
	$(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $< $(HOSTLIBS)
 | 
			
		||||
 | 
			
		||||
tests/seek_test$(EXESUF): tests/seek_test.c $(FF_DEP_LIBS)
 | 
			
		||||
	$(CC) $(FF_LDFLAGS) $(CFLAGS) -o $@ $< $(FF_EXTRALIBS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
.PHONY: lib videohook documentation *test regtest-* swscale-error zlib-error alltools check
 | 
			
		||||
 | 
			
		||||
-include $(VHOOK_DEPS)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										8
									
								
								README
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								README
									
									
									
									
									
								
							@@ -4,15 +4,9 @@ FFmpeg README
 | 
			
		||||
1) Documentation
 | 
			
		||||
----------------
 | 
			
		||||
 | 
			
		||||
* Read the documentation in the doc/ directory in git.
 | 
			
		||||
  You can also view it online at http://ffmpeg.org/documentation.html
 | 
			
		||||
* Read the documentation in the doc/ directory.
 | 
			
		||||
 | 
			
		||||
2) Licensing
 | 
			
		||||
------------
 | 
			
		||||
 | 
			
		||||
* See the LICENSE file.
 | 
			
		||||
 | 
			
		||||
3) Build and Install
 | 
			
		||||
--------------------
 | 
			
		||||
 | 
			
		||||
* See the INSTALL file.
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										235
									
								
								RELEASE
									
									
									
									
									
								
							
							
						
						
									
										235
									
								
								RELEASE
									
									
									
									
									
								
							@@ -1 +1,234 @@
 | 
			
		||||
1.0.7
 | 
			
		||||
Release Notes
 | 
			
		||||
=============
 | 
			
		||||
 | 
			
		||||
* 0.5 "Bike Shed World Domination" March 3, 2009
 | 
			
		||||
 | 
			
		||||
General notes
 | 
			
		||||
-------------
 | 
			
		||||
 | 
			
		||||
It has been so long since the last release that this should be considered the
 | 
			
		||||
first FFmpeg release of recent times. Because of the way things have unfolded to
 | 
			
		||||
date, the notes for this version cannot be entirely conventional.
 | 
			
		||||
 | 
			
		||||
See the Changelog file for a list of significant changes.
 | 
			
		||||
 | 
			
		||||
Please note that our policy on bug reports has not changed. We still only accept
 | 
			
		||||
bug reports against HEAD of the FFmpeg trunk repository. If you are experiencing
 | 
			
		||||
any issues with any formally released version of FFmpeg, please try a current
 | 
			
		||||
version of the development code to check if the issue still exists. If it does,
 | 
			
		||||
make your report against the development code following the usual bug reporting
 | 
			
		||||
guidelines.
 | 
			
		||||
 | 
			
		||||
API notes
 | 
			
		||||
---------
 | 
			
		||||
 | 
			
		||||
In the next release, it is intended to remove a number of deprecated APIs. We
 | 
			
		||||
decided to put out a release that includes said APIs for the benefit of third
 | 
			
		||||
party software.
 | 
			
		||||
 | 
			
		||||
As such, this release:
 | 
			
		||||
- provides a sync point for said APIs
 | 
			
		||||
- increases awareness of API changes
 | 
			
		||||
- allows the next release to detail how to transition from the old to the new
 | 
			
		||||
 | 
			
		||||
The deprecated APIs to be removed are:
 | 
			
		||||
- imgconvert (to be replaced by libswscale)
 | 
			
		||||
- vhook (to be replaced by libavfilter)
 | 
			
		||||
 | 
			
		||||
If at all possible, do not use the deprecated APIs. All notes on API changes
 | 
			
		||||
should appear in doc/APIchanges.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
* 0.5.1 March 2, 2010
 | 
			
		||||
 | 
			
		||||
General notes
 | 
			
		||||
-------------
 | 
			
		||||
 | 
			
		||||
This point release includes some minor updates to make the 0.5 release series
 | 
			
		||||
usable for users that need to retain the existing behavior as closely as
 | 
			
		||||
possible. The changes follow below:
 | 
			
		||||
 | 
			
		||||
Security fixes
 | 
			
		||||
--------------
 | 
			
		||||
 | 
			
		||||
Various programming errors in container and codec implementations
 | 
			
		||||
may lead to denial of service or the execution of arbitrary code
 | 
			
		||||
if the user is tricked into opening a malformed media file or stream.
 | 
			
		||||
 | 
			
		||||
Affected and updated have been the implementations of the following
 | 
			
		||||
codecs and container formats:
 | 
			
		||||
 | 
			
		||||
 - the Vorbis audio codec
 | 
			
		||||
 - the FF Video 1 codec
 | 
			
		||||
 - the MPEG audio codec
 | 
			
		||||
 - the H264 video codec
 | 
			
		||||
 - the MLP codec
 | 
			
		||||
 - the HuffYUV codec
 | 
			
		||||
 - the ASF demuxer
 | 
			
		||||
 - the Ogg container implementation
 | 
			
		||||
 - the MOV container implementation
 | 
			
		||||
 | 
			
		||||
Symbol Versioning enabled
 | 
			
		||||
-------------------------
 | 
			
		||||
 | 
			
		||||
The backported symbol versioning change is enabled on platforms that support
 | 
			
		||||
it. This allows users to upgrade from 0.5.1 to the upcoming 0.6 release
 | 
			
		||||
without having to recompile their applications. Please note that distributors
 | 
			
		||||
have to recompile applications against 0.5.1 before upgrading to 0.6.
 | 
			
		||||
 | 
			
		||||
libx264.c backport
 | 
			
		||||
------------------
 | 
			
		||||
 | 
			
		||||
This release includes a backport to the libx264 wrapper that allows FFmpeg to
 | 
			
		||||
be compiled against newer versions of libx264 up to API version 85.
 | 
			
		||||
 | 
			
		||||
licensing changes
 | 
			
		||||
-----------------
 | 
			
		||||
 | 
			
		||||
Previously both libswscale and our AC-3 decoder had GPLed parts. These have
 | 
			
		||||
been replaced by fresh LGPL code. x86 optimizations for libswscale remain GPL,
 | 
			
		||||
but the C code is fully functional. Optimizations for other architectures have
 | 
			
		||||
been relicensed to LGPL.
 | 
			
		||||
 | 
			
		||||
AMR-NB decoding/encoding and AMR-WB decoding is now possible through the free
 | 
			
		||||
software OpenCORE libraries as an alternative to the non-free libamr libraries.
 | 
			
		||||
 | 
			
		||||
We found out that libfaac contains non-free parts and is not LGPL as previously
 | 
			
		||||
claimed. We have changed configure to reflect this. You now have to pass the
 | 
			
		||||
--enable-nonfree option if you wish to compile with libfaac support enabled.
 | 
			
		||||
 | 
			
		||||
Furthermore the non-free bits in libavcodec/fdctref.c have been rewritten. Note
 | 
			
		||||
well that they were only used in a test program and never compiled into any
 | 
			
		||||
FFmpeg library.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
* 0.5.2 May 25, 2010
 | 
			
		||||
 | 
			
		||||
General notes
 | 
			
		||||
-------------
 | 
			
		||||
 | 
			
		||||
This is a maintenance-only release that addresses a small number of security
 | 
			
		||||
and portability issues. Distributors and system integrators are encouraged
 | 
			
		||||
to update and share their patches against this branch.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
* 0.5.3 Oct 18, 2010
 | 
			
		||||
 | 
			
		||||
General notes
 | 
			
		||||
-------------
 | 
			
		||||
 | 
			
		||||
This is (again) another maintenance-only release that addresses a fix
 | 
			
		||||
for seekable HTTP and an exploitable bug in the FLIC decoder
 | 
			
		||||
(cf. CVE-2010-3429 for details). Distributors and system integrators are
 | 
			
		||||
encouraged to update and share their patches against this branch.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
* 0.5.4 Mar 17, 2011
 | 
			
		||||
 | 
			
		||||
General notes
 | 
			
		||||
-------------
 | 
			
		||||
 | 
			
		||||
This is the first release that we cut after git migration. It is another
 | 
			
		||||
maintenance-only release that addresses several security issues that were
 | 
			
		||||
brought to our attention. In detail, fixes for RV30/40, WMV, Vorbis and
 | 
			
		||||
VC-1 have been backported from trunk. Distributors and system integrators
 | 
			
		||||
are encouraged to update and share their patches against this branch.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
* 0.5.5 Nov 6, 2011
 | 
			
		||||
 | 
			
		||||
General notes
 | 
			
		||||
-------------
 | 
			
		||||
 | 
			
		||||
This maintenance-only release addresses several security issues that
 | 
			
		||||
were brought to our attention. In detail, fixes for the MJPEG decoder,
 | 
			
		||||
the CAVS decoder (CVE-2011-3362, CVE-2011-3973, CVE-2011-3974), and the
 | 
			
		||||
Matroska decoder (MSVR11-011/CVE-2011-3504) and many others have been
 | 
			
		||||
corrected. Additional, this release contains fixes for compilation with
 | 
			
		||||
gcc-4.6. Distributors and system integrators are encouraged to update
 | 
			
		||||
and share their patches against this branch.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
* 0.5.6 Nov 21, 2011
 | 
			
		||||
 | 
			
		||||
General notes
 | 
			
		||||
-------------
 | 
			
		||||
 | 
			
		||||
This maintenance-only release addresses several security issues that
 | 
			
		||||
were brought to our attention.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
* 0.5.7 Dec 25, 2011
 | 
			
		||||
 | 
			
		||||
General notes
 | 
			
		||||
-------------
 | 
			
		||||
 | 
			
		||||
This maintenance-only release addresses several security issues that
 | 
			
		||||
were brought to our attention. In details, it features fixes for the
 | 
			
		||||
QDM2 decoder (CVE-2011-4351), DoS in the VP5/VP6 decoders
 | 
			
		||||
(CVE-2011-4353), and a buffer overflow in the Sierra VMD decoder
 | 
			
		||||
CVE-2011-4364, and a safety fix in the SVQ1 decoder (CVE-2011-4579).
 | 
			
		||||
CVE-2011-4352, a bug in the VP3 decoder, is not known to affect this
 | 
			
		||||
release.
 | 
			
		||||
 | 
			
		||||
Distributors and system integrators are encouraged to update and share
 | 
			
		||||
their patches against this branch.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
* 0.5.8 Jan 12, 2012
 | 
			
		||||
 | 
			
		||||
General notes
 | 
			
		||||
-------------
 | 
			
		||||
 | 
			
		||||
This mostly maintenance-only release that addresses a number a number of
 | 
			
		||||
bugs such as security and compilation issues that have been brought to
 | 
			
		||||
our attention. Among other (rather minor) fixes, this release features
 | 
			
		||||
fixes for the VP3 decoder (CVE-2011-3892), vorbis decoder, and matroska
 | 
			
		||||
demuxer (CVE-2011-3893 and CVE-2011-3895).
 | 
			
		||||
 | 
			
		||||
Distributors and system integrators are encouraged
 | 
			
		||||
to update and share their patches against this branch.  For a full list
 | 
			
		||||
of changes please see the Changelog file.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
* 0.5.9 May 11, 2012
 | 
			
		||||
 | 
			
		||||
General notes
 | 
			
		||||
-------------
 | 
			
		||||
 | 
			
		||||
This maintenance-only release that addresses a number a number of
 | 
			
		||||
security issues that have been brought to our attention. Among other
 | 
			
		||||
(rather minor) fixes, this release features fixes for the DV decoder
 | 
			
		||||
(CVE-2011-3929 and CVE-2011-3936), nsvdec (CVE-2011-3940), Atrac3
 | 
			
		||||
(CVE-2012-0853), mjpegdec (CVE-2011-3947) and the VQA video decoder
 | 
			
		||||
(CVE-2012-0947).
 | 
			
		||||
 | 
			
		||||
Distributors and system integrators are encouraged
 | 
			
		||||
to update and share their patches against this branch.  For a full list
 | 
			
		||||
of changes please see the Changelog file.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
* 0.5.10 Jun 09, 2012
 | 
			
		||||
 | 
			
		||||
General notes
 | 
			
		||||
-------------
 | 
			
		||||
 | 
			
		||||
This mostly maintenance-only release addresses a number a number of bugs
 | 
			
		||||
such as security and compilation issues that have been brought to our
 | 
			
		||||
attention. Among other fixes, this release features includes security
 | 
			
		||||
updates for the DPCM codecs (CVE-2011-3951), H.264 (CVE-2012-0851),
 | 
			
		||||
ADPCM (CVE-2012-0852), and the KMVC decoder (CVE-2011-3952).
 | 
			
		||||
 | 
			
		||||
Distributors and system integrators are encouraged
 | 
			
		||||
to update and share their patches against this branch.  For a full list
 | 
			
		||||
of changes please see the Changelog file or the git commit history.
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										17
									
								
								arch.mak
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								arch.mak
									
									
									
									
									
								
							@@ -1,17 +0,0 @@
 | 
			
		||||
OBJS-$(HAVE_ARMV5TE) += $(ARMV5TE-OBJS) $(ARMV5TE-OBJS-yes)
 | 
			
		||||
OBJS-$(HAVE_ARMV6)   += $(ARMV6-OBJS)   $(ARMV6-OBJS-yes)
 | 
			
		||||
OBJS-$(HAVE_ARMVFP)  += $(ARMVFP-OBJS)  $(ARMVFP-OBJS-yes)
 | 
			
		||||
OBJS-$(HAVE_NEON)    += $(NEON-OBJS)    $(NEON-OBJS-yes)
 | 
			
		||||
 | 
			
		||||
OBJS-$(HAVE_MMI)     += $(MMI-OBJS)     $(MMI-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_ALTIVEC) += $(ALTIVEC-OBJS) $(ALTIVEC-OBJS-yes)
 | 
			
		||||
 | 
			
		||||
OBJS-$(HAVE_VIS)     += $(VIS-OBJS)     $(VIS-OBJS-yes)
 | 
			
		||||
 | 
			
		||||
OBJS-$(HAVE_MMX)     += $(MMX-OBJS)     $(MMX-OBJS-yes)
 | 
			
		||||
OBJS-$(HAVE_YASM)    += $(YASM-OBJS)    $(YASM-OBJS-yes)
 | 
			
		||||
							
								
								
									
										1669
									
								
								cmdutils.c
									
									
									
									
									
								
							
							
						
						
									
										1669
									
								
								cmdutils.c
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										413
									
								
								cmdutils.h
									
									
									
									
									
								
							
							
						
						
									
										413
									
								
								cmdutils.h
									
									
									
									
									
								
							@@ -22,17 +22,11 @@
 | 
			
		||||
#ifndef FFMPEG_CMDUTILS_H
 | 
			
		||||
#define FFMPEG_CMDUTILS_H
 | 
			
		||||
 | 
			
		||||
#include <stdint.h>
 | 
			
		||||
 | 
			
		||||
#include <inttypes.h>
 | 
			
		||||
#include "libavcodec/avcodec.h"
 | 
			
		||||
#include "libavfilter/avfilter.h"
 | 
			
		||||
#include "libavformat/avformat.h"
 | 
			
		||||
#include "libswscale/swscale.h"
 | 
			
		||||
 | 
			
		||||
#ifdef __MINGW32__
 | 
			
		||||
#undef main /* We don't want SDL to override our main() */
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * program name, defined by the program for show_version().
 | 
			
		||||
 */
 | 
			
		||||
@@ -43,101 +37,49 @@ extern const char program_name[];
 | 
			
		||||
 */
 | 
			
		||||
extern const int program_birth_year;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * this year, defined by the program for show_banner()
 | 
			
		||||
 */
 | 
			
		||||
extern const int this_year;
 | 
			
		||||
 | 
			
		||||
extern AVCodecContext *avcodec_opts[AVMEDIA_TYPE_NB];
 | 
			
		||||
extern const char **opt_names;
 | 
			
		||||
extern AVCodecContext *avctx_opts[CODEC_TYPE_NB];
 | 
			
		||||
extern AVFormatContext *avformat_opts;
 | 
			
		||||
extern struct SwsContext *sws_opts;
 | 
			
		||||
extern struct SwrContext *swr_opts;
 | 
			
		||||
extern AVDictionary *format_opts, *codec_opts;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Initialize the cmdutils option system, in particular
 | 
			
		||||
 * allocate the *_opts contexts.
 | 
			
		||||
 */
 | 
			
		||||
void init_opts(void);
 | 
			
		||||
/**
 | 
			
		||||
 * Uninitialize the cmdutils option system, in particular
 | 
			
		||||
 * free the *_opts contexts and their contents.
 | 
			
		||||
 */
 | 
			
		||||
void uninit_opts(void);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Trivial log callback.
 | 
			
		||||
 * Only suitable for opt_help and similar since it lacks prefix handling.
 | 
			
		||||
 */
 | 
			
		||||
void log_callback_help(void* ptr, int level, const char* fmt, va_list vl);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Fallback for options that are not explicitly handled, these will be
 | 
			
		||||
 * parsed through AVOptions.
 | 
			
		||||
 */
 | 
			
		||||
int opt_default(void *optctx, const char *opt, const char *arg);
 | 
			
		||||
int opt_default(const char *opt, const char *arg);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Set the libav* libraries log level.
 | 
			
		||||
 */
 | 
			
		||||
int opt_loglevel(void *optctx, const char *opt, const char *arg);
 | 
			
		||||
 | 
			
		||||
int opt_report(const char *opt);
 | 
			
		||||
 | 
			
		||||
int opt_max_alloc(void *optctx, const char *opt, const char *arg);
 | 
			
		||||
 | 
			
		||||
int opt_cpuflags(void *optctx, const char *opt, const char *arg);
 | 
			
		||||
 | 
			
		||||
int opt_codec_debug(void *optctx, const char *opt, const char *arg);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Limit the execution time.
 | 
			
		||||
 */
 | 
			
		||||
int opt_timelimit(void *optctx, const char *opt, const char *arg);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Parse a string and return its corresponding value as a double.
 | 
			
		||||
 * Exit from the application if the string cannot be correctly
 | 
			
		||||
 * Parses a string and returns its corresponding value as a double.
 | 
			
		||||
 * Exits from the application if the string cannot be correctly
 | 
			
		||||
 * parsed or the corresponding value is invalid.
 | 
			
		||||
 *
 | 
			
		||||
 * @param context the context of the value to be set (e.g. the
 | 
			
		||||
 * corresponding command line option name)
 | 
			
		||||
 * corresponding commandline option name)
 | 
			
		||||
 * @param numstr the string to be parsed
 | 
			
		||||
 * @param type the type (OPT_INT64 or OPT_FLOAT) as which the
 | 
			
		||||
 * string should be parsed
 | 
			
		||||
 * @param min the minimum valid accepted value
 | 
			
		||||
 * @param max the maximum valid accepted value
 | 
			
		||||
 */
 | 
			
		||||
double parse_number_or_die(const char *context, const char *numstr, int type,
 | 
			
		||||
                           double min, double max);
 | 
			
		||||
double parse_number_or_die(const char *context, const char *numstr, int type, double min, double max);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Parse a string specifying a time and return its corresponding
 | 
			
		||||
 * value as a number of microseconds. Exit from the application if
 | 
			
		||||
 * Parses a string specifying a time and returns its corresponding
 | 
			
		||||
 * value as a number of microseconds. Exits from the application if
 | 
			
		||||
 * the string cannot be correctly parsed.
 | 
			
		||||
 *
 | 
			
		||||
 * @param context the context of the value to be set (e.g. the
 | 
			
		||||
 * corresponding command line option name)
 | 
			
		||||
 * corresponding commandline option name)
 | 
			
		||||
 * @param timestr the string to be parsed
 | 
			
		||||
 * @param is_duration a flag which tells how to interpret timestr, if
 | 
			
		||||
 * not zero timestr is interpreted as a duration, otherwise as a
 | 
			
		||||
 * @param is_duration a flag which tells how to interpret \p timestr, if
 | 
			
		||||
 * not zero \p timestr is interpreted as a duration, otherwise as a
 | 
			
		||||
 * date
 | 
			
		||||
 *
 | 
			
		||||
 * @see parse_date()
 | 
			
		||||
 */
 | 
			
		||||
int64_t parse_time_or_die(const char *context, const char *timestr,
 | 
			
		||||
                          int is_duration);
 | 
			
		||||
 | 
			
		||||
typedef struct SpecifierOpt {
 | 
			
		||||
    char *specifier;    /**< stream/chapter/program/... specifier */
 | 
			
		||||
    union {
 | 
			
		||||
        uint8_t *str;
 | 
			
		||||
        int        i;
 | 
			
		||||
        int64_t  i64;
 | 
			
		||||
        float      f;
 | 
			
		||||
        double   dbl;
 | 
			
		||||
    } u;
 | 
			
		||||
} SpecifierOpt;
 | 
			
		||||
int64_t parse_time_or_die(const char *context, const char *timestr, int is_duration);
 | 
			
		||||
 | 
			
		||||
typedef struct {
 | 
			
		||||
    const char *name;
 | 
			
		||||
@@ -148,343 +90,66 @@ typedef struct {
 | 
			
		||||
#define OPT_STRING 0x0008
 | 
			
		||||
#define OPT_VIDEO  0x0010
 | 
			
		||||
#define OPT_AUDIO  0x0020
 | 
			
		||||
#define OPT_GRAB   0x0040
 | 
			
		||||
#define OPT_INT    0x0080
 | 
			
		||||
#define OPT_FLOAT  0x0100
 | 
			
		||||
#define OPT_SUBTITLE 0x0200
 | 
			
		||||
#define OPT_INT64  0x0400
 | 
			
		||||
#define OPT_EXIT   0x0800
 | 
			
		||||
#define OPT_DATA   0x1000
 | 
			
		||||
#define OPT_PERFILE  0x2000     /* the option is per-file (currently ffmpeg-only).
 | 
			
		||||
                                   implied by OPT_OFFSET or OPT_SPEC */
 | 
			
		||||
#define OPT_OFFSET 0x4000       /* option is specified as an offset in a passed optctx */
 | 
			
		||||
#define OPT_SPEC   0x8000       /* option is to be stored in an array of SpecifierOpt.
 | 
			
		||||
                                   Implies OPT_OFFSET. Next element after the offset is
 | 
			
		||||
                                   an int containing element count in the array. */
 | 
			
		||||
#define OPT_TIME  0x10000
 | 
			
		||||
#define OPT_DOUBLE 0x20000
 | 
			
		||||
#define OPT_FUNC2  0x0400
 | 
			
		||||
#define OPT_INT64  0x0800
 | 
			
		||||
#define OPT_EXIT   0x1000
 | 
			
		||||
     union {
 | 
			
		||||
        void *dst_ptr;
 | 
			
		||||
        int (*func_arg)(void *, const char *, const char *);
 | 
			
		||||
        size_t off;
 | 
			
		||||
        void (*func_arg)(const char *); //FIXME passing error code as int return would be nicer then exit() in the func
 | 
			
		||||
        int *int_arg;
 | 
			
		||||
        char **str_arg;
 | 
			
		||||
        float *float_arg;
 | 
			
		||||
        int (*func2_arg)(const char *, const char *);
 | 
			
		||||
        int64_t *int64_arg;
 | 
			
		||||
    } u;
 | 
			
		||||
    const char *help;
 | 
			
		||||
    const char *argname;
 | 
			
		||||
} OptionDef;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Print help for all options matching specified flags.
 | 
			
		||||
 *
 | 
			
		||||
 * @param options a list of options
 | 
			
		||||
 * @param msg title of this group. Only printed if at least one option matches.
 | 
			
		||||
 * @param req_flags print only options which have all those flags set.
 | 
			
		||||
 * @param rej_flags don't print options which have any of those flags set.
 | 
			
		||||
 * @param alt_flags print only options that have at least one of those flags set
 | 
			
		||||
 */
 | 
			
		||||
void show_help_options(const OptionDef *options, const char *msg, int req_flags,
 | 
			
		||||
                       int rej_flags, int alt_flags);
 | 
			
		||||
void show_help_options(const OptionDef *options, const char *msg, int mask, int value);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Show help for all options with given flags in class and all its
 | 
			
		||||
 * children.
 | 
			
		||||
 */
 | 
			
		||||
void show_help_children(const AVClass *class, int flags);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Per-fftool specific help handler. Implemented in each
 | 
			
		||||
 * fftool, called by show_help().
 | 
			
		||||
 */
 | 
			
		||||
void show_help_default(const char *opt, const char *arg);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Generic -h handler common to all fftools.
 | 
			
		||||
 */
 | 
			
		||||
int show_help(void *optctx, const char *opt, const char *arg);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Parse the command line arguments.
 | 
			
		||||
 *
 | 
			
		||||
 * @param optctx an opaque options context
 | 
			
		||||
 * Parses the command line arguments.
 | 
			
		||||
 * @param options Array with the definitions required to interpret every
 | 
			
		||||
 * option of the form: -option_name [argument]
 | 
			
		||||
 * option of the form: -<option_name> [<argument>]
 | 
			
		||||
 * @param parse_arg_function Name of the function called to process every
 | 
			
		||||
 * argument without a leading option name flag. NULL if such arguments do
 | 
			
		||||
 * not have to be processed.
 | 
			
		||||
 */
 | 
			
		||||
void parse_options(void *optctx, int argc, char **argv, const OptionDef *options,
 | 
			
		||||
                   void (* parse_arg_function)(void *optctx, const char*));
 | 
			
		||||
void parse_options(int argc, char **argv, const OptionDef *options,
 | 
			
		||||
                   void (* parse_arg_function)(const char*));
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Parse one given option.
 | 
			
		||||
 *
 | 
			
		||||
 * @return on success 1 if arg was consumed, 0 otherwise; negative number on error
 | 
			
		||||
 */
 | 
			
		||||
int parse_option(void *optctx, const char *opt, const char *arg,
 | 
			
		||||
                 const OptionDef *options);
 | 
			
		||||
void set_context_opts(void *ctx, void *opts_ctx, int flags);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Find the '-loglevel' option in the command line args and apply it.
 | 
			
		||||
 */
 | 
			
		||||
void parse_loglevel(int argc, char **argv, const OptionDef *options);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Return index of option opt in argv or 0 if not found.
 | 
			
		||||
 */
 | 
			
		||||
int locate_option(int argc, char **argv, const OptionDef *options,
 | 
			
		||||
                  const char *optname);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Check if the given stream matches a stream specifier.
 | 
			
		||||
 *
 | 
			
		||||
 * @param s  Corresponding format context.
 | 
			
		||||
 * @param st Stream from s to be checked.
 | 
			
		||||
 * @param spec A stream specifier of the [v|a|s|d]:[\<stream index\>] form.
 | 
			
		||||
 *
 | 
			
		||||
 * @return 1 if the stream matches, 0 if it doesn't, <0 on error
 | 
			
		||||
 */
 | 
			
		||||
int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Filter out options for given codec.
 | 
			
		||||
 *
 | 
			
		||||
 * Create a new options dictionary containing only the options from
 | 
			
		||||
 * opts which apply to the codec with ID codec_id.
 | 
			
		||||
 *
 | 
			
		||||
 * @param s Corresponding format context.
 | 
			
		||||
 * @param st A stream from s for which the options should be filtered.
 | 
			
		||||
 * @param codec The particular codec for which the options should be filtered.
 | 
			
		||||
 *              If null, the default one is looked up according to the codec id.
 | 
			
		||||
 * @return a pointer to the created dictionary
 | 
			
		||||
 */
 | 
			
		||||
AVDictionary *filter_codec_opts(AVDictionary *opts, enum AVCodecID codec_id,
 | 
			
		||||
                                AVFormatContext *s, AVStream *st, AVCodec *codec);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Setup AVCodecContext options for avformat_find_stream_info().
 | 
			
		||||
 *
 | 
			
		||||
 * Create an array of dictionaries, one dictionary for each stream
 | 
			
		||||
 * contained in s.
 | 
			
		||||
 * Each dictionary will contain the options from codec_opts which can
 | 
			
		||||
 * be applied to the corresponding stream codec context.
 | 
			
		||||
 *
 | 
			
		||||
 * @return pointer to the created array of dictionaries, NULL if it
 | 
			
		||||
 * cannot be created
 | 
			
		||||
 */
 | 
			
		||||
AVDictionary **setup_find_stream_info_opts(AVFormatContext *s,
 | 
			
		||||
                                           AVDictionary *codec_opts);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Print an error message to stderr, indicating filename and a human
 | 
			
		||||
 * readable description of the error code err.
 | 
			
		||||
 *
 | 
			
		||||
 * If strerror_r() is not available the use of this function in a
 | 
			
		||||
 * multithreaded application may be unsafe.
 | 
			
		||||
 *
 | 
			
		||||
 * @see av_strerror()
 | 
			
		||||
 */
 | 
			
		||||
void print_error(const char *filename, int err);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Print the program banner to stderr. The banner contents depend on the
 | 
			
		||||
 * Prints the program banner to stderr. The banner contents depend on the
 | 
			
		||||
 * current version of the repository and of the libav* libraries used by
 | 
			
		||||
 * the program.
 | 
			
		||||
 */
 | 
			
		||||
void show_banner(int argc, char **argv, const OptionDef *options);
 | 
			
		||||
void show_banner(void);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Print the version of the program to stdout. The version message
 | 
			
		||||
 * Prints the version of the program to stdout. The version message
 | 
			
		||||
 * depends on the current versions of the repository and of the libav*
 | 
			
		||||
 * libraries.
 | 
			
		||||
 * This option processing function does not utilize the arguments.
 | 
			
		||||
 */
 | 
			
		||||
int show_version(void *optctx, const char *opt, const char *arg);
 | 
			
		||||
void show_version(void);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Print the license of the program to stdout. The license depends on
 | 
			
		||||
 * Prints the license of the program to stdout. The license depends on
 | 
			
		||||
 * the license of the libraries compiled into the program.
 | 
			
		||||
 * This option processing function does not utilize the arguments.
 | 
			
		||||
 */
 | 
			
		||||
int show_license(void *optctx, const char *opt, const char *arg);
 | 
			
		||||
void show_license(void);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Print a listing containing all the formats supported by the
 | 
			
		||||
 * program.
 | 
			
		||||
 * This option processing function does not utilize the arguments.
 | 
			
		||||
 */
 | 
			
		||||
int show_formats(void *optctx, const char *opt, const char *arg);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Print a listing containing all the codecs supported by the
 | 
			
		||||
 * program.
 | 
			
		||||
 * This option processing function does not utilize the arguments.
 | 
			
		||||
 */
 | 
			
		||||
int show_codecs(void *optctx, const char *opt, const char *arg);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Print a listing containing all the decoders supported by the
 | 
			
		||||
 * Prints a listing containing all the formats supported by the
 | 
			
		||||
 * program.
 | 
			
		||||
 */
 | 
			
		||||
int show_decoders(void *optctx, const char *opt, const char *arg);
 | 
			
		||||
void show_formats(void);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Print a listing containing all the encoders supported by the
 | 
			
		||||
 * program.
 | 
			
		||||
 */
 | 
			
		||||
int show_encoders(void *optctx, const char *opt, const char *arg);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Print a listing containing all the filters supported by the
 | 
			
		||||
 * program.
 | 
			
		||||
 * This option processing function does not utilize the arguments.
 | 
			
		||||
 */
 | 
			
		||||
int show_filters(void *optctx, const char *opt, const char *arg);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Print a listing containing all the bit stream filters supported by the
 | 
			
		||||
 * program.
 | 
			
		||||
 * This option processing function does not utilize the arguments.
 | 
			
		||||
 */
 | 
			
		||||
int show_bsfs(void *optctx, const char *opt, const char *arg);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Print a listing containing all the protocols supported by the
 | 
			
		||||
 * program.
 | 
			
		||||
 * This option processing function does not utilize the arguments.
 | 
			
		||||
 */
 | 
			
		||||
int show_protocols(void *optctx, const char *opt, const char *arg);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Print a listing containing all the pixel formats supported by the
 | 
			
		||||
 * program.
 | 
			
		||||
 * This option processing function does not utilize the arguments.
 | 
			
		||||
 */
 | 
			
		||||
int show_pix_fmts(void *optctx, const char *opt, const char *arg);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Print a listing containing all the standard channel layouts supported by
 | 
			
		||||
 * the program.
 | 
			
		||||
 * This option processing function does not utilize the arguments.
 | 
			
		||||
 */
 | 
			
		||||
int show_layouts(void *optctx, const char *opt, const char *arg);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Print a listing containing all the sample formats supported by the
 | 
			
		||||
 * program.
 | 
			
		||||
 */
 | 
			
		||||
int show_sample_fmts(void *optctx, const char *opt, const char *arg);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Return a positive value if a line read from standard input
 | 
			
		||||
 * starts with [yY], otherwise return 0.
 | 
			
		||||
 */
 | 
			
		||||
int read_yesno(void);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Read the file with name filename, and put its content in a newly
 | 
			
		||||
 * allocated 0-terminated buffer.
 | 
			
		||||
 *
 | 
			
		||||
 * @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.
 | 
			
		||||
 *
 | 
			
		||||
 * If is_path is non-zero, look for the file in the path preset_name.
 | 
			
		||||
 * Otherwise search for a file named arg.ffpreset in the directories
 | 
			
		||||
 * $FFMPEG_DATADIR (if set), $HOME/.ffmpeg, and in the datadir defined
 | 
			
		||||
 * at configuration time or in a "ffpresets" folder along the executable
 | 
			
		||||
 * on win32, in that order. If no such file is found and
 | 
			
		||||
 * codec_name is defined, then search for a file named
 | 
			
		||||
 * codec_name-preset_name.avpreset in the above-mentioned directories.
 | 
			
		||||
 *
 | 
			
		||||
 * @param filename buffer where the name of the found filename is written
 | 
			
		||||
 * @param filename_size size in bytes of the filename buffer
 | 
			
		||||
 * @param preset_name name of the preset to search
 | 
			
		||||
 * @param is_path tell if preset_name is a filename path
 | 
			
		||||
 * @param codec_name name of the codec for which to look for the
 | 
			
		||||
 * preset, may be NULL
 | 
			
		||||
 */
 | 
			
		||||
FILE *get_preset_file(char *filename, size_t filename_size,
 | 
			
		||||
                      const char *preset_name, int is_path, const char *codec_name);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Do all the necessary cleanup and abort.
 | 
			
		||||
 * This function is implemented in the avtools, not cmdutils.
 | 
			
		||||
 */
 | 
			
		||||
av_noreturn void exit_program(int ret);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Realloc array to hold new_size elements of elem_size.
 | 
			
		||||
 * Calls exit_program() on failure.
 | 
			
		||||
 *
 | 
			
		||||
 * @param elem_size size in bytes of each element
 | 
			
		||||
 * @param size new element count will be written here
 | 
			
		||||
 * @return reallocated array
 | 
			
		||||
 */
 | 
			
		||||
void *grow_array(void *array, int elem_size, int *size, int new_size);
 | 
			
		||||
 | 
			
		||||
typedef struct FrameBuffer {
 | 
			
		||||
    uint8_t *base[4];
 | 
			
		||||
    uint8_t *data[4];
 | 
			
		||||
    int  linesize[4];
 | 
			
		||||
 | 
			
		||||
    int h, w;
 | 
			
		||||
    enum PixelFormat pix_fmt;
 | 
			
		||||
 | 
			
		||||
    int refcount;
 | 
			
		||||
    struct FrameBuffer **pool;  ///< head of the buffer pool
 | 
			
		||||
    struct FrameBuffer *next;
 | 
			
		||||
} FrameBuffer;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Get a frame from the pool. This is intended to be used as a callback for
 | 
			
		||||
 * AVCodecContext.get_buffer.
 | 
			
		||||
 *
 | 
			
		||||
 * @param s codec context. s->opaque must be a pointer to the head of the
 | 
			
		||||
 *          buffer pool.
 | 
			
		||||
 * @param frame frame->opaque will be set to point to the FrameBuffer
 | 
			
		||||
 *              containing the frame data.
 | 
			
		||||
 */
 | 
			
		||||
int codec_get_buffer(AVCodecContext *s, AVFrame *frame);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * A callback to be used for AVCodecContext.release_buffer along with
 | 
			
		||||
 * codec_get_buffer().
 | 
			
		||||
 */
 | 
			
		||||
void codec_release_buffer(AVCodecContext *s, AVFrame *frame);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * A callback to be used for AVFilterBuffer.free.
 | 
			
		||||
 * @param fb buffer to free. fb->priv must be a pointer to the FrameBuffer
 | 
			
		||||
 *           containing the buffer data.
 | 
			
		||||
 */
 | 
			
		||||
void filter_release_buffer(AVFilterBuffer *fb);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Free all the buffers in the pool. This must be called after all the
 | 
			
		||||
 * buffers have been released.
 | 
			
		||||
 */
 | 
			
		||||
void free_buffer_pool(FrameBuffer **pool);
 | 
			
		||||
 | 
			
		||||
#define GET_PIX_FMT_NAME(pix_fmt)\
 | 
			
		||||
    const char *name = av_get_pix_fmt_name(pix_fmt);
 | 
			
		||||
 | 
			
		||||
#define GET_SAMPLE_FMT_NAME(sample_fmt)\
 | 
			
		||||
    const char *name = av_get_sample_fmt_name(sample_fmt)
 | 
			
		||||
 | 
			
		||||
#define GET_SAMPLE_RATE_NAME(rate)\
 | 
			
		||||
    char name[16];\
 | 
			
		||||
    snprintf(name, sizeof(name), "%d", rate);
 | 
			
		||||
 | 
			
		||||
#define GET_CH_LAYOUT_NAME(ch_layout)\
 | 
			
		||||
    char name[16];\
 | 
			
		||||
    snprintf(name, sizeof(name), "0x%"PRIx64, ch_layout);
 | 
			
		||||
 | 
			
		||||
#define GET_CH_LAYOUT_DESC(ch_layout)\
 | 
			
		||||
    char name[128];\
 | 
			
		||||
    av_get_channel_layout_string(name, sizeof(name), 0, ch_layout);
 | 
			
		||||
 | 
			
		||||
#endif /* CMDUTILS_H */
 | 
			
		||||
#endif /* FFMPEG_CMDUTILS_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,23 +0,0 @@
 | 
			
		||||
    { "L"          , OPT_EXIT, {.func_arg = show_license},      "show license" },
 | 
			
		||||
    { "h"          , OPT_EXIT, {.func_arg = show_help},         "show help", "topic" },
 | 
			
		||||
    { "?"          , OPT_EXIT, {.func_arg = show_help},         "show help", "topic" },
 | 
			
		||||
    { "help"       , OPT_EXIT, {.func_arg = show_help},         "show help", "topic" },
 | 
			
		||||
    { "-help"      , OPT_EXIT, {.func_arg = show_help},         "show help", "topic" },
 | 
			
		||||
    { "version"    , OPT_EXIT, {.func_arg = show_version},      "show version" },
 | 
			
		||||
    { "formats"    , OPT_EXIT, {.func_arg = show_formats  },    "show available formats" },
 | 
			
		||||
    { "codecs"     , OPT_EXIT, {.func_arg = show_codecs   },    "show available codecs" },
 | 
			
		||||
    { "decoders"   , OPT_EXIT, {.func_arg = show_decoders },    "show available decoders" },
 | 
			
		||||
    { "encoders"   , OPT_EXIT, {.func_arg = show_encoders },    "show available encoders" },
 | 
			
		||||
    { "bsfs"       , OPT_EXIT, {.func_arg = show_bsfs     },    "show available bit stream filters" },
 | 
			
		||||
    { "protocols"  , OPT_EXIT, {.func_arg = show_protocols},    "show available protocols" },
 | 
			
		||||
    { "filters"    , OPT_EXIT, {.func_arg = show_filters  },    "show available filters" },
 | 
			
		||||
    { "pix_fmts"   , OPT_EXIT, {.func_arg = show_pix_fmts },    "show available pixel formats" },
 | 
			
		||||
    { "layouts"    , OPT_EXIT, {.func_arg = show_layouts  },    "show standard channel layouts" },
 | 
			
		||||
    { "sample_fmts", OPT_EXIT, {.func_arg = show_sample_fmts }, "show available audio sample formats" },
 | 
			
		||||
    { "loglevel"   , HAS_ARG,  {.func_arg = opt_loglevel},      "set libav* logging level", "loglevel" },
 | 
			
		||||
    { "v",           HAS_ARG,  {.func_arg = opt_loglevel},      "set libav* logging level", "loglevel" },
 | 
			
		||||
    { "debug"      , HAS_ARG,  {.func_arg = opt_codec_debug},   "set debug flags", "flags" },
 | 
			
		||||
    { "fdebug"     , HAS_ARG,  {.func_arg = opt_codec_debug},   "set debug flags", "flags" },
 | 
			
		||||
    { "report"     , 0,        {(void*)opt_report}, "generate a report" },
 | 
			
		||||
    { "max_alloc"  , HAS_ARG,  {.func_arg = opt_max_alloc},     "set maximum size of a single allocated block", "bytes" },
 | 
			
		||||
    { "cpuflags"   , HAS_ARG | OPT_EXPERT, {.func_arg = opt_cpuflags}, "force specific cpu flags", "flags" },
 | 
			
		||||
							
								
								
									
										173
									
								
								common.mak
									
									
									
									
									
								
							
							
						
						
									
										173
									
								
								common.mak
									
									
									
									
									
								
							@@ -2,129 +2,116 @@
 | 
			
		||||
# common bits used by all libraries
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
# first so "all" becomes default target
 | 
			
		||||
all: all-yes
 | 
			
		||||
all: # make "all" default target
 | 
			
		||||
 | 
			
		||||
ifndef SUBDIR
 | 
			
		||||
vpath %.c $(SRC_DIR)
 | 
			
		||||
vpath %.h $(SRC_DIR)
 | 
			
		||||
vpath %.S $(SRC_DIR)
 | 
			
		||||
vpath %.asm $(SRC_DIR)
 | 
			
		||||
vpath %.v   $(SRC_DIR)
 | 
			
		||||
 | 
			
		||||
ifndef V
 | 
			
		||||
Q      = @
 | 
			
		||||
ECHO   = printf "$(1)\t%s\n" $(2)
 | 
			
		||||
BRIEF  = CC CXX HOSTCC HOSTLD AS YASM AR LD STRIP CP
 | 
			
		||||
SILENT = DEPCC DEPHOSTCC DEPAS DEPYASM RANLIB RM
 | 
			
		||||
 | 
			
		||||
MSG    = $@
 | 
			
		||||
M      = @$(call ECHO,$(TAG),$@);
 | 
			
		||||
$(foreach VAR,$(BRIEF), \
 | 
			
		||||
    $(eval override $(VAR) = @$$(call ECHO,$(VAR),$$(MSG)); $($(VAR))))
 | 
			
		||||
$(foreach VAR,$(SILENT),$(eval override $(VAR) = @$($(VAR))))
 | 
			
		||||
$(eval INSTALL = @$(call ECHO,INSTALL,$$(^:$(SRC_DIR)/%=%)); $(INSTALL))
 | 
			
		||||
ifeq ($(SRC_DIR),$(SRC_PATH_BARE))
 | 
			
		||||
BUILD_ROOT_REL = .
 | 
			
		||||
else
 | 
			
		||||
BUILD_ROOT_REL = ..
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
ALLFFLIBS = avcodec avdevice avfilter avformat avresample avutil postproc swscale swresample
 | 
			
		||||
ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale
 | 
			
		||||
 | 
			
		||||
# NASM requires -I path terminated with /
 | 
			
		||||
IFLAGS     := -I. -I$(SRC_PATH)/
 | 
			
		||||
CPPFLAGS   := $(IFLAGS) $(CPPFLAGS)
 | 
			
		||||
CFLAGS     += $(ECFLAGS)
 | 
			
		||||
CCFLAGS     = $(CPPFLAGS) $(CFLAGS)
 | 
			
		||||
ASFLAGS    := $(CPPFLAGS) $(ASFLAGS)
 | 
			
		||||
CXXFLAGS   += $(CPPFLAGS) $(CFLAGS)
 | 
			
		||||
YASMFLAGS  += $(IFLAGS:%=%/) -I$(SRC_PATH)/libavutil/x86/ -Pconfig.asm
 | 
			
		||||
 | 
			
		||||
HOSTCCFLAGS = $(IFLAGS) $(HOSTCFLAGS)
 | 
			
		||||
LDFLAGS    := $(ALLFFLIBS:%=$(LD_PATH)lib%) $(LDFLAGS)
 | 
			
		||||
 | 
			
		||||
define COMPILE
 | 
			
		||||
       $(call $(1)DEP,$(1))
 | 
			
		||||
       $($(1)) $($(1)FLAGS) $($(1)_DEPFLAGS) $($(1)_C) $($(1)_O) $<
 | 
			
		||||
endef
 | 
			
		||||
 | 
			
		||||
COMPILE_C = $(call COMPILE,CC)
 | 
			
		||||
COMPILE_CXX = $(call COMPILE,CXX)
 | 
			
		||||
COMPILE_S = $(call COMPILE,AS)
 | 
			
		||||
CFLAGS := -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
 | 
			
		||||
          -I$(BUILD_ROOT_REL) -I$(SRC_PATH) $(OPTFLAGS)
 | 
			
		||||
 | 
			
		||||
%.o: %.c
 | 
			
		||||
	$(COMPILE_C)
 | 
			
		||||
 | 
			
		||||
%.o: %.cpp
 | 
			
		||||
	$(COMPILE_CXX)
 | 
			
		||||
 | 
			
		||||
%.s: %.c
 | 
			
		||||
	$(CC) $(CPPFLAGS) $(CFLAGS) -S -o $@ $<
 | 
			
		||||
	$(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
 | 
			
		||||
 | 
			
		||||
%.o: %.S
 | 
			
		||||
	$(COMPILE_S)
 | 
			
		||||
	$(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
 | 
			
		||||
 | 
			
		||||
%.h.c:
 | 
			
		||||
	$(Q)echo '#include "$*.h"' >$@
 | 
			
		||||
%.ho: %.h
 | 
			
		||||
	$(CC) $(CFLAGS) $(LIBOBJFLAGS) -Wno-unused -c -o $@ -x c $<
 | 
			
		||||
 | 
			
		||||
%.d: %.c
 | 
			
		||||
	$(DEPEND_CMD) > $@
 | 
			
		||||
 | 
			
		||||
%.d: %.S
 | 
			
		||||
	$(DEPEND_CMD) > $@
 | 
			
		||||
 | 
			
		||||
%.d: %.cpp
 | 
			
		||||
	$(DEPEND_CMD) > $@
 | 
			
		||||
 | 
			
		||||
%.o: %.d
 | 
			
		||||
 | 
			
		||||
%$(EXESUF): %.c
 | 
			
		||||
 | 
			
		||||
%.ver: %.v
 | 
			
		||||
	$(Q)sed 's/$$MAJOR/$($(basename $(@F))_VERSION_MAJOR)/' $^ > $@
 | 
			
		||||
	sed 's/$$MAJOR/$($(basename $(@F))_VERSION_MAJOR)/' $^ > $@
 | 
			
		||||
 | 
			
		||||
%.c %.h: TAG = GEN
 | 
			
		||||
 | 
			
		||||
# Dummy rule to stop make trying to rebuild removed or renamed headers
 | 
			
		||||
%.h:
 | 
			
		||||
	@:
 | 
			
		||||
 | 
			
		||||
# Disable suffix rules.  Most of the builtin rules are suffix rules,
 | 
			
		||||
# so this saves some time on slow systems.
 | 
			
		||||
.SUFFIXES:
 | 
			
		||||
 | 
			
		||||
# Do not delete intermediate files from chains of implicit rules
 | 
			
		||||
$(OBJS):
 | 
			
		||||
SVN_ENTRIES = $(SRC_PATH_BARE)/.svn/entries
 | 
			
		||||
ifeq ($(wildcard $(SVN_ENTRIES)),$(SVN_ENTRIES))
 | 
			
		||||
$(BUILD_ROOT_REL)/version.h: $(SVN_ENTRIES)
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
include $(SRC_PATH)/arch.mak
 | 
			
		||||
$(BUILD_ROOT_REL)/version.h: $(SRC_PATH_BARE)/version.sh
 | 
			
		||||
	$< $(SRC_PATH) $@ $(EXTRA_VERSION)
 | 
			
		||||
 | 
			
		||||
install: install-libs install-headers
 | 
			
		||||
 | 
			
		||||
uninstall: uninstall-libs uninstall-headers
 | 
			
		||||
 | 
			
		||||
.PHONY: all depend dep clean distclean install* uninstall* tests
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
CFLAGS   += $(CFLAGS-yes)
 | 
			
		||||
OBJS     += $(OBJS-yes)
 | 
			
		||||
FFLIBS   := $(FFLIBS-yes) $(FFLIBS)
 | 
			
		||||
TESTPROGS += $(TESTPROGS-yes)
 | 
			
		||||
TESTS    += $(TESTS-yes)
 | 
			
		||||
 | 
			
		||||
LDLIBS       = $(FFLIBS:%=%$(BUILDSUF))
 | 
			
		||||
FFEXTRALIBS := $(LDLIBS:%=$(LD_LIB)) $(EXTRALIBS)
 | 
			
		||||
FFEXTRALIBS := $(addprefix -l,$(addsuffix $(BUILDSUF),$(FFLIBS))) $(EXTRALIBS)
 | 
			
		||||
FFLDFLAGS   := $(addprefix -L$(BUILD_ROOT)/lib,$(FFLIBS)) $(LDFLAGS)
 | 
			
		||||
 | 
			
		||||
EXAMPLES  := $(EXAMPLES:%=$(SUBDIR)%-example$(EXESUF))
 | 
			
		||||
OBJS      := $(sort $(OBJS:%=$(SUBDIR)%))
 | 
			
		||||
TESTOBJS  := $(TESTOBJS:%=$(SUBDIR)%) $(TESTPROGS:%=$(SUBDIR)%-test.o)
 | 
			
		||||
TESTPROGS := $(TESTPROGS:%=$(SUBDIR)%-test$(EXESUF))
 | 
			
		||||
HOSTOBJS  := $(HOSTPROGS:%=$(SUBDIR)%.o)
 | 
			
		||||
HOSTPROGS := $(HOSTPROGS:%=$(SUBDIR)%$(HOSTEXESUF))
 | 
			
		||||
TOOLS     += $(TOOLS-yes)
 | 
			
		||||
TOOLOBJS  := $(TOOLS:%=tools/%.o)
 | 
			
		||||
TOOLS     := $(TOOLS:%=tools/%$(EXESUF))
 | 
			
		||||
OBJS  := $(addprefix $(SUBDIR),$(OBJS))
 | 
			
		||||
TESTS := $(addprefix $(SUBDIR),$(TESTS))
 | 
			
		||||
 | 
			
		||||
DEP_LIBS := $(foreach NAME,$(FFLIBS),lib$(NAME)/$($(CONFIG_SHARED:yes=S)LIBNAME))
 | 
			
		||||
DEP_LIBS:=$(foreach NAME,$(FFLIBS),lib$(NAME)/$($(BUILD_SHARED:yes=S)LIBNAME))
 | 
			
		||||
 | 
			
		||||
ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h))
 | 
			
		||||
SKIPHEADERS += $(ARCH_HEADERS:%=$(ARCH)/%) $(SKIPHEADERS-)
 | 
			
		||||
SKIPHEADERS := $(SKIPHEADERS:%=$(SUBDIR)%)
 | 
			
		||||
HOBJS        = $(filter-out $(SKIPHEADERS:.h=.h.o),$(ALLHEADERS:.h=.h.o))
 | 
			
		||||
checkheaders: $(HOBJS)
 | 
			
		||||
.SECONDARY:   $(HOBJS:.o=.c)
 | 
			
		||||
checkheaders: $(filter-out %_template.ho,$(ALLHEADERS:.h=.ho))
 | 
			
		||||
 | 
			
		||||
alltools: $(TOOLS)
 | 
			
		||||
DEPS := $(OBJS:.o=.d)
 | 
			
		||||
depend dep: $(DEPS)
 | 
			
		||||
 | 
			
		||||
$(HOSTOBJS): %.o: %.c
 | 
			
		||||
	$(call COMPILE,HOSTCC)
 | 
			
		||||
CLEANSUFFIXES = *.o *~ *.ho *.ver
 | 
			
		||||
LIBSUFFIXES   = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a *.exp *.map
 | 
			
		||||
DISTCLEANSUFFIXES = *.d *.pc
 | 
			
		||||
 | 
			
		||||
$(HOSTPROGS): %$(HOSTEXESUF): %.o
 | 
			
		||||
	$(HOSTLD) $(HOSTLDFLAGS) $(HOSTLD_O) $< $(HOSTLIBS)
 | 
			
		||||
define RULES
 | 
			
		||||
$(SUBDIR)%$(EXESUF): $(SUBDIR)%.o
 | 
			
		||||
	$(CC) $(FFLDFLAGS) -o $$@ $$^ $(SUBDIR)$(LIBNAME) $(FFEXTRALIBS)
 | 
			
		||||
 | 
			
		||||
$(OBJS):     | $(sort $(dir $(OBJS)))
 | 
			
		||||
$(HOSTOBJS): | $(sort $(dir $(HOSTOBJS)))
 | 
			
		||||
$(TESTOBJS): | $(sort $(dir $(TESTOBJS)))
 | 
			
		||||
$(HOBJS):    | $(sort $(dir $(HOBJS)))
 | 
			
		||||
$(TOOLOBJS): | tools
 | 
			
		||||
$(SUBDIR)%-test.o: $(SUBDIR)%.c
 | 
			
		||||
	$(CC) $(CFLAGS) -DTEST -c -o $$@ $$^
 | 
			
		||||
 | 
			
		||||
OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOSTOBJS) $(TESTOBJS) $(HOBJS))
 | 
			
		||||
$(SUBDIR)%-test.o: $(SUBDIR)%-test.c
 | 
			
		||||
	$(CC) $(CFLAGS) -DTEST -c -o $$@ $$^
 | 
			
		||||
 | 
			
		||||
CLEANSUFFIXES     = *.d *.o *~ *.h.c *.map *.ver *.ho *.gcno *.gcda
 | 
			
		||||
DISTCLEANSUFFIXES = *.pc
 | 
			
		||||
LIBSUFFIXES       = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a
 | 
			
		||||
$(SUBDIR)x86/%.o: $(SUBDIR)x86/%.asm
 | 
			
		||||
	$(YASM) $(YASMFLAGS) -I $$(<D)/ -o $$@ $$<
 | 
			
		||||
 | 
			
		||||
$(SUBDIR)x86/%.d: $(SUBDIR)x86/%.asm
 | 
			
		||||
	$(YASM) $(YASMFLAGS) -I $$(<D)/ -M -o $$(@:%.d=%.o) $$< > $$@
 | 
			
		||||
 | 
			
		||||
clean::
 | 
			
		||||
	$(RM) $(OBJS) $(OBJS:.o=.d)
 | 
			
		||||
	rm -f $(TESTS) $(addprefix $(SUBDIR),$(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \
 | 
			
		||||
	    $(addprefix $(SUBDIR), $(foreach suffix,$(CLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS))))
 | 
			
		||||
 | 
			
		||||
-include $(wildcard $(OBJS:.o=.d) $(HOSTOBJS:.o=.d) $(TESTOBJS:.o=.d) $(HOBJS:.o=.d))
 | 
			
		||||
distclean:: clean
 | 
			
		||||
	rm -f  $(addprefix $(SUBDIR),$(DISTCLEANSUFFIXES)) \
 | 
			
		||||
            $(addprefix $(SUBDIR), $(foreach suffix,$(DISTCLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS))))
 | 
			
		||||
endef
 | 
			
		||||
 | 
			
		||||
$(eval $(RULES))
 | 
			
		||||
 | 
			
		||||
tests: $(TESTS)
 | 
			
		||||
 | 
			
		||||
-include $(DEPS)
 | 
			
		||||
 
 | 
			
		||||
@@ -1,85 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * 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
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * This file was copied from the following newsgroup posting:
 | 
			
		||||
 *
 | 
			
		||||
 * Newsgroups: mod.std.unix
 | 
			
		||||
 * Subject: public domain AT&T getopt source
 | 
			
		||||
 * Date: 3 Nov 85 19:34:15 GMT
 | 
			
		||||
 *
 | 
			
		||||
 * Here's something you've all been waiting for:  the AT&T public domain
 | 
			
		||||
 * source for getopt(3).  It is the code which was given out at the 1985
 | 
			
		||||
 * UNIFORUM conference in Dallas.  I obtained it by electronic mail
 | 
			
		||||
 * directly from AT&T.  The people there assure me that it is indeed
 | 
			
		||||
 * in the public domain.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
 | 
			
		||||
static int opterr = 1;
 | 
			
		||||
static int optind = 1;
 | 
			
		||||
static int optopt;
 | 
			
		||||
static char *optarg;
 | 
			
		||||
 | 
			
		||||
#undef fprintf
 | 
			
		||||
 | 
			
		||||
static int getopt(int argc, char *argv[], char *opts)
 | 
			
		||||
{
 | 
			
		||||
    static int sp = 1;
 | 
			
		||||
    int c;
 | 
			
		||||
    char *cp;
 | 
			
		||||
 | 
			
		||||
    if (sp == 1)
 | 
			
		||||
        if (optind >= argc ||
 | 
			
		||||
            argv[optind][0] != '-' || argv[optind][1] == '\0')
 | 
			
		||||
            return EOF;
 | 
			
		||||
        else if (!strcmp(argv[optind], "--")) {
 | 
			
		||||
            optind++;
 | 
			
		||||
            return EOF;
 | 
			
		||||
        }
 | 
			
		||||
    optopt = c = argv[optind][sp];
 | 
			
		||||
    if (c == ':' || (cp = strchr(opts, c)) == NULL) {
 | 
			
		||||
        fprintf(stderr, ": illegal option -- %c\n", c);
 | 
			
		||||
        if (argv[optind][++sp] == '\0') {
 | 
			
		||||
            optind++;
 | 
			
		||||
            sp = 1;
 | 
			
		||||
        }
 | 
			
		||||
        return '?';
 | 
			
		||||
    }
 | 
			
		||||
    if (*++cp == ':') {
 | 
			
		||||
        if (argv[optind][sp+1] != '\0')
 | 
			
		||||
            optarg = &argv[optind++][sp+1];
 | 
			
		||||
        else if(++optind >= argc) {
 | 
			
		||||
            fprintf(stderr, ": option requires an argument -- %c\n", c);
 | 
			
		||||
            sp = 1;
 | 
			
		||||
            return '?';
 | 
			
		||||
        } else
 | 
			
		||||
            optarg = argv[optind++];
 | 
			
		||||
        sp = 1;
 | 
			
		||||
    } else {
 | 
			
		||||
        if (argv[optind][++sp] == '\0') {
 | 
			
		||||
            sp = 1;
 | 
			
		||||
            optind++;
 | 
			
		||||
        }
 | 
			
		||||
        optarg = NULL;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return c;
 | 
			
		||||
}
 | 
			
		||||
@@ -1,71 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * C99-compatible snprintf() and vsnprintf() implementations
 | 
			
		||||
 * Copyright (c) 2012 Ronald S. Bultje <rsbultje@gmail.com>
 | 
			
		||||
 *
 | 
			
		||||
 * 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 <stdio.h>
 | 
			
		||||
#include <stdarg.h>
 | 
			
		||||
#include <limits.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
 | 
			
		||||
#include "compat/va_copy.h"
 | 
			
		||||
#include "libavutil/error.h"
 | 
			
		||||
 | 
			
		||||
#if defined(__MINGW32__)
 | 
			
		||||
#define EOVERFLOW EFBIG
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
int avpriv_snprintf(char *s, size_t n, const char *fmt, ...)
 | 
			
		||||
{
 | 
			
		||||
    va_list ap;
 | 
			
		||||
    int ret;
 | 
			
		||||
 | 
			
		||||
    va_start(ap, fmt);
 | 
			
		||||
    ret = avpriv_vsnprintf(s, n, fmt, ap);
 | 
			
		||||
    va_end(ap);
 | 
			
		||||
 | 
			
		||||
    return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int avpriv_vsnprintf(char *s, size_t n, const char *fmt,
 | 
			
		||||
                     va_list ap)
 | 
			
		||||
{
 | 
			
		||||
    int ret;
 | 
			
		||||
    va_list ap_copy;
 | 
			
		||||
 | 
			
		||||
    if (n == 0)
 | 
			
		||||
        return _vscprintf(fmt, ap);
 | 
			
		||||
    else if (n > INT_MAX)
 | 
			
		||||
        return AVERROR(EOVERFLOW);
 | 
			
		||||
 | 
			
		||||
    /* we use n - 1 here because if the buffer is not big enough, the MS
 | 
			
		||||
     * runtime libraries don't add a terminating zero at the end. MSDN
 | 
			
		||||
     * recommends to provide _snprintf/_vsnprintf() a buffer size that
 | 
			
		||||
     * is one less than the actual buffer, and zero it before calling
 | 
			
		||||
     * _snprintf/_vsnprintf() to workaround this problem.
 | 
			
		||||
     * See http://msdn.microsoft.com/en-us/library/1kt27hek(v=vs.80).aspx */
 | 
			
		||||
    memset(s, 0, n);
 | 
			
		||||
    va_copy(ap_copy, ap);
 | 
			
		||||
    ret = _vsnprintf(s, n - 1, fmt, ap_copy);
 | 
			
		||||
    va_end(ap_copy);
 | 
			
		||||
    if (ret == -1)
 | 
			
		||||
        ret = _vscprintf(fmt, ap);
 | 
			
		||||
 | 
			
		||||
    return ret;
 | 
			
		||||
}
 | 
			
		||||
@@ -1,38 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * C99-compatible snprintf() and vsnprintf() implementations
 | 
			
		||||
 * Copyright (c) 2012 Ronald S. Bultje <rsbultje@gmail.com>
 | 
			
		||||
 *
 | 
			
		||||
 * 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
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef COMPAT_SNPRINTF_H
 | 
			
		||||
#define COMPAT_SNPRINTF_H
 | 
			
		||||
 | 
			
		||||
#include <stdarg.h>
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
 | 
			
		||||
int avpriv_snprintf(char *s, size_t n, const char *fmt, ...);
 | 
			
		||||
int avpriv_vsnprintf(char *s, size_t n, const char *fmt, va_list ap);
 | 
			
		||||
 | 
			
		||||
#undef snprintf
 | 
			
		||||
#undef _snprintf
 | 
			
		||||
#undef vsnprintf
 | 
			
		||||
#define snprintf avpriv_snprintf
 | 
			
		||||
#define _snprintf avpriv_snprintf
 | 
			
		||||
#define vsnprintf avpriv_vsnprintf
 | 
			
		||||
 | 
			
		||||
#endif /* COMPAT_SNPRINTF_H */
 | 
			
		||||
@@ -1,94 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * C99-compatible strtod() implementation
 | 
			
		||||
 * Copyright (c) 2012 Ronald S. Bultje <rsbultje@gmail.com>
 | 
			
		||||
 *
 | 
			
		||||
 * 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 <ctype.h>
 | 
			
		||||
#include <limits.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
 | 
			
		||||
#include "libavutil/avstring.h"
 | 
			
		||||
#include "libavutil/mathematics.h"
 | 
			
		||||
 | 
			
		||||
static char *check_nan_suffix(char *s)
 | 
			
		||||
{
 | 
			
		||||
    char *start = s;
 | 
			
		||||
 | 
			
		||||
    if (*s++ != '(')
 | 
			
		||||
        return start;
 | 
			
		||||
 | 
			
		||||
    while ((*s >= 'a' && *s <= 'z') || (*s >= 'A' && *s <= 'Z') ||
 | 
			
		||||
           (*s >= '0' && *s <= '9') ||  *s == '_')
 | 
			
		||||
        s++;
 | 
			
		||||
 | 
			
		||||
    return *s == ')' ? s + 1 : start;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#undef strtod
 | 
			
		||||
double strtod(const char *, char **);
 | 
			
		||||
 | 
			
		||||
double avpriv_strtod(const char *nptr, char **endptr)
 | 
			
		||||
{
 | 
			
		||||
    char *end;
 | 
			
		||||
    double res;
 | 
			
		||||
 | 
			
		||||
    /* Skip leading spaces */
 | 
			
		||||
    while (isspace(*nptr))
 | 
			
		||||
        nptr++;
 | 
			
		||||
 | 
			
		||||
    if (!av_strncasecmp(nptr, "infinity", 8)) {
 | 
			
		||||
        end = nptr + 8;
 | 
			
		||||
        res = INFINITY;
 | 
			
		||||
    } else if (!av_strncasecmp(nptr, "inf", 3)) {
 | 
			
		||||
        end = nptr + 3;
 | 
			
		||||
        res = INFINITY;
 | 
			
		||||
    } else if (!av_strncasecmp(nptr, "+infinity", 9)) {
 | 
			
		||||
        end = nptr + 9;
 | 
			
		||||
        res = INFINITY;
 | 
			
		||||
    } else if (!av_strncasecmp(nptr, "+inf", 4)) {
 | 
			
		||||
        end = nptr + 4;
 | 
			
		||||
        res = INFINITY;
 | 
			
		||||
    } else if (!av_strncasecmp(nptr, "-infinity", 9)) {
 | 
			
		||||
        end = nptr + 9;
 | 
			
		||||
        res = -INFINITY;
 | 
			
		||||
    } else if (!av_strncasecmp(nptr, "-inf", 4)) {
 | 
			
		||||
        end = nptr + 4;
 | 
			
		||||
        res = -INFINITY;
 | 
			
		||||
    } else if (!av_strncasecmp(nptr, "nan", 3)) {
 | 
			
		||||
        end = check_nan_suffix(nptr + 3);
 | 
			
		||||
        res = NAN;
 | 
			
		||||
    } else if (!av_strncasecmp(nptr, "+nan", 4) ||
 | 
			
		||||
               !av_strncasecmp(nptr, "-nan", 4)) {
 | 
			
		||||
        end = check_nan_suffix(nptr + 4);
 | 
			
		||||
        res = NAN;
 | 
			
		||||
    } else if (!av_strncasecmp(nptr, "0x", 2) ||
 | 
			
		||||
               !av_strncasecmp(nptr, "-0x", 3) ||
 | 
			
		||||
               !av_strncasecmp(nptr, "+0x", 3)) {
 | 
			
		||||
        /* FIXME this doesn't handle exponents, non-integers (float/double)
 | 
			
		||||
         * and numbers too large for long long */
 | 
			
		||||
        res = strtoll(nptr, &end, 16);
 | 
			
		||||
    } else {
 | 
			
		||||
        res = strtod(nptr, &end);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (endptr)
 | 
			
		||||
        *endptr = end;
 | 
			
		||||
 | 
			
		||||
    return res;
 | 
			
		||||
}
 | 
			
		||||
@@ -1,26 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * MSVC Compatible va_copy macro
 | 
			
		||||
 * Copyright (c) 2012 Derek Buitenhuis
 | 
			
		||||
 *
 | 
			
		||||
 * 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 <stdarg.h>
 | 
			
		||||
 | 
			
		||||
#if !defined(va_copy) && defined(_MSC_VER)
 | 
			
		||||
#define va_copy(dst, src) ((dst) = (src))
 | 
			
		||||
#endif
 | 
			
		||||
							
								
								
									
										1403
									
								
								doc/APIchanges
									
									
									
									
									
								
							
							
						
						
									
										1403
									
								
								doc/APIchanges
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										77
									
								
								doc/Makefile
									
									
									
									
									
								
							
							
						
						
									
										77
									
								
								doc/Makefile
									
									
									
									
									
								
							@@ -1,77 +0,0 @@
 | 
			
		||||
MANPAGES    = $(PROGS-yes:%=doc/%.1)
 | 
			
		||||
PODPAGES    = $(PROGS-yes:%=doc/%.pod)
 | 
			
		||||
HTMLPAGES   = $(PROGS-yes:%=doc/%.html)                                 \
 | 
			
		||||
              doc/developer.html                                        \
 | 
			
		||||
              doc/faq.html                                              \
 | 
			
		||||
              doc/fate.html                                             \
 | 
			
		||||
              doc/general.html                                          \
 | 
			
		||||
              doc/git-howto.html                                        \
 | 
			
		||||
              doc/platform.html                                         \
 | 
			
		||||
              doc/syntax.html                                           \
 | 
			
		||||
 | 
			
		||||
TXTPAGES    = doc/fate.txt                                              \
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
DOCS-$(CONFIG_HTMLPAGES) += $(HTMLPAGES)
 | 
			
		||||
DOCS-$(CONFIG_PODPAGES)  += $(PODPAGES)
 | 
			
		||||
DOCS-$(CONFIG_MANPAGES)  += $(MANPAGES)
 | 
			
		||||
DOCS-$(CONFIG_TXTPAGES)  += $(TXTPAGES)
 | 
			
		||||
DOCS = $(DOCS-yes)
 | 
			
		||||
 | 
			
		||||
all-$(CONFIG_DOC): doc
 | 
			
		||||
 | 
			
		||||
doc: documentation
 | 
			
		||||
 | 
			
		||||
documentation: $(DOCS)
 | 
			
		||||
 | 
			
		||||
TEXIDEP = awk '/^@(verbatim)?include/ { printf "$@: $(@D)/%s\n", $$2 }' <$< >$(@:%=%.d)
 | 
			
		||||
 | 
			
		||||
doc/%.txt: TAG = TXT
 | 
			
		||||
doc/%.txt: doc/%.texi
 | 
			
		||||
	$(Q)$(TEXIDEP)
 | 
			
		||||
	$(M)makeinfo --force --no-headers -o $@ $< 2>/dev/null
 | 
			
		||||
 | 
			
		||||
GENTEXI  = format codec
 | 
			
		||||
GENTEXI := $(GENTEXI:%=doc/avoptions_%.texi)
 | 
			
		||||
 | 
			
		||||
$(GENTEXI): TAG = GENTEXI
 | 
			
		||||
$(GENTEXI): doc/avoptions_%.texi: doc/print_options$(HOSTEXESUF)
 | 
			
		||||
	$(M)doc/print_options $* > $@
 | 
			
		||||
 | 
			
		||||
doc/%.html: TAG = HTML
 | 
			
		||||
doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
 | 
			
		||||
	$(Q)$(TEXIDEP)
 | 
			
		||||
	$(M)texi2html -I doc -monolithic --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
 | 
			
		||||
 | 
			
		||||
doc/%.pod: TAG = POD
 | 
			
		||||
doc/%.pod: doc/%.texi $(GENTEXI)
 | 
			
		||||
	$(Q)$(TEXIDEP)
 | 
			
		||||
	$(M)perl $(SRC_PATH)/doc/texi2pod.pl -Idoc $< $@
 | 
			
		||||
 | 
			
		||||
doc/%.1: TAG = MAN
 | 
			
		||||
doc/%.1: doc/%.pod $(GENTEXI)
 | 
			
		||||
	$(M)pod2man --section=1 --center=" " --release=" " $< > $@
 | 
			
		||||
 | 
			
		||||
$(DOCS): | doc/
 | 
			
		||||
 | 
			
		||||
install-man:
 | 
			
		||||
 | 
			
		||||
ifdef CONFIG_MANPAGES
 | 
			
		||||
install-progs-$(CONFIG_DOC): install-man
 | 
			
		||||
 | 
			
		||||
install-man: $(MANPAGES)
 | 
			
		||||
	$(Q)mkdir -p "$(MANDIR)/man1"
 | 
			
		||||
	$(INSTALL) -m 644 $(MANPAGES) "$(MANDIR)/man1"
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
uninstall: uninstall-man
 | 
			
		||||
 | 
			
		||||
uninstall-man:
 | 
			
		||||
	$(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
 | 
			
		||||
 | 
			
		||||
clean::
 | 
			
		||||
	$(RM) $(TXTPAGES) doc/*.html doc/*.pod doc/*.1 $(CLEANSUFFIXES:%=doc/%) doc/avoptions_*.texi
 | 
			
		||||
 | 
			
		||||
-include $(wildcard $(DOCS:%=%.d))
 | 
			
		||||
 | 
			
		||||
.PHONY: doc documentation
 | 
			
		||||
@@ -1,16 +0,0 @@
 | 
			
		||||
Release Notes
 | 
			
		||||
=============
 | 
			
		||||
 | 
			
		||||
* 1.0 "Angel"  September, 2012
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
General notes
 | 
			
		||||
-------------
 | 
			
		||||
See the Changelog file for a list of significant changes. Note, there
 | 
			
		||||
are many more new features and bugfixes than whats listed there.
 | 
			
		||||
 | 
			
		||||
Bugreports against FFmpeg git master or the most recent FFmpeg release are
 | 
			
		||||
accepted. If you are experiencing issues with any formally released version of
 | 
			
		||||
FFmpeg, please try git master to check if the issue still exists. If it does,
 | 
			
		||||
make your report against the development code following the usual bug reporting
 | 
			
		||||
guidelines.
 | 
			
		||||
							
								
								
									
										90
									
								
								doc/TODO
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										90
									
								
								doc/TODO
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,90 @@
 | 
			
		||||
ffmpeg TODO list:
 | 
			
		||||
----------------
 | 
			
		||||
 | 
			
		||||
Fabrice's TODO list: (unordered)
 | 
			
		||||
-------------------
 | 
			
		||||
Short term:
 | 
			
		||||
 | 
			
		||||
- use AVFMTCTX_DISCARD_PKT in ffplay so that DV has a chance to work
 | 
			
		||||
- add RTSP regression test (both client and server)
 | 
			
		||||
- make ffserver allocate AVFormatContext
 | 
			
		||||
- clean up (incompatible change, for 0.5.0):
 | 
			
		||||
    * AVStream -> AVComponent
 | 
			
		||||
    * AVFormatContext -> AVInputStream/AVOutputStream
 | 
			
		||||
    * suppress rate_emu from AVCodecContext
 | 
			
		||||
- add new float/integer audio filterting and conversion : suppress
 | 
			
		||||
  CODEC_ID_PCM_xxc and use CODEC_ID_RAWAUDIO.
 | 
			
		||||
- fix telecine and frame rate conversion
 | 
			
		||||
 | 
			
		||||
Long term (ask me if you want to help):
 | 
			
		||||
 | 
			
		||||
- commit new imgconvert API and new PIX_FMT_xxx alpha formats
 | 
			
		||||
- commit new LGPL'ed float and integer-only AC3 decoder
 | 
			
		||||
- add WMA integer-only decoder
 | 
			
		||||
- add new MPEG4-AAC audio decoder (both integer-only and float version)
 | 
			
		||||
 | 
			
		||||
Michael's TODO list: (unordered) (if anyone wanna help with sth, just ask)
 | 
			
		||||
-------------------
 | 
			
		||||
- optimize H264 CABAC
 | 
			
		||||
- more optimizations
 | 
			
		||||
- simper rate control
 | 
			
		||||
 | 
			
		||||
Francois' TODO list: (unordered, without any timeframe)
 | 
			
		||||
-------------------
 | 
			
		||||
- test MACE decoder against the openquicktime one as suggested by A'rpi
 | 
			
		||||
- BeOS audio input grabbing backend
 | 
			
		||||
- BeOS video input grabbing backend
 | 
			
		||||
- publish my BeOS libposix on BeBits so I can officially support ffserver :)
 | 
			
		||||
- check the whole code for thread-safety (global and init stuff)
 | 
			
		||||
 | 
			
		||||
Philip'a TODO list: (alphabetically ordered) (please help)
 | 
			
		||||
------------------
 | 
			
		||||
- Add a multi-ffm filetype so that feeds can be recorded into multiple files rather
 | 
			
		||||
  than one big file.
 | 
			
		||||
- Authenticated users support -- where the authentication is in the URL
 | 
			
		||||
- Change ASF files so that the embedded timestamp in the frames is right rather
 | 
			
		||||
  than being an offset from the start of the stream
 | 
			
		||||
- Make ffm files more resilient to changes in the codec structures so that you
 | 
			
		||||
  can play old ffm files.
 | 
			
		||||
 | 
			
		||||
Baptiste's TODO list:
 | 
			
		||||
-----------------
 | 
			
		||||
- mov edit list support (AVEditList)
 | 
			
		||||
- YUV 10 bit per component support "2vuy"
 | 
			
		||||
- mxf muxer
 | 
			
		||||
- mpeg2 non linear quantizer
 | 
			
		||||
 | 
			
		||||
unassigned TODO: (unordered)
 | 
			
		||||
---------------
 | 
			
		||||
- use AVFrame for audio codecs too
 | 
			
		||||
- rework aviobuf.c buffering strategy and fix url_fskip
 | 
			
		||||
- generate optimal huffman tables for mjpeg encoding
 | 
			
		||||
- fix ffserver regression tests
 | 
			
		||||
- support xvids motion estimation
 | 
			
		||||
- support x264s motion estimation
 | 
			
		||||
- support x264s rate control
 | 
			
		||||
- SNOW: non translational motion compensation
 | 
			
		||||
- SNOW: more optimal quantization
 | 
			
		||||
- SNOW: 4x4 block support
 | 
			
		||||
- SNOW: 1/8 pel motion compensation support
 | 
			
		||||
- SNOW: iterative motion estimation based on subsampled images
 | 
			
		||||
- SNOW: try B frames and MCTF and see how their PSNR/bitrate/complexity behaves
 | 
			
		||||
- SNOW: try to use the wavelet transformed MC-ed reference frame as context for the entropy coder
 | 
			
		||||
- SNOW: think about/analyize how to make snow use multiple cpus/threads
 | 
			
		||||
- SNOW: finish spec
 | 
			
		||||
- FLAC: lossy encoding (viterbi and naive scalar quantization)
 | 
			
		||||
- libavfilter
 | 
			
		||||
- JPEG2000 decoder & encoder
 | 
			
		||||
- MPEG4 GMC encoding support
 | 
			
		||||
- macroblock based pixel format (better cache locality, somewhat complex, one paper claimed it faster for high res)
 | 
			
		||||
- regression tests for codecs which do not have an encoder (I+P-frame bitstream in svn)
 | 
			
		||||
- add support for using mplayers video filters to ffmpeg
 | 
			
		||||
- H264 encoder
 | 
			
		||||
- per MB ratecontrol (so VCD and such do work better)
 | 
			
		||||
- write a script which iteratively changes all functions between always_inline and noinline and benchmarks the result to find the best set of inlined functions
 | 
			
		||||
- convert all the non SIMD asm into small asm vs. C testcases and submit them to the gcc devels so they can improve gcc
 | 
			
		||||
- generic audio mixing API
 | 
			
		||||
- extract PES packetizer from PS muxer and use it for new TS muxer
 | 
			
		||||
- implement automatic AVBistreamFilter activation
 | 
			
		||||
- make cabac encoder use bytestream (see http://trac.videolan.org/x264/changeset/?format=diff&new=651)
 | 
			
		||||
- merge imdct and windowing, the current code does considerable amounts of redundant work
 | 
			
		||||
@@ -1,200 +0,0 @@
 | 
			
		||||
All the numerical options, if not specified otherwise, accept in input
 | 
			
		||||
a string representing a number, which may contain one of the
 | 
			
		||||
International System number postfixes, for example 'K', 'M', 'G'.
 | 
			
		||||
If 'i' is appended after the postfix, powers of 2 are used instead of
 | 
			
		||||
powers of 10. The 'B' postfix multiplies the value for 8, and can be
 | 
			
		||||
appended after another postfix or used alone. This allows using for
 | 
			
		||||
example 'KB', 'MiB', 'G' and 'B' as postfix.
 | 
			
		||||
 | 
			
		||||
Options which do not take arguments are boolean options, and set the
 | 
			
		||||
corresponding value to true. They can be set to false by prefixing
 | 
			
		||||
with "no" the option name, for example using "-nofoo" in the
 | 
			
		||||
command line will set to false the boolean option with name "foo".
 | 
			
		||||
 | 
			
		||||
@anchor{Stream specifiers}
 | 
			
		||||
@section Stream specifiers
 | 
			
		||||
Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers
 | 
			
		||||
are used to precisely specify which stream(s) does a given option belong to.
 | 
			
		||||
 | 
			
		||||
A stream specifier is a string generally appended to the option name and
 | 
			
		||||
separated from it by a colon. E.g. @code{-codec:a:1 ac3} option contains
 | 
			
		||||
@code{a:1} stream specifier, which matches the second audio stream. Therefore it
 | 
			
		||||
would select the ac3 codec for the second audio stream.
 | 
			
		||||
 | 
			
		||||
A stream specifier can match several streams, the option is then applied to all
 | 
			
		||||
of them. E.g. the stream specifier in @code{-b:a 128k} matches all audio
 | 
			
		||||
streams.
 | 
			
		||||
 | 
			
		||||
An empty stream specifier matches all streams, for example @code{-codec copy}
 | 
			
		||||
or @code{-codec: copy} would copy all the streams without reencoding.
 | 
			
		||||
 | 
			
		||||
Possible forms of stream specifiers are:
 | 
			
		||||
@table @option
 | 
			
		||||
@item @var{stream_index}
 | 
			
		||||
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: 'v' for video, 'a' for audio, 's' for subtitle,
 | 
			
		||||
'd' for data and 't' for attachments. If @var{stream_index} is given, then
 | 
			
		||||
matches stream number @var{stream_index} of this type. Otherwise matches all
 | 
			
		||||
streams of this type.
 | 
			
		||||
@item p:@var{program_id}[:@var{stream_index}]
 | 
			
		||||
If @var{stream_index} is given, then matches stream number @var{stream_index} in
 | 
			
		||||
program with id @var{program_id}. Otherwise matches all streams in this program.
 | 
			
		||||
@item #@var{stream_id}
 | 
			
		||||
Matches the stream by format-specific ID.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section Generic options
 | 
			
		||||
 | 
			
		||||
These options are shared amongst the av* tools.
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item -L
 | 
			
		||||
Show license.
 | 
			
		||||
 | 
			
		||||
@item -h, -?, -help, --help [@var{arg}]
 | 
			
		||||
Show help. An optional parameter may be specified to print help about a specific
 | 
			
		||||
item.
 | 
			
		||||
 | 
			
		||||
Possible values of @var{arg} are:
 | 
			
		||||
@table @option
 | 
			
		||||
@item decoder=@var{decoder_name}
 | 
			
		||||
Print detailed information about the decoder named @var{decoder_name}. Use the
 | 
			
		||||
@option{-decoders} option to get a list of all decoders.
 | 
			
		||||
 | 
			
		||||
@item encoder=@var{encoder_name}
 | 
			
		||||
Print detailed information about the encoder named @var{encoder_name}. Use the
 | 
			
		||||
@option{-encoders} option to get a list of all encoders.
 | 
			
		||||
 | 
			
		||||
@item demuxer=@var{demuxer_name}
 | 
			
		||||
Print detailed information about the demuxer named @var{demuxer_name}. Use the
 | 
			
		||||
@option{-formats} option to get a list of all demuxers and muxers.
 | 
			
		||||
 | 
			
		||||
@item muxer=@var{muxer_name}
 | 
			
		||||
Print detailed information about the muxer named @var{muxer_name}. Use the
 | 
			
		||||
@option{-formats} option to get a list of all muxers and demuxers.
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@item -version
 | 
			
		||||
Show version.
 | 
			
		||||
 | 
			
		||||
@item -formats
 | 
			
		||||
Show available formats.
 | 
			
		||||
 | 
			
		||||
The fields preceding the format names have the following meanings:
 | 
			
		||||
@table @samp
 | 
			
		||||
@item D
 | 
			
		||||
Decoding available
 | 
			
		||||
@item E
 | 
			
		||||
Encoding available
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@item -codecs
 | 
			
		||||
Show all codecs known to libavcodec.
 | 
			
		||||
 | 
			
		||||
Note that the term 'codec' is used throughout this documentation as a shortcut
 | 
			
		||||
for what is more correctly called a media bitstream format.
 | 
			
		||||
 | 
			
		||||
@item -decoders
 | 
			
		||||
Show available decoders.
 | 
			
		||||
 | 
			
		||||
@item -encoders
 | 
			
		||||
Show all available encoders.
 | 
			
		||||
 | 
			
		||||
@item -bsfs
 | 
			
		||||
Show available bitstream filters.
 | 
			
		||||
 | 
			
		||||
@item -protocols
 | 
			
		||||
Show available protocols.
 | 
			
		||||
 | 
			
		||||
@item -filters
 | 
			
		||||
Show available libavfilter filters.
 | 
			
		||||
 | 
			
		||||
@item -pix_fmts
 | 
			
		||||
Show available pixel formats.
 | 
			
		||||
 | 
			
		||||
@item -sample_fmts
 | 
			
		||||
Show available sample formats.
 | 
			
		||||
 | 
			
		||||
@item -layouts
 | 
			
		||||
Show channel names and standard channel layouts.
 | 
			
		||||
 | 
			
		||||
@item -loglevel @var{loglevel} | -v @var{loglevel}
 | 
			
		||||
Set the logging level used by the library.
 | 
			
		||||
@var{loglevel} is a number or a string containing one of the following values:
 | 
			
		||||
@table @samp
 | 
			
		||||
@item quiet
 | 
			
		||||
@item panic
 | 
			
		||||
@item fatal
 | 
			
		||||
@item error
 | 
			
		||||
@item warning
 | 
			
		||||
@item info
 | 
			
		||||
@item verbose
 | 
			
		||||
@item debug
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
By default the program logs to stderr, if coloring is supported by the
 | 
			
		||||
terminal, colors are used to mark errors and warnings. Log coloring
 | 
			
		||||
can be disabled setting the environment variable
 | 
			
		||||
@env{AV_LOG_FORCE_NOCOLOR} or @env{NO_COLOR}, or can be forced setting
 | 
			
		||||
the environment variable @env{AV_LOG_FORCE_COLOR}.
 | 
			
		||||
The use of the environment variable @env{NO_COLOR} is deprecated and
 | 
			
		||||
will be dropped in a following FFmpeg version.
 | 
			
		||||
 | 
			
		||||
@item -report
 | 
			
		||||
Dump full command line and console output to a file named
 | 
			
		||||
@code{@var{program}-@var{YYYYMMDD}-@var{HHMMSS}.log} in the current
 | 
			
		||||
directory.
 | 
			
		||||
This file can be useful for bug reports.
 | 
			
		||||
It also implies @code{-loglevel verbose}.
 | 
			
		||||
 | 
			
		||||
Note: setting the environment variable @code{FFREPORT} to any value has the
 | 
			
		||||
same effect.
 | 
			
		||||
 | 
			
		||||
@item -cpuflags flags (@emph{global})
 | 
			
		||||
Allows setting and clearing cpu flags. This option is intended
 | 
			
		||||
for testing. Do not use it unless you know what you're doing.
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -cpuflags -sse+mmx ...
 | 
			
		||||
ffmpeg -cpuflags mmx ...
 | 
			
		||||
ffmpeg -cpuflags 0 ...
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section AVOptions
 | 
			
		||||
 | 
			
		||||
These options are provided directly by the libavformat, libavdevice and
 | 
			
		||||
libavcodec libraries. To see the list of available AVOptions, use the
 | 
			
		||||
@option{-help} option. They are separated into two categories:
 | 
			
		||||
@table @option
 | 
			
		||||
@item generic
 | 
			
		||||
These options can be set for any container, codec or device. Generic options
 | 
			
		||||
are listed under AVFormatContext options for containers/devices and under
 | 
			
		||||
AVCodecContext options for codecs.
 | 
			
		||||
@item private
 | 
			
		||||
These options are specific to the given container, device or codec. Private
 | 
			
		||||
options are listed under their corresponding containers/devices/codecs.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
For example to write an ID3v2.3 header instead of a default ID3v2.4 to
 | 
			
		||||
an MP3 file, use the @option{id3v2_version} private option of the MP3
 | 
			
		||||
muxer:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i input.flac -id3v2_version 3 out.mp3
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
All codec AVOptions are obviously per-stream, so the chapter on stream
 | 
			
		||||
specifiers applies to them
 | 
			
		||||
 | 
			
		||||
Note @option{-nooption} syntax cannot be used for boolean AVOptions,
 | 
			
		||||
use @option{-option 0}/@option{-option 1}.
 | 
			
		||||
 | 
			
		||||
Note2 old undocumented way of specifying per-stream AVOptions by prepending
 | 
			
		||||
v/a/s to the options name is now obsolete and will be removed soon.
 | 
			
		||||
 | 
			
		||||
@include avoptions_codec.texi
 | 
			
		||||
@include avoptions_format.texi
 | 
			
		||||
@@ -19,6 +19,7 @@ integer.c               128bit integer math
 | 
			
		||||
lls.c
 | 
			
		||||
mathematics.c           greatest common divisor, integer sqrt, integer log2, ...
 | 
			
		||||
mem.c                   memory allocation routines with guaranteed alignment
 | 
			
		||||
softfloat.c
 | 
			
		||||
 | 
			
		||||
Headers:
 | 
			
		||||
bswap.h                 big/little/native-endian conversion code
 | 
			
		||||
 
 | 
			
		||||
@@ -1,91 +0,0 @@
 | 
			
		||||
@chapter Bitstream Filters
 | 
			
		||||
@c man begin BITSTREAM FILTERS
 | 
			
		||||
 | 
			
		||||
When you configure your FFmpeg build, all the supported bitstream
 | 
			
		||||
filters are enabled by default. You can list all available ones using
 | 
			
		||||
the configure option @code{--list-bsfs}.
 | 
			
		||||
 | 
			
		||||
You can disable all the bitstream filters using the configure option
 | 
			
		||||
@code{--disable-bsfs}, and selectively enable any bitstream filter using
 | 
			
		||||
the option @code{--enable-bsf=BSF}, or you can disable a particular
 | 
			
		||||
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.
 | 
			
		||||
 | 
			
		||||
Below is a description of the currently available bitstream filters.
 | 
			
		||||
 | 
			
		||||
@section aac_adtstoasc
 | 
			
		||||
 | 
			
		||||
@section chomp
 | 
			
		||||
 | 
			
		||||
@section dump_extradata
 | 
			
		||||
 | 
			
		||||
@section h264_mp4toannexb
 | 
			
		||||
 | 
			
		||||
Convert an H.264 bitstream from length prefixed mode to start code
 | 
			
		||||
prefixed mode (as defined in the Annex B of the ITU-T H.264
 | 
			
		||||
specification).
 | 
			
		||||
 | 
			
		||||
This is required by some streaming formats, typically the MPEG-2
 | 
			
		||||
transport stream format ("mpegts").
 | 
			
		||||
 | 
			
		||||
For example to remux an MP4 file containing an H.264 stream to mpegts
 | 
			
		||||
format with @command{ffmpeg}, you can use the command:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@section imx_dump_header
 | 
			
		||||
 | 
			
		||||
@section mjpeg2jpeg
 | 
			
		||||
 | 
			
		||||
Convert MJPEG/AVI1 packets to full JPEG/JFIF packets.
 | 
			
		||||
 | 
			
		||||
MJPEG is a video codec wherein each video frame is essentially a
 | 
			
		||||
JPEG image. The individual frames can be extracted without loss,
 | 
			
		||||
e.g. by
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i ../some_mjpeg.avi -c:v copy frames_%d.jpg
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Unfortunately, these chunks are incomplete JPEG images, because
 | 
			
		||||
they lack the DHT segment required for decoding. Quoting from
 | 
			
		||||
@url{http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml}:
 | 
			
		||||
 | 
			
		||||
Avery Lee, writing in the rec.video.desktop newsgroup in 2001,
 | 
			
		||||
commented that "MJPEG, or at least the MJPEG in AVIs having the
 | 
			
		||||
MJPG fourcc, is restricted JPEG with a fixed -- and *omitted* --
 | 
			
		||||
Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2,
 | 
			
		||||
and it must use basic Huffman encoding, not arithmetic or
 | 
			
		||||
progressive. . . . You can indeed extract the MJPEG frames and
 | 
			
		||||
decode them with a regular JPEG decoder, but you have to prepend
 | 
			
		||||
the DHT segment to them, or else the decoder won't have any idea
 | 
			
		||||
how to decompress the data. The exact table necessary is given in
 | 
			
		||||
the OpenDML spec."
 | 
			
		||||
 | 
			
		||||
This bitstream filter patches the header of frames extracted from an MJPEG
 | 
			
		||||
stream (carrying the AVI1 header ID and lacking a DHT segment) to
 | 
			
		||||
produce fully qualified JPEG images.
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i mjpeg-movie.avi -c:v copy -bsf:v mjpeg2jpeg frame_%d.jpg
 | 
			
		||||
exiftran -i -9 frame*.jpg
 | 
			
		||||
ffmpeg -i frame_%d.jpg -c:v copy rotated.avi
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@section mjpega_dump_header
 | 
			
		||||
 | 
			
		||||
@section movsub
 | 
			
		||||
 | 
			
		||||
@section mp3_header_compress
 | 
			
		||||
 | 
			
		||||
@section mp3_header_decompress
 | 
			
		||||
 | 
			
		||||
@section noise
 | 
			
		||||
 | 
			
		||||
@section remove_extradata
 | 
			
		||||
 | 
			
		||||
@c man end BITSTREAM FILTERS
 | 
			
		||||
@@ -1,50 +0,0 @@
 | 
			
		||||
FFmpeg currently uses a custom build system, this text attempts to document
 | 
			
		||||
some of its obscure features and options.
 | 
			
		||||
 | 
			
		||||
Makefile variables:
 | 
			
		||||
 | 
			
		||||
V
 | 
			
		||||
    Disable the default terse mode, the full command issued by make and its
 | 
			
		||||
    output will be shown on the screen.
 | 
			
		||||
 | 
			
		||||
DESTDIR
 | 
			
		||||
    Destination directory for the install targets, useful to prepare packages
 | 
			
		||||
    or install FFmpeg in cross-environments.
 | 
			
		||||
 | 
			
		||||
Makefile targets:
 | 
			
		||||
 | 
			
		||||
all
 | 
			
		||||
    Default target, builds all the libraries and the executables.
 | 
			
		||||
 | 
			
		||||
fate
 | 
			
		||||
    Run the fate test suite, note you must have installed it
 | 
			
		||||
 | 
			
		||||
fate-list
 | 
			
		||||
    Will list all fate/regression test targets
 | 
			
		||||
 | 
			
		||||
install
 | 
			
		||||
    Install headers, libraries and programs.
 | 
			
		||||
 | 
			
		||||
libavformat/output-example
 | 
			
		||||
    Build the libavformat basic example.
 | 
			
		||||
 | 
			
		||||
libavcodec/api-example
 | 
			
		||||
    Build the libavcodec basic example.
 | 
			
		||||
 | 
			
		||||
libswscale/swscale-test
 | 
			
		||||
    Build the swscale self-test (useful also as example).
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Useful standard make commands:
 | 
			
		||||
make -t <target>
 | 
			
		||||
    Touch all files that otherwise would be build, this is useful to reduce
 | 
			
		||||
    unneeded rebuilding when changing headers, but note you must force rebuilds
 | 
			
		||||
    of files that actually need it by hand then.
 | 
			
		||||
 | 
			
		||||
make -j<num>
 | 
			
		||||
    rebuild with multiple jobs at the same time. Faster on multi processor systems
 | 
			
		||||
 | 
			
		||||
make -k
 | 
			
		||||
    continue build in case of errors, this is useful for the regression tests
 | 
			
		||||
    sometimes but note it will still not run all reg tests.
 | 
			
		||||
 | 
			
		||||
@@ -1,63 +0,0 @@
 | 
			
		||||
@chapter Decoders
 | 
			
		||||
@c man begin DECODERS
 | 
			
		||||
 | 
			
		||||
Decoders are configured elements in FFmpeg which allow the decoding of
 | 
			
		||||
multimedia streams.
 | 
			
		||||
 | 
			
		||||
When you configure your FFmpeg build, all the supported native decoders
 | 
			
		||||
are enabled by default. Decoders requiring an external library must be enabled
 | 
			
		||||
manually via the corresponding @code{--enable-lib} option. You can list all
 | 
			
		||||
available decoders using the configure option @code{--list-decoders}.
 | 
			
		||||
 | 
			
		||||
You can disable all the decoders with the configure option
 | 
			
		||||
@code{--disable-decoders} and selectively enable / disable single decoders
 | 
			
		||||
with the options @code{--enable-decoder=@var{DECODER}} /
 | 
			
		||||
@code{--disable-decoder=@var{DECODER}}.
 | 
			
		||||
 | 
			
		||||
The option @code{-codecs} of the ff* tools will display the list of
 | 
			
		||||
enabled decoders.
 | 
			
		||||
 | 
			
		||||
@c man end DECODERS
 | 
			
		||||
 | 
			
		||||
@chapter Video Decoders
 | 
			
		||||
@c man begin VIDEO DECODERS
 | 
			
		||||
 | 
			
		||||
A description of some of the currently available video decoders
 | 
			
		||||
follows.
 | 
			
		||||
 | 
			
		||||
@section rawvideo
 | 
			
		||||
 | 
			
		||||
Raw video decoder.
 | 
			
		||||
 | 
			
		||||
This decoder decodes rawvideo streams.
 | 
			
		||||
 | 
			
		||||
@subsection Options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
@item top @var{top_field_first}
 | 
			
		||||
Specify the assumed field type of the input video.
 | 
			
		||||
@table @option
 | 
			
		||||
@item -1
 | 
			
		||||
the video is assumed to be progressive (default)
 | 
			
		||||
@item 0
 | 
			
		||||
bottom-field-first is assumed
 | 
			
		||||
@item 1
 | 
			
		||||
top-field-first is assumed
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@c man end VIDEO DECODERS
 | 
			
		||||
 | 
			
		||||
@chapter Audio Decoders
 | 
			
		||||
@c man begin AUDIO DECODERS
 | 
			
		||||
 | 
			
		||||
@section ffwavesynth
 | 
			
		||||
 | 
			
		||||
Internal wave synthetizer.
 | 
			
		||||
 | 
			
		||||
This decoder generates wave patterns according to predefined sequences. Its
 | 
			
		||||
use is purely internal and the format of the data it accepts is not publicly
 | 
			
		||||
documented.
 | 
			
		||||
 | 
			
		||||
@c man end AUDIO DECODERS
 | 
			
		||||
@@ -1,187 +0,0 @@
 | 
			
		||||
@chapter Demuxers
 | 
			
		||||
@c man begin DEMUXERS
 | 
			
		||||
 | 
			
		||||
Demuxers are configured elements in FFmpeg which allow to read the
 | 
			
		||||
multimedia streams from a particular type of file.
 | 
			
		||||
 | 
			
		||||
When you configure your FFmpeg build, all the supported demuxers
 | 
			
		||||
are enabled by default. You can list all available ones using the
 | 
			
		||||
configure option "--list-demuxers".
 | 
			
		||||
 | 
			
		||||
You can disable all the demuxers using the configure option
 | 
			
		||||
"--disable-demuxers", and selectively enable a single demuxer with
 | 
			
		||||
the option "--enable-demuxer=@var{DEMUXER}", or disable it
 | 
			
		||||
with the option "--disable-demuxer=@var{DEMUXER}".
 | 
			
		||||
 | 
			
		||||
The option "-formats" of the ff* tools will display the list of
 | 
			
		||||
enabled demuxers.
 | 
			
		||||
 | 
			
		||||
The description of some of the currently available demuxers follows.
 | 
			
		||||
 | 
			
		||||
@section image2
 | 
			
		||||
 | 
			
		||||
Image file demuxer.
 | 
			
		||||
 | 
			
		||||
This demuxer reads from a list of image files specified by a pattern.
 | 
			
		||||
The syntax and meaning of the pattern is specified by the
 | 
			
		||||
option @var{pattern_type}.
 | 
			
		||||
 | 
			
		||||
The pattern may contain a suffix which is used to automatically
 | 
			
		||||
determine the format of the images contained in the files.
 | 
			
		||||
 | 
			
		||||
The size, the pixel format, and the format of each image must be the
 | 
			
		||||
same for all the files in the sequence.
 | 
			
		||||
 | 
			
		||||
This demuxer accepts the following options:
 | 
			
		||||
@table @option
 | 
			
		||||
@item framerate
 | 
			
		||||
Set the framerate for the video stream. It defaults to 25.
 | 
			
		||||
@item loop
 | 
			
		||||
If set to 1, loop over the input. Default value is 0.
 | 
			
		||||
@item pattern_type
 | 
			
		||||
Select the pattern type used to interpret the provided filename.
 | 
			
		||||
 | 
			
		||||
@var{pattern_type} accepts one of the following values.
 | 
			
		||||
@table @option
 | 
			
		||||
@item sequence
 | 
			
		||||
Select a sequence pattern type, used to specify a sequence of files
 | 
			
		||||
indexed by sequential numbers.
 | 
			
		||||
 | 
			
		||||
A sequence pattern may contain the string "%d" or "%0@var{N}d", which
 | 
			
		||||
specifies the position of the characters representing a sequential
 | 
			
		||||
number in each filename matched by the pattern. If the form
 | 
			
		||||
"%d0@var{N}d" is used, the string representing the number in each
 | 
			
		||||
filename is 0-padded and @var{N} is the total number of 0-padded
 | 
			
		||||
digits representing the number. The literal character '%' can be
 | 
			
		||||
specified in the pattern with the string "%%".
 | 
			
		||||
 | 
			
		||||
If the sequence pattern contains "%d" or "%0@var{N}d", the first filename of
 | 
			
		||||
the file list specified by the pattern must contain a number
 | 
			
		||||
inclusively contained between @var{start_number} and
 | 
			
		||||
@var{start_number}+@var{start_number_range}-1, and all the following
 | 
			
		||||
numbers must be sequential.
 | 
			
		||||
 | 
			
		||||
For example the pattern "img-%03d.bmp" will match a sequence of
 | 
			
		||||
filenames of the form @file{img-001.bmp}, @file{img-002.bmp}, ...,
 | 
			
		||||
@file{img-010.bmp}, etc.; the pattern "i%%m%%g-%d.jpg" will match a
 | 
			
		||||
sequence of filenames of the form @file{i%m%g-1.jpg},
 | 
			
		||||
@file{i%m%g-2.jpg}, ..., @file{i%m%g-10.jpg}, etc.
 | 
			
		||||
 | 
			
		||||
Note that the pattern must not necessarily contain "%d" or
 | 
			
		||||
"%0@var{N}d", for example to convert a single image file
 | 
			
		||||
@file{img.jpeg} you can employ the command:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i img.jpeg img.png
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item glob
 | 
			
		||||
Select a glob wildcard pattern type.
 | 
			
		||||
 | 
			
		||||
The pattern is interpreted like a @code{glob()} pattern. This is only
 | 
			
		||||
selectable if libavformat was compiled with globbing support.
 | 
			
		||||
 | 
			
		||||
@item glob_sequence @emph{(deprecated, will be removed)}
 | 
			
		||||
Select a mixed glob wildcard/sequence pattern.
 | 
			
		||||
 | 
			
		||||
If your version of libavformat was compiled with globbing support, and
 | 
			
		||||
the provided pattern contains at least one glob meta character among
 | 
			
		||||
@code{%*?[]@{@}} that is preceded by an unescaped "%", the pattern is
 | 
			
		||||
interpreted like a @code{glob()} pattern, otherwise it is interpreted
 | 
			
		||||
like a sequence pattern.
 | 
			
		||||
 | 
			
		||||
All glob special characters @code{%*?[]@{@}} must be prefixed
 | 
			
		||||
with "%". To escape a literal "%" you shall use "%%".
 | 
			
		||||
 | 
			
		||||
For example the pattern @code{foo-%*.jpeg} will match all the
 | 
			
		||||
filenames prefixed by "foo-" and terminating with ".jpeg", and
 | 
			
		||||
@code{foo-%?%?%?.jpeg} will match all the filenames prefixed with
 | 
			
		||||
"foo-", followed by a sequence of three characters, and terminating
 | 
			
		||||
with ".jpeg".
 | 
			
		||||
 | 
			
		||||
This pattern type is deprecated in favor of @var{glob} and
 | 
			
		||||
@var{sequence}.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
Default value is @var{glob_sequence}.
 | 
			
		||||
@item pixel_format
 | 
			
		||||
Set the pixel format of the images to read. If not specified the pixel
 | 
			
		||||
format is guessed from the first image file in the sequence.
 | 
			
		||||
@item start_number
 | 
			
		||||
Set the index of the file matched by the image file pattern to start
 | 
			
		||||
to read from. Default value is 0.
 | 
			
		||||
@item start_number_range
 | 
			
		||||
Set the index interval range to check when looking for the first image
 | 
			
		||||
file in the sequence, starting from @var{start_number}. Default value
 | 
			
		||||
is 5.
 | 
			
		||||
@item video_size
 | 
			
		||||
Set the video size of the images to read. If not specified the video
 | 
			
		||||
size is guessed from the first image file in the sequence.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@subsection Examples
 | 
			
		||||
 | 
			
		||||
@itemize
 | 
			
		||||
@item
 | 
			
		||||
Use @command{ffmpeg} for creating a video from the images in the file
 | 
			
		||||
sequence @file{img-001.jpeg}, @file{img-002.jpeg}, ..., assuming an
 | 
			
		||||
input frame rate of 10 frames per second:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i 'img-%03d.jpeg' -r 10 out.mkv
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
As above, but start by reading from a file with index 100 in the sequence:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -start_number 100 -i 'img-%03d.jpeg' -r 10 out.mkv
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
Read images matching the "*.png" glob pattern , that is all the files
 | 
			
		||||
terminating with the ".png" suffix:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -pattern_type glob -i "*.png" -r 10 out.mkv
 | 
			
		||||
@end example
 | 
			
		||||
@end itemize
 | 
			
		||||
 | 
			
		||||
@section applehttp
 | 
			
		||||
 | 
			
		||||
Apple HTTP Live Streaming demuxer.
 | 
			
		||||
 | 
			
		||||
This demuxer presents all AVStreams from all variant streams.
 | 
			
		||||
The id field is set to the bitrate variant index number. By setting
 | 
			
		||||
the discard flags on AVStreams (by pressing 'a' or 'v' in ffplay),
 | 
			
		||||
the caller can decide which variant streams to actually receive.
 | 
			
		||||
The total bitrate of the variant that the stream belongs to is
 | 
			
		||||
available in a metadata key named "variant_bitrate".
 | 
			
		||||
 | 
			
		||||
@section sbg
 | 
			
		||||
 | 
			
		||||
SBaGen script demuxer.
 | 
			
		||||
 | 
			
		||||
This demuxer reads the script language used by SBaGen
 | 
			
		||||
@url{http://uazu.net/sbagen/} to generate binaural beats sessions. A SBG
 | 
			
		||||
script looks like that:
 | 
			
		||||
@example
 | 
			
		||||
-SE
 | 
			
		||||
a: 300-2.5/3 440+4.5/0
 | 
			
		||||
b: 300-2.5/0 440+4.5/3
 | 
			
		||||
off: -
 | 
			
		||||
NOW      == a
 | 
			
		||||
+0:07:00 == b
 | 
			
		||||
+0:14:00 == a
 | 
			
		||||
+0:21:00 == b
 | 
			
		||||
+0:30:00    off
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
A SBG script can mix absolute and relative timestamps. If the script uses
 | 
			
		||||
either only absolute timestamps (including the script start time) or only
 | 
			
		||||
relative ones, then its layout is fixed, and the conversion is
 | 
			
		||||
straightforward. On the other hand, if the script mixes both kind of
 | 
			
		||||
timestamps, then the @var{NOW} reference for relative timestamps will be
 | 
			
		||||
taken from the current time of day at the time the script is read, and the
 | 
			
		||||
script layout will be frozen according to that reference. That means that if
 | 
			
		||||
the script is directly played, the actual times will match the absolute
 | 
			
		||||
timestamps up to the sound controller's clock accuracy, but if the user
 | 
			
		||||
somehow pauses the playback or seeks, all times will be shifted accordingly.
 | 
			
		||||
 | 
			
		||||
@c man end INPUT DEVICES
 | 
			
		||||
@@ -1,550 +0,0 @@
 | 
			
		||||
\input texinfo @c -*- texinfo -*-
 | 
			
		||||
 | 
			
		||||
@settitle Developer Documentation
 | 
			
		||||
@titlepage
 | 
			
		||||
@center @titlefont{Developer Documentation}
 | 
			
		||||
@end titlepage
 | 
			
		||||
 | 
			
		||||
@top
 | 
			
		||||
 | 
			
		||||
@contents
 | 
			
		||||
 | 
			
		||||
@chapter Developers Guide
 | 
			
		||||
 | 
			
		||||
@section API
 | 
			
		||||
@itemize @bullet
 | 
			
		||||
@item libavcodec is the library containing the codecs (both encoding and
 | 
			
		||||
decoding). Look at @file{doc/examples/decoding_encoding.c} to see how to use
 | 
			
		||||
it.
 | 
			
		||||
 | 
			
		||||
@item libavformat is the library containing the file format handling (mux and
 | 
			
		||||
demux code for several formats). Look at @file{ffplay.c} to use it in a
 | 
			
		||||
player. See @file{doc/examples/muxing.c} to use it to generate audio or video
 | 
			
		||||
streams.
 | 
			
		||||
 | 
			
		||||
@end itemize
 | 
			
		||||
 | 
			
		||||
@section Integrating libavcodec or libavformat in your program
 | 
			
		||||
 | 
			
		||||
You can integrate all the source code of the libraries to link them
 | 
			
		||||
statically to avoid any version problem. All you need is to provide a
 | 
			
		||||
'config.mak' and a 'config.h' in the parent directory. See the defines
 | 
			
		||||
generated by ./configure to understand what is needed.
 | 
			
		||||
 | 
			
		||||
You can use libavcodec or libavformat in your commercial program, but
 | 
			
		||||
@emph{any patch you make must be published}. The best way to proceed is
 | 
			
		||||
to send your patches to the FFmpeg mailing list.
 | 
			
		||||
 | 
			
		||||
@section Contributing
 | 
			
		||||
 | 
			
		||||
There are 3 ways by which code gets into ffmpeg.
 | 
			
		||||
@itemize @bullet
 | 
			
		||||
@item Submitting Patches to the main developer mailing list
 | 
			
		||||
      see @ref{Submitting patches} for details.
 | 
			
		||||
@item Directly committing changes to the main tree.
 | 
			
		||||
@item Committing changes to a git clone, for example on github.com or
 | 
			
		||||
      gitorious.org. And asking us to merge these changes.
 | 
			
		||||
@end itemize
 | 
			
		||||
 | 
			
		||||
Whichever way, changes should be reviewed by the maintainer of the code
 | 
			
		||||
before they are committed. And they should follow the @ref{Coding Rules}.
 | 
			
		||||
The developer making the commit and the author are responsible for their changes
 | 
			
		||||
and should try to fix issues their commit causes.
 | 
			
		||||
 | 
			
		||||
@anchor{Coding Rules}
 | 
			
		||||
@section Coding Rules
 | 
			
		||||
 | 
			
		||||
@subsection Code formatting conventions
 | 
			
		||||
 | 
			
		||||
There are the following guidelines regarding the indentation in files:
 | 
			
		||||
@itemize @bullet
 | 
			
		||||
@item
 | 
			
		||||
Indent size is 4.
 | 
			
		||||
@item
 | 
			
		||||
The TAB character is forbidden outside of Makefiles as is any
 | 
			
		||||
form of trailing whitespace. Commits containing either will be
 | 
			
		||||
rejected by the git repository.
 | 
			
		||||
@item
 | 
			
		||||
You should try to limit your code lines to 80 characters; however, do so if
 | 
			
		||||
and only if this improves readability.
 | 
			
		||||
@end itemize
 | 
			
		||||
The presentation is one inspired by 'indent -i4 -kr -nut'.
 | 
			
		||||
 | 
			
		||||
The main priority in FFmpeg is simplicity and small code size in order to
 | 
			
		||||
minimize the bug count.
 | 
			
		||||
 | 
			
		||||
@subsection Comments
 | 
			
		||||
Use the JavaDoc/Doxygen  format (see examples below) so that code documentation
 | 
			
		||||
can be generated automatically. All nontrivial functions should have a comment
 | 
			
		||||
above them explaining what the function does, even if it is just one sentence.
 | 
			
		||||
All structures and their member variables should be documented, too.
 | 
			
		||||
 | 
			
		||||
Avoid Qt-style and similar Doxygen syntax with @code{!} in it, i.e. replace
 | 
			
		||||
@code{//!} with @code{///} and similar.  Also @@ syntax should be employed
 | 
			
		||||
for markup commands, i.e. use @code{@@param} and not @code{\param}.
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
/**
 | 
			
		||||
 * @@file
 | 
			
		||||
 * MPEG codec.
 | 
			
		||||
 * @@author ...
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Summary sentence.
 | 
			
		||||
 * more text ...
 | 
			
		||||
 * ...
 | 
			
		||||
 */
 | 
			
		||||
typedef struct Foobar@{
 | 
			
		||||
    int var1; /**< var1 description */
 | 
			
		||||
    int var2; ///< var2 description
 | 
			
		||||
    /** var3 description */
 | 
			
		||||
    int var3;
 | 
			
		||||
@} Foobar;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Summary sentence.
 | 
			
		||||
 * more text ...
 | 
			
		||||
 * ...
 | 
			
		||||
 * @@param my_parameter description of my_parameter
 | 
			
		||||
 * @@return return value description
 | 
			
		||||
 */
 | 
			
		||||
int myfunc(int my_parameter)
 | 
			
		||||
...
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@subsection C language features
 | 
			
		||||
 | 
			
		||||
FFmpeg is programmed in the ISO C90 language with a few additional
 | 
			
		||||
features from ISO C99, namely:
 | 
			
		||||
@itemize @bullet
 | 
			
		||||
@item
 | 
			
		||||
the @samp{inline} keyword;
 | 
			
		||||
@item
 | 
			
		||||
@samp{//} comments;
 | 
			
		||||
@item
 | 
			
		||||
designated struct initializers (@samp{struct s x = @{ .i = 17 @};})
 | 
			
		||||
@item
 | 
			
		||||
compound literals (@samp{x = (struct s) @{ 17, 23 @};})
 | 
			
		||||
@end itemize
 | 
			
		||||
 | 
			
		||||
These features are supported by all compilers we care about, so we will not
 | 
			
		||||
accept patches to remove their use unless they absolutely do not impair
 | 
			
		||||
clarity and performance.
 | 
			
		||||
 | 
			
		||||
All code must compile with recent versions of GCC and a number of other
 | 
			
		||||
currently supported compilers. To ensure compatibility, please do not use
 | 
			
		||||
additional C99 features or GCC extensions. Especially watch out for:
 | 
			
		||||
@itemize @bullet
 | 
			
		||||
@item
 | 
			
		||||
mixing statements and declarations;
 | 
			
		||||
@item
 | 
			
		||||
@samp{long long} (use @samp{int64_t} instead);
 | 
			
		||||
@item
 | 
			
		||||
@samp{__attribute__} not protected by @samp{#ifdef __GNUC__} or similar;
 | 
			
		||||
@item
 | 
			
		||||
GCC statement expressions (@samp{(x = (@{ int y = 4; y; @})}).
 | 
			
		||||
@end itemize
 | 
			
		||||
 | 
			
		||||
@subsection Naming conventions
 | 
			
		||||
All names are using underscores (_), not CamelCase. For example, @samp{avfilter_get_video_buffer} is
 | 
			
		||||
a valid function name and @samp{AVFilterGetVideo} is not. The exception from this are type names, like
 | 
			
		||||
for example structs and enums; they should always be in the CamelCase
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
There are following conventions for naming variables and functions:
 | 
			
		||||
@itemize @bullet
 | 
			
		||||
@item
 | 
			
		||||
For local variables no prefix is required.
 | 
			
		||||
@item
 | 
			
		||||
For variables and functions declared as @code{static} no prefixes are required.
 | 
			
		||||
@item
 | 
			
		||||
For variables and functions used internally by the library, @code{ff_} prefix
 | 
			
		||||
should be used.
 | 
			
		||||
For example, @samp{ff_w64_demuxer}.
 | 
			
		||||
@item
 | 
			
		||||
For variables and functions used internally across multiple libraries, use
 | 
			
		||||
@code{avpriv_}. For example, @samp{avpriv_aac_parse_header}.
 | 
			
		||||
@item
 | 
			
		||||
For exported names, each library has its own prefixes. Just check the existing
 | 
			
		||||
code and name accordingly.
 | 
			
		||||
@end itemize
 | 
			
		||||
 | 
			
		||||
@subsection Miscellanous conventions
 | 
			
		||||
@itemize @bullet
 | 
			
		||||
@item
 | 
			
		||||
fprintf and printf are forbidden in libavformat and libavcodec,
 | 
			
		||||
please use av_log() instead.
 | 
			
		||||
@item
 | 
			
		||||
Casts should be used only when necessary. Unneeded parentheses
 | 
			
		||||
should also be avoided if they don't make the code easier to understand.
 | 
			
		||||
@end itemize
 | 
			
		||||
 | 
			
		||||
@subsection Editor configuration
 | 
			
		||||
In order to configure Vim to follow FFmpeg formatting conventions, paste
 | 
			
		||||
the following snippet into your @file{.vimrc}:
 | 
			
		||||
@example
 | 
			
		||||
" indentation rules for FFmpeg: 4 spaces, no tabs
 | 
			
		||||
set expandtab
 | 
			
		||||
set shiftwidth=4
 | 
			
		||||
set softtabstop=4
 | 
			
		||||
set cindent
 | 
			
		||||
set cinoptions=(0
 | 
			
		||||
" allow tabs in Makefiles
 | 
			
		||||
autocmd FileType make set noexpandtab shiftwidth=8 softtabstop=8
 | 
			
		||||
" Trailing whitespace and tabs are forbidden, so highlight them.
 | 
			
		||||
highlight ForbiddenWhitespace ctermbg=red guibg=red
 | 
			
		||||
match ForbiddenWhitespace /\s\+$\|\t/
 | 
			
		||||
" Do not highlight spaces at the end of line while typing on that line.
 | 
			
		||||
autocmd InsertEnter * match ForbiddenWhitespace /\t\|\s\+\%#\@@<!$/
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
For Emacs, add these roughly equivalent lines to your @file{.emacs.d/init.el}:
 | 
			
		||||
@example
 | 
			
		||||
(c-add-style "ffmpeg"
 | 
			
		||||
             '("k&r"
 | 
			
		||||
               (c-basic-offset . 4)
 | 
			
		||||
               (indent-tabs-mode . nil)
 | 
			
		||||
               (show-trailing-whitespace . t)
 | 
			
		||||
               (c-offsets-alist
 | 
			
		||||
                (statement-cont . (c-lineup-assignments +)))
 | 
			
		||||
               )
 | 
			
		||||
             )
 | 
			
		||||
(setq c-default-style "ffmpeg")
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@section Development Policy
 | 
			
		||||
 | 
			
		||||
@enumerate
 | 
			
		||||
@item
 | 
			
		||||
   Contributions should be licensed under the LGPL 2.1, including an
 | 
			
		||||
   "or any later version" clause, or the MIT license.  GPL 2 including
 | 
			
		||||
   an "or any later version" clause is also acceptable, but LGPL is
 | 
			
		||||
   preferred.
 | 
			
		||||
@item
 | 
			
		||||
   You must not commit code which breaks FFmpeg! (Meaning unfinished but
 | 
			
		||||
   enabled code which breaks compilation or compiles but does not work or
 | 
			
		||||
   breaks the regression tests)
 | 
			
		||||
   You can commit unfinished stuff (for testing etc), but it must be disabled
 | 
			
		||||
   (#ifdef etc) by default so it does not interfere with other developers'
 | 
			
		||||
   work.
 | 
			
		||||
@item
 | 
			
		||||
   You do not have to over-test things. If it works for you, and you think it
 | 
			
		||||
   should work for others, then commit. If your code has problems
 | 
			
		||||
   (portability, triggers compiler bugs, unusual environment etc) they will be
 | 
			
		||||
   reported and eventually fixed.
 | 
			
		||||
@item
 | 
			
		||||
   Do not commit unrelated changes together, split them into self-contained
 | 
			
		||||
   pieces. Also do not forget that if part B depends on part A, but A does not
 | 
			
		||||
   depend on B, then A can and should be committed first and separate from B.
 | 
			
		||||
   Keeping changes well split into self-contained parts makes reviewing and
 | 
			
		||||
   understanding them on the commit log mailing list easier. This also helps
 | 
			
		||||
   in case of debugging later on.
 | 
			
		||||
   Also if you have doubts about splitting or not splitting, do not hesitate to
 | 
			
		||||
   ask/discuss it on the developer mailing list.
 | 
			
		||||
@item
 | 
			
		||||
   Do not change behavior of the programs (renaming options etc) or public
 | 
			
		||||
   API or ABI without first discussing it on the ffmpeg-devel mailing list.
 | 
			
		||||
   Do not remove functionality from the code. Just improve!
 | 
			
		||||
 | 
			
		||||
   Note: Redundant code can be removed.
 | 
			
		||||
@item
 | 
			
		||||
   Do not commit changes to the build system (Makefiles, configure script)
 | 
			
		||||
   which change behavior, defaults etc, without asking first. The same
 | 
			
		||||
   applies to compiler warning fixes, trivial looking fixes and to code
 | 
			
		||||
   maintained by other developers. We usually have a reason for doing things
 | 
			
		||||
   the way we do. Send your changes as patches to the ffmpeg-devel mailing
 | 
			
		||||
   list, and if the code maintainers say OK, you may commit. This does not
 | 
			
		||||
   apply to files you wrote and/or maintain.
 | 
			
		||||
@item
 | 
			
		||||
   We refuse source indentation and other cosmetic changes if they are mixed
 | 
			
		||||
   with functional changes, such commits will be rejected and removed. Every
 | 
			
		||||
   developer has his own indentation style, you should not change it. Of course
 | 
			
		||||
   if you (re)write something, you can use your own style, even though we would
 | 
			
		||||
   prefer if the indentation throughout FFmpeg was consistent (Many projects
 | 
			
		||||
   force a given indentation style - we do not.). If you really need to make
 | 
			
		||||
   indentation changes (try to avoid this), separate them strictly from real
 | 
			
		||||
   changes.
 | 
			
		||||
 | 
			
		||||
   NOTE: If you had to put if()@{ .. @} over a large (> 5 lines) chunk of code,
 | 
			
		||||
   then either do NOT change the indentation of the inner part within (do not
 | 
			
		||||
   move it to the right)! or do so in a separate commit
 | 
			
		||||
@item
 | 
			
		||||
   Always fill out the commit log message. Describe in a few lines what you
 | 
			
		||||
   changed and why. You can refer to mailing list postings if you fix a
 | 
			
		||||
   particular bug. Comments such as "fixed!" or "Changed it." are unacceptable.
 | 
			
		||||
   Recommended format:
 | 
			
		||||
   area changed: Short 1 line description
 | 
			
		||||
 | 
			
		||||
   details describing what and why and giving references.
 | 
			
		||||
@item
 | 
			
		||||
   Make sure the author of the commit is set correctly. (see git commit --author)
 | 
			
		||||
   If you apply a patch, send an
 | 
			
		||||
   answer to ffmpeg-devel (or wherever you got the patch from) saying that
 | 
			
		||||
   you applied the patch.
 | 
			
		||||
@item
 | 
			
		||||
   When applying patches that have been discussed (at length) on the mailing
 | 
			
		||||
   list, reference the thread in the log message.
 | 
			
		||||
@item
 | 
			
		||||
    Do NOT commit to code actively maintained by others without permission.
 | 
			
		||||
    Send a patch to ffmpeg-devel instead. If no one answers within a reasonable
 | 
			
		||||
    timeframe (12h for build failures and security fixes, 3 days small changes,
 | 
			
		||||
    1 week for big patches) then commit your patch if you think it is OK.
 | 
			
		||||
    Also note, the maintainer can simply ask for more time to review!
 | 
			
		||||
@item
 | 
			
		||||
    Subscribe to the ffmpeg-cvslog mailing list. The diffs of all commits
 | 
			
		||||
    are sent there and reviewed by all the other developers. Bugs and possible
 | 
			
		||||
    improvements or general questions regarding commits are discussed there. We
 | 
			
		||||
    expect you to react if problems with your code are uncovered.
 | 
			
		||||
@item
 | 
			
		||||
    Update the documentation if you change behavior or add features. If you are
 | 
			
		||||
    unsure how best to do this, send a patch to ffmpeg-devel, the documentation
 | 
			
		||||
    maintainer(s) will review and commit your stuff.
 | 
			
		||||
@item
 | 
			
		||||
    Try to keep important discussions and requests (also) on the public
 | 
			
		||||
    developer mailing list, so that all developers can benefit from them.
 | 
			
		||||
@item
 | 
			
		||||
    Never write to unallocated memory, never write over the end of arrays,
 | 
			
		||||
    always check values read from some untrusted source before using them
 | 
			
		||||
    as array index or other risky things.
 | 
			
		||||
@item
 | 
			
		||||
    Remember to check if you need to bump versions for the specific libav*
 | 
			
		||||
    parts (libavutil, libavcodec, libavformat) you are changing. You need
 | 
			
		||||
    to change the version integer.
 | 
			
		||||
    Incrementing the first component means no backward compatibility to
 | 
			
		||||
    previous versions (e.g. removal of a function from the public API).
 | 
			
		||||
    Incrementing the second component means backward compatible change
 | 
			
		||||
    (e.g. addition of a function to the public API or extension of an
 | 
			
		||||
    existing data structure).
 | 
			
		||||
    Incrementing the third component means a noteworthy binary compatible
 | 
			
		||||
    change (e.g. encoder bug fix that matters for the decoder).
 | 
			
		||||
@item
 | 
			
		||||
    Compiler warnings indicate potential bugs or code with bad style. If a type of
 | 
			
		||||
    warning always points to correct and clean code, that warning should
 | 
			
		||||
    be disabled, not the code changed.
 | 
			
		||||
    Thus the remaining warnings can either be bugs or correct code.
 | 
			
		||||
    If it is a bug, the bug has to be fixed. If it is not, the code should
 | 
			
		||||
    be changed to not generate a warning unless that causes a slowdown
 | 
			
		||||
    or obfuscates the code.
 | 
			
		||||
@item
 | 
			
		||||
    If you add a new file, give it a proper license header. Do not copy and
 | 
			
		||||
    paste it from a random place, use an existing file as template.
 | 
			
		||||
@end enumerate
 | 
			
		||||
 | 
			
		||||
We think our rules are not too hard. If you have comments, contact us.
 | 
			
		||||
 | 
			
		||||
Note, these rules are mostly borrowed from the MPlayer project.
 | 
			
		||||
 | 
			
		||||
@anchor{Submitting patches}
 | 
			
		||||
@section Submitting patches
 | 
			
		||||
 | 
			
		||||
First, read the @ref{Coding Rules} above if you did not yet, in particular
 | 
			
		||||
the rules regarding patch submission.
 | 
			
		||||
 | 
			
		||||
When you submit your patch, please use @code{git format-patch} or
 | 
			
		||||
@code{git send-email}. We cannot read other diffs :-)
 | 
			
		||||
 | 
			
		||||
Also please do not submit a patch which contains several unrelated changes.
 | 
			
		||||
Split it into separate, self-contained pieces. This does not mean splitting
 | 
			
		||||
file by file. Instead, make the patch as small as possible while still
 | 
			
		||||
keeping it as a logical unit that contains an individual change, even
 | 
			
		||||
if it spans multiple files. This makes reviewing your patches much easier
 | 
			
		||||
for us and greatly increases your chances of getting your patch applied.
 | 
			
		||||
 | 
			
		||||
Use the patcheck tool of FFmpeg to check your patch.
 | 
			
		||||
The tool is located in the tools directory.
 | 
			
		||||
 | 
			
		||||
Run the @ref{Regression tests} before submitting a patch in order to verify
 | 
			
		||||
it does not cause unexpected problems.
 | 
			
		||||
 | 
			
		||||
Patches should be posted as base64 encoded attachments (or any other
 | 
			
		||||
encoding which ensures that the patch will not be trashed during
 | 
			
		||||
transmission) to the ffmpeg-devel mailing list, see
 | 
			
		||||
@url{http://lists.ffmpeg.org/mailman/listinfo/ffmpeg-devel}
 | 
			
		||||
 | 
			
		||||
It also helps quite a bit if you tell us what the patch does (for example
 | 
			
		||||
'replaces lrint by lrintf'), and why (for example '*BSD isn't C99 compliant
 | 
			
		||||
and has no lrint()')
 | 
			
		||||
 | 
			
		||||
Also please if you send several patches, send each patch as a separate mail,
 | 
			
		||||
do not attach several unrelated patches to the same mail.
 | 
			
		||||
 | 
			
		||||
Your patch will be reviewed on the mailing list. You will likely be asked
 | 
			
		||||
to make some changes and are expected to send in an improved version that
 | 
			
		||||
incorporates the requests from the review. This process may go through
 | 
			
		||||
several iterations. Once your patch is deemed good enough, some developer
 | 
			
		||||
will pick it up and commit it to the official FFmpeg tree.
 | 
			
		||||
 | 
			
		||||
Give us a few days to react. But if some time passes without reaction,
 | 
			
		||||
send a reminder by email. Your patch should eventually be dealt with.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section New codecs or formats checklist
 | 
			
		||||
 | 
			
		||||
@enumerate
 | 
			
		||||
@item
 | 
			
		||||
    Did you use av_cold for codec initialization and close functions?
 | 
			
		||||
@item
 | 
			
		||||
    Did you add a long_name under NULL_IF_CONFIG_SMALL to the AVCodec or
 | 
			
		||||
    AVInputFormat/AVOutputFormat struct?
 | 
			
		||||
@item
 | 
			
		||||
    Did you bump the minor version number (and reset the micro version
 | 
			
		||||
    number) in @file{libavcodec/version.h} or @file{libavformat/version.h}?
 | 
			
		||||
@item
 | 
			
		||||
    Did you register it in @file{allcodecs.c} or @file{allformats.c}?
 | 
			
		||||
@item
 | 
			
		||||
    Did you add the AVCodecID to @file{avcodec.h}?
 | 
			
		||||
    When adding new codec IDs, also add an entry to the codec descriptor
 | 
			
		||||
    list in @file{libavcodec/codec_desc.c}.
 | 
			
		||||
@item
 | 
			
		||||
    If it has a fourCC, did you add it to @file{libavformat/riff.c},
 | 
			
		||||
    even if it is only a decoder?
 | 
			
		||||
@item
 | 
			
		||||
    Did you add a rule to compile the appropriate files in the Makefile?
 | 
			
		||||
    Remember to do this even if you're just adding a format to a file that is
 | 
			
		||||
    already being compiled by some other rule, like a raw demuxer.
 | 
			
		||||
@item
 | 
			
		||||
    Did you add an entry to the table of supported formats or codecs in
 | 
			
		||||
    @file{doc/general.texi}?
 | 
			
		||||
@item
 | 
			
		||||
    Did you add an entry in the Changelog?
 | 
			
		||||
@item
 | 
			
		||||
    If it depends on a parser or a library, did you add that dependency in
 | 
			
		||||
    configure?
 | 
			
		||||
@item
 | 
			
		||||
    Did you @code{git add} the appropriate files before committing?
 | 
			
		||||
@item
 | 
			
		||||
    Did you make sure it compiles standalone, i.e. with
 | 
			
		||||
    @code{configure --disable-everything --enable-decoder=foo}
 | 
			
		||||
    (or @code{--enable-demuxer} or whatever your component is)?
 | 
			
		||||
@end enumerate
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section patch submission checklist
 | 
			
		||||
 | 
			
		||||
@enumerate
 | 
			
		||||
@item
 | 
			
		||||
    Does @code{make fate} pass with the patch applied?
 | 
			
		||||
@item
 | 
			
		||||
    Was the patch generated with git format-patch or send-email?
 | 
			
		||||
@item
 | 
			
		||||
    Did you sign off your patch? (git commit -s)
 | 
			
		||||
    See @url{http://kerneltrap.org/files/Jeremy/DCO.txt} for the meaning
 | 
			
		||||
    of sign off.
 | 
			
		||||
@item
 | 
			
		||||
    Did you provide a clear git commit log message?
 | 
			
		||||
@item
 | 
			
		||||
    Is the patch against latest FFmpeg git master branch?
 | 
			
		||||
@item
 | 
			
		||||
    Are you subscribed to ffmpeg-devel?
 | 
			
		||||
    (the list is subscribers only due to spam)
 | 
			
		||||
@item
 | 
			
		||||
    Have you checked that the changes are minimal, so that the same cannot be
 | 
			
		||||
    achieved with a smaller patch and/or simpler final code?
 | 
			
		||||
@item
 | 
			
		||||
    If the change is to speed critical code, did you benchmark it?
 | 
			
		||||
@item
 | 
			
		||||
    If you did any benchmarks, did you provide them in the mail?
 | 
			
		||||
@item
 | 
			
		||||
    Have you checked that the patch does not introduce buffer overflows or
 | 
			
		||||
    other security issues?
 | 
			
		||||
@item
 | 
			
		||||
    Did you test your decoder or demuxer against damaged data? If no, see
 | 
			
		||||
    tools/trasher and the noise bitstream filter. Your decoder or demuxer
 | 
			
		||||
    should not crash or end in a (near) infinite loop when fed damaged data.
 | 
			
		||||
@item
 | 
			
		||||
    Does the patch not mix functional and cosmetic changes?
 | 
			
		||||
@item
 | 
			
		||||
    Did you add tabs or trailing whitespace to the code? Both are forbidden.
 | 
			
		||||
@item
 | 
			
		||||
    Is the patch attached to the email you send?
 | 
			
		||||
@item
 | 
			
		||||
    Is the mime type of the patch correct? It should be text/x-diff or
 | 
			
		||||
    text/x-patch or at least text/plain and not application/octet-stream.
 | 
			
		||||
@item
 | 
			
		||||
    If the patch fixes a bug, did you provide a verbose analysis of the bug?
 | 
			
		||||
@item
 | 
			
		||||
    If the patch fixes a bug, did you provide enough information, including
 | 
			
		||||
    a sample, so the bug can be reproduced and the fix can be verified?
 | 
			
		||||
    Note please do not attach samples >100k to mails but rather provide a
 | 
			
		||||
    URL, you can upload to ftp://upload.ffmpeg.org
 | 
			
		||||
@item
 | 
			
		||||
    Did you provide a verbose summary about what the patch does change?
 | 
			
		||||
@item
 | 
			
		||||
    Did you provide a verbose explanation why it changes things like it does?
 | 
			
		||||
@item
 | 
			
		||||
    Did you provide a verbose summary of the user visible advantages and
 | 
			
		||||
    disadvantages if the patch is applied?
 | 
			
		||||
@item
 | 
			
		||||
    Did you provide an example so we can verify the new feature added by the
 | 
			
		||||
    patch easily?
 | 
			
		||||
@item
 | 
			
		||||
    If you added a new file, did you insert a license header? It should be
 | 
			
		||||
    taken from FFmpeg, not randomly copied and pasted from somewhere else.
 | 
			
		||||
@item
 | 
			
		||||
    You should maintain alphabetical order in alphabetically ordered lists as
 | 
			
		||||
    long as doing so does not break API/ABI compatibility.
 | 
			
		||||
@item
 | 
			
		||||
    Lines with similar content should be aligned vertically when doing so
 | 
			
		||||
    improves readability.
 | 
			
		||||
@item
 | 
			
		||||
    Consider to add a regression test for your code.
 | 
			
		||||
@item
 | 
			
		||||
    If you added YASM code please check that things still work with --disable-yasm
 | 
			
		||||
@item
 | 
			
		||||
    Make sure you check the return values of function and return appropriate
 | 
			
		||||
    error codes. Especially memory allocation functions like @code{av_malloc()}
 | 
			
		||||
    are notoriously left unchecked, which is a serious problem.
 | 
			
		||||
@end enumerate
 | 
			
		||||
 | 
			
		||||
@section Patch review process
 | 
			
		||||
 | 
			
		||||
All patches posted to ffmpeg-devel will be reviewed, unless they contain a
 | 
			
		||||
clear note that the patch is not for the git master branch.
 | 
			
		||||
Reviews and comments will be posted as replies to the patch on the
 | 
			
		||||
mailing list. The patch submitter then has to take care of every comment,
 | 
			
		||||
that can be by resubmitting a changed patch or by discussion. Resubmitted
 | 
			
		||||
patches will themselves be reviewed like any other patch. If at some point
 | 
			
		||||
a patch passes review with no comments then it is approved, that can for
 | 
			
		||||
simple and small patches happen immediately while large patches will generally
 | 
			
		||||
have to be changed and reviewed many times before they are approved.
 | 
			
		||||
After a patch is approved it will be committed to the repository.
 | 
			
		||||
 | 
			
		||||
We will review all submitted patches, but sometimes we are quite busy so
 | 
			
		||||
especially for large patches this can take several weeks.
 | 
			
		||||
 | 
			
		||||
If you feel that the review process is too slow and you are willing to try to
 | 
			
		||||
take over maintainership of the area of code you change then just clone
 | 
			
		||||
git master and maintain the area of code there. We will merge each area from
 | 
			
		||||
where its best maintained.
 | 
			
		||||
 | 
			
		||||
When resubmitting patches, please do not make any significant changes
 | 
			
		||||
not related to the comments received during review. Such patches will
 | 
			
		||||
be rejected. Instead, submit significant changes or new features as
 | 
			
		||||
separate patches.
 | 
			
		||||
 | 
			
		||||
@anchor{Regression tests}
 | 
			
		||||
@section Regression tests
 | 
			
		||||
 | 
			
		||||
Before submitting a patch (or committing to the repository), you should at least
 | 
			
		||||
test that you did not break anything.
 | 
			
		||||
 | 
			
		||||
Running 'make fate' accomplishes this, please see @url{fate.html} for details.
 | 
			
		||||
 | 
			
		||||
[Of course, some patches may change the results of the regression tests. In
 | 
			
		||||
this case, the reference results of the regression tests shall be modified
 | 
			
		||||
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 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 introductionary message for the patch series that you post to
 | 
			
		||||
the ffmpeg-devel mailing list, a direct link to download the sample media.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@bye
 | 
			
		||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -1,10 +0,0 @@
 | 
			
		||||
 </div>
 | 
			
		||||
 | 
			
		||||
 <div id="footer">
 | 
			
		||||
   Generated on $datetime for $projectname by <a href="http://www.doxygen.org/index.html">doxygen</a> $doxygenversion
 | 
			
		||||
 </div>
 | 
			
		||||
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
</body>
 | 
			
		||||
</html>
 | 
			
		||||
@@ -1,14 +0,0 @@
 | 
			
		||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 | 
			
		||||
<html xmlns="http://www.w3.org/1999/xhtml">
 | 
			
		||||
<head>
 | 
			
		||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
 | 
			
		||||
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
 | 
			
		||||
<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
 | 
			
		||||
<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
 | 
			
		||||
<link href="$relpath$doxy_stylesheet.css" rel="stylesheet" type="text/css" />
 | 
			
		||||
</head>
 | 
			
		||||
 | 
			
		||||
<div id="container">
 | 
			
		||||
 | 
			
		||||
<div id="body">
 | 
			
		||||
 <div>
 | 
			
		||||
@@ -1,594 +0,0 @@
 | 
			
		||||
@chapter Encoders
 | 
			
		||||
@c man begin ENCODERS
 | 
			
		||||
 | 
			
		||||
Encoders are configured elements in FFmpeg which allow the encoding of
 | 
			
		||||
multimedia streams.
 | 
			
		||||
 | 
			
		||||
When you configure your FFmpeg build, all the supported native encoders
 | 
			
		||||
are enabled by default. Encoders requiring an external library must be enabled
 | 
			
		||||
manually via the corresponding @code{--enable-lib} option. You can list all
 | 
			
		||||
available encoders using the configure option @code{--list-encoders}.
 | 
			
		||||
 | 
			
		||||
You can disable all the encoders with the configure option
 | 
			
		||||
@code{--disable-encoders} and selectively enable / disable single encoders
 | 
			
		||||
with the options @code{--enable-encoder=@var{ENCODER}} /
 | 
			
		||||
@code{--disable-encoder=@var{ENCODER}}.
 | 
			
		||||
 | 
			
		||||
The option @code{-codecs} of the ff* tools will display the list of
 | 
			
		||||
enabled encoders.
 | 
			
		||||
 | 
			
		||||
@c man end ENCODERS
 | 
			
		||||
 | 
			
		||||
@chapter Audio Encoders
 | 
			
		||||
@c man begin AUDIO ENCODERS
 | 
			
		||||
 | 
			
		||||
A description of some of the currently available audio encoders
 | 
			
		||||
follows.
 | 
			
		||||
 | 
			
		||||
@section ac3 and ac3_fixed
 | 
			
		||||
 | 
			
		||||
AC-3 audio encoders.
 | 
			
		||||
 | 
			
		||||
These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366, as well as
 | 
			
		||||
the undocumented RealAudio 3 (a.k.a. dnet).
 | 
			
		||||
 | 
			
		||||
The @var{ac3} encoder uses floating-point math, while the @var{ac3_fixed}
 | 
			
		||||
encoder only uses fixed-point integer math. This does not mean that one is
 | 
			
		||||
always faster, just that one or the other may be better suited to a
 | 
			
		||||
particular system. The floating-point encoder will generally produce better
 | 
			
		||||
quality audio for a given bitrate. The @var{ac3_fixed} encoder is not the
 | 
			
		||||
default codec for any of the output formats, so it must be specified explicitly
 | 
			
		||||
using the option @code{-acodec ac3_fixed} in order to use it.
 | 
			
		||||
 | 
			
		||||
@subsection AC-3 Metadata
 | 
			
		||||
 | 
			
		||||
The AC-3 metadata options are used to set parameters that describe the audio,
 | 
			
		||||
but in most cases do not affect the audio encoding itself. Some of the options
 | 
			
		||||
do directly affect or influence the decoding and playback of the resulting
 | 
			
		||||
bitstream, while others are just for informational purposes. A few of the
 | 
			
		||||
options will add bits to the output stream that could otherwise be used for
 | 
			
		||||
audio data, and will thus affect the quality of the output. Those will be
 | 
			
		||||
indicated accordingly with a note in the option list below.
 | 
			
		||||
 | 
			
		||||
These parameters are described in detail in several publicly-available
 | 
			
		||||
documents.
 | 
			
		||||
@itemize
 | 
			
		||||
@item @uref{http://www.atsc.org/cms/standards/a_52-2010.pdf,A/52:2010 - Digital Audio Compression (AC-3) (E-AC-3) Standard}
 | 
			
		||||
@item @uref{http://www.atsc.org/cms/standards/a_54a_with_corr_1.pdf,A/54 - Guide to the Use of the ATSC Digital Television Standard}
 | 
			
		||||
@item @uref{http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/18_Metadata.Guide.pdf,Dolby Metadata Guide}
 | 
			
		||||
@item @uref{http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/46_DDEncodingGuidelines.pdf,Dolby Digital Professional Encoding Guidelines}
 | 
			
		||||
@end itemize
 | 
			
		||||
 | 
			
		||||
@subsubsection Metadata Control Options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item -per_frame_metadata @var{boolean}
 | 
			
		||||
Allow Per-Frame Metadata. Specifies if the encoder should check for changing
 | 
			
		||||
metadata for each frame.
 | 
			
		||||
@table @option
 | 
			
		||||
@item 0
 | 
			
		||||
The metadata values set at initialization will be used for every frame in the
 | 
			
		||||
stream. (default)
 | 
			
		||||
@item 1
 | 
			
		||||
Metadata values can be changed before encoding each frame.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@subsubsection Downmix Levels
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item -center_mixlev @var{level}
 | 
			
		||||
Center Mix Level. The amount of gain the decoder should apply to the center
 | 
			
		||||
channel when downmixing to stereo. This field will only be written to the
 | 
			
		||||
bitstream if a center channel is present. The value is specified as a scale
 | 
			
		||||
factor. There are 3 valid values:
 | 
			
		||||
@table @option
 | 
			
		||||
@item 0.707
 | 
			
		||||
Apply -3dB gain
 | 
			
		||||
@item 0.595
 | 
			
		||||
Apply -4.5dB gain (default)
 | 
			
		||||
@item 0.500
 | 
			
		||||
Apply -6dB gain
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@item -surround_mixlev @var{level}
 | 
			
		||||
Surround Mix Level. The amount of gain the decoder should apply to the surround
 | 
			
		||||
channel(s) when downmixing to stereo. This field will only be written to the
 | 
			
		||||
bitstream if one or more surround channels are present. The value is specified
 | 
			
		||||
as a scale factor.  There are 3 valid values:
 | 
			
		||||
@table @option
 | 
			
		||||
@item 0.707
 | 
			
		||||
Apply -3dB gain
 | 
			
		||||
@item 0.500
 | 
			
		||||
Apply -6dB gain (default)
 | 
			
		||||
@item 0.000
 | 
			
		||||
Silence Surround Channel(s)
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@subsubsection Audio Production Information
 | 
			
		||||
Audio Production Information is optional information describing the mixing
 | 
			
		||||
environment.  Either none or both of the fields are written to the bitstream.
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item -mixing_level @var{number}
 | 
			
		||||
Mixing Level. Specifies peak sound pressure level (SPL) in the production
 | 
			
		||||
environment when the mix was mastered. Valid values are 80 to 111, or -1 for
 | 
			
		||||
unknown or not indicated. The default value is -1, but that value cannot be
 | 
			
		||||
used if the Audio Production Information is written to the bitstream. Therefore,
 | 
			
		||||
if the @code{room_type} option is not the default value, the @code{mixing_level}
 | 
			
		||||
option must not be -1.
 | 
			
		||||
 | 
			
		||||
@item -room_type @var{type}
 | 
			
		||||
Room Type. Describes the equalization used during the final mixing session at
 | 
			
		||||
the studio or on the dubbing stage. A large room is a dubbing stage with the
 | 
			
		||||
industry standard X-curve equalization; a small room has flat equalization.
 | 
			
		||||
This field will not be written to the bitstream if both the @code{mixing_level}
 | 
			
		||||
option and the @code{room_type} option have the default values.
 | 
			
		||||
@table @option
 | 
			
		||||
@item 0
 | 
			
		||||
@itemx notindicated
 | 
			
		||||
Not Indicated (default)
 | 
			
		||||
@item 1
 | 
			
		||||
@itemx large
 | 
			
		||||
Large Room
 | 
			
		||||
@item 2
 | 
			
		||||
@itemx small
 | 
			
		||||
Small Room
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@subsubsection Other Metadata Options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item -copyright @var{boolean}
 | 
			
		||||
Copyright Indicator. Specifies whether a copyright exists for this audio.
 | 
			
		||||
@table @option
 | 
			
		||||
@item 0
 | 
			
		||||
@itemx off
 | 
			
		||||
No Copyright Exists (default)
 | 
			
		||||
@item 1
 | 
			
		||||
@itemx on
 | 
			
		||||
Copyright Exists
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@item -dialnorm @var{value}
 | 
			
		||||
Dialogue Normalization. Indicates how far the average dialogue level of the
 | 
			
		||||
program is below digital 100% full scale (0 dBFS). This parameter determines a
 | 
			
		||||
level shift during audio reproduction that sets the average volume of the
 | 
			
		||||
dialogue to a preset level. The goal is to match volume level between program
 | 
			
		||||
sources. A value of -31dB will result in no volume level change, relative to
 | 
			
		||||
the source volume, during audio reproduction. Valid values are whole numbers in
 | 
			
		||||
the range -31 to -1, with -31 being the default.
 | 
			
		||||
 | 
			
		||||
@item -dsur_mode @var{mode}
 | 
			
		||||
Dolby Surround Mode. Specifies whether the stereo signal uses Dolby Surround
 | 
			
		||||
(Pro Logic). This field will only be written to the bitstream if the audio
 | 
			
		||||
stream is stereo. Using this option does @b{NOT} mean the encoder will actually
 | 
			
		||||
apply Dolby Surround processing.
 | 
			
		||||
@table @option
 | 
			
		||||
@item 0
 | 
			
		||||
@itemx notindicated
 | 
			
		||||
Not Indicated (default)
 | 
			
		||||
@item 1
 | 
			
		||||
@itemx off
 | 
			
		||||
Not Dolby Surround Encoded
 | 
			
		||||
@item 2
 | 
			
		||||
@itemx on
 | 
			
		||||
Dolby Surround Encoded
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@item -original @var{boolean}
 | 
			
		||||
Original Bit Stream Indicator. Specifies whether this audio is from the
 | 
			
		||||
original source and not a copy.
 | 
			
		||||
@table @option
 | 
			
		||||
@item 0
 | 
			
		||||
@itemx off
 | 
			
		||||
Not Original Source
 | 
			
		||||
@item 1
 | 
			
		||||
@itemx on
 | 
			
		||||
Original Source (default)
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@subsection Extended Bitstream Information
 | 
			
		||||
The extended bitstream options are part of the Alternate Bit Stream Syntax as
 | 
			
		||||
specified in Annex D of the A/52:2010 standard. It is grouped into 2 parts.
 | 
			
		||||
If any one parameter in a group is specified, all values in that group will be
 | 
			
		||||
written to the bitstream.  Default values are used for those that are written
 | 
			
		||||
but have not been specified.  If the mixing levels are written, the decoder
 | 
			
		||||
will use these values instead of the ones specified in the @code{center_mixlev}
 | 
			
		||||
and @code{surround_mixlev} options if it supports the Alternate Bit Stream
 | 
			
		||||
Syntax.
 | 
			
		||||
 | 
			
		||||
@subsubsection Extended Bitstream Information - Part 1
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item -dmix_mode @var{mode}
 | 
			
		||||
Preferred Stereo Downmix Mode. Allows the user to select either Lt/Rt
 | 
			
		||||
(Dolby Surround) or Lo/Ro (normal stereo) as the preferred stereo downmix mode.
 | 
			
		||||
@table @option
 | 
			
		||||
@item 0
 | 
			
		||||
@itemx notindicated
 | 
			
		||||
Not Indicated (default)
 | 
			
		||||
@item 1
 | 
			
		||||
@itemx ltrt
 | 
			
		||||
Lt/Rt Downmix Preferred
 | 
			
		||||
@item 2
 | 
			
		||||
@itemx loro
 | 
			
		||||
Lo/Ro Downmix Preferred
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@item -ltrt_cmixlev @var{level}
 | 
			
		||||
Lt/Rt Center Mix Level. The amount of gain the decoder should apply to the
 | 
			
		||||
center channel when downmixing to stereo in Lt/Rt mode.
 | 
			
		||||
@table @option
 | 
			
		||||
@item 1.414
 | 
			
		||||
Apply +3dB gain
 | 
			
		||||
@item 1.189
 | 
			
		||||
Apply +1.5dB gain
 | 
			
		||||
@item 1.000
 | 
			
		||||
Apply 0dB gain
 | 
			
		||||
@item 0.841
 | 
			
		||||
Apply -1.5dB gain
 | 
			
		||||
@item 0.707
 | 
			
		||||
Apply -3.0dB gain
 | 
			
		||||
@item 0.595
 | 
			
		||||
Apply -4.5dB gain (default)
 | 
			
		||||
@item 0.500
 | 
			
		||||
Apply -6.0dB gain
 | 
			
		||||
@item 0.000
 | 
			
		||||
Silence Center Channel
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@item -ltrt_surmixlev @var{level}
 | 
			
		||||
Lt/Rt Surround Mix Level. The amount of gain the decoder should apply to the
 | 
			
		||||
surround channel(s) when downmixing to stereo in Lt/Rt mode.
 | 
			
		||||
@table @option
 | 
			
		||||
@item 0.841
 | 
			
		||||
Apply -1.5dB gain
 | 
			
		||||
@item 0.707
 | 
			
		||||
Apply -3.0dB gain
 | 
			
		||||
@item 0.595
 | 
			
		||||
Apply -4.5dB gain
 | 
			
		||||
@item 0.500
 | 
			
		||||
Apply -6.0dB gain (default)
 | 
			
		||||
@item 0.000
 | 
			
		||||
Silence Surround Channel(s)
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@item -loro_cmixlev @var{level}
 | 
			
		||||
Lo/Ro Center Mix Level. The amount of gain the decoder should apply to the
 | 
			
		||||
center channel when downmixing to stereo in Lo/Ro mode.
 | 
			
		||||
@table @option
 | 
			
		||||
@item 1.414
 | 
			
		||||
Apply +3dB gain
 | 
			
		||||
@item 1.189
 | 
			
		||||
Apply +1.5dB gain
 | 
			
		||||
@item 1.000
 | 
			
		||||
Apply 0dB gain
 | 
			
		||||
@item 0.841
 | 
			
		||||
Apply -1.5dB gain
 | 
			
		||||
@item 0.707
 | 
			
		||||
Apply -3.0dB gain
 | 
			
		||||
@item 0.595
 | 
			
		||||
Apply -4.5dB gain (default)
 | 
			
		||||
@item 0.500
 | 
			
		||||
Apply -6.0dB gain
 | 
			
		||||
@item 0.000
 | 
			
		||||
Silence Center Channel
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@item -loro_surmixlev @var{level}
 | 
			
		||||
Lo/Ro Surround Mix Level. The amount of gain the decoder should apply to the
 | 
			
		||||
surround channel(s) when downmixing to stereo in Lo/Ro mode.
 | 
			
		||||
@table @option
 | 
			
		||||
@item 0.841
 | 
			
		||||
Apply -1.5dB gain
 | 
			
		||||
@item 0.707
 | 
			
		||||
Apply -3.0dB gain
 | 
			
		||||
@item 0.595
 | 
			
		||||
Apply -4.5dB gain
 | 
			
		||||
@item 0.500
 | 
			
		||||
Apply -6.0dB gain (default)
 | 
			
		||||
@item 0.000
 | 
			
		||||
Silence Surround Channel(s)
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@subsubsection Extended Bitstream Information - Part 2
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item -dsurex_mode @var{mode}
 | 
			
		||||
Dolby Surround EX Mode. Indicates whether the stream uses Dolby Surround EX
 | 
			
		||||
(7.1 matrixed to 5.1). Using this option does @b{NOT} mean the encoder will actually
 | 
			
		||||
apply Dolby Surround EX processing.
 | 
			
		||||
@table @option
 | 
			
		||||
@item 0
 | 
			
		||||
@itemx notindicated
 | 
			
		||||
Not Indicated (default)
 | 
			
		||||
@item 1
 | 
			
		||||
@itemx on
 | 
			
		||||
Dolby Surround EX Off
 | 
			
		||||
@item 2
 | 
			
		||||
@itemx off
 | 
			
		||||
Dolby Surround EX On
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@item -dheadphone_mode @var{mode}
 | 
			
		||||
Dolby Headphone Mode. Indicates whether the stream uses Dolby Headphone
 | 
			
		||||
encoding (multi-channel matrixed to 2.0 for use with headphones). Using this
 | 
			
		||||
option does @b{NOT} mean the encoder will actually apply Dolby Headphone
 | 
			
		||||
processing.
 | 
			
		||||
@table @option
 | 
			
		||||
@item 0
 | 
			
		||||
@itemx notindicated
 | 
			
		||||
Not Indicated (default)
 | 
			
		||||
@item 1
 | 
			
		||||
@itemx on
 | 
			
		||||
Dolby Headphone Off
 | 
			
		||||
@item 2
 | 
			
		||||
@itemx off
 | 
			
		||||
Dolby Headphone On
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@item -ad_conv_type @var{type}
 | 
			
		||||
A/D Converter Type. Indicates whether the audio has passed through HDCD A/D
 | 
			
		||||
conversion.
 | 
			
		||||
@table @option
 | 
			
		||||
@item 0
 | 
			
		||||
@itemx standard
 | 
			
		||||
Standard A/D Converter (default)
 | 
			
		||||
@item 1
 | 
			
		||||
@itemx hdcd
 | 
			
		||||
HDCD A/D Converter
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@subsection Other AC-3 Encoding Options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item -stereo_rematrixing @var{boolean}
 | 
			
		||||
Stereo Rematrixing. Enables/Disables use of rematrixing for stereo input. This
 | 
			
		||||
is an optional AC-3 feature that increases quality by selectively encoding
 | 
			
		||||
the left/right channels as mid/side. This option is enabled by default, and it
 | 
			
		||||
is highly recommended that it be left as enabled except for testing purposes.
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@subsection Floating-Point-Only AC-3 Encoding Options
 | 
			
		||||
 | 
			
		||||
These options are only valid for the floating-point encoder and do not exist
 | 
			
		||||
for the fixed-point encoder due to the corresponding features not being
 | 
			
		||||
implemented in fixed-point.
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item -channel_coupling @var{boolean}
 | 
			
		||||
Enables/Disables use of channel coupling, which is an optional AC-3 feature
 | 
			
		||||
that increases quality by combining high frequency information from multiple
 | 
			
		||||
channels into a single channel. The per-channel high frequency information is
 | 
			
		||||
sent with less accuracy in both the frequency and time domains. This allows
 | 
			
		||||
more bits to be used for lower frequencies while preserving enough information
 | 
			
		||||
to reconstruct the high frequencies. This option is enabled by default for the
 | 
			
		||||
floating-point encoder and should generally be left as enabled except for
 | 
			
		||||
testing purposes or to increase encoding speed.
 | 
			
		||||
@table @option
 | 
			
		||||
@item -1
 | 
			
		||||
@itemx auto
 | 
			
		||||
Selected by Encoder (default)
 | 
			
		||||
@item 0
 | 
			
		||||
@itemx off
 | 
			
		||||
Disable Channel Coupling
 | 
			
		||||
@item 1
 | 
			
		||||
@itemx on
 | 
			
		||||
Enable Channel Coupling
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@item -cpl_start_band @var{number}
 | 
			
		||||
Coupling Start Band. Sets the channel coupling start band, from 1 to 15. If a
 | 
			
		||||
value higher than the bandwidth is used, it will be reduced to 1 less than the
 | 
			
		||||
coupling end band. If @var{auto} is used, the start band will be determined by
 | 
			
		||||
the encoder based on the bit rate, sample rate, and channel layout. This option
 | 
			
		||||
has no effect if channel coupling is disabled.
 | 
			
		||||
@table @option
 | 
			
		||||
@item -1
 | 
			
		||||
@itemx auto
 | 
			
		||||
Selected by Encoder (default)
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@c man end AUDIO ENCODERS
 | 
			
		||||
 | 
			
		||||
@chapter Video Encoders
 | 
			
		||||
@c man begin VIDEO ENCODERS
 | 
			
		||||
 | 
			
		||||
A description of some of the currently available video encoders
 | 
			
		||||
follows.
 | 
			
		||||
 | 
			
		||||
@section libvpx
 | 
			
		||||
 | 
			
		||||
VP8 format supported through libvpx.
 | 
			
		||||
 | 
			
		||||
Requires the presence of the libvpx headers and library during configuration.
 | 
			
		||||
You need to explicitly configure the build with @code{--enable-libvpx}.
 | 
			
		||||
 | 
			
		||||
@subsection Options
 | 
			
		||||
 | 
			
		||||
Mapping from FFmpeg to libvpx options with conversion notes in parentheses.
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item threads
 | 
			
		||||
g_threads
 | 
			
		||||
 | 
			
		||||
@item profile
 | 
			
		||||
g_profile
 | 
			
		||||
 | 
			
		||||
@item vb
 | 
			
		||||
rc_target_bitrate
 | 
			
		||||
 | 
			
		||||
@item g
 | 
			
		||||
kf_max_dist
 | 
			
		||||
 | 
			
		||||
@item keyint_min
 | 
			
		||||
kf_min_dist
 | 
			
		||||
 | 
			
		||||
@item qmin
 | 
			
		||||
rc_min_quantizer
 | 
			
		||||
 | 
			
		||||
@item qmax
 | 
			
		||||
rc_max_quantizer
 | 
			
		||||
 | 
			
		||||
@item bufsize, vb
 | 
			
		||||
rc_buf_sz
 | 
			
		||||
@code{(bufsize * 1000 / vb)}
 | 
			
		||||
 | 
			
		||||
rc_buf_optimal_sz
 | 
			
		||||
@code{(bufsize * 1000 / vb * 5 / 6)}
 | 
			
		||||
 | 
			
		||||
@item rc_init_occupancy, vb
 | 
			
		||||
rc_buf_initial_sz
 | 
			
		||||
@code{(rc_init_occupancy * 1000 / vb)}
 | 
			
		||||
 | 
			
		||||
@item rc_buffer_aggressivity
 | 
			
		||||
rc_undershoot_pct
 | 
			
		||||
 | 
			
		||||
@item skip_threshold
 | 
			
		||||
rc_dropframe_thresh
 | 
			
		||||
 | 
			
		||||
@item qcomp
 | 
			
		||||
rc_2pass_vbr_bias_pct
 | 
			
		||||
 | 
			
		||||
@item maxrate, vb
 | 
			
		||||
rc_2pass_vbr_maxsection_pct
 | 
			
		||||
@code{(maxrate * 100 / vb)}
 | 
			
		||||
 | 
			
		||||
@item minrate, vb
 | 
			
		||||
rc_2pass_vbr_minsection_pct
 | 
			
		||||
@code{(minrate * 100 / vb)}
 | 
			
		||||
 | 
			
		||||
@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
 | 
			
		||||
@code{VP8E_SET_CPUUSED}
 | 
			
		||||
 | 
			
		||||
@item nr
 | 
			
		||||
@code{VP8E_SET_NOISE_SENSITIVITY}
 | 
			
		||||
 | 
			
		||||
@item mb_threshold
 | 
			
		||||
@code{VP8E_SET_STATIC_THRESHOLD}
 | 
			
		||||
 | 
			
		||||
@item slices
 | 
			
		||||
@code{VP8E_SET_TOKEN_PARTITIONS}
 | 
			
		||||
 | 
			
		||||
@item max-intra-rate
 | 
			
		||||
@code{VP8E_SET_MAX_INTRA_BITRATE_PCT}
 | 
			
		||||
 | 
			
		||||
@item force_key_frames
 | 
			
		||||
@code{VPX_EFLAG_FORCE_KF}
 | 
			
		||||
 | 
			
		||||
@item Alternate reference frame related
 | 
			
		||||
@table @option
 | 
			
		||||
@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 vp8flags error_resilient
 | 
			
		||||
g_error_resilient
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
For more information about libvpx see:
 | 
			
		||||
@url{http://www.webmproject.org/}
 | 
			
		||||
 | 
			
		||||
@section libx264
 | 
			
		||||
 | 
			
		||||
H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 format supported through
 | 
			
		||||
libx264.
 | 
			
		||||
 | 
			
		||||
Requires the presence of the libx264 headers and library during
 | 
			
		||||
configuration. You need to explicitly configure the build with
 | 
			
		||||
@code{--enable-libx264}.
 | 
			
		||||
 | 
			
		||||
@subsection Options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item preset @var{preset_name}
 | 
			
		||||
Set the encoding preset.
 | 
			
		||||
 | 
			
		||||
@item tune @var{tune_name}
 | 
			
		||||
Tune the encoding params.
 | 
			
		||||
 | 
			
		||||
@item fastfirstpass @var{bool}
 | 
			
		||||
Use fast settings when encoding first pass, default value is 1.
 | 
			
		||||
 | 
			
		||||
@item profile @var{profile_name}
 | 
			
		||||
Set profile restrictions.
 | 
			
		||||
 | 
			
		||||
@item level @var{level}
 | 
			
		||||
Specify level (as defined by Annex A).
 | 
			
		||||
Deprecated in favor of @var{x264opts}.
 | 
			
		||||
 | 
			
		||||
@item passlogfile @var{filename}
 | 
			
		||||
Specify filename for 2 pass stats.
 | 
			
		||||
Deprecated in favor of @var{x264opts} (see @var{stats} libx264 option).
 | 
			
		||||
 | 
			
		||||
@item wpredp @var{wpred_type}
 | 
			
		||||
Specify Weighted prediction for P-frames.
 | 
			
		||||
Deprecated in favor of @var{x264opts} (see @var{weightp} libx264 option).
 | 
			
		||||
 | 
			
		||||
@item x264opts @var{options}
 | 
			
		||||
Allow to set any x264 option, see x264 --fullhelp for a list.
 | 
			
		||||
 | 
			
		||||
@var{options} is a list of @var{key}=@var{value} couples separated by
 | 
			
		||||
":".
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
For example to specify libx264 encoding options with @command{ffmpeg}:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i foo.mpg -vcodec libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
For more information about libx264 and the supported options see:
 | 
			
		||||
@url{http://www.videolan.org/developers/x264.html}
 | 
			
		||||
 | 
			
		||||
@c man end VIDEO ENCODERS
 | 
			
		||||
							
								
								
									
										174
									
								
								doc/errno.txt
									
									
									
									
									
								
							
							
						
						
									
										174
									
								
								doc/errno.txt
									
									
									
									
									
								
							@@ -1,174 +0,0 @@
 | 
			
		||||
The following table lists most error codes found in various operating
 | 
			
		||||
systems supported by FFmpeg.
 | 
			
		||||
 | 
			
		||||
                             OS
 | 
			
		||||
Code             Std    F  LBMWwb Text (YMMV)
 | 
			
		||||
 | 
			
		||||
E2BIG            POSIX     ++++++  Argument list too long
 | 
			
		||||
EACCES           POSIX     ++++++  Permission denied
 | 
			
		||||
EADDRINUSE       POSIX     +++..+  Address in use
 | 
			
		||||
EADDRNOTAVAIL    POSIX     +++..+  Cannot assign requested address
 | 
			
		||||
EADV                       +.....  Advertise error
 | 
			
		||||
EAFNOSUPPORT     POSIX     +++..+  Address family not supported
 | 
			
		||||
EAGAIN           POSIX  +  ++++++  Resource temporarily unavailable
 | 
			
		||||
EALREADY         POSIX     +++..+  Operation already in progress
 | 
			
		||||
EAUTH                      .++...  Authentication error
 | 
			
		||||
EBADARCH                   ..+...  Bad CPU type in executable
 | 
			
		||||
EBADE                      +.....  Invalid exchange
 | 
			
		||||
EBADEXEC                   ..+...  Bad executable
 | 
			
		||||
EBADF            POSIX     ++++++  Bad file descriptor
 | 
			
		||||
EBADFD                     +.....  File descriptor in bad state
 | 
			
		||||
EBADMACHO                  ..+...  Malformed Macho file
 | 
			
		||||
EBADMSG          POSIX     ++4...  Bad message
 | 
			
		||||
EBADR                      +.....  Invalid request descriptor
 | 
			
		||||
EBADRPC                    .++...  RPC struct is bad
 | 
			
		||||
EBADRQC                    +.....  Invalid request code
 | 
			
		||||
EBADSLT                    +.....  Invalid slot
 | 
			
		||||
EBFONT                     +.....  Bad font file format
 | 
			
		||||
EBUSY            POSIX  -  ++++++  Device or resource busy
 | 
			
		||||
ECANCELED        POSIX     +++...  Operation canceled
 | 
			
		||||
ECHILD           POSIX     ++++++  No child processes
 | 
			
		||||
ECHRNG                     +.....  Channel number out of range
 | 
			
		||||
ECOMM                      +.....  Communication error on send
 | 
			
		||||
ECONNABORTED     POSIX     +++..+  Software caused connection abort
 | 
			
		||||
ECONNREFUSED     POSIX  -  +++ss+  Connection refused
 | 
			
		||||
ECONNRESET       POSIX     +++..+  Connection reset
 | 
			
		||||
EDEADLK          POSIX     ++++++  Resource deadlock avoided
 | 
			
		||||
EDEADLOCK                  +..++.  File locking deadlock error
 | 
			
		||||
EDESTADDRREQ     POSIX     +++...  Destination address required
 | 
			
		||||
EDEVERR                    ..+...  Device error
 | 
			
		||||
EDOM             C89    -  ++++++  Numerical argument out of domain
 | 
			
		||||
EDOOFUS                    .F....  Programming error
 | 
			
		||||
EDOTDOT                    +.....  RFS specific error
 | 
			
		||||
EDQUOT           POSIX     +++...  Disc quota exceeded
 | 
			
		||||
EEXIST           POSIX     ++++++  File exists
 | 
			
		||||
EFAULT           POSIX  -  ++++++  Bad address
 | 
			
		||||
EFBIG            POSIX  -  ++++++  File too large
 | 
			
		||||
EFTYPE                     .++...  Inappropriate file type or format
 | 
			
		||||
EHOSTDOWN                  +++...  Host is down
 | 
			
		||||
EHOSTUNREACH     POSIX     +++..+  No route to host
 | 
			
		||||
EHWPOISON                  +.....  Memory page has hardware error
 | 
			
		||||
EIDRM            POSIX     +++...  Identifier removed
 | 
			
		||||
EILSEQ           C99       ++++++  Illegal byte sequence
 | 
			
		||||
EINPROGRESS      POSIX  -  +++ss+  Operation in progress
 | 
			
		||||
EINTR            POSIX  -  ++++++  Interrupted system call
 | 
			
		||||
EINVAL           POSIX  +  ++++++  Invalid argument
 | 
			
		||||
EIO              POSIX  +  ++++++  I/O error
 | 
			
		||||
EISCONN          POSIX     +++..+  Socket is already connected
 | 
			
		||||
EISDIR           POSIX     ++++++  Is a directory
 | 
			
		||||
EISNAM                     +.....  Is a named type file
 | 
			
		||||
EKEYEXPIRED                +.....  Key has expired
 | 
			
		||||
EKEYREJECTED               +.....  Key was rejected by service
 | 
			
		||||
EKEYREVOKED                +.....  Key has been revoked
 | 
			
		||||
EL2HLT                     +.....  Level 2 halted
 | 
			
		||||
EL2NSYNC                   +.....  Level 2 not synchronized
 | 
			
		||||
EL3HLT                     +.....  Level 3 halted
 | 
			
		||||
EL3RST                     +.....  Level 3 reset
 | 
			
		||||
ELIBACC                    +.....  Can not access a needed shared library
 | 
			
		||||
ELIBBAD                    +.....  Accessing a corrupted shared library
 | 
			
		||||
ELIBEXEC                   +.....  Cannot exec a shared library directly
 | 
			
		||||
ELIBMAX                    +.....  Too many shared libraries
 | 
			
		||||
ELIBSCN                    +.....  .lib section in a.out corrupted
 | 
			
		||||
ELNRNG                     +.....  Link number out of range
 | 
			
		||||
ELOOP            POSIX     +++..+  Too many levels of symbolic links
 | 
			
		||||
EMEDIUMTYPE                +.....  Wrong medium type
 | 
			
		||||
EMFILE           POSIX     ++++++  Too many open files
 | 
			
		||||
EMLINK           POSIX     ++++++  Too many links
 | 
			
		||||
EMSGSIZE         POSIX     +++..+  Message too long
 | 
			
		||||
EMULTIHOP        POSIX     ++4...  Multihop attempted
 | 
			
		||||
ENAMETOOLONG     POSIX  -  ++++++  Filen ame too long
 | 
			
		||||
ENAVAIL                    +.....  No XENIX semaphores available
 | 
			
		||||
ENEEDAUTH                  .++...  Need authenticator
 | 
			
		||||
ENETDOWN         POSIX     +++..+  Network is down
 | 
			
		||||
ENETRESET        SUSv3     +++..+  Network dropped connection on reset
 | 
			
		||||
ENETUNREACH      POSIX     +++..+  Network unreachable
 | 
			
		||||
ENFILE           POSIX     ++++++  Too many open files in system
 | 
			
		||||
ENOANO                     +.....  No anode
 | 
			
		||||
ENOATTR                    .++...  Attribute not found
 | 
			
		||||
ENOBUFS          POSIX  -  +++..+  No buffer space available
 | 
			
		||||
ENOCSI                     +.....  No CSI structure available
 | 
			
		||||
ENODATA          XSR       +N4...  No message available
 | 
			
		||||
ENODEV           POSIX  -  ++++++  No such device
 | 
			
		||||
ENOENT           POSIX  -  ++++++  No such file or directory
 | 
			
		||||
ENOEXEC          POSIX     ++++++  Exec format error
 | 
			
		||||
ENOFILE                    ...++.  No such file or directory
 | 
			
		||||
ENOKEY                     +.....  Required key not available
 | 
			
		||||
ENOLCK           POSIX     ++++++  No locks available
 | 
			
		||||
ENOLINK          POSIX     ++4...  Link has been severed
 | 
			
		||||
ENOMEDIUM                  +.....  No medium found
 | 
			
		||||
ENOMEM           POSIX     ++++++  Not enough space
 | 
			
		||||
ENOMSG           POSIX     +++..+  No message of desired type
 | 
			
		||||
ENONET                     +.....  Machine is not on the network
 | 
			
		||||
ENOPKG                     +.....  Package not installed
 | 
			
		||||
ENOPROTOOPT      POSIX     +++..+  Protocol not available
 | 
			
		||||
ENOSPC           POSIX     ++++++  No space left on device
 | 
			
		||||
ENOSR            XSR       +N4...  No STREAM resources
 | 
			
		||||
ENOSTR           XSR       +N4...  Not a STREAM
 | 
			
		||||
ENOSYS           POSIX  +  ++++++  Function not implemented
 | 
			
		||||
ENOTBLK                    +++...  Block device required
 | 
			
		||||
ENOTCONN         POSIX     +++..+  Socket is not connected
 | 
			
		||||
ENOTDIR          POSIX     ++++++  Not a directory
 | 
			
		||||
ENOTEMPTY        POSIX     ++++++  Directory not empty
 | 
			
		||||
ENOTNAM                    +.....  Not a XENIX named type file
 | 
			
		||||
ENOTRECOVERABLE  SUSv4  -  +.....  State not recoverable
 | 
			
		||||
ENOTSOCK         POSIX     +++..+  Socket operation on non-socket
 | 
			
		||||
ENOTSUP          POSIX     +++...  Operation not supported
 | 
			
		||||
ENOTTY           POSIX     ++++++  Inappropriate I/O control operation
 | 
			
		||||
ENOTUNIQ                   +.....  Name not unique on network
 | 
			
		||||
ENXIO            POSIX     ++++++  No such device or address
 | 
			
		||||
EOPNOTSUPP       POSIX     +++..+  Operation not supported (on socket)
 | 
			
		||||
EOVERFLOW        POSIX     +++..+  Value too large to be stored in data type
 | 
			
		||||
EOWNERDEAD       SUSv4     +.....  Owner died
 | 
			
		||||
EPERM            POSIX  -  ++++++  Operation not permitted
 | 
			
		||||
EPFNOSUPPORT               +++..+  Protocol family not supported
 | 
			
		||||
EPIPE            POSIX  -  ++++++  Broken pipe
 | 
			
		||||
EPROCLIM                   .++...  Too many processes
 | 
			
		||||
EPROCUNAVAIL               .++...  Bad procedure for program
 | 
			
		||||
EPROGMISMATCH              .++...  Program version wrong
 | 
			
		||||
EPROGUNAVAIL               .++...  RPC prog. not avail
 | 
			
		||||
EPROTO           POSIX     ++4...  Protocol error
 | 
			
		||||
EPROTONOSUPPORT  POSIX  -  +++ss+  Protocol not supported
 | 
			
		||||
EPROTOTYPE       POSIX     +++..+  Protocol wrong type for socket
 | 
			
		||||
EPWROFF                    ..+...  Device power is off
 | 
			
		||||
ERANGE           C89    -  ++++++  Result too large
 | 
			
		||||
EREMCHG                    +.....  Remote address changed
 | 
			
		||||
EREMOTE                    +++...  Object is remote
 | 
			
		||||
EREMOTEIO                  +.....  Remote I/O error
 | 
			
		||||
ERESTART                   +.....  Interrupted system call should be restarted
 | 
			
		||||
ERFKILL                    +.....  Operation not possible due to RF-kill
 | 
			
		||||
EROFS            POSIX     ++++++  Read-only file system
 | 
			
		||||
ERPCMISMATCH               .++...  RPC version wrong
 | 
			
		||||
ESHLIBVERS                 ..+...  Shared library version mismatch
 | 
			
		||||
ESHUTDOWN                  +++..+  Cannot send after socket shutdown
 | 
			
		||||
ESOCKTNOSUPPORT            +++...  Socket type not supported
 | 
			
		||||
ESPIPE           POSIX     ++++++  Illegal seek
 | 
			
		||||
ESRCH            POSIX     ++++++  No such process
 | 
			
		||||
ESRMNT                     +.....  Srmount error
 | 
			
		||||
ESTALE           POSIX     +++..+  Stale NFS file handle
 | 
			
		||||
ESTRPIPE                   +.....  Streams pipe error
 | 
			
		||||
ETIME            XSR       +N4...  Stream ioctl timeout
 | 
			
		||||
ETIMEDOUT        POSIX  -  +++ss+  Connection timed out
 | 
			
		||||
ETOOMANYREFS               +++...  Too many references: cannot splice
 | 
			
		||||
ETXTBSY          POSIX     +++...  Text file busy
 | 
			
		||||
EUCLEAN                    +.....  Structure needs cleaning
 | 
			
		||||
EUNATCH                    +.....  Protocol driver not attached
 | 
			
		||||
EUSERS                     +++...  Too many users
 | 
			
		||||
EWOULDBLOCK      POSIX     +++..+  Operation would block
 | 
			
		||||
EXDEV            POSIX     ++++++  Cross-device link
 | 
			
		||||
EXFULL                     +.....  Exchange full
 | 
			
		||||
 | 
			
		||||
Notations:
 | 
			
		||||
 | 
			
		||||
F: used in FFmpeg (-: a few times, +: a lot)
 | 
			
		||||
 | 
			
		||||
SUSv3: Single Unix Specification, version 3
 | 
			
		||||
SUSv4: Single Unix Specification, version 4
 | 
			
		||||
XSR: XSI STREAMS (obsolete)
 | 
			
		||||
 | 
			
		||||
OS: availability on some supported operating systems
 | 
			
		||||
L: GNU/Linux
 | 
			
		||||
B: BSD (F: FreeBSD, N: NetBSD)
 | 
			
		||||
M: MacOS X
 | 
			
		||||
W: Microsoft Windows (s: emulated with winsock, see libavformat/network.h)
 | 
			
		||||
w: Mingw32 (3.17) and Mingw64 (2.0.1)
 | 
			
		||||
b: BeOS
 | 
			
		||||
							
								
								
									
										252
									
								
								doc/eval.texi
									
									
									
									
									
								
							
							
						
						
									
										252
									
								
								doc/eval.texi
									
									
									
									
									
								
							@@ -1,252 +0,0 @@
 | 
			
		||||
@chapter Expression Evaluation
 | 
			
		||||
@c man begin EXPRESSION EVALUATION
 | 
			
		||||
 | 
			
		||||
When evaluating an arithmetic expression, FFmpeg uses an internal
 | 
			
		||||
formula evaluator, implemented through the @file{libavutil/eval.h}
 | 
			
		||||
interface.
 | 
			
		||||
 | 
			
		||||
An expression may contain unary, binary operators, constants, and
 | 
			
		||||
functions.
 | 
			
		||||
 | 
			
		||||
Two expressions @var{expr1} and @var{expr2} can be combined to form
 | 
			
		||||
another expression "@var{expr1};@var{expr2}".
 | 
			
		||||
@var{expr1} and @var{expr2} are evaluated in turn, and the new
 | 
			
		||||
expression evaluates to the value of @var{expr2}.
 | 
			
		||||
 | 
			
		||||
The following binary operators are available: @code{+}, @code{-},
 | 
			
		||||
@code{*}, @code{/}, @code{^}.
 | 
			
		||||
 | 
			
		||||
The following unary operators are available: @code{+}, @code{-}.
 | 
			
		||||
 | 
			
		||||
The following functions are available:
 | 
			
		||||
@table @option
 | 
			
		||||
@item sinh(x)
 | 
			
		||||
Compute hyperbolic sine of @var{x}.
 | 
			
		||||
 | 
			
		||||
@item cosh(x)
 | 
			
		||||
Compute hyperbolic cosine of @var{x}.
 | 
			
		||||
 | 
			
		||||
@item tanh(x)
 | 
			
		||||
Compute hyperbolic tangent of @var{x}.
 | 
			
		||||
 | 
			
		||||
@item sin(x)
 | 
			
		||||
Compute sine of @var{x}.
 | 
			
		||||
 | 
			
		||||
@item cos(x)
 | 
			
		||||
Compute cosine of @var{x}.
 | 
			
		||||
 | 
			
		||||
@item tan(x)
 | 
			
		||||
Compute tangent of @var{x}.
 | 
			
		||||
 | 
			
		||||
@item atan(x)
 | 
			
		||||
Compute arctangent of @var{x}.
 | 
			
		||||
 | 
			
		||||
@item asin(x)
 | 
			
		||||
Compute arcsine of @var{x}.
 | 
			
		||||
 | 
			
		||||
@item acos(x)
 | 
			
		||||
Compute arccosine of @var{x}.
 | 
			
		||||
 | 
			
		||||
@item exp(x)
 | 
			
		||||
Compute exponential of @var{x} (with base @code{e}, the Euler's number).
 | 
			
		||||
 | 
			
		||||
@item log(x)
 | 
			
		||||
Compute natural logarithm of @var{x}.
 | 
			
		||||
 | 
			
		||||
@item abs(x)
 | 
			
		||||
Compute absolute value of @var{x}.
 | 
			
		||||
 | 
			
		||||
@item squish(x)
 | 
			
		||||
Compute expression @code{1/(1 + exp(4*x))}.
 | 
			
		||||
 | 
			
		||||
@item gauss(x)
 | 
			
		||||
Compute Gauss function of @var{x}, corresponding to
 | 
			
		||||
@code{exp(-x*x/2) / sqrt(2*PI)}.
 | 
			
		||||
 | 
			
		||||
@item isinf(x)
 | 
			
		||||
Return 1.0 if @var{x} is +/-INFINITY, 0.0 otherwise.
 | 
			
		||||
 | 
			
		||||
@item isnan(x)
 | 
			
		||||
Return 1.0 if @var{x} is NAN, 0.0 otherwise.
 | 
			
		||||
 | 
			
		||||
@item mod(x, y)
 | 
			
		||||
Compute the remainder of division of @var{x} by @var{y}.
 | 
			
		||||
 | 
			
		||||
@item max(x, y)
 | 
			
		||||
Return the maximum between @var{x} and @var{y}.
 | 
			
		||||
 | 
			
		||||
@item min(x, y)
 | 
			
		||||
Return the maximum between @var{x} and @var{y}.
 | 
			
		||||
 | 
			
		||||
@item eq(x, y)
 | 
			
		||||
Return 1 if @var{x} and @var{y} are equivalent, 0 otherwise.
 | 
			
		||||
 | 
			
		||||
@item gte(x, y)
 | 
			
		||||
Return 1 if @var{x} is greater than or equal to @var{y}, 0 otherwise.
 | 
			
		||||
 | 
			
		||||
@item gt(x, y)
 | 
			
		||||
Return 1 if @var{x} is greater than @var{y}, 0 otherwise.
 | 
			
		||||
 | 
			
		||||
@item lte(x, y)
 | 
			
		||||
Return 1 if @var{x} is lesser than or equal to @var{y}, 0 otherwise.
 | 
			
		||||
 | 
			
		||||
@item lt(x, y)
 | 
			
		||||
Return 1 if @var{x} is lesser than @var{y}, 0 otherwise.
 | 
			
		||||
 | 
			
		||||
@item st(var, expr)
 | 
			
		||||
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.
 | 
			
		||||
Note, Variables are currently not shared between expressions.
 | 
			
		||||
 | 
			
		||||
@item ld(var)
 | 
			
		||||
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.
 | 
			
		||||
 | 
			
		||||
@item while(cond, expr)
 | 
			
		||||
Evaluate expression @var{expr} while the expression @var{cond} is
 | 
			
		||||
non-zero, and returns the value of the last @var{expr} evaluation, or
 | 
			
		||||
NAN if @var{cond} was always false.
 | 
			
		||||
 | 
			
		||||
@item ceil(expr)
 | 
			
		||||
Round the value of expression @var{expr} upwards to the nearest
 | 
			
		||||
integer. For example, "ceil(1.5)" is "2.0".
 | 
			
		||||
 | 
			
		||||
@item floor(expr)
 | 
			
		||||
Round the value of expression @var{expr} downwards to the nearest
 | 
			
		||||
integer. For example, "floor(-1.5)" is "-2.0".
 | 
			
		||||
 | 
			
		||||
@item trunc(expr)
 | 
			
		||||
Round the value of expression @var{expr} towards zero to the nearest
 | 
			
		||||
integer. For example, "trunc(-1.5)" is "-1.0".
 | 
			
		||||
 | 
			
		||||
@item sqrt(expr)
 | 
			
		||||
Compute the square root of @var{expr}. This is equivalent to
 | 
			
		||||
"(@var{expr})^.5".
 | 
			
		||||
 | 
			
		||||
@item not(expr)
 | 
			
		||||
Return 1.0 if @var{expr} is zero, 0.0 otherwise.
 | 
			
		||||
 | 
			
		||||
@item pow(x, y)
 | 
			
		||||
Compute the power of @var{x} elevated @var{y}, it is equivalent to
 | 
			
		||||
"(@var{x})^(@var{y})".
 | 
			
		||||
 | 
			
		||||
@item random(x)
 | 
			
		||||
Return a pseudo random value between 0.0 and 1.0. @var{x} is the index of the
 | 
			
		||||
internal variable which will be used to save the seed/state.
 | 
			
		||||
 | 
			
		||||
@item hypot(x, y)
 | 
			
		||||
This function is similar to the C function with the same name; it returns
 | 
			
		||||
"sqrt(@var{x}*@var{x} + @var{y}*@var{y})", the length of the hypotenuse of a
 | 
			
		||||
right triangle with sides of length @var{x} and @var{y}, or the distance of the
 | 
			
		||||
point (@var{x}, @var{y}) from the origin.
 | 
			
		||||
 | 
			
		||||
@item gcd(x, y)
 | 
			
		||||
Return the greatest common divisor of @var{x} and @var{y}. If both @var{x} and
 | 
			
		||||
@var{y} are 0 or either or both are less than zero then behavior is undefined.
 | 
			
		||||
 | 
			
		||||
@item if(x, y)
 | 
			
		||||
Evaluate @var{x}, and if the result is non-zero return the result of
 | 
			
		||||
the evaluation of @var{y}, return 0 otherwise.
 | 
			
		||||
 | 
			
		||||
@item ifnot(x, y)
 | 
			
		||||
Evaluate @var{x}, and if the result is zero return the result of the
 | 
			
		||||
evaluation of @var{y}, return 0 otherwise.
 | 
			
		||||
 | 
			
		||||
@item taylor(expr, x) taylor(expr, x, id)
 | 
			
		||||
Evaluate a taylor series at x.
 | 
			
		||||
expr represents the LD(id)-th derivates of f(x) at 0. If id is not specified
 | 
			
		||||
then 0 is assumed.
 | 
			
		||||
note, when you have the derivatives at y instead of 0
 | 
			
		||||
taylor(expr, x-y) can be used
 | 
			
		||||
When the series does not converge the results are undefined.
 | 
			
		||||
 | 
			
		||||
@item root(expr, max)
 | 
			
		||||
Finds x where f(x)=0 in the interval 0..max.
 | 
			
		||||
f() must be continuous or the result is undefined.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
The following constants are available:
 | 
			
		||||
@table @option
 | 
			
		||||
@item PI
 | 
			
		||||
area of the unit disc, approximately 3.14
 | 
			
		||||
@item E
 | 
			
		||||
exp(1) (Euler's number), approximately 2.718
 | 
			
		||||
@item PHI
 | 
			
		||||
golden ratio (1+sqrt(5))/2, approximately 1.618
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
Assuming that an expression is considered "true" if it has a non-zero
 | 
			
		||||
value, note that:
 | 
			
		||||
 | 
			
		||||
@code{*} works like AND
 | 
			
		||||
 | 
			
		||||
@code{+} works like OR
 | 
			
		||||
 | 
			
		||||
and the construct:
 | 
			
		||||
@example
 | 
			
		||||
if A then B else C
 | 
			
		||||
@end example
 | 
			
		||||
is equivalent to
 | 
			
		||||
@example
 | 
			
		||||
if(A,B) + ifnot(A,C)
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
In your C code, you can extend the list of unary and binary functions,
 | 
			
		||||
and define recognized constants, so that they are available for your
 | 
			
		||||
expressions.
 | 
			
		||||
 | 
			
		||||
The evaluator also recognizes the International System number
 | 
			
		||||
postfixes. If 'i' is appended after the postfix, powers of 2 are used
 | 
			
		||||
instead of powers of 10. The 'B' postfix multiplies the value for 8,
 | 
			
		||||
and can be appended after another postfix or used alone. This allows
 | 
			
		||||
using for example 'KB', 'MiB', 'G' and 'B' as postfix.
 | 
			
		||||
 | 
			
		||||
Follows the list of available International System postfixes, with
 | 
			
		||||
indication of the corresponding powers of 10 and of 2.
 | 
			
		||||
@table @option
 | 
			
		||||
@item y
 | 
			
		||||
-24 / -80
 | 
			
		||||
@item z
 | 
			
		||||
-21 / -70
 | 
			
		||||
@item a
 | 
			
		||||
-18 / -60
 | 
			
		||||
@item f
 | 
			
		||||
-15 / -50
 | 
			
		||||
@item p
 | 
			
		||||
-12 / -40
 | 
			
		||||
@item n
 | 
			
		||||
-9 / -30
 | 
			
		||||
@item u
 | 
			
		||||
-6 / -20
 | 
			
		||||
@item m
 | 
			
		||||
-3 / -10
 | 
			
		||||
@item c
 | 
			
		||||
-2
 | 
			
		||||
@item d
 | 
			
		||||
-1
 | 
			
		||||
@item h
 | 
			
		||||
2
 | 
			
		||||
@item k
 | 
			
		||||
3 / 10
 | 
			
		||||
@item K
 | 
			
		||||
3 / 10
 | 
			
		||||
@item M
 | 
			
		||||
6 / 20
 | 
			
		||||
@item G
 | 
			
		||||
9 / 30
 | 
			
		||||
@item T
 | 
			
		||||
12 / 40
 | 
			
		||||
@item P
 | 
			
		||||
15 / 40
 | 
			
		||||
@item E
 | 
			
		||||
18 / 50
 | 
			
		||||
@item Z
 | 
			
		||||
21 / 60
 | 
			
		||||
@item Y
 | 
			
		||||
24 / 70
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@c man end
 | 
			
		||||
@@ -1,36 +0,0 @@
 | 
			
		||||
# use pkg-config for getting CFLAGS and LDLIBS
 | 
			
		||||
FFMPEG_LIBS=    libavdevice                        \
 | 
			
		||||
                libavformat                        \
 | 
			
		||||
                libavfilter                        \
 | 
			
		||||
                libavcodec                         \
 | 
			
		||||
                libswresample                      \
 | 
			
		||||
                libswscale                         \
 | 
			
		||||
                libavutil                          \
 | 
			
		||||
 | 
			
		||||
CFLAGS += -Wall -O2 -g
 | 
			
		||||
CFLAGS := $(shell pkg-config --cflags $(FFMPEG_LIBS)) $(CFLAGS)
 | 
			
		||||
LDLIBS := $(shell pkg-config --libs $(FFMPEG_LIBS)) $(LDLIBS)
 | 
			
		||||
 | 
			
		||||
EXAMPLES=       decoding_encoding                  \
 | 
			
		||||
                demuxing                           \
 | 
			
		||||
                filtering_video                    \
 | 
			
		||||
                filtering_audio                    \
 | 
			
		||||
                metadata                           \
 | 
			
		||||
                muxing                             \
 | 
			
		||||
                scaling_video                      \
 | 
			
		||||
 | 
			
		||||
OBJS=$(addsuffix .o,$(EXAMPLES))
 | 
			
		||||
 | 
			
		||||
# the following examples make explicit use of the math library
 | 
			
		||||
decoding_encoding: LDLIBS += -lm
 | 
			
		||||
muxing:            LDLIBS += -lm
 | 
			
		||||
 | 
			
		||||
.phony: all clean-test clean
 | 
			
		||||
 | 
			
		||||
all: $(OBJS) $(EXAMPLES)
 | 
			
		||||
 | 
			
		||||
clean-test:
 | 
			
		||||
	$(RM) test*.pgm test.h264 test.mp2 test.sw test.mpg
 | 
			
		||||
 | 
			
		||||
clean: clean-test
 | 
			
		||||
	$(RM) $(EXAMPLES) $(OBJS)
 | 
			
		||||
@@ -1,635 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (c) 2001 Fabrice Bellard
 | 
			
		||||
 *
 | 
			
		||||
 * 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
 | 
			
		||||
 * libavcodec API use example.
 | 
			
		||||
 *
 | 
			
		||||
 * Note that libavcodec only handles codecs (mpeg, mpeg4, etc...),
 | 
			
		||||
 * not file formats (avi, vob, mp4, mov, mkv, mxf, flv, mpegts, mpegps, etc...). See library 'libavformat' for the
 | 
			
		||||
 * format handling
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <math.h>
 | 
			
		||||
 | 
			
		||||
#include <libavutil/opt.h>
 | 
			
		||||
#include <libavcodec/avcodec.h>
 | 
			
		||||
#include <libavutil/audioconvert.h>
 | 
			
		||||
#include <libavutil/common.h>
 | 
			
		||||
#include <libavutil/imgutils.h>
 | 
			
		||||
#include <libavutil/mathematics.h>
 | 
			
		||||
#include <libavutil/samplefmt.h>
 | 
			
		||||
 | 
			
		||||
#define INBUF_SIZE 4096
 | 
			
		||||
#define AUDIO_INBUF_SIZE 20480
 | 
			
		||||
#define AUDIO_REFILL_THRESH 4096
 | 
			
		||||
 | 
			
		||||
/* check that a given sample format is supported by the encoder */
 | 
			
		||||
static int check_sample_fmt(AVCodec *codec, enum AVSampleFormat sample_fmt)
 | 
			
		||||
{
 | 
			
		||||
    const enum AVSampleFormat *p = codec->sample_fmts;
 | 
			
		||||
 | 
			
		||||
    while (*p != AV_SAMPLE_FMT_NONE) {
 | 
			
		||||
        if (*p == sample_fmt)
 | 
			
		||||
            return 1;
 | 
			
		||||
        p++;
 | 
			
		||||
    }
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* just pick the highest supported samplerate */
 | 
			
		||||
static int select_sample_rate(AVCodec *codec)
 | 
			
		||||
{
 | 
			
		||||
    const int *p;
 | 
			
		||||
    int best_samplerate = 0;
 | 
			
		||||
 | 
			
		||||
    if (!codec->supported_samplerates)
 | 
			
		||||
        return 44100;
 | 
			
		||||
 | 
			
		||||
    p = codec->supported_samplerates;
 | 
			
		||||
    while (*p) {
 | 
			
		||||
        best_samplerate = FFMAX(*p, best_samplerate);
 | 
			
		||||
        p++;
 | 
			
		||||
    }
 | 
			
		||||
    return best_samplerate;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* select layout with the highest channel count */
 | 
			
		||||
static int select_channel_layout(AVCodec *codec)
 | 
			
		||||
{
 | 
			
		||||
    const uint64_t *p;
 | 
			
		||||
    uint64_t best_ch_layout = 0;
 | 
			
		||||
    int best_nb_channells   = 0;
 | 
			
		||||
 | 
			
		||||
    if (!codec->channel_layouts)
 | 
			
		||||
        return AV_CH_LAYOUT_STEREO;
 | 
			
		||||
 | 
			
		||||
    p = codec->channel_layouts;
 | 
			
		||||
    while (*p) {
 | 
			
		||||
        int nb_channels = av_get_channel_layout_nb_channels(*p);
 | 
			
		||||
 | 
			
		||||
        if (nb_channels > best_nb_channells) {
 | 
			
		||||
            best_ch_layout    = *p;
 | 
			
		||||
            best_nb_channells = nb_channels;
 | 
			
		||||
        }
 | 
			
		||||
        p++;
 | 
			
		||||
    }
 | 
			
		||||
    return best_ch_layout;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Audio encoding example
 | 
			
		||||
 */
 | 
			
		||||
static void audio_encode_example(const char *filename)
 | 
			
		||||
{
 | 
			
		||||
    AVCodec *codec;
 | 
			
		||||
    AVCodecContext *c= NULL;
 | 
			
		||||
    AVFrame *frame;
 | 
			
		||||
    AVPacket pkt;
 | 
			
		||||
    int i, j, k, ret, got_output;
 | 
			
		||||
    int buffer_size;
 | 
			
		||||
    FILE *f;
 | 
			
		||||
    uint16_t *samples;
 | 
			
		||||
    float t, tincr;
 | 
			
		||||
 | 
			
		||||
    printf("Encode audio file %s\n", filename);
 | 
			
		||||
 | 
			
		||||
    /* find the MP2 encoder */
 | 
			
		||||
    codec = avcodec_find_encoder(AV_CODEC_ID_MP2);
 | 
			
		||||
    if (!codec) {
 | 
			
		||||
        fprintf(stderr, "Codec not found\n");
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    c = avcodec_alloc_context3(codec);
 | 
			
		||||
 | 
			
		||||
    /* put sample parameters */
 | 
			
		||||
    c->bit_rate = 64000;
 | 
			
		||||
 | 
			
		||||
    /* check that the encoder supports s16 pcm input */
 | 
			
		||||
    c->sample_fmt = AV_SAMPLE_FMT_S16;
 | 
			
		||||
    if (!check_sample_fmt(codec, c->sample_fmt)) {
 | 
			
		||||
        fprintf(stderr, "Encoder does not support sample format %s",
 | 
			
		||||
                av_get_sample_fmt_name(c->sample_fmt));
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* select other audio parameters supported by the encoder */
 | 
			
		||||
    c->sample_rate    = select_sample_rate(codec);
 | 
			
		||||
    c->channel_layout = select_channel_layout(codec);
 | 
			
		||||
    c->channels       = av_get_channel_layout_nb_channels(c->channel_layout);
 | 
			
		||||
 | 
			
		||||
    /* open it */
 | 
			
		||||
    if (avcodec_open2(c, codec, NULL) < 0) {
 | 
			
		||||
        fprintf(stderr, "Could not open codec\n");
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    f = fopen(filename, "wb");
 | 
			
		||||
    if (!f) {
 | 
			
		||||
        fprintf(stderr, "Could not open %s\n", filename);
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* frame containing input raw audio */
 | 
			
		||||
    frame = avcodec_alloc_frame();
 | 
			
		||||
    if (!frame) {
 | 
			
		||||
        fprintf(stderr, "Could not allocate audio frame\n");
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    frame->nb_samples     = c->frame_size;
 | 
			
		||||
    frame->format         = c->sample_fmt;
 | 
			
		||||
    frame->channel_layout = c->channel_layout;
 | 
			
		||||
 | 
			
		||||
    /* the codec gives us the frame size, in samples,
 | 
			
		||||
     * we calculate the size of the samples buffer in bytes */
 | 
			
		||||
    buffer_size = av_samples_get_buffer_size(NULL, c->channels, c->frame_size,
 | 
			
		||||
                                             c->sample_fmt, 0);
 | 
			
		||||
    samples = av_malloc(buffer_size);
 | 
			
		||||
    if (!samples) {
 | 
			
		||||
        fprintf(stderr, "Could not allocate %d bytes for samples buffer\n",
 | 
			
		||||
                buffer_size);
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
    /* setup the data pointers in the AVFrame */
 | 
			
		||||
    ret = avcodec_fill_audio_frame(frame, c->channels, c->sample_fmt,
 | 
			
		||||
                                   (const uint8_t*)samples, buffer_size, 0);
 | 
			
		||||
    if (ret < 0) {
 | 
			
		||||
        fprintf(stderr, "Could not setup audio frame\n");
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* encode a single tone sound */
 | 
			
		||||
    t = 0;
 | 
			
		||||
    tincr = 2 * M_PI * 440.0 / c->sample_rate;
 | 
			
		||||
    for(i=0;i<200;i++) {
 | 
			
		||||
        av_init_packet(&pkt);
 | 
			
		||||
        pkt.data = NULL; // packet data will be allocated by the encoder
 | 
			
		||||
        pkt.size = 0;
 | 
			
		||||
 | 
			
		||||
        for (j = 0; j < c->frame_size; j++) {
 | 
			
		||||
            samples[2*j] = (int)(sin(t) * 10000);
 | 
			
		||||
 | 
			
		||||
            for (k = 1; k < c->channels; k++)
 | 
			
		||||
                samples[2*j + k] = samples[2*j];
 | 
			
		||||
            t += tincr;
 | 
			
		||||
        }
 | 
			
		||||
        /* encode the samples */
 | 
			
		||||
        ret = avcodec_encode_audio2(c, &pkt, frame, &got_output);
 | 
			
		||||
        if (ret < 0) {
 | 
			
		||||
            fprintf(stderr, "Error encoding audio frame\n");
 | 
			
		||||
            exit(1);
 | 
			
		||||
        }
 | 
			
		||||
        if (got_output) {
 | 
			
		||||
            fwrite(pkt.data, 1, pkt.size, f);
 | 
			
		||||
            av_free_packet(&pkt);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* get the delayed frames */
 | 
			
		||||
    for (got_output = 1; got_output; i++) {
 | 
			
		||||
        ret = avcodec_encode_audio2(c, &pkt, NULL, &got_output);
 | 
			
		||||
        if (ret < 0) {
 | 
			
		||||
            fprintf(stderr, "Error encoding frame\n");
 | 
			
		||||
            exit(1);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (got_output) {
 | 
			
		||||
            fwrite(pkt.data, 1, pkt.size, f);
 | 
			
		||||
            av_free_packet(&pkt);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    fclose(f);
 | 
			
		||||
 | 
			
		||||
    av_freep(&samples);
 | 
			
		||||
    avcodec_free_frame(&frame);
 | 
			
		||||
    avcodec_close(c);
 | 
			
		||||
    av_free(c);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Audio decoding.
 | 
			
		||||
 */
 | 
			
		||||
static void audio_decode_example(const char *outfilename, const char *filename)
 | 
			
		||||
{
 | 
			
		||||
    AVCodec *codec;
 | 
			
		||||
    AVCodecContext *c= NULL;
 | 
			
		||||
    int len;
 | 
			
		||||
    FILE *f, *outfile;
 | 
			
		||||
    uint8_t inbuf[AUDIO_INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE];
 | 
			
		||||
    AVPacket avpkt;
 | 
			
		||||
    AVFrame *decoded_frame = NULL;
 | 
			
		||||
 | 
			
		||||
    av_init_packet(&avpkt);
 | 
			
		||||
 | 
			
		||||
    printf("Decode audio file %s to %s\n", filename, outfilename);
 | 
			
		||||
 | 
			
		||||
    /* find the mpeg audio decoder */
 | 
			
		||||
    codec = avcodec_find_decoder(AV_CODEC_ID_MP2);
 | 
			
		||||
    if (!codec) {
 | 
			
		||||
        fprintf(stderr, "Codec not found\n");
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    c = avcodec_alloc_context3(codec);
 | 
			
		||||
 | 
			
		||||
    /* open it */
 | 
			
		||||
    if (avcodec_open2(c, codec, NULL) < 0) {
 | 
			
		||||
        fprintf(stderr, "Could not open codec\n");
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    f = fopen(filename, "rb");
 | 
			
		||||
    if (!f) {
 | 
			
		||||
        fprintf(stderr, "Could not open %s\n", filename);
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
    outfile = fopen(outfilename, "wb");
 | 
			
		||||
    if (!outfile) {
 | 
			
		||||
        av_free(c);
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* decode until eof */
 | 
			
		||||
    avpkt.data = inbuf;
 | 
			
		||||
    avpkt.size = fread(inbuf, 1, AUDIO_INBUF_SIZE, f);
 | 
			
		||||
 | 
			
		||||
    while (avpkt.size > 0) {
 | 
			
		||||
        int got_frame = 0;
 | 
			
		||||
 | 
			
		||||
        if (!decoded_frame) {
 | 
			
		||||
            if (!(decoded_frame = avcodec_alloc_frame())) {
 | 
			
		||||
                fprintf(stderr, "Could not allocate audio frame\n");
 | 
			
		||||
                exit(1);
 | 
			
		||||
            }
 | 
			
		||||
        } else
 | 
			
		||||
            avcodec_get_frame_defaults(decoded_frame);
 | 
			
		||||
 | 
			
		||||
        len = avcodec_decode_audio4(c, decoded_frame, &got_frame, &avpkt);
 | 
			
		||||
        if (len < 0) {
 | 
			
		||||
            fprintf(stderr, "Error while decoding\n");
 | 
			
		||||
            exit(1);
 | 
			
		||||
        }
 | 
			
		||||
        if (got_frame) {
 | 
			
		||||
            /* if a frame has been decoded, output it */
 | 
			
		||||
            int data_size = av_samples_get_buffer_size(NULL, c->channels,
 | 
			
		||||
                                                       decoded_frame->nb_samples,
 | 
			
		||||
                                                       c->sample_fmt, 1);
 | 
			
		||||
            fwrite(decoded_frame->data[0], 1, data_size, outfile);
 | 
			
		||||
        }
 | 
			
		||||
        avpkt.size -= len;
 | 
			
		||||
        avpkt.data += len;
 | 
			
		||||
        avpkt.dts =
 | 
			
		||||
        avpkt.pts = AV_NOPTS_VALUE;
 | 
			
		||||
        if (avpkt.size < AUDIO_REFILL_THRESH) {
 | 
			
		||||
            /* Refill the input buffer, to avoid trying to decode
 | 
			
		||||
             * incomplete frames. Instead of this, one could also use
 | 
			
		||||
             * a parser, or use a proper container format through
 | 
			
		||||
             * libavformat. */
 | 
			
		||||
            memmove(inbuf, avpkt.data, avpkt.size);
 | 
			
		||||
            avpkt.data = inbuf;
 | 
			
		||||
            len = fread(avpkt.data + avpkt.size, 1,
 | 
			
		||||
                        AUDIO_INBUF_SIZE - avpkt.size, f);
 | 
			
		||||
            if (len > 0)
 | 
			
		||||
                avpkt.size += len;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    fclose(outfile);
 | 
			
		||||
    fclose(f);
 | 
			
		||||
 | 
			
		||||
    avcodec_close(c);
 | 
			
		||||
    av_free(c);
 | 
			
		||||
    avcodec_free_frame(&decoded_frame);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Video encoding example
 | 
			
		||||
 */
 | 
			
		||||
static void video_encode_example(const char *filename, int codec_id)
 | 
			
		||||
{
 | 
			
		||||
    AVCodec *codec;
 | 
			
		||||
    AVCodecContext *c= NULL;
 | 
			
		||||
    int i, ret, x, y, got_output;
 | 
			
		||||
    FILE *f;
 | 
			
		||||
    AVFrame *frame;
 | 
			
		||||
    AVPacket pkt;
 | 
			
		||||
    uint8_t endcode[] = { 0, 0, 1, 0xb7 };
 | 
			
		||||
 | 
			
		||||
    printf("Encode video file %s\n", filename);
 | 
			
		||||
 | 
			
		||||
    /* find the mpeg1 video encoder */
 | 
			
		||||
    codec = avcodec_find_encoder(codec_id);
 | 
			
		||||
    if (!codec) {
 | 
			
		||||
        fprintf(stderr, "Codec not found\n");
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    c = avcodec_alloc_context3(codec);
 | 
			
		||||
 | 
			
		||||
    /* put sample parameters */
 | 
			
		||||
    c->bit_rate = 400000;
 | 
			
		||||
    /* resolution must be a multiple of two */
 | 
			
		||||
    c->width = 352;
 | 
			
		||||
    c->height = 288;
 | 
			
		||||
    /* frames per second */
 | 
			
		||||
    c->time_base= (AVRational){1,25};
 | 
			
		||||
    c->gop_size = 10; /* emit one intra frame every ten frames */
 | 
			
		||||
    c->max_b_frames=1;
 | 
			
		||||
    c->pix_fmt = PIX_FMT_YUV420P;
 | 
			
		||||
 | 
			
		||||
    if(codec_id == AV_CODEC_ID_H264)
 | 
			
		||||
        av_opt_set(c->priv_data, "preset", "slow", 0);
 | 
			
		||||
 | 
			
		||||
    /* open it */
 | 
			
		||||
    if (avcodec_open2(c, codec, NULL) < 0) {
 | 
			
		||||
        fprintf(stderr, "Could not open codec\n");
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    f = fopen(filename, "wb");
 | 
			
		||||
    if (!f) {
 | 
			
		||||
        fprintf(stderr, "Could not open %s\n", filename);
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    frame = avcodec_alloc_frame();
 | 
			
		||||
    if (!frame) {
 | 
			
		||||
        fprintf(stderr, "Could not allocate video frame\n");
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
    frame->format = c->pix_fmt;
 | 
			
		||||
    frame->width  = c->width;
 | 
			
		||||
    frame->height = c->height;
 | 
			
		||||
 | 
			
		||||
    /* the image can be allocated by any means and av_image_alloc() is
 | 
			
		||||
     * just the most convenient way if av_malloc() is to be used */
 | 
			
		||||
    ret = av_image_alloc(frame->data, frame->linesize, c->width, c->height,
 | 
			
		||||
                         c->pix_fmt, 32);
 | 
			
		||||
    if (ret < 0) {
 | 
			
		||||
        fprintf(stderr, "Could not allocate raw picture buffer\n");
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* encode 1 second of video */
 | 
			
		||||
    for(i=0;i<25;i++) {
 | 
			
		||||
        av_init_packet(&pkt);
 | 
			
		||||
        pkt.data = NULL;    // packet data will be allocated by the encoder
 | 
			
		||||
        pkt.size = 0;
 | 
			
		||||
 | 
			
		||||
        fflush(stdout);
 | 
			
		||||
        /* prepare a dummy image */
 | 
			
		||||
        /* Y */
 | 
			
		||||
        for(y=0;y<c->height;y++) {
 | 
			
		||||
            for(x=0;x<c->width;x++) {
 | 
			
		||||
                frame->data[0][y * frame->linesize[0] + x] = x + y + i * 3;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /* Cb and Cr */
 | 
			
		||||
        for(y=0;y<c->height/2;y++) {
 | 
			
		||||
            for(x=0;x<c->width/2;x++) {
 | 
			
		||||
                frame->data[1][y * frame->linesize[1] + x] = 128 + y + i * 2;
 | 
			
		||||
                frame->data[2][y * frame->linesize[2] + x] = 64 + x + i * 5;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        frame->pts = i;
 | 
			
		||||
 | 
			
		||||
        /* encode the image */
 | 
			
		||||
        ret = avcodec_encode_video2(c, &pkt, frame, &got_output);
 | 
			
		||||
        if (ret < 0) {
 | 
			
		||||
            fprintf(stderr, "Error encoding frame\n");
 | 
			
		||||
            exit(1);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (got_output) {
 | 
			
		||||
            printf("Write frame %3d (size=%5d)\n", i, pkt.size);
 | 
			
		||||
            fwrite(pkt.data, 1, pkt.size, f);
 | 
			
		||||
            av_free_packet(&pkt);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* get the delayed frames */
 | 
			
		||||
    for (got_output = 1; got_output; i++) {
 | 
			
		||||
        fflush(stdout);
 | 
			
		||||
 | 
			
		||||
        ret = avcodec_encode_video2(c, &pkt, NULL, &got_output);
 | 
			
		||||
        if (ret < 0) {
 | 
			
		||||
            fprintf(stderr, "Error encoding frame\n");
 | 
			
		||||
            exit(1);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (got_output) {
 | 
			
		||||
            printf("Write frame %3d (size=%5d)\n", i, pkt.size);
 | 
			
		||||
            fwrite(pkt.data, 1, pkt.size, f);
 | 
			
		||||
            av_free_packet(&pkt);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* add sequence end code to have a real mpeg file */
 | 
			
		||||
    fwrite(endcode, 1, sizeof(endcode), f);
 | 
			
		||||
    fclose(f);
 | 
			
		||||
 | 
			
		||||
    avcodec_close(c);
 | 
			
		||||
    av_free(c);
 | 
			
		||||
    av_freep(&frame->data[0]);
 | 
			
		||||
    avcodec_free_frame(&frame);
 | 
			
		||||
    printf("\n");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Video decoding example
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
static void pgm_save(unsigned char *buf, int wrap, int xsize, int ysize,
 | 
			
		||||
                     char *filename)
 | 
			
		||||
{
 | 
			
		||||
    FILE *f;
 | 
			
		||||
    int i;
 | 
			
		||||
 | 
			
		||||
    f=fopen(filename,"w");
 | 
			
		||||
    fprintf(f,"P5\n%d %d\n%d\n",xsize,ysize,255);
 | 
			
		||||
    for(i=0;i<ysize;i++)
 | 
			
		||||
        fwrite(buf + i * wrap,1,xsize,f);
 | 
			
		||||
    fclose(f);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void video_decode_example(const char *outfilename, const char *filename)
 | 
			
		||||
{
 | 
			
		||||
    AVCodec *codec;
 | 
			
		||||
    AVCodecContext *c= NULL;
 | 
			
		||||
    int frame, got_picture, len;
 | 
			
		||||
    FILE *f;
 | 
			
		||||
    AVFrame *picture;
 | 
			
		||||
    uint8_t inbuf[INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE];
 | 
			
		||||
    char buf[1024];
 | 
			
		||||
    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, FF_INPUT_BUFFER_PADDING_SIZE);
 | 
			
		||||
 | 
			
		||||
    printf("Decode video file %s to %s\n", filename, outfilename);
 | 
			
		||||
 | 
			
		||||
    /* find the mpeg1 video decoder */
 | 
			
		||||
    codec = avcodec_find_decoder(AV_CODEC_ID_MPEG1VIDEO);
 | 
			
		||||
    if (!codec) {
 | 
			
		||||
        fprintf(stderr, "Codec not found\n");
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    c = avcodec_alloc_context3(codec);
 | 
			
		||||
    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
 | 
			
		||||
       available in the bitstream. */
 | 
			
		||||
 | 
			
		||||
    /* open it */
 | 
			
		||||
    if (avcodec_open2(c, codec, NULL) < 0) {
 | 
			
		||||
        fprintf(stderr, "Could not open codec\n");
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* the codec gives us the frame size, in samples */
 | 
			
		||||
 | 
			
		||||
    f = fopen(filename, "rb");
 | 
			
		||||
    if (!f) {
 | 
			
		||||
        fprintf(stderr, "Could not open %s\n", filename);
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    picture = avcodec_alloc_frame();
 | 
			
		||||
    if (!picture) {
 | 
			
		||||
        fprintf(stderr, "Could not allocate video frame\n");
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    frame = 0;
 | 
			
		||||
    for(;;) {
 | 
			
		||||
        avpkt.size = fread(inbuf, 1, INBUF_SIZE, f);
 | 
			
		||||
        if (avpkt.size == 0)
 | 
			
		||||
            break;
 | 
			
		||||
 | 
			
		||||
        /* NOTE1: some codecs are stream based (mpegvideo, mpegaudio)
 | 
			
		||||
           and this is the only method to use them because you cannot
 | 
			
		||||
           know the compressed data size before analysing it.
 | 
			
		||||
 | 
			
		||||
           BUT some other codecs (msmpeg4, mpeg4) are inherently frame
 | 
			
		||||
           based, so you must call them with all the data for one
 | 
			
		||||
           frame exactly. You must also initialize 'width' and
 | 
			
		||||
           'height' before initializing them. */
 | 
			
		||||
 | 
			
		||||
        /* NOTE2: some codecs allow the raw parameters (frame size,
 | 
			
		||||
           sample rate) to be changed at any frame. We handle this, so
 | 
			
		||||
           you should also take care of it */
 | 
			
		||||
 | 
			
		||||
        /* here, we use a stream based decoder (mpeg1video), so we
 | 
			
		||||
           feed decoder and see if it could decode a frame */
 | 
			
		||||
        avpkt.data = inbuf;
 | 
			
		||||
        while (avpkt.size > 0) {
 | 
			
		||||
            len = avcodec_decode_video2(c, picture, &got_picture, &avpkt);
 | 
			
		||||
            if (len < 0) {
 | 
			
		||||
                fprintf(stderr, "Error while decoding frame %d\n", frame);
 | 
			
		||||
                exit(1);
 | 
			
		||||
            }
 | 
			
		||||
            if (got_picture) {
 | 
			
		||||
                printf("Saving frame %3d\n", frame);
 | 
			
		||||
                fflush(stdout);
 | 
			
		||||
 | 
			
		||||
                /* the picture is allocated by the decoder. no need to
 | 
			
		||||
                   free it */
 | 
			
		||||
                snprintf(buf, sizeof(buf), outfilename, frame);
 | 
			
		||||
                pgm_save(picture->data[0], picture->linesize[0],
 | 
			
		||||
                         c->width, c->height, buf);
 | 
			
		||||
                frame++;
 | 
			
		||||
            }
 | 
			
		||||
            avpkt.size -= len;
 | 
			
		||||
            avpkt.data += len;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* some codecs, such as MPEG, transmit the I and P frame with a
 | 
			
		||||
       latency of one frame. You must do the following to have a
 | 
			
		||||
       chance to get the last frame of the video */
 | 
			
		||||
    avpkt.data = NULL;
 | 
			
		||||
    avpkt.size = 0;
 | 
			
		||||
    len = avcodec_decode_video2(c, picture, &got_picture, &avpkt);
 | 
			
		||||
    if (got_picture) {
 | 
			
		||||
        printf("Saving last frame %3d\n", frame);
 | 
			
		||||
        fflush(stdout);
 | 
			
		||||
 | 
			
		||||
        /* the picture is allocated by the decoder. no need to
 | 
			
		||||
           free it */
 | 
			
		||||
        snprintf(buf, sizeof(buf), outfilename, frame);
 | 
			
		||||
        pgm_save(picture->data[0], picture->linesize[0],
 | 
			
		||||
                 c->width, c->height, buf);
 | 
			
		||||
        frame++;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    fclose(f);
 | 
			
		||||
 | 
			
		||||
    avcodec_close(c);
 | 
			
		||||
    av_free(c);
 | 
			
		||||
    avcodec_free_frame(&picture);
 | 
			
		||||
    printf("\n");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int main(int argc, char **argv)
 | 
			
		||||
{
 | 
			
		||||
    const char *output_type;
 | 
			
		||||
 | 
			
		||||
    /* register all the codecs */
 | 
			
		||||
    avcodec_register_all();
 | 
			
		||||
 | 
			
		||||
    if (argc < 2) {
 | 
			
		||||
        printf("usage: %s output_type\n"
 | 
			
		||||
               "API example program to decode/encode a media stream with libavcodec.\n"
 | 
			
		||||
               "This program generates a synthetic stream and encodes it to a file\n"
 | 
			
		||||
               "named test.h264, test.mp2 or test.mpg depending on output_type.\n"
 | 
			
		||||
               "The encoded stream is then decoded and written to a raw data output\n."
 | 
			
		||||
               "output_type must be choosen between 'h264', 'mp2', 'mpg'\n",
 | 
			
		||||
               argv[0]);
 | 
			
		||||
        return 1;
 | 
			
		||||
    }
 | 
			
		||||
    output_type = argv[1];
 | 
			
		||||
 | 
			
		||||
    if (!strcmp(output_type, "h264")) {
 | 
			
		||||
        video_encode_example("test.h264", AV_CODEC_ID_H264);
 | 
			
		||||
    } else if (!strcmp(output_type, "mp2")) {
 | 
			
		||||
        audio_encode_example("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");
 | 
			
		||||
    } else {
 | 
			
		||||
        fprintf(stderr, "Invalid output type '%s', choose between 'h264', 'mp2', or 'mpg'\n",
 | 
			
		||||
                output_type);
 | 
			
		||||
        return 1;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
@@ -1,339 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (c) 2012 Stefano Sabatini
 | 
			
		||||
 *
 | 
			
		||||
 * 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 demuxing API use example.
 | 
			
		||||
 *
 | 
			
		||||
 * Show how to use the libavformat and libavcodec API to demux and
 | 
			
		||||
 * decode audio and video data.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <libavutil/imgutils.h>
 | 
			
		||||
#include <libavutil/samplefmt.h>
 | 
			
		||||
#include <libavutil/timestamp.h>
 | 
			
		||||
#include <libavformat/avformat.h>
 | 
			
		||||
 | 
			
		||||
static AVFormatContext *fmt_ctx = NULL;
 | 
			
		||||
static AVCodecContext *video_dec_ctx = NULL, *audio_dec_ctx;
 | 
			
		||||
static AVStream *video_stream = NULL, *audio_stream = NULL;
 | 
			
		||||
static const char *src_filename = NULL;
 | 
			
		||||
static const char *video_dst_filename = NULL;
 | 
			
		||||
static const char *audio_dst_filename = NULL;
 | 
			
		||||
static FILE *video_dst_file = NULL;
 | 
			
		||||
static FILE *audio_dst_file = NULL;
 | 
			
		||||
 | 
			
		||||
static uint8_t *video_dst_data[4] = {NULL};
 | 
			
		||||
static int      video_dst_linesize[4];
 | 
			
		||||
static int video_dst_bufsize;
 | 
			
		||||
 | 
			
		||||
static uint8_t **audio_dst_data = NULL;
 | 
			
		||||
static int       audio_dst_linesize;
 | 
			
		||||
static int audio_dst_bufsize;
 | 
			
		||||
 | 
			
		||||
static int video_stream_idx = -1, audio_stream_idx = -1;
 | 
			
		||||
static AVFrame *frame = NULL;
 | 
			
		||||
static AVPacket pkt;
 | 
			
		||||
static int video_frame_count = 0;
 | 
			
		||||
static int audio_frame_count = 0;
 | 
			
		||||
 | 
			
		||||
static int decode_packet(int *got_frame, int cached)
 | 
			
		||||
{
 | 
			
		||||
    int ret = 0;
 | 
			
		||||
 | 
			
		||||
    if (pkt.stream_index == video_stream_idx) {
 | 
			
		||||
        /* decode video frame */
 | 
			
		||||
        ret = avcodec_decode_video2(video_dec_ctx, frame, got_frame, &pkt);
 | 
			
		||||
        if (ret < 0) {
 | 
			
		||||
            fprintf(stderr, "Error decoding video frame\n");
 | 
			
		||||
            return ret;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (*got_frame) {
 | 
			
		||||
            printf("video_frame%s n:%d coded_n:%d pts:%s\n",
 | 
			
		||||
                   cached ? "(cached)" : "",
 | 
			
		||||
                   video_frame_count++, frame->coded_picture_number,
 | 
			
		||||
                   av_ts2timestr(frame->pts, &video_dec_ctx->time_base));
 | 
			
		||||
 | 
			
		||||
            /* copy decoded frame to destination buffer:
 | 
			
		||||
             * 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,
 | 
			
		||||
                          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);
 | 
			
		||||
        }
 | 
			
		||||
    } else if (pkt.stream_index == audio_stream_idx) {
 | 
			
		||||
        /* decode audio frame */
 | 
			
		||||
        ret = avcodec_decode_audio4(audio_dec_ctx, frame, got_frame, &pkt);
 | 
			
		||||
        if (ret < 0) {
 | 
			
		||||
            fprintf(stderr, "Error decoding audio frame\n");
 | 
			
		||||
            return ret;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (*got_frame) {
 | 
			
		||||
            printf("audio_frame%s n:%d nb_samples:%d pts:%s\n",
 | 
			
		||||
                   cached ? "(cached)" : "",
 | 
			
		||||
                   audio_frame_count++, frame->nb_samples,
 | 
			
		||||
                   av_ts2timestr(frame->pts, &audio_dec_ctx->time_base));
 | 
			
		||||
 | 
			
		||||
            ret = av_samples_alloc(audio_dst_data, &audio_dst_linesize, frame->channels,
 | 
			
		||||
                                   frame->nb_samples, frame->format, 1);
 | 
			
		||||
            if (ret < 0) {
 | 
			
		||||
                fprintf(stderr, "Could not allocate audio buffer\n");
 | 
			
		||||
                return AVERROR(ENOMEM);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            /* TODO: extend return code of the av_samples_* functions so that this call is not needed */
 | 
			
		||||
            audio_dst_bufsize =
 | 
			
		||||
                av_samples_get_buffer_size(NULL, frame->channels,
 | 
			
		||||
                                           frame->nb_samples, frame->format, 1);
 | 
			
		||||
 | 
			
		||||
            /* copy audio data to destination buffer:
 | 
			
		||||
             * this is required since rawaudio expects non aligned data */
 | 
			
		||||
            av_samples_copy(audio_dst_data, frame->data, 0, 0,
 | 
			
		||||
                            frame->nb_samples, frame->channels, frame->format);
 | 
			
		||||
 | 
			
		||||
            /* write to rawaudio file */
 | 
			
		||||
            fwrite(audio_dst_data[0], 1, audio_dst_bufsize, audio_dst_file);
 | 
			
		||||
            av_freep(&audio_dst_data[0]);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int open_codec_context(int *stream_idx,
 | 
			
		||||
                              AVFormatContext *fmt_ctx, enum AVMediaType type)
 | 
			
		||||
{
 | 
			
		||||
    int ret;
 | 
			
		||||
    AVStream *st;
 | 
			
		||||
    AVCodecContext *dec_ctx = NULL;
 | 
			
		||||
    AVCodec *dec = NULL;
 | 
			
		||||
 | 
			
		||||
    ret = av_find_best_stream(fmt_ctx, type, -1, -1, NULL, 0);
 | 
			
		||||
    if (ret < 0) {
 | 
			
		||||
        fprintf(stderr, "Could not find %s stream in input file '%s'\n",
 | 
			
		||||
                av_get_media_type_string(type), src_filename);
 | 
			
		||||
        return ret;
 | 
			
		||||
    } else {
 | 
			
		||||
        *stream_idx = ret;
 | 
			
		||||
        st = fmt_ctx->streams[*stream_idx];
 | 
			
		||||
 | 
			
		||||
        /* find decoder for the stream */
 | 
			
		||||
        dec_ctx = st->codec;
 | 
			
		||||
        dec = avcodec_find_decoder(dec_ctx->codec_id);
 | 
			
		||||
        if (!dec) {
 | 
			
		||||
            fprintf(stderr, "Failed to find %s codec\n",
 | 
			
		||||
                    av_get_media_type_string(type));
 | 
			
		||||
            return ret;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if ((ret = avcodec_open2(dec_ctx, dec, NULL)) < 0) {
 | 
			
		||||
            fprintf(stderr, "Failed to open %s codec\n",
 | 
			
		||||
                    av_get_media_type_string(type));
 | 
			
		||||
            return ret;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int get_format_from_sample_fmt(const char **fmt,
 | 
			
		||||
                                      enum AVSampleFormat sample_fmt)
 | 
			
		||||
{
 | 
			
		||||
    int i;
 | 
			
		||||
    struct sample_fmt_entry {
 | 
			
		||||
        enum AVSampleFormat sample_fmt; const char *fmt_be, *fmt_le;
 | 
			
		||||
    } sample_fmt_entries[] = {
 | 
			
		||||
        { AV_SAMPLE_FMT_U8,  "u8",    "u8"    },
 | 
			
		||||
        { AV_SAMPLE_FMT_S16, "s16be", "s16le" },
 | 
			
		||||
        { AV_SAMPLE_FMT_S32, "s32be", "s32le" },
 | 
			
		||||
        { AV_SAMPLE_FMT_FLT, "f32be", "f32le" },
 | 
			
		||||
        { AV_SAMPLE_FMT_DBL, "f64be", "f64le" },
 | 
			
		||||
    };
 | 
			
		||||
    *fmt = NULL;
 | 
			
		||||
 | 
			
		||||
    for (i = 0; i < FF_ARRAY_ELEMS(sample_fmt_entries); i++) {
 | 
			
		||||
        struct sample_fmt_entry *entry = &sample_fmt_entries[i];
 | 
			
		||||
        if (sample_fmt == entry->sample_fmt) {
 | 
			
		||||
            *fmt = AV_NE(entry->fmt_be, entry->fmt_le);
 | 
			
		||||
            return 0;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    fprintf(stderr,
 | 
			
		||||
            "sample format %s is not supported as output format\n",
 | 
			
		||||
            av_get_sample_fmt_name(sample_fmt));
 | 
			
		||||
    return -1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int main (int argc, char **argv)
 | 
			
		||||
{
 | 
			
		||||
    int ret = 0, got_frame;
 | 
			
		||||
 | 
			
		||||
    if (argc != 4) {
 | 
			
		||||
        fprintf(stderr, "usage: %s input_file video_output_file audio_output_file\n"
 | 
			
		||||
                "API example program to show how to read frames from an input file.\n"
 | 
			
		||||
                "This program reads frames from a file, decodes them, and writes decoded\n"
 | 
			
		||||
                "video frames to a rawvideo file named video_output_file, and decoded\n"
 | 
			
		||||
                "audio frames to a rawaudio file named audio_output_file.\n"
 | 
			
		||||
                "\n", argv[0]);
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
    src_filename = argv[1];
 | 
			
		||||
    video_dst_filename = argv[2];
 | 
			
		||||
    audio_dst_filename = argv[3];
 | 
			
		||||
 | 
			
		||||
    /* register all formats and codecs */
 | 
			
		||||
    av_register_all();
 | 
			
		||||
 | 
			
		||||
    /* open input file, and allocated format context */
 | 
			
		||||
    if (avformat_open_input(&fmt_ctx, src_filename, NULL, NULL) < 0) {
 | 
			
		||||
        fprintf(stderr, "Could not open source file %s\n", src_filename);
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* retrieve stream information */
 | 
			
		||||
    if (avformat_find_stream_info(fmt_ctx, NULL) < 0) {
 | 
			
		||||
        fprintf(stderr, "Could not find stream information\n");
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (open_codec_context(&video_stream_idx, fmt_ctx, AVMEDIA_TYPE_VIDEO) >= 0) {
 | 
			
		||||
        video_stream = fmt_ctx->streams[video_stream_idx];
 | 
			
		||||
        video_dec_ctx = video_stream->codec;
 | 
			
		||||
 | 
			
		||||
        video_dst_file = fopen(video_dst_filename, "wb");
 | 
			
		||||
        if (!video_dst_file) {
 | 
			
		||||
            fprintf(stderr, "Could not open destination file %s\n", video_dst_filename);
 | 
			
		||||
            ret = 1;
 | 
			
		||||
            goto end;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /* allocate image where the decoded image will be put */
 | 
			
		||||
        ret = av_image_alloc(video_dst_data, video_dst_linesize,
 | 
			
		||||
                             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;
 | 
			
		||||
        }
 | 
			
		||||
        video_dst_bufsize = ret;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* dump input information to stderr */
 | 
			
		||||
    av_dump_format(fmt_ctx, 0, src_filename, 0);
 | 
			
		||||
 | 
			
		||||
    if (open_codec_context(&audio_stream_idx, fmt_ctx, AVMEDIA_TYPE_AUDIO) >= 0) {
 | 
			
		||||
        int nb_planes;
 | 
			
		||||
 | 
			
		||||
        audio_stream = fmt_ctx->streams[audio_stream_idx];
 | 
			
		||||
        audio_dec_ctx = audio_stream->codec;
 | 
			
		||||
        audio_dst_file = fopen(audio_dst_filename, "wb");
 | 
			
		||||
        if (!audio_dst_file) {
 | 
			
		||||
            fprintf(stderr, "Could not open destination file %s\n", video_dst_filename);
 | 
			
		||||
            ret = 1;
 | 
			
		||||
            goto end;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        nb_planes = av_sample_fmt_is_planar(audio_dec_ctx->sample_fmt) ?
 | 
			
		||||
            audio_dec_ctx->channels : 1;
 | 
			
		||||
        audio_dst_data = av_mallocz(sizeof(uint8_t *) * nb_planes);
 | 
			
		||||
        if (!audio_dst_data) {
 | 
			
		||||
            fprintf(stderr, "Could not allocate audio data buffers\n");
 | 
			
		||||
            ret = AVERROR(ENOMEM);
 | 
			
		||||
            goto end;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (!audio_stream && !video_stream) {
 | 
			
		||||
        fprintf(stderr, "Could not find audio or video stream in the input, aborting\n");
 | 
			
		||||
        ret = 1;
 | 
			
		||||
        goto end;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    frame = avcodec_alloc_frame();
 | 
			
		||||
    if (!frame) {
 | 
			
		||||
        fprintf(stderr, "Could not allocate frame\n");
 | 
			
		||||
        ret = AVERROR(ENOMEM);
 | 
			
		||||
        goto end;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* initialize packet, set data to NULL, let the demuxer fill it */
 | 
			
		||||
    av_init_packet(&pkt);
 | 
			
		||||
    pkt.data = NULL;
 | 
			
		||||
    pkt.size = 0;
 | 
			
		||||
 | 
			
		||||
    if (video_stream)
 | 
			
		||||
        printf("Demuxing video from file '%s' into '%s'\n", src_filename, video_dst_filename);
 | 
			
		||||
    if (audio_stream)
 | 
			
		||||
        printf("Demuxing video from file '%s' into '%s'\n", src_filename, audio_dst_filename);
 | 
			
		||||
 | 
			
		||||
    /* read frames from the file */
 | 
			
		||||
    while (av_read_frame(fmt_ctx, &pkt) >= 0)
 | 
			
		||||
        decode_packet(&got_frame, 0);
 | 
			
		||||
 | 
			
		||||
    /* flush cached frames */
 | 
			
		||||
    pkt.data = NULL;
 | 
			
		||||
    pkt.size = 0;
 | 
			
		||||
    do {
 | 
			
		||||
        decode_packet(&got_frame, 1);
 | 
			
		||||
    } while (got_frame);
 | 
			
		||||
 | 
			
		||||
    printf("Demuxing succeeded.\n");
 | 
			
		||||
 | 
			
		||||
    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(video_dec_ctx->pix_fmt), video_dec_ctx->width, video_dec_ctx->height,
 | 
			
		||||
               video_dst_filename);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (audio_stream) {
 | 
			
		||||
        const char *fmt;
 | 
			
		||||
 | 
			
		||||
        if ((ret = get_format_from_sample_fmt(&fmt, audio_dec_ctx->sample_fmt) < 0))
 | 
			
		||||
            goto end;
 | 
			
		||||
        printf("Play the output audio file with the command:\n"
 | 
			
		||||
               "ffplay -f %s -ac %d -ar %d %s\n",
 | 
			
		||||
               fmt, audio_dec_ctx->channels, audio_dec_ctx->sample_rate,
 | 
			
		||||
               audio_dst_filename);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
end:
 | 
			
		||||
    if (video_dec_ctx)
 | 
			
		||||
        avcodec_close(video_dec_ctx);
 | 
			
		||||
    if (audio_dec_ctx)
 | 
			
		||||
        avcodec_close(audio_dec_ctx);
 | 
			
		||||
    avformat_close_input(&fmt_ctx);
 | 
			
		||||
    if (video_dst_file)
 | 
			
		||||
        fclose(video_dst_file);
 | 
			
		||||
    if (audio_dst_file)
 | 
			
		||||
        fclose(audio_dst_file);
 | 
			
		||||
    av_free(frame);
 | 
			
		||||
    av_free(video_dst_data[0]);
 | 
			
		||||
    av_free(audio_dst_data);
 | 
			
		||||
 | 
			
		||||
    return ret < 0;
 | 
			
		||||
}
 | 
			
		||||
@@ -1,240 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (c) 2010 Nicolas George
 | 
			
		||||
 * Copyright (c) 2011 Stefano Sabatini
 | 
			
		||||
 * Copyright (c) 2012 Clément Bœsch
 | 
			
		||||
 *
 | 
			
		||||
 * 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
 | 
			
		||||
 * API example for audio decoding and filtering
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <unistd.h>
 | 
			
		||||
 | 
			
		||||
#include <libavcodec/avcodec.h>
 | 
			
		||||
#include <libavformat/avformat.h>
 | 
			
		||||
#include <libavfilter/avfiltergraph.h>
 | 
			
		||||
#include <libavfilter/avcodec.h>
 | 
			
		||||
#include <libavfilter/buffersink.h>
 | 
			
		||||
#include <libavfilter/buffersrc.h>
 | 
			
		||||
 | 
			
		||||
const char *filter_descr = "aresample=8000,aconvert=s16:mono";
 | 
			
		||||
const char *player       = "ffplay -f s16le -ar 8000 -ac 1 -";
 | 
			
		||||
 | 
			
		||||
static AVFormatContext *fmt_ctx;
 | 
			
		||||
static AVCodecContext *dec_ctx;
 | 
			
		||||
AVFilterContext *buffersink_ctx;
 | 
			
		||||
AVFilterContext *buffersrc_ctx;
 | 
			
		||||
AVFilterGraph *filter_graph;
 | 
			
		||||
static int audio_stream_index = -1;
 | 
			
		||||
 | 
			
		||||
static int open_input_file(const char *filename)
 | 
			
		||||
{
 | 
			
		||||
    int ret;
 | 
			
		||||
    AVCodec *dec;
 | 
			
		||||
 | 
			
		||||
    if ((ret = avformat_open_input(&fmt_ctx, filename, NULL, NULL)) < 0) {
 | 
			
		||||
        av_log(NULL, AV_LOG_ERROR, "Cannot open input file\n");
 | 
			
		||||
        return ret;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if ((ret = avformat_find_stream_info(fmt_ctx, NULL)) < 0) {
 | 
			
		||||
        av_log(NULL, AV_LOG_ERROR, "Cannot find stream information\n");
 | 
			
		||||
        return ret;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* select the audio stream */
 | 
			
		||||
    ret = av_find_best_stream(fmt_ctx, AVMEDIA_TYPE_AUDIO, -1, -1, &dec, 0);
 | 
			
		||||
    if (ret < 0) {
 | 
			
		||||
        av_log(NULL, AV_LOG_ERROR, "Cannot find a audio stream in the input file\n");
 | 
			
		||||
        return ret;
 | 
			
		||||
    }
 | 
			
		||||
    audio_stream_index = ret;
 | 
			
		||||
    dec_ctx = fmt_ctx->streams[audio_stream_index]->codec;
 | 
			
		||||
 | 
			
		||||
    /* init the audio decoder */
 | 
			
		||||
    if ((ret = avcodec_open2(dec_ctx, dec, NULL)) < 0) {
 | 
			
		||||
        av_log(NULL, AV_LOG_ERROR, "Cannot open audio decoder\n");
 | 
			
		||||
        return ret;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int init_filters(const char *filters_descr)
 | 
			
		||||
{
 | 
			
		||||
    char args[512];
 | 
			
		||||
    int ret;
 | 
			
		||||
    AVFilter *abuffersrc  = avfilter_get_by_name("abuffer");
 | 
			
		||||
    AVFilter *abuffersink = avfilter_get_by_name("ffabuffersink");
 | 
			
		||||
    AVFilterInOut *outputs = avfilter_inout_alloc();
 | 
			
		||||
    AVFilterInOut *inputs  = avfilter_inout_alloc();
 | 
			
		||||
    const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_S16, -1 };
 | 
			
		||||
    AVABufferSinkParams *abuffersink_params;
 | 
			
		||||
    const AVFilterLink *outlink;
 | 
			
		||||
    AVRational time_base = fmt_ctx->streams[audio_stream_index]->time_base;
 | 
			
		||||
 | 
			
		||||
    filter_graph = avfilter_graph_alloc();
 | 
			
		||||
 | 
			
		||||
    /* buffer audio source: the decoded frames from the decoder will be inserted here. */
 | 
			
		||||
    if (!dec_ctx->channel_layout)
 | 
			
		||||
        dec_ctx->channel_layout = av_get_default_channel_layout(dec_ctx->channels);
 | 
			
		||||
    snprintf(args, sizeof(args),
 | 
			
		||||
            "time_base=%d/%d:sample_rate=%d:sample_fmt=%s:channel_layout=0x%"PRIx64,
 | 
			
		||||
             time_base.num, time_base.den, dec_ctx->sample_rate,
 | 
			
		||||
             av_get_sample_fmt_name(dec_ctx->sample_fmt), dec_ctx->channel_layout);
 | 
			
		||||
    ret = avfilter_graph_create_filter(&buffersrc_ctx, abuffersrc, "in",
 | 
			
		||||
                                       args, NULL, filter_graph);
 | 
			
		||||
    if (ret < 0) {
 | 
			
		||||
        av_log(NULL, AV_LOG_ERROR, "Cannot create audio buffer source\n");
 | 
			
		||||
        return ret;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* buffer audio sink: to terminate the filter chain. */
 | 
			
		||||
    abuffersink_params = av_abuffersink_params_alloc();
 | 
			
		||||
    abuffersink_params->sample_fmts     = sample_fmts;
 | 
			
		||||
    ret = avfilter_graph_create_filter(&buffersink_ctx, abuffersink, "out",
 | 
			
		||||
                                       NULL, abuffersink_params, filter_graph);
 | 
			
		||||
    av_free(abuffersink_params);
 | 
			
		||||
    if (ret < 0) {
 | 
			
		||||
        av_log(NULL, AV_LOG_ERROR, "Cannot create audio buffer sink\n");
 | 
			
		||||
        return ret;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* Endpoints for the filter graph. */
 | 
			
		||||
    outputs->name       = av_strdup("in");
 | 
			
		||||
    outputs->filter_ctx = buffersrc_ctx;
 | 
			
		||||
    outputs->pad_idx    = 0;
 | 
			
		||||
    outputs->next       = NULL;
 | 
			
		||||
 | 
			
		||||
    inputs->name       = av_strdup("out");
 | 
			
		||||
    inputs->filter_ctx = buffersink_ctx;
 | 
			
		||||
    inputs->pad_idx    = 0;
 | 
			
		||||
    inputs->next       = NULL;
 | 
			
		||||
 | 
			
		||||
    if ((ret = avfilter_graph_parse(filter_graph, filters_descr,
 | 
			
		||||
                                    &inputs, &outputs, NULL)) < 0)
 | 
			
		||||
        return ret;
 | 
			
		||||
 | 
			
		||||
    if ((ret = avfilter_graph_config(filter_graph, NULL)) < 0)
 | 
			
		||||
        return ret;
 | 
			
		||||
 | 
			
		||||
    /* Print summary of the sink buffer
 | 
			
		||||
     * Note: args buffer is reused to store channel layout string */
 | 
			
		||||
    outlink = buffersink_ctx->inputs[0];
 | 
			
		||||
    av_get_channel_layout_string(args, sizeof(args), -1, outlink->channel_layout);
 | 
			
		||||
    av_log(NULL, AV_LOG_INFO, "Output: srate:%dHz fmt:%s chlayout:%s\n",
 | 
			
		||||
           (int)outlink->sample_rate,
 | 
			
		||||
           (char *)av_x_if_null(av_get_sample_fmt_name(outlink->format), "?"),
 | 
			
		||||
           args);
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void print_samplesref(AVFilterBufferRef *samplesref)
 | 
			
		||||
{
 | 
			
		||||
    const AVFilterBufferRefAudioProps *props = samplesref->audio;
 | 
			
		||||
    const int n = props->nb_samples * av_get_channel_layout_nb_channels(props->channel_layout);
 | 
			
		||||
    const uint16_t *p     = (uint16_t*)samplesref->data[0];
 | 
			
		||||
    const uint16_t *p_end = p + n;
 | 
			
		||||
 | 
			
		||||
    while (p < p_end) {
 | 
			
		||||
        fputc(*p    & 0xff, stdout);
 | 
			
		||||
        fputc(*p>>8 & 0xff, stdout);
 | 
			
		||||
        p++;
 | 
			
		||||
    }
 | 
			
		||||
    fflush(stdout);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int main(int argc, char **argv)
 | 
			
		||||
{
 | 
			
		||||
    int ret;
 | 
			
		||||
    AVPacket packet;
 | 
			
		||||
    AVFrame frame;
 | 
			
		||||
    int got_frame;
 | 
			
		||||
 | 
			
		||||
    if (argc != 2) {
 | 
			
		||||
        fprintf(stderr, "Usage: %s file | %s\n", argv[0], player);
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    avcodec_register_all();
 | 
			
		||||
    av_register_all();
 | 
			
		||||
    avfilter_register_all();
 | 
			
		||||
 | 
			
		||||
    if ((ret = open_input_file(argv[1])) < 0)
 | 
			
		||||
        goto end;
 | 
			
		||||
    if ((ret = init_filters(filter_descr)) < 0)
 | 
			
		||||
        goto end;
 | 
			
		||||
 | 
			
		||||
    /* read all packets */
 | 
			
		||||
    while (1) {
 | 
			
		||||
        AVFilterBufferRef *samplesref;
 | 
			
		||||
        if ((ret = av_read_frame(fmt_ctx, &packet)) < 0)
 | 
			
		||||
            break;
 | 
			
		||||
 | 
			
		||||
        if (packet.stream_index == audio_stream_index) {
 | 
			
		||||
            avcodec_get_frame_defaults(&frame);
 | 
			
		||||
            got_frame = 0;
 | 
			
		||||
            ret = avcodec_decode_audio4(dec_ctx, &frame, &got_frame, &packet);
 | 
			
		||||
            if (ret < 0) {
 | 
			
		||||
                av_log(NULL, AV_LOG_ERROR, "Error decoding audio\n");
 | 
			
		||||
                continue;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (got_frame) {
 | 
			
		||||
                /* push the audio data from decoded frame into the filtergraph */
 | 
			
		||||
                if (av_buffersrc_add_frame(buffersrc_ctx, &frame, 0) < 0) {
 | 
			
		||||
                    av_log(NULL, AV_LOG_ERROR, "Error while feeding the audio filtergraph\n");
 | 
			
		||||
                    break;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                /* pull filtered audio from the filtergraph */
 | 
			
		||||
                while (1) {
 | 
			
		||||
                    ret = av_buffersink_get_buffer_ref(buffersink_ctx, &samplesref, 0);
 | 
			
		||||
                    if(ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
 | 
			
		||||
                        break;
 | 
			
		||||
                    if(ret < 0)
 | 
			
		||||
                        goto end;
 | 
			
		||||
                    if (samplesref) {
 | 
			
		||||
                        print_samplesref(samplesref);
 | 
			
		||||
                        avfilter_unref_bufferp(&samplesref);
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        av_free_packet(&packet);
 | 
			
		||||
    }
 | 
			
		||||
end:
 | 
			
		||||
    avfilter_graph_free(&filter_graph);
 | 
			
		||||
    if (dec_ctx)
 | 
			
		||||
        avcodec_close(dec_ctx);
 | 
			
		||||
    avformat_close_input(&fmt_ctx);
 | 
			
		||||
 | 
			
		||||
    if (ret < 0 && ret != AVERROR_EOF) {
 | 
			
		||||
        char buf[1024];
 | 
			
		||||
        av_strerror(ret, buf, sizeof(buf));
 | 
			
		||||
        fprintf(stderr, "Error occurred: %s\n", buf);
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    exit(0);
 | 
			
		||||
}
 | 
			
		||||
@@ -1,247 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (c) 2010 Nicolas George
 | 
			
		||||
 * Copyright (c) 2011 Stefano Sabatini
 | 
			
		||||
 *
 | 
			
		||||
 * 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
 | 
			
		||||
 * API example for decoding and filtering
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define _XOPEN_SOURCE 600 /* for usleep */
 | 
			
		||||
#include <unistd.h>
 | 
			
		||||
 | 
			
		||||
#include <libavcodec/avcodec.h>
 | 
			
		||||
#include <libavformat/avformat.h>
 | 
			
		||||
#include <libavfilter/avfiltergraph.h>
 | 
			
		||||
#include <libavfilter/avcodec.h>
 | 
			
		||||
#include <libavfilter/buffersink.h>
 | 
			
		||||
#include <libavfilter/buffersrc.h>
 | 
			
		||||
 | 
			
		||||
const char *filter_descr = "scale=78:24";
 | 
			
		||||
 | 
			
		||||
static AVFormatContext *fmt_ctx;
 | 
			
		||||
static AVCodecContext *dec_ctx;
 | 
			
		||||
AVFilterContext *buffersink_ctx;
 | 
			
		||||
AVFilterContext *buffersrc_ctx;
 | 
			
		||||
AVFilterGraph *filter_graph;
 | 
			
		||||
static int video_stream_index = -1;
 | 
			
		||||
static int64_t last_pts = AV_NOPTS_VALUE;
 | 
			
		||||
 | 
			
		||||
static int open_input_file(const char *filename)
 | 
			
		||||
{
 | 
			
		||||
    int ret;
 | 
			
		||||
    AVCodec *dec;
 | 
			
		||||
 | 
			
		||||
    if ((ret = avformat_open_input(&fmt_ctx, filename, NULL, NULL)) < 0) {
 | 
			
		||||
        av_log(NULL, AV_LOG_ERROR, "Cannot open input file\n");
 | 
			
		||||
        return ret;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if ((ret = avformat_find_stream_info(fmt_ctx, NULL)) < 0) {
 | 
			
		||||
        av_log(NULL, AV_LOG_ERROR, "Cannot find stream information\n");
 | 
			
		||||
        return ret;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* select the video stream */
 | 
			
		||||
    ret = av_find_best_stream(fmt_ctx, AVMEDIA_TYPE_VIDEO, -1, -1, &dec, 0);
 | 
			
		||||
    if (ret < 0) {
 | 
			
		||||
        av_log(NULL, AV_LOG_ERROR, "Cannot find a video stream in the input file\n");
 | 
			
		||||
        return ret;
 | 
			
		||||
    }
 | 
			
		||||
    video_stream_index = ret;
 | 
			
		||||
    dec_ctx = fmt_ctx->streams[video_stream_index]->codec;
 | 
			
		||||
 | 
			
		||||
    /* init the video decoder */
 | 
			
		||||
    if ((ret = avcodec_open2(dec_ctx, dec, NULL)) < 0) {
 | 
			
		||||
        av_log(NULL, AV_LOG_ERROR, "Cannot open video decoder\n");
 | 
			
		||||
        return ret;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int init_filters(const char *filters_descr)
 | 
			
		||||
{
 | 
			
		||||
    char args[512];
 | 
			
		||||
    int ret;
 | 
			
		||||
    AVFilter *buffersrc  = avfilter_get_by_name("buffer");
 | 
			
		||||
    AVFilter *buffersink = avfilter_get_by_name("ffbuffersink");
 | 
			
		||||
    AVFilterInOut *outputs = avfilter_inout_alloc();
 | 
			
		||||
    AVFilterInOut *inputs  = avfilter_inout_alloc();
 | 
			
		||||
    enum PixelFormat pix_fmts[] = { PIX_FMT_GRAY8, PIX_FMT_NONE };
 | 
			
		||||
    AVBufferSinkParams *buffersink_params;
 | 
			
		||||
 | 
			
		||||
    filter_graph = avfilter_graph_alloc();
 | 
			
		||||
 | 
			
		||||
    /* buffer video source: the decoded frames from the decoder will be inserted here. */
 | 
			
		||||
    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,
 | 
			
		||||
            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",
 | 
			
		||||
                                       args, NULL, filter_graph);
 | 
			
		||||
    if (ret < 0) {
 | 
			
		||||
        av_log(NULL, AV_LOG_ERROR, "Cannot create buffer source\n");
 | 
			
		||||
        return ret;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* buffer video sink: to terminate the filter chain. */
 | 
			
		||||
    buffersink_params = av_buffersink_params_alloc();
 | 
			
		||||
    buffersink_params->pixel_fmts = pix_fmts;
 | 
			
		||||
    ret = avfilter_graph_create_filter(&buffersink_ctx, buffersink, "out",
 | 
			
		||||
                                       NULL, buffersink_params, filter_graph);
 | 
			
		||||
    av_free(buffersink_params);
 | 
			
		||||
    if (ret < 0) {
 | 
			
		||||
        av_log(NULL, AV_LOG_ERROR, "Cannot create buffer sink\n");
 | 
			
		||||
        return ret;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* Endpoints for the filter graph. */
 | 
			
		||||
    outputs->name       = av_strdup("in");
 | 
			
		||||
    outputs->filter_ctx = buffersrc_ctx;
 | 
			
		||||
    outputs->pad_idx    = 0;
 | 
			
		||||
    outputs->next       = NULL;
 | 
			
		||||
 | 
			
		||||
    inputs->name       = av_strdup("out");
 | 
			
		||||
    inputs->filter_ctx = buffersink_ctx;
 | 
			
		||||
    inputs->pad_idx    = 0;
 | 
			
		||||
    inputs->next       = NULL;
 | 
			
		||||
 | 
			
		||||
    if ((ret = avfilter_graph_parse(filter_graph, filters_descr,
 | 
			
		||||
                                    &inputs, &outputs, NULL)) < 0)
 | 
			
		||||
        return ret;
 | 
			
		||||
 | 
			
		||||
    if ((ret = avfilter_graph_config(filter_graph, NULL)) < 0)
 | 
			
		||||
        return ret;
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void display_picref(AVFilterBufferRef *picref, AVRational time_base)
 | 
			
		||||
{
 | 
			
		||||
    int x, y;
 | 
			
		||||
    uint8_t *p0, *p;
 | 
			
		||||
    int64_t delay;
 | 
			
		||||
 | 
			
		||||
    if (picref->pts != AV_NOPTS_VALUE) {
 | 
			
		||||
        if (last_pts != AV_NOPTS_VALUE) {
 | 
			
		||||
            /* sleep roughly the right amount of time;
 | 
			
		||||
             * usleep is in microseconds, just like AV_TIME_BASE. */
 | 
			
		||||
            delay = av_rescale_q(picref->pts - last_pts,
 | 
			
		||||
                                 time_base, AV_TIME_BASE_Q);
 | 
			
		||||
            if (delay > 0 && delay < 1000000)
 | 
			
		||||
                usleep(delay);
 | 
			
		||||
        }
 | 
			
		||||
        last_pts = picref->pts;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* Trivial ASCII grayscale display. */
 | 
			
		||||
    p0 = picref->data[0];
 | 
			
		||||
    puts("\033c");
 | 
			
		||||
    for (y = 0; y < picref->video->h; y++) {
 | 
			
		||||
        p = p0;
 | 
			
		||||
        for (x = 0; x < picref->video->w; x++)
 | 
			
		||||
            putchar(" .-+#"[*(p++) / 52]);
 | 
			
		||||
        putchar('\n');
 | 
			
		||||
        p0 += picref->linesize[0];
 | 
			
		||||
    }
 | 
			
		||||
    fflush(stdout);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int main(int argc, char **argv)
 | 
			
		||||
{
 | 
			
		||||
    int ret;
 | 
			
		||||
    AVPacket packet;
 | 
			
		||||
    AVFrame frame;
 | 
			
		||||
    int got_frame;
 | 
			
		||||
 | 
			
		||||
    if (argc != 2) {
 | 
			
		||||
        fprintf(stderr, "Usage: %s file\n", argv[0]);
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    avcodec_register_all();
 | 
			
		||||
    av_register_all();
 | 
			
		||||
    avfilter_register_all();
 | 
			
		||||
 | 
			
		||||
    if ((ret = open_input_file(argv[1])) < 0)
 | 
			
		||||
        goto end;
 | 
			
		||||
    if ((ret = init_filters(filter_descr)) < 0)
 | 
			
		||||
        goto end;
 | 
			
		||||
 | 
			
		||||
    /* read all packets */
 | 
			
		||||
    while (1) {
 | 
			
		||||
        AVFilterBufferRef *picref;
 | 
			
		||||
        if ((ret = av_read_frame(fmt_ctx, &packet)) < 0)
 | 
			
		||||
            break;
 | 
			
		||||
 | 
			
		||||
        if (packet.stream_index == video_stream_index) {
 | 
			
		||||
            avcodec_get_frame_defaults(&frame);
 | 
			
		||||
            got_frame = 0;
 | 
			
		||||
            ret = avcodec_decode_video2(dec_ctx, &frame, &got_frame, &packet);
 | 
			
		||||
            if (ret < 0) {
 | 
			
		||||
                av_log(NULL, AV_LOG_ERROR, "Error decoding video\n");
 | 
			
		||||
                break;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (got_frame) {
 | 
			
		||||
                frame.pts = av_frame_get_best_effort_timestamp(&frame);
 | 
			
		||||
 | 
			
		||||
                /* push the decoded frame into the filtergraph */
 | 
			
		||||
                if (av_buffersrc_add_frame(buffersrc_ctx, &frame, 0) < 0) {
 | 
			
		||||
                    av_log(NULL, AV_LOG_ERROR, "Error while feeding the filtergraph\n");
 | 
			
		||||
                    break;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                /* pull filtered pictures from the filtergraph */
 | 
			
		||||
                while (1) {
 | 
			
		||||
                    ret = av_buffersink_get_buffer_ref(buffersink_ctx, &picref, 0);
 | 
			
		||||
                    if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
 | 
			
		||||
                        break;
 | 
			
		||||
                    if (ret < 0)
 | 
			
		||||
                        goto end;
 | 
			
		||||
 | 
			
		||||
                    if (picref) {
 | 
			
		||||
                        display_picref(picref, buffersink_ctx->inputs[0]->time_base);
 | 
			
		||||
                        avfilter_unref_bufferp(&picref);
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        av_free_packet(&packet);
 | 
			
		||||
    }
 | 
			
		||||
end:
 | 
			
		||||
    avfilter_graph_free(&filter_graph);
 | 
			
		||||
    if (dec_ctx)
 | 
			
		||||
        avcodec_close(dec_ctx);
 | 
			
		||||
    avformat_close_input(&fmt_ctx);
 | 
			
		||||
 | 
			
		||||
    if (ret < 0 && ret != AVERROR_EOF) {
 | 
			
		||||
        char buf[1024];
 | 
			
		||||
        av_strerror(ret, buf, sizeof(buf));
 | 
			
		||||
        fprintf(stderr, "Error occurred: %s\n", buf);
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    exit(0);
 | 
			
		||||
}
 | 
			
		||||
@@ -1,55 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (c) 2011 Reinhard Tartler
 | 
			
		||||
 *
 | 
			
		||||
 * 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
 | 
			
		||||
 * Shows how the metadata API can be used in application programs.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
 | 
			
		||||
#include <libavformat/avformat.h>
 | 
			
		||||
#include <libavutil/dict.h>
 | 
			
		||||
 | 
			
		||||
int main (int argc, char **argv)
 | 
			
		||||
{
 | 
			
		||||
    AVFormatContext *fmt_ctx = NULL;
 | 
			
		||||
    AVDictionaryEntry *tag = NULL;
 | 
			
		||||
    int ret;
 | 
			
		||||
 | 
			
		||||
    if (argc != 2) {
 | 
			
		||||
        printf("usage: %s <input_file>\n"
 | 
			
		||||
               "example program to demonstrate the use of the libavformat metadata API.\n"
 | 
			
		||||
               "\n", argv[0]);
 | 
			
		||||
        return 1;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    av_register_all();
 | 
			
		||||
    if ((ret = avformat_open_input(&fmt_ctx, argv[1], NULL, NULL)))
 | 
			
		||||
        return ret;
 | 
			
		||||
 | 
			
		||||
    while ((tag = av_dict_get(fmt_ctx->metadata, "", tag, AV_DICT_IGNORE_SUFFIX)))
 | 
			
		||||
        printf("%s=%s\n", tag->key, tag->value);
 | 
			
		||||
 | 
			
		||||
    avformat_close_input(&fmt_ctx);
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
@@ -1,531 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (c) 2003 Fabrice Bellard
 | 
			
		||||
 *
 | 
			
		||||
 * 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 API example.
 | 
			
		||||
 *
 | 
			
		||||
 * Output a media file in any supported libavformat format.
 | 
			
		||||
 * The default codecs are used.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include <math.h>
 | 
			
		||||
 | 
			
		||||
#include <libavutil/mathematics.h>
 | 
			
		||||
#include <libavformat/avformat.h>
 | 
			
		||||
#include <libswscale/swscale.h>
 | 
			
		||||
 | 
			
		||||
/* 5 seconds stream duration */
 | 
			
		||||
#define STREAM_DURATION   200.0
 | 
			
		||||
#define STREAM_FRAME_RATE 25 /* 25 images/s */
 | 
			
		||||
#define STREAM_NB_FRAMES  ((int)(STREAM_DURATION * STREAM_FRAME_RATE))
 | 
			
		||||
#define STREAM_PIX_FMT    PIX_FMT_YUV420P /* default pix_fmt */
 | 
			
		||||
 | 
			
		||||
static int sws_flags = SWS_BICUBIC;
 | 
			
		||||
 | 
			
		||||
/**************************************************************/
 | 
			
		||||
/* audio output */
 | 
			
		||||
 | 
			
		||||
static float t, tincr, tincr2;
 | 
			
		||||
static int16_t *samples;
 | 
			
		||||
static int audio_input_frame_size;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * add an audio output stream
 | 
			
		||||
 */
 | 
			
		||||
static AVStream *add_audio_stream(AVFormatContext *oc, AVCodec **codec,
 | 
			
		||||
                                  enum AVCodecID codec_id)
 | 
			
		||||
{
 | 
			
		||||
    AVCodecContext *c;
 | 
			
		||||
    AVStream *st;
 | 
			
		||||
 | 
			
		||||
    /* find the audio encoder */
 | 
			
		||||
    *codec = avcodec_find_encoder(codec_id);
 | 
			
		||||
    if (!(*codec)) {
 | 
			
		||||
        fprintf(stderr, "Could not find codec\n");
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    st = avformat_new_stream(oc, *codec);
 | 
			
		||||
    if (!st) {
 | 
			
		||||
        fprintf(stderr, "Could not allocate stream\n");
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
    st->id = 1;
 | 
			
		||||
 | 
			
		||||
    c = st->codec;
 | 
			
		||||
 | 
			
		||||
    /* put sample parameters */
 | 
			
		||||
    c->sample_fmt  = AV_SAMPLE_FMT_S16;
 | 
			
		||||
    c->bit_rate    = 64000;
 | 
			
		||||
    c->sample_rate = 44100;
 | 
			
		||||
    c->channels    = 2;
 | 
			
		||||
 | 
			
		||||
    // some formats want stream headers to be separate
 | 
			
		||||
    if (oc->oformat->flags & AVFMT_GLOBALHEADER)
 | 
			
		||||
        c->flags |= CODEC_FLAG_GLOBAL_HEADER;
 | 
			
		||||
 | 
			
		||||
    return st;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void open_audio(AVFormatContext *oc, AVCodec *codec, AVStream *st)
 | 
			
		||||
{
 | 
			
		||||
    AVCodecContext *c;
 | 
			
		||||
 | 
			
		||||
    c = st->codec;
 | 
			
		||||
 | 
			
		||||
    /* open it */
 | 
			
		||||
    if (avcodec_open2(c, codec, NULL) < 0) {
 | 
			
		||||
        fprintf(stderr, "could not open codec\n");
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* init signal generator */
 | 
			
		||||
    t     = 0;
 | 
			
		||||
    tincr = 2 * M_PI * 110.0 / c->sample_rate;
 | 
			
		||||
    /* increment frequency by 110 Hz per second */
 | 
			
		||||
    tincr2 = 2 * M_PI * 110.0 / c->sample_rate / c->sample_rate;
 | 
			
		||||
 | 
			
		||||
    if (c->codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE)
 | 
			
		||||
        audio_input_frame_size = 10000;
 | 
			
		||||
    else
 | 
			
		||||
        audio_input_frame_size = c->frame_size;
 | 
			
		||||
    samples = av_malloc(audio_input_frame_size *
 | 
			
		||||
                        av_get_bytes_per_sample(c->sample_fmt) *
 | 
			
		||||
                        c->channels);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Prepare a 16 bit dummy audio frame of 'frame_size' samples and
 | 
			
		||||
 * 'nb_channels' channels. */
 | 
			
		||||
static void get_audio_frame(int16_t *samples, int frame_size, int nb_channels)
 | 
			
		||||
{
 | 
			
		||||
    int j, i, v;
 | 
			
		||||
    int16_t *q;
 | 
			
		||||
 | 
			
		||||
    q = samples;
 | 
			
		||||
    for (j = 0; j < frame_size; j++) {
 | 
			
		||||
        v = (int)(sin(t) * 10000);
 | 
			
		||||
        for (i = 0; i < nb_channels; i++)
 | 
			
		||||
            *q++ = v;
 | 
			
		||||
        t     += tincr;
 | 
			
		||||
        tincr += tincr2;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void write_audio_frame(AVFormatContext *oc, AVStream *st)
 | 
			
		||||
{
 | 
			
		||||
    AVCodecContext *c;
 | 
			
		||||
    AVPacket pkt = { 0 }; // data and size must be 0;
 | 
			
		||||
    AVFrame *frame = avcodec_alloc_frame();
 | 
			
		||||
    int got_packet;
 | 
			
		||||
 | 
			
		||||
    av_init_packet(&pkt);
 | 
			
		||||
    c = st->codec;
 | 
			
		||||
 | 
			
		||||
    get_audio_frame(samples, audio_input_frame_size, c->channels);
 | 
			
		||||
    frame->nb_samples = audio_input_frame_size;
 | 
			
		||||
    avcodec_fill_audio_frame(frame, c->channels, c->sample_fmt,
 | 
			
		||||
                             (uint8_t *)samples,
 | 
			
		||||
                             audio_input_frame_size *
 | 
			
		||||
                             av_get_bytes_per_sample(c->sample_fmt) *
 | 
			
		||||
                             c->channels, 1);
 | 
			
		||||
 | 
			
		||||
    avcodec_encode_audio2(c, &pkt, frame, &got_packet);
 | 
			
		||||
    if (!got_packet)
 | 
			
		||||
        return;
 | 
			
		||||
 | 
			
		||||
    pkt.stream_index = st->index;
 | 
			
		||||
 | 
			
		||||
    /* Write the compressed frame to the media file. */
 | 
			
		||||
    if (av_interleaved_write_frame(oc, &pkt) != 0) {
 | 
			
		||||
        fprintf(stderr, "Error while writing audio frame\n");
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
    avcodec_free_frame(&frame);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void close_audio(AVFormatContext *oc, AVStream *st)
 | 
			
		||||
{
 | 
			
		||||
    avcodec_close(st->codec);
 | 
			
		||||
 | 
			
		||||
    av_free(samples);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**************************************************************/
 | 
			
		||||
/* video output */
 | 
			
		||||
 | 
			
		||||
static AVFrame *frame;
 | 
			
		||||
static AVPicture src_picture, dst_picture;
 | 
			
		||||
static uint8_t *video_outbuf;
 | 
			
		||||
static int frame_count, video_outbuf_size;
 | 
			
		||||
 | 
			
		||||
/* Add a video output stream. */
 | 
			
		||||
static AVStream *add_video_stream(AVFormatContext *oc, AVCodec **codec,
 | 
			
		||||
                                  enum AVCodecID codec_id)
 | 
			
		||||
{
 | 
			
		||||
    AVCodecContext *c;
 | 
			
		||||
    AVStream *st;
 | 
			
		||||
 | 
			
		||||
    /* find the video encoder */
 | 
			
		||||
    *codec = avcodec_find_encoder(codec_id);
 | 
			
		||||
    if (!(*codec)) {
 | 
			
		||||
        fprintf(stderr, "codec not found\n");
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    st = avformat_new_stream(oc, *codec);
 | 
			
		||||
    if (!st) {
 | 
			
		||||
        fprintf(stderr, "Could not alloc stream\n");
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    c = st->codec;
 | 
			
		||||
 | 
			
		||||
    avcodec_get_context_defaults3(c, *codec);
 | 
			
		||||
 | 
			
		||||
    c->codec_id = codec_id;
 | 
			
		||||
 | 
			
		||||
    /* Put sample parameters. */
 | 
			
		||||
    c->bit_rate = 400000;
 | 
			
		||||
    /* Resolution must be a multiple of two. */
 | 
			
		||||
    c->width    = 352;
 | 
			
		||||
    c->height   = 288;
 | 
			
		||||
    /* timebase: This is the fundamental unit of time (in seconds) in terms
 | 
			
		||||
     * of which frame timestamps are represented. For fixed-fps content,
 | 
			
		||||
     * timebase should be 1/framerate and timestamp increments should be
 | 
			
		||||
     * identical to 1. */
 | 
			
		||||
    c->time_base.den = STREAM_FRAME_RATE;
 | 
			
		||||
    c->time_base.num = 1;
 | 
			
		||||
    c->gop_size      = 12; /* emit one intra frame every twelve frames at most */
 | 
			
		||||
    c->pix_fmt       = STREAM_PIX_FMT;
 | 
			
		||||
    if (c->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
 | 
			
		||||
        /* just for testing, we also add B frames */
 | 
			
		||||
        c->max_b_frames = 2;
 | 
			
		||||
    }
 | 
			
		||||
    if (c->codec_id == AV_CODEC_ID_MPEG1VIDEO) {
 | 
			
		||||
        /* Needed to avoid using macroblocks in which some coeffs overflow.
 | 
			
		||||
         * This does not happen with normal video, it just happens here as
 | 
			
		||||
         * the motion of the chroma plane does not match the luma plane. */
 | 
			
		||||
        c->mb_decision = 2;
 | 
			
		||||
    }
 | 
			
		||||
    /* Some formats want stream headers to be separate. */
 | 
			
		||||
    if (oc->oformat->flags & AVFMT_GLOBALHEADER)
 | 
			
		||||
        c->flags |= CODEC_FLAG_GLOBAL_HEADER;
 | 
			
		||||
 | 
			
		||||
    return st;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void open_video(AVFormatContext *oc, AVCodec *codec, AVStream *st)
 | 
			
		||||
{
 | 
			
		||||
    int ret;
 | 
			
		||||
    AVCodecContext *c = st->codec;
 | 
			
		||||
 | 
			
		||||
    /* open the codec */
 | 
			
		||||
    if (avcodec_open2(c, codec, NULL) < 0) {
 | 
			
		||||
        fprintf(stderr, "Could not open codec\n");
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    video_outbuf = NULL;
 | 
			
		||||
    if (!(oc->oformat->flags & AVFMT_RAWPICTURE)) {
 | 
			
		||||
        /* Allocate output buffer. */
 | 
			
		||||
        /* XXX: API change will be done. */
 | 
			
		||||
        /* Buffers passed into lav* can be allocated any way you prefer,
 | 
			
		||||
         * as long as they're aligned enough for the architecture, and
 | 
			
		||||
         * they're freed appropriately (such as using av_free for buffers
 | 
			
		||||
         * allocated with av_malloc). */
 | 
			
		||||
        video_outbuf_size = 200000;
 | 
			
		||||
        video_outbuf      = av_malloc(video_outbuf_size);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* allocate and init a re-usable frame */
 | 
			
		||||
    frame = avcodec_alloc_frame();
 | 
			
		||||
    if (!frame) {
 | 
			
		||||
        fprintf(stderr, "Could not allocate video frame\n");
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* Allocate the encoded raw picture. */
 | 
			
		||||
    ret = avpicture_alloc(&dst_picture, c->pix_fmt, c->width, c->height);
 | 
			
		||||
    if (ret < 0) {
 | 
			
		||||
        fprintf(stderr, "Could not allocate picture\n");
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* If the output format is not YUV420P, then a temporary YUV420P
 | 
			
		||||
     * picture is needed too. It is then converted to the required
 | 
			
		||||
     * output format. */
 | 
			
		||||
    if (c->pix_fmt != PIX_FMT_YUV420P) {
 | 
			
		||||
        ret = avpicture_alloc(&src_picture, PIX_FMT_YUV420P, c->width, c->height);
 | 
			
		||||
        if (ret < 0) {
 | 
			
		||||
            fprintf(stderr, "Could not allocate temporary picture\n");
 | 
			
		||||
            exit(1);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* copy data and linesize picture pointers to frame */
 | 
			
		||||
    *((AVPicture *)frame) = dst_picture;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Prepare a dummy image. */
 | 
			
		||||
static void fill_yuv_image(AVPicture *pict, int frame_index,
 | 
			
		||||
                           int width, int height)
 | 
			
		||||
{
 | 
			
		||||
    int x, y, i;
 | 
			
		||||
 | 
			
		||||
    i = frame_index;
 | 
			
		||||
 | 
			
		||||
    /* Y */
 | 
			
		||||
    for (y = 0; y < height; y++)
 | 
			
		||||
        for (x = 0; x < width; x++)
 | 
			
		||||
            pict->data[0][y * pict->linesize[0] + x] = x + y + i * 3;
 | 
			
		||||
 | 
			
		||||
    /* Cb and Cr */
 | 
			
		||||
    for (y = 0; y < height / 2; y++) {
 | 
			
		||||
        for (x = 0; x < width / 2; x++) {
 | 
			
		||||
            pict->data[1][y * pict->linesize[1] + x] = 128 + y + i * 2;
 | 
			
		||||
            pict->data[2][y * pict->linesize[2] + x] = 64 + x + i * 5;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void write_video_frame(AVFormatContext *oc, AVStream *st)
 | 
			
		||||
{
 | 
			
		||||
    int ret;
 | 
			
		||||
    static struct SwsContext *sws_ctx;
 | 
			
		||||
    AVCodecContext *c = st->codec;
 | 
			
		||||
 | 
			
		||||
    if (frame_count >= STREAM_NB_FRAMES) {
 | 
			
		||||
        /* No more frames to compress. The codec has a latency of a few
 | 
			
		||||
         * frames if using B-frames, so we get the last frames by
 | 
			
		||||
         * passing the same picture again. */
 | 
			
		||||
    } else {
 | 
			
		||||
        if (c->pix_fmt != PIX_FMT_YUV420P) {
 | 
			
		||||
            /* as we only generate a YUV420P picture, we must convert it
 | 
			
		||||
             * to the codec pixel format if needed */
 | 
			
		||||
            if (!sws_ctx) {
 | 
			
		||||
                sws_ctx = sws_getContext(c->width, c->height, PIX_FMT_YUV420P,
 | 
			
		||||
                                         c->width, c->height, c->pix_fmt,
 | 
			
		||||
                                         sws_flags, NULL, NULL, NULL);
 | 
			
		||||
                if (!sws_ctx) {
 | 
			
		||||
                    fprintf(stderr,
 | 
			
		||||
                            "Could not initialize the conversion context\n");
 | 
			
		||||
                    exit(1);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            fill_yuv_image(&src_picture, frame_count, c->width, c->height);
 | 
			
		||||
            sws_scale(sws_ctx,
 | 
			
		||||
                      (const uint8_t * const *)src_picture.data, src_picture.linesize,
 | 
			
		||||
                      0, c->height, dst_picture.data, dst_picture.linesize);
 | 
			
		||||
        } else {
 | 
			
		||||
            fill_yuv_image(&dst_picture, frame_count, c->width, c->height);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (oc->oformat->flags & AVFMT_RAWPICTURE) {
 | 
			
		||||
        /* Raw video case - the API will change slightly in the near
 | 
			
		||||
         * future for that. */
 | 
			
		||||
        AVPacket pkt;
 | 
			
		||||
        av_init_packet(&pkt);
 | 
			
		||||
 | 
			
		||||
        pkt.flags        |= AV_PKT_FLAG_KEY;
 | 
			
		||||
        pkt.stream_index  = st->index;
 | 
			
		||||
        pkt.data          = dst_picture.data[0];
 | 
			
		||||
        pkt.size          = sizeof(AVPicture);
 | 
			
		||||
 | 
			
		||||
        ret = av_interleaved_write_frame(oc, &pkt);
 | 
			
		||||
    } else {
 | 
			
		||||
        /* encode the image */
 | 
			
		||||
        AVPacket pkt;
 | 
			
		||||
        int got_output;
 | 
			
		||||
 | 
			
		||||
        av_init_packet(&pkt);
 | 
			
		||||
        pkt.data = NULL;    // packet data will be allocated by the encoder
 | 
			
		||||
        pkt.size = 0;
 | 
			
		||||
 | 
			
		||||
        ret = avcodec_encode_video2(c, &pkt, frame, &got_output);
 | 
			
		||||
        if (ret < 0) {
 | 
			
		||||
            fprintf(stderr, "Error encoding video frame\n");
 | 
			
		||||
            exit(1);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /* If size is zero, it means the image was buffered. */
 | 
			
		||||
        if (got_output) {
 | 
			
		||||
            if (c->coded_frame->pts != AV_NOPTS_VALUE)
 | 
			
		||||
                pkt.pts = av_rescale_q(c->coded_frame->pts,
 | 
			
		||||
                                       c->time_base, st->time_base);
 | 
			
		||||
            if (c->coded_frame->key_frame)
 | 
			
		||||
                pkt.flags |= AV_PKT_FLAG_KEY;
 | 
			
		||||
 | 
			
		||||
            pkt.stream_index = st->index;
 | 
			
		||||
 | 
			
		||||
            /* Write the compressed frame to the media file. */
 | 
			
		||||
            ret = av_interleaved_write_frame(oc, &pkt);
 | 
			
		||||
        } else {
 | 
			
		||||
            ret = 0;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    if (ret != 0) {
 | 
			
		||||
        fprintf(stderr, "Error while writing video frame\n");
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
    frame_count++;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void close_video(AVFormatContext *oc, AVStream *st)
 | 
			
		||||
{
 | 
			
		||||
    avcodec_close(st->codec);
 | 
			
		||||
    av_free(src_picture.data[0]);
 | 
			
		||||
    av_free(dst_picture.data[0]);
 | 
			
		||||
    av_free(frame);
 | 
			
		||||
    av_free(video_outbuf);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**************************************************************/
 | 
			
		||||
/* media file output */
 | 
			
		||||
 | 
			
		||||
int main(int argc, char **argv)
 | 
			
		||||
{
 | 
			
		||||
    const char *filename;
 | 
			
		||||
    AVOutputFormat *fmt;
 | 
			
		||||
    AVFormatContext *oc;
 | 
			
		||||
    AVStream *audio_st, *video_st;
 | 
			
		||||
    AVCodec *audio_codec, *video_codec;
 | 
			
		||||
    double audio_pts, video_pts;
 | 
			
		||||
    int i;
 | 
			
		||||
 | 
			
		||||
    /* Initialize libavcodec, and register all codecs and formats. */
 | 
			
		||||
    av_register_all();
 | 
			
		||||
 | 
			
		||||
    if (argc != 2) {
 | 
			
		||||
        printf("usage: %s output_file\n"
 | 
			
		||||
               "API example program to output a media file with libavformat.\n"
 | 
			
		||||
               "The output format is automatically guessed according to the file extension.\n"
 | 
			
		||||
               "Raw images can also be output by using '%%d' in the filename\n"
 | 
			
		||||
               "\n", argv[0]);
 | 
			
		||||
        return 1;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    filename = argv[1];
 | 
			
		||||
 | 
			
		||||
    /* allocate the output media context */
 | 
			
		||||
    avformat_alloc_output_context2(&oc, NULL, NULL, filename);
 | 
			
		||||
    if (!oc) {
 | 
			
		||||
        printf("Could not deduce output format from file extension: using MPEG.\n");
 | 
			
		||||
        avformat_alloc_output_context2(&oc, NULL, "mpeg", filename);
 | 
			
		||||
    }
 | 
			
		||||
    if (!oc) {
 | 
			
		||||
        return 1;
 | 
			
		||||
    }
 | 
			
		||||
    fmt = oc->oformat;
 | 
			
		||||
 | 
			
		||||
    /* Add the audio and video streams using the default format codecs
 | 
			
		||||
     * and initialize the codecs. */
 | 
			
		||||
    video_st = NULL;
 | 
			
		||||
    audio_st = NULL;
 | 
			
		||||
    if (fmt->video_codec != AV_CODEC_ID_NONE) {
 | 
			
		||||
        video_st = add_video_stream(oc, &video_codec, fmt->video_codec);
 | 
			
		||||
    }
 | 
			
		||||
    if (fmt->audio_codec != AV_CODEC_ID_NONE) {
 | 
			
		||||
        audio_st = add_audio_stream(oc, &audio_codec, fmt->audio_codec);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* Now that all the parameters are set, we can open the audio and
 | 
			
		||||
     * video codecs and allocate the necessary encode buffers. */
 | 
			
		||||
    if (video_st)
 | 
			
		||||
        open_video(oc, video_codec, video_st);
 | 
			
		||||
    if (audio_st)
 | 
			
		||||
        open_audio(oc, audio_codec, audio_st);
 | 
			
		||||
 | 
			
		||||
    av_dump_format(oc, 0, filename, 1);
 | 
			
		||||
 | 
			
		||||
    /* open the output file, if needed */
 | 
			
		||||
    if (!(fmt->flags & AVFMT_NOFILE)) {
 | 
			
		||||
        if (avio_open(&oc->pb, filename, AVIO_FLAG_WRITE) < 0) {
 | 
			
		||||
            fprintf(stderr, "Could not open '%s'\n", filename);
 | 
			
		||||
            return 1;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* Write the stream header, if any. */
 | 
			
		||||
    if (avformat_write_header(oc, NULL) < 0) {
 | 
			
		||||
        fprintf(stderr, "Error occurred when opening output file\n");
 | 
			
		||||
        return 1;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    frame->pts = 0;
 | 
			
		||||
    for (;;) {
 | 
			
		||||
        /* Compute current audio and video time. */
 | 
			
		||||
        if (audio_st)
 | 
			
		||||
            audio_pts = (double)audio_st->pts.val * audio_st->time_base.num / audio_st->time_base.den;
 | 
			
		||||
        else
 | 
			
		||||
            audio_pts = 0.0;
 | 
			
		||||
 | 
			
		||||
        if (video_st)
 | 
			
		||||
            video_pts = (double)video_st->pts.val * video_st->time_base.num /
 | 
			
		||||
                        video_st->time_base.den;
 | 
			
		||||
        else
 | 
			
		||||
            video_pts = 0.0;
 | 
			
		||||
 | 
			
		||||
        if ((!audio_st || audio_pts >= STREAM_DURATION) &&
 | 
			
		||||
            (!video_st || video_pts >= STREAM_DURATION))
 | 
			
		||||
            break;
 | 
			
		||||
 | 
			
		||||
        /* write interleaved audio and video frames */
 | 
			
		||||
        if (!video_st || (video_st && audio_st && audio_pts < video_pts)) {
 | 
			
		||||
            write_audio_frame(oc, audio_st);
 | 
			
		||||
        } else {
 | 
			
		||||
            write_video_frame(oc, video_st);
 | 
			
		||||
            frame->pts++;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* Write the trailer, if any. The trailer must be written before you
 | 
			
		||||
     * close the CodecContexts open when you wrote the header; otherwise
 | 
			
		||||
     * av_write_trailer() may try to use memory that was freed on
 | 
			
		||||
     * av_codec_close(). */
 | 
			
		||||
    av_write_trailer(oc);
 | 
			
		||||
 | 
			
		||||
    /* Close each codec. */
 | 
			
		||||
    if (video_st)
 | 
			
		||||
        close_video(oc, video_st);
 | 
			
		||||
    if (audio_st)
 | 
			
		||||
        close_audio(oc, audio_st);
 | 
			
		||||
 | 
			
		||||
    /* Free the streams. */
 | 
			
		||||
    for (i = 0; i < oc->nb_streams; i++) {
 | 
			
		||||
        av_freep(&oc->streams[i]->codec);
 | 
			
		||||
        av_freep(&oc->streams[i]);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (!(fmt->flags & AVFMT_NOFILE))
 | 
			
		||||
        /* Close the output file. */
 | 
			
		||||
        avio_close(oc->pb);
 | 
			
		||||
 | 
			
		||||
    /* free the stream */
 | 
			
		||||
    av_free(oc);
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
@@ -1,142 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (c) 2012 Stefano Sabatini
 | 
			
		||||
 *
 | 
			
		||||
 * 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
 | 
			
		||||
 * libswscale API use example.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <libavutil/imgutils.h>
 | 
			
		||||
#include <libavutil/parseutils.h>
 | 
			
		||||
#include <libswscale/swscale.h>
 | 
			
		||||
 | 
			
		||||
static void fill_yuv_image(uint8_t *data[4], int linesize[4],
 | 
			
		||||
                           int width, int height, int frame_index)
 | 
			
		||||
{
 | 
			
		||||
    int x, y, i;
 | 
			
		||||
 | 
			
		||||
    i = frame_index;
 | 
			
		||||
 | 
			
		||||
    /* Y */
 | 
			
		||||
    for (y = 0; y < height; y++)
 | 
			
		||||
        for (x = 0; x < width; x++)
 | 
			
		||||
            data[0][y * linesize[0] + x] = x + y + i * 3;
 | 
			
		||||
 | 
			
		||||
    /* Cb and Cr */
 | 
			
		||||
    for (y = 0; y < height / 2; y++) {
 | 
			
		||||
        for (x = 0; x < width / 2; x++) {
 | 
			
		||||
            data[1][y * linesize[1] + x] = 128 + y + i * 2;
 | 
			
		||||
            data[2][y * linesize[2] + x] = 64 + x + i * 5;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int main(int argc, char **argv)
 | 
			
		||||
{
 | 
			
		||||
    uint8_t *src_data[4], *dst_data[4];
 | 
			
		||||
    int src_linesize[4], dst_linesize[4];
 | 
			
		||||
    int src_w = 320, src_h = 240, dst_w, dst_h;
 | 
			
		||||
    enum PixelFormat src_pix_fmt = PIX_FMT_YUV420P, dst_pix_fmt = PIX_FMT_RGB24;
 | 
			
		||||
    const char *dst_size = NULL;
 | 
			
		||||
    const char *dst_filename = NULL;
 | 
			
		||||
    FILE *dst_file;
 | 
			
		||||
    int dst_bufsize;
 | 
			
		||||
    struct SwsContext *sws_ctx;
 | 
			
		||||
    int i, ret;
 | 
			
		||||
 | 
			
		||||
    if (argc != 3) {
 | 
			
		||||
        fprintf(stderr, "Usage: %s output_file output_size\n"
 | 
			
		||||
                "API example program to show how to scale an image with libswscale.\n"
 | 
			
		||||
                "This program generates a series of pictures, rescales them to the given "
 | 
			
		||||
                "output_size and saves them to an output file named output_file\n."
 | 
			
		||||
                "\n", argv[0]);
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
    dst_filename = argv[1];
 | 
			
		||||
    dst_size     = argv[2];
 | 
			
		||||
 | 
			
		||||
    if (av_parse_video_size(&dst_w, &dst_h, dst_size) < 0) {
 | 
			
		||||
        fprintf(stderr,
 | 
			
		||||
                "Invalid size '%s', must be in the form WxH or a valid size abbreviation\n",
 | 
			
		||||
                dst_size);
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    dst_file = fopen(dst_filename, "wb");
 | 
			
		||||
    if (!dst_file) {
 | 
			
		||||
        fprintf(stderr, "Could not open destination file %s\n", dst_filename);
 | 
			
		||||
        exit(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* create scaling context */
 | 
			
		||||
    sws_ctx = sws_getContext(src_w, src_h, src_pix_fmt,
 | 
			
		||||
                             dst_w, dst_h, dst_pix_fmt,
 | 
			
		||||
                             SWS_BILINEAR, NULL, NULL, NULL);
 | 
			
		||||
    if (!sws_ctx) {
 | 
			
		||||
        fprintf(stderr,
 | 
			
		||||
                "Impossible to create scale context for the conversion "
 | 
			
		||||
                "fmt:%s s:%dx%d -> fmt:%s s:%dx%d\n",
 | 
			
		||||
                av_get_pix_fmt_name(src_pix_fmt), src_w, src_h,
 | 
			
		||||
                av_get_pix_fmt_name(dst_pix_fmt), dst_w, dst_h);
 | 
			
		||||
        ret = AVERROR(EINVAL);
 | 
			
		||||
        goto end;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* allocate source and destination image buffers */
 | 
			
		||||
    if ((ret = av_image_alloc(src_data, src_linesize,
 | 
			
		||||
                              src_w, src_h, src_pix_fmt, 16)) < 0) {
 | 
			
		||||
        fprintf(stderr, "Could not allocate source image\n");
 | 
			
		||||
        goto end;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* buffer is going to be written to rawvideo file, no alignmnet */
 | 
			
		||||
    if ((ret = av_image_alloc(dst_data, dst_linesize,
 | 
			
		||||
                              dst_w, dst_h, dst_pix_fmt, 1)) < 0) {
 | 
			
		||||
        fprintf(stderr, "Could not allocate destination image\n");
 | 
			
		||||
        goto end;
 | 
			
		||||
    }
 | 
			
		||||
    dst_bufsize = ret;
 | 
			
		||||
 | 
			
		||||
    for (i = 0; i < 100; i++) {
 | 
			
		||||
        /* generate synthetic video */
 | 
			
		||||
        fill_yuv_image(src_data, src_linesize, src_w, src_h, i);
 | 
			
		||||
 | 
			
		||||
        /* convert to destination format */
 | 
			
		||||
        sws_scale(sws_ctx, (const uint8_t * const*)src_data,
 | 
			
		||||
                  src_linesize, 0, src_h, dst_data, dst_linesize);
 | 
			
		||||
 | 
			
		||||
        /* write scaled image to file */
 | 
			
		||||
        fwrite(dst_data[0], 1, dst_bufsize, dst_file);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    fprintf(stderr, "Scaling succeeded. Play the output file with the command:\n"
 | 
			
		||||
           "ffplay -f rawvideo -pix_fmt %s -video_size %dx%d %s\n",
 | 
			
		||||
           av_get_pix_fmt_name(dst_pix_fmt), dst_w, dst_h, dst_filename);
 | 
			
		||||
 | 
			
		||||
end:
 | 
			
		||||
    if (dst_file)
 | 
			
		||||
        fclose(dst_file);
 | 
			
		||||
    av_freep(&src_data[0]);
 | 
			
		||||
    av_freep(&dst_data[0]);
 | 
			
		||||
    sws_freeContext(sws_ctx);
 | 
			
		||||
    return ret < 0;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										390
									
								
								doc/faq.texi
									
									
									
									
									
								
							
							
						
						
									
										390
									
								
								doc/faq.texi
									
									
									
									
									
								
							@@ -2,15 +2,29 @@
 | 
			
		||||
 | 
			
		||||
@settitle FFmpeg FAQ
 | 
			
		||||
@titlepage
 | 
			
		||||
@sp 7
 | 
			
		||||
@center @titlefont{FFmpeg FAQ}
 | 
			
		||||
@sp 3
 | 
			
		||||
@end titlepage
 | 
			
		||||
 | 
			
		||||
@top
 | 
			
		||||
 | 
			
		||||
@contents
 | 
			
		||||
 | 
			
		||||
@chapter General Questions
 | 
			
		||||
 | 
			
		||||
@section When will the next FFmpeg version be released? / Why are FFmpeg releases so few and far between?
 | 
			
		||||
 | 
			
		||||
Like most open source projects FFmpeg suffers from a certain lack of
 | 
			
		||||
manpower. For this reason the developers have to prioritize the work
 | 
			
		||||
they do and putting out releases is not at the top of the list, fixing
 | 
			
		||||
bugs and reviewing patches takes precedence. Please don't complain or
 | 
			
		||||
request more timely and/or frequent releases unless you are willing to
 | 
			
		||||
help out creating them.
 | 
			
		||||
 | 
			
		||||
@section I have a problem with an old version of FFmpeg; where should I report it?
 | 
			
		||||
Nowhere. Upgrade to the latest release or if there is no recent release upgrade
 | 
			
		||||
to Subversion HEAD. You could also try to report it. Maybe you will get lucky and
 | 
			
		||||
become the first person in history to get an answer different from "upgrade
 | 
			
		||||
to Subversion HEAD".
 | 
			
		||||
 | 
			
		||||
@section Why doesn't FFmpeg support feature [xyz]?
 | 
			
		||||
 | 
			
		||||
Because no one has taken on that task yet. FFmpeg development is
 | 
			
		||||
@@ -24,6 +38,30 @@ No. Windows DLLs are not portable, bloated and often slow.
 | 
			
		||||
Moreover FFmpeg strives to support all codecs natively.
 | 
			
		||||
A DLL loader is not conducive to that goal.
 | 
			
		||||
 | 
			
		||||
@section My bug report/mail to ffmpeg-devel/user has not received any replies.
 | 
			
		||||
 | 
			
		||||
Likely reasons
 | 
			
		||||
@itemize
 | 
			
		||||
@item We are busy and haven't had time yet to read your report or
 | 
			
		||||
investigate the issue.
 | 
			
		||||
@item You didn't follow bugreports.html.
 | 
			
		||||
@item You didn't use Subversion HEAD.
 | 
			
		||||
@item You reported a segmentation fault without gdb output.
 | 
			
		||||
@item You describe a problem but not how to reproduce it.
 | 
			
		||||
@item It's unclear if you use ffmpeg as command line tool or use
 | 
			
		||||
libav* from another application.
 | 
			
		||||
@item You speak about a video having problems on playback but
 | 
			
		||||
not what you use to play it.
 | 
			
		||||
@item We have no faint clue what you are talking about besides
 | 
			
		||||
that it is related to FFmpeg.
 | 
			
		||||
@end itemize
 | 
			
		||||
 | 
			
		||||
@section Is there a forum for FFmpeg? I do not like mailing lists.
 | 
			
		||||
 | 
			
		||||
You may view our mailing lists with a more forum-alike look here:
 | 
			
		||||
@url{http://dir.gmane.org/gmane.comp.video.ffmpeg.user},
 | 
			
		||||
but, if you post, please remember that our mailing list rules still apply there.
 | 
			
		||||
 | 
			
		||||
@section I cannot read this file although this format seems to be supported by ffmpeg.
 | 
			
		||||
 | 
			
		||||
Even if ffmpeg can read the container format, it may not support all its
 | 
			
		||||
@@ -47,7 +85,7 @@ The following list of video codecs should work on most Windows systems:
 | 
			
		||||
.asf only
 | 
			
		||||
@item mpeg4
 | 
			
		||||
Only if you have some MPEG-4 codec like ffdshow or Xvid installed.
 | 
			
		||||
@item mpeg1video
 | 
			
		||||
@item mpeg1
 | 
			
		||||
.mpg only
 | 
			
		||||
@end table
 | 
			
		||||
Note, ASF files often have .wmv or .wma extensions in Windows. It should also
 | 
			
		||||
@@ -59,9 +97,9 @@ The following list of audio codecs should work on most Windows systems:
 | 
			
		||||
@table @option
 | 
			
		||||
@item adpcm_ima_wav
 | 
			
		||||
@item adpcm_ms
 | 
			
		||||
@item pcm_s16le
 | 
			
		||||
@item pcm
 | 
			
		||||
always
 | 
			
		||||
@item libmp3lame
 | 
			
		||||
@item mp3
 | 
			
		||||
If some MP3 codec like LAME is installed.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@@ -83,8 +121,7 @@ problem and an NP-hard problem...
 | 
			
		||||
 | 
			
		||||
@section ffmpeg does not work; what is wrong?
 | 
			
		||||
 | 
			
		||||
Try a @code{make distclean} in the ffmpeg source directory before the build.
 | 
			
		||||
If this does not help see
 | 
			
		||||
Try a @code{make distclean} in the ffmpeg source directory before the build. If this does not help see
 | 
			
		||||
(@url{http://ffmpeg.org/bugreports.html}).
 | 
			
		||||
 | 
			
		||||
@section How do I encode single pictures into movies?
 | 
			
		||||
@@ -101,25 +138,6 @@ Notice that @samp{%d} is replaced by the image number.
 | 
			
		||||
 | 
			
		||||
@file{img%03d.jpg} means the sequence @file{img001.jpg}, @file{img002.jpg}, etc...
 | 
			
		||||
 | 
			
		||||
If you have large number of pictures to rename, you can use the
 | 
			
		||||
following command to ease the burden. The command, using the bourne
 | 
			
		||||
shell syntax, symbolically links all files in the current directory
 | 
			
		||||
that match @code{*jpg} to the @file{/tmp} directory in the sequence of
 | 
			
		||||
@file{img001.jpg}, @file{img002.jpg} and so on.
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
  x=1; for i in *jpg; do counter=$(printf %03d $x); ln -s "$i" /tmp/img"$counter".jpg; x=$(($x+1)); done
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
If you want to sequence them by oldest modified first, substitute
 | 
			
		||||
@code{$(ls -r -t *jpg)} in place of @code{*jpg}.
 | 
			
		||||
 | 
			
		||||
Then run:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
  ffmpeg -f image2 -i /tmp/img%03d.jpg /tmp/a.mpg
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
The same logic is used for any image format that ffmpeg reads.
 | 
			
		||||
 | 
			
		||||
@section How do I encode movie to single pictures?
 | 
			
		||||
@@ -135,15 +153,15 @@ The @file{movie.mpg} used as input will be converted to
 | 
			
		||||
 | 
			
		||||
Instead of relying on file format self-recognition, you may also use
 | 
			
		||||
@table @option
 | 
			
		||||
@item -c:v ppm
 | 
			
		||||
@item -c:v png
 | 
			
		||||
@item -c:v mjpeg
 | 
			
		||||
@item -vcodec ppm
 | 
			
		||||
@item -vcodec png
 | 
			
		||||
@item -vcodec mjpeg
 | 
			
		||||
@end table
 | 
			
		||||
to force the encoding.
 | 
			
		||||
 | 
			
		||||
Applying that to the previous example:
 | 
			
		||||
@example
 | 
			
		||||
  ffmpeg -i movie.mpg -f image2 -c:v mjpeg menu%d.jpg
 | 
			
		||||
  ffmpeg -i movie.mpg -f image2 -vcodec mjpeg menu%d.jpg
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Beware that there is no "jpeg" codec. Use "mjpeg" instead.
 | 
			
		||||
@@ -158,28 +176,87 @@ quite logical that there is a small reduction of quality. This is not a bug.
 | 
			
		||||
 | 
			
		||||
Use @file{-} as file name.
 | 
			
		||||
 | 
			
		||||
@section Why does FFmpeg not decode audio in VOB files?
 | 
			
		||||
 | 
			
		||||
The audio is AC-3 (a.k.a. A/52). AC-3 decoding is an optional component in FFmpeg
 | 
			
		||||
as the component that handles AC-3 decoding is currently released under the GPL.
 | 
			
		||||
Enable AC-3 decoding with @code{./configure --enable-gpl}. Take care: By
 | 
			
		||||
enabling AC-3, you automatically change the license of libavcodec from
 | 
			
		||||
LGPL to GPL.
 | 
			
		||||
 | 
			
		||||
@section Why does the chrominance data seem to be sampled at a different time from the luminance data on bt8x8 captures on Linux?
 | 
			
		||||
 | 
			
		||||
This is a well-known bug in the bt8x8 driver. For 2.4.26 there is a patch at
 | 
			
		||||
(@url{http://svn.ffmpeg.org/michael/trunk/patches/bttv-420-2.4.26.patch?view=co}). This may also
 | 
			
		||||
apply cleanly to other 2.4-series kernels.
 | 
			
		||||
 | 
			
		||||
@section How do I avoid the ugly aliasing artifacts in bt8x8 captures on Linux?
 | 
			
		||||
 | 
			
		||||
Pass 'combfilter=1 lumafilter=1' to the bttv driver. Note though that 'combfilter=1'
 | 
			
		||||
will cause somewhat too strong filtering. A fix is to apply (@url{http://svn.ffmpeg.org/michael/trunk/patches/bttv-comb-2.4.26.patch?view=co})
 | 
			
		||||
or (@url{http://svn.ffmpeg.org/michael/trunk/patches/bttv-comb-2.6.6.patch?view=co})
 | 
			
		||||
and pass 'combfilter=2'.
 | 
			
		||||
 | 
			
		||||
@section -f jpeg doesn't work.
 | 
			
		||||
 | 
			
		||||
Try '-f image2 test%d.jpg'.
 | 
			
		||||
 | 
			
		||||
@section Why can I not change the frame rate?
 | 
			
		||||
@section Why can I not change the framerate?
 | 
			
		||||
 | 
			
		||||
Some codecs, like MPEG-1/2, only allow a small number of fixed frame rates.
 | 
			
		||||
Choose a different codec with the -c:v command line option.
 | 
			
		||||
Some codecs, like MPEG-1/2, only allow a small number of fixed framerates.
 | 
			
		||||
Choose a different codec with the -vcodec command line option.
 | 
			
		||||
 | 
			
		||||
@section How do I encode Xvid or DivX video with ffmpeg?
 | 
			
		||||
 | 
			
		||||
Both Xvid and DivX (version 4+) are implementations of the ISO MPEG-4
 | 
			
		||||
standard (note that there are many other coding formats that use this
 | 
			
		||||
same standard). Thus, use '-c:v mpeg4' to encode in these formats. The
 | 
			
		||||
same standard). Thus, use '-vcodec mpeg4' to encode in these formats. The
 | 
			
		||||
default fourcc stored in an MPEG-4-coded file will be 'FMP4'. If you want
 | 
			
		||||
a different fourcc, use the '-vtag' option. E.g., '-vtag xvid' will
 | 
			
		||||
force the fourcc 'xvid' to be stored as the video fourcc rather than the
 | 
			
		||||
default.
 | 
			
		||||
 | 
			
		||||
@section How do I encode videos which play on the iPod?
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
@item needed stuff
 | 
			
		||||
-acodec libfaac -vcodec mpeg4 width<=320 height<=240
 | 
			
		||||
@item working stuff
 | 
			
		||||
4mv, title
 | 
			
		||||
@item non-working stuff
 | 
			
		||||
B-frames
 | 
			
		||||
@item example command line
 | 
			
		||||
ffmpeg -i input -acodec libfaac -ab 128kb -vcodec mpeg4 -b 1200kb -mbd 2 -flags +4mv -trellis 2 -aic 2 -cmp 2 -subcmp 2 -s 320x180 -title X output.mp4
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section How do I encode videos which play on the PSP?
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
@item needed stuff
 | 
			
		||||
-acodec libfaac -vcodec mpeg4 width*height<=76800 width%16=0 height%16=0 -ar 24000 -r 30000/1001 or 15000/1001 -f psp
 | 
			
		||||
@item working stuff
 | 
			
		||||
4mv, title
 | 
			
		||||
@item non-working stuff
 | 
			
		||||
B-frames
 | 
			
		||||
@item example command line
 | 
			
		||||
ffmpeg -i input -acodec libfaac -ab 128kb -vcodec mpeg4 -b 1200kb -ar 24000 -mbd 2 -flags +4mv -trellis 2 -aic 2 -cmp 2 -subcmp 2 -s 368x192 -r 30000/1001 -title X -f psp output.mp4
 | 
			
		||||
@item needed stuff for H.264
 | 
			
		||||
-acodec libfaac -vcodec libx264 width*height<=76800 width%16=0? height%16=0? -ar 48000 -coder 1 -r 30000/1001 or 15000/1001 -f psp
 | 
			
		||||
@item working stuff for H.264
 | 
			
		||||
title, loop filter
 | 
			
		||||
@item non-working stuff for H.264
 | 
			
		||||
CAVLC
 | 
			
		||||
@item example command line
 | 
			
		||||
ffmpeg -i input -acodec libfaac -ab 128kb -vcodec libx264 -b 1200kb -ar 48000 -mbd 2 -coder 1 -cmp 2 -subcmp 2 -s 368x192 -r 30000/1001 -title X -f psp -flags loop -trellis 2 -partitions parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 output.mp4
 | 
			
		||||
@item higher resolution for newer PSP firmwares, width<=480, height<=272
 | 
			
		||||
-vcodec libx264 -level 21 -coder 1 -f psp
 | 
			
		||||
@item example command line
 | 
			
		||||
ffmpeg -i input -acodec libfaac -ab 128kb -ac 2 -ar 48000 -vcodec libx264 -level 21 -b 640kb -coder 1 -f psp -flags +loop -trellis 2 -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -g 250 -s 480x272 output.mp4
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section Which are good parameters for encoding high quality MPEG-4?
 | 
			
		||||
 | 
			
		||||
'-mbd rd -flags +mv4+aic -trellis 2 -cmp 2 -subcmp 2 -g 300 -pass 1/2',
 | 
			
		||||
'-mbd rd -flags +4mv+aic -trellis 2 -cmp 2 -subcmp 2 -g 300 -pass 1/2',
 | 
			
		||||
things to try: '-bf 2', '-flags qprd', '-flags mv0', '-flags skiprd'.
 | 
			
		||||
 | 
			
		||||
@section Which are good parameters for encoding high quality MPEG-1/MPEG-2?
 | 
			
		||||
@@ -198,71 +275,24 @@ material, and try '-top 0/1' if the result looks really messed-up.
 | 
			
		||||
If you have built FFmpeg with @code{./configure --enable-avisynth}
 | 
			
		||||
(only possible on MinGW/Cygwin platforms),
 | 
			
		||||
then you may use any file that DirectShow can read as input.
 | 
			
		||||
(Be aware that this feature has been recently added,
 | 
			
		||||
so you will need to help yourself in case of problems.)
 | 
			
		||||
 | 
			
		||||
Just create an "input.avs" text file with this single line ...
 | 
			
		||||
@example
 | 
			
		||||
  DirectShowSource("C:\path to your file\yourfile.asf")
 | 
			
		||||
@end example
 | 
			
		||||
... and then feed that text file to ffmpeg:
 | 
			
		||||
... and then feed that text file to FFmpeg:
 | 
			
		||||
@example
 | 
			
		||||
  ffmpeg -i input.avs
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
For ANY other help on Avisynth, please visit the
 | 
			
		||||
@uref{http://www.avisynth.org/, Avisynth homepage}.
 | 
			
		||||
For ANY other help on Avisynth, please visit @url{http://www.avisynth.org/}.
 | 
			
		||||
 | 
			
		||||
@section How can I join video files?
 | 
			
		||||
 | 
			
		||||
To "join" video files is quite ambiguous. The following list explains the
 | 
			
		||||
different kinds of "joining" and points out how those are addressed in
 | 
			
		||||
FFmpeg. To join video files may mean:
 | 
			
		||||
 | 
			
		||||
@itemize
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
To put them one after the other: this is called to @emph{concatenate} them
 | 
			
		||||
(in short: concat) and is addressed
 | 
			
		||||
@ref{How can I concatenate video files, in this very faq}.
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
To put them together in the same file, to let the user choose between the
 | 
			
		||||
different versions (example: different audio languages): this is called to
 | 
			
		||||
@emph{multiplex} them together (in short: mux), and is done by simply
 | 
			
		||||
invoking ffmpeg with several @option{-i} options.
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
For audio, to put all channels together in a single stream (example: two
 | 
			
		||||
mono streams into one stereo stream): this is sometimes called to
 | 
			
		||||
@emph{merge} them, and can be done using the
 | 
			
		||||
@url{http://ffmpeg.org/ffmpeg.html#amerge, @code{amerge}} filter.
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
For audio, to play one on top of the other: this is called to @emph{mix}
 | 
			
		||||
them, and can be done by first merging them into a single stream and then
 | 
			
		||||
using the @url{http://ffmpeg.org/ffmpeg.html#pan, @code{pan}} filter to mix
 | 
			
		||||
the channels at will.
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
For video, to display both together, side by side or one on top of a part of
 | 
			
		||||
the other; it can be done using the
 | 
			
		||||
@url{http://ffmpeg.org/ffmpeg.html#overlay, @code{overlay}} video filter.
 | 
			
		||||
 | 
			
		||||
@end itemize
 | 
			
		||||
 | 
			
		||||
@anchor{How can I concatenate video files}
 | 
			
		||||
@section How can I concatenate video files?
 | 
			
		||||
 | 
			
		||||
There are several solutions, depending on the exact circumstances.
 | 
			
		||||
 | 
			
		||||
@subsection Concatenating using filters
 | 
			
		||||
 | 
			
		||||
FFmpeg has a @url{http://ffmpeg.org/ffmpeg.html#concat-1, @code{concat}}
 | 
			
		||||
filter designed specifically for that, with examples in the documentation.
 | 
			
		||||
 | 
			
		||||
@subsection Concatenating at the file level
 | 
			
		||||
 | 
			
		||||
A few multimedia containers (MPEG-1, MPEG-2 PS, DV) allow to concatenate
 | 
			
		||||
video by merely concatenating the files them.
 | 
			
		||||
A few multimedia containers (MPEG-1, MPEG-2 PS, DV) allow to join video files by
 | 
			
		||||
merely concatenating them.
 | 
			
		||||
 | 
			
		||||
Hence you may concatenate your multimedia files by first transcoding them to
 | 
			
		||||
these privileged formats, then using the humble @code{cat} command (or the
 | 
			
		||||
@@ -270,47 +300,32 @@ equally humble @code{copy} under Windows), and finally transcoding back to your
 | 
			
		||||
format of choice.
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i input1.avi -qscale:v 1 intermediate1.mpg
 | 
			
		||||
ffmpeg -i input2.avi -qscale:v 1 intermediate2.mpg
 | 
			
		||||
ffmpeg -i input1.avi -sameq intermediate1.mpg
 | 
			
		||||
ffmpeg -i input2.avi -sameq intermediate2.mpg
 | 
			
		||||
cat intermediate1.mpg intermediate2.mpg > intermediate_all.mpg
 | 
			
		||||
ffmpeg -i intermediate_all.mpg -qscale:v 2 output.avi
 | 
			
		||||
ffmpeg -i intermediate_all.mpg -sameq output.avi
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Additionally, you can use the @code{concat} protocol instead of @code{cat} or
 | 
			
		||||
@code{copy} which will avoid creation of a potentially huge intermediate file.
 | 
			
		||||
Notice that you should either use @code{-sameq} or set a reasonably high
 | 
			
		||||
bitrate for your intermediate and output files, if you want to preserve
 | 
			
		||||
video quality.
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i input1.avi -qscale:v 1 intermediate1.mpg
 | 
			
		||||
ffmpeg -i input2.avi -qscale:v 1 intermediate2.mpg
 | 
			
		||||
ffmpeg -i concat:"intermediate1.mpg|intermediate2.mpg" -c copy intermediate_all.mpg
 | 
			
		||||
ffmpeg -i intermediate_all.mpg -qscale:v 2 output.avi
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Note that you may need to escape the character "|" which is special for many
 | 
			
		||||
shells.
 | 
			
		||||
 | 
			
		||||
Another option is usage of named pipes, should your platform support it:
 | 
			
		||||
Also notice that you may avoid the huge intermediate files by taking advantage
 | 
			
		||||
of named pipes, should your platform support it:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
mkfifo intermediate1.mpg
 | 
			
		||||
mkfifo intermediate2.mpg
 | 
			
		||||
ffmpeg -i input1.avi -qscale:v 1 -y intermediate1.mpg < /dev/null &
 | 
			
		||||
ffmpeg -i input2.avi -qscale:v 1 -y intermediate2.mpg < /dev/null &
 | 
			
		||||
ffmpeg -i input1.avi -sameq -y intermediate1.mpg < /dev/null &
 | 
			
		||||
ffmpeg -i input2.avi -sameq -y intermediate2.mpg < /dev/null &
 | 
			
		||||
cat intermediate1.mpg intermediate2.mpg |\
 | 
			
		||||
ffmpeg -f mpeg -i - -qscale:v 2 -c:v mpeg4 -acodec libmp3lame -q:a 4 output.avi
 | 
			
		||||
ffmpeg -f mpeg -i - -sameq -vcodec mpeg4 -acodec libmp3lame output.avi
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@subsection Concatenating using raw audio and video
 | 
			
		||||
 | 
			
		||||
Similarly, the yuv4mpegpipe format, and the raw video, raw audio codecs also
 | 
			
		||||
allow concatenation, and the transcoding step is almost lossless.
 | 
			
		||||
When using multiple yuv4mpegpipe(s), the first line needs to be discarded
 | 
			
		||||
from all but the first stream. This can be accomplished by piping through
 | 
			
		||||
@code{tail} as seen below. Note that when piping through @code{tail} you
 | 
			
		||||
must use command grouping, @code{@{  ;@}}, to background properly.
 | 
			
		||||
 | 
			
		||||
For example, let's say we want to concatenate two FLV files into an
 | 
			
		||||
output.flv file:
 | 
			
		||||
For example, let's say we want to join two FLV files into an output.flv file:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
mkfifo temp1.a
 | 
			
		||||
@@ -322,81 +337,38 @@ mkfifo all.v
 | 
			
		||||
ffmpeg -i input1.flv -vn -f u16le -acodec pcm_s16le -ac 2 -ar 44100 - > temp1.a < /dev/null &
 | 
			
		||||
ffmpeg -i input2.flv -vn -f u16le -acodec pcm_s16le -ac 2 -ar 44100 - > temp2.a < /dev/null &
 | 
			
		||||
ffmpeg -i input1.flv -an -f yuv4mpegpipe - > temp1.v < /dev/null &
 | 
			
		||||
@{ ffmpeg -i input2.flv -an -f yuv4mpegpipe - < /dev/null | tail -n +2 > temp2.v ; @} &
 | 
			
		||||
ffmpeg -i input2.flv -an -f yuv4mpegpipe - > temp2.v < /dev/null &
 | 
			
		||||
cat temp1.a temp2.a > all.a &
 | 
			
		||||
cat temp1.v temp2.v > all.v &
 | 
			
		||||
ffmpeg -f u16le -acodec pcm_s16le -ac 2 -ar 44100 -i all.a \
 | 
			
		||||
       -f yuv4mpegpipe -i all.v \
 | 
			
		||||
       -qscale:v 2 -y output.flv
 | 
			
		||||
       -sameq -y output.flv
 | 
			
		||||
rm temp[12].[av] all.[av]
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@section -profile option fails when encoding H.264 video with AAC audio
 | 
			
		||||
@section FFmpeg does not adhere to the -maxrate setting, some frames are bigger than maxrate/fps.
 | 
			
		||||
 | 
			
		||||
@command{ffmpeg} prints an error like
 | 
			
		||||
Read the MPEG spec about video buffer verifier.
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
Undefined constant or missing '(' in 'baseline'
 | 
			
		||||
Unable to parse option value "baseline"
 | 
			
		||||
Error setting option profile to value baseline.
 | 
			
		||||
@end example
 | 
			
		||||
@section I want CBR, but no matter what I do frame sizes differ.
 | 
			
		||||
 | 
			
		||||
Short answer: write @option{-profile:v} instead of @option{-profile}.
 | 
			
		||||
You do not understand what CBR is, please read the MPEG spec.
 | 
			
		||||
Read about video buffer verifier and constant bitrate.
 | 
			
		||||
The one sentence summary is that there is a buffer and the input rate is
 | 
			
		||||
constant, the output can vary as needed.
 | 
			
		||||
 | 
			
		||||
Long answer: this happens because the @option{-profile} option can apply to both
 | 
			
		||||
video and audio.  Specifically the AAC encoder also defines some profiles, none
 | 
			
		||||
of which are named @var{baseline}.
 | 
			
		||||
@section How do I check if a stream is CBR?
 | 
			
		||||
 | 
			
		||||
The solution is to apply the @option{-profile} option to the video stream only
 | 
			
		||||
by using @url{http://ffmpeg.org/ffmpeg.html#Stream-specifiers-1, Stream specifiers}.
 | 
			
		||||
Appending @code{:v} to it will do exactly that.
 | 
			
		||||
To quote the MPEG-2 spec:
 | 
			
		||||
"There is no way to tell that a bitstream is constant bitrate without
 | 
			
		||||
examining all of the vbv_delay values and making complicated computations."
 | 
			
		||||
 | 
			
		||||
@section Using @option{-f lavfi}, audio becomes mono for no apparent reason.
 | 
			
		||||
 | 
			
		||||
Use @option{-dumpgraph -} to find out exactly where the channel layout is
 | 
			
		||||
lost.
 | 
			
		||||
 | 
			
		||||
Most likely, it is through @code{auto-inserted aconvert}. Try to understand
 | 
			
		||||
why the converting filter was needed at that place.
 | 
			
		||||
 | 
			
		||||
Just before the output is a likely place, as @option{-f lavfi} currently
 | 
			
		||||
only support packed S16.
 | 
			
		||||
 | 
			
		||||
Then insert the correct @code{aconvert} explicitly in the filter graph,
 | 
			
		||||
specifying the exact format.
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
aconvert=s16:stereo:packed
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@section Why does FFmpeg not see the subtitles in my VOB file?
 | 
			
		||||
 | 
			
		||||
VOB and a few other formats do not have a global header that describes
 | 
			
		||||
everything present in the file. Instead, applications are supposed to scan
 | 
			
		||||
the file to see what it contains. Since VOB files are frequently large, only
 | 
			
		||||
the beginning is scanned. If the subtitles happen only later in the file,
 | 
			
		||||
they will not be initally detected.
 | 
			
		||||
 | 
			
		||||
Some applications, including the @code{ffmpeg} command-line tool, can only
 | 
			
		||||
work with streams that were detected during the initial scan; streams that
 | 
			
		||||
are detected later are ignored.
 | 
			
		||||
 | 
			
		||||
The size of the initial scan is controlled by two options: @code{probesize}
 | 
			
		||||
(default ~5 Mo) and @code{analyzeduration} (default 5,000,000 µs = 5 s). For
 | 
			
		||||
the subtitle stream to be detected, both values must be large enough.
 | 
			
		||||
 | 
			
		||||
@chapter Development
 | 
			
		||||
 | 
			
		||||
@section Are there examples illustrating how to use the FFmpeg libraries, particularly libavcodec and libavformat?
 | 
			
		||||
 | 
			
		||||
Yes. Check the @file{doc/examples} directory in the source
 | 
			
		||||
repository, also available online at:
 | 
			
		||||
@url{https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples}.
 | 
			
		||||
 | 
			
		||||
Examples are also installed by default, usually in
 | 
			
		||||
@code{$PREFIX/share/ffmpeg/examples}.
 | 
			
		||||
 | 
			
		||||
Also you may read the Developers Guide of the FFmpeg documentation. Alternatively,
 | 
			
		||||
Yes. Read the Developers Guide of the FFmpeg documentation. Alternatively,
 | 
			
		||||
examine the source code for one of the many open source projects that
 | 
			
		||||
already incorporate FFmpeg at (@url{projects.html}).
 | 
			
		||||
 | 
			
		||||
@@ -438,44 +410,34 @@ the FFmpeg Windows Help Forum at
 | 
			
		||||
 | 
			
		||||
No. These tools are too bloated and they complicate the build.
 | 
			
		||||
 | 
			
		||||
@section Why not rewrite FFmpeg in object-oriented C++?
 | 
			
		||||
@section Why not rewrite ffmpeg in object-oriented C++?
 | 
			
		||||
 | 
			
		||||
FFmpeg is already organized in a highly modular manner and does not need to
 | 
			
		||||
be rewritten in a formal object language. Further, many of the developers
 | 
			
		||||
favor straight C; it works for them. For more arguments on this matter,
 | 
			
		||||
read @uref{http://www.tux.org/lkml/#s15, "Programming Religion"}.
 | 
			
		||||
read "Programming Religion" at (@url{http://www.tux.org/lkml/#s15}).
 | 
			
		||||
 | 
			
		||||
@section Why are the ffmpeg programs devoid of debugging symbols?
 | 
			
		||||
 | 
			
		||||
The build process creates ffmpeg_g, ffplay_g, etc. which contain full debug
 | 
			
		||||
information. Those binaries are stripped to create ffmpeg, ffplay, etc. If
 | 
			
		||||
you need the debug information, use the *_g versions.
 | 
			
		||||
you need the debug information, used the *_g versions.
 | 
			
		||||
 | 
			
		||||
@section I do not like the LGPL, can I contribute code under the GPL instead?
 | 
			
		||||
 | 
			
		||||
Yes, as long as the code is optional and can easily and cleanly be placed
 | 
			
		||||
under #if CONFIG_GPL without breaking anything. So, for example, a new codec
 | 
			
		||||
under #if CONFIG_GPL without breaking anything. So for example a new codec
 | 
			
		||||
or filter would be OK under GPL while a bug fix to LGPL code would not.
 | 
			
		||||
 | 
			
		||||
@section I'm using FFmpeg from within my C application but the linker complains about missing symbols from the libraries themselves.
 | 
			
		||||
@section I want to compile xyz.c alone but my compiler produced many errors.
 | 
			
		||||
 | 
			
		||||
FFmpeg builds static libraries by default. In static libraries, dependencies
 | 
			
		||||
are not handled. That has two consequences. First, you must specify the
 | 
			
		||||
libraries in dependency order: @code{-lavdevice} must come before
 | 
			
		||||
@code{-lavformat}, @code{-lavutil} must come after everything else, etc.
 | 
			
		||||
Second, external libraries that are used in FFmpeg have to be specified too.
 | 
			
		||||
Common code is in its own files in libav* and is used by the individual
 | 
			
		||||
codecs. They will not work without the common parts, you have to compile
 | 
			
		||||
the whole libav*. If you wish, disable some parts with configure switches.
 | 
			
		||||
You can also try to hack it and remove more, but if you had problems fixing
 | 
			
		||||
the compilation failure then you are probably not qualified for this.
 | 
			
		||||
 | 
			
		||||
An easy way to get the full list of required libraries in dependency order
 | 
			
		||||
is to use @code{pkg-config}.
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
  c99 -o program program.c $(pkg-config --cflags --libs libavformat libavcodec)
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
See @file{doc/example/Makefile} and @file{doc/example/pc-uninstalled} for
 | 
			
		||||
more details.
 | 
			
		||||
 | 
			
		||||
@section I'm using FFmpeg from within my C++ application but the linker complains about missing symbols which seem to be available.
 | 
			
		||||
@section I'm using libavcodec from within my C++ application but the linker complains about missing symbols which seem to be available.
 | 
			
		||||
 | 
			
		||||
FFmpeg is a pure C project, so to use the libraries within your C++ application
 | 
			
		||||
you need to explicitly state that you are using a C library. You can do this by
 | 
			
		||||
@@ -483,15 +445,23 @@ encompassing your FFmpeg includes using @code{extern "C"}.
 | 
			
		||||
 | 
			
		||||
See @url{http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html#faq-32.3}
 | 
			
		||||
 | 
			
		||||
@section I'm using libavutil from within my C++ application but the compiler complains about 'UINT64_C' was not declared in this scope
 | 
			
		||||
 | 
			
		||||
FFmpeg is a pure C project using C99 math features, in order to enable C++
 | 
			
		||||
to use them you have to append -D__STDC_CONSTANT_MACROS to your CXXFLAGS
 | 
			
		||||
 | 
			
		||||
@section I have a file in memory / a API different from *open/*read/ libc how do I use it with libavformat?
 | 
			
		||||
 | 
			
		||||
You have to implement a URLProtocol, see @file{libavformat/file.c} in
 | 
			
		||||
FFmpeg and @file{libmpdemux/demux_lavf.c} in MPlayer sources.
 | 
			
		||||
You have to implement a URLProtocol, see libavformat/file.c in FFmpeg
 | 
			
		||||
and libmpdemux/demux_lavf.c in MPlayer sources.
 | 
			
		||||
 | 
			
		||||
@section I get "No compatible shell script interpreter found." in MSys.
 | 
			
		||||
 | 
			
		||||
The standard MSys bash (2.04) is broken. You need to install 2.05 or later.
 | 
			
		||||
 | 
			
		||||
@section I get "./configure: line <xxx>: pr: command not found" in MSys.
 | 
			
		||||
 | 
			
		||||
The standard MSys install doesn't come with pr. You need to get it from the coreutils package.
 | 
			
		||||
 | 
			
		||||
@section I tried to pass RTP packets into a decoder, but it doesn't work.
 | 
			
		||||
 | 
			
		||||
RTP is a container format like any other, you must first depacketize the
 | 
			
		||||
codec frames/samples stored in RTP and then feed to the decoder.
 | 
			
		||||
 | 
			
		||||
@section Where can I find libav* headers for Pascal/Delphi?
 | 
			
		||||
 | 
			
		||||
@@ -499,7 +469,7 @@ see @url{http://www.iversenit.dk/dev/ffmpeg-headers/}
 | 
			
		||||
 | 
			
		||||
@section Where is the documentation about ffv1, msmpeg4, asv1, 4xm?
 | 
			
		||||
 | 
			
		||||
see @url{http://www.ffmpeg.org/~michael/}
 | 
			
		||||
see @url{http://svn.ffmpeg.org/michael/trunk/docs/}
 | 
			
		||||
 | 
			
		||||
@section How do I feed H.263-RTP (and other codecs in RTP) to libavcodec?
 | 
			
		||||
 | 
			
		||||
@@ -507,24 +477,12 @@ Even if peculiar since it is network oriented, RTP is a container like any
 | 
			
		||||
other. You have to @emph{demux} RTP before feeding the payload to libavcodec.
 | 
			
		||||
In this specific case please look at RFC 4629 to see how it should be done.
 | 
			
		||||
 | 
			
		||||
@section AVStream.r_frame_rate is wrong, it is much larger than the frame rate.
 | 
			
		||||
@section AVStream.r_frame_rate is wrong, it is much larger than the framerate.
 | 
			
		||||
 | 
			
		||||
r_frame_rate is NOT the average frame rate, it is the smallest frame rate
 | 
			
		||||
r_frame_rate is NOT the average framerate, it is the smallest framerate
 | 
			
		||||
that can accurately represent all timestamps. So no, it is not
 | 
			
		||||
wrong if it is larger than the average!
 | 
			
		||||
For example, if you have mixed 25 and 30 fps content, then r_frame_rate
 | 
			
		||||
will be 150.
 | 
			
		||||
 | 
			
		||||
@section Why is @code{make fate} not running all tests?
 | 
			
		||||
 | 
			
		||||
Make sure you have the fate-suite samples and the @code{SAMPLES} Make variable
 | 
			
		||||
or @code{FATE_SAMPLES} environment variable or the @code{--samples}
 | 
			
		||||
@command{configure} option is set to the right path.
 | 
			
		||||
 | 
			
		||||
@section Why is @code{make fate} not finding the samples?
 | 
			
		||||
 | 
			
		||||
Do you happen to have a @code{~} character in the samples path to indicate a
 | 
			
		||||
home directory? The value is used in ways where the shell cannot expand it,
 | 
			
		||||
causing FATE to not find files. Just replace @code{~} by the full path.
 | 
			
		||||
 | 
			
		||||
@bye
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										194
									
								
								doc/fate.texi
									
									
									
									
									
								
							
							
						
						
									
										194
									
								
								doc/fate.texi
									
									
									
									
									
								
							@@ -1,194 +0,0 @@
 | 
			
		||||
\input texinfo @c -*- texinfo -*-
 | 
			
		||||
 | 
			
		||||
@settitle FFmpeg Automated Testing Environment
 | 
			
		||||
@titlepage
 | 
			
		||||
@center @titlefont{FFmpeg Automated Testing Environment}
 | 
			
		||||
@end titlepage
 | 
			
		||||
 | 
			
		||||
@node Top
 | 
			
		||||
@top
 | 
			
		||||
 | 
			
		||||
@contents
 | 
			
		||||
 | 
			
		||||
@chapter Introduction
 | 
			
		||||
 | 
			
		||||
  FATE is an extended regression suite on the client-side and a means
 | 
			
		||||
for results aggregation and presentation on the server-side.
 | 
			
		||||
 | 
			
		||||
  The first part of this document explains how you can use FATE from
 | 
			
		||||
your FFmpeg source directory to test your ffmpeg binary. The second
 | 
			
		||||
part describes how you can run FATE to submit the results to FFmpeg's
 | 
			
		||||
FATE server.
 | 
			
		||||
 | 
			
		||||
  In any way you can have a look at the publicly viewable FATE results
 | 
			
		||||
by visiting this website:
 | 
			
		||||
 | 
			
		||||
  @url{http://fate.ffmpeg.org/}
 | 
			
		||||
 | 
			
		||||
  This is especially recommended for all people contributing source
 | 
			
		||||
code to FFmpeg, as it can be seen if some test on some platform broke
 | 
			
		||||
with there recent contribution. This usually happens on the platforms
 | 
			
		||||
the developers could not test on.
 | 
			
		||||
 | 
			
		||||
  The second part of this document describes how you can run FATE to
 | 
			
		||||
submit your results to FFmpeg's FATE server. If you want to submit your
 | 
			
		||||
results be sure to check that your combination of CPU, OS and compiler
 | 
			
		||||
is not already listed on the above mentioned website.
 | 
			
		||||
 | 
			
		||||
  In the third part you can find a comprehensive listing of FATE makefile
 | 
			
		||||
targets and variables.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@chapter Using FATE from your FFmpeg source directory
 | 
			
		||||
 | 
			
		||||
  If you want to run FATE on your machine you need to have the samples
 | 
			
		||||
in place. You can get the samples via the build target fate-rsync.
 | 
			
		||||
Use this command from the top-level source directory:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
make fate-rsync SAMPLES=fate-suite/
 | 
			
		||||
make fate       SAMPLES=fate-suite/
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
  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
 | 
			
		||||
`--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
 | 
			
		||||
./configure --samples=fate-suite/
 | 
			
		||||
make fate-rsync
 | 
			
		||||
make fate
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
  Yet another way to tell FATE about the location of the sample
 | 
			
		||||
directory is by making sure the environment variable FATE_SAMPLES
 | 
			
		||||
contains the path to your samples directory. This can be achieved
 | 
			
		||||
by e.g. putting that variable in your shell profile or by setting
 | 
			
		||||
it in your interactive session.
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
FATE_SAMPLES=fate-suite/ make fate
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@float NOTE
 | 
			
		||||
Do not put a '~' character in the samples path to indicate a home
 | 
			
		||||
directory. Because of shell nuances, this will cause FATE to fail.
 | 
			
		||||
@end float
 | 
			
		||||
 | 
			
		||||
To use a custom wrapper to run the test, pass @option{--target-exec} to
 | 
			
		||||
@command{configure} or set the @var{TARGET_EXEC} Make variable.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@chapter Submitting the results to the FFmpeg result aggregation server
 | 
			
		||||
 | 
			
		||||
  To submit your results to the server you should run fate through the
 | 
			
		||||
shell script @file{tests/fate.sh} from the FFmpeg sources. This script needs
 | 
			
		||||
to be invoked with a configuration file as its first argument.
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
tests/fate.sh /path/to/fate_config
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
  A configuration file template with comments describing the individual
 | 
			
		||||
configuration variables can be found at @file{tests/fate_config.sh.template}.
 | 
			
		||||
 | 
			
		||||
@ifhtml
 | 
			
		||||
  The mentioned configuration template is also available here:
 | 
			
		||||
@verbatiminclude ../tests/fate_config.sh.template
 | 
			
		||||
@end ifhtml
 | 
			
		||||
 | 
			
		||||
  Create a configuration that suits your needs, based on the configuration
 | 
			
		||||
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 <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 `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:
 | 
			
		||||
 | 
			
		||||
@itemize
 | 
			
		||||
    @item configure.log
 | 
			
		||||
    @item compile.log
 | 
			
		||||
    @item test.log
 | 
			
		||||
    @item report
 | 
			
		||||
    @item version
 | 
			
		||||
@end itemize
 | 
			
		||||
 | 
			
		||||
  When you have everything working properly you can create an SSH key pair
 | 
			
		||||
and send the public key to the FATE server administrator who can be contacted
 | 
			
		||||
at the email address @email{fate-admin@@ffmpeg.org}.
 | 
			
		||||
 | 
			
		||||
  Configure your SSH client to use public key authentication with that key
 | 
			
		||||
when connecting to the FATE server. Also do not forget to check the identity
 | 
			
		||||
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:
 | 
			
		||||
 | 
			
		||||
  b1:31:c8:79:3f:04:1d:f8:f2:23:26:5a:fd:55:fa:92
 | 
			
		||||
 | 
			
		||||
  If you have problems connecting to the FATE server, it may help to try out
 | 
			
		||||
the @command{ssh} command with one or more @option{-v} options. You should
 | 
			
		||||
get detailed output concerning your SSH configuration and the authentication
 | 
			
		||||
process.
 | 
			
		||||
 | 
			
		||||
  The only thing left is to automate the execution of the fate.sh script and
 | 
			
		||||
the synchronisation of the samples directory.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@chapter FATE makefile targets and variables
 | 
			
		||||
 | 
			
		||||
@section Makefile targets
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
@item fate-rsync
 | 
			
		||||
    Download/synchronize sample files to the configured samples directory.
 | 
			
		||||
 | 
			
		||||
@item fate-list
 | 
			
		||||
    Will list all fate/regression test targets.
 | 
			
		||||
 | 
			
		||||
@item fate
 | 
			
		||||
    Run the FATE test suite (requires the fate-suite dataset).
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section Makefile variables
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
@item V
 | 
			
		||||
    Verbosity level, can be set to 0, 1 or 2.
 | 
			
		||||
    @itemize
 | 
			
		||||
        @item 0: show just the test arguments
 | 
			
		||||
        @item 1: show just the command used in the test
 | 
			
		||||
        @item 2: show everything
 | 
			
		||||
    @end itemize
 | 
			
		||||
 | 
			
		||||
@item SAMPLES
 | 
			
		||||
    Specify or override the path to the FATE samples at make time, it has a
 | 
			
		||||
    meaning only while running the regression tests.
 | 
			
		||||
 | 
			
		||||
@item THREADS
 | 
			
		||||
    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 @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 @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}.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section Examples
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
make V=1 SAMPLES=/var/fate/samples THREADS=2 CPUFLAGS=mmx fate
 | 
			
		||||
@end example
 | 
			
		||||
							
								
								
									
										969
									
								
								doc/ffmpeg-doc.texi
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										969
									
								
								doc/ffmpeg-doc.texi
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,969 @@
 | 
			
		||||
\input texinfo @c -*- texinfo -*-
 | 
			
		||||
 | 
			
		||||
@settitle FFmpeg Documentation
 | 
			
		||||
@titlepage
 | 
			
		||||
@sp 7
 | 
			
		||||
@center @titlefont{FFmpeg Documentation}
 | 
			
		||||
@sp 3
 | 
			
		||||
@end titlepage
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@chapter Introduction
 | 
			
		||||
 | 
			
		||||
FFmpeg is a very fast video and audio converter. It can also grab from
 | 
			
		||||
a live audio/video source.
 | 
			
		||||
 | 
			
		||||
The command line interface is designed to be intuitive, in the sense
 | 
			
		||||
that FFmpeg tries to figure out all parameters that can possibly be
 | 
			
		||||
derived automatically. You usually only have to specify the target
 | 
			
		||||
bitrate you want.
 | 
			
		||||
 | 
			
		||||
FFmpeg can also convert from any sample rate to any other, and resize
 | 
			
		||||
video on the fly with a high quality polyphase filter.
 | 
			
		||||
 | 
			
		||||
@chapter Quick Start
 | 
			
		||||
 | 
			
		||||
@c man begin EXAMPLES
 | 
			
		||||
@section Video and Audio grabbing
 | 
			
		||||
 | 
			
		||||
FFmpeg can grab video and audio from devices given that you specify the input
 | 
			
		||||
format and device.
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -f oss -i /dev/dsp -f video4linux2 -i /dev/video0 /tmp/out.mpg
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Note that you must activate the right video source and channel before
 | 
			
		||||
launching FFmpeg with any TV viewer such as xawtv
 | 
			
		||||
(@url{http://linux.bytesex.org/xawtv/}) by Gerd Knorr. You also
 | 
			
		||||
have to set the audio recording levels correctly with a
 | 
			
		||||
standard mixer.
 | 
			
		||||
 | 
			
		||||
@section X11 grabbing
 | 
			
		||||
 | 
			
		||||
FFmpeg can grab the X11 display.
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -f x11grab -s cif -i :0.0 /tmp/out.mpg
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
0.0 is display.screen number of your X11 server, same as
 | 
			
		||||
the DISPLAY environment variable.
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -f x11grab -s cif -i :0.0+10,20 /tmp/out.mpg
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
0.0 is display.screen number of your X11 server, same as the DISPLAY environment
 | 
			
		||||
variable. 10 is the x-offset and 20 the y-offset for the grabbing.
 | 
			
		||||
 | 
			
		||||
@section Video and Audio file format conversion
 | 
			
		||||
 | 
			
		||||
* FFmpeg can use any supported file format and protocol as input:
 | 
			
		||||
 | 
			
		||||
Examples:
 | 
			
		||||
 | 
			
		||||
* You can use YUV files as input:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i /tmp/test%d.Y /tmp/out.mpg
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
It will use the files:
 | 
			
		||||
@example
 | 
			
		||||
/tmp/test0.Y, /tmp/test0.U, /tmp/test0.V,
 | 
			
		||||
/tmp/test1.Y, /tmp/test1.U, /tmp/test1.V, etc...
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
The Y files use twice the resolution of the U and V files. They are
 | 
			
		||||
raw files, without header. They can be generated by all decent video
 | 
			
		||||
decoders. You must specify the size of the image with the @option{-s} option
 | 
			
		||||
if FFmpeg cannot guess it.
 | 
			
		||||
 | 
			
		||||
* You can input from a raw YUV420P file:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i /tmp/test.yuv /tmp/out.avi
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
test.yuv is a file containing raw YUV planar data. Each frame is composed
 | 
			
		||||
of the Y plane followed by the U and V planes at half vertical and
 | 
			
		||||
horizontal resolution.
 | 
			
		||||
 | 
			
		||||
* You can output to a raw YUV420P file:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i mydivx.avi hugefile.yuv
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
* You can set several input files and output files:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i /tmp/a.wav -s 640x480 -i /tmp/a.yuv /tmp/a.mpg
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Converts the audio file a.wav and the raw YUV video file a.yuv
 | 
			
		||||
to MPEG file a.mpg.
 | 
			
		||||
 | 
			
		||||
* You can also do audio and video conversions at the same time:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i /tmp/a.wav -ar 22050 /tmp/a.mp2
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Converts a.wav to MPEG audio at 22050 Hz sample rate.
 | 
			
		||||
 | 
			
		||||
* You can encode to several formats at the same time and define a
 | 
			
		||||
mapping from input stream to output streams:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i /tmp/a.wav -ab 64k /tmp/a.mp2 -ab 128k /tmp/b.mp2 -map 0:0 -map 0:0
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Converts a.wav to a.mp2 at 64 kbits and to b.mp2 at 128 kbits. '-map
 | 
			
		||||
file:index' specifies which input stream is used for each output
 | 
			
		||||
stream, in the order of the definition of output streams.
 | 
			
		||||
 | 
			
		||||
* You can transcode decrypted VOBs:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i snatch_1.vob -f avi -vcodec mpeg4 -b 800k -g 300 -bf 2 -acodec libmp3lame -ab 128k snatch.avi
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
This is a typical DVD ripping example; the input is a VOB file, the
 | 
			
		||||
output an AVI file with MPEG-4 video and MP3 audio. Note that in this
 | 
			
		||||
command we use B-frames so the MPEG-4 stream is DivX5 compatible, and
 | 
			
		||||
GOP size is 300 which means one intra frame every 10 seconds for 29.97fps
 | 
			
		||||
input video. Furthermore, the audio stream is MP3-encoded so you need
 | 
			
		||||
to enable LAME support by passing @code{--enable-libmp3lame} to configure.
 | 
			
		||||
The mapping is particularly useful for DVD transcoding
 | 
			
		||||
to get the desired audio language.
 | 
			
		||||
 | 
			
		||||
NOTE: To see the supported input formats, use @code{ffmpeg -formats}.
 | 
			
		||||
 | 
			
		||||
* You can extract images from a video, or create a video from many images:
 | 
			
		||||
 | 
			
		||||
For extracting images from a video:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i foo.avi -r 1 -s WxH -f image2 foo-%03d.jpeg
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
This will extract one video frame per second from the video and will
 | 
			
		||||
output them in files named @file{foo-001.jpeg}, @file{foo-002.jpeg},
 | 
			
		||||
etc. Images will be rescaled to fit the new WxH values.
 | 
			
		||||
 | 
			
		||||
If you want to extract just a limited number of frames, you can use the
 | 
			
		||||
above command in combination with the -vframes or -t option, or in
 | 
			
		||||
combination with -ss to start extracting from a certain point in time.
 | 
			
		||||
 | 
			
		||||
For creating a video from many images:
 | 
			
		||||
@example
 | 
			
		||||
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
 | 
			
		||||
composed of three digits padded with zeroes to express the sequence
 | 
			
		||||
number. It is the same syntax supported by the C printf function, but
 | 
			
		||||
only formats accepting a normal integer are suitable.
 | 
			
		||||
 | 
			
		||||
* You can put many streams of the same type in the output:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i test1.avi -i test2.avi -vcodec copy -acodec copy -vcodec copy -acodec copy test12.avi -newvideo -newaudio
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
In addition to the first video and audio streams, the resulting
 | 
			
		||||
output file @file{test12.avi} will contain the second video
 | 
			
		||||
and the second audio stream found in the input streams list.
 | 
			
		||||
 | 
			
		||||
The @code{-newvideo}, @code{-newaudio} and @code{-newsubtitle}
 | 
			
		||||
options have to be specified immediately after the name of the output
 | 
			
		||||
file to which you want to add them.
 | 
			
		||||
@c man end
 | 
			
		||||
 | 
			
		||||
@chapter Invocation
 | 
			
		||||
 | 
			
		||||
@section Syntax
 | 
			
		||||
 | 
			
		||||
The generic syntax is:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
@c man begin SYNOPSIS
 | 
			
		||||
ffmpeg [[infile options][@option{-i} @var{infile}]]... @{[outfile options] @var{outfile}@}...
 | 
			
		||||
@c man end
 | 
			
		||||
@end example
 | 
			
		||||
@c man begin DESCRIPTION
 | 
			
		||||
As a general rule, options are applied to the next specified
 | 
			
		||||
file. Therefore, order is important, and you can have the same
 | 
			
		||||
option on the command line multiple times. Each occurrence is
 | 
			
		||||
then applied to the next input or output file.
 | 
			
		||||
 | 
			
		||||
* To set the video bitrate of the output file to 64kbit/s:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i input.avi -b 64k output.avi
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
* To force the frame rate of the output file to 24 fps:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i input.avi -r 24 output.avi
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
* To force the frame rate of the input file (valid for raw formats only)
 | 
			
		||||
to 1 fps and the frame rate of the output file to 24 fps:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -r 1 -i input.m2v -r 24 output.avi
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
The format option may be needed for raw input files.
 | 
			
		||||
 | 
			
		||||
By default, FFmpeg tries to convert as losslessly as possible: It
 | 
			
		||||
uses the same audio and video parameters for the outputs as the one
 | 
			
		||||
specified for the inputs.
 | 
			
		||||
@c man end
 | 
			
		||||
 | 
			
		||||
@c man begin OPTIONS
 | 
			
		||||
@section Main options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
@item -L
 | 
			
		||||
Show license.
 | 
			
		||||
 | 
			
		||||
@item -h
 | 
			
		||||
Show help.
 | 
			
		||||
 | 
			
		||||
@item -version
 | 
			
		||||
Show version.
 | 
			
		||||
 | 
			
		||||
@item -formats
 | 
			
		||||
Show available formats, codecs, bitstream filters, protocols, and frame size and frame rate abbreviations.
 | 
			
		||||
 | 
			
		||||
The fields preceding the format and codec names have the following meanings:
 | 
			
		||||
@table @samp
 | 
			
		||||
@item D
 | 
			
		||||
Decoding available
 | 
			
		||||
@item E
 | 
			
		||||
Encoding available
 | 
			
		||||
@item V/A/S
 | 
			
		||||
Video/audio/subtitle codec
 | 
			
		||||
@item S
 | 
			
		||||
Codec supports slices
 | 
			
		||||
@item D
 | 
			
		||||
Codec supports direct rendering
 | 
			
		||||
@item T
 | 
			
		||||
Codec can handle input truncated at random locations instead of only at frame boundaries
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@item -f @var{fmt}
 | 
			
		||||
Force format.
 | 
			
		||||
 | 
			
		||||
@item -i @var{filename}
 | 
			
		||||
input file name
 | 
			
		||||
 | 
			
		||||
@item -y
 | 
			
		||||
Overwrite output files.
 | 
			
		||||
 | 
			
		||||
@item -t @var{duration}
 | 
			
		||||
Restrict the transcoded/captured video sequence
 | 
			
		||||
to the duration specified in seconds.
 | 
			
		||||
@code{hh:mm:ss[.xxx]} syntax is also supported.
 | 
			
		||||
 | 
			
		||||
@item -fs @var{limit_size}
 | 
			
		||||
Set the file size limit.
 | 
			
		||||
 | 
			
		||||
@item -ss @var{position}
 | 
			
		||||
Seek to given time position in seconds.
 | 
			
		||||
@code{hh:mm:ss[.xxx]} syntax is also supported.
 | 
			
		||||
 | 
			
		||||
@item -itsoffset @var{offset}
 | 
			
		||||
Set the input time offset in seconds.
 | 
			
		||||
@code{[-]hh:mm:ss[.xxx]} syntax is also supported.
 | 
			
		||||
This option affects all the input files that follow it.
 | 
			
		||||
The offset is added to the timestamps of the input files.
 | 
			
		||||
Specifying a positive offset means that the corresponding
 | 
			
		||||
streams are delayed by 'offset' seconds.
 | 
			
		||||
 | 
			
		||||
@item -timestamp @var{time}
 | 
			
		||||
Set the timestamp.
 | 
			
		||||
 | 
			
		||||
@item -metadata @var{key}=@var{value}
 | 
			
		||||
Set a metadata key/value pair.
 | 
			
		||||
 | 
			
		||||
For example, for setting the title in the output file:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i in.avi -metadata title="my title" out.flv
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item -v @var{number}
 | 
			
		||||
Set the logging verbosity level.
 | 
			
		||||
 | 
			
		||||
@item -target @var{type}
 | 
			
		||||
Specify target file type ("vcd", "svcd", "dvd", "dv", "dv50", "pal-vcd",
 | 
			
		||||
"ntsc-svcd", ... ). All the format options (bitrate, codecs,
 | 
			
		||||
buffer sizes) are then set automatically. You can just type:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Nevertheless you can specify additional options as long as you know
 | 
			
		||||
they do not conflict with the standard, as in:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i myfile.avi -target vcd -bf 2 /tmp/vcd.mpg
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item -dframes @var{number}
 | 
			
		||||
Set the number of data frames to record.
 | 
			
		||||
 | 
			
		||||
@item -scodec @var{codec}
 | 
			
		||||
Force subtitle codec ('copy' to copy stream).
 | 
			
		||||
 | 
			
		||||
@item -newsubtitle
 | 
			
		||||
Add a new subtitle stream to the current output stream.
 | 
			
		||||
 | 
			
		||||
@item -slang @var{code}
 | 
			
		||||
Set the ISO 639 language code (3 letters) of the current subtitle stream.
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section Video Options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
@item -b @var{bitrate}
 | 
			
		||||
Set the video bitrate in bit/s (default = 200 kb/s).
 | 
			
		||||
@item -vframes @var{number}
 | 
			
		||||
Set the number of video frames to record.
 | 
			
		||||
@item -r @var{fps}
 | 
			
		||||
Set frame rate (Hz value, fraction or abbreviation), (default = 25).
 | 
			
		||||
@item -s @var{size}
 | 
			
		||||
Set frame size. The format is @samp{wxh} (ffserver default = 160x128, ffmpeg default = same as source).
 | 
			
		||||
The following abbreviations are recognized:
 | 
			
		||||
@table @samp
 | 
			
		||||
@item sqcif
 | 
			
		||||
128x96
 | 
			
		||||
@item qcif
 | 
			
		||||
176x144
 | 
			
		||||
@item cif
 | 
			
		||||
352x288
 | 
			
		||||
@item 4cif
 | 
			
		||||
704x576
 | 
			
		||||
@item qqvga
 | 
			
		||||
160x120
 | 
			
		||||
@item qvga
 | 
			
		||||
320x240
 | 
			
		||||
@item vga
 | 
			
		||||
640x480
 | 
			
		||||
@item svga
 | 
			
		||||
800x600
 | 
			
		||||
@item xga
 | 
			
		||||
1024x768
 | 
			
		||||
@item uxga
 | 
			
		||||
1600x1200
 | 
			
		||||
@item qxga
 | 
			
		||||
2048x1536
 | 
			
		||||
@item sxga
 | 
			
		||||
1280x1024
 | 
			
		||||
@item qsxga
 | 
			
		||||
2560x2048
 | 
			
		||||
@item hsxga
 | 
			
		||||
5120x4096
 | 
			
		||||
@item wvga
 | 
			
		||||
852x480
 | 
			
		||||
@item wxga
 | 
			
		||||
1366x768
 | 
			
		||||
@item wsxga
 | 
			
		||||
1600x1024
 | 
			
		||||
@item wuxga
 | 
			
		||||
1920x1200
 | 
			
		||||
@item woxga
 | 
			
		||||
2560x1600
 | 
			
		||||
@item wqsxga
 | 
			
		||||
3200x2048
 | 
			
		||||
@item wquxga
 | 
			
		||||
3840x2400
 | 
			
		||||
@item whsxga
 | 
			
		||||
6400x4096
 | 
			
		||||
@item whuxga
 | 
			
		||||
7680x4800
 | 
			
		||||
@item cga
 | 
			
		||||
320x200
 | 
			
		||||
@item ega
 | 
			
		||||
640x350
 | 
			
		||||
@item hd480
 | 
			
		||||
852x480
 | 
			
		||||
@item hd720
 | 
			
		||||
1280x720
 | 
			
		||||
@item hd1080
 | 
			
		||||
1920x1080
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@item -aspect @var{aspect}
 | 
			
		||||
Set aspect ratio (4:3, 16:9 or 1.3333, 1.7777).
 | 
			
		||||
@item -croptop @var{size}
 | 
			
		||||
Set top crop band size (in pixels).
 | 
			
		||||
@item -cropbottom @var{size}
 | 
			
		||||
Set bottom crop band size (in pixels).
 | 
			
		||||
@item -cropleft @var{size}
 | 
			
		||||
Set left crop band size (in pixels).
 | 
			
		||||
@item -cropright @var{size}
 | 
			
		||||
Set right crop band size (in pixels).
 | 
			
		||||
@item -padtop @var{size}
 | 
			
		||||
Set top pad band size (in pixels).
 | 
			
		||||
@item -padbottom @var{size}
 | 
			
		||||
Set bottom pad band size (in pixels).
 | 
			
		||||
@item -padleft @var{size}
 | 
			
		||||
Set left pad band size (in pixels).
 | 
			
		||||
@item -padright @var{size}
 | 
			
		||||
Set right pad band size (in pixels).
 | 
			
		||||
@item -padcolor @var{hex_color}
 | 
			
		||||
Set color of padded bands. The value for padcolor is expressed
 | 
			
		||||
as a six digit hexadecimal number where the first two digits
 | 
			
		||||
represent red, the middle two digits green and last two digits
 | 
			
		||||
blue (default = 000000 (black)).
 | 
			
		||||
@item -vn
 | 
			
		||||
Disable video recording.
 | 
			
		||||
@item -bt @var{tolerance}
 | 
			
		||||
Set video bitrate tolerance (in bits, default 4000k).
 | 
			
		||||
Has a minimum value of: (target_bitrate/target_framerate).
 | 
			
		||||
In 1-pass mode, bitrate tolerance specifies how far ratecontrol is
 | 
			
		||||
willing to deviate from the target average bitrate value. This is
 | 
			
		||||
not related to min/max bitrate. Lowering tolerance too much has
 | 
			
		||||
an adverse effect on quality.
 | 
			
		||||
@item -maxrate @var{bitrate}
 | 
			
		||||
Set max video bitrate (in bit/s).
 | 
			
		||||
Requires -bufsize to be set.
 | 
			
		||||
@item -minrate @var{bitrate}
 | 
			
		||||
Set min video bitrate (in bit/s).
 | 
			
		||||
Most useful in setting up a CBR encode:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i myfile.avi -b 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k out.m2v
 | 
			
		||||
@end example
 | 
			
		||||
It is of little use elsewise.
 | 
			
		||||
@item -bufsize @var{size}
 | 
			
		||||
Set video buffer verifier buffer size (in bits).
 | 
			
		||||
@item -vcodec @var{codec}
 | 
			
		||||
Force video codec to @var{codec}. Use the @code{copy} special value to
 | 
			
		||||
tell that the raw codec data must be copied as is.
 | 
			
		||||
@item -sameq
 | 
			
		||||
Use same video quality as source (implies VBR).
 | 
			
		||||
 | 
			
		||||
@item -pass @var{n}
 | 
			
		||||
Select the pass number (1 or 2). It is used to do two-pass
 | 
			
		||||
video encoding. The statistics of the video are recorded in the first
 | 
			
		||||
pass into a log file (see also the option -passlogfile),
 | 
			
		||||
and in the second pass that log file is used to generate the video
 | 
			
		||||
at the exact requested bitrate.
 | 
			
		||||
On pass 1, you may just deactivate audio and set output to null,
 | 
			
		||||
examples for Windows and Unix:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i foo.mov -vcodec libxvid -pass 1 -an -f rawvideo -y NUL
 | 
			
		||||
ffmpeg -i foo.mov -vcodec libxvid -pass 1 -an -f rawvideo -y /dev/null
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item -passlogfile @var{prefix}
 | 
			
		||||
Set two-pass log file name prefix to @var{prefix}, the default file name
 | 
			
		||||
prefix is ``ffmpeg2pass''. The complete file name will be
 | 
			
		||||
@file{PREFIX-N.log}, where N is a number specific to the output
 | 
			
		||||
stream.
 | 
			
		||||
 | 
			
		||||
@item -newvideo
 | 
			
		||||
Add a new video stream to the current output stream.
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section Advanced Video Options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
@item -pix_fmt @var{format}
 | 
			
		||||
Set pixel format. Use 'list' as parameter to show all the supported
 | 
			
		||||
pixel formats.
 | 
			
		||||
@item -sws_flags @var{flags}
 | 
			
		||||
Set SwScaler flags (only available when compiled with swscale support).
 | 
			
		||||
@item -g @var{gop_size}
 | 
			
		||||
Set the group of pictures size.
 | 
			
		||||
@item -intra
 | 
			
		||||
Use only intra frames.
 | 
			
		||||
@item -vdt @var{n}
 | 
			
		||||
Discard threshold.
 | 
			
		||||
@item -qscale @var{q}
 | 
			
		||||
Use fixed video quantizer scale (VBR).
 | 
			
		||||
@item -qmin @var{q}
 | 
			
		||||
minimum video quantizer scale (VBR)
 | 
			
		||||
@item -qmax @var{q}
 | 
			
		||||
maximum video quantizer scale (VBR)
 | 
			
		||||
@item -qdiff @var{q}
 | 
			
		||||
maximum difference between the quantizer scales (VBR)
 | 
			
		||||
@item -qblur @var{blur}
 | 
			
		||||
video quantizer scale blur (VBR) (range 0.0 - 1.0)
 | 
			
		||||
@item -qcomp @var{compression}
 | 
			
		||||
video quantizer scale compression (VBR) (default 0.5).
 | 
			
		||||
Constant of ratecontrol equation. Recommended range for default rc_eq: 0.0-1.0
 | 
			
		||||
 | 
			
		||||
@item -lmin @var{lambda}
 | 
			
		||||
minimum video lagrange factor (VBR)
 | 
			
		||||
@item -lmax @var{lambda}
 | 
			
		||||
max video lagrange factor (VBR)
 | 
			
		||||
@item -mblmin @var{lambda}
 | 
			
		||||
minimum macroblock quantizer scale (VBR)
 | 
			
		||||
@item -mblmax @var{lambda}
 | 
			
		||||
maximum macroblock quantizer scale (VBR)
 | 
			
		||||
 | 
			
		||||
These four options (lmin, lmax, mblmin, mblmax) use 'lambda' units,
 | 
			
		||||
but you may use the QP2LAMBDA constant to easily convert from 'q' units:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i src.ext -lmax 21*QP2LAMBDA dst.ext
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item -rc_init_cplx @var{complexity}
 | 
			
		||||
initial complexity for single pass encoding
 | 
			
		||||
@item -b_qfactor @var{factor}
 | 
			
		||||
qp factor between P- and B-frames
 | 
			
		||||
@item -i_qfactor @var{factor}
 | 
			
		||||
qp factor between P- and I-frames
 | 
			
		||||
@item -b_qoffset @var{offset}
 | 
			
		||||
qp offset between P- and B-frames
 | 
			
		||||
@item -i_qoffset @var{offset}
 | 
			
		||||
qp offset between P- and I-frames
 | 
			
		||||
@item -rc_eq @var{equation}
 | 
			
		||||
Set rate control equation (@pxref{FFmpeg formula
 | 
			
		||||
evaluator}) (default = @code{tex^qComp}).
 | 
			
		||||
@item -rc_override @var{override}
 | 
			
		||||
rate control override for specific intervals
 | 
			
		||||
@item -me_method @var{method}
 | 
			
		||||
Set motion estimation method to @var{method}.
 | 
			
		||||
Available methods are (from lowest to best quality):
 | 
			
		||||
@table @samp
 | 
			
		||||
@item zero
 | 
			
		||||
Try just the (0, 0) vector.
 | 
			
		||||
@item phods
 | 
			
		||||
@item log
 | 
			
		||||
@item x1
 | 
			
		||||
@item hex
 | 
			
		||||
@item umh
 | 
			
		||||
@item epzs
 | 
			
		||||
(default method)
 | 
			
		||||
@item full
 | 
			
		||||
exhaustive search (slow and marginally better than epzs)
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@item -dct_algo @var{algo}
 | 
			
		||||
Set DCT algorithm to @var{algo}. Available values are:
 | 
			
		||||
@table @samp
 | 
			
		||||
@item 0
 | 
			
		||||
FF_DCT_AUTO (default)
 | 
			
		||||
@item 1
 | 
			
		||||
FF_DCT_FASTINT
 | 
			
		||||
@item 2
 | 
			
		||||
FF_DCT_INT
 | 
			
		||||
@item 3
 | 
			
		||||
FF_DCT_MMX
 | 
			
		||||
@item 4
 | 
			
		||||
FF_DCT_MLIB
 | 
			
		||||
@item 5
 | 
			
		||||
FF_DCT_ALTIVEC
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@item -idct_algo @var{algo}
 | 
			
		||||
Set IDCT algorithm to @var{algo}. Available values are:
 | 
			
		||||
@table @samp
 | 
			
		||||
@item 0
 | 
			
		||||
FF_IDCT_AUTO (default)
 | 
			
		||||
@item 1
 | 
			
		||||
FF_IDCT_INT
 | 
			
		||||
@item 2
 | 
			
		||||
FF_IDCT_SIMPLE
 | 
			
		||||
@item 3
 | 
			
		||||
FF_IDCT_SIMPLEMMX
 | 
			
		||||
@item 4
 | 
			
		||||
FF_IDCT_LIBMPEG2MMX
 | 
			
		||||
@item 5
 | 
			
		||||
FF_IDCT_PS2
 | 
			
		||||
@item 6
 | 
			
		||||
FF_IDCT_MLIB
 | 
			
		||||
@item 7
 | 
			
		||||
FF_IDCT_ARM
 | 
			
		||||
@item 8
 | 
			
		||||
FF_IDCT_ALTIVEC
 | 
			
		||||
@item 9
 | 
			
		||||
FF_IDCT_SH4
 | 
			
		||||
@item 10
 | 
			
		||||
FF_IDCT_SIMPLEARM
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@item -er @var{n}
 | 
			
		||||
Set error resilience to @var{n}.
 | 
			
		||||
@table @samp
 | 
			
		||||
@item 1
 | 
			
		||||
FF_ER_CAREFUL (default)
 | 
			
		||||
@item 2
 | 
			
		||||
FF_ER_COMPLIANT
 | 
			
		||||
@item 3
 | 
			
		||||
FF_ER_AGGRESSIVE
 | 
			
		||||
@item 4
 | 
			
		||||
FF_ER_VERY_AGGRESSIVE
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@item -ec @var{bit_mask}
 | 
			
		||||
Set error concealment to @var{bit_mask}. @var{bit_mask} is a bit mask of
 | 
			
		||||
the following values:
 | 
			
		||||
@table @samp
 | 
			
		||||
@item 1
 | 
			
		||||
FF_EC_GUESS_MVS (default = enabled)
 | 
			
		||||
@item 2
 | 
			
		||||
FF_EC_DEBLOCK (default = enabled)
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@item -bf @var{frames}
 | 
			
		||||
Use 'frames' B-frames (supported for MPEG-1, MPEG-2 and MPEG-4).
 | 
			
		||||
@item -mbd @var{mode}
 | 
			
		||||
macroblock decision
 | 
			
		||||
@table @samp
 | 
			
		||||
@item 0
 | 
			
		||||
FF_MB_DECISION_SIMPLE: Use mb_cmp (cannot change it yet in FFmpeg).
 | 
			
		||||
@item 1
 | 
			
		||||
FF_MB_DECISION_BITS: Choose the one which needs the fewest bits.
 | 
			
		||||
@item 2
 | 
			
		||||
FF_MB_DECISION_RD: rate distortion
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@item -4mv
 | 
			
		||||
Use four motion vector by macroblock (MPEG-4 only).
 | 
			
		||||
@item -part
 | 
			
		||||
Use data partitioning (MPEG-4 only).
 | 
			
		||||
@item -bug @var{param}
 | 
			
		||||
Work around encoder bugs that are not auto-detected.
 | 
			
		||||
@item -strict @var{strictness}
 | 
			
		||||
How strictly to follow the standards.
 | 
			
		||||
@item -aic
 | 
			
		||||
Enable Advanced intra coding (h263+).
 | 
			
		||||
@item -umv
 | 
			
		||||
Enable Unlimited Motion Vector (h263+)
 | 
			
		||||
 | 
			
		||||
@item -deinterlace
 | 
			
		||||
Deinterlace pictures.
 | 
			
		||||
@item -ilme
 | 
			
		||||
Force interlacing support in encoder (MPEG-2 and MPEG-4 only).
 | 
			
		||||
Use this option if your input file is interlaced and you want
 | 
			
		||||
to keep the interlaced format for minimum losses.
 | 
			
		||||
The alternative is to deinterlace the input stream with
 | 
			
		||||
@option{-deinterlace}, but deinterlacing introduces losses.
 | 
			
		||||
@item -psnr
 | 
			
		||||
Calculate PSNR of compressed frames.
 | 
			
		||||
@item -vstats
 | 
			
		||||
Dump video coding statistics to @file{vstats_HHMMSS.log}.
 | 
			
		||||
@item -vstats_file @var{file}
 | 
			
		||||
Dump video coding statistics to @var{file}.
 | 
			
		||||
@item -vhook @var{module}
 | 
			
		||||
Insert video processing @var{module}. @var{module} contains the module
 | 
			
		||||
name and its parameters separated by spaces.
 | 
			
		||||
@item -top @var{n}
 | 
			
		||||
top=1/bottom=0/auto=-1 field first
 | 
			
		||||
@item -dc @var{precision}
 | 
			
		||||
Intra_dc_precision.
 | 
			
		||||
@item -vtag @var{fourcc/tag}
 | 
			
		||||
Force video tag/fourcc.
 | 
			
		||||
@item -qphist
 | 
			
		||||
Show QP histogram.
 | 
			
		||||
@item -vbsf @var{bitstream_filter}
 | 
			
		||||
Bitstream filters available are "dump_extra", "remove_extra", "noise", "h264_mp4toannexb", "imxdump", "mjpegadump".
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i h264.mp4 -vcodec copy -vbsf h264_mp4toannexb -an out.h264
 | 
			
		||||
@end example
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section Audio Options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
@item -aframes @var{number}
 | 
			
		||||
Set the number of audio frames to record.
 | 
			
		||||
@item -ar @var{freq}
 | 
			
		||||
Set the audio sampling frequency (default = 44100 Hz).
 | 
			
		||||
@item -ab @var{bitrate}
 | 
			
		||||
Set the audio bitrate in bit/s (default = 64k).
 | 
			
		||||
@item -aq @var{q}
 | 
			
		||||
Set the audio quality (codec-specific, VBR).
 | 
			
		||||
@item -ac @var{channels}
 | 
			
		||||
Set the number of audio channels (default = 1).
 | 
			
		||||
@item -an
 | 
			
		||||
Disable audio recording.
 | 
			
		||||
@item -acodec @var{codec}
 | 
			
		||||
Force audio codec to @var{codec}. Use the @code{copy} special value to
 | 
			
		||||
specify that the raw codec data must be copied as is.
 | 
			
		||||
@item -newaudio
 | 
			
		||||
Add a new audio track to the output file. If you want to specify parameters,
 | 
			
		||||
do so before @code{-newaudio} (@code{-acodec}, @code{-ab}, etc..).
 | 
			
		||||
 | 
			
		||||
Mapping will be done automatically, if the number of output streams is equal to
 | 
			
		||||
the number of input streams, else it will pick the first one that matches. You
 | 
			
		||||
can override the mapping using @code{-map} as usual.
 | 
			
		||||
 | 
			
		||||
Example:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i file.mpg -vcodec copy -acodec ac3 -ab 384k test.mpg -acodec mp2 -ab 192k -newaudio
 | 
			
		||||
@end example
 | 
			
		||||
@item -alang @var{code}
 | 
			
		||||
Set the ISO 639 language code (3 letters) of the current audio stream.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section Advanced Audio options:
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
@item -atag @var{fourcc/tag}
 | 
			
		||||
Force audio tag/fourcc.
 | 
			
		||||
@item -absf @var{bitstream_filter}
 | 
			
		||||
Bitstream filters available are "dump_extra", "remove_extra", "noise", "mp3comp", "mp3decomp".
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section Subtitle options:
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
@item -scodec @var{codec}
 | 
			
		||||
Force subtitle codec ('copy' to copy stream).
 | 
			
		||||
@item -newsubtitle
 | 
			
		||||
Add a new subtitle stream to the current output stream.
 | 
			
		||||
@item -slang @var{code}
 | 
			
		||||
Set the ISO 639 language code (3 letters) of the current subtitle stream.
 | 
			
		||||
@item -sn
 | 
			
		||||
Disable subtitle recording.
 | 
			
		||||
@item -sbsf @var{bitstream_filter}
 | 
			
		||||
Bitstream filters available are "mov2textsub", "text2movsub".
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i file.mov -an -vn -sbsf mov2textsub -scodec copy -f rawvideo sub.txt
 | 
			
		||||
@end example
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section Audio/Video grab options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
@item -vc @var{channel}
 | 
			
		||||
Set video grab channel (DV1394 only).
 | 
			
		||||
@item -tvstd @var{standard}
 | 
			
		||||
Set television standard (NTSC, PAL (SECAM)).
 | 
			
		||||
@item -isync
 | 
			
		||||
Synchronize read on input.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section Advanced options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
@item -map @var{input_stream_id}[:@var{sync_stream_id}]
 | 
			
		||||
Set stream mapping from input streams to output streams.
 | 
			
		||||
Just enumerate the input streams in the order you want them in the output.
 | 
			
		||||
@var{sync_stream_id} if specified sets the input stream to sync
 | 
			
		||||
against.
 | 
			
		||||
@item -map_meta_data @var{outfile}:@var{infile}
 | 
			
		||||
Set meta data information of @var{outfile} from @var{infile}.
 | 
			
		||||
@item -debug
 | 
			
		||||
Print specific debug info.
 | 
			
		||||
@item -benchmark
 | 
			
		||||
Add timings for benchmarking.
 | 
			
		||||
@item -dump
 | 
			
		||||
Dump each input packet.
 | 
			
		||||
@item -hex
 | 
			
		||||
When dumping packets, also dump the payload.
 | 
			
		||||
@item -bitexact
 | 
			
		||||
Only use bit exact algorithms (for codec testing).
 | 
			
		||||
@item -ps @var{size}
 | 
			
		||||
Set packet size in bits.
 | 
			
		||||
@item -re
 | 
			
		||||
Read input at native frame rate. Mainly used to simulate a grab device.
 | 
			
		||||
@item -loop_input
 | 
			
		||||
Loop over the input stream. Currently it works only for image
 | 
			
		||||
streams. This option is used for automatic FFserver testing.
 | 
			
		||||
@item -loop_output @var{number_of_times}
 | 
			
		||||
Repeatedly loop output for formats that support looping such as animated GIF
 | 
			
		||||
(0 will loop the output infinitely).
 | 
			
		||||
@item -threads @var{count}
 | 
			
		||||
Thread count.
 | 
			
		||||
@item -vsync @var{parameter}
 | 
			
		||||
Video sync method. Video will be stretched/squeezed to match the timestamps,
 | 
			
		||||
it is done by duplicating and dropping frames. 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 -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.
 | 
			
		||||
-async 1 is a special case where only the start of the audio stream is corrected
 | 
			
		||||
without any later correction.
 | 
			
		||||
@item -copyts
 | 
			
		||||
Copy timestamps from input to output.
 | 
			
		||||
@item -shortest
 | 
			
		||||
Finish encoding when the shortest input stream ends.
 | 
			
		||||
@item -dts_delta_threshold
 | 
			
		||||
Timestamp discontinuity delta threshold.
 | 
			
		||||
@item -muxdelay @var{seconds}
 | 
			
		||||
Set the maximum demux-decode delay.
 | 
			
		||||
@item -muxpreload @var{seconds}
 | 
			
		||||
Set the initial demux-decode delay.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section Preset files
 | 
			
		||||
 | 
			
		||||
A preset file contains a sequence of @var{option}=@var{value} pairs,
 | 
			
		||||
one for each line, specifying a sequence of options which would be
 | 
			
		||||
awkward to specify on the command line. Lines starting with the hash
 | 
			
		||||
('#') character are ignored and are used to provide comments. Check
 | 
			
		||||
the @file{ffpresets} directory in the FFmpeg source tree for examples.
 | 
			
		||||
 | 
			
		||||
Preset files are specified with the @code{vpre}, @code{apre} and
 | 
			
		||||
@code{spre} options. The options specified in a preset file are
 | 
			
		||||
applied to the currently selected codec of the same type as the preset
 | 
			
		||||
option.
 | 
			
		||||
 | 
			
		||||
The argument passed to the preset options identifies the preset file
 | 
			
		||||
to use according to the following rules.
 | 
			
		||||
 | 
			
		||||
First ffmpeg searches for a file named @var{arg}.ffpreset in the
 | 
			
		||||
directories @file{$HOME/.ffmpeg}, and in the datadir 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.ffpreset}.
 | 
			
		||||
 | 
			
		||||
If no such file is found, then ffmpeg will search for a file named
 | 
			
		||||
@var{codec_name}-@var{arg}.ffpreset 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 libx264} and use @code{-vpre max},
 | 
			
		||||
then it will search for the file @file{libx264-max.ffpreset}.
 | 
			
		||||
 | 
			
		||||
Finally, if the above rules failed and the argument specifies an
 | 
			
		||||
absolute pathname, ffmpeg will search for that filename. This way you
 | 
			
		||||
can specify the absolute and complete filename of the preset file, for
 | 
			
		||||
example @file{./ffpresets/libx264-max.ffpreset}.
 | 
			
		||||
 | 
			
		||||
@node FFmpeg formula evaluator
 | 
			
		||||
@section FFmpeg formula evaluator
 | 
			
		||||
 | 
			
		||||
When evaluating a rate control string, FFmpeg uses an internal formula
 | 
			
		||||
evaluator.
 | 
			
		||||
 | 
			
		||||
The following binary operators are available: @code{+}, @code{-},
 | 
			
		||||
@code{*}, @code{/}, @code{^}.
 | 
			
		||||
 | 
			
		||||
The following unary operators are available: @code{+}, @code{-},
 | 
			
		||||
@code{(...)}.
 | 
			
		||||
 | 
			
		||||
The following statements are available: @code{ld}, @code{st},
 | 
			
		||||
@code{while}.
 | 
			
		||||
 | 
			
		||||
The following functions are available:
 | 
			
		||||
@table @var
 | 
			
		||||
@item sinh(x)
 | 
			
		||||
@item cosh(x)
 | 
			
		||||
@item tanh(x)
 | 
			
		||||
@item sin(x)
 | 
			
		||||
@item cos(x)
 | 
			
		||||
@item tan(x)
 | 
			
		||||
@item atan(x)
 | 
			
		||||
@item asin(x)
 | 
			
		||||
@item acos(x)
 | 
			
		||||
@item exp(x)
 | 
			
		||||
@item log(x)
 | 
			
		||||
@item abs(x)
 | 
			
		||||
@item squish(x)
 | 
			
		||||
@item gauss(x)
 | 
			
		||||
@item mod(x, y)
 | 
			
		||||
@item max(x, y)
 | 
			
		||||
@item min(x, y)
 | 
			
		||||
@item eq(x, y)
 | 
			
		||||
@item gte(x, y)
 | 
			
		||||
@item gt(x, y)
 | 
			
		||||
@item lte(x, y)
 | 
			
		||||
@item lt(x, y)
 | 
			
		||||
@item bits2qp(bits)
 | 
			
		||||
@item qp2bits(qp)
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
The following constants are available:
 | 
			
		||||
@table @var
 | 
			
		||||
@item PI
 | 
			
		||||
@item E
 | 
			
		||||
@item iTex
 | 
			
		||||
@item pTex
 | 
			
		||||
@item tex
 | 
			
		||||
@item mv
 | 
			
		||||
@item fCode
 | 
			
		||||
@item iCount
 | 
			
		||||
@item mcVar
 | 
			
		||||
@item var
 | 
			
		||||
@item isI
 | 
			
		||||
@item isP
 | 
			
		||||
@item isB
 | 
			
		||||
@item avgQP
 | 
			
		||||
@item qComp
 | 
			
		||||
@item avgIITex
 | 
			
		||||
@item avgPITex
 | 
			
		||||
@item avgPPTex
 | 
			
		||||
@item avgBPTex
 | 
			
		||||
@item avgTex
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@c man end
 | 
			
		||||
 | 
			
		||||
@ignore
 | 
			
		||||
 | 
			
		||||
@setfilename ffmpeg
 | 
			
		||||
@settitle FFmpeg video converter
 | 
			
		||||
 | 
			
		||||
@c man begin SEEALSO
 | 
			
		||||
ffserver(1), ffplay(1) and the HTML documentation of @file{ffmpeg}.
 | 
			
		||||
@c man end
 | 
			
		||||
 | 
			
		||||
@c man begin AUTHOR
 | 
			
		||||
Fabrice Bellard
 | 
			
		||||
@c man end
 | 
			
		||||
 | 
			
		||||
@end ignore
 | 
			
		||||
 | 
			
		||||
@section Protocols
 | 
			
		||||
 | 
			
		||||
The file name can be @file{-} to read from standard input or to write
 | 
			
		||||
to standard output.
 | 
			
		||||
 | 
			
		||||
FFmpeg also handles many protocols specified with an URL syntax.
 | 
			
		||||
 | 
			
		||||
Use 'ffmpeg -formats' to see a list of the supported protocols.
 | 
			
		||||
 | 
			
		||||
The protocol @code{http:} is currently used only to communicate with
 | 
			
		||||
FFserver (see the FFserver documentation). When FFmpeg will be a
 | 
			
		||||
video player it will also be used for streaming :-)
 | 
			
		||||
 | 
			
		||||
@chapter Tips
 | 
			
		||||
 | 
			
		||||
@itemize
 | 
			
		||||
@item For streaming at very low bitrate application, 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 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 '-intra' 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).
 | 
			
		||||
 | 
			
		||||
@item When converting video files, you can use the '-sameq' option which
 | 
			
		||||
uses the same quality factor in the encoder as in the decoder.
 | 
			
		||||
It allows almost lossless encoding.
 | 
			
		||||
 | 
			
		||||
@end itemize
 | 
			
		||||
 | 
			
		||||
@bye
 | 
			
		||||
							
								
								
									
										1342
									
								
								doc/ffmpeg.texi
									
									
									
									
									
								
							
							
						
						
									
										1342
									
								
								doc/ffmpeg.texi
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -1,47 +0,0 @@
 | 
			
		||||
                                                                                                                                       :
 | 
			
		||||
                                             ffmpeg.c                                                                                  :       libav*
 | 
			
		||||
                                             ========                                                                                  :       ======
 | 
			
		||||
                                                                                                                                       :
 | 
			
		||||
                                                                                                                                       :
 | 
			
		||||
                                                                                                       --------------------------------:---> AVStream...
 | 
			
		||||
                                                                    InputStream input_streams[]      /                                 :
 | 
			
		||||
                                                                                                    /                                  :
 | 
			
		||||
                    InputFile input_files[]                         +==========================+   /   ^                               :
 | 
			
		||||
                                                          ------> 0 |      : st ---:-----------:--/    :                               :
 | 
			
		||||
                 ^  +------+-----------+-----+          /           +--------------------------+       :                               :
 | 
			
		||||
                 :  |      :ist_index--:-----:---------/          1 |      : st    :           |       :                               :
 | 
			
		||||
                 :  +------+-----------+-----+                      +==========================+       :                               :
 | 
			
		||||
 nb_input_files  :  |      :ist_index--:-----:------------------> 2 |      : st    :           |       :                               :
 | 
			
		||||
                 :  +------+-----------+-----+                      +--------------------------+       :  nb_input_streams             :
 | 
			
		||||
                 :  |      :ist_index  :     |                    3 |            ...           |       :                               :
 | 
			
		||||
                 v  +------+-----------+-----+                      +--------------------------+       :                               :
 | 
			
		||||
                                                              --> 4 |                          |       :                               :
 | 
			
		||||
                                                             |      +--------------------------+       :                               :
 | 
			
		||||
                                                             |    5 |                          |       :                               :
 | 
			
		||||
                                                             |      +==========================+       v                               :
 | 
			
		||||
                                                             |                                                                         :
 | 
			
		||||
                                                             |                                                                         :
 | 
			
		||||
                                                             |                                                                         :
 | 
			
		||||
                                                             |                                                                         :
 | 
			
		||||
                                                              ---------                                --------------------------------:---> AVStream...
 | 
			
		||||
                                                                        \                            /                                 :
 | 
			
		||||
                                                                    OutputStream output_streams[]   /                                  :
 | 
			
		||||
                                                                          \                        /                                   :
 | 
			
		||||
                                                                    +======\======================/======+      ^                      :
 | 
			
		||||
                                                          ------> 0 |   : source_index  : st-:---        |      :                      :
 | 
			
		||||
                    OutputFile output_files[]           /           +------------------------------------+      :                      :
 | 
			
		||||
                                                       /          1 |   :               :    :           |      :                      :
 | 
			
		||||
                 ^  +------+------------+-----+       /             +------------------------------------+      :                      :
 | 
			
		||||
                 :  |      : ost_index -:-----:------/            2 |   :               :    :           |      :                      :
 | 
			
		||||
 nb_output_files :  +------+------------+-----+                     +====================================+      :                      :
 | 
			
		||||
                 :  |      : ost_index -:-----|-----------------> 3 |   :               :    :           |      :                      :
 | 
			
		||||
                 :  +------+------------+-----+                     +------------------------------------+      : nb_output_streams    :
 | 
			
		||||
                 :  |      :            :     |                   4 |                                    |      :                      :
 | 
			
		||||
                 :  +------+------------+-----+                     +------------------------------------+      :                      :
 | 
			
		||||
                 :  |      :            :     |                   5 |                                    |      :                      :
 | 
			
		||||
                 v  +------+------------+-----+                     +------------------------------------+      :                      :
 | 
			
		||||
                                                                  6 |                                    |      :                      :
 | 
			
		||||
                                                                    +------------------------------------+      :                      :
 | 
			
		||||
                                                                  7 |                                    |      :                      :
 | 
			
		||||
                                                                    +====================================+      v                      :
 | 
			
		||||
                                                                                                                                       :
 | 
			
		||||
							
								
								
									
										172
									
								
								doc/ffmpeg_powerpc_performance_evaluation_howto.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										172
									
								
								doc/ffmpeg_powerpc_performance_evaluation_howto.txt
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,172 @@
 | 
			
		||||
FFmpeg & evaluating performance on the PowerPC Architecture HOWTO
 | 
			
		||||
 | 
			
		||||
(c) 2003-2004 Romain Dolbeau <romain@dolbeau.org>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
I - Introduction
 | 
			
		||||
 | 
			
		||||
The PowerPC architecture and its SIMD extension AltiVec offer some
 | 
			
		||||
interesting tools to evaluate performance and improve the code.
 | 
			
		||||
This document tries to explain how to use those tools with FFmpeg.
 | 
			
		||||
 | 
			
		||||
The architecture itself offers two ways to evaluate the performance of
 | 
			
		||||
a given piece of code:
 | 
			
		||||
 | 
			
		||||
1) The Time Base Registers (TBL)
 | 
			
		||||
2) The Performance Monitor Counter Registers (PMC)
 | 
			
		||||
 | 
			
		||||
The first ones are always available, always active, but they're not very
 | 
			
		||||
accurate: the registers increment by one every four *bus* cycles. On
 | 
			
		||||
my 667 Mhz tiBook (ppc7450), this means once every twenty *processor*
 | 
			
		||||
cycles. So we won't use that.
 | 
			
		||||
 | 
			
		||||
The PMC are much more useful: not only can they report cycle-accurate
 | 
			
		||||
timing, but they can also be used to monitor many other parameters,
 | 
			
		||||
such as the number of AltiVec stalls for every kind of instruction,
 | 
			
		||||
or instruction cache misses. The downside is that not all processors
 | 
			
		||||
support the PMC (all G3, all G4 and the 970 do support them), and
 | 
			
		||||
they're inactive by default - you need to activate them with a
 | 
			
		||||
dedicated tool. Also, the number of available PMC depends on the
 | 
			
		||||
procesor: the various 604 have 2, the various 75x (aka. G3) have 4,
 | 
			
		||||
and the various 74xx (aka G4) have 6.
 | 
			
		||||
 | 
			
		||||
*WARNING*: The PowerPC 970 is not very well documented, and its PMC
 | 
			
		||||
registers are 64 bits wide. To properly notify the code, you *must*
 | 
			
		||||
tune for the 970 (using --tune=970), or the code will assume 32 bit
 | 
			
		||||
registers.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
II - Enabling FFmpeg PowerPC performance support
 | 
			
		||||
 | 
			
		||||
This needs to be done by hand. First, you need to configure FFmpeg as
 | 
			
		||||
usual, but add the "--powerpc-perf-enable" option. For instance:
 | 
			
		||||
 | 
			
		||||
#####
 | 
			
		||||
./configure --prefix=/usr/local/ffmpeg-svn --cc=gcc-3.3 --tune=7450 --powerpc-perf-enable
 | 
			
		||||
#####
 | 
			
		||||
 | 
			
		||||
This will configure FFmpeg to install inside /usr/local/ffmpeg-svn,
 | 
			
		||||
compiling with gcc-3.3 (you should try to use this one or a newer
 | 
			
		||||
gcc), and tuning for the PowerPC 7450 (i.e. the newer G4; as a rule of
 | 
			
		||||
thumb, those at 550Mhz and more). It will also enable the PMC.
 | 
			
		||||
 | 
			
		||||
You may also edit the file "config.h" to enable the following line:
 | 
			
		||||
 | 
			
		||||
#####
 | 
			
		||||
// #define ALTIVEC_USE_REFERENCE_C_CODE 1
 | 
			
		||||
#####
 | 
			
		||||
 | 
			
		||||
If you enable this line, then the code will not make use of AltiVec,
 | 
			
		||||
but will use the reference C code instead. This is useful to compare
 | 
			
		||||
performance between two versions of the code.
 | 
			
		||||
 | 
			
		||||
Also, the number of enabled PMC is defined in "libavcodec/ppc/dsputil_ppc.h":
 | 
			
		||||
 | 
			
		||||
#####
 | 
			
		||||
#define POWERPC_NUM_PMC_ENABLED 4
 | 
			
		||||
#####
 | 
			
		||||
 | 
			
		||||
If you have a G4 CPU, you can enable all 6 PMC. DO NOT enable more
 | 
			
		||||
PMC than available on your CPU!
 | 
			
		||||
 | 
			
		||||
Then, simply compile FFmpeg as usual (make && make install).
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
III - Using FFmpeg PowerPC performance support
 | 
			
		||||
 | 
			
		||||
This FFmeg can be used exactly as usual. But before exiting, FFmpeg
 | 
			
		||||
will dump a per-function report that looks like this:
 | 
			
		||||
 | 
			
		||||
#####
 | 
			
		||||
PowerPC performance report
 | 
			
		||||
 Values are from the PMC registers, and represent whatever the
 | 
			
		||||
 registers are set to record.
 | 
			
		||||
 Function "gmc1_altivec" (pmc1):
 | 
			
		||||
        min: 231
 | 
			
		||||
        max: 1339867
 | 
			
		||||
        avg: 558.25 (255302)
 | 
			
		||||
 Function "gmc1_altivec" (pmc2):
 | 
			
		||||
        min: 93
 | 
			
		||||
        max: 2164
 | 
			
		||||
        avg: 267.31 (255302)
 | 
			
		||||
 Function "gmc1_altivec" (pmc3):
 | 
			
		||||
        min: 72
 | 
			
		||||
        max: 1987
 | 
			
		||||
        avg: 276.20 (255302)
 | 
			
		||||
(...)
 | 
			
		||||
#####
 | 
			
		||||
 | 
			
		||||
In this example, PMC1 was set to record CPU cycles, PMC2 was set to
 | 
			
		||||
record AltiVec Permute Stall Cycles, and PMC3 was set to record AltiVec
 | 
			
		||||
Issue Stalls.
 | 
			
		||||
 | 
			
		||||
The function "gmc1_altivec" was monitored 255302 times, and the
 | 
			
		||||
minimum execution time was 231 processor cycles. The max and average
 | 
			
		||||
aren't much use, as it's very likely the OS interrupted execution for
 | 
			
		||||
reasons of its own :-(
 | 
			
		||||
 | 
			
		||||
With the exact same settings and source file, but using the reference C
 | 
			
		||||
code we get:
 | 
			
		||||
 | 
			
		||||
#####
 | 
			
		||||
PowerPC performance report
 | 
			
		||||
 Values are from the PMC registers, and represent whatever the
 | 
			
		||||
 registers are set to record.
 | 
			
		||||
 Function "gmc1_altivec" (pmc1):
 | 
			
		||||
        min: 592
 | 
			
		||||
        max: 2532235
 | 
			
		||||
        avg: 962.88 (255302)
 | 
			
		||||
 Function "gmc1_altivec" (pmc2):
 | 
			
		||||
        min: 0
 | 
			
		||||
        max: 33
 | 
			
		||||
        avg: 0.00 (255302)
 | 
			
		||||
 Function "gmc1_altivec" (pmc3):
 | 
			
		||||
        min: 0
 | 
			
		||||
        max: 350
 | 
			
		||||
        avg: 0.03 (255302)
 | 
			
		||||
(...)
 | 
			
		||||
#####
 | 
			
		||||
 | 
			
		||||
592 cycles, so the fastest AltiVec execution is about 2.5x faster than
 | 
			
		||||
the fastest C execution in this example. It's not perfect but it's not
 | 
			
		||||
bad (well I wrote this function so I can't say otherwise :-).
 | 
			
		||||
 | 
			
		||||
Once you have that kind of report, you can try to improve things by
 | 
			
		||||
finding what goes wrong and fixing it; in the example above, one
 | 
			
		||||
should try to diminish the number of AltiVec stalls, as this *may*
 | 
			
		||||
improve performance.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
IV) Enabling the PMC in Mac OS X
 | 
			
		||||
 | 
			
		||||
This is easy. Use "Monster" and "monster". Those tools come from
 | 
			
		||||
Apple's CHUD package, and can be found hidden in the developer web
 | 
			
		||||
site & FTP site. "MONster" is the graphical application, use it to
 | 
			
		||||
generate a config file specifying what each register should
 | 
			
		||||
monitor. Then use the command-line application "monster" to use that
 | 
			
		||||
config file, and enjoy the results.
 | 
			
		||||
 | 
			
		||||
Note that "MONster" can be used for many other things, but it's
 | 
			
		||||
documented by Apple, it's not my subject.
 | 
			
		||||
 | 
			
		||||
If you are using CHUD 4.4.2 or later, you'll notice that MONster is
 | 
			
		||||
no longer available. It's been superseeded by Shark, where
 | 
			
		||||
configuration of PMCs is available as a plugin.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
V) Enabling the PMC on Linux
 | 
			
		||||
 | 
			
		||||
On linux you may use oprofile from http://oprofile.sf.net, depending on the
 | 
			
		||||
version and the cpu you may need to apply a patch[1] to access a set of the
 | 
			
		||||
possibile counters from the userspace application. You can always define them
 | 
			
		||||
using the kernel interface /dev/oprofile/* .
 | 
			
		||||
 | 
			
		||||
[1] http://dev.gentoo.org/~lu_zero/development/oprofile-g4-20060423.patch
 | 
			
		||||
 | 
			
		||||
--
 | 
			
		||||
Romain Dolbeau <romain@dolbeau.org>
 | 
			
		||||
Luca Barbato <lu_zero@gentoo.org>
 | 
			
		||||
@@ -1,102 +1,76 @@
 | 
			
		||||
\input texinfo @c -*- texinfo -*-
 | 
			
		||||
 | 
			
		||||
@settitle ffplay Documentation
 | 
			
		||||
@settitle FFplay Documentation
 | 
			
		||||
@titlepage
 | 
			
		||||
@center @titlefont{ffplay Documentation}
 | 
			
		||||
@sp 7
 | 
			
		||||
@center @titlefont{FFplay Documentation}
 | 
			
		||||
@sp 3
 | 
			
		||||
@end titlepage
 | 
			
		||||
 | 
			
		||||
@top
 | 
			
		||||
 | 
			
		||||
@contents
 | 
			
		||||
@chapter Introduction
 | 
			
		||||
 | 
			
		||||
@chapter Synopsis
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
@c man begin SYNOPSIS
 | 
			
		||||
ffplay [options] [@file{input_file}]
 | 
			
		||||
@c man end
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@chapter Description
 | 
			
		||||
@c man begin DESCRIPTION
 | 
			
		||||
 | 
			
		||||
FFplay is a very simple and portable media player using the FFmpeg
 | 
			
		||||
libraries and the SDL library. It is mostly used as a testbed for the
 | 
			
		||||
various FFmpeg APIs.
 | 
			
		||||
@c man end
 | 
			
		||||
 | 
			
		||||
@chapter Options
 | 
			
		||||
@chapter Invocation
 | 
			
		||||
 | 
			
		||||
@section Syntax
 | 
			
		||||
@example
 | 
			
		||||
@c man begin SYNOPSIS
 | 
			
		||||
ffplay [options] @file{input_file}
 | 
			
		||||
@c man end
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@c man begin OPTIONS
 | 
			
		||||
 | 
			
		||||
@include avtools-common-opts.texi
 | 
			
		||||
 | 
			
		||||
@section Main options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
@item -h
 | 
			
		||||
Show help.
 | 
			
		||||
@item -version
 | 
			
		||||
Show version.
 | 
			
		||||
@item -L
 | 
			
		||||
Show license.
 | 
			
		||||
@item -formats
 | 
			
		||||
Show available formats, codecs, protocols, ...
 | 
			
		||||
@item -x @var{width}
 | 
			
		||||
Force displayed width.
 | 
			
		||||
@item -y @var{height}
 | 
			
		||||
Force displayed height.
 | 
			
		||||
@item -s @var{size}
 | 
			
		||||
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.
 | 
			
		||||
Set frame size (WxH or abbreviation), needed for videos which don't
 | 
			
		||||
contain a header with the frame size like raw YUV.
 | 
			
		||||
@item -an
 | 
			
		||||
Disable audio.
 | 
			
		||||
@item -vn
 | 
			
		||||
Disable video.
 | 
			
		||||
@item -ss @var{pos}
 | 
			
		||||
Seek to a given position in seconds.
 | 
			
		||||
@item -t @var{duration}
 | 
			
		||||
play <duration> seconds of audio/video
 | 
			
		||||
@item -bytes
 | 
			
		||||
Seek by bytes.
 | 
			
		||||
@item -nodisp
 | 
			
		||||
Disable graphical display.
 | 
			
		||||
@item -f @var{fmt}
 | 
			
		||||
Force format.
 | 
			
		||||
@item -window_title @var{title}
 | 
			
		||||
Set window title (default is the input filename).
 | 
			
		||||
@item -loop @var{number}
 | 
			
		||||
Loops movie playback <number> times. 0 means forever.
 | 
			
		||||
@item -showmode @var{mode}
 | 
			
		||||
Set the show mode to use.
 | 
			
		||||
Available values for @var{mode} are:
 | 
			
		||||
@table @samp
 | 
			
		||||
@item 0, video
 | 
			
		||||
show video
 | 
			
		||||
@item 1, waves
 | 
			
		||||
show audio waves
 | 
			
		||||
@item 2, rdft
 | 
			
		||||
show audio frequency band using RDFT ((Inverse) Real Discrete Fourier Transform)
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
Default value is "video", if video is not present or cannot be played
 | 
			
		||||
"rdft" is automatically selected.
 | 
			
		||||
 | 
			
		||||
You can interactively cycle through the available show modes by
 | 
			
		||||
pressing the key @key{w}.
 | 
			
		||||
 | 
			
		||||
@item -vf @var{filter_graph}
 | 
			
		||||
@var{filter_graph} is a description of the filter graph to apply to
 | 
			
		||||
the input video.
 | 
			
		||||
Use the option "-filters" to show all the available filters (including
 | 
			
		||||
also sources and sinks).
 | 
			
		||||
 | 
			
		||||
@item -i @var{input_file}
 | 
			
		||||
Read @var{input_file}.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section Advanced options
 | 
			
		||||
@table @option
 | 
			
		||||
@item -pix_fmt @var{format}
 | 
			
		||||
Set pixel format.
 | 
			
		||||
This option has been deprecated in favor of private options, try -pixel_format.
 | 
			
		||||
@item -stats
 | 
			
		||||
Show the stream duration, the codec parameters, the current position in
 | 
			
		||||
the stream and the audio/video synchronisation drift.
 | 
			
		||||
@item -debug
 | 
			
		||||
Print specific debug info.
 | 
			
		||||
@item -bug
 | 
			
		||||
Work around bugs.
 | 
			
		||||
@item -vismv
 | 
			
		||||
Visualize motion vectors.
 | 
			
		||||
@item -fast
 | 
			
		||||
Non-spec-compliant optimizations.
 | 
			
		||||
@item -genpts
 | 
			
		||||
@@ -128,14 +102,6 @@ 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
 | 
			
		||||
Exit if any key is pressed.
 | 
			
		||||
@item -exitonmousedown
 | 
			
		||||
Exit if any mouse button is pressed.
 | 
			
		||||
@item -codec:@var{stream_type}
 | 
			
		||||
Force a specific decoder implementation
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section While playing
 | 
			
		||||
@@ -168,9 +134,6 @@ Seek backward/forward 10 seconds.
 | 
			
		||||
@item down/up
 | 
			
		||||
Seek backward/forward 1 minute.
 | 
			
		||||
 | 
			
		||||
@item page down/page up
 | 
			
		||||
Seek backward/forward 10 minutes.
 | 
			
		||||
 | 
			
		||||
@item mouse click
 | 
			
		||||
Seek to percentage in file corresponding to fraction of width.
 | 
			
		||||
 | 
			
		||||
@@ -178,27 +141,17 @@ Seek to percentage in file corresponding to fraction of width.
 | 
			
		||||
 | 
			
		||||
@c man end
 | 
			
		||||
 | 
			
		||||
@include syntax.texi
 | 
			
		||||
@include eval.texi
 | 
			
		||||
@include decoders.texi
 | 
			
		||||
@include demuxers.texi
 | 
			
		||||
@include muxers.texi
 | 
			
		||||
@include indevs.texi
 | 
			
		||||
@include outdevs.texi
 | 
			
		||||
@include protocols.texi
 | 
			
		||||
@include filters.texi
 | 
			
		||||
 | 
			
		||||
@ignore
 | 
			
		||||
 | 
			
		||||
@setfilename ffplay
 | 
			
		||||
@settitle FFplay media player
 | 
			
		||||
 | 
			
		||||
@c man begin SEEALSO
 | 
			
		||||
ffmpeg(1), ffprobe(1), ffserver(1) and the FFmpeg HTML documentation
 | 
			
		||||
ffmpeg(1), ffserver(1) and the HTML documentation of @file{ffmpeg}.
 | 
			
		||||
@c man end
 | 
			
		||||
 | 
			
		||||
@c man begin AUTHORS
 | 
			
		||||
The FFmpeg developers
 | 
			
		||||
@c man begin AUTHOR
 | 
			
		||||
Fabrice Bellard
 | 
			
		||||
@c man end
 | 
			
		||||
 | 
			
		||||
@end ignore
 | 
			
		||||
							
								
								
									
										455
									
								
								doc/ffprobe.texi
									
									
									
									
									
								
							
							
						
						
									
										455
									
								
								doc/ffprobe.texi
									
									
									
									
									
								
							@@ -1,455 +0,0 @@
 | 
			
		||||
\input texinfo @c -*- texinfo -*-
 | 
			
		||||
 | 
			
		||||
@settitle ffprobe Documentation
 | 
			
		||||
@titlepage
 | 
			
		||||
@center @titlefont{ffprobe Documentation}
 | 
			
		||||
@end titlepage
 | 
			
		||||
 | 
			
		||||
@top
 | 
			
		||||
 | 
			
		||||
@contents
 | 
			
		||||
 | 
			
		||||
@chapter Synopsis
 | 
			
		||||
 | 
			
		||||
The generic syntax is:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
@c man begin SYNOPSIS
 | 
			
		||||
ffprobe [options] [@file{input_file}]
 | 
			
		||||
@c man end
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@chapter Description
 | 
			
		||||
@c man begin DESCRIPTION
 | 
			
		||||
 | 
			
		||||
ffprobe gathers information from multimedia streams and prints it in
 | 
			
		||||
human- and machine-readable fashion.
 | 
			
		||||
 | 
			
		||||
For example it can be used to check the format of the container used
 | 
			
		||||
by a multimedia stream and the format and type of each media stream
 | 
			
		||||
contained in it.
 | 
			
		||||
 | 
			
		||||
If a filename is specified in input, ffprobe will try to open and
 | 
			
		||||
probe the file content. If the file cannot be opened or recognized as
 | 
			
		||||
a multimedia file, a positive exit code is returned.
 | 
			
		||||
 | 
			
		||||
ffprobe may be employed both as a standalone application or in
 | 
			
		||||
combination with a textual filter, which may perform more
 | 
			
		||||
sophisticated processing, e.g. statistical processing or plotting.
 | 
			
		||||
 | 
			
		||||
Options are used to list some of the formats supported by ffprobe or
 | 
			
		||||
for specifying which information to display, and for setting how
 | 
			
		||||
ffprobe will show it.
 | 
			
		||||
 | 
			
		||||
ffprobe output is designed to be easily parsable by a textual filter,
 | 
			
		||||
and consists of one or more sections of a form defined by the selected
 | 
			
		||||
writer, which is specified by the @option{print_format} option.
 | 
			
		||||
 | 
			
		||||
Metadata tags stored in the container or in the streams are recognized
 | 
			
		||||
and printed in the corresponding "FORMAT" or "STREAM" section.
 | 
			
		||||
 | 
			
		||||
@c man end
 | 
			
		||||
 | 
			
		||||
@chapter Options
 | 
			
		||||
@c man begin OPTIONS
 | 
			
		||||
 | 
			
		||||
@include avtools-common-opts.texi
 | 
			
		||||
 | 
			
		||||
@section Main options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item -f @var{format}
 | 
			
		||||
Force format to use.
 | 
			
		||||
 | 
			
		||||
@item -unit
 | 
			
		||||
Show the unit of the displayed values.
 | 
			
		||||
 | 
			
		||||
@item -prefix
 | 
			
		||||
Use SI prefixes for the displayed values.
 | 
			
		||||
Unless the "-byte_binary_prefix" option is used all the prefixes
 | 
			
		||||
are decimal.
 | 
			
		||||
 | 
			
		||||
@item -byte_binary_prefix
 | 
			
		||||
Force the use of binary prefixes for byte values.
 | 
			
		||||
 | 
			
		||||
@item -sexagesimal
 | 
			
		||||
Use sexagesimal format HH:MM:SS.MICROSECONDS for time values.
 | 
			
		||||
 | 
			
		||||
@item -pretty
 | 
			
		||||
Prettify the format of the displayed values, it corresponds to the
 | 
			
		||||
options "-unit -prefix -byte_binary_prefix -sexagesimal".
 | 
			
		||||
 | 
			
		||||
@item -of, -print_format @var{writer_name}[=@var{writer_options}]
 | 
			
		||||
Set the output printing format.
 | 
			
		||||
 | 
			
		||||
@var{writer_name} specifies the name of the writer, and
 | 
			
		||||
@var{writer_options} specifies the options to be passed to the writer.
 | 
			
		||||
 | 
			
		||||
For example for printing the output in JSON format, specify:
 | 
			
		||||
@example
 | 
			
		||||
-print_format json
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
For more details on the available output printing formats, see the
 | 
			
		||||
Writers section below.
 | 
			
		||||
 | 
			
		||||
@item -show_data
 | 
			
		||||
Show payload data, as an hexadecimal and ASCII dump. Coupled with
 | 
			
		||||
@option{-show_packets}, it will dump the packets' data. Coupled with
 | 
			
		||||
@option{-show_streams}, it will dump the codec extradata.
 | 
			
		||||
 | 
			
		||||
The dump is printed as the "data" field. It may contain newlines.
 | 
			
		||||
 | 
			
		||||
@item -show_error
 | 
			
		||||
Show information about the error found when trying to probe the input.
 | 
			
		||||
 | 
			
		||||
The error information is printed within a section with name "ERROR".
 | 
			
		||||
 | 
			
		||||
@item -show_format
 | 
			
		||||
Show information about the container format of the input multimedia
 | 
			
		||||
stream.
 | 
			
		||||
 | 
			
		||||
All the container format information is printed within a section with
 | 
			
		||||
name "FORMAT".
 | 
			
		||||
 | 
			
		||||
@item -show_format_entry @var{name}
 | 
			
		||||
Like @option{-show_format}, but only prints the specified entry of the
 | 
			
		||||
container format information, rather than all. This option may be given more
 | 
			
		||||
than once, then all specified entries will be shown.
 | 
			
		||||
 | 
			
		||||
@item -show_packets
 | 
			
		||||
Show information about each packet contained in the input multimedia
 | 
			
		||||
stream.
 | 
			
		||||
 | 
			
		||||
The information for each single packet is printed within a dedicated
 | 
			
		||||
section with name "PACKET".
 | 
			
		||||
 | 
			
		||||
@item -show_frames
 | 
			
		||||
Show information about each frame contained in the input multimedia
 | 
			
		||||
stream.
 | 
			
		||||
 | 
			
		||||
The information for each single frame is printed within a dedicated
 | 
			
		||||
section with name "FRAME".
 | 
			
		||||
 | 
			
		||||
@item -show_streams
 | 
			
		||||
Show information about each media stream contained in the input
 | 
			
		||||
multimedia stream.
 | 
			
		||||
 | 
			
		||||
Each media stream information is printed within a dedicated section
 | 
			
		||||
with name "STREAM".
 | 
			
		||||
 | 
			
		||||
@item -count_frames
 | 
			
		||||
Count the number of frames per stream and report it in the
 | 
			
		||||
corresponding stream section.
 | 
			
		||||
 | 
			
		||||
@item -count_packets
 | 
			
		||||
Count the number of packets per stream and report it in the
 | 
			
		||||
corresponding stream section.
 | 
			
		||||
 | 
			
		||||
@item -show_private_data, -private
 | 
			
		||||
Show private data, that is data depending on the format of the
 | 
			
		||||
particular shown element.
 | 
			
		||||
This option is enabled by default, but you may need to disable it
 | 
			
		||||
for specific uses, for example when creating XSD-compliant XML output.
 | 
			
		||||
 | 
			
		||||
@item -show_program_version
 | 
			
		||||
Show information related to program version.
 | 
			
		||||
 | 
			
		||||
Version information is printed within a section with name
 | 
			
		||||
"PROGRAM_VERSION".
 | 
			
		||||
 | 
			
		||||
@item -show_library_versions
 | 
			
		||||
Show information related to library versions.
 | 
			
		||||
 | 
			
		||||
Version information for each library is printed within a section with
 | 
			
		||||
name "LIBRARY_VERSION".
 | 
			
		||||
 | 
			
		||||
@item -show_versions
 | 
			
		||||
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 -bitexact
 | 
			
		||||
Force bitexact output, useful to produce output which is not dependent
 | 
			
		||||
on the specific build.
 | 
			
		||||
 | 
			
		||||
@item -i @var{input_file}
 | 
			
		||||
Read @var{input_file}.
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
@c man end
 | 
			
		||||
 | 
			
		||||
@chapter Writers
 | 
			
		||||
@c man begin WRITERS
 | 
			
		||||
 | 
			
		||||
A writer defines the output format adopted by @command{ffprobe}, and will be
 | 
			
		||||
used for printing all the parts of the output.
 | 
			
		||||
 | 
			
		||||
A writer may accept one or more arguments, which specify the options to
 | 
			
		||||
adopt.
 | 
			
		||||
 | 
			
		||||
A description of the currently available writers follows.
 | 
			
		||||
 | 
			
		||||
@section default
 | 
			
		||||
Default format.
 | 
			
		||||
 | 
			
		||||
Print each section in the form:
 | 
			
		||||
@example
 | 
			
		||||
[SECTION]
 | 
			
		||||
key1=val1
 | 
			
		||||
...
 | 
			
		||||
keyN=valN
 | 
			
		||||
[/SECTION]
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Metadata tags are printed as a line in the corresponding FORMAT or
 | 
			
		||||
STREAM section, and are prefixed by the string "TAG:".
 | 
			
		||||
 | 
			
		||||
This writer accepts options as a list of @var{key}=@var{value} pairs,
 | 
			
		||||
separated by ":".
 | 
			
		||||
 | 
			
		||||
A description of the accepted options follows.
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item nokey, nk
 | 
			
		||||
If set to 1 specify not to print the key of each field. Default value
 | 
			
		||||
is 0.
 | 
			
		||||
 | 
			
		||||
@item noprint_wrappers, nw
 | 
			
		||||
If set to 1 specify not to print the section header and footer.
 | 
			
		||||
Default value is 0.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section compact, csv
 | 
			
		||||
Compact and CSV format.
 | 
			
		||||
 | 
			
		||||
The @code{csv} writer is equivalent to @code{compact}, but supports
 | 
			
		||||
different defaults.
 | 
			
		||||
 | 
			
		||||
Each section is printed on a single line.
 | 
			
		||||
If no option is specifid, the output has the form:
 | 
			
		||||
@example
 | 
			
		||||
section|key1=val1| ... |keyN=valN
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Metadata tags are printed in the corresponding "format" or "stream"
 | 
			
		||||
section. A metadata tag key, if printed, is prefixed by the string
 | 
			
		||||
"tag:".
 | 
			
		||||
 | 
			
		||||
This writer accepts options as a list of @var{key}=@var{value} pairs,
 | 
			
		||||
separated by ":".
 | 
			
		||||
 | 
			
		||||
The description of the accepted options follows.
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item item_sep, s
 | 
			
		||||
Specify the character to use for separating fields in the output line.
 | 
			
		||||
It must be a single printable character, it is "|" by default ("," for
 | 
			
		||||
the @code{csv} writer).
 | 
			
		||||
 | 
			
		||||
@item nokey, nk
 | 
			
		||||
If set to 1 specify not to print the key of each field. Its default
 | 
			
		||||
value is 0 (1 for the @code{csv} writer).
 | 
			
		||||
 | 
			
		||||
@item escape, e
 | 
			
		||||
Set the escape mode to use, default to "c" ("csv" for the @code{csv}
 | 
			
		||||
writer).
 | 
			
		||||
 | 
			
		||||
It can assume one of the following values:
 | 
			
		||||
@table @option
 | 
			
		||||
@item c
 | 
			
		||||
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 ('\n'), a carriage return ('\r'), a double quote
 | 
			
		||||
('"'), or @var{SEP} are enclosed in double-quotes.
 | 
			
		||||
 | 
			
		||||
@item none
 | 
			
		||||
Perform no escaping.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@item print_section, p
 | 
			
		||||
Print the section name at the begin of each line if the value is
 | 
			
		||||
@code{1}, disable it with value set to @code{0}. Default value is
 | 
			
		||||
@code{1}.
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section flat
 | 
			
		||||
Flat format.
 | 
			
		||||
 | 
			
		||||
A free-form output where each line contains an explicit key=value, such as
 | 
			
		||||
"streams.stream.3.tags.foo=bar". The output is shell escaped, so it can be
 | 
			
		||||
directly embedded in sh scripts as long as the separator character is an
 | 
			
		||||
alphanumeric character or an underscore (see @var{sep_char} option).
 | 
			
		||||
 | 
			
		||||
This writer accepts options as a list of @var{key}=@var{value} pairs,
 | 
			
		||||
separated by ":".
 | 
			
		||||
 | 
			
		||||
The description of the accepted options follows.
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
@item sep_char, s
 | 
			
		||||
Separator character used to separate the chapter, the section name, IDs and
 | 
			
		||||
potential tags in the printed field key.
 | 
			
		||||
 | 
			
		||||
Default value is '.'.
 | 
			
		||||
 | 
			
		||||
@item hierarchical, h
 | 
			
		||||
Specify if the section name specification should be hierarchical. If
 | 
			
		||||
set to 1, and if there is more than one section in the current
 | 
			
		||||
chapter, the section name will be prefixed by the name of the
 | 
			
		||||
chapter. A value of 0 will disable this behavior.
 | 
			
		||||
 | 
			
		||||
Default value is 1.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section ini
 | 
			
		||||
INI format output.
 | 
			
		||||
 | 
			
		||||
Print output in an INI based format.
 | 
			
		||||
 | 
			
		||||
The following conventions are adopted:
 | 
			
		||||
 | 
			
		||||
@itemize
 | 
			
		||||
@item
 | 
			
		||||
all key and values are UTF-8
 | 
			
		||||
@item
 | 
			
		||||
'.' is the subgroup separator
 | 
			
		||||
@item
 | 
			
		||||
newline, '\t', '\f', '\b' and the following characters are escaped
 | 
			
		||||
@item
 | 
			
		||||
'\' is the escape character
 | 
			
		||||
@item
 | 
			
		||||
'#' is the comment indicator
 | 
			
		||||
@item
 | 
			
		||||
'=' is the key/value separator
 | 
			
		||||
@item
 | 
			
		||||
':' 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 ":".
 | 
			
		||||
 | 
			
		||||
The description of the accepted options follows.
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
@item hierarchical, h
 | 
			
		||||
Specify if the section name specification should be hierarchical. If
 | 
			
		||||
set to 1, and if there is more than one section in the current
 | 
			
		||||
chapter, the section name will be prefixed by the name of the
 | 
			
		||||
chapter. A value of 0 will disable this behavior.
 | 
			
		||||
 | 
			
		||||
Default value is 1.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section json
 | 
			
		||||
JSON based format.
 | 
			
		||||
 | 
			
		||||
Each section is printed using JSON notation.
 | 
			
		||||
 | 
			
		||||
This writer accepts options as a list of @var{key}=@var{value} pairs,
 | 
			
		||||
separated by ":".
 | 
			
		||||
 | 
			
		||||
The description of the accepted options follows.
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item compact, c
 | 
			
		||||
If set to 1 enable compact output, that is each section will be
 | 
			
		||||
printed on a single line. Default value is 0.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
For more information about JSON, see @url{http://www.json.org/}.
 | 
			
		||||
 | 
			
		||||
@section xml
 | 
			
		||||
XML based format.
 | 
			
		||||
 | 
			
		||||
The XML output is described in the XML schema description file
 | 
			
		||||
@file{ffprobe.xsd} installed in the FFmpeg datadir.
 | 
			
		||||
 | 
			
		||||
An updated version of the schema can be retrieved at the url
 | 
			
		||||
@url{http://www.ffmpeg.org/schema/ffprobe.xsd}, which redirects to the
 | 
			
		||||
latest schema committed into the FFmpeg development source code tree.
 | 
			
		||||
 | 
			
		||||
Note that the output issued will be compliant to the
 | 
			
		||||
@file{ffprobe.xsd} schema only when no special global output options
 | 
			
		||||
(@option{unit}, @option{prefix}, @option{byte_binary_prefix},
 | 
			
		||||
@option{sexagesimal} etc.) are specified.
 | 
			
		||||
 | 
			
		||||
This writer accepts options as a list of @var{key}=@var{value} pairs,
 | 
			
		||||
separated by ":".
 | 
			
		||||
 | 
			
		||||
The description of the accepted options follows.
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item fully_qualified, q
 | 
			
		||||
If set to 1 specify if the output should be fully qualified. Default
 | 
			
		||||
value is 0.
 | 
			
		||||
This is required for generating an XML file which can be validated
 | 
			
		||||
through an XSD file.
 | 
			
		||||
 | 
			
		||||
@item xsd_compliant, x
 | 
			
		||||
If set to 1 perform more checks for ensuring that the output is XSD
 | 
			
		||||
compliant. Default value is 0.
 | 
			
		||||
This option automatically sets @option{fully_qualified} to 1.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
For more information about the XML format, see
 | 
			
		||||
@url{http://www.w3.org/XML/}.
 | 
			
		||||
@c man end WRITERS
 | 
			
		||||
 | 
			
		||||
@chapter Timecode
 | 
			
		||||
@c man begin TIMECODE
 | 
			
		||||
 | 
			
		||||
@command{ffprobe} supports Timecode extraction:
 | 
			
		||||
 | 
			
		||||
@itemize
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
MPEG1/2 timecode is extracted from the GOP, and is available in the video
 | 
			
		||||
stream details (@option{-show_streams}, see @var{timecode}).
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
MOV timecode is extracted from tmcd track, so is available in the tmcd
 | 
			
		||||
stream metadata (@option{-show_streams}, see @var{TAG:timecode}).
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
DV, GXF and AVI timecodes are available in format metadata
 | 
			
		||||
(@option{-show_format}, see @var{TAG:timecode}).
 | 
			
		||||
 | 
			
		||||
@end itemize
 | 
			
		||||
@c man end TIMECODE
 | 
			
		||||
 | 
			
		||||
@include syntax.texi
 | 
			
		||||
@include decoders.texi
 | 
			
		||||
@include demuxers.texi
 | 
			
		||||
@include protocols.texi
 | 
			
		||||
@include indevs.texi
 | 
			
		||||
 | 
			
		||||
@ignore
 | 
			
		||||
 | 
			
		||||
@setfilename ffprobe
 | 
			
		||||
@settitle ffprobe media prober
 | 
			
		||||
 | 
			
		||||
@c man begin SEEALSO
 | 
			
		||||
ffmpeg(1), ffplay(1), ffserver(1) and the FFmpeg HTML documentation
 | 
			
		||||
@c man end
 | 
			
		||||
 | 
			
		||||
@c man begin AUTHORS
 | 
			
		||||
The FFmpeg developers
 | 
			
		||||
@c man end
 | 
			
		||||
 | 
			
		||||
@end ignore
 | 
			
		||||
 | 
			
		||||
@bye
 | 
			
		||||
							
								
								
									
										182
									
								
								doc/ffprobe.xsd
									
									
									
									
									
								
							
							
						
						
									
										182
									
								
								doc/ffprobe.xsd
									
									
									
									
									
								
							@@ -1,182 +0,0 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
 | 
			
		||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 | 
			
		||||
    targetNamespace="http://www.ffmpeg.org/schema/ffprobe"
 | 
			
		||||
    xmlns:ffprobe="http://www.ffmpeg.org/schema/ffprobe">
 | 
			
		||||
 | 
			
		||||
    <xsd:element name="ffprobe" type="ffprobe:ffprobeType"/>
 | 
			
		||||
 | 
			
		||||
    <xsd:complexType name="ffprobeType">
 | 
			
		||||
        <xsd:sequence>
 | 
			
		||||
            <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="streams"  type="ffprobe:streamsType" minOccurs="0" maxOccurs="1" />
 | 
			
		||||
            <xsd:element name="format"   type="ffprobe:formatType"  minOccurs="0" maxOccurs="1" />
 | 
			
		||||
            <xsd:element name="error"    type="ffprobe:errorType"   minOccurs="0" maxOccurs="1" />
 | 
			
		||||
            <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:sequence>
 | 
			
		||||
    </xsd:complexType>
 | 
			
		||||
 | 
			
		||||
    <xsd:complexType name="packetsType">
 | 
			
		||||
        <xsd:sequence>
 | 
			
		||||
            <xsd:element name="packet" type="ffprobe:packetType" minOccurs="0" maxOccurs="unbounded"/>
 | 
			
		||||
        </xsd:sequence>
 | 
			
		||||
    </xsd:complexType>
 | 
			
		||||
 | 
			
		||||
    <xsd:complexType name="framesType">
 | 
			
		||||
        <xsd:sequence>
 | 
			
		||||
            <xsd:element name="frame" type="ffprobe:frameType" minOccurs="0" maxOccurs="unbounded"/>
 | 
			
		||||
        </xsd:sequence>
 | 
			
		||||
    </xsd:complexType>
 | 
			
		||||
 | 
			
		||||
    <xsd:complexType name="packetType">
 | 
			
		||||
      <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"  />
 | 
			
		||||
      <xsd:attribute name="pts_time"      type="xsd:float" />
 | 
			
		||||
      <xsd:attribute name="dts"           type="xsd:long"  />
 | 
			
		||||
      <xsd:attribute name="dts_time"      type="xsd:float" />
 | 
			
		||||
      <xsd:attribute name="duration"      type="xsd:long"  />
 | 
			
		||||
      <xsd:attribute name="duration_time" type="xsd:float" />
 | 
			
		||||
      <xsd:attribute name="convergence_duration"      type="xsd:long"  />
 | 
			
		||||
      <xsd:attribute name="convergence_duration_time" type="xsd:float" />
 | 
			
		||||
      <xsd:attribute name="size"          type="xsd:long" use="required" />
 | 
			
		||||
      <xsd:attribute name="pos"           type="xsd:long"  />
 | 
			
		||||
      <xsd:attribute name="flags"         type="xsd:string" use="required" />
 | 
			
		||||
      <xsd:attribute name="data"          type="xsd:string" />
 | 
			
		||||
    </xsd:complexType>
 | 
			
		||||
 | 
			
		||||
    <xsd:complexType name="frameType">
 | 
			
		||||
      <xsd:attribute name="media_type"    type="xsd:string" use="required"/>
 | 
			
		||||
      <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"/>
 | 
			
		||||
      <xsd:attribute name="pkt_pts"       type="xsd:long" />
 | 
			
		||||
      <xsd:attribute name="pkt_pts_time"  type="xsd:float"/>
 | 
			
		||||
      <xsd:attribute name="pkt_dts"       type="xsd:long" />
 | 
			
		||||
      <xsd:attribute name="pkt_dts_time"  type="xsd:float"/>
 | 
			
		||||
      <xsd:attribute name="pkt_duration"  type="xsd:long" />
 | 
			
		||||
      <xsd:attribute name="pkt_duration_time" type="xsd:float"/>
 | 
			
		||||
      <xsd:attribute name="pkt_pos"       type="xsd:long" />
 | 
			
		||||
 | 
			
		||||
      <!-- audio attributes -->
 | 
			
		||||
      <xsd:attribute name="sample_fmt"             type="xsd:string"/>
 | 
			
		||||
      <xsd:attribute name="nb_samples"             type="xsd:long"  />
 | 
			
		||||
      <xsd:attribute name="channels"               type="xsd:int"   />
 | 
			
		||||
      <xsd:attribute name="channel_layout"         type="xsd:string"/>
 | 
			
		||||
 | 
			
		||||
      <!-- video attributes -->
 | 
			
		||||
      <xsd:attribute name="width"                  type="xsd:long"  />
 | 
			
		||||
      <xsd:attribute name="height"                 type="xsd:long"  />
 | 
			
		||||
      <xsd:attribute name="pix_fmt"                type="xsd:string"/>
 | 
			
		||||
      <xsd:attribute name="sample_aspect_ratio"    type="xsd:string"/>
 | 
			
		||||
      <xsd:attribute name="pict_type"              type="xsd:string"/>
 | 
			
		||||
      <xsd:attribute name="coded_picture_number"   type="xsd:long"  />
 | 
			
		||||
      <xsd:attribute name="display_picture_number" type="xsd:long"  />
 | 
			
		||||
      <xsd:attribute name="interlaced_frame"       type="xsd:int"   />
 | 
			
		||||
      <xsd:attribute name="top_field_first"        type="xsd:int"   />
 | 
			
		||||
      <xsd:attribute name="repeat_pict"            type="xsd:int"   />
 | 
			
		||||
      <xsd:attribute name="reference"              type="xsd:int"   />
 | 
			
		||||
    </xsd:complexType>
 | 
			
		||||
 | 
			
		||||
    <xsd:complexType name="streamsType">
 | 
			
		||||
        <xsd:sequence>
 | 
			
		||||
            <xsd:element name="stream" type="ffprobe:streamType" minOccurs="0" maxOccurs="unbounded"/>
 | 
			
		||||
        </xsd:sequence>
 | 
			
		||||
    </xsd:complexType>
 | 
			
		||||
 | 
			
		||||
    <xsd:complexType name="streamType">
 | 
			
		||||
      <xsd:sequence>
 | 
			
		||||
        <xsd:element name="tag" type="ffprobe:tagType" minOccurs="0" maxOccurs="unbounded"/>
 | 
			
		||||
      </xsd:sequence>
 | 
			
		||||
 | 
			
		||||
      <xsd:attribute name="index"            type="xsd:int" use="required"/>
 | 
			
		||||
      <xsd:attribute name="codec_name"       type="xsd:string" />
 | 
			
		||||
      <xsd:attribute name="codec_long_name"  type="xsd:string" />
 | 
			
		||||
      <xsd:attribute name="profile"          type="xsd:string" />
 | 
			
		||||
      <xsd:attribute name="codec_type"       type="xsd:string" />
 | 
			
		||||
      <xsd:attribute name="codec_time_base"  type="xsd:string" use="required"/>
 | 
			
		||||
      <xsd:attribute name="codec_tag"        type="xsd:string" use="required"/>
 | 
			
		||||
      <xsd:attribute name="codec_tag_string" type="xsd:string" use="required"/>
 | 
			
		||||
      <xsd:attribute name="extradata"        type="xsd:string" />
 | 
			
		||||
 | 
			
		||||
      <!-- video attributes -->
 | 
			
		||||
      <xsd:attribute name="width"                type="xsd:int"/>
 | 
			
		||||
      <xsd:attribute name="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"/>
 | 
			
		||||
      <xsd:attribute name="pix_fmt"              type="xsd:string"/>
 | 
			
		||||
      <xsd:attribute name="level"                type="xsd:int"/>
 | 
			
		||||
      <xsd:attribute name="timecode"             type="xsd:string"/>
 | 
			
		||||
 | 
			
		||||
      <!-- audio attributes -->
 | 
			
		||||
      <xsd:attribute name="sample_fmt"       type="xsd:string"/>
 | 
			
		||||
      <xsd:attribute name="sample_rate"      type="xsd:int"/>
 | 
			
		||||
      <xsd:attribute name="channels"         type="xsd:int"/>
 | 
			
		||||
      <xsd:attribute name="bits_per_sample"  type="xsd:int"/>
 | 
			
		||||
 | 
			
		||||
      <xsd:attribute name="id"               type="xsd:string"/>
 | 
			
		||||
      <xsd:attribute name="r_frame_rate"     type="xsd:string" use="required"/>
 | 
			
		||||
      <xsd:attribute name="avg_frame_rate"   type="xsd:string" use="required"/>
 | 
			
		||||
      <xsd:attribute name="time_base"        type="xsd:string" use="required"/>
 | 
			
		||||
      <xsd:attribute name="start_pts"        type="xsd:long"/>
 | 
			
		||||
      <xsd:attribute name="start_time"       type="xsd:float"/>
 | 
			
		||||
      <xsd:attribute name="duration_ts"      type="xsd:long"/>
 | 
			
		||||
      <xsd:attribute name="duration"         type="xsd:float"/>
 | 
			
		||||
      <xsd:attribute name="bit_rate"         type="xsd:int"/>
 | 
			
		||||
      <xsd:attribute name="nb_frames"        type="xsd:int"/>
 | 
			
		||||
      <xsd:attribute name="nb_read_frames"   type="xsd:int"/>
 | 
			
		||||
      <xsd:attribute name="nb_read_packets"  type="xsd:int"/>
 | 
			
		||||
    </xsd:complexType>
 | 
			
		||||
 | 
			
		||||
    <xsd:complexType name="formatType">
 | 
			
		||||
      <xsd:sequence>
 | 
			
		||||
        <xsd:element name="tag" type="ffprobe:tagType" minOccurs="0" maxOccurs="unbounded"/>
 | 
			
		||||
      </xsd:sequence>
 | 
			
		||||
 | 
			
		||||
      <xsd:attribute name="filename"         type="xsd:string" use="required"/>
 | 
			
		||||
      <xsd:attribute name="nb_streams"       type="xsd:int"    use="required"/>
 | 
			
		||||
      <xsd:attribute name="format_name"      type="xsd:string" use="required"/>
 | 
			
		||||
      <xsd:attribute name="format_long_name" type="xsd:string"/>
 | 
			
		||||
      <xsd:attribute name="start_time"       type="xsd:float"/>
 | 
			
		||||
      <xsd:attribute name="duration"         type="xsd:float"/>
 | 
			
		||||
      <xsd:attribute name="size"             type="xsd:long"/>
 | 
			
		||||
      <xsd:attribute name="bit_rate"         type="xsd:long"/>
 | 
			
		||||
    </xsd:complexType>
 | 
			
		||||
 | 
			
		||||
    <xsd:complexType name="tagType">
 | 
			
		||||
      <xsd:attribute name="key"   type="xsd:string" use="required"/>
 | 
			
		||||
      <xsd:attribute name="value" type="xsd:string" use="required"/>
 | 
			
		||||
    </xsd:complexType>
 | 
			
		||||
 | 
			
		||||
    <xsd:complexType name="errorType">
 | 
			
		||||
      <xsd:attribute name="code"   type="xsd:int"    use="required"/>
 | 
			
		||||
      <xsd:attribute name="string" type="xsd:string" use="required"/>
 | 
			
		||||
    </xsd:complexType>
 | 
			
		||||
 | 
			
		||||
    <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" use="required"/>
 | 
			
		||||
      <xsd:attribute name="build_time"       type="xsd:string" use="required"/>
 | 
			
		||||
      <xsd:attribute name="compiler_type"    type="xsd:string" use="required"/>
 | 
			
		||||
      <xsd:attribute name="compiler_version" type="xsd:string" use="required"/>
 | 
			
		||||
      <xsd:attribute name="configuration"    type="xsd:string" use="required"/>
 | 
			
		||||
    </xsd:complexType>
 | 
			
		||||
 | 
			
		||||
    <xsd:complexType name="libraryVersionType">
 | 
			
		||||
      <xsd:attribute name="name"        type="xsd:string" use="required"/>
 | 
			
		||||
      <xsd:attribute name="major"       type="xsd:int"    use="required"/>
 | 
			
		||||
      <xsd:attribute name="minor"       type="xsd:int"    use="required"/>
 | 
			
		||||
      <xsd:attribute name="micro"       type="xsd:int"    use="required"/>
 | 
			
		||||
      <xsd:attribute name="version"     type="xsd:int"    use="required"/>
 | 
			
		||||
    </xsd:complexType>
 | 
			
		||||
 | 
			
		||||
    <xsd:complexType name="libraryVersionsType">
 | 
			
		||||
        <xsd:sequence>
 | 
			
		||||
          <xsd:element name="library_version" type="ffprobe:libraryVersionType" minOccurs="0" maxOccurs="unbounded"/>
 | 
			
		||||
        </xsd:sequence>
 | 
			
		||||
    </xsd:complexType>
 | 
			
		||||
</xsd:schema>
 | 
			
		||||
@@ -1,46 +1,34 @@
 | 
			
		||||
\input texinfo @c -*- texinfo -*-
 | 
			
		||||
 | 
			
		||||
@settitle ffserver Documentation
 | 
			
		||||
@settitle FFserver Documentation
 | 
			
		||||
@titlepage
 | 
			
		||||
@center @titlefont{ffserver Documentation}
 | 
			
		||||
@sp 7
 | 
			
		||||
@center @titlefont{FFserver Documentation}
 | 
			
		||||
@sp 3
 | 
			
		||||
@end titlepage
 | 
			
		||||
 | 
			
		||||
@top
 | 
			
		||||
 | 
			
		||||
@contents
 | 
			
		||||
@chapter Introduction
 | 
			
		||||
 | 
			
		||||
@chapter Synopsys
 | 
			
		||||
 | 
			
		||||
The generic syntax is:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
@c man begin SYNOPSIS
 | 
			
		||||
ffserver [options]
 | 
			
		||||
@c man end
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@chapter Description
 | 
			
		||||
@c man begin DESCRIPTION
 | 
			
		||||
 | 
			
		||||
ffserver is a streaming server for both audio and video. It supports
 | 
			
		||||
 | 
			
		||||
FFserver is a streaming server for both audio and video. It supports
 | 
			
		||||
several live feeds, streaming from files and time shifting on live feeds
 | 
			
		||||
(you can seek to positions in the past on each live feed, provided you
 | 
			
		||||
specify a big enough feed storage in ffserver.conf).
 | 
			
		||||
 | 
			
		||||
ffserver runs in daemon mode by default; that is, it puts itself in
 | 
			
		||||
FFserver runs in daemon mode by default; that is, it puts itself in
 | 
			
		||||
the background and detaches from its TTY, unless it is launched in
 | 
			
		||||
debug mode or a NoDaemon option is specified in the configuration
 | 
			
		||||
file.
 | 
			
		||||
 | 
			
		||||
This documentation covers only the streaming aspects of ffserver /
 | 
			
		||||
ffmpeg. All questions about parameters for ffmpeg, codec questions,
 | 
			
		||||
etc. are not covered here. Read @file{ffmpeg.html} for more
 | 
			
		||||
etc. are not covered here. Read @file{ffmpeg-doc.html} for more
 | 
			
		||||
information.
 | 
			
		||||
 | 
			
		||||
@section How does it work?
 | 
			
		||||
 | 
			
		||||
ffserver receives prerecorded files or FFM streams from some ffmpeg
 | 
			
		||||
FFserver receives prerecorded files or FFM streams from some ffmpeg
 | 
			
		||||
instance as input, then streams them over RTP/RTSP/HTTP.
 | 
			
		||||
 | 
			
		||||
An ffserver instance will listen on some port as specified in the
 | 
			
		||||
@@ -58,7 +46,7 @@ file.
 | 
			
		||||
 | 
			
		||||
@section Status stream
 | 
			
		||||
 | 
			
		||||
ffserver supports an HTTP interface which exposes the current status
 | 
			
		||||
FFserver supports an HTTP interface which exposes the current status
 | 
			
		||||
of the server.
 | 
			
		||||
 | 
			
		||||
Simply point your browser to the address of the special status stream
 | 
			
		||||
@@ -111,8 +99,8 @@ As a simple test, just run the following two command lines where INPUTFILE
 | 
			
		||||
is some file which you can decode with ffmpeg:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffserver -f doc/ffserver.conf &
 | 
			
		||||
ffmpeg -i INPUTFILE http://localhost:8090/feed1.ffm
 | 
			
		||||
./ffserver -f doc/ffserver.conf &
 | 
			
		||||
./ffmpeg -i INPUTFILE http://localhost:8090/feed1.ffm
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
At this point you should be able to go to your Windows machine and fire up
 | 
			
		||||
@@ -147,7 +135,7 @@ that only captures in stereo and also requires that one channel be flipped.
 | 
			
		||||
If you are one of these people, then export 'AUDIO_FLIP_LEFT=1' before
 | 
			
		||||
starting ffmpeg.
 | 
			
		||||
 | 
			
		||||
@subsection The audio and video lose sync after a while.
 | 
			
		||||
@subsection The audio and video loose sync after a while.
 | 
			
		||||
 | 
			
		||||
Yes, they do.
 | 
			
		||||
 | 
			
		||||
@@ -238,20 +226,31 @@ You use this by adding the ?date= to the end of the URL for the stream.
 | 
			
		||||
For example:   @samp{http://localhost:8080/test.asf?date=2002-07-26T23:05:00}.
 | 
			
		||||
@c man end
 | 
			
		||||
 | 
			
		||||
@chapter Options
 | 
			
		||||
@chapter Invocation
 | 
			
		||||
@section Syntax
 | 
			
		||||
@example
 | 
			
		||||
@c man begin SYNOPSIS
 | 
			
		||||
ffserver [options]
 | 
			
		||||
@c man end
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@section Options
 | 
			
		||||
@c man begin OPTIONS
 | 
			
		||||
 | 
			
		||||
@include avtools-common-opts.texi
 | 
			
		||||
 | 
			
		||||
@section Main options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
@item -version
 | 
			
		||||
Show version.
 | 
			
		||||
@item -L
 | 
			
		||||
Show license.
 | 
			
		||||
@item -formats
 | 
			
		||||
Show available formats, codecs, protocols, ...
 | 
			
		||||
@item -h
 | 
			
		||||
Show help.
 | 
			
		||||
@item -f @var{configfile}
 | 
			
		||||
Use @file{configfile} instead of @file{/etc/ffserver.conf}.
 | 
			
		||||
@item -n
 | 
			
		||||
Enable no-launch mode. This option disables all the Launch directives
 | 
			
		||||
within the various <Stream> sections. Since ffserver will not launch
 | 
			
		||||
any ffmpeg instances, you will have to launch them manually.
 | 
			
		||||
within the various <Stream> sections. FFserver will not launch any
 | 
			
		||||
ffmpeg instance, so you will have to launch them manually.
 | 
			
		||||
@item -d
 | 
			
		||||
Enable debug mode. This option increases log verbosity, directs log
 | 
			
		||||
messages to stdout and causes ffserver to run in the foreground
 | 
			
		||||
@@ -262,16 +261,15 @@ rather than as a daemon.
 | 
			
		||||
@ignore
 | 
			
		||||
 | 
			
		||||
@setfilename ffserver
 | 
			
		||||
@settitle ffserver video server
 | 
			
		||||
@settitle FFserver video server
 | 
			
		||||
 | 
			
		||||
@c man begin SEEALSO
 | 
			
		||||
 | 
			
		||||
ffmpeg(1), ffplay(1), ffprobe(1), the @file{ffserver.conf}
 | 
			
		||||
example and the FFmpeg HTML documentation
 | 
			
		||||
ffmpeg(1), ffplay(1), the @file{ffmpeg/doc/ffserver.conf} example and
 | 
			
		||||
the HTML documentation of @file{ffmpeg}.
 | 
			
		||||
@c man end
 | 
			
		||||
 | 
			
		||||
@c man begin AUTHORS
 | 
			
		||||
The FFmpeg developers
 | 
			
		||||
@c man begin AUTHOR
 | 
			
		||||
Fabrice Bellard
 | 
			
		||||
@c man end
 | 
			
		||||
 | 
			
		||||
@end ignore
 | 
			
		||||
@@ -306,27 +306,6 @@ StartSendOnKey
 | 
			
		||||
#</Stream>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Transcode an incoming live feed to another live feed,
 | 
			
		||||
# using libx264 and video presets
 | 
			
		||||
 | 
			
		||||
#<Stream live.h264>
 | 
			
		||||
#Format rtp
 | 
			
		||||
#Feed feed1.ffm
 | 
			
		||||
#VideoCodec libx264
 | 
			
		||||
#VideoFrameRate 24
 | 
			
		||||
#VideoBitRate 100
 | 
			
		||||
#VideoSize 480x272
 | 
			
		||||
#AVPresetVideo default
 | 
			
		||||
#AVPresetVideo baseline
 | 
			
		||||
#AVOptionVideo flags +global_header
 | 
			
		||||
#
 | 
			
		||||
#AudioCodec libfaac
 | 
			
		||||
#AudioBitRate 32
 | 
			
		||||
#AudioChannels 2
 | 
			
		||||
#AudioSampleRate 22050
 | 
			
		||||
#AVOptionAudio flags +global_header
 | 
			
		||||
#</Stream>
 | 
			
		||||
 | 
			
		||||
##################################################################
 | 
			
		||||
# SDP/multicast examples
 | 
			
		||||
#
 | 
			
		||||
@@ -373,3 +352,5 @@ ACL allow 192.168.0.0 192.168.255.255
 | 
			
		||||
<Redirect index.html>
 | 
			
		||||
URL http://www.ffmpeg.org/
 | 
			
		||||
</Redirect>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,269 +0,0 @@
 | 
			
		||||
Filter design
 | 
			
		||||
=============
 | 
			
		||||
 | 
			
		||||
This document explains guidelines that should be observed (or ignored with
 | 
			
		||||
good reason) when writing filters for libavfilter.
 | 
			
		||||
 | 
			
		||||
In this document, the word “frame” indicates either a video frame or a group
 | 
			
		||||
of audio samples, as stored in an AVFilterBuffer structure.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Format negotiation
 | 
			
		||||
==================
 | 
			
		||||
 | 
			
		||||
  The query_formats method should set, for each input and each output links,
 | 
			
		||||
  the list of supported formats.
 | 
			
		||||
 | 
			
		||||
  For video links, that means pixel format. For audio links, that means
 | 
			
		||||
  channel layout, and sample format (the sample packing is implied by the
 | 
			
		||||
  sample format).
 | 
			
		||||
 | 
			
		||||
  The lists are not just lists, they are references to shared objects. When
 | 
			
		||||
  the negotiation mechanism computes the intersection of the formats
 | 
			
		||||
  supported at each ends of a link, all references to both lists are
 | 
			
		||||
  replaced with a reference to the intersection. And when a single format is
 | 
			
		||||
  eventually chosen for a link amongst the remaining list, again, all
 | 
			
		||||
  references to the list are updated.
 | 
			
		||||
 | 
			
		||||
  That means that if a filter requires that its input and output have the
 | 
			
		||||
  same format amongst a supported list, all it has to do is use a reference
 | 
			
		||||
  to the same list of formats.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Buffer references ownership and permissions
 | 
			
		||||
===========================================
 | 
			
		||||
 | 
			
		||||
  Principle
 | 
			
		||||
  ---------
 | 
			
		||||
 | 
			
		||||
    Audio and video data are voluminous; the buffer and buffer reference
 | 
			
		||||
    mechanism is intended to avoid, as much as possible, expensive copies of
 | 
			
		||||
    that data while still allowing the filters to produce correct results.
 | 
			
		||||
 | 
			
		||||
    The data is stored in buffers represented by AVFilterBuffer structures.
 | 
			
		||||
    They must not be accessed directly, but through references stored in
 | 
			
		||||
    AVFilterBufferRef structures. Several references can point to the
 | 
			
		||||
    same buffer; the buffer is automatically deallocated once all
 | 
			
		||||
    corresponding references have been destroyed.
 | 
			
		||||
 | 
			
		||||
    The characteristics of the data (resolution, sample rate, etc.) are
 | 
			
		||||
    stored in the reference; different references for the same buffer can
 | 
			
		||||
    show different characteristics. In particular, a video reference can
 | 
			
		||||
    point to only a part of a video buffer.
 | 
			
		||||
 | 
			
		||||
    A reference is usually obtained as input to the start_frame or
 | 
			
		||||
    filter_samples method or requested using the ff_get_video_buffer or
 | 
			
		||||
    ff_get_audio_buffer functions. A new reference on an existing buffer can
 | 
			
		||||
    be created with the avfilter_ref_buffer. A reference is destroyed using
 | 
			
		||||
    the avfilter_unref_bufferp function.
 | 
			
		||||
 | 
			
		||||
  Reference ownership
 | 
			
		||||
  -------------------
 | 
			
		||||
 | 
			
		||||
    At any time, a reference “belongs” to a particular piece of code,
 | 
			
		||||
    usually a filter. With a few caveats that will be explained below, only
 | 
			
		||||
    that piece of code is allowed to access it. It is also responsible for
 | 
			
		||||
    destroying it, although this is sometimes done automatically (see the
 | 
			
		||||
    section on link reference fields).
 | 
			
		||||
 | 
			
		||||
    Here are the (fairly obvious) rules for reference ownership:
 | 
			
		||||
 | 
			
		||||
    * A reference received by the start_frame or filter_samples method
 | 
			
		||||
      belong to the corresponding filter.
 | 
			
		||||
 | 
			
		||||
      Special exception: for video references: the reference may be used
 | 
			
		||||
      internally for automatic copying and must not be destroyed before
 | 
			
		||||
      end_frame; it can be given away to ff_start_frame.
 | 
			
		||||
 | 
			
		||||
    * A reference passed to ff_start_frame or ff_filter_samples is given
 | 
			
		||||
      away and must no longer be used.
 | 
			
		||||
 | 
			
		||||
    * A reference created with avfilter_ref_buffer belongs to the code that
 | 
			
		||||
      created it.
 | 
			
		||||
 | 
			
		||||
    * A reference obtained with ff_get_video_buffer or ff_get_audio_buffer
 | 
			
		||||
      belongs to the code that requested it.
 | 
			
		||||
 | 
			
		||||
    * A reference given as return value by the get_video_buffer or
 | 
			
		||||
      get_audio_buffer method is given away and must no longer be used.
 | 
			
		||||
 | 
			
		||||
  Link reference fields
 | 
			
		||||
  ---------------------
 | 
			
		||||
 | 
			
		||||
    The AVFilterLink structure has a few AVFilterBufferRef fields. Here are
 | 
			
		||||
    the rules to handle them:
 | 
			
		||||
 | 
			
		||||
    * cur_buf is set before the start_frame and filter_samples methods to
 | 
			
		||||
      the same reference given as argument to the methods and belongs to the
 | 
			
		||||
      destination filter of the link. If it has not been cleared after
 | 
			
		||||
      end_frame or filter_samples, libavfilter will automatically destroy
 | 
			
		||||
      the reference; therefore, any filter that needs to keep the reference
 | 
			
		||||
      for longer must set cur_buf to NULL.
 | 
			
		||||
 | 
			
		||||
    * out_buf belongs to the source filter of the link and can be used to
 | 
			
		||||
      store a reference to the buffer that has been sent to the destination.
 | 
			
		||||
      If it is not NULL after end_frame or filter_samples, libavfilter will
 | 
			
		||||
      automatically destroy the reference.
 | 
			
		||||
 | 
			
		||||
      If a video input pad does not have a start_frame method, the default
 | 
			
		||||
      method will request a buffer on the first output of the filter, store
 | 
			
		||||
      the reference in out_buf and push a second reference to the output.
 | 
			
		||||
 | 
			
		||||
    * src_buf, cur_buf_copy and partial_buf are used by libavfilter
 | 
			
		||||
      internally and must not be accessed by filters.
 | 
			
		||||
 | 
			
		||||
  Reference permissions
 | 
			
		||||
  ---------------------
 | 
			
		||||
 | 
			
		||||
    The AVFilterBufferRef structure has a perms field that describes what
 | 
			
		||||
    the code that owns the reference is allowed to do to the buffer data.
 | 
			
		||||
    Different references for the same buffer can have different permissions.
 | 
			
		||||
 | 
			
		||||
    For video filters, the permissions only apply to the parts of the buffer
 | 
			
		||||
    that have already been covered by the draw_slice method.
 | 
			
		||||
 | 
			
		||||
    The value is a binary OR of the following constants:
 | 
			
		||||
 | 
			
		||||
    * AV_PERM_READ: the owner can read the buffer data; this is essentially
 | 
			
		||||
      always true and is there for self-documentation.
 | 
			
		||||
 | 
			
		||||
    * AV_PERM_WRITE: the owner can modify the buffer data.
 | 
			
		||||
 | 
			
		||||
    * AV_PERM_PRESERVE: the owner can rely on the fact that the buffer data
 | 
			
		||||
      will not be modified by previous filters.
 | 
			
		||||
 | 
			
		||||
    * AV_PERM_REUSE: the owner can output the buffer several times, without
 | 
			
		||||
      modifying the data in between.
 | 
			
		||||
 | 
			
		||||
    * AV_PERM_REUSE2: the owner can output the buffer several times and
 | 
			
		||||
      modify the data in between (useless without the WRITE permissions).
 | 
			
		||||
 | 
			
		||||
    * AV_PERM_ALIGN: the owner can access the data using fast operations
 | 
			
		||||
      that require data alignment.
 | 
			
		||||
 | 
			
		||||
    The READ, WRITE and PRESERVE permissions are about sharing the same
 | 
			
		||||
    buffer between several filters to avoid expensive copies without them
 | 
			
		||||
    doing conflicting changes on the data.
 | 
			
		||||
 | 
			
		||||
    The REUSE and REUSE2 permissions are about special memory for direct
 | 
			
		||||
    rendering. For example a buffer directly allocated in video memory must
 | 
			
		||||
    not modified once it is displayed on screen, or it will cause tearing;
 | 
			
		||||
    it will therefore not have the REUSE2 permission.
 | 
			
		||||
 | 
			
		||||
    The ALIGN permission is about extracting part of the buffer, for
 | 
			
		||||
    copy-less padding or cropping for example.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    References received on input pads are guaranteed to have all the
 | 
			
		||||
    permissions stated in the min_perms field and none of the permissions
 | 
			
		||||
    stated in the rej_perms.
 | 
			
		||||
 | 
			
		||||
    References obtained by ff_get_video_buffer and ff_get_audio_buffer are
 | 
			
		||||
    guaranteed to have at least all the permissions requested as argument.
 | 
			
		||||
 | 
			
		||||
    References created by avfilter_ref_buffer have the same permissions as
 | 
			
		||||
    the original reference minus the ones explicitly masked; the mask is
 | 
			
		||||
    usually ~0 to keep the same permissions.
 | 
			
		||||
 | 
			
		||||
    Filters should remove permissions on reference they give to output
 | 
			
		||||
    whenever necessary. It can be automatically done by setting the
 | 
			
		||||
    rej_perms field on the output pad.
 | 
			
		||||
 | 
			
		||||
    Here are a few guidelines corresponding to common situations:
 | 
			
		||||
 | 
			
		||||
    * Filters that modify and forward their frame (like drawtext) need the
 | 
			
		||||
      WRITE permission.
 | 
			
		||||
 | 
			
		||||
    * Filters that read their input to produce a new frame on output (like
 | 
			
		||||
      scale) need the READ permission on input and and must request a buffer
 | 
			
		||||
      with the WRITE permission.
 | 
			
		||||
 | 
			
		||||
    * Filters that intend to keep a reference after the filtering process
 | 
			
		||||
      is finished (after end_frame or filter_samples returns) must have the
 | 
			
		||||
      PRESERVE permission on it and remove the WRITE permission if they
 | 
			
		||||
      create a new reference to give it away.
 | 
			
		||||
 | 
			
		||||
    * Filters that intend to modify a reference they have kept after the end
 | 
			
		||||
      of the filtering process need the REUSE2 permission and must remove
 | 
			
		||||
      the PRESERVE permission if they create a new reference to give it
 | 
			
		||||
      away.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Frame scheduling
 | 
			
		||||
================
 | 
			
		||||
 | 
			
		||||
  The purpose of these rules is to ensure that frames flow in the filter
 | 
			
		||||
  graph without getting stuck and accumulating somewhere.
 | 
			
		||||
 | 
			
		||||
  Simple filters that output one frame for each input frame should not have
 | 
			
		||||
  to worry about it.
 | 
			
		||||
 | 
			
		||||
  start_frame / filter_samples
 | 
			
		||||
  ----------------------------
 | 
			
		||||
 | 
			
		||||
    These methods are called when a frame is pushed to the filter's input.
 | 
			
		||||
    They can be called at any time except in a reentrant way.
 | 
			
		||||
 | 
			
		||||
    If the input frame is enough to produce output, then the filter should
 | 
			
		||||
    push the output frames on the output link immediately.
 | 
			
		||||
 | 
			
		||||
    As an exception to the previous rule, if the input frame is enough to
 | 
			
		||||
    produce several output frames, then the filter needs output only at
 | 
			
		||||
    least one per link. The additional frames can be left buffered in the
 | 
			
		||||
    filter; these buffered frames must be flushed immediately if a new input
 | 
			
		||||
    produces new output.
 | 
			
		||||
 | 
			
		||||
    (Example: framerate-doubling filter: start_frame must (1) flush the
 | 
			
		||||
    second copy of the previous frame, if it is still there, (2) push the
 | 
			
		||||
    first copy of the incoming frame, (3) keep the second copy for later.)
 | 
			
		||||
 | 
			
		||||
    If the input frame is not enough to produce output, the filter must not
 | 
			
		||||
    call request_frame to get more. It must just process the frame or queue
 | 
			
		||||
    it. The task of requesting more frames is left to the filter's
 | 
			
		||||
    request_frame method or the application.
 | 
			
		||||
 | 
			
		||||
    If a filter has several inputs, the filter must be ready for frames
 | 
			
		||||
    arriving randomly on any input. Therefore, any filter with several inputs
 | 
			
		||||
    will most likely require some kind of queuing mechanism. It is perfectly
 | 
			
		||||
    acceptable to have a limited queue and to drop frames when the inputs
 | 
			
		||||
    are too unbalanced.
 | 
			
		||||
 | 
			
		||||
  request_frame
 | 
			
		||||
  -------------
 | 
			
		||||
 | 
			
		||||
    This method is called when a frame is wanted on an output.
 | 
			
		||||
 | 
			
		||||
    For an input, it should directly call start_frame or filter_samples on
 | 
			
		||||
    the corresponding output.
 | 
			
		||||
 | 
			
		||||
    For a filter, if there are queued frames already ready, one of these
 | 
			
		||||
    frames should be pushed. If not, the filter should request a frame on
 | 
			
		||||
    one of its inputs, repeatedly until at least one frame has been pushed.
 | 
			
		||||
 | 
			
		||||
    Return values:
 | 
			
		||||
    if request_frame could produce a frame, it should return 0;
 | 
			
		||||
    if it could not for temporary reasons, it should return AVERROR(EAGAIN);
 | 
			
		||||
    if it could not because there are no more frames, it should return
 | 
			
		||||
    AVERROR_EOF.
 | 
			
		||||
 | 
			
		||||
    The typical implementation of request_frame for a filter with several
 | 
			
		||||
    inputs will look like that:
 | 
			
		||||
 | 
			
		||||
        if (frames_queued) {
 | 
			
		||||
            push_one_frame();
 | 
			
		||||
            return 0;
 | 
			
		||||
        }
 | 
			
		||||
        while (!frame_pushed) {
 | 
			
		||||
            input = input_where_a_frame_is_most_needed();
 | 
			
		||||
            ret = avfilter_request_frame(input);
 | 
			
		||||
            if (ret == AVERROR_EOF) {
 | 
			
		||||
                process_eof_on_input();
 | 
			
		||||
            } else if (ret < 0) {
 | 
			
		||||
                return ret;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return 0;
 | 
			
		||||
 | 
			
		||||
    Note that, except for filters that can have queued frames, request_frame
 | 
			
		||||
    does not push frames: it requests them to its input, and as a reaction,
 | 
			
		||||
    the start_frame / filter_samples method will be called and do the work.
 | 
			
		||||
							
								
								
									
										4754
									
								
								doc/filters.texi
									
									
									
									
									
								
							
							
						
						
									
										4754
									
								
								doc/filters.texi
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										1153
									
								
								doc/general.texi
									
									
									
									
									
								
							
							
						
						
									
										1153
									
								
								doc/general.texi
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -1,415 +0,0 @@
 | 
			
		||||
\input texinfo @c -*- texinfo -*-
 | 
			
		||||
 | 
			
		||||
@settitle Using git to develop FFmpeg
 | 
			
		||||
 | 
			
		||||
@titlepage
 | 
			
		||||
@center @titlefont{Using git to develop FFmpeg}
 | 
			
		||||
@end titlepage
 | 
			
		||||
 | 
			
		||||
@top
 | 
			
		||||
 | 
			
		||||
@contents
 | 
			
		||||
 | 
			
		||||
@chapter Introduction
 | 
			
		||||
 | 
			
		||||
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:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
git --help
 | 
			
		||||
man git
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
shows you the available subcommands,
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
git <command> --help
 | 
			
		||||
man git-<command>
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
shows information about the subcommand <command>.
 | 
			
		||||
 | 
			
		||||
Additional information could be found on the
 | 
			
		||||
@url{http://gitref.org, Git Reference} website
 | 
			
		||||
 | 
			
		||||
For more information about the Git project, visit the
 | 
			
		||||
 | 
			
		||||
@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
 | 
			
		||||
 | 
			
		||||
@chapter Basics Usage
 | 
			
		||||
 | 
			
		||||
@section Get GIT
 | 
			
		||||
 | 
			
		||||
You can get git from @url{http://git-scm.com/}
 | 
			
		||||
Most distribution and operating system provide a package for it.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section Cloning the source tree
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
git clone git://source.ffmpeg.org/ffmpeg <target>
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
This will put the FFmpeg sources into the directory @var{<target>}.
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
git clone git@@source.ffmpeg.org:ffmpeg <target>
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
This will put the FFmpeg sources into the directory @var{<target>} and let
 | 
			
		||||
you push back your changes to the remote repository.
 | 
			
		||||
 | 
			
		||||
Make sure that you do not have Windows line endings in your checkouts,
 | 
			
		||||
otherwise you may experience spurious compilation failures. One way to
 | 
			
		||||
achieve this is to run
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
git config --global core.autocrlf false
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section Updating the source tree to the latest revision
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
git pull (--rebase)
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
pulls in the latest changes from the tracked branch. The tracked branch
 | 
			
		||||
can be remote. By default the master branch tracks the branch master in
 | 
			
		||||
the remote origin.
 | 
			
		||||
 | 
			
		||||
@float IMPORTANT
 | 
			
		||||
@command{--rebase} (see below) is recommended.
 | 
			
		||||
@end float
 | 
			
		||||
 | 
			
		||||
@section Rebasing your local branches
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
git pull --rebase
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
fetches the changes from the main repository and replays your local commits
 | 
			
		||||
over it. This is required to keep all your local changes at the top of
 | 
			
		||||
FFmpeg's master tree. The master tree will reject pushes with merge commits.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section Adding/removing files/directories
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
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
 | 
			
		||||
directory that makes files appear or disappear.
 | 
			
		||||
Line moves across files are automatically tracked.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section Showing modifications
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
git diff <filename(s)>
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
will show all local modifications in your working directory as unified diff.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section Inspecting the changelog
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
git log <filename(s)>
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
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
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
git status
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
detects all the changes you made and lists what actions will be taken in case
 | 
			
		||||
of a commit (additions, modifications, deletions, etc.).
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section Committing
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
git diff --check
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
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.
 | 
			
		||||
 | 
			
		||||
For cosmetics-only commits you should get (almost) empty output from
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
git diff -w -b <filename(s)>
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Also check the output of
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
git status
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
to make sure you don't have untracked files or deletions.
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
git add [-i|-p|-A] <filenames/dirnames>
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
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 @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
 | 
			
		||||
added to the commit.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
git commit
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Git will commit the selected changes to your current local branch.
 | 
			
		||||
 | 
			
		||||
You will be prompted for a log message in an editor, which is either
 | 
			
		||||
set in your personal configuration file through
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
git config --global core.editor
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
or set by one of the following environment variables:
 | 
			
		||||
@var{GIT_EDITOR}, @var{VISUAL} or @var{EDITOR}.
 | 
			
		||||
 | 
			
		||||
Log messages should be concise but descriptive. Explain why you made a change,
 | 
			
		||||
what you did will be obvious from the changes themselves most of the time.
 | 
			
		||||
Saying just "bug fix" or "10l" is bad. Remember that people of varying skill
 | 
			
		||||
levels look at and educate themselves while reading through your code. Don't
 | 
			
		||||
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 git format-patch.
 | 
			
		||||
 | 
			
		||||
@section Preparing a patchset
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
git format-patch <commit> [-o directory]
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
will generate a set of patches for each commit between @var{<commit>} and
 | 
			
		||||
current @var{HEAD}. E.g.
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
git format-patch origin/master
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
will generate patches for all commits on current branch which are not
 | 
			
		||||
present in upstream.
 | 
			
		||||
A useful shortcut is also
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
git format-patch -n
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
which will generate patches from last @var{n} commits.
 | 
			
		||||
By default the patches are created in the current directory.
 | 
			
		||||
 | 
			
		||||
@section Sending patches for review
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
git send-email <commit list|directory>
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
will send the patches created by @command{git format-patch} or directly
 | 
			
		||||
generates them. All the email fields can be configured in the global/local
 | 
			
		||||
configuration or overridden by command line.
 | 
			
		||||
Note that this tool must often be installed separately (e.g. @var{git-email}
 | 
			
		||||
package on Debian-based distros).
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section Renaming/moving/copying files or contents of files
 | 
			
		||||
 | 
			
		||||
Git automatically tracks such changes, making those normal commits.
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
mv/cp path/file otherpath/otherfile
 | 
			
		||||
git add [-A] .
 | 
			
		||||
git commit
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@chapter Git configuration
 | 
			
		||||
 | 
			
		||||
In order to simplify a few workflows, it is advisable to configure both
 | 
			
		||||
your personal Git installation and your local FFmpeg repository.
 | 
			
		||||
 | 
			
		||||
@section Personal Git installation
 | 
			
		||||
 | 
			
		||||
Add the following to your @file{~/.gitconfig} to help @command{git send-email}
 | 
			
		||||
and @command{git format-patch} detect renames:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
[diff]
 | 
			
		||||
        renames = copy
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@section Repository configuration
 | 
			
		||||
 | 
			
		||||
In order to have @command{git send-email} automatically send patches
 | 
			
		||||
to the ffmpeg-devel mailing list, add the following stanza
 | 
			
		||||
to @file{/path/to/ffmpeg/repository/.git/config}:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
[sendemail]
 | 
			
		||||
        to = ffmpeg-devel@@ffmpeg.org
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@chapter FFmpeg specific
 | 
			
		||||
 | 
			
		||||
@section Reverting broken commits
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
git reset <commit>
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@command{git reset} will uncommit the changes till @var{<commit>} rewriting
 | 
			
		||||
the current branch history.
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
git commit --amend
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
allows to amend the last commit details quickly.
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
git rebase -i origin/master
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
will replay local commits over the main repository allowing to edit, merge
 | 
			
		||||
or remove some of them in the process.
 | 
			
		||||
 | 
			
		||||
@float NOTE
 | 
			
		||||
@command{git reset}, @command{git commit --amend} and @command{git rebase}
 | 
			
		||||
rewrite history, so you should use them ONLY on your local or topic branches.
 | 
			
		||||
The main repository will reject those changes.
 | 
			
		||||
@end float
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
git revert <commit>
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@command{git revert} will generate a revert commit. This will not make the
 | 
			
		||||
faulty commit disappear from the history.
 | 
			
		||||
 | 
			
		||||
@section Pushing changes to remote trees
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
git push
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
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 and to sync the local tree.
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
git remote add <name> <url>
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Will add additional remote with a name reference, it is useful if you want
 | 
			
		||||
to push your local branch for review on a remote host.
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
git push <remote> <refspec>
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Will push the changes to the @var{<remote>} repository.
 | 
			
		||||
Omitting @var{<refspec>} makes @command{git push} update all the remote
 | 
			
		||||
branches matching the local ones.
 | 
			
		||||
 | 
			
		||||
@section Finding a specific svn revision
 | 
			
		||||
 | 
			
		||||
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 @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
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
git checkout -b svn_23456 $SHA1
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
where @var{$SHA1} is the commit hash from the @command{git log} output.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@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
 | 
			
		||||
proper order. This list tries to be exhaustive. In case you are just
 | 
			
		||||
pushing a typo in a comment, some of the steps may be unnecessary.
 | 
			
		||||
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 --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.
 | 
			
		||||
 | 
			
		||||
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 check}
 | 
			
		||||
@item if fate fails due to missing samples run @command{make fate-rsync} and retry
 | 
			
		||||
@end itemize
 | 
			
		||||
 | 
			
		||||
Make sure all your changes have been checked before pushing them, the
 | 
			
		||||
testsuite only checks against regressions and that only to some extend. It does
 | 
			
		||||
obviously not check newly added features/code to be working unless you have
 | 
			
		||||
added a test for that (which is recommended).
 | 
			
		||||
 | 
			
		||||
Also note that every single commit should pass the test suite, not just
 | 
			
		||||
the result of a series of patches.
 | 
			
		||||
 | 
			
		||||
Once everything passed, push the changes to your public ffmpeg clone and post a
 | 
			
		||||
merge request to ffmpeg-devel. You can also push them directly but this is not
 | 
			
		||||
recommended.
 | 
			
		||||
 | 
			
		||||
@chapter Server Issues
 | 
			
		||||
 | 
			
		||||
Contact the project admins @email{root@@ffmpeg.org} if you have technical
 | 
			
		||||
problems with the GIT server.
 | 
			
		||||
@@ -1,273 +0,0 @@
 | 
			
		||||
 | 
			
		||||
About Git write access:
 | 
			
		||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
			
		||||
 | 
			
		||||
Before everything else, you should know how to use GIT properly.
 | 
			
		||||
Luckily Git comes with excellent documentation.
 | 
			
		||||
 | 
			
		||||
  git --help
 | 
			
		||||
  man git
 | 
			
		||||
 | 
			
		||||
shows you the available subcommands,
 | 
			
		||||
 | 
			
		||||
  git <command> --help
 | 
			
		||||
  man git-<command>
 | 
			
		||||
 | 
			
		||||
shows information about the subcommand <command>.
 | 
			
		||||
 | 
			
		||||
The most comprehensive manual is the website Git Reference
 | 
			
		||||
 | 
			
		||||
http://gitref.org/
 | 
			
		||||
 | 
			
		||||
For more information about the Git project, visit
 | 
			
		||||
 | 
			
		||||
http://git-scm.com/
 | 
			
		||||
 | 
			
		||||
Consult these resources whenever you have problems, they are quite exhaustive.
 | 
			
		||||
 | 
			
		||||
You do not need a special username or password.
 | 
			
		||||
All you need is to provide a ssh public key to the Git server admin.
 | 
			
		||||
 | 
			
		||||
What follows now is a basic introduction to Git and some FFmpeg-specific
 | 
			
		||||
guidelines. Read it at least once, if you are granted commit privileges to the
 | 
			
		||||
FFmpeg project you are expected to be familiar with these rules.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
I. BASICS:
 | 
			
		||||
==========
 | 
			
		||||
 | 
			
		||||
0. Get GIT:
 | 
			
		||||
 | 
			
		||||
  Most distributions have a git package, if not
 | 
			
		||||
  You can get git from http://git-scm.com/
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
1. Cloning the source tree:
 | 
			
		||||
 | 
			
		||||
    git clone git://source.ffmpeg.org/ffmpeg <target>
 | 
			
		||||
 | 
			
		||||
  This will put the FFmpeg sources into the directory <target>.
 | 
			
		||||
 | 
			
		||||
    git clone git@source.ffmpeg.org:ffmpeg <target>
 | 
			
		||||
 | 
			
		||||
  This will put the FFmpeg sources into the directory <target> and let
 | 
			
		||||
  you push back your changes to the remote repository.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
2. Updating the source tree to the latest revision:
 | 
			
		||||
 | 
			
		||||
    git pull (--ff-only)
 | 
			
		||||
 | 
			
		||||
  pulls in the latest changes from the tracked branch. The tracked branch
 | 
			
		||||
  can be remote. By default the master branch tracks the branch master in
 | 
			
		||||
  the remote origin.
 | 
			
		||||
  Caveat: Since merge commits are forbidden at least for the initial
 | 
			
		||||
          months of git --ff-only or --rebase (see below) are recommended.
 | 
			
		||||
          --ff-only will fail and not create merge commits if your branch
 | 
			
		||||
          has diverged (has a different history) from the tracked branch.
 | 
			
		||||
 | 
			
		||||
2.a Rebasing your local branches:
 | 
			
		||||
 | 
			
		||||
    git pull --rebase
 | 
			
		||||
 | 
			
		||||
  fetches the changes from the main repository and replays your local commits
 | 
			
		||||
  over it. This is required to keep all your local changes at the top of
 | 
			
		||||
  FFmpeg's master tree. The master tree will reject pushes with merge commits.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
3. Adding/removing files/directories:
 | 
			
		||||
 | 
			
		||||
    git add [-A] <filename/dirname>
 | 
			
		||||
    git rm [-r] <filename/dirname>
 | 
			
		||||
 | 
			
		||||
  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.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
4. Showing modifications:
 | 
			
		||||
 | 
			
		||||
    git diff <filename(s)>
 | 
			
		||||
 | 
			
		||||
  will show all local modifications in your working directory as unified diff.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
5. Inspecting the changelog:
 | 
			
		||||
 | 
			
		||||
    git log <filename(s)>
 | 
			
		||||
 | 
			
		||||
  You may also use the graphical tools like gitview or gitk or the web
 | 
			
		||||
  interface available at http://source.ffmpeg.org
 | 
			
		||||
 | 
			
		||||
6. Checking source tree status:
 | 
			
		||||
 | 
			
		||||
    git status
 | 
			
		||||
 | 
			
		||||
  detects all the changes you made and lists what actions will be taken in case
 | 
			
		||||
  of a commit (additions, modifications, deletions, etc.).
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
7. Committing:
 | 
			
		||||
 | 
			
		||||
    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.
 | 
			
		||||
 | 
			
		||||
  For cosmetics-only commits you should get (almost) empty output from
 | 
			
		||||
 | 
			
		||||
    git diff -w -b <filename(s)>
 | 
			
		||||
 | 
			
		||||
  Also check the output of
 | 
			
		||||
 | 
			
		||||
    git status
 | 
			
		||||
 | 
			
		||||
  to make sure you don't have untracked files or deletions.
 | 
			
		||||
 | 
			
		||||
    git add [-i|-p|-A] <filenames/dirnames>
 | 
			
		||||
 | 
			
		||||
  Make sure you have told git your name and email address, e.g. by running
 | 
			
		||||
    git config --global user.name "My Name"
 | 
			
		||||
    git config --global user.email my@email.invalid
 | 
			
		||||
  (--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
 | 
			
		||||
  added to the commit.
 | 
			
		||||
 | 
			
		||||
    git commit
 | 
			
		||||
 | 
			
		||||
  Git will commit the selected changes to your current local branch.
 | 
			
		||||
 | 
			
		||||
  You will be prompted for a log message in an editor, which is either
 | 
			
		||||
  set in your personal configuration file through
 | 
			
		||||
 | 
			
		||||
    git config core.editor
 | 
			
		||||
 | 
			
		||||
  or set by one of the following environment variables:
 | 
			
		||||
  GIT_EDITOR, VISUAL or EDITOR.
 | 
			
		||||
 | 
			
		||||
  Log messages should be concise but descriptive. Explain why you made a change,
 | 
			
		||||
  what you did will be obvious from the changes themselves most of the time.
 | 
			
		||||
  Saying just "bug fix" or "10l" is bad. Remember that people of varying skill
 | 
			
		||||
  levels look at and educate themselves while reading through your code. Don't
 | 
			
		||||
  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 git format-patch.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
8. Renaming/moving/copying files or contents of files:
 | 
			
		||||
 | 
			
		||||
  Git automatically tracks such changes, making those normal commits.
 | 
			
		||||
 | 
			
		||||
    mv/cp path/file otherpath/otherfile
 | 
			
		||||
 | 
			
		||||
    git add [-A] .
 | 
			
		||||
 | 
			
		||||
    git commit
 | 
			
		||||
 | 
			
		||||
  Do not move, rename or copy files of which you are not the maintainer without
 | 
			
		||||
  discussing it on the mailing list first!
 | 
			
		||||
 | 
			
		||||
9. Reverting broken commits
 | 
			
		||||
 | 
			
		||||
    git revert <commit>
 | 
			
		||||
 | 
			
		||||
  git revert will generate a revert commit. This will not make the faulty
 | 
			
		||||
  commit disappear from the history.
 | 
			
		||||
 | 
			
		||||
    git reset <commit>
 | 
			
		||||
 | 
			
		||||
  git reset will uncommit the changes till <commit> rewriting the current
 | 
			
		||||
  branch history.
 | 
			
		||||
 | 
			
		||||
    git commit --amend
 | 
			
		||||
 | 
			
		||||
  allows to amend the last commit details quickly.
 | 
			
		||||
 | 
			
		||||
    git rebase -i origin/master
 | 
			
		||||
 | 
			
		||||
  will replay local commits over the main repository allowing to edit,
 | 
			
		||||
  merge or remove some of them in the process.
 | 
			
		||||
 | 
			
		||||
  Note that the reset, commit --amend and rebase rewrite history, so you
 | 
			
		||||
  should use them ONLY on your local or topic branches.
 | 
			
		||||
 | 
			
		||||
  The main repository will reject those changes.
 | 
			
		||||
 | 
			
		||||
10. Preparing a patchset.
 | 
			
		||||
 | 
			
		||||
    git format-patch <commit> [-o directory]
 | 
			
		||||
 | 
			
		||||
  will generate a set of patches for each commit between <commit> and
 | 
			
		||||
  current HEAD. E.g.
 | 
			
		||||
 | 
			
		||||
    git format-patch origin/master
 | 
			
		||||
 | 
			
		||||
  will generate patches for all commits on current branch which are not
 | 
			
		||||
  present in upstream.
 | 
			
		||||
  A useful shortcut is also
 | 
			
		||||
 | 
			
		||||
    git format-patch -n
 | 
			
		||||
 | 
			
		||||
  which will generate patches from last n commits.
 | 
			
		||||
  By default the patches are created in the current directory.
 | 
			
		||||
 | 
			
		||||
11. Sending patches for review
 | 
			
		||||
 | 
			
		||||
    git send-email <commit list|directory>
 | 
			
		||||
 | 
			
		||||
  will send the patches created by git format-patch or directly generates
 | 
			
		||||
  them. All the email fields can be configured in the global/local
 | 
			
		||||
  configuration or overridden by command line.
 | 
			
		||||
  Note that this tool must often be installed separately (e.g. git-email
 | 
			
		||||
  package on Debian-based distros).
 | 
			
		||||
 | 
			
		||||
12. Pushing changes to remote trees
 | 
			
		||||
 | 
			
		||||
    git push
 | 
			
		||||
 | 
			
		||||
  Will push the changes to the default remote (origin).
 | 
			
		||||
  Git will prevent you from pushing changes if the local and remote trees are
 | 
			
		||||
  out of sync. Refer to 2 and 2.a to sync the local tree.
 | 
			
		||||
 | 
			
		||||
    git remote add <name> <url>
 | 
			
		||||
 | 
			
		||||
  Will add additional remote with a name reference, it is useful if you want
 | 
			
		||||
  to push your local branch for review on a remote host.
 | 
			
		||||
 | 
			
		||||
    git push <remote> <refspec>
 | 
			
		||||
 | 
			
		||||
  Will push the changes to the remote repository. Omitting refspec makes git
 | 
			
		||||
  push update all the remote branches matching the local ones.
 | 
			
		||||
 | 
			
		||||
13. Finding a specific svn revision
 | 
			
		||||
 | 
			
		||||
  Since version 1.7.1 git supports ':/foo' syntax for specifying commits
 | 
			
		||||
  based on a regular expression. see man gitrevisions
 | 
			
		||||
 | 
			
		||||
    git show :/'as revision 23456'
 | 
			
		||||
 | 
			
		||||
  will show the svn changeset r23456. With older git versions searching in
 | 
			
		||||
  the git log output is the easiest option (especially if a pager with
 | 
			
		||||
  search capabilities is used).
 | 
			
		||||
  This commit can be checked out with
 | 
			
		||||
 | 
			
		||||
    git checkout -b svn_23456 :/'as revision 23456'
 | 
			
		||||
 | 
			
		||||
  or for git < 1.7.1 with
 | 
			
		||||
 | 
			
		||||
    git checkout -b svn_23456 $SHA1
 | 
			
		||||
 | 
			
		||||
  where $SHA1 is the commit SHA1 from the 'git log' output.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Contact the project admins <root at ffmpeg dot org> if you have technical
 | 
			
		||||
problems with the GIT server.
 | 
			
		||||
							
								
								
									
										299
									
								
								doc/hooks.texi
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										299
									
								
								doc/hooks.texi
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,299 @@
 | 
			
		||||
\input texinfo @c -*- texinfo -*-
 | 
			
		||||
 | 
			
		||||
@settitle Video Hook Documentation
 | 
			
		||||
@titlepage
 | 
			
		||||
@sp 7
 | 
			
		||||
@center @titlefont{Video Hook Documentation}
 | 
			
		||||
@sp 3
 | 
			
		||||
@end titlepage
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@chapter Introduction
 | 
			
		||||
 | 
			
		||||
@var{Please be aware that vhook is deprecated, and hence its development is
 | 
			
		||||
frozen (bug fixes are still accepted).
 | 
			
		||||
The substitute will be 'libavfilter', the result of our 'Video Filter API'
 | 
			
		||||
Google Summer of Code project. You may monitor its progress by subscribing to
 | 
			
		||||
the ffmpeg-soc mailing list at
 | 
			
		||||
@url{http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc}.}
 | 
			
		||||
 | 
			
		||||
The video hook functionality is designed (mostly) for live video. It allows
 | 
			
		||||
the video to be modified or examined between the decoder and the encoder.
 | 
			
		||||
 | 
			
		||||
Any number of hook modules can be placed inline, and they are run in the
 | 
			
		||||
order that they were specified on the ffmpeg command line.
 | 
			
		||||
 | 
			
		||||
The video hook modules are provided for use as a base for your own modules,
 | 
			
		||||
and are described below.
 | 
			
		||||
 | 
			
		||||
Modules are loaded using the -vhook option to ffmpeg. The value of this parameter
 | 
			
		||||
is a space separated list of arguments. The first is the module name, and the rest
 | 
			
		||||
are passed as arguments to the Configure function of the module.
 | 
			
		||||
 | 
			
		||||
The modules are dynamic libraries: They have different suffixes (.so, .dll, .dylib)
 | 
			
		||||
depending on your platform. And your platform dictates if they need to be
 | 
			
		||||
somewhere in your PATH, or in your LD_LIBRARY_PATH. Otherwise you will need to
 | 
			
		||||
specify the full path of the vhook file that you are using.
 | 
			
		||||
 | 
			
		||||
@section null.c
 | 
			
		||||
 | 
			
		||||
This does nothing. Actually it converts the input image to RGB24 and then converts
 | 
			
		||||
it back again. This is meant as a sample that you can use to test your setup.
 | 
			
		||||
 | 
			
		||||
@section fish.c
 | 
			
		||||
 | 
			
		||||
This implements a 'fish detector'. Essentially it converts the image into HSV
 | 
			
		||||
space and tests whether more than a certain percentage of the pixels fall into
 | 
			
		||||
a specific HSV cuboid. If so, then the image is saved into a file for processing
 | 
			
		||||
by other bits of code.
 | 
			
		||||
 | 
			
		||||
Why use HSV? It turns out that HSV cuboids represent a more compact range of
 | 
			
		||||
colors than would an RGB cuboid.
 | 
			
		||||
 | 
			
		||||
@section imlib2.c
 | 
			
		||||
 | 
			
		||||
This module implements a text overlay for a video image. Currently it
 | 
			
		||||
supports a fixed overlay or reading the text from a file. The string
 | 
			
		||||
is passed through strftime() so that it is easy to imprint the date and
 | 
			
		||||
time onto the image.
 | 
			
		||||
 | 
			
		||||
This module depends on the external library imlib2, available on
 | 
			
		||||
Sourceforge, among other places, if it is not already installed on
 | 
			
		||||
your system.
 | 
			
		||||
 | 
			
		||||
You may also overlay an image (even semi-transparent) like TV stations do.
 | 
			
		||||
You may move either the text or the image around your video to create
 | 
			
		||||
scrolling credits, for example.
 | 
			
		||||
 | 
			
		||||
The font file used is looked for in a FONTPATH environment variable, and
 | 
			
		||||
prepended to the point size as a command line option and can be specified
 | 
			
		||||
with the full path to the font file, as in:
 | 
			
		||||
@example
 | 
			
		||||
-F /usr/X11R6/lib/X11/fonts/TTF/VeraBd.ttf/20
 | 
			
		||||
@end example
 | 
			
		||||
where 20 is the point size.
 | 
			
		||||
 | 
			
		||||
You can specify the filename to read RGB color names from. If it is not
 | 
			
		||||
specified, these defaults are used: @file{/usr/share/X11/rgb.txt} and
 | 
			
		||||
@file{/usr/lib/X11/rgb.txt}
 | 
			
		||||
 | 
			
		||||
Options:
 | 
			
		||||
@multitable @columnfractions .2 .8
 | 
			
		||||
@item @option{-C <rgb.txt>}   @tab The filename to read RGB color names from
 | 
			
		||||
@item @option{-c <color>}     @tab The color of the text
 | 
			
		||||
@item @option{-F <fontname>}  @tab The font face and size
 | 
			
		||||
@item @option{-t <text>}      @tab The text
 | 
			
		||||
@item @option{-f <filename>}  @tab The filename to read text from
 | 
			
		||||
@item @option{-x <expression>}@tab x coordinate of text or image
 | 
			
		||||
@item @option{-y <expression>}@tab y coordinate of text or image
 | 
			
		||||
@item @option{-i <filename>}  @tab The filename to read a image from
 | 
			
		||||
@item @option{-R <expression>}@tab Value for R color
 | 
			
		||||
@item @option{-G <expression>}@tab Value for G color
 | 
			
		||||
@item @option{-B <expression>}@tab Value for B color
 | 
			
		||||
@item @option{-A <expression>}@tab Value for Alpha channel
 | 
			
		||||
@end multitable
 | 
			
		||||
 | 
			
		||||
Expressions are functions of these variables:
 | 
			
		||||
@multitable @columnfractions .2 .8
 | 
			
		||||
@item @var{N} @tab frame number (starting at zero)
 | 
			
		||||
@item @var{H} @tab frame height
 | 
			
		||||
@item @var{W} @tab frame width
 | 
			
		||||
@item @var{h} @tab image height
 | 
			
		||||
@item @var{w} @tab image width
 | 
			
		||||
@item @var{X} @tab previous x coordinate of text or image
 | 
			
		||||
@item @var{Y} @tab previous y coordinate of text or image
 | 
			
		||||
@end multitable
 | 
			
		||||
 | 
			
		||||
You may also use the constants @var{PI}, @var{E}, and the math functions available at the
 | 
			
		||||
FFmpeg formula evaluator at (@url{ffmpeg-doc.html#SEC13}), except @var{bits2qp(bits)}
 | 
			
		||||
and @var{qp2bits(qp)}.
 | 
			
		||||
 | 
			
		||||
Usage examples:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
   # Remember to set the path to your fonts
 | 
			
		||||
   FONTPATH="/cygdrive/c/WINDOWS/Fonts/"
 | 
			
		||||
   FONTPATH="$FONTPATH:/usr/share/imlib2/data/fonts/"
 | 
			
		||||
   FONTPATH="$FONTPATH:/usr/X11R6/lib/X11/fonts/TTF/"
 | 
			
		||||
   export FONTPATH
 | 
			
		||||
 | 
			
		||||
   # Bulb dancing in a Lissajous pattern
 | 
			
		||||
   ffmpeg -i input.avi -vhook \
 | 
			
		||||
     'vhook/imlib2.dll -x W*(0.5+0.25*sin(N/47*PI))-w/2 -y H*(0.5+0.50*cos(N/97*PI))-h/2 -i /usr/share/imlib2/data/images/bulb.png' \
 | 
			
		||||
     -acodec copy -sameq output.avi
 | 
			
		||||
 | 
			
		||||
   # Text scrolling
 | 
			
		||||
   ffmpeg -i input.avi -vhook \
 | 
			
		||||
     'vhook/imlib2.dll -c red -F Vera.ttf/20 -x 150+0.5*N -y 70+0.25*N -t Hello' \
 | 
			
		||||
     -acodec copy -sameq output.avi
 | 
			
		||||
 | 
			
		||||
   # Date and time stamp, security-camera style:
 | 
			
		||||
   ffmpeg -r 29.97 -s 320x256 -f video4linux -i /dev/video0 \
 | 
			
		||||
     -vhook 'vhook/imlib2.so -x 0 -y 0 -i black-260x20.png' \
 | 
			
		||||
     -vhook 'vhook/imlib2.so -c white -F VeraBd.ttf/12 -x 0 -y 0 -t %A-%D-%T' \
 | 
			
		||||
     output.avi
 | 
			
		||||
 | 
			
		||||
     In this example the video is captured from the first video capture card as a
 | 
			
		||||
     320x256 AVI, and a black 260 by 20 pixel PNG image is placed in the upper
 | 
			
		||||
     left corner, with the day, date and time overlaid on it in Vera Bold 12
 | 
			
		||||
     point font. A simple black PNG file 260 pixels wide and 20 pixels tall
 | 
			
		||||
     was created in the GIMP for this purpose.
 | 
			
		||||
 | 
			
		||||
   # Scrolling credits from a text file
 | 
			
		||||
   ffmpeg -i input.avi -vhook \
 | 
			
		||||
     'vhook/imlib2.so -c white -F VeraBd.ttf/16 -x 100 -y -1.0*N -f credits.txt' \
 | 
			
		||||
     -sameq output.avi
 | 
			
		||||
 | 
			
		||||
     In this example, the text is stored in a file, and is positioned 100
 | 
			
		||||
     pixels from the left hand edge of the video. The text is scrolled from the
 | 
			
		||||
     bottom up. Making the y factor positive will scroll from the top down.
 | 
			
		||||
     Increasing the magnitude of the y factor makes the text scroll faster,
 | 
			
		||||
     decreasing it makes it scroll slower. Hint: Blank lines containing only
 | 
			
		||||
     a newline are treated as end-of-file. To create blank lines, use lines
 | 
			
		||||
     that consist of space characters only.
 | 
			
		||||
 | 
			
		||||
   # Scrolling credits with custom color from a text file
 | 
			
		||||
   ffmpeg -i input.avi -vhook \
 | 
			
		||||
     'vhook/imlib2.so -C rgb.txt -c CustomColor1 -F VeraBd.ttf/16 -x 100 -y -1.0*N -f credits.txt' \
 | 
			
		||||
     -sameq output.avi
 | 
			
		||||
 | 
			
		||||
     This example does the same as the one above, but specifies an rgb.txt file
 | 
			
		||||
     to be used, which has a custom-made color in it.
 | 
			
		||||
 | 
			
		||||
   # Variable colors
 | 
			
		||||
   ffmpeg -i input.avi -vhook \
 | 
			
		||||
     'vhook/imlib2.so -t Hello -R abs(255*sin(N/47*PI)) -G abs(255*sin(N/47*PI)) -B abs(255*sin(N/47*PI))' \
 | 
			
		||||
     -sameq output.avi
 | 
			
		||||
 | 
			
		||||
     In this example, the color for the text goes up and down from black to
 | 
			
		||||
     white.
 | 
			
		||||
 | 
			
		||||
   # Text fade-out
 | 
			
		||||
   ffmpeg -i input.avi -vhook \
 | 
			
		||||
     'vhook/imlib2.so -t Hello -A max(0,255-exp(N/47))' \
 | 
			
		||||
     -sameq output.avi
 | 
			
		||||
 | 
			
		||||
     In this example, the text fades out in about 10 seconds for a 25 fps input
 | 
			
		||||
     video file.
 | 
			
		||||
 | 
			
		||||
   # scrolling credits from a graphics file
 | 
			
		||||
   ffmpeg -sameq -i input.avi \
 | 
			
		||||
     -vhook 'vhook/imlib2.so -x 0 -y -1.0*N -i credits.png' output.avi
 | 
			
		||||
 | 
			
		||||
     In this example, a transparent PNG file the same width as the video
 | 
			
		||||
     (e.g. 320 pixels), but very long, (e.g. 3000 pixels), was created, and
 | 
			
		||||
     text, graphics, brushstrokes, etc, were added to the image. The image
 | 
			
		||||
     is then scrolled up, from the bottom of the frame.
 | 
			
		||||
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@section ppm.c
 | 
			
		||||
 | 
			
		||||
It's basically a launch point for a PPM pipe, so you can use any
 | 
			
		||||
executable (or script) which consumes a PPM on stdin and produces a PPM
 | 
			
		||||
on stdout (and flushes each frame). The Netpbm utilities are a series of
 | 
			
		||||
such programs.
 | 
			
		||||
 | 
			
		||||
A list of them is here:
 | 
			
		||||
 | 
			
		||||
@url{http://netpbm.sourceforge.net/doc/directory.html}
 | 
			
		||||
 | 
			
		||||
Usage example:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i input -vhook "/path/to/ppm.so some-ppm-filter args" output
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@section drawtext.c
 | 
			
		||||
 | 
			
		||||
This module implements a text overlay for a video image. Currently it
 | 
			
		||||
supports a fixed overlay or reading the text from a file. The string
 | 
			
		||||
is passed through strftime() so that it is easy to imprint the date and
 | 
			
		||||
time onto the image.
 | 
			
		||||
 | 
			
		||||
Features:
 | 
			
		||||
@itemize @minus
 | 
			
		||||
@item TrueType, Type1 and others via the FreeType2 library
 | 
			
		||||
@item Font kerning (better output)
 | 
			
		||||
@item Line Wrap (put the text that doesn't fit one line on the next line)
 | 
			
		||||
@item Background box (currently in development)
 | 
			
		||||
@item Outline
 | 
			
		||||
@end itemize
 | 
			
		||||
 | 
			
		||||
Options:
 | 
			
		||||
@multitable @columnfractions .2 .8
 | 
			
		||||
@item @option{-c <color>}          @tab Foreground color of the text ('internet' way) <#RRGGBB> [default #FFFFFF]
 | 
			
		||||
@item @option{-C <color>}          @tab Background color of the text ('internet' way) <#RRGGBB> [default #000000]
 | 
			
		||||
@item @option{-f <font-filename>}  @tab font file to use
 | 
			
		||||
@item @option{-t <text>}           @tab text to display
 | 
			
		||||
@item @option{-T <filename>}       @tab file to read text from
 | 
			
		||||
@item @option{-x <pos>}            @tab x coordinate of the start of the text
 | 
			
		||||
@item @option{-y <pos>}            @tab y coordinate of the start of the text
 | 
			
		||||
@end multitable
 | 
			
		||||
 | 
			
		||||
Text fonts are being looked for in a FONTPATH environment variable.
 | 
			
		||||
If the FONTPATH environment variable is not available, or is not checked by
 | 
			
		||||
your target (i.e. Cygwin), then specify the full path to the font file as in:
 | 
			
		||||
@example
 | 
			
		||||
-f /usr/X11R6/lib/X11/fonts/TTF/VeraBd.ttf
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Usage Example:
 | 
			
		||||
@example
 | 
			
		||||
   # Remember to set the path to your fonts
 | 
			
		||||
   FONTPATH="/cygdrive/c/WINDOWS/Fonts/"
 | 
			
		||||
   FONTPATH="$FONTPATH:/usr/share/imlib2/data/fonts/"
 | 
			
		||||
   FONTPATH="$FONTPATH:/usr/X11R6/lib/X11/fonts/TTF/"
 | 
			
		||||
   export FONTPATH
 | 
			
		||||
 | 
			
		||||
   # Time and date display
 | 
			
		||||
   ffmpeg -f video4linux2 -i /dev/video0 \
 | 
			
		||||
   -vhook 'vhook/drawtext.so -f VeraBd.ttf -t %A-%D-%T' movie.mpg
 | 
			
		||||
 | 
			
		||||
     This example grabs video from the first capture card and outputs it to an
 | 
			
		||||
     MPEG video, and places "Weekday-dd/mm/yy-hh:mm:ss" at the top left of the
 | 
			
		||||
     frame, updated every second, using the Vera Bold TrueType Font, which
 | 
			
		||||
     should exist in: /usr/X11R6/lib/X11/fonts/TTF/
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Check the man page for strftime() for all the various ways you can format
 | 
			
		||||
the date and time.
 | 
			
		||||
 | 
			
		||||
@section watermark.c
 | 
			
		||||
 | 
			
		||||
Command Line options:
 | 
			
		||||
@multitable @columnfractions .2 .8
 | 
			
		||||
@item @option{-m [0|1]}            @tab Mode (default: 0, see below)
 | 
			
		||||
@item @option{-t 000000 - FFFFFF}  @tab Threshold, six digit hex number
 | 
			
		||||
@item @option{-f <filename>}       @tab Watermark image filename, must be specified!
 | 
			
		||||
@end multitable
 | 
			
		||||
 | 
			
		||||
MODE 0:
 | 
			
		||||
 The watermark picture works like this (assuming color intensities 0..0xFF):
 | 
			
		||||
 Per color do this:
 | 
			
		||||
 If mask color is 0x80, no change to the original frame.
 | 
			
		||||
 If mask color is < 0x80 the absolute difference is subtracted from the
 | 
			
		||||
 frame. If result < 0, result = 0.
 | 
			
		||||
 If mask color is > 0x80 the absolute difference is added to the
 | 
			
		||||
 frame. If result > 0xFF, result = 0xFF.
 | 
			
		||||
 | 
			
		||||
 You can override the 0x80 level with the -t flag. E.g. if threshold is
 | 
			
		||||
 000000 the color value of watermark is added to the destination.
 | 
			
		||||
 | 
			
		||||
 This way a mask that is visible both in light and dark pictures can be made
 | 
			
		||||
 (e.g. by using a picture generated by the Gimp and the bump map tool).
 | 
			
		||||
 | 
			
		||||
 An example watermark file is at:
 | 
			
		||||
 @url{http://engene.se/ffmpeg_watermark.gif}
 | 
			
		||||
 | 
			
		||||
MODE 1:
 | 
			
		||||
 Per color do this:
 | 
			
		||||
 If mask color > threshold color then the watermark pixel is used.
 | 
			
		||||
 | 
			
		||||
Example usage:
 | 
			
		||||
@example
 | 
			
		||||
   ffmpeg -i infile -vhook '/path/watermark.so -f wm.gif' -an out.mov
 | 
			
		||||
   ffmpeg -i infile -vhook '/path/watermark.so -f wm.gif -m 1 -t 222222' -an out.mov
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@bye
 | 
			
		||||
							
								
								
									
										704
									
								
								doc/indevs.texi
									
									
									
									
									
								
							
							
						
						
									
										704
									
								
								doc/indevs.texi
									
									
									
									
									
								
							@@ -1,704 +0,0 @@
 | 
			
		||||
@chapter Input Devices
 | 
			
		||||
@c man begin INPUT DEVICES
 | 
			
		||||
 | 
			
		||||
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
 | 
			
		||||
are enabled by default. You can list all available ones using the
 | 
			
		||||
configure option "--list-indevs".
 | 
			
		||||
 | 
			
		||||
You can disable all the input devices using the configure option
 | 
			
		||||
"--disable-indevs", and selectively enable an input device using the
 | 
			
		||||
option "--enable-indev=@var{INDEV}", or you can disable a particular
 | 
			
		||||
input device using the option "--disable-indev=@var{INDEV}".
 | 
			
		||||
 | 
			
		||||
The option "-formats" of the ff* tools will display the list of
 | 
			
		||||
supported input devices (amongst the demuxers).
 | 
			
		||||
 | 
			
		||||
A description of the currently available input devices follows.
 | 
			
		||||
 | 
			
		||||
@section alsa
 | 
			
		||||
 | 
			
		||||
ALSA (Advanced Linux Sound Architecture) input device.
 | 
			
		||||
 | 
			
		||||
To enable this input device during configuration you need libasound
 | 
			
		||||
installed on your system.
 | 
			
		||||
 | 
			
		||||
This device allows capturing from an ALSA device. The name of the
 | 
			
		||||
device to capture has to be an ALSA card identifier.
 | 
			
		||||
 | 
			
		||||
An ALSA identifier has the syntax:
 | 
			
		||||
@example
 | 
			
		||||
hw:@var{CARD}[,@var{DEV}[,@var{SUBDEV}]]
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
where the @var{DEV} and @var{SUBDEV} components are optional.
 | 
			
		||||
 | 
			
		||||
The three arguments (in order: @var{CARD},@var{DEV},@var{SUBDEV})
 | 
			
		||||
specify card number or identifier, device number and subdevice number
 | 
			
		||||
(-1 means any).
 | 
			
		||||
 | 
			
		||||
To see the list of cards currently recognized by your system check the
 | 
			
		||||
files @file{/proc/asound/cards} and @file{/proc/asound/devices}.
 | 
			
		||||
 | 
			
		||||
For example to capture with @command{ffmpeg} from an ALSA device with
 | 
			
		||||
card id 0, you may run the command:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -f alsa -i hw:0 alsaout.wav
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
For more information see:
 | 
			
		||||
@url{http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html}
 | 
			
		||||
 | 
			
		||||
@section bktr
 | 
			
		||||
 | 
			
		||||
BSD video input device.
 | 
			
		||||
 | 
			
		||||
@section dshow
 | 
			
		||||
 | 
			
		||||
Windows DirectShow input device.
 | 
			
		||||
 | 
			
		||||
DirectShow support is enabled when FFmpeg is built with the mingw-w64 project.
 | 
			
		||||
Currently only audio and video devices are supported.
 | 
			
		||||
 | 
			
		||||
Multiple devices may be opened as separate inputs, but they may also be
 | 
			
		||||
opened on the same input, which should improve synchronism between them.
 | 
			
		||||
 | 
			
		||||
The input name should be in the format:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
@var{TYPE}=@var{NAME}[:@var{TYPE}=@var{NAME}]
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
where @var{TYPE} can be either @var{audio} or @var{video},
 | 
			
		||||
and @var{NAME} is the device's name.
 | 
			
		||||
 | 
			
		||||
@subsection Options
 | 
			
		||||
 | 
			
		||||
If no options are specified, the device's defaults are used.
 | 
			
		||||
If the device does not support the requested options, it will
 | 
			
		||||
fail to open.
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item video_size
 | 
			
		||||
Set the video size in the captured video.
 | 
			
		||||
 | 
			
		||||
@item framerate
 | 
			
		||||
Set the framerate in the captured video.
 | 
			
		||||
 | 
			
		||||
@item sample_rate
 | 
			
		||||
Set the sample rate (in Hz) of the captured audio.
 | 
			
		||||
 | 
			
		||||
@item sample_size
 | 
			
		||||
Set the sample size (in bits) of the captured audio.
 | 
			
		||||
 | 
			
		||||
@item channels
 | 
			
		||||
Set the number of channels in the captured audio.
 | 
			
		||||
 | 
			
		||||
@item list_devices
 | 
			
		||||
If set to @option{true}, print a list of devices and exit.
 | 
			
		||||
 | 
			
		||||
@item list_options
 | 
			
		||||
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 same name (starts at 0,
 | 
			
		||||
defaults to 0).
 | 
			
		||||
 | 
			
		||||
@item audio_device_number
 | 
			
		||||
Set audio device number for devices with same name (starts at 0,
 | 
			
		||||
defaults to 0).
 | 
			
		||||
 | 
			
		||||
@item pixel_format
 | 
			
		||||
Select pixel format to be used by DirectShow. This may only be set when
 | 
			
		||||
the video codec is not set or set to rawvideo.
 | 
			
		||||
 | 
			
		||||
@item audio_buffer_size
 | 
			
		||||
Set audio device buffer size in milliseconds (which can directly
 | 
			
		||||
impact latency, depending on the device).
 | 
			
		||||
Defaults to using the audio device's
 | 
			
		||||
default buffer size (typically some multiple of 500ms).
 | 
			
		||||
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}
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@subsection Examples
 | 
			
		||||
 | 
			
		||||
@itemize
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
Print the list of DirectShow supported devices and exit:
 | 
			
		||||
@example
 | 
			
		||||
$ ffmpeg -list_devices true -f dshow -i dummy
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
Open video device @var{Camera}:
 | 
			
		||||
@example
 | 
			
		||||
$ ffmpeg -f dshow -i video="Camera"
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
Open second video device with name @var{Camera}:
 | 
			
		||||
@example
 | 
			
		||||
$ ffmpeg -f dshow -video_device_number 1 -i video="Camera"
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
Open video device @var{Camera} and audio device @var{Microphone}:
 | 
			
		||||
@example
 | 
			
		||||
$ ffmpeg -f dshow -i video="Camera":audio="Microphone"
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
Print the list of supported options in selected device and exit:
 | 
			
		||||
@example
 | 
			
		||||
$ ffmpeg -list_options true -f dshow -i video="Camera"
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@end itemize
 | 
			
		||||
 | 
			
		||||
@section dv1394
 | 
			
		||||
 | 
			
		||||
Linux DV 1394 input device.
 | 
			
		||||
 | 
			
		||||
@section fbdev
 | 
			
		||||
 | 
			
		||||
Linux framebuffer input device.
 | 
			
		||||
 | 
			
		||||
The Linux framebuffer is a graphic hardware-independent abstraction
 | 
			
		||||
layer to show graphics on a computer monitor, typically on the
 | 
			
		||||
console. It is accessed through a file device node, usually
 | 
			
		||||
@file{/dev/fb0}.
 | 
			
		||||
 | 
			
		||||
For more detailed information read the file
 | 
			
		||||
Documentation/fb/framebuffer.txt included in the Linux source tree.
 | 
			
		||||
 | 
			
		||||
To record from the framebuffer device @file{/dev/fb0} with
 | 
			
		||||
@command{ffmpeg}:
 | 
			
		||||
@example
 | 
			
		||||
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 -frames:v 1 -r 1 -i /dev/fb0 screenshot.jpeg
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
See also @url{http://linux-fbdev.sourceforge.net/}, and fbset(1).
 | 
			
		||||
 | 
			
		||||
@section iec61883
 | 
			
		||||
 | 
			
		||||
FireWire DV/HDV input device using libiec61883.
 | 
			
		||||
 | 
			
		||||
To enable this input device, you need libiec61883, libraw1394 and
 | 
			
		||||
libavc1394 installed on your system. Use the configure option
 | 
			
		||||
@code{--enable-libiec61883} to compile with the device enabled.
 | 
			
		||||
 | 
			
		||||
The iec61883 capture device supports capturing from a video device
 | 
			
		||||
connected via IEEE1394 (FireWire), using libiec61883 and the new Linux
 | 
			
		||||
FireWire stack (juju). This is the default DV/HDV input method in Linux
 | 
			
		||||
Kernel 2.6.37 and later, since the old FireWire stack was removed.
 | 
			
		||||
 | 
			
		||||
Specify the FireWire port to be used as input file, or "auto"
 | 
			
		||||
to choose the first port connected.
 | 
			
		||||
 | 
			
		||||
@subsection Options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item dvtype
 | 
			
		||||
Override autodetection of DV/HDV. This should only be used if auto
 | 
			
		||||
detection does not work, or if usage of a different device type
 | 
			
		||||
should be prohibited. Treating a DV device as HDV (or vice versa) will
 | 
			
		||||
not work and result in undefined behavior.
 | 
			
		||||
The values @option{auto}, @option{dv} and @option{hdv} are supported.
 | 
			
		||||
 | 
			
		||||
@item dvbuffer
 | 
			
		||||
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.
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@subsection Examples
 | 
			
		||||
 | 
			
		||||
@itemize
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
Grab and show the input of a FireWire DV/HDV device.
 | 
			
		||||
@example
 | 
			
		||||
ffplay -f iec61883 -i auto
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
Grab and record the input of a FireWire DV/HDV device,
 | 
			
		||||
using a packet buffer of 100000 packets if the source is HDV.
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -f iec61883 -i auto -hdvbuffer 100000 out.mpg
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@end itemize
 | 
			
		||||
 | 
			
		||||
@section jack
 | 
			
		||||
 | 
			
		||||
JACK input device.
 | 
			
		||||
 | 
			
		||||
To enable this input device during configuration you need libjack
 | 
			
		||||
installed on your system.
 | 
			
		||||
 | 
			
		||||
A JACK input device creates one or more JACK writable clients, one for
 | 
			
		||||
each audio channel, with name @var{client_name}:input_@var{N}, where
 | 
			
		||||
@var{client_name} is the name provided by the application, and @var{N}
 | 
			
		||||
is a number which identifies the channel.
 | 
			
		||||
Each writable client will send the acquired data to the FFmpeg input
 | 
			
		||||
device.
 | 
			
		||||
 | 
			
		||||
Once you have created one or more JACK readable clients, you need to
 | 
			
		||||
connect them to one or more JACK writable clients.
 | 
			
		||||
 | 
			
		||||
To connect or disconnect JACK clients you can use the @command{jack_connect}
 | 
			
		||||
and @command{jack_disconnect} programs, or do it through a graphical interface,
 | 
			
		||||
for example with @command{qjackctl}.
 | 
			
		||||
 | 
			
		||||
To list the JACK clients and their properties you can invoke the command
 | 
			
		||||
@command{jack_lsp}.
 | 
			
		||||
 | 
			
		||||
Follows an example which shows how to capture a JACK readable client
 | 
			
		||||
with @command{ffmpeg}.
 | 
			
		||||
@example
 | 
			
		||||
# Create a JACK writable client with name "ffmpeg".
 | 
			
		||||
$ ffmpeg -f jack -i ffmpeg -y out.wav
 | 
			
		||||
 | 
			
		||||
# Start the sample jack_metro readable client.
 | 
			
		||||
$ jack_metro -b 120 -d 0.2 -f 4000
 | 
			
		||||
 | 
			
		||||
# List the current JACK clients.
 | 
			
		||||
$ jack_lsp -c
 | 
			
		||||
system:capture_1
 | 
			
		||||
system:capture_2
 | 
			
		||||
system:playback_1
 | 
			
		||||
system:playback_2
 | 
			
		||||
ffmpeg:input_1
 | 
			
		||||
metro:120_bpm
 | 
			
		||||
 | 
			
		||||
# Connect metro to the ffmpeg writable client.
 | 
			
		||||
$ jack_connect metro:120_bpm ffmpeg:input_1
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
For more information read:
 | 
			
		||||
@url{http://jackaudio.org/}
 | 
			
		||||
 | 
			
		||||
@section lavfi
 | 
			
		||||
 | 
			
		||||
Libavfilter input virtual device.
 | 
			
		||||
 | 
			
		||||
This input device reads data from the open output pads of a libavfilter
 | 
			
		||||
filtergraph.
 | 
			
		||||
 | 
			
		||||
For each filtergraph open output, the input device will create a
 | 
			
		||||
corresponding stream which is mapped to the generated output. Currently
 | 
			
		||||
only video data is supported. The filtergraph is specified through the
 | 
			
		||||
option @option{graph}.
 | 
			
		||||
 | 
			
		||||
@subsection Options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item graph
 | 
			
		||||
Specify the filtergraph to use as input. Each video open output must be
 | 
			
		||||
labelled by a unique string of the form "out@var{N}", where @var{N} is a
 | 
			
		||||
number starting from 0 corresponding to the mapped input stream
 | 
			
		||||
generated by the device.
 | 
			
		||||
The first unlabelled output is automatically assigned to the "out0"
 | 
			
		||||
label, but all the others need to be specified explicitly.
 | 
			
		||||
 | 
			
		||||
If not specified defaults to the filename specified for the input
 | 
			
		||||
device.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@subsection Examples
 | 
			
		||||
 | 
			
		||||
@itemize
 | 
			
		||||
@item
 | 
			
		||||
Create a color video stream and play it back with @command{ffplay}:
 | 
			
		||||
@example
 | 
			
		||||
ffplay -f lavfi -graph "color=pink [out0]" dummy
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
As the previous example, but use filename for specifying the graph
 | 
			
		||||
description, and omit the "out0" label:
 | 
			
		||||
@example
 | 
			
		||||
ffplay -f lavfi color=pink
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
Create three different video test filtered sources and play them:
 | 
			
		||||
@example
 | 
			
		||||
ffplay -f lavfi -graph "testsrc [out0]; testsrc,hflip [out1]; testsrc,negate [out2]" test3
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
Read an audio stream from a file using the amovie source and play it
 | 
			
		||||
back with @command{ffplay}:
 | 
			
		||||
@example
 | 
			
		||||
ffplay -f lavfi "amovie=test.wav"
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
Read an audio stream and a video stream and play it back with
 | 
			
		||||
@command{ffplay}:
 | 
			
		||||
@example
 | 
			
		||||
ffplay -f lavfi "movie=test.avi[out0];amovie=test.wav[out1]"
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@end itemize
 | 
			
		||||
 | 
			
		||||
@section libdc1394
 | 
			
		||||
 | 
			
		||||
IIDC1394 input device, based on libdc1394 and libraw1394.
 | 
			
		||||
 | 
			
		||||
@section openal
 | 
			
		||||
 | 
			
		||||
The OpenAL input device provides audio capture on all systems with a
 | 
			
		||||
working OpenAL 1.1 implementation.
 | 
			
		||||
 | 
			
		||||
To enable this input device during configuration, you need OpenAL
 | 
			
		||||
headers and libraries installed on your system, and need to configure
 | 
			
		||||
FFmpeg with @code{--enable-openal}.
 | 
			
		||||
 | 
			
		||||
OpenAL headers and libraries should be provided as part of your OpenAL
 | 
			
		||||
implementation, or as an additional download (an SDK). Depending on your
 | 
			
		||||
installation you may need to specify additional flags via the
 | 
			
		||||
@code{--extra-cflags} and @code{--extra-ldflags} for allowing the build
 | 
			
		||||
system to locate the OpenAL headers and libraries.
 | 
			
		||||
 | 
			
		||||
An incomplete list of OpenAL implementations follows:
 | 
			
		||||
 | 
			
		||||
@table @strong
 | 
			
		||||
@item Creative
 | 
			
		||||
The official Windows implementation, providing hardware acceleration
 | 
			
		||||
with supported devices and software fallback.
 | 
			
		||||
See @url{http://openal.org/}.
 | 
			
		||||
@item OpenAL Soft
 | 
			
		||||
Portable, open source (LGPL) software implementation. Includes
 | 
			
		||||
backends for the most common sound APIs on the Windows, Linux,
 | 
			
		||||
Solaris, and BSD operating systems.
 | 
			
		||||
See @url{http://kcat.strangesoft.net/openal.html}.
 | 
			
		||||
@item Apple
 | 
			
		||||
OpenAL is part of Core Audio, the official Mac OS X Audio interface.
 | 
			
		||||
See @url{http://developer.apple.com/technologies/mac/audio-and-video.html}
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
This device allows to capture from an audio input device handled
 | 
			
		||||
through OpenAL.
 | 
			
		||||
 | 
			
		||||
You need to specify the name of the device to capture in the provided
 | 
			
		||||
filename. If the empty string is provided, the device will
 | 
			
		||||
automatically select the default device. You can get the list of the
 | 
			
		||||
supported devices by using the option @var{list_devices}.
 | 
			
		||||
 | 
			
		||||
@subsection Options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item channels
 | 
			
		||||
Set the number of channels in the captured audio. Only the values
 | 
			
		||||
@option{1} (monaural) and @option{2} (stereo) are currently supported.
 | 
			
		||||
Defaults to @option{2}.
 | 
			
		||||
 | 
			
		||||
@item sample_size
 | 
			
		||||
Set the sample size (in bits) of the captured audio. Only the values
 | 
			
		||||
@option{8} and @option{16} are currently supported. Defaults to
 | 
			
		||||
@option{16}.
 | 
			
		||||
 | 
			
		||||
@item sample_rate
 | 
			
		||||
Set the sample rate (in Hz) of the captured audio.
 | 
			
		||||
Defaults to @option{44.1k}.
 | 
			
		||||
 | 
			
		||||
@item list_devices
 | 
			
		||||
If set to @option{true}, print a list of devices and exit.
 | 
			
		||||
Defaults to @option{false}.
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@subsection Examples
 | 
			
		||||
 | 
			
		||||
Print the list of OpenAL supported devices and exit:
 | 
			
		||||
@example
 | 
			
		||||
$ ffmpeg -list_devices true -f openal -i dummy out.ogg
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Capture from the OpenAL device @file{DR-BT101 via PulseAudio}:
 | 
			
		||||
@example
 | 
			
		||||
$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out.ogg
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Capture from the default device (note the empty string '' as filename):
 | 
			
		||||
@example
 | 
			
		||||
$ ffmpeg -f openal -i '' out.ogg
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Capture from two devices simultaneously, writing to two different files,
 | 
			
		||||
within the same @command{ffmpeg} command:
 | 
			
		||||
@example
 | 
			
		||||
$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out1.ogg -f openal -i 'ALSA Default' out2.ogg
 | 
			
		||||
@end example
 | 
			
		||||
Note: not all OpenAL implementations support multiple simultaneous capture -
 | 
			
		||||
try the latest OpenAL Soft if the above does not work.
 | 
			
		||||
 | 
			
		||||
@section oss
 | 
			
		||||
 | 
			
		||||
Open Sound System input device.
 | 
			
		||||
 | 
			
		||||
The filename to provide to the input device is the device node
 | 
			
		||||
representing the OSS input device, and is usually set to
 | 
			
		||||
@file{/dev/dsp}.
 | 
			
		||||
 | 
			
		||||
For example to grab from @file{/dev/dsp} using @command{ffmpeg} use the
 | 
			
		||||
command:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
For more information about OSS see:
 | 
			
		||||
@url{http://manuals.opensound.com/usersguide/dsp.html}
 | 
			
		||||
 | 
			
		||||
@section pulse
 | 
			
		||||
 | 
			
		||||
pulseaudio input device.
 | 
			
		||||
 | 
			
		||||
To enable this input device during configuration you need libpulse-simple
 | 
			
		||||
installed in your system.
 | 
			
		||||
 | 
			
		||||
The filename to provide to the input device is a source device or the
 | 
			
		||||
string "default"
 | 
			
		||||
 | 
			
		||||
To list the pulse source devices and their properties you can invoke
 | 
			
		||||
the command @command{pactl list sources}.
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -f pulse -i default /tmp/pulse.wav
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@subsection @var{server} AVOption
 | 
			
		||||
 | 
			
		||||
The syntax is:
 | 
			
		||||
@example
 | 
			
		||||
-server @var{server name}
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Connects to a specific server.
 | 
			
		||||
 | 
			
		||||
@subsection @var{name} AVOption
 | 
			
		||||
 | 
			
		||||
The syntax is:
 | 
			
		||||
@example
 | 
			
		||||
-name @var{application name}
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Specify the application name pulse will use when showing active clients,
 | 
			
		||||
by default it is the LIBAVFORMAT_IDENT string
 | 
			
		||||
 | 
			
		||||
@subsection @var{stream_name} AVOption
 | 
			
		||||
 | 
			
		||||
The syntax is:
 | 
			
		||||
@example
 | 
			
		||||
-stream_name @var{stream name}
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Specify the stream name pulse will use when showing active streams,
 | 
			
		||||
by default it is "record"
 | 
			
		||||
 | 
			
		||||
@subsection @var{sample_rate} AVOption
 | 
			
		||||
 | 
			
		||||
The syntax is:
 | 
			
		||||
@example
 | 
			
		||||
-sample_rate @var{samplerate}
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Specify the samplerate in Hz, by default 48kHz is used.
 | 
			
		||||
 | 
			
		||||
@subsection @var{channels} AVOption
 | 
			
		||||
 | 
			
		||||
The syntax is:
 | 
			
		||||
@example
 | 
			
		||||
-channels @var{N}
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Specify the channels in use, by default 2 (stereo) is set.
 | 
			
		||||
 | 
			
		||||
@subsection @var{frame_size} AVOption
 | 
			
		||||
 | 
			
		||||
The syntax is:
 | 
			
		||||
@example
 | 
			
		||||
-frame_size @var{bytes}
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Specify the number of byte per frame, by default it is set to 1024.
 | 
			
		||||
 | 
			
		||||
@subsection @var{fragment_size} AVOption
 | 
			
		||||
 | 
			
		||||
The syntax is:
 | 
			
		||||
@example
 | 
			
		||||
-fragment_size @var{bytes}
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Specify the minimal buffering fragment in pulseaudio, it will affect the
 | 
			
		||||
audio latency. By default it is unset.
 | 
			
		||||
 | 
			
		||||
@section sndio
 | 
			
		||||
 | 
			
		||||
sndio input device.
 | 
			
		||||
 | 
			
		||||
To enable this input device during configuration you need libsndio
 | 
			
		||||
installed on your system.
 | 
			
		||||
 | 
			
		||||
The filename to provide to the input device is the device node
 | 
			
		||||
representing the sndio input device, and is usually set to
 | 
			
		||||
@file{/dev/audio0}.
 | 
			
		||||
 | 
			
		||||
For example to grab from @file{/dev/audio0} using @command{ffmpeg} use the
 | 
			
		||||
command:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@section video4linux2
 | 
			
		||||
 | 
			
		||||
Video4Linux2 input video device.
 | 
			
		||||
 | 
			
		||||
The name of the device to grab is a file device node, usually Linux
 | 
			
		||||
systems tend to automatically create such nodes when the device
 | 
			
		||||
(e.g. an USB webcam) is plugged into the system, and has a name of the
 | 
			
		||||
kind @file{/dev/video@var{N}}, where @var{N} is a number associated to
 | 
			
		||||
the device.
 | 
			
		||||
 | 
			
		||||
Video4Linux2 devices usually support a limited set of
 | 
			
		||||
@var{width}x@var{height} sizes and framerates. You can check which are
 | 
			
		||||
supported using @command{-list_formats all} for Video4Linux2 devices.
 | 
			
		||||
 | 
			
		||||
Some usage examples of the video4linux2 devices with ffmpeg and ffplay:
 | 
			
		||||
 | 
			
		||||
The time base for the timestamps is 1 microsecond. Depending on the kernel
 | 
			
		||||
version and configuration, the timestamps may be derived from the real time
 | 
			
		||||
clock (origin at the Unix Epoch) or the monotonic clock (origin usually at
 | 
			
		||||
boot time, unaffected by NTP or manual changes to the clock). The
 | 
			
		||||
@option{-timestamps abs} or @option{-ts abs} option can be used to force
 | 
			
		||||
conversion into the real time clock.
 | 
			
		||||
 | 
			
		||||
Note that if FFmpeg is build with v4l-utils support ("--enable-libv4l2"
 | 
			
		||||
option), it will always be used.
 | 
			
		||||
@example
 | 
			
		||||
# Grab and show the input of a video4linux2 device.
 | 
			
		||||
ffplay -f video4linux2 -framerate 30 -video_size hd720 /dev/video0
 | 
			
		||||
 | 
			
		||||
# Grab and record the input of a video4linux2 device, leave the
 | 
			
		||||
framerate and size as previously set.
 | 
			
		||||
ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
"v4l" and "v4l2" can be used as aliases for the respective "video4linux" and
 | 
			
		||||
"video4linux2".
 | 
			
		||||
 | 
			
		||||
@section vfwcap
 | 
			
		||||
 | 
			
		||||
VfW (Video for Windows) capture input device.
 | 
			
		||||
 | 
			
		||||
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.
 | 
			
		||||
 | 
			
		||||
@section x11grab
 | 
			
		||||
 | 
			
		||||
X11 video input device.
 | 
			
		||||
 | 
			
		||||
This device allows to capture a region of an X11 display.
 | 
			
		||||
 | 
			
		||||
The filename passed as input has the syntax:
 | 
			
		||||
@example
 | 
			
		||||
[@var{hostname}]:@var{display_number}.@var{screen_number}[+@var{x_offset},@var{y_offset}]
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@var{hostname}:@var{display_number}.@var{screen_number} specifies the
 | 
			
		||||
X11 display name of the screen to grab from. @var{hostname} can be
 | 
			
		||||
omitted, and defaults to "localhost". The environment variable
 | 
			
		||||
@env{DISPLAY} contains the default display name.
 | 
			
		||||
 | 
			
		||||
@var{x_offset} and @var{y_offset} specify the offsets of the grabbed
 | 
			
		||||
area with respect to the top-left border of the X11 screen. They
 | 
			
		||||
default to 0.
 | 
			
		||||
 | 
			
		||||
Check the X11 documentation (e.g. man X) for more detailed information.
 | 
			
		||||
 | 
			
		||||
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
 | 
			
		||||
ffmpeg -f x11grab -r 25 -s cif -i :0.0 out.mpg
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Grab at position @code{10,20}:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -f x11grab -r 25 -s cif -i :0.0+10,20 out.mpg
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@subsection Options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
@item draw_mouse
 | 
			
		||||
Specify whether to draw the mouse pointer. A value of @code{0} specify
 | 
			
		||||
not to draw the pointer. Default value is @code{1}.
 | 
			
		||||
 | 
			
		||||
@item follow_mouse
 | 
			
		||||
Make the grabbed area follow the mouse. The argument can be
 | 
			
		||||
@code{centered} or a number of pixels @var{PIXELS}.
 | 
			
		||||
 | 
			
		||||
When it is specified with "centered", the grabbing region follows the mouse
 | 
			
		||||
pointer and keeps the pointer at the center of region; otherwise, the region
 | 
			
		||||
follows only when the mouse pointer reaches within @var{PIXELS} (greater than
 | 
			
		||||
zero) to the edge of region.
 | 
			
		||||
 | 
			
		||||
For example:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -f x11grab -follow_mouse centered -r 25 -s cif -i :0.0 out.mpg
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
To follow only when the mouse pointer reaches within 100 pixels to edge:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -f x11grab -follow_mouse 100 -r 25 -s cif -i :0.0 out.mpg
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item framerate
 | 
			
		||||
Set the grabbing frame rate. Default value is @code{ntsc},
 | 
			
		||||
corresponding to a framerate of @code{30000/1001}.
 | 
			
		||||
 | 
			
		||||
@item show_region
 | 
			
		||||
Show grabbed region on screen.
 | 
			
		||||
 | 
			
		||||
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.
 | 
			
		||||
 | 
			
		||||
For example:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -f x11grab -show_region 1 -r 25 -s cif -i :0.0+10,20 out.mpg
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
With @var{follow_mouse}:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -f x11grab -follow_mouse centered -show_region 1 -r 25 -s cif -i :0.0 out.mpg
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item video_size
 | 
			
		||||
Set the video frame size. Default value is @code{vga}.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@c man end INPUT DEVICES
 | 
			
		||||
@@ -5,42 +5,49 @@ NOTE: This is a draft.
 | 
			
		||||
 | 
			
		||||
Overview:
 | 
			
		||||
---------
 | 
			
		||||
 | 
			
		||||
FFmpeg uses Trac for tracking issues, new issues and changes to
 | 
			
		||||
existing issues can be done through a web interface.
 | 
			
		||||
 | 
			
		||||
Issues can be different kinds of things we want to keep track of
 | 
			
		||||
but that do not belong into the source tree itself. This includes
 | 
			
		||||
bug reports, patches, feature requests and license violations. We
 | 
			
		||||
might add more items to this list in the future, so feel free to
 | 
			
		||||
propose a new `type of issue' on the ffmpeg-devel mailing list if
 | 
			
		||||
you feel it is worth tracking.
 | 
			
		||||
 | 
			
		||||
FFmpeg uses Roundup for tracking issues, new issues and changes to
 | 
			
		||||
existing issues can be done through a web interface and through email.
 | 
			
		||||
It is possible to subscribe to individual issues by adding yourself to the
 | 
			
		||||
Cc list or to subscribe to the ffmpeg-trac mailing list which receives
 | 
			
		||||
a mail for every change to every issue.
 | 
			
		||||
nosy list or to subscribe to the ffmpeg-issues mailing list which receives
 | 
			
		||||
a mail for every change to every issue. Replies to such mails will also
 | 
			
		||||
be properly added to the respective issue.
 | 
			
		||||
(the above does all work already after light testing)
 | 
			
		||||
 | 
			
		||||
The subscription URL for the ffmpeg-trac list is:
 | 
			
		||||
http(s)://ffmpeg.org/mailman/listinfo/ffmpeg-trac
 | 
			
		||||
The subscription URL for the ffmpeg-issues list is:
 | 
			
		||||
http://live.polito/mailman/listinfo/ffmpeg-issues
 | 
			
		||||
The URL of the webinterface of the tracker is:
 | 
			
		||||
http(s)://ffmpeg.org/trac/ffmpeg
 | 
			
		||||
http(s)://roundup.ffmpeg/roundup/ffmpeg/
 | 
			
		||||
Note the URLs in this document are obfuscated, you must append the top level
 | 
			
		||||
domain for non-profit organizations to the tracker, and of Italy to the
 | 
			
		||||
mailing list.
 | 
			
		||||
 | 
			
		||||
Email Interface:
 | 
			
		||||
----------------
 | 
			
		||||
There is a mailing list to which all new issues and changes to existing issues
 | 
			
		||||
are sent. You can subscribe through
 | 
			
		||||
http://live.polito/mailman/listinfo/ffmpeg-issues
 | 
			
		||||
Replies to messages there will have their text added to the specific issues.
 | 
			
		||||
Attachments will be added as if they had been uploaded via the web interface.
 | 
			
		||||
You can change the status, substatus, topic, ... by changing the subject in
 | 
			
		||||
your reply like:
 | 
			
		||||
Re: [issue94] register_avcodec and allcodecs.h [type=patch;status=open;substatus=approved]
 | 
			
		||||
Roundup will then change things as you requested and remove the [...] from
 | 
			
		||||
the subject before forwarding the mail to the mailing list.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
NOTE: issue = (bug report || patch || feature request)
 | 
			
		||||
 | 
			
		||||
Type:
 | 
			
		||||
-----
 | 
			
		||||
bug / defect
 | 
			
		||||
bug
 | 
			
		||||
    An error, flaw, mistake, failure, or fault in FFmpeg or libav* that
 | 
			
		||||
    prevents it from behaving as intended.
 | 
			
		||||
 | 
			
		||||
feature request / enhancement
 | 
			
		||||
feature request
 | 
			
		||||
    Request of support for encoding or decoding of a new codec, container
 | 
			
		||||
    or variant.
 | 
			
		||||
    Request of support for more, less or plain different output or behavior
 | 
			
		||||
    where the current implementation cannot be considered wrong.
 | 
			
		||||
 | 
			
		||||
license violation
 | 
			
		||||
    ticket to keep track of (L)GPL violations of ffmpeg by others
 | 
			
		||||
 | 
			
		||||
patch
 | 
			
		||||
    A patch as generated by diff which conforms to the patch submission and
 | 
			
		||||
    development policy.
 | 
			
		||||
@@ -61,8 +68,6 @@ important
 | 
			
		||||
    the separation to normal is somewhat fuzzy.
 | 
			
		||||
    For feature requests this priority would be used for things many people
 | 
			
		||||
    want.
 | 
			
		||||
    Regressions also should be marked as important, regressions are bugs that
 | 
			
		||||
    don't exist in a past revision or another branch.
 | 
			
		||||
 | 
			
		||||
normal
 | 
			
		||||
 | 
			
		||||
@@ -92,17 +97,6 @@ closed
 | 
			
		||||
    final state
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Analyzed flag:
 | 
			
		||||
--------------
 | 
			
		||||
Bugs which have been analyzed and where it is understood what causes them
 | 
			
		||||
and which exact chain of events triggers them. This analysis should be
 | 
			
		||||
available as a message in the bug report.
 | 
			
		||||
Note, do not change the status to analyzed without also providing a clear
 | 
			
		||||
and understandable analysis.
 | 
			
		||||
This state implicates that the bug either has been reproduced or that
 | 
			
		||||
reproduction is not needed as the bug is already understood.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Type/Status/Substatus:
 | 
			
		||||
----------
 | 
			
		||||
*/new/new
 | 
			
		||||
@@ -130,6 +124,24 @@ Type/Status/Substatus:
 | 
			
		||||
    Issues for which some information has been requested by the developers,
 | 
			
		||||
    but which has not been provided by anyone within reasonable time.
 | 
			
		||||
 | 
			
		||||
bug/open/reproduced
 | 
			
		||||
    Bugs which have been reproduced.
 | 
			
		||||
 | 
			
		||||
bug/open/analyzed
 | 
			
		||||
    Bugs which have been analyzed and where it is understood what causes them
 | 
			
		||||
    and which exact chain of events triggers them. This analysis should be
 | 
			
		||||
    available as a message in the bug report.
 | 
			
		||||
    Note, do not change the status to analyzed without also providing a clear
 | 
			
		||||
    and understandable analysis.
 | 
			
		||||
    This state implicates that the bug either has been reproduced or that
 | 
			
		||||
    reproduction is not needed as the bug is already understood.
 | 
			
		||||
 | 
			
		||||
bug/open/needs_more_info
 | 
			
		||||
    Bug reports which are incomplete and or where more information is needed
 | 
			
		||||
    from the submitter or another person who can provide it.
 | 
			
		||||
    This state implicates that the bug has not been analyzed or reproduced.
 | 
			
		||||
    Note, the idea behind needs_more_info is to offload work from the
 | 
			
		||||
    developers to the users whenever possible.
 | 
			
		||||
 | 
			
		||||
bug/closed/fixed
 | 
			
		||||
    Bugs which have to the best of our knowledge been fixed.
 | 
			
		||||
@@ -163,6 +175,10 @@ patch/closed/applied
 | 
			
		||||
patch/closed/rejected
 | 
			
		||||
    Patches which have been rejected.
 | 
			
		||||
 | 
			
		||||
feature_request/open/needs_more_info
 | 
			
		||||
    Feature requests where it is not clear what exactly is wanted
 | 
			
		||||
    (these also could be closed as invalid ...).
 | 
			
		||||
 | 
			
		||||
feature_request/closed/implemented
 | 
			
		||||
    Feature requests which have been implemented.
 | 
			
		||||
 | 
			
		||||
@@ -174,10 +190,12 @@ Note, please do not use type-status-substatus combinations other than the
 | 
			
		||||
above without asking on ffmpeg-dev first!
 | 
			
		||||
 | 
			
		||||
Note2, if you provide the requested info do not forget to remove the
 | 
			
		||||
needs_more_info substatus.
 | 
			
		||||
needs_more_info substate.
 | 
			
		||||
 | 
			
		||||
Component:
 | 
			
		||||
----------
 | 
			
		||||
Topic:
 | 
			
		||||
------
 | 
			
		||||
A topic is a tag you should add to your issue in order to make grouping them
 | 
			
		||||
easier.
 | 
			
		||||
 | 
			
		||||
avcodec
 | 
			
		||||
    issues in libavcodec/*
 | 
			
		||||
@@ -197,9 +215,6 @@ ffmpeg
 | 
			
		||||
ffplay
 | 
			
		||||
    issues in or related to ffplay.c
 | 
			
		||||
 | 
			
		||||
ffprobe
 | 
			
		||||
    issues in or related to ffprobe.c
 | 
			
		||||
 | 
			
		||||
ffserver
 | 
			
		||||
    issues in or related to ffserver.c
 | 
			
		||||
 | 
			
		||||
@@ -207,7 +222,7 @@ build system
 | 
			
		||||
    issues in or related to configure/Makefile
 | 
			
		||||
 | 
			
		||||
regression
 | 
			
		||||
    bugs which were not present in a past revision
 | 
			
		||||
    bugs which were working in a past revision
 | 
			
		||||
 | 
			
		||||
trac
 | 
			
		||||
roundup
 | 
			
		||||
    issues related to our issue tracker
 | 
			
		||||
 
 | 
			
		||||
@@ -1,68 +0,0 @@
 | 
			
		||||
@chapter Metadata
 | 
			
		||||
@c man begin METADATA
 | 
			
		||||
 | 
			
		||||
FFmpeg is able to dump metadata from media files into a simple UTF-8-encoded
 | 
			
		||||
INI-like text file and then load it back using the metadata muxer/demuxer.
 | 
			
		||||
 | 
			
		||||
The file format is as follows:
 | 
			
		||||
@enumerate
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
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 ';FFMETADATA' string, followed by a version number (now 1).
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
Metadata tags are of the form 'key=value'
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
Immediately after header follows global metadata
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
After global metadata there may be sections with per-stream/per-chapter
 | 
			
		||||
metadata.
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in
 | 
			
		||||
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 '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
 | 
			
		||||
'START=num', 'END=num', where num is a positive integer.
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
Empty lines and lines starting with ';' or '#' are ignored.
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
Metadata keys or values containing special characters ('=', ';', '#', '\' and a
 | 
			
		||||
newline) must be escaped with a backslash '\'.
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
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:
 | 
			
		||||
@example
 | 
			
		||||
;FFMETADATA1
 | 
			
		||||
title=bike\\shed
 | 
			
		||||
;this is a comment
 | 
			
		||||
artist=FFmpeg troll team
 | 
			
		||||
 | 
			
		||||
[CHAPTER]
 | 
			
		||||
TIMEBASE=1/1000
 | 
			
		||||
START=0
 | 
			
		||||
#chapter ends at 0:01:00
 | 
			
		||||
END=60000
 | 
			
		||||
title=chapter \#1
 | 
			
		||||
[STREAM]
 | 
			
		||||
title=multi\
 | 
			
		||||
line
 | 
			
		||||
@end example
 | 
			
		||||
@c man end METADATA
 | 
			
		||||
							
								
								
									
										65
									
								
								doc/mips.txt
									
									
									
									
									
								
							
							
						
						
									
										65
									
								
								doc/mips.txt
									
									
									
									
									
								
							@@ -1,65 +0,0 @@
 | 
			
		||||
MIPS optimizations info
 | 
			
		||||
===============================================
 | 
			
		||||
 | 
			
		||||
MIPS optimizations of codecs are targeting MIPS 74k family of
 | 
			
		||||
CPUs. Some of these optimizations are relying more on properties of
 | 
			
		||||
this architecture and some are relying less (and can be used on most
 | 
			
		||||
MIPS architectures without degradation in performance).
 | 
			
		||||
 | 
			
		||||
Along with FFMPEG copyright notice, there is MIPS copyright notice in
 | 
			
		||||
all the files that are created by people from MIPS Technologies.
 | 
			
		||||
 | 
			
		||||
Example of copyright notice:
 | 
			
		||||
===============================================
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (c) 2012
 | 
			
		||||
 *      MIPS Technologies, Inc., California.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. Neither the name of the MIPS Technologies, Inc., nor the names of its
 | 
			
		||||
 *    contributors may be used to endorse or promote products derived from
 | 
			
		||||
 *    this software without specific prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``AS IS'' AND
 | 
			
		||||
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE MIPS TECHNOLOGIES, INC. BE LIABLE
 | 
			
		||||
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 | 
			
		||||
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 | 
			
		||||
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | 
			
		||||
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 | 
			
		||||
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 | 
			
		||||
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 | 
			
		||||
 * SUCH DAMAGE.
 | 
			
		||||
 *
 | 
			
		||||
 * Author:  Author Name (author_name@@mips.com)
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
Files that have MIPS copyright notice in them:
 | 
			
		||||
===============================================
 | 
			
		||||
* libavutil/mips/
 | 
			
		||||
      libm_mips.h
 | 
			
		||||
* libavcodec/mips/
 | 
			
		||||
      acelp_filters_mips.c
 | 
			
		||||
      acelp_vectors_mips.c
 | 
			
		||||
      amrwbdec_mips.c
 | 
			
		||||
      amrwbdec_mips.h
 | 
			
		||||
      celp_filters_mips.c
 | 
			
		||||
      celp_math_mips.c
 | 
			
		||||
      compute_antialias_fixed.h
 | 
			
		||||
      compute_antialias_float.h
 | 
			
		||||
      lsp_mips.h
 | 
			
		||||
      dsputil_mips.c
 | 
			
		||||
      fft_mips.c
 | 
			
		||||
      fft_table.h
 | 
			
		||||
      fft_init_table.c
 | 
			
		||||
      fmtconvert_mips.c
 | 
			
		||||
      mpegaudiodsp_mips_fixed.c
 | 
			
		||||
      mpegaudiodsp_mips_float.c
 | 
			
		||||
@@ -1,65 +0,0 @@
 | 
			
		||||
FFmpeg multithreading methods
 | 
			
		||||
==============================================
 | 
			
		||||
 | 
			
		||||
FFmpeg provides two methods for multithreading codecs.
 | 
			
		||||
 | 
			
		||||
Slice threading decodes multiple parts of a frame at the same time, using
 | 
			
		||||
AVCodecContext execute() and execute2().
 | 
			
		||||
 | 
			
		||||
Frame threading decodes multiple frames at the same time.
 | 
			
		||||
It accepts N future frames and delays decoded pictures by N-1 frames.
 | 
			
		||||
The later frames are decoded in separate threads while the user is
 | 
			
		||||
displaying the current one.
 | 
			
		||||
 | 
			
		||||
Restrictions on clients
 | 
			
		||||
==============================================
 | 
			
		||||
 | 
			
		||||
Slice threading -
 | 
			
		||||
* The client's draw_horiz_band() must be thread-safe according to the comment
 | 
			
		||||
  in avcodec.h.
 | 
			
		||||
 | 
			
		||||
Frame threading -
 | 
			
		||||
* Restrictions with slice threading also apply.
 | 
			
		||||
* For best performance, the client should set thread_safe_callbacks if it
 | 
			
		||||
  provides a thread-safe get_buffer() callback.
 | 
			
		||||
* There is one frame of delay added for every thread beyond the first one.
 | 
			
		||||
  Clients must be able to handle this; the pkt_dts and pkt_pts fields in
 | 
			
		||||
  AVFrame will work as usual.
 | 
			
		||||
 | 
			
		||||
Restrictions on codec implementations
 | 
			
		||||
==============================================
 | 
			
		||||
 | 
			
		||||
Slice threading -
 | 
			
		||||
 None except that there must be something worth executing in parallel.
 | 
			
		||||
 | 
			
		||||
Frame threading -
 | 
			
		||||
* Codecs can only accept entire pictures per packet.
 | 
			
		||||
* Codecs similar to ffv1, whose streams don't reset across frames,
 | 
			
		||||
  will not work because their bitstreams cannot be decoded in parallel.
 | 
			
		||||
 | 
			
		||||
* The contents of buffers must not be read before ff_thread_await_progress()
 | 
			
		||||
  has been called on them. reget_buffer() and buffer age optimizations no longer work.
 | 
			
		||||
* The contents of buffers must not be written to after ff_thread_report_progress()
 | 
			
		||||
  has been called on them. This includes draw_edges().
 | 
			
		||||
 | 
			
		||||
Porting codecs to frame threading
 | 
			
		||||
==============================================
 | 
			
		||||
 | 
			
		||||
Find all context variables that are needed by the next frame. Move all
 | 
			
		||||
code changing them, as well as code calling get_buffer(), up to before
 | 
			
		||||
the decode process starts. Call ff_thread_finish_setup() afterwards. If
 | 
			
		||||
some code can't be moved, have update_thread_context() run it in the next
 | 
			
		||||
thread.
 | 
			
		||||
 | 
			
		||||
If the codec allocates writable tables in its init(), add an init_thread_copy()
 | 
			
		||||
which re-allocates them for other threads.
 | 
			
		||||
 | 
			
		||||
Add CODEC_CAP_FRAME_THREADS to the codec capabilities. There will be very little
 | 
			
		||||
speed gain at this point but it should work.
 | 
			
		||||
 | 
			
		||||
Call ff_thread_report_progress() after some part of the current picture has decoded.
 | 
			
		||||
A good place to put this is where draw_horiz_band() is called - add this if it isn't
 | 
			
		||||
called anywhere, as it's useful too and the implementation is trivial when you're
 | 
			
		||||
doing this. Note that draw_edges() needs to be called before reporting progress.
 | 
			
		||||
 | 
			
		||||
Before accessing a reference frame or its MVs, call ff_thread_await_progress().
 | 
			
		||||
							
								
								
									
										651
									
								
								doc/muxers.texi
									
									
									
									
									
								
							
							
						
						
									
										651
									
								
								doc/muxers.texi
									
									
									
									
									
								
							@@ -1,651 +0,0 @@
 | 
			
		||||
@chapter Muxers
 | 
			
		||||
@c man begin MUXERS
 | 
			
		||||
 | 
			
		||||
Muxers are configured elements in FFmpeg which allow writing
 | 
			
		||||
multimedia streams to a particular type of file.
 | 
			
		||||
 | 
			
		||||
When you configure your FFmpeg build, all the supported muxers
 | 
			
		||||
are enabled by default. You can list all available muxers using the
 | 
			
		||||
configure option @code{--list-muxers}.
 | 
			
		||||
 | 
			
		||||
You can disable all the muxers with the configure option
 | 
			
		||||
@code{--disable-muxers} and selectively enable / disable single muxers
 | 
			
		||||
with the options @code{--enable-muxer=@var{MUXER}} /
 | 
			
		||||
@code{--disable-muxer=@var{MUXER}}.
 | 
			
		||||
 | 
			
		||||
The option @code{-formats} of the ff* tools will display the list of
 | 
			
		||||
enabled muxers.
 | 
			
		||||
 | 
			
		||||
A description of some of the currently available muxers follows.
 | 
			
		||||
 | 
			
		||||
@anchor{crc}
 | 
			
		||||
@section crc
 | 
			
		||||
 | 
			
		||||
CRC (Cyclic Redundancy Check) testing format.
 | 
			
		||||
 | 
			
		||||
This muxer computes and prints the Adler-32 CRC of all the input audio
 | 
			
		||||
and video frames. By default audio frames are converted to signed
 | 
			
		||||
16-bit raw audio and video frames to raw video before computing the
 | 
			
		||||
CRC.
 | 
			
		||||
 | 
			
		||||
The output of the muxer consists of a single line of the form:
 | 
			
		||||
CRC=0x@var{CRC}, where @var{CRC} is a hexadecimal number 0-padded to
 | 
			
		||||
8 digits containing the CRC for all the decoded input frames.
 | 
			
		||||
 | 
			
		||||
For example to compute the CRC of the input, and store it in the file
 | 
			
		||||
@file{out.crc}:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i INPUT -f crc out.crc
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
You can print the CRC to stdout with the command:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i INPUT -f crc -
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
You can select the output format of each frame with @command{ffmpeg} by
 | 
			
		||||
specifying the audio and video codec and format. For example to
 | 
			
		||||
compute the CRC of the input audio converted to PCM unsigned 8-bit
 | 
			
		||||
and the input video converted to MPEG-2 video, use the command:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f crc -
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
See also the @ref{framecrc} muxer.
 | 
			
		||||
 | 
			
		||||
@anchor{framecrc}
 | 
			
		||||
@section framecrc
 | 
			
		||||
 | 
			
		||||
Per-packet CRC (Cyclic Redundancy Check) testing format.
 | 
			
		||||
 | 
			
		||||
This muxer computes and prints the Adler-32 CRC for each audio
 | 
			
		||||
and video packet. By default audio frames are converted to signed
 | 
			
		||||
16-bit raw audio and video frames to raw video before computing the
 | 
			
		||||
CRC.
 | 
			
		||||
 | 
			
		||||
The output of the muxer consists of a line for each audio and video
 | 
			
		||||
packet of the form:
 | 
			
		||||
@example
 | 
			
		||||
@var{stream_index}, @var{packet_dts}, @var{packet_pts}, @var{packet_duration}, @var{packet_size}, 0x@var{CRC}
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@var{CRC} is a hexadecimal number 0-padded to 8 digits containing the
 | 
			
		||||
CRC of the packet.
 | 
			
		||||
 | 
			
		||||
For example to compute the CRC of the audio and video frames in
 | 
			
		||||
@file{INPUT}, converted to raw audio and video packets, and store it
 | 
			
		||||
in the file @file{out.crc}:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i INPUT -f framecrc out.crc
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
To print the information to stdout, use the command:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i INPUT -f framecrc -
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
With @command{ffmpeg}, you can select the output format to which the
 | 
			
		||||
audio and video frames are encoded before computing the CRC for each
 | 
			
		||||
packet by specifying the audio and video codec. For example, to
 | 
			
		||||
compute the CRC of each decoded input audio frame converted to PCM
 | 
			
		||||
unsigned 8-bit and of each decoded input video frame converted to
 | 
			
		||||
MPEG-2 video, use the command:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f framecrc -
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
See also the @ref{crc} muxer.
 | 
			
		||||
 | 
			
		||||
@anchor{framemd5}
 | 
			
		||||
@section framemd5
 | 
			
		||||
 | 
			
		||||
Per-packet MD5 testing format.
 | 
			
		||||
 | 
			
		||||
This muxer computes and prints the MD5 hash for each audio
 | 
			
		||||
and video packet. By default audio frames are converted to signed
 | 
			
		||||
16-bit raw audio and video frames to raw video before computing the
 | 
			
		||||
hash.
 | 
			
		||||
 | 
			
		||||
The output of the muxer consists of a line for each audio and video
 | 
			
		||||
packet of the form:
 | 
			
		||||
@example
 | 
			
		||||
@var{stream_index}, @var{packet_dts}, @var{packet_pts}, @var{packet_duration}, @var{packet_size}, @var{MD5}
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@var{MD5} is a hexadecimal number representing the computed MD5 hash
 | 
			
		||||
for the packet.
 | 
			
		||||
 | 
			
		||||
For example to compute the MD5 of the audio and video frames in
 | 
			
		||||
@file{INPUT}, converted to raw audio and video packets, and store it
 | 
			
		||||
in the file @file{out.md5}:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i INPUT -f framemd5 out.md5
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
To print the information to stdout, use the command:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i INPUT -f framemd5 -
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
See also the @ref{md5} muxer.
 | 
			
		||||
 | 
			
		||||
@anchor{ico}
 | 
			
		||||
@section ico
 | 
			
		||||
 | 
			
		||||
ICO file muxer.
 | 
			
		||||
 | 
			
		||||
Microsoft's icon file format (ICO) has some strict limitations that should be noted:
 | 
			
		||||
 | 
			
		||||
@itemize
 | 
			
		||||
@item
 | 
			
		||||
Size cannot exceed 256 pixels in any dimension
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
Only BMP and PNG images can be stored
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
If a BMP image is used, it must be one of the following pixel formats:
 | 
			
		||||
@example
 | 
			
		||||
BMP Bit Depth      FFmpeg Pixel Format
 | 
			
		||||
1bit               pal8
 | 
			
		||||
4bit               pal8
 | 
			
		||||
8bit               pal8
 | 
			
		||||
16bit              rgb555le
 | 
			
		||||
24bit              bgr24
 | 
			
		||||
32bit              bgra
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
If a BMP image is used, it must use the BITMAPINFOHEADER DIB header
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
If a PNG image is used, it must use the rgba pixel format
 | 
			
		||||
@end itemize
 | 
			
		||||
 | 
			
		||||
@anchor{image2}
 | 
			
		||||
@section image2
 | 
			
		||||
 | 
			
		||||
Image file muxer.
 | 
			
		||||
 | 
			
		||||
The image file muxer writes video frames to image files.
 | 
			
		||||
 | 
			
		||||
The output filenames are specified by a pattern, which can be used to
 | 
			
		||||
produce sequentially numbered series of files.
 | 
			
		||||
The pattern may contain the string "%d" or "%0@var{N}d", this string
 | 
			
		||||
specifies the position of the characters representing a numbering in
 | 
			
		||||
the filenames. If the form "%0@var{N}d" is used, the string
 | 
			
		||||
representing the number in each filename is 0-padded to @var{N}
 | 
			
		||||
digits. The literal character '%' can be specified in the pattern with
 | 
			
		||||
the string "%%".
 | 
			
		||||
 | 
			
		||||
If the pattern contains "%d" or "%0@var{N}d", the first filename of
 | 
			
		||||
the file list specified will contain the number 1, all the following
 | 
			
		||||
numbers will be sequential.
 | 
			
		||||
 | 
			
		||||
The pattern may contain a suffix which is used to automatically
 | 
			
		||||
determine the format of the image files to write.
 | 
			
		||||
 | 
			
		||||
For example the pattern "img-%03d.bmp" will specify a sequence of
 | 
			
		||||
filenames of the form @file{img-001.bmp}, @file{img-002.bmp}, ...,
 | 
			
		||||
@file{img-010.bmp}, etc.
 | 
			
		||||
The pattern "img%%-%d.jpg" will specify a sequence of filenames of the
 | 
			
		||||
form @file{img%-1.jpg}, @file{img%-2.jpg}, ..., @file{img%-10.jpg},
 | 
			
		||||
etc.
 | 
			
		||||
 | 
			
		||||
The following example shows how to use @command{ffmpeg} for creating a
 | 
			
		||||
sequence of files @file{img-001.jpeg}, @file{img-002.jpeg}, ...,
 | 
			
		||||
taking one image every second from the input video:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i in.avi -vsync 1 -r 1 -f image2 'img-%03d.jpeg'
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Note that with @command{ffmpeg}, if the format is not specified with the
 | 
			
		||||
@code{-f} option and the output filename specifies an image file
 | 
			
		||||
format, the image2 muxer is automatically selected, so the previous
 | 
			
		||||
command can be written as:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i in.avi -vsync 1 -r 1 'img-%03d.jpeg'
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Note also that the pattern must not necessarily contain "%d" or
 | 
			
		||||
"%0@var{N}d", for example to create a single image file
 | 
			
		||||
@file{img.jpeg} from the input video you can employ the command:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i in.avi -f image2 -frames:v 1 img.jpeg
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
The image muxer supports the .Y.U.V image file format. This format is
 | 
			
		||||
special in that that each image frame consists of three files, for
 | 
			
		||||
each of the YUV420P components. To read or write this image file format,
 | 
			
		||||
specify the name of the '.Y' file. The muxer will automatically open the
 | 
			
		||||
'.U' and '.V' files as required.
 | 
			
		||||
 | 
			
		||||
@anchor{md5}
 | 
			
		||||
@section md5
 | 
			
		||||
 | 
			
		||||
MD5 testing format.
 | 
			
		||||
 | 
			
		||||
This muxer computes and prints the MD5 hash of all the input audio
 | 
			
		||||
and video frames. By default audio frames are converted to signed
 | 
			
		||||
16-bit raw audio and video frames to raw video before computing the
 | 
			
		||||
hash.
 | 
			
		||||
 | 
			
		||||
The output of the muxer consists of a single line of the form:
 | 
			
		||||
MD5=@var{MD5}, where @var{MD5} is a hexadecimal number representing
 | 
			
		||||
the computed MD5 hash.
 | 
			
		||||
 | 
			
		||||
For example to compute the MD5 hash of the input converted to raw
 | 
			
		||||
audio and video, and store it in the file @file{out.md5}:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i INPUT -f md5 out.md5
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
You can print the MD5 to stdout with the command:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i INPUT -f md5 -
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
See also the @ref{framemd5} muxer.
 | 
			
		||||
 | 
			
		||||
@section MOV/MP4/ISMV
 | 
			
		||||
 | 
			
		||||
The mov/mp4/ismv muxer supports fragmentation. Normally, a MOV/MP4
 | 
			
		||||
file has all the metadata about all packets stored in one location
 | 
			
		||||
(written at the end of the file, it can be moved to the start for
 | 
			
		||||
better playback using the @command{qt-faststart} tool). A fragmented
 | 
			
		||||
file consists of a number of fragments, where packets and metadata
 | 
			
		||||
about these packets are stored together. Writing a fragmented
 | 
			
		||||
file has the advantage that the file is decodable even if the
 | 
			
		||||
writing is interrupted (while a normal MOV/MP4 is undecodable if
 | 
			
		||||
it is not properly finished), and it requires less memory when writing
 | 
			
		||||
very long files (since writing normal MOV/MP4 files stores info about
 | 
			
		||||
every single packet in memory until the file is closed). The downside
 | 
			
		||||
is that it is less compatible with other applications.
 | 
			
		||||
 | 
			
		||||
Fragmentation is enabled by setting one of the AVOptions that define
 | 
			
		||||
how to cut the file into fragments:
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
@item -moov_size @var{bytes}
 | 
			
		||||
Reserves space for the moov atom at the beginning of the file instead of placing the
 | 
			
		||||
moov atom at the end. If the space reserved is insufficient, muxing will fail.
 | 
			
		||||
@item -movflags frag_keyframe
 | 
			
		||||
Start a new fragment at each video keyframe.
 | 
			
		||||
@item -frag_duration @var{duration}
 | 
			
		||||
Create fragments that are @var{duration} microseconds long.
 | 
			
		||||
@item -frag_size @var{size}
 | 
			
		||||
Create fragments that contain up to @var{size} bytes of payload data.
 | 
			
		||||
@item -movflags frag_custom
 | 
			
		||||
Allow the caller to manually choose when to cut fragments, by
 | 
			
		||||
calling @code{av_write_frame(ctx, NULL)} to write a fragment with
 | 
			
		||||
the packets written so far. (This is only useful with other
 | 
			
		||||
applications integrating libavformat, not from @command{ffmpeg}.)
 | 
			
		||||
@item -min_frag_duration @var{duration}
 | 
			
		||||
Don't create fragments that are shorter than @var{duration} microseconds long.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
If more than one condition is specified, fragments are cut when
 | 
			
		||||
one of the specified conditions is fulfilled. The exception to this is
 | 
			
		||||
@code{-min_frag_duration}, which has to be fulfilled for any of the other
 | 
			
		||||
conditions to apply.
 | 
			
		||||
 | 
			
		||||
Additionally, the way the output file is written can be adjusted
 | 
			
		||||
through a few other options:
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
@item -movflags empty_moov
 | 
			
		||||
Write an initial moov atom directly at the start of the file, without
 | 
			
		||||
describing any samples in it. Generally, an mdat/moov pair is written
 | 
			
		||||
at the start of the file, as a normal MOV/MP4 file, containing only
 | 
			
		||||
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,
 | 
			
		||||
packets for all tracks are written in a moof atom (which is slightly
 | 
			
		||||
more efficient), but with this option set, the muxer writes one moof/mdat
 | 
			
		||||
pair for each track, making it easier to separate tracks.
 | 
			
		||||
 | 
			
		||||
This option is implicitly set when writing ismv (Smooth Streaming) files.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
Smooth Streaming content can be pushed in real time to a publishing
 | 
			
		||||
point on IIS with this muxer. Example:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -re @var{<normal input/transcoding options>} -movflags isml+frag_keyframe -f ismv http://server/publishingpoint.isml/Streams(Encoder1)
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@section mpegts
 | 
			
		||||
 | 
			
		||||
MPEG transport stream muxer.
 | 
			
		||||
 | 
			
		||||
This muxer implements ISO 13818-1 and part of ETSI EN 300 468.
 | 
			
		||||
 | 
			
		||||
The muxer options are:
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
@item -mpegts_original_network_id @var{number}
 | 
			
		||||
Set the original_network_id (default 0x0001). This is unique identifier
 | 
			
		||||
of a network in DVB. Its main use is in the unique identification of a
 | 
			
		||||
service through the path Original_Network_ID, Transport_Stream_ID.
 | 
			
		||||
@item -mpegts_transport_stream_id @var{number}
 | 
			
		||||
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_pmt_start_pid @var{number}
 | 
			
		||||
Set the first PID for PMT (default 0x1000, max 0x1f00).
 | 
			
		||||
@item -mpegts_start_pid @var{number}
 | 
			
		||||
Set the first PID for data packets (default 0x0100, max 0x0f00).
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
The recognized metadata settings in mpegts muxer are @code{service_provider}
 | 
			
		||||
and @code{service_name}. If they are not set the default for
 | 
			
		||||
@code{service_provider} is "FFmpeg" and the default for
 | 
			
		||||
@code{service_name} is "Service01".
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i file.mpg -c copy \
 | 
			
		||||
     -mpegts_original_network_id 0x1122 \
 | 
			
		||||
     -mpegts_transport_stream_id 0x3344 \
 | 
			
		||||
     -mpegts_service_id 0x5566 \
 | 
			
		||||
     -mpegts_pmt_start_pid 0x1500 \
 | 
			
		||||
     -mpegts_start_pid 0x150 \
 | 
			
		||||
     -metadata service_provider="Some provider" \
 | 
			
		||||
     -metadata service_name="Some Channel" \
 | 
			
		||||
     -y out.ts
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@section null
 | 
			
		||||
 | 
			
		||||
Null muxer.
 | 
			
		||||
 | 
			
		||||
This muxer does not generate any output file, it is mainly useful for
 | 
			
		||||
testing or benchmarking purposes.
 | 
			
		||||
 | 
			
		||||
For example to benchmark decoding with @command{ffmpeg} you can use the
 | 
			
		||||
command:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -benchmark -i INPUT -f null out.null
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Note that the above command does not read or write the @file{out.null}
 | 
			
		||||
file, but specifying the output file is required by the @command{ffmpeg}
 | 
			
		||||
syntax.
 | 
			
		||||
 | 
			
		||||
Alternatively you can write the command as:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -benchmark -i INPUT -f null -
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@section matroska
 | 
			
		||||
 | 
			
		||||
Matroska container muxer.
 | 
			
		||||
 | 
			
		||||
This muxer implements the matroska and webm container specs.
 | 
			
		||||
 | 
			
		||||
The recognized metadata settings in this muxer are:
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item title=@var{title name}
 | 
			
		||||
Name provided to a single track
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item language=@var{language name}
 | 
			
		||||
Specifies the language of the track in the Matroska languages form
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item stereo_mode=@var{mode}
 | 
			
		||||
Stereo 3D video layout of two views in a single video track
 | 
			
		||||
@table @option
 | 
			
		||||
@item mono
 | 
			
		||||
video is not stereo
 | 
			
		||||
@item left_right
 | 
			
		||||
Both views are arranged side by side, Left-eye view is on the left
 | 
			
		||||
@item bottom_top
 | 
			
		||||
Both views are arranged in top-bottom orientation, Left-eye view is at bottom
 | 
			
		||||
@item top_bottom
 | 
			
		||||
Both views are arranged in top-bottom orientation, Left-eye view is on top
 | 
			
		||||
@item checkerboard_rl
 | 
			
		||||
Each view is arranged in a checkerboard interleaved pattern, Left-eye view being first
 | 
			
		||||
@item checkerboard_lr
 | 
			
		||||
Each view is arranged in a checkerboard interleaved pattern, Right-eye view being first
 | 
			
		||||
@item row_interleaved_rl
 | 
			
		||||
Each view is constituted by a row based interleaving, Right-eye view is first row
 | 
			
		||||
@item row_interleaved_lr
 | 
			
		||||
Each view is constituted by a row based interleaving, Left-eye view is first row
 | 
			
		||||
@item col_interleaved_rl
 | 
			
		||||
Both views are arranged in a column based interleaving manner, Right-eye view is first column
 | 
			
		||||
@item col_interleaved_lr
 | 
			
		||||
Both views are arranged in a column based interleaving manner, Left-eye view is first column
 | 
			
		||||
@item anaglyph_cyan_red
 | 
			
		||||
All frames are in anaglyph format viewable through red-cyan filters
 | 
			
		||||
@item right_left
 | 
			
		||||
Both views are arranged side by side, Right-eye view is on the left
 | 
			
		||||
@item anaglyph_green_magenta
 | 
			
		||||
All frames are in anaglyph format viewable through green-magenta filters
 | 
			
		||||
@item block_lr
 | 
			
		||||
Both eyes laced in one Block, Left-eye view is first
 | 
			
		||||
@item block_rl
 | 
			
		||||
Both eyes laced in one Block, Right-eye view is first
 | 
			
		||||
@end table
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
For example a 3D WebM clip can be created using the following command line:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i sample_left_right_clip.mpg -an -c:v libvpx -metadata stereo_mode=left_right -y stereo_clip.webm
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@section segment, stream_segment, ssegment
 | 
			
		||||
 | 
			
		||||
Basic stream segmenter.
 | 
			
		||||
 | 
			
		||||
The segmenter 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}.
 | 
			
		||||
 | 
			
		||||
@code{stream_segment} is a variant of the muxer used to write to
 | 
			
		||||
streaming output formats, i.e. which do not require global headers,
 | 
			
		||||
and is recommended for outputting e.g. to MPEG transport stream segments.
 | 
			
		||||
@code{ssegment} is a shorter alias for @code{stream_segment}.
 | 
			
		||||
 | 
			
		||||
Every segment starts with a video keyframe, if a video stream is present.
 | 
			
		||||
Note that if you want accurate splitting for a video file, you need to
 | 
			
		||||
make the input key frames correspond to the exact splitting times
 | 
			
		||||
expected by the segmenter, or the segment muxer will start the new
 | 
			
		||||
segment with the key frame found next after the specified start
 | 
			
		||||
time.
 | 
			
		||||
 | 
			
		||||
The segment muxer works best with a single constant frame rate video.
 | 
			
		||||
 | 
			
		||||
Optionally it can generate a list of the created segments, by setting
 | 
			
		||||
the option @var{segment_list}. The list type is specified by the
 | 
			
		||||
@var{segment_list_type} option.
 | 
			
		||||
 | 
			
		||||
The segment muxer supports the following options:
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
@item segment_format @var{format}
 | 
			
		||||
Override the inner container format, by default it is guessed by the filename
 | 
			
		||||
extension.
 | 
			
		||||
@item segment_list @var{name}
 | 
			
		||||
Generate also a listfile named @var{name}. If not specified no
 | 
			
		||||
listfile is generated.
 | 
			
		||||
@item segment_list_flags @var{flags}
 | 
			
		||||
Set flags affecting the segment list generation.
 | 
			
		||||
 | 
			
		||||
It currently supports the following flags:
 | 
			
		||||
@table @var
 | 
			
		||||
@item cache
 | 
			
		||||
Allow caching (only affects M3U8 list files).
 | 
			
		||||
 | 
			
		||||
@item live
 | 
			
		||||
Allow live-friendly file generation.
 | 
			
		||||
 | 
			
		||||
This currently only affects M3U8 lists. In particular, write a fake
 | 
			
		||||
EXT-X-TARGETDURATION duration field at the top of the file, based on
 | 
			
		||||
the specified @var{segment_time}.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
Default value is @code{cache}.
 | 
			
		||||
 | 
			
		||||
@item segment_list_size @var{size}
 | 
			
		||||
Overwrite the listfile once it reaches @var{size} entries. If 0
 | 
			
		||||
the listfile is never overwritten. Default value is 0.
 | 
			
		||||
@item segment_list type @var{type}
 | 
			
		||||
Specify the format for the segment list file.
 | 
			
		||||
 | 
			
		||||
The following values are recognized:
 | 
			
		||||
@table @option
 | 
			
		||||
@item flat
 | 
			
		||||
Generate a flat list for the created segments, one segment per line.
 | 
			
		||||
 | 
			
		||||
@item csv, ext
 | 
			
		||||
Generate a list for the created segments, one segment per line,
 | 
			
		||||
each line matching the format (comma-separated values):
 | 
			
		||||
@example
 | 
			
		||||
@var{segment_filename},@var{segment_start_time},@var{segment_end_time}
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@var{segment_filename} is the name of the output file generated by the
 | 
			
		||||
muxer according to the provided pattern. CSV escaping (according to
 | 
			
		||||
RFC4180) is applied if required.
 | 
			
		||||
 | 
			
		||||
@var{segment_start_time} and @var{segment_end_time} specify
 | 
			
		||||
the segment start and end time expressed in seconds.
 | 
			
		||||
 | 
			
		||||
A list file with the suffix @code{".csv"} or @code{".ext"} will
 | 
			
		||||
auto-select this format.
 | 
			
		||||
 | 
			
		||||
@code{ext} is deprecated in favor or @code{csv}.
 | 
			
		||||
 | 
			
		||||
@item m3u8
 | 
			
		||||
Generate an extended M3U8 file, version 4, compliant with
 | 
			
		||||
@url{http://tools.ietf.org/id/draft-pantos-http-live-streaming-08.txt}.
 | 
			
		||||
 | 
			
		||||
A list file with the suffix @code{".m3u8"} will auto-select this format.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
If not specified the type is guessed from the list file name suffix.
 | 
			
		||||
@item segment_time @var{time}
 | 
			
		||||
Set segment duration to @var{time}. Default value is "2".
 | 
			
		||||
@item segment_time_delta @var{delta}
 | 
			
		||||
Specify the accuracy time when selecting the start time for a
 | 
			
		||||
segment. Default value is "0".
 | 
			
		||||
 | 
			
		||||
When delta is specified a key-frame will start a new segment if its
 | 
			
		||||
PTS satisfies the relation:
 | 
			
		||||
@example
 | 
			
		||||
PTS >= start_time - time_delta
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
This option is useful when splitting video content, which is always
 | 
			
		||||
split at GOP boundaries, in case a key frame is found just before the
 | 
			
		||||
specified split time.
 | 
			
		||||
 | 
			
		||||
In particular may be used in combination with the @file{ffmpeg} option
 | 
			
		||||
@var{force_key_frames}. The key frame times specified by
 | 
			
		||||
@var{force_key_frames} may not be set accurately because of rounding
 | 
			
		||||
issues, with the consequence that a key frame time may result set just
 | 
			
		||||
before the specified time. For constant frame rate videos a value of
 | 
			
		||||
1/2*@var{frame_rate} should address the worst case mismatch between
 | 
			
		||||
the specified time and the time set by @var{force_key_frames}.
 | 
			
		||||
 | 
			
		||||
@item segment_times @var{times}
 | 
			
		||||
Specify a list of split points. @var{times} contains a list of comma
 | 
			
		||||
separated duration specifications, in increasing order.
 | 
			
		||||
@item segment_wrap @var{limit}
 | 
			
		||||
Wrap around segment index once it reaches @var{limit}.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
Some examples follow.
 | 
			
		||||
 | 
			
		||||
@itemize
 | 
			
		||||
@item
 | 
			
		||||
To remux the content of file @file{in.mkv} to a list of segments
 | 
			
		||||
@file{out-000.nut}, @file{out-001.nut}, etc., and write the list of
 | 
			
		||||
generated segments to @file{out.list}:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.list out%03d.nut
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
As the example above, but segment the input file according to the split
 | 
			
		||||
points specified by the @var{segment_times} option:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.csv -segment_times 1,2,3,5,8,13,21 out%03d.nut
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
As the example above, but use the @code{ffmpeg} @var{force_key_frames}
 | 
			
		||||
option to force key frames in the input at the specified location, together
 | 
			
		||||
with the segment option @var{segment_time_delta} to account for
 | 
			
		||||
possible roundings operated when setting key frame times.
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i in.mkv -force_key_frames 1,2,3,5,8,13,21 -vcodec mpeg4 -acodec pcm_s16le -map 0 \
 | 
			
		||||
-f segment -segment_list out.csv -segment_times 1,2,3,5,8,13,21 -segment_time_delta 0.05 out%03d.nut
 | 
			
		||||
@end example
 | 
			
		||||
In order to force key frames on the input file, transcoding is
 | 
			
		||||
required.
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
To convert the @file{in.mkv} to TS segments using the @code{libx264}
 | 
			
		||||
and @code{libfaac} encoders:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i in.mkv -map 0 -codec:v libx264 -codec:a libfaac -f ssegment -segment_list out.list out%03d.ts
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
Segment the input file, and create an M3U8 live playlist (can be used
 | 
			
		||||
as live HLS source):
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -re -i in.mkv -codec copy -map 0 -f segment -segment_list playlist.m3u8 \
 | 
			
		||||
-segment_list_flags +live -segment_time 10 out%03d.mkv
 | 
			
		||||
@end example
 | 
			
		||||
@end itemize
 | 
			
		||||
 | 
			
		||||
@section mp3
 | 
			
		||||
 | 
			
		||||
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. The legacy ID3v1 tag is
 | 
			
		||||
not written by default, but may be enabled with the @code{write_id3v1} option.
 | 
			
		||||
 | 
			
		||||
For seekable output the muxer also writes 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 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.
 | 
			
		||||
 | 
			
		||||
Examples:
 | 
			
		||||
 | 
			
		||||
Write an mp3 with an ID3v2.3 header and an ID3v1 footer:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i INPUT -id3v2_version 3 -write_id3v1 1 out.mp3
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
To attach a picture to an mp3 file select both the audio and the picture stream
 | 
			
		||||
with @code{map}:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i input.mp3 -i cover.png -c copy -map 0 -map 1
 | 
			
		||||
-metadata:s:v title="Album cover" -metadata:s:v comment="Cover (Front)" out.mp3
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@c man end MUXERS
 | 
			
		||||
@@ -17,15 +17,15 @@ Understanding these overoptimized functions:
 | 
			
		||||
As many functions tend to be a bit difficult to understand because
 | 
			
		||||
of optimizations, it can be hard to optimize them further, or write
 | 
			
		||||
architecture-specific versions. It is recommended to look at older
 | 
			
		||||
revisions of the interesting files (web frontends for the various FFmpeg
 | 
			
		||||
branches are listed at http://ffmpeg.org/download.html).
 | 
			
		||||
revisions of the interesting files (for a web frontend try ViewVC at
 | 
			
		||||
http://svn.ffmpeg.org/ffmpeg/trunk/).
 | 
			
		||||
Alternatively, look into the other architecture-specific versions in
 | 
			
		||||
the x86/, ppc/, alpha/ subdirectories. Even if you don't exactly
 | 
			
		||||
comprehend the instructions, it could help understanding the functions
 | 
			
		||||
and how they can be optimized.
 | 
			
		||||
 | 
			
		||||
NOTE: If you still don't understand some function, ask at our mailing list!!!
 | 
			
		||||
(http://lists.ffmpeg.org/mailman/listinfo/ffmpeg-devel)
 | 
			
		||||
(http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
When is an optimization justified?
 | 
			
		||||
@@ -157,68 +157,15 @@ Use asm loops like:
 | 
			
		||||
__asm__(
 | 
			
		||||
    "1: ....
 | 
			
		||||
    ...
 | 
			
		||||
    "jump_instruction ....
 | 
			
		||||
    "jump_instruciton ....
 | 
			
		||||
Do not use C loops:
 | 
			
		||||
do{
 | 
			
		||||
    __asm__(
 | 
			
		||||
        ...
 | 
			
		||||
}while()
 | 
			
		||||
 | 
			
		||||
For x86, mark registers that are clobbered in your asm. This means both
 | 
			
		||||
general x86 registers (e.g. eax) as well as XMM registers. This last one is
 | 
			
		||||
particularly important on Win64, where xmm6-15 are callee-save, and not
 | 
			
		||||
restoring their contents leads to undefined results. In external asm (e.g.
 | 
			
		||||
yasm), you do this by using:
 | 
			
		||||
cglobal functon_name, num_args, num_regs, num_xmm_regs
 | 
			
		||||
In inline asm, you specify clobbered registers at the end of your asm:
 | 
			
		||||
__asm__(".." ::: "%eax").
 | 
			
		||||
If gcc is not set to support sse (-msse) it will not accept xmm registers
 | 
			
		||||
in the clobber list. For that we use two macros to declare the clobbers.
 | 
			
		||||
XMM_CLOBBERS should be used when there are other clobbers, for example:
 | 
			
		||||
__asm__(".." ::: XMM_CLOBBERS("xmm0",) "eax");
 | 
			
		||||
and XMM_CLOBBERS_ONLY should be used when the only clobbers are xmm registers:
 | 
			
		||||
__asm__(".." :: XMM_CLOBBERS_ONLY("xmm0"));
 | 
			
		||||
 | 
			
		||||
Do not expect a compiler to maintain values in your registers between separate
 | 
			
		||||
(inline) asm code blocks. It is not required to. For example, this is bad:
 | 
			
		||||
__asm__("movdqa %0, %%xmm7" : src);
 | 
			
		||||
/* do something */
 | 
			
		||||
__asm__("movdqa %%xmm7, %1" : dst);
 | 
			
		||||
- first of all, you're assuming that the compiler will not use xmm7 in
 | 
			
		||||
   between the two asm blocks.  It probably won't when you test it, but it's
 | 
			
		||||
   a poor assumption that will break at some point for some --cpu compiler flag
 | 
			
		||||
- secondly, you didn't mark xmm7 as clobbered. If you did, the compiler would
 | 
			
		||||
   have restored the original value of xmm7 after the first asm block, thus
 | 
			
		||||
   rendering the combination of the two blocks of code invalid
 | 
			
		||||
Code that depends on data in registries being untouched, should be written as
 | 
			
		||||
a single __asm__() statement. Ideally, a single function contains only one
 | 
			
		||||
__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.
 | 
			
		||||
 | 
			
		||||
Inline asm vs. external asm
 | 
			
		||||
---------------------------
 | 
			
		||||
Both inline asm (__asm__("..") in a .c file, handled by a compiler such as gcc)
 | 
			
		||||
and external asm (.s or .asm files, handled by an assembler such as yasm/nasm)
 | 
			
		||||
are accepted in FFmpeg. Which one to use differs per specific case.
 | 
			
		||||
 | 
			
		||||
- if your code is intended to be inlined in a C function, inline asm is always
 | 
			
		||||
   better, because external asm cannot be inlined
 | 
			
		||||
- if your code calls external functions, yasm is always better
 | 
			
		||||
- if your code takes huge and complex structs as function arguments (e.g.
 | 
			
		||||
   MpegEncContext; note that this is not ideal and is discouraged if there
 | 
			
		||||
   are alternatives), then inline asm is always better, because predicting
 | 
			
		||||
   member offsets in complex structs is almost impossible. It's safest to let
 | 
			
		||||
   the compiler take care of that
 | 
			
		||||
- in many cases, both can be used and it just depends on the preference of the
 | 
			
		||||
   person writing the asm. For new asm, the choice is up to you. For existing
 | 
			
		||||
   asm, you'll likely want to maintain whatever form it is currently in unless
 | 
			
		||||
   there is a good reason to change it.
 | 
			
		||||
- if, for some reason, you believe that a particular chunk of existing external
 | 
			
		||||
   asm could be improved upon further if written in inline asm (or the other
 | 
			
		||||
   way around), then please make the move from external asm <-> inline asm a
 | 
			
		||||
   separate patch before your patches that actually improve the asm.
 | 
			
		||||
Use __asm__() instead of intrinsics. The latter requires a good optimizing compiler
 | 
			
		||||
which gcc is not.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Links:
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										156
									
								
								doc/outdevs.texi
									
									
									
									
									
								
							
							
						
						
									
										156
									
								
								doc/outdevs.texi
									
									
									
									
									
								
							@@ -1,156 +0,0 @@
 | 
			
		||||
@chapter Output Devices
 | 
			
		||||
@c man begin OUTPUT DEVICES
 | 
			
		||||
 | 
			
		||||
Output devices are configured elements in FFmpeg which allow to write
 | 
			
		||||
multimedia data to an output device attached to your system.
 | 
			
		||||
 | 
			
		||||
When you configure your FFmpeg build, all the supported output devices
 | 
			
		||||
are enabled by default. You can list all available ones using the
 | 
			
		||||
configure option "--list-outdevs".
 | 
			
		||||
 | 
			
		||||
You can disable all the output devices using the configure option
 | 
			
		||||
"--disable-outdevs", and selectively enable an output device using the
 | 
			
		||||
option "--enable-outdev=@var{OUTDEV}", or you can disable a particular
 | 
			
		||||
input device using the option "--disable-outdev=@var{OUTDEV}".
 | 
			
		||||
 | 
			
		||||
The option "-formats" of the ff* tools will display the list of
 | 
			
		||||
enabled output devices (amongst the muxers).
 | 
			
		||||
 | 
			
		||||
A description of the currently available output devices follows.
 | 
			
		||||
 | 
			
		||||
@section alsa
 | 
			
		||||
 | 
			
		||||
ALSA (Advanced Linux Sound Architecture) output device.
 | 
			
		||||
 | 
			
		||||
@section caca
 | 
			
		||||
 | 
			
		||||
CACA output device.
 | 
			
		||||
 | 
			
		||||
This output devices allows to show a video stream in CACA window.
 | 
			
		||||
Only one CACA window is allowed per application, so you can
 | 
			
		||||
have only one instance of this output device in an application.
 | 
			
		||||
 | 
			
		||||
To enable this output device you need to configure FFmpeg with
 | 
			
		||||
@code{--enable-libcaca}.
 | 
			
		||||
libcaca is a graphics library that outputs text instead of pixels.
 | 
			
		||||
 | 
			
		||||
For more information about libcaca, check:
 | 
			
		||||
@url{http://caca.zoy.org/wiki/libcaca}
 | 
			
		||||
 | 
			
		||||
@subsection Options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item window_title
 | 
			
		||||
Set the CACA window title, if not specified default to the filename
 | 
			
		||||
specified for the output device.
 | 
			
		||||
 | 
			
		||||
@item window_size
 | 
			
		||||
Set the CACA window size, can be a string of the form
 | 
			
		||||
@var{width}x@var{height} or a video size abbreviation.
 | 
			
		||||
If not specified it defaults to the size of the input video.
 | 
			
		||||
 | 
			
		||||
@item driver
 | 
			
		||||
Set display driver.
 | 
			
		||||
 | 
			
		||||
@item algorithm
 | 
			
		||||
Set dithering algorithm. Dithering is necessary
 | 
			
		||||
because the picture being rendered has usually far more colours than
 | 
			
		||||
the available palette.
 | 
			
		||||
The accepted values are listed with @code{-list_dither algorithms}.
 | 
			
		||||
 | 
			
		||||
@item antialias
 | 
			
		||||
Set antialias method. Antialiasing smoothens the rendered
 | 
			
		||||
image and avoids the commonly seen staircase effect.
 | 
			
		||||
The accepted values are listed with @code{-list_dither antialiases}.
 | 
			
		||||
 | 
			
		||||
@item charset
 | 
			
		||||
Set which characters are going to be used when rendering text.
 | 
			
		||||
The accepted values are listed with @code{-list_dither charsets}.
 | 
			
		||||
 | 
			
		||||
@item color
 | 
			
		||||
Set color to be used when rendering text.
 | 
			
		||||
The accepted values are listed with @code{-list_dither colors}.
 | 
			
		||||
 | 
			
		||||
@item list_drivers
 | 
			
		||||
If set to @option{true}, print a list of available drivers and exit.
 | 
			
		||||
 | 
			
		||||
@item list_dither
 | 
			
		||||
List available dither options related to the argument.
 | 
			
		||||
The argument must be one of @code{algorithms}, @code{antialiases},
 | 
			
		||||
@code{charsets}, @code{colors}.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@subsection Examples
 | 
			
		||||
 | 
			
		||||
@itemize
 | 
			
		||||
@item
 | 
			
		||||
The following command shows the @command{ffmpeg} output is an
 | 
			
		||||
CACA window, forcing its size to 80x25:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i INPUT -vcodec rawvideo -pix_fmt rgb24 -window_size 80x25 -f caca -
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
Show the list of available drivers and exit:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_drivers true -
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item
 | 
			
		||||
Show the list of available dither colors and exit:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_dither colors -
 | 
			
		||||
@end example
 | 
			
		||||
@end itemize
 | 
			
		||||
 | 
			
		||||
@section oss
 | 
			
		||||
 | 
			
		||||
OSS (Open Sound System) output device.
 | 
			
		||||
 | 
			
		||||
@section sdl
 | 
			
		||||
 | 
			
		||||
SDL (Simple DirectMedia Layer) output device.
 | 
			
		||||
 | 
			
		||||
This output devices allows to show a video stream in an SDL
 | 
			
		||||
window. Only one SDL window is allowed per application, so you can
 | 
			
		||||
have only one instance of this output device in an application.
 | 
			
		||||
 | 
			
		||||
To enable this output device you need libsdl installed on your system
 | 
			
		||||
when configuring your build.
 | 
			
		||||
 | 
			
		||||
For more information about SDL, check:
 | 
			
		||||
@url{http://www.libsdl.org/}
 | 
			
		||||
 | 
			
		||||
@subsection Options
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item window_title
 | 
			
		||||
Set the SDL window title, if not specified default to the filename
 | 
			
		||||
specified for the output device.
 | 
			
		||||
 | 
			
		||||
@item icon_title
 | 
			
		||||
Set the name of the iconified SDL window, if not specified it is set
 | 
			
		||||
to the same value of @var{window_title}.
 | 
			
		||||
 | 
			
		||||
@item window_size
 | 
			
		||||
Set the SDL window size, can be a string of the form
 | 
			
		||||
@var{width}x@var{height} or a video size abbreviation.
 | 
			
		||||
If not specified it defaults to the size of the input video,
 | 
			
		||||
downscaled according to the aspect ratio.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@subsection Examples
 | 
			
		||||
 | 
			
		||||
The following command shows the @command{ffmpeg} output is an
 | 
			
		||||
SDL window, forcing its size to the qcif format:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i INPUT -vcodec rawvideo -pix_fmt yuv420p -window_size qcif -f sdl "SDL output"
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@section sndio
 | 
			
		||||
 | 
			
		||||
sndio audio output device.
 | 
			
		||||
 | 
			
		||||
@c man end OUTPUT DEVICES
 | 
			
		||||
@@ -1,365 +0,0 @@
 | 
			
		||||
\input texinfo @c -*- texinfo -*-
 | 
			
		||||
 | 
			
		||||
@settitle Platform Specific information
 | 
			
		||||
@titlepage
 | 
			
		||||
@center @titlefont{Platform Specific information}
 | 
			
		||||
@end titlepage
 | 
			
		||||
 | 
			
		||||
@top
 | 
			
		||||
 | 
			
		||||
@contents
 | 
			
		||||
 | 
			
		||||
@chapter Unix-like
 | 
			
		||||
 | 
			
		||||
Some parts of FFmpeg cannot be built with version 2.15 of the GNU
 | 
			
		||||
assembler which is still provided by a few AMD64 distributions. To
 | 
			
		||||
make sure your compiler really uses the required version of gas
 | 
			
		||||
after a binutils upgrade, run:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
$(gcc -print-prog-name=as) --version
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
If not, then you should install a different compiler that has no
 | 
			
		||||
hard-coded path to gas. In the worst case pass @code{--disable-asm}
 | 
			
		||||
to configure.
 | 
			
		||||
 | 
			
		||||
@section BSD
 | 
			
		||||
 | 
			
		||||
BSD make will not build FFmpeg, you need to install and use GNU Make
 | 
			
		||||
(@command{gmake}).
 | 
			
		||||
 | 
			
		||||
@section (Open)Solaris
 | 
			
		||||
 | 
			
		||||
GNU Make is required to build FFmpeg, so you have to invoke (@command{gmake}),
 | 
			
		||||
standard Solaris Make will not work. When building with a non-c99 front-end
 | 
			
		||||
(gcc, generic suncc) add either @code{--extra-libs=/usr/lib/values-xpg6.o}
 | 
			
		||||
or @code{--extra-libs=/usr/lib/64/values-xpg6.o} to the configure options
 | 
			
		||||
since the libc is not c99-compliant by default. The probes performed by
 | 
			
		||||
configure may raise an exception leading to the death of configure itself
 | 
			
		||||
due to a bug in the system shell. Simply invoke a different shell such as
 | 
			
		||||
bash directly to work around this:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
bash ./configure
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@anchor{Darwin}
 | 
			
		||||
@section Darwin (Mac OS X, iPhone)
 | 
			
		||||
 | 
			
		||||
The toolchain provided with Xcode is sufficient to build the basic
 | 
			
		||||
unacelerated code.
 | 
			
		||||
 | 
			
		||||
Mac OS X on PowerPC or ARM (iPhone) requires a preprocessor from
 | 
			
		||||
@url{http://github.com/yuvi/gas-preprocessor} to build the optimized
 | 
			
		||||
assembler functions. Just download the Perl script and put it somewhere
 | 
			
		||||
in your PATH, FFmpeg's configure will pick it up automatically.
 | 
			
		||||
 | 
			
		||||
Mac OS X on amd64 and x86 requires @command{yasm} to build most of the
 | 
			
		||||
optimized assembler functions. @uref{http://www.finkproject.org/, Fink},
 | 
			
		||||
@uref{http://www.gentoo.org/proj/en/gentoo-alt/prefix/bootstrap-macos.xml, Gentoo Prefix},
 | 
			
		||||
@uref{http://mxcl.github.com/homebrew/, Homebrew}
 | 
			
		||||
or @uref{http://www.macports.org, MacPorts} can easily provide it.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@chapter DOS
 | 
			
		||||
 | 
			
		||||
Using a cross-compiler is preferred for various reasons.
 | 
			
		||||
@url{http://www.delorie.com/howto/djgpp/linux-x-djgpp.html}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@chapter OS/2
 | 
			
		||||
 | 
			
		||||
For information about compiling FFmpeg on OS/2 see
 | 
			
		||||
@url{http://www.edm2.com/index.php/FFmpeg}.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@chapter Windows
 | 
			
		||||
 | 
			
		||||
To get help and instructions for building FFmpeg under Windows, check out
 | 
			
		||||
the FFmpeg Windows Help Forum at
 | 
			
		||||
@url{http://ffmpeg.arrozcru.org/}.
 | 
			
		||||
 | 
			
		||||
@section Native Windows compilation
 | 
			
		||||
 | 
			
		||||
FFmpeg can be built to run natively on Windows using the MinGW tools. Install
 | 
			
		||||
the latest versions of MSYS and MinGW from @url{http://www.mingw.org/}.
 | 
			
		||||
You can find detailed installation instructions in the download
 | 
			
		||||
section and the FAQ.
 | 
			
		||||
 | 
			
		||||
FFmpeg does not build out-of-the-box with the packages the automated MinGW
 | 
			
		||||
installer provides. It also requires coreutils to be installed and many other
 | 
			
		||||
packages updated to the latest version. The minimum versions for some packages
 | 
			
		||||
are listed below:
 | 
			
		||||
 | 
			
		||||
@itemize
 | 
			
		||||
@item bash 3.1
 | 
			
		||||
@item msys-make 3.81-2 (note: not mingw32-make)
 | 
			
		||||
@item w32api 3.13
 | 
			
		||||
@item mingw-runtime 3.15
 | 
			
		||||
@end itemize
 | 
			
		||||
 | 
			
		||||
FFmpeg automatically passes @code{-fno-common} to the compiler to work around
 | 
			
		||||
a GCC bug (see @url{http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37216}).
 | 
			
		||||
 | 
			
		||||
Notes:
 | 
			
		||||
 | 
			
		||||
@itemize
 | 
			
		||||
 | 
			
		||||
@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
 | 
			
		||||
@code{make install}).
 | 
			
		||||
 | 
			
		||||
@item In order to compile FFplay, you must have the MinGW development library
 | 
			
		||||
of @uref{http://www.libsdl.org/, SDL} and @code{pkg-config} installed.
 | 
			
		||||
 | 
			
		||||
@item By using @code{./configure --enable-shared} when configuring FFmpeg,
 | 
			
		||||
you can build the FFmpeg libraries (e.g. libavutil, libavcodec,
 | 
			
		||||
libavformat) as DLLs.
 | 
			
		||||
 | 
			
		||||
@end itemize
 | 
			
		||||
 | 
			
		||||
@section Microsoft Visual C++ compatibility
 | 
			
		||||
 | 
			
		||||
As stated in the FAQ, FFmpeg will not compile under MSVC++. However, if you
 | 
			
		||||
want to use the libav* libraries in your own applications, you can still
 | 
			
		||||
compile those applications using MSVC++. But the libav* libraries you link
 | 
			
		||||
to @emph{must} be built with MinGW. However, you will not be able to debug
 | 
			
		||||
inside the libav* libraries, since MSVC++ does not recognize the debug
 | 
			
		||||
symbols generated by GCC.
 | 
			
		||||
We strongly recommend you to move over from MSVC++ to MinGW tools.
 | 
			
		||||
 | 
			
		||||
This description of how to use the FFmpeg libraries with MSVC++ is based on
 | 
			
		||||
Microsoft Visual C++ 2005 Express Edition. If you have a different version,
 | 
			
		||||
you might have to modify the procedures slightly.
 | 
			
		||||
 | 
			
		||||
@subsection Using static libraries
 | 
			
		||||
 | 
			
		||||
Assuming you have just built and installed FFmpeg in @file{/usr/local}:
 | 
			
		||||
 | 
			
		||||
@enumerate
 | 
			
		||||
 | 
			
		||||
@item Create a new console application ("File / New / Project") and then
 | 
			
		||||
select "Win32 Console Application". On the appropriate page of the
 | 
			
		||||
Application Wizard, uncheck the "Precompiled headers" option.
 | 
			
		||||
 | 
			
		||||
@item Write the source code for your application, or, for testing, just
 | 
			
		||||
copy the code from an existing sample application into the source file
 | 
			
		||||
that MSVC++ has already created for you. For example, you can copy
 | 
			
		||||
@file{libavformat/output-example.c} from the FFmpeg distribution.
 | 
			
		||||
 | 
			
		||||
@item Open the "Project / Properties" dialog box. In the "Configuration"
 | 
			
		||||
combo box, select "All Configurations" so that the changes you make will
 | 
			
		||||
affect both debug and release builds. In the tree view on the left hand
 | 
			
		||||
side, select "C/C++ / General", then edit the "Additional Include
 | 
			
		||||
Directories" setting to contain the path where the FFmpeg includes were
 | 
			
		||||
installed (i.e. @file{c:\msys\1.0\local\include}).
 | 
			
		||||
Do not add MinGW's include directory here, or the include files will
 | 
			
		||||
conflict with MSVC's.
 | 
			
		||||
 | 
			
		||||
@item Still in the "Project / Properties" dialog box, select
 | 
			
		||||
"Linker / General" from the tree view and edit the
 | 
			
		||||
"Additional Library Directories" setting to contain the @file{lib}
 | 
			
		||||
directory where FFmpeg was installed (i.e. @file{c:\msys\1.0\local\lib}),
 | 
			
		||||
the directory where MinGW libs are installed (i.e. @file{c:\mingw\lib}),
 | 
			
		||||
and the directory where MinGW's GCC libs are installed
 | 
			
		||||
(i.e. @file{C:\mingw\lib\gcc\mingw32\4.2.1-sjlj}). Then select
 | 
			
		||||
"Linker / Input" from the tree view, and add the files @file{libavformat.a},
 | 
			
		||||
@file{libavcodec.a}, @file{libavutil.a}, @file{libmingwex.a},
 | 
			
		||||
@file{libgcc.a}, and any other libraries you used (i.e. @file{libz.a})
 | 
			
		||||
to the end of "Additional Dependencies".
 | 
			
		||||
 | 
			
		||||
@item Now, select "C/C++ / Code Generation" from the tree view. Select
 | 
			
		||||
"Debug" in the "Configuration" combo box. Make sure that "Runtime
 | 
			
		||||
Library" is set to "Multi-threaded Debug DLL". Then, select "Release" in
 | 
			
		||||
the "Configuration" combo box and make sure that "Runtime Library" is
 | 
			
		||||
set to "Multi-threaded DLL".
 | 
			
		||||
 | 
			
		||||
@item Click "OK" to close the "Project / Properties" dialog box.
 | 
			
		||||
 | 
			
		||||
@item MSVC++ lacks some C99 header files that are fundamental for FFmpeg.
 | 
			
		||||
Get msinttypes from @url{http://code.google.com/p/msinttypes/downloads/list}
 | 
			
		||||
and install it in MSVC++'s include directory
 | 
			
		||||
(i.e. @file{C:\Program Files\Microsoft Visual Studio 8\VC\include}).
 | 
			
		||||
 | 
			
		||||
@item MSVC++ also does not understand the @code{inline} keyword used by
 | 
			
		||||
FFmpeg, so you must add this line before @code{#include}ing libav*:
 | 
			
		||||
@example
 | 
			
		||||
#define inline _inline
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@item Build your application, everything should work.
 | 
			
		||||
 | 
			
		||||
@end enumerate
 | 
			
		||||
 | 
			
		||||
@subsection Using shared libraries
 | 
			
		||||
 | 
			
		||||
This is how to create DLL and LIB files that are compatible with MSVC++:
 | 
			
		||||
 | 
			
		||||
@enumerate
 | 
			
		||||
 | 
			
		||||
@item Add a call to @file{vcvars32.bat} (which sets up the environment
 | 
			
		||||
variables for the Visual C++ tools) as the first line of @file{msys.bat}.
 | 
			
		||||
The standard location for @file{vcvars32.bat} is
 | 
			
		||||
@file{C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat},
 | 
			
		||||
and the standard location for @file{msys.bat} is @file{C:\msys\1.0\msys.bat}.
 | 
			
		||||
If this corresponds to your setup, add the following line as the first line
 | 
			
		||||
of @file{msys.bat}:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
call "C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat"
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Alternatively, you may start the @file{Visual Studio 2005 Command Prompt},
 | 
			
		||||
and run @file{c:\msys\1.0\msys.bat} from there.
 | 
			
		||||
 | 
			
		||||
@item Within the MSYS shell, run @code{lib.exe}. If you get a help message
 | 
			
		||||
from @file{Microsoft (R) Library Manager}, this means your environment
 | 
			
		||||
variables are set up correctly, the @file{Microsoft (R) Library Manager}
 | 
			
		||||
is on the path and will be used by FFmpeg to create
 | 
			
		||||
MSVC++-compatible import libraries.
 | 
			
		||||
 | 
			
		||||
@item Build FFmpeg with
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
./configure --enable-shared
 | 
			
		||||
make
 | 
			
		||||
make install
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Your install path (@file{/usr/local/} by default) should now have the
 | 
			
		||||
necessary DLL and LIB files under the @file{bin} directory.
 | 
			
		||||
 | 
			
		||||
@end enumerate
 | 
			
		||||
 | 
			
		||||
Alternatively, build the libraries with a cross compiler, according to
 | 
			
		||||
the instructions below in @ref{Cross compilation for Windows with Linux}.
 | 
			
		||||
 | 
			
		||||
To use those files with MSVC++, do the same as you would do with
 | 
			
		||||
the static libraries, as described above. But in Step 4,
 | 
			
		||||
you should only need to add the directory where the LIB files are installed
 | 
			
		||||
(i.e. @file{c:\msys\usr\local\bin}). This is not a typo, the LIB files are
 | 
			
		||||
installed in the @file{bin} directory. And instead of adding the static
 | 
			
		||||
libraries (@file{libxxx.a} files) you should add the MSVC import libraries
 | 
			
		||||
(@file{avcodec.lib}, @file{avformat.lib}, and
 | 
			
		||||
@file{avutil.lib}). Note that you should not use the GCC import
 | 
			
		||||
libraries (@file{libxxx.dll.a} files), as these will give you undefined
 | 
			
		||||
reference errors. There should be no need for @file{libmingwex.a},
 | 
			
		||||
@file{libgcc.a}, and @file{wsock32.lib}, nor any other external library
 | 
			
		||||
statically linked into the DLLs.
 | 
			
		||||
 | 
			
		||||
FFmpeg headers do not declare global data for Windows DLLs through the usual
 | 
			
		||||
dllexport/dllimport interface. Such data will be exported properly while
 | 
			
		||||
building, but to use them in your MSVC++ code you will have to edit the
 | 
			
		||||
appropriate headers and mark the data as dllimport. For example, in
 | 
			
		||||
libavutil/pixdesc.h you should have:
 | 
			
		||||
@example
 | 
			
		||||
extern __declspec(dllimport) const AVPixFmtDescriptor av_pix_fmt_descriptors[];
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Note that using import libraries created by dlltool requires
 | 
			
		||||
the linker optimization option to be set to
 | 
			
		||||
"References: Keep Unreferenced Data (@code{/OPT:NOREF})", otherwise
 | 
			
		||||
the resulting binaries will fail during runtime. This isn't
 | 
			
		||||
required when using import libraries generated by lib.exe.
 | 
			
		||||
This issue is reported upstream at
 | 
			
		||||
@url{http://sourceware.org/bugzilla/show_bug.cgi?id=12633}.
 | 
			
		||||
 | 
			
		||||
To create import libraries that work with the @code{/OPT:REF} option
 | 
			
		||||
(which is enabled by default in Release mode), follow these steps:
 | 
			
		||||
 | 
			
		||||
@enumerate
 | 
			
		||||
 | 
			
		||||
@item Open @emph{Visual Studio 2005 Command Prompt}.
 | 
			
		||||
 | 
			
		||||
Alternatively, in a normal command line prompt, call @file{vcvars32.bat}
 | 
			
		||||
which sets up the environment variables for the Visual C++ tools
 | 
			
		||||
(the standard location for this file is
 | 
			
		||||
@file{C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat}).
 | 
			
		||||
 | 
			
		||||
@item Enter the @file{bin} directory where the created LIB and DLL files
 | 
			
		||||
are stored.
 | 
			
		||||
 | 
			
		||||
@item Generate new import libraries with @command{lib.exe}:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
lib /machine:i386 /def:..\lib\foo-version.def  /out:foo.lib
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Replace @code{foo-version} and @code{foo} with the respective library names.
 | 
			
		||||
 | 
			
		||||
@end enumerate
 | 
			
		||||
 | 
			
		||||
@anchor{Cross compilation for Windows with Linux}
 | 
			
		||||
@section Cross compilation for Windows with Linux
 | 
			
		||||
 | 
			
		||||
You must use the MinGW cross compilation tools available at
 | 
			
		||||
@url{http://www.mingw.org/}.
 | 
			
		||||
 | 
			
		||||
Then configure FFmpeg with the following options:
 | 
			
		||||
@example
 | 
			
		||||
./configure --target-os=mingw32 --cross-prefix=i386-mingw32msvc-
 | 
			
		||||
@end example
 | 
			
		||||
(you can change the cross-prefix according to the prefix chosen for the
 | 
			
		||||
MinGW tools).
 | 
			
		||||
 | 
			
		||||
Then you can easily test FFmpeg with @uref{http://www.winehq.com/, Wine}.
 | 
			
		||||
 | 
			
		||||
@section Compilation under Cygwin
 | 
			
		||||
 | 
			
		||||
Please use Cygwin 1.7.x as the obsolete 1.5.x Cygwin versions lack
 | 
			
		||||
llrint() in its C library.
 | 
			
		||||
 | 
			
		||||
Install your Cygwin with all the "Base" packages, plus the
 | 
			
		||||
following "Devel" ones:
 | 
			
		||||
@example
 | 
			
		||||
binutils, gcc4-core, make, git, mingw-runtime, texi2html
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
In order to run FATE you will also need the following "Utils" packages:
 | 
			
		||||
@example
 | 
			
		||||
bc, diffutils
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
If you want to build FFmpeg with additional libraries, download Cygwin
 | 
			
		||||
"Devel" packages for Ogg and Vorbis from any Cygwin packages repository:
 | 
			
		||||
@example
 | 
			
		||||
libogg-devel, libvorbis-devel
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
These library packages are only available from
 | 
			
		||||
@uref{http://sourceware.org/cygwinports/, Cygwin Ports}:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
yasm, libSDL-devel, libfaac-devel, libaacplus-devel, libgsm-devel, libmp3lame-devel,
 | 
			
		||||
libschroedinger1.0-devel, speex-devel, libtheora-devel, libxvidcore-devel
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
The recommendation for x264 is to build it from source, as it evolves too
 | 
			
		||||
quickly for Cygwin Ports to be up to date.
 | 
			
		||||
 | 
			
		||||
@section Crosscompilation for Windows under Cygwin
 | 
			
		||||
 | 
			
		||||
With Cygwin you can create Windows binaries that do not need the cygwin1.dll.
 | 
			
		||||
 | 
			
		||||
Just install your Cygwin as explained before, plus these additional
 | 
			
		||||
"Devel" packages:
 | 
			
		||||
@example
 | 
			
		||||
gcc-mingw-core, mingw-runtime, mingw-zlib
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
and add some special flags to your configure invocation.
 | 
			
		||||
 | 
			
		||||
For a static build run
 | 
			
		||||
@example
 | 
			
		||||
./configure --target-os=mingw32 --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
and for a build with shared libraries
 | 
			
		||||
@example
 | 
			
		||||
./configure --target-os=mingw32 --enable-shared --disable-static --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@bye
 | 
			
		||||
@@ -1,125 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (c) 2012 Anton Khirnov
 | 
			
		||||
 *
 | 
			
		||||
 * This file is part of Libav.
 | 
			
		||||
 *
 | 
			
		||||
 * Libav 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.
 | 
			
		||||
 *
 | 
			
		||||
 * Libav 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 Libav; if not, write to the Free Software
 | 
			
		||||
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * generate texinfo manpages for avoptions
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <stddef.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include <float.h>
 | 
			
		||||
 | 
			
		||||
#include "libavformat/avformat.h"
 | 
			
		||||
#include "libavcodec/avcodec.h"
 | 
			
		||||
#include "libavutil/opt.h"
 | 
			
		||||
 | 
			
		||||
static void print_usage(void)
 | 
			
		||||
{
 | 
			
		||||
    fprintf(stderr, "Usage: enum_options type\n"
 | 
			
		||||
            "type: format codec\n");
 | 
			
		||||
    exit(1);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void print_option(const AVOption *opts, const AVOption *o, int per_stream)
 | 
			
		||||
{
 | 
			
		||||
    printf("@item -%s%s @var{", o->name, per_stream ? "[:stream_specifier]" : "");
 | 
			
		||||
    switch (o->type) {
 | 
			
		||||
    case AV_OPT_TYPE_BINARY:   printf("hexadecimal string"); break;
 | 
			
		||||
    case AV_OPT_TYPE_STRING:   printf("string");             break;
 | 
			
		||||
    case AV_OPT_TYPE_INT:
 | 
			
		||||
    case AV_OPT_TYPE_INT64:    printf("integer");            break;
 | 
			
		||||
    case AV_OPT_TYPE_FLOAT:
 | 
			
		||||
    case AV_OPT_TYPE_DOUBLE:   printf("float");              break;
 | 
			
		||||
    case AV_OPT_TYPE_RATIONAL: printf("rational number");    break;
 | 
			
		||||
    case AV_OPT_TYPE_FLAGS:    printf("flags");              break;
 | 
			
		||||
    default:                   printf("value");              break;
 | 
			
		||||
    }
 | 
			
		||||
    printf("} (@emph{");
 | 
			
		||||
 | 
			
		||||
    if (o->flags & AV_OPT_FLAG_DECODING_PARAM) {
 | 
			
		||||
        printf("input");
 | 
			
		||||
        if (o->flags & AV_OPT_FLAG_ENCODING_PARAM)
 | 
			
		||||
            printf("/");
 | 
			
		||||
    }
 | 
			
		||||
    if (o->flags & AV_OPT_FLAG_ENCODING_PARAM) printf("output");
 | 
			
		||||
    if (o->flags & AV_OPT_FLAG_AUDIO_PARAM)    printf(",audio");
 | 
			
		||||
    if (o->flags & AV_OPT_FLAG_VIDEO_PARAM)    printf(",video");
 | 
			
		||||
    if (o->flags & AV_OPT_FLAG_SUBTITLE_PARAM) printf(",subtitles");
 | 
			
		||||
 | 
			
		||||
    printf("})\n");
 | 
			
		||||
    if (o->help)
 | 
			
		||||
        printf("%s\n", o->help);
 | 
			
		||||
 | 
			
		||||
    if (o->unit) {
 | 
			
		||||
        const AVOption *u;
 | 
			
		||||
        printf("\nPossible values:\n@table @samp\n");
 | 
			
		||||
 | 
			
		||||
        for (u = opts; u->name; u++) {
 | 
			
		||||
            if (u->type == AV_OPT_TYPE_CONST && u->unit && !strcmp(u->unit, o->unit))
 | 
			
		||||
                printf("@item %s\n%s\n", u->name, u->help ? u->help : "");
 | 
			
		||||
        }
 | 
			
		||||
        printf("@end table\n");
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void show_opts(const AVOption *opts, int per_stream)
 | 
			
		||||
{
 | 
			
		||||
    const AVOption *o;
 | 
			
		||||
 | 
			
		||||
    printf("@table @option\n");
 | 
			
		||||
    for (o = opts; o->name; o++) {
 | 
			
		||||
        if (o->type != AV_OPT_TYPE_CONST)
 | 
			
		||||
            print_option(opts, o, per_stream);
 | 
			
		||||
    }
 | 
			
		||||
    printf("@end table\n");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void show_format_opts(void)
 | 
			
		||||
{
 | 
			
		||||
#include "libavformat/options_table.h"
 | 
			
		||||
 | 
			
		||||
    printf("@section Format AVOptions\n");
 | 
			
		||||
    show_opts(options, 0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void show_codec_opts(void)
 | 
			
		||||
{
 | 
			
		||||
#include "libavcodec/options_table.h"
 | 
			
		||||
 | 
			
		||||
    printf("@section Codec AVOptions\n");
 | 
			
		||||
    show_opts(options, 1);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int main(int argc, char **argv)
 | 
			
		||||
{
 | 
			
		||||
    if (argc < 2)
 | 
			
		||||
        print_usage();
 | 
			
		||||
 | 
			
		||||
    printf("@c DO NOT EDIT THIS FILE!\n"
 | 
			
		||||
           "@c It was generated by print_options.\n\n");
 | 
			
		||||
    if (!strcmp(argv[1], "format"))
 | 
			
		||||
        show_format_opts();
 | 
			
		||||
    else if (!strcmp(argv[1], "codec"))
 | 
			
		||||
        show_codec_opts();
 | 
			
		||||
    else
 | 
			
		||||
        print_usage();
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
@@ -1,724 +0,0 @@
 | 
			
		||||
@chapter Protocols
 | 
			
		||||
@c man begin PROTOCOLS
 | 
			
		||||
 | 
			
		||||
Protocols are configured elements in FFmpeg which allow to access
 | 
			
		||||
resources which require the use of a particular protocol.
 | 
			
		||||
 | 
			
		||||
When you configure your FFmpeg build, all the supported protocols are
 | 
			
		||||
enabled by default. You can list all available ones using the
 | 
			
		||||
configure option "--list-protocols".
 | 
			
		||||
 | 
			
		||||
You can disable all the protocols using the configure option
 | 
			
		||||
"--disable-protocols", and selectively enable a protocol using the
 | 
			
		||||
option "--enable-protocol=@var{PROTOCOL}", or you can disable a
 | 
			
		||||
particular protocol using the option
 | 
			
		||||
"--disable-protocol=@var{PROTOCOL}".
 | 
			
		||||
 | 
			
		||||
The option "-protocols" of the ff* tools will display the list of
 | 
			
		||||
supported protocols.
 | 
			
		||||
 | 
			
		||||
A description of the currently available protocols follows.
 | 
			
		||||
 | 
			
		||||
@section bluray
 | 
			
		||||
 | 
			
		||||
Read BluRay playlist.
 | 
			
		||||
 | 
			
		||||
The accepted options are:
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item angle
 | 
			
		||||
BluRay angle
 | 
			
		||||
 | 
			
		||||
@item chapter
 | 
			
		||||
Start chapter (1...N)
 | 
			
		||||
 | 
			
		||||
@item playlist
 | 
			
		||||
Playlist to read (BDMV/PLAYLIST/?????.mpls)
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
Examples:
 | 
			
		||||
 | 
			
		||||
Read longest playlist from BluRay mounted to /mnt/bluray:
 | 
			
		||||
@example
 | 
			
		||||
bluray:/mnt/bluray
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Read angle 2 of playlist 4 from BluRay mounted to /mnt/bluray, start from chapter 2:
 | 
			
		||||
@example
 | 
			
		||||
-playlist 4 -angle 2 -chapter 2 bluray:/mnt/bluray
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@section concat
 | 
			
		||||
 | 
			
		||||
Physical concatenation protocol.
 | 
			
		||||
 | 
			
		||||
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:
 | 
			
		||||
@example
 | 
			
		||||
concat:@var{URL1}|@var{URL2}|...|@var{URLN}
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
where @var{URL1}, @var{URL2}, ..., @var{URLN} are the urls of the
 | 
			
		||||
resource to be concatenated, each one possibly specifying a distinct
 | 
			
		||||
protocol.
 | 
			
		||||
 | 
			
		||||
For example to read a sequence of files @file{split1.mpeg},
 | 
			
		||||
@file{split2.mpeg}, @file{split3.mpeg} with @command{ffplay} use the
 | 
			
		||||
command:
 | 
			
		||||
@example
 | 
			
		||||
ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Note that you may need to escape the character "|" which is special for
 | 
			
		||||
many shells.
 | 
			
		||||
 | 
			
		||||
@section file
 | 
			
		||||
 | 
			
		||||
File access protocol.
 | 
			
		||||
 | 
			
		||||
Allow to read from or read to a file.
 | 
			
		||||
 | 
			
		||||
For example to read from a file @file{input.mpeg} with @command{ffmpeg}
 | 
			
		||||
use the command:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i file:input.mpeg output.mpeg
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
The ff* tools default to the file protocol, that is a resource
 | 
			
		||||
specified with the name "FILE.mpeg" is interpreted as the URL
 | 
			
		||||
"file:FILE.mpeg".
 | 
			
		||||
 | 
			
		||||
@section gopher
 | 
			
		||||
 | 
			
		||||
Gopher protocol.
 | 
			
		||||
 | 
			
		||||
@section hls
 | 
			
		||||
 | 
			
		||||
Read Apple HTTP Live Streaming compliant segmented stream as
 | 
			
		||||
a uniform one. The M3U8 playlists describing the segments can be
 | 
			
		||||
remote HTTP resources or local files, accessed using the standard
 | 
			
		||||
file protocol.
 | 
			
		||||
The nested protocol is declared by specifying
 | 
			
		||||
"+@var{proto}" after the hls URI scheme name, where @var{proto}
 | 
			
		||||
is either "file" or "http".
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
hls+http://host/path/to/remote/resource.m3u8
 | 
			
		||||
hls+file://path/to/local/resource.m3u8
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Using this protocol is discouraged - the hls demuxer should work
 | 
			
		||||
just as well (if not, please report the issues) and is more complete.
 | 
			
		||||
To use the hls demuxer instead, simply use the direct URLs to the
 | 
			
		||||
m3u8 files.
 | 
			
		||||
 | 
			
		||||
@section http
 | 
			
		||||
 | 
			
		||||
HTTP (Hyper Text Transfer Protocol).
 | 
			
		||||
 | 
			
		||||
@section mmst
 | 
			
		||||
 | 
			
		||||
MMS (Microsoft Media Server) protocol over TCP.
 | 
			
		||||
 | 
			
		||||
@section mmsh
 | 
			
		||||
 | 
			
		||||
MMS (Microsoft Media Server) protocol over HTTP.
 | 
			
		||||
 | 
			
		||||
The required syntax is:
 | 
			
		||||
@example
 | 
			
		||||
mmsh://@var{server}[:@var{port}][/@var{app}][/@var{playpath}]
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@section md5
 | 
			
		||||
 | 
			
		||||
MD5 output protocol.
 | 
			
		||||
 | 
			
		||||
Computes the MD5 hash of the data to be written, and on close writes
 | 
			
		||||
this to the designated output or stdout if none is specified. It can
 | 
			
		||||
be used to test muxers without writing an actual file.
 | 
			
		||||
 | 
			
		||||
Some examples follow.
 | 
			
		||||
@example
 | 
			
		||||
# Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
 | 
			
		||||
ffmpeg -i input.flv -f avi -y md5:output.avi.md5
 | 
			
		||||
 | 
			
		||||
# Write the MD5 hash of the encoded AVI file to stdout.
 | 
			
		||||
ffmpeg -i input.flv -f avi -y md5:
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Note that some formats (typically MOV) require the output protocol to
 | 
			
		||||
be seekable, so they will fail with the MD5 output protocol.
 | 
			
		||||
 | 
			
		||||
@section pipe
 | 
			
		||||
 | 
			
		||||
UNIX pipe access protocol.
 | 
			
		||||
 | 
			
		||||
Allow to read and write from UNIX pipes.
 | 
			
		||||
 | 
			
		||||
The accepted syntax is:
 | 
			
		||||
@example
 | 
			
		||||
pipe:[@var{number}]
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@var{number} is the number corresponding to the file descriptor of the
 | 
			
		||||
pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr).  If @var{number}
 | 
			
		||||
is not specified, by default the stdout file descriptor will be used
 | 
			
		||||
for writing, stdin for reading.
 | 
			
		||||
 | 
			
		||||
For example to read from stdin with @command{ffmpeg}:
 | 
			
		||||
@example
 | 
			
		||||
cat test.wav | ffmpeg -i pipe:0
 | 
			
		||||
# ...this is the same as...
 | 
			
		||||
cat test.wav | ffmpeg -i pipe:
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
For writing to stdout with @command{ffmpeg}:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i test.wav -f avi pipe:1 | cat > test.avi
 | 
			
		||||
# ...this is the same as...
 | 
			
		||||
ffmpeg -i test.wav -f avi pipe: | cat > test.avi
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Note that some formats (typically MOV), require the output protocol to
 | 
			
		||||
be seekable, so they will fail with the pipe output protocol.
 | 
			
		||||
 | 
			
		||||
@section rtmp
 | 
			
		||||
 | 
			
		||||
Real-Time Messaging Protocol.
 | 
			
		||||
 | 
			
		||||
The Real-Time Messaging Protocol (RTMP) is used for streaming multimedia
 | 
			
		||||
content across a TCP/IP network.
 | 
			
		||||
 | 
			
		||||
The required syntax is:
 | 
			
		||||
@example
 | 
			
		||||
rtmp://@var{server}[:@var{port}][/@var{app}][/@var{instance}][/@var{playpath}]
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
The accepted parameters are:
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item server
 | 
			
		||||
The address of the RTMP server.
 | 
			
		||||
 | 
			
		||||
@item port
 | 
			
		||||
The number of the TCP port to use (by default is 1935).
 | 
			
		||||
 | 
			
		||||
@item app
 | 
			
		||||
It is the name of the application to access. It usually corresponds to
 | 
			
		||||
the path where the application is installed on the RTMP server
 | 
			
		||||
(e.g. @file{/ondemand/}, @file{/flash/live/}, etc.). You can override
 | 
			
		||||
the value parsed from the URI through the @code{rtmp_app} option, too.
 | 
			
		||||
 | 
			
		||||
@item playpath
 | 
			
		||||
It is the path or name of the resource to play with reference to the
 | 
			
		||||
application specified in @var{app}, may be prefixed by "mp4:". You
 | 
			
		||||
can override the value parsed from the URI through the @code{rtmp_playpath}
 | 
			
		||||
option, too.
 | 
			
		||||
 | 
			
		||||
@item listen
 | 
			
		||||
Act as a server, listening for an incoming connection.
 | 
			
		||||
 | 
			
		||||
@item timeout
 | 
			
		||||
Maximum time to wait for the incoming connection. Implies listen.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
Additionally, the following parameters can be set via command line options
 | 
			
		||||
(or in code via @code{AVOption}s):
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item rtmp_app
 | 
			
		||||
Name of application to connect on the RTMP server. This option
 | 
			
		||||
overrides the parameter specified in the URI.
 | 
			
		||||
 | 
			
		||||
@item rtmp_buffer
 | 
			
		||||
Set the client buffer time in milliseconds. The default is 3000.
 | 
			
		||||
 | 
			
		||||
@item rtmp_conn
 | 
			
		||||
Extra arbitrary AMF connection parameters, parsed from a string,
 | 
			
		||||
e.g. like @code{B:1 S:authMe O:1 NN:code:1.23 NS:flag:ok O:0}.
 | 
			
		||||
Each value is prefixed by a single character denoting the type,
 | 
			
		||||
B for Boolean, N for number, S for string, O for object, or Z for null,
 | 
			
		||||
followed by a colon. For Booleans the data must be either 0 or 1 for
 | 
			
		||||
FALSE or TRUE, respectively.  Likewise for Objects the data must be 0 or
 | 
			
		||||
1 to end or begin an object, respectively. Data items in subobjects may
 | 
			
		||||
be named, by prefixing the type with 'N' and specifying the name before
 | 
			
		||||
the value (i.e. @code{NB:myFlag:1}). This option may be used multiple
 | 
			
		||||
times to construct arbitrary AMF sequences.
 | 
			
		||||
 | 
			
		||||
@item rtmp_flashver
 | 
			
		||||
Version of the Flash plugin used to run the SWF player. The default
 | 
			
		||||
is LNX 9,0,124,2.
 | 
			
		||||
 | 
			
		||||
@item rtmp_flush_interval
 | 
			
		||||
Number of packets flushed in the same request (RTMPT only). The default
 | 
			
		||||
is 10.
 | 
			
		||||
 | 
			
		||||
@item rtmp_live
 | 
			
		||||
Specify that the media is a live stream. No resuming or seeking in
 | 
			
		||||
live streams is possible. The default value is @code{any}, which means the
 | 
			
		||||
subscriber first tries to play the live stream specified in the
 | 
			
		||||
playpath. If a live stream of that name is not found, it plays the
 | 
			
		||||
recorded stream. The other possible values are @code{live} and
 | 
			
		||||
@code{recorded}.
 | 
			
		||||
 | 
			
		||||
@item rtmp_pageurl
 | 
			
		||||
URL of the web page in which the media was embedded. By default no
 | 
			
		||||
value will be sent.
 | 
			
		||||
 | 
			
		||||
@item rtmp_playpath
 | 
			
		||||
Stream identifier to play or to publish. This option overrides the
 | 
			
		||||
parameter specified in the URI.
 | 
			
		||||
 | 
			
		||||
@item rtmp_subscribe
 | 
			
		||||
Name of live stream to subscribe to. By default no value will be sent.
 | 
			
		||||
It is only sent if the option is specified or if rtmp_live
 | 
			
		||||
is set to live.
 | 
			
		||||
 | 
			
		||||
@item rtmp_swfhash
 | 
			
		||||
SHA256 hash of the decompressed SWF file (32 bytes).
 | 
			
		||||
 | 
			
		||||
@item rtmp_swfsize
 | 
			
		||||
Size of the decompressed SWF file, required for SWFVerification.
 | 
			
		||||
 | 
			
		||||
@item rtmp_swfurl
 | 
			
		||||
URL of the SWF player for the media. By default no value will be sent.
 | 
			
		||||
 | 
			
		||||
@item rtmp_swfverify
 | 
			
		||||
URL to player swf file, compute hash/size automatically.
 | 
			
		||||
 | 
			
		||||
@item rtmp_tcurl
 | 
			
		||||
URL of the target stream. Defaults to proto://host[:port]/app.
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
For example to read with @command{ffplay} a multimedia resource named
 | 
			
		||||
"sample" from the application "vod" from an RTMP server "myserver":
 | 
			
		||||
@example
 | 
			
		||||
ffplay rtmp://myserver/vod/sample
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@section rtmpe
 | 
			
		||||
 | 
			
		||||
Encrypted Real-Time Messaging Protocol.
 | 
			
		||||
 | 
			
		||||
The Encrypted Real-Time Messaging Protocol (RTMPE) is used for
 | 
			
		||||
streaming multimedia content within standard cryptographic primitives,
 | 
			
		||||
consisting of Diffie-Hellman key exchange and HMACSHA256, generating
 | 
			
		||||
a pair of RC4 keys.
 | 
			
		||||
 | 
			
		||||
@section rtmps
 | 
			
		||||
 | 
			
		||||
Real-Time Messaging Protocol over a secure SSL connection.
 | 
			
		||||
 | 
			
		||||
The Real-Time Messaging Protocol (RTMPS) is used for streaming
 | 
			
		||||
multimedia content across an encrypted connection.
 | 
			
		||||
 | 
			
		||||
@section rtmpt
 | 
			
		||||
 | 
			
		||||
Real-Time Messaging Protocol tunneled through HTTP.
 | 
			
		||||
 | 
			
		||||
The Real-Time Messaging Protocol tunneled through HTTP (RTMPT) is used
 | 
			
		||||
for streaming multimedia content within HTTP requests to traverse
 | 
			
		||||
firewalls.
 | 
			
		||||
 | 
			
		||||
@section rtmpte
 | 
			
		||||
 | 
			
		||||
Encrypted Real-Time Messaging Protocol tunneled through HTTP.
 | 
			
		||||
 | 
			
		||||
The Encrypted Real-Time Messaging Protocol tunneled through HTTP (RTMPTE)
 | 
			
		||||
is used for streaming multimedia content within HTTP requests to traverse
 | 
			
		||||
firewalls.
 | 
			
		||||
 | 
			
		||||
@section rtmpts
 | 
			
		||||
 | 
			
		||||
Real-Time Messaging Protocol tunneled through HTTPS.
 | 
			
		||||
 | 
			
		||||
The Real-Time Messaging Protocol tunneled through HTTPS (RTMPTS) is used
 | 
			
		||||
for streaming multimedia content within HTTPS requests to traverse
 | 
			
		||||
firewalls.
 | 
			
		||||
 | 
			
		||||
@section rtmp, rtmpe, rtmps, rtmpt, rtmpte
 | 
			
		||||
 | 
			
		||||
Real-Time Messaging Protocol and its variants supported through
 | 
			
		||||
librtmp.
 | 
			
		||||
 | 
			
		||||
Requires the presence of the librtmp headers and library during
 | 
			
		||||
configuration. You need to explicitly configure the build with
 | 
			
		||||
"--enable-librtmp". If enabled this will replace the native RTMP
 | 
			
		||||
protocol.
 | 
			
		||||
 | 
			
		||||
This protocol provides most client functions and a few server
 | 
			
		||||
functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT),
 | 
			
		||||
encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled
 | 
			
		||||
variants of these encrypted types (RTMPTE, RTMPTS).
 | 
			
		||||
 | 
			
		||||
The required syntax is:
 | 
			
		||||
@example
 | 
			
		||||
@var{rtmp_proto}://@var{server}[:@var{port}][/@var{app}][/@var{playpath}] @var{options}
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
where @var{rtmp_proto} is one of the strings "rtmp", "rtmpt", "rtmpe",
 | 
			
		||||
"rtmps", "rtmpte", "rtmpts" corresponding to each RTMP variant, and
 | 
			
		||||
@var{server}, @var{port}, @var{app} and @var{playpath} have the same
 | 
			
		||||
meaning as specified for the RTMP native protocol.
 | 
			
		||||
@var{options} contains a list of space-separated options of the form
 | 
			
		||||
@var{key}=@var{val}.
 | 
			
		||||
 | 
			
		||||
See the librtmp manual page (man 3 librtmp) for more information.
 | 
			
		||||
 | 
			
		||||
For example, to stream a file in real-time to an RTMP server using
 | 
			
		||||
@command{ffmpeg}:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
To play the same stream using @command{ffplay}:
 | 
			
		||||
@example
 | 
			
		||||
ffplay "rtmp://myserver/live/mystream live=1"
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@section rtp
 | 
			
		||||
 | 
			
		||||
Real-Time Protocol.
 | 
			
		||||
 | 
			
		||||
@section rtsp
 | 
			
		||||
 | 
			
		||||
RTSP is not technically a protocol handler in libavformat, it is a demuxer
 | 
			
		||||
and muxer. The demuxer supports both normal RTSP (with data transferred
 | 
			
		||||
over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with
 | 
			
		||||
data transferred over RDT).
 | 
			
		||||
 | 
			
		||||
The muxer can be used to send a stream using RTSP ANNOUNCE to a server
 | 
			
		||||
supporting it (currently Darwin Streaming Server and Mischa Spiegelmock's
 | 
			
		||||
@uref{http://github.com/revmischa/rtsp-server, RTSP server}).
 | 
			
		||||
 | 
			
		||||
The required syntax for a RTSP url is:
 | 
			
		||||
@example
 | 
			
		||||
rtsp://@var{hostname}[:@var{port}]/@var{path}
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
The following options (set on the @command{ffmpeg}/@command{ffplay} command
 | 
			
		||||
line, or set in code via @code{AVOption}s or in @code{avformat_open_input}),
 | 
			
		||||
are supported:
 | 
			
		||||
 | 
			
		||||
Flags for @code{rtsp_transport}:
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item udp
 | 
			
		||||
Use UDP as lower transport protocol.
 | 
			
		||||
 | 
			
		||||
@item tcp
 | 
			
		||||
Use TCP (interleaving within the RTSP control channel) as lower
 | 
			
		||||
transport protocol.
 | 
			
		||||
 | 
			
		||||
@item udp_multicast
 | 
			
		||||
Use UDP multicast as lower transport protocol.
 | 
			
		||||
 | 
			
		||||
@item http
 | 
			
		||||
Use HTTP tunneling as lower transport protocol, which is useful for
 | 
			
		||||
passing proxies.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
Multiple lower transport protocols may be specified, in that case they are
 | 
			
		||||
tried one at a time (if the setup of one fails, the next one is tried).
 | 
			
		||||
For the muxer, only the @code{tcp} and @code{udp} options are supported.
 | 
			
		||||
 | 
			
		||||
Flags for @code{rtsp_flags}:
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
@item filter_src
 | 
			
		||||
Accept packets only from negotiated peer address and port.
 | 
			
		||||
@item listen
 | 
			
		||||
Act as a server, listening for an incoming connection.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
When receiving data over UDP, the demuxer tries to reorder received packets
 | 
			
		||||
(since they may arrive out of order, or packets may get lost totally). This
 | 
			
		||||
can be disabled by setting the maximum demuxing delay to zero (via
 | 
			
		||||
the @code{max_delay} field of AVFormatContext).
 | 
			
		||||
 | 
			
		||||
When watching multi-bitrate Real-RTSP streams with @command{ffplay}, the
 | 
			
		||||
streams to display can be chosen with @code{-vst} @var{n} and
 | 
			
		||||
@code{-ast} @var{n} for video and audio respectively, and can be switched
 | 
			
		||||
on the fly by pressing @code{v} and @code{a}.
 | 
			
		||||
 | 
			
		||||
Example command lines:
 | 
			
		||||
 | 
			
		||||
To watch a stream over UDP, with a max reordering delay of 0.5 seconds:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
To watch a stream tunneled over HTTP:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffplay -rtsp_transport http rtsp://server/video.mp4
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
To send a stream in realtime to a RTSP server, for others to watch:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -re -i @var{input} -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
To receive a stream in realtime:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -rtsp_flags listen -i rtsp://ownaddress/live.sdp @var{output}
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@section sap
 | 
			
		||||
 | 
			
		||||
Session Announcement Protocol (RFC 2974). This is not technically a
 | 
			
		||||
protocol handler in libavformat, it is a muxer and demuxer.
 | 
			
		||||
It is used for signalling of RTP streams, by announcing the SDP for the
 | 
			
		||||
streams regularly on a separate port.
 | 
			
		||||
 | 
			
		||||
@subsection Muxer
 | 
			
		||||
 | 
			
		||||
The syntax for a SAP url given to the muxer is:
 | 
			
		||||
@example
 | 
			
		||||
sap://@var{destination}[:@var{port}][?@var{options}]
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
The RTP packets are sent to @var{destination} on port @var{port},
 | 
			
		||||
or to port 5004 if no port is specified.
 | 
			
		||||
@var{options} is a @code{&}-separated list. The following options
 | 
			
		||||
are supported:
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item announce_addr=@var{address}
 | 
			
		||||
Specify the destination IP address for sending the announcements to.
 | 
			
		||||
If omitted, the announcements are sent to the commonly used SAP
 | 
			
		||||
announcement multicast address 224.2.127.254 (sap.mcast.net), or
 | 
			
		||||
ff0e::2:7ffe if @var{destination} is an IPv6 address.
 | 
			
		||||
 | 
			
		||||
@item announce_port=@var{port}
 | 
			
		||||
Specify the port to send the announcements on, defaults to
 | 
			
		||||
9875 if not specified.
 | 
			
		||||
 | 
			
		||||
@item ttl=@var{ttl}
 | 
			
		||||
Specify the time to live value for the announcements and RTP packets,
 | 
			
		||||
defaults to 255.
 | 
			
		||||
 | 
			
		||||
@item same_port=@var{0|1}
 | 
			
		||||
If set to 1, send all RTP streams on the same port pair. If zero (the
 | 
			
		||||
default), all streams are sent on unique ports, with each stream on a
 | 
			
		||||
port 2 numbers higher than the previous.
 | 
			
		||||
VLC/Live555 requires this to be set to 1, to be able to receive the stream.
 | 
			
		||||
The RTP stack in libavformat for receiving requires all streams to be sent
 | 
			
		||||
on unique ports.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
Example command lines follow.
 | 
			
		||||
 | 
			
		||||
To broadcast a stream on the local subnet, for watching in VLC:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -re -i @var{input} -f sap sap://224.0.0.255?same_port=1
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Similarly, for watching in @command{ffplay}:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -re -i @var{input} -f sap sap://224.0.0.255
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
And for watching in @command{ffplay}, over IPv6:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -re -i @var{input} -f sap sap://[ff0e::1:2:3:4]
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@subsection Demuxer
 | 
			
		||||
 | 
			
		||||
The syntax for a SAP url given to the demuxer is:
 | 
			
		||||
@example
 | 
			
		||||
sap://[@var{address}][:@var{port}]
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@var{address} is the multicast address to listen for announcements on,
 | 
			
		||||
if omitted, the default 224.2.127.254 (sap.mcast.net) is used. @var{port}
 | 
			
		||||
is the port that is listened on, 9875 if omitted.
 | 
			
		||||
 | 
			
		||||
The demuxers listens for announcements on the given address and port.
 | 
			
		||||
Once an announcement is received, it tries to receive that particular stream.
 | 
			
		||||
 | 
			
		||||
Example command lines follow.
 | 
			
		||||
 | 
			
		||||
To play back the first stream announced on the normal SAP multicast address:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffplay sap://
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
To play back the first stream announced on one the default IPv6 SAP multicast address:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffplay sap://[ff0e::2:7ffe]
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@section tcp
 | 
			
		||||
 | 
			
		||||
Trasmission Control Protocol.
 | 
			
		||||
 | 
			
		||||
The required syntax for a TCP url is:
 | 
			
		||||
@example
 | 
			
		||||
tcp://@var{hostname}:@var{port}[?@var{options}]
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item listen
 | 
			
		||||
Listen for an incoming connection
 | 
			
		||||
 | 
			
		||||
@item timeout=@var{microseconds}
 | 
			
		||||
In read mode: if no data arrived in more than this time interval, raise error.
 | 
			
		||||
In write mode: if socket cannot be written in more than this time interval, raise error.
 | 
			
		||||
This also sets timeout on TCP connection establishing.
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i @var{input} -f @var{format} tcp://@var{hostname}:@var{port}?listen
 | 
			
		||||
ffplay tcp://@var{hostname}:@var{port}
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@section tls
 | 
			
		||||
 | 
			
		||||
Transport Layer Security/Secure Sockets Layer
 | 
			
		||||
 | 
			
		||||
The required syntax for a TLS/SSL url is:
 | 
			
		||||
@example
 | 
			
		||||
tls://@var{hostname}:@var{port}[?@var{options}]
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item listen
 | 
			
		||||
Act as a server, listening for an incoming connection.
 | 
			
		||||
 | 
			
		||||
@item cafile=@var{filename}
 | 
			
		||||
Certificate authority file. The file must be in OpenSSL PEM format.
 | 
			
		||||
 | 
			
		||||
@item cert=@var{filename}
 | 
			
		||||
Certificate file. The file must be in OpenSSL PEM format.
 | 
			
		||||
 | 
			
		||||
@item key=@var{filename}
 | 
			
		||||
Private key file.
 | 
			
		||||
 | 
			
		||||
@item verify=@var{0|1}
 | 
			
		||||
Verify the peer's certificate.
 | 
			
		||||
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
Example command lines:
 | 
			
		||||
 | 
			
		||||
To create a TLS/SSL server that serves an input stream.
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i @var{input} -f @var{format} tls://@var{hostname}:@var{port}?listen&cert=@var{server.crt}&key=@var{server.key}
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
To play back a stream from the TLS/SSL server using @command{ffplay}:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
ffplay tls://@var{hostname}:@var{port}
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@section udp
 | 
			
		||||
 | 
			
		||||
User Datagram Protocol.
 | 
			
		||||
 | 
			
		||||
The required syntax for a UDP url is:
 | 
			
		||||
@example
 | 
			
		||||
udp://@var{hostname}:@var{port}[?@var{options}]
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@var{options} contains a list of &-separated options of the form @var{key}=@var{val}.
 | 
			
		||||
 | 
			
		||||
In case threading is enabled on the system, a circular buffer is used
 | 
			
		||||
to store the incoming data, which allows to reduce loss of data due to
 | 
			
		||||
UDP socket buffer overruns. The @var{fifo_size} and
 | 
			
		||||
@var{overrun_nonfatal} options are related to this buffer.
 | 
			
		||||
 | 
			
		||||
The list of supported options follows.
 | 
			
		||||
 | 
			
		||||
@table @option
 | 
			
		||||
 | 
			
		||||
@item buffer_size=@var{size}
 | 
			
		||||
Set the UDP socket buffer size in bytes. This is used both for the
 | 
			
		||||
receiving and the sending buffer size.
 | 
			
		||||
 | 
			
		||||
@item localport=@var{port}
 | 
			
		||||
Override the local UDP port to bind with.
 | 
			
		||||
 | 
			
		||||
@item localaddr=@var{addr}
 | 
			
		||||
Choose the local IP address. This is useful e.g. if sending multicast
 | 
			
		||||
and the host has multiple interfaces, where the user can choose
 | 
			
		||||
which interface to send on by specifying the IP address of that interface.
 | 
			
		||||
 | 
			
		||||
@item pkt_size=@var{size}
 | 
			
		||||
Set the size in bytes of UDP packets.
 | 
			
		||||
 | 
			
		||||
@item reuse=@var{1|0}
 | 
			
		||||
Explicitly allow or disallow reusing UDP sockets.
 | 
			
		||||
 | 
			
		||||
@item ttl=@var{ttl}
 | 
			
		||||
Set the time to live value (for multicast only).
 | 
			
		||||
 | 
			
		||||
@item connect=@var{1|0}
 | 
			
		||||
Initialize the UDP socket with @code{connect()}. In this case, the
 | 
			
		||||
destination address can't be changed with ff_udp_set_remote_url later.
 | 
			
		||||
If the destination address isn't known at the start, this option can
 | 
			
		||||
be specified in ff_udp_set_remote_url, too.
 | 
			
		||||
This allows finding out the source address for the packets with getsockname,
 | 
			
		||||
and makes writes return with AVERROR(ECONNREFUSED) if "destination
 | 
			
		||||
unreachable" is received.
 | 
			
		||||
For receiving, this gives the benefit of only receiving packets from
 | 
			
		||||
the specified peer address/port.
 | 
			
		||||
 | 
			
		||||
@item sources=@var{address}[,@var{address}]
 | 
			
		||||
Only receive packets sent to the multicast group from one of the
 | 
			
		||||
specified sender IP addresses.
 | 
			
		||||
 | 
			
		||||
@item block=@var{address}[,@var{address}]
 | 
			
		||||
Ignore packets sent to the multicast group from the specified
 | 
			
		||||
sender IP addresses.
 | 
			
		||||
 | 
			
		||||
@item fifo_size=@var{units}
 | 
			
		||||
Set the UDP receiving circular buffer size, expressed as a number of
 | 
			
		||||
packets with size of 188 bytes. If not specified defaults to 7*4096.
 | 
			
		||||
 | 
			
		||||
@item overrun_nonfatal=@var{1|0}
 | 
			
		||||
Survive in case of UDP receiving circular buffer overrun. Default
 | 
			
		||||
value is 0.
 | 
			
		||||
 | 
			
		||||
@item timeout=@var{microseconds}
 | 
			
		||||
In read mode: if no data arrived in more than this time interval, raise error.
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
Some usage examples of the UDP protocol with @command{ffmpeg} follow.
 | 
			
		||||
 | 
			
		||||
To stream over UDP to a remote endpoint:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i @var{input} -f @var{format} udp://@var{hostname}:@var{port}
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
To stream in mpegts format over UDP using 188 sized UDP packets, using a large input buffer:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i @var{input} -f mpegts udp://@var{hostname}:@var{port}?pkt_size=188&buffer_size=65535
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
To receive over UDP from a remote endpoint:
 | 
			
		||||
@example
 | 
			
		||||
ffmpeg -i udp://[@var{multicast-address}]:@var{port}
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@c man end PROTOCOLS
 | 
			
		||||
@@ -1,61 +0,0 @@
 | 
			
		||||
A Quick Description Of Rate Distortion Theory.
 | 
			
		||||
 | 
			
		||||
We want to encode a video, picture or piece of music optimally. What does
 | 
			
		||||
"optimally" really mean? It means that we want to get the best quality at a
 | 
			
		||||
given filesize OR we want to get the smallest filesize at a given quality
 | 
			
		||||
(in practice, these 2 goals are usually the same).
 | 
			
		||||
 | 
			
		||||
Solving this directly is not practical; trying all byte sequences 1
 | 
			
		||||
megabyte in length and selecting the "best looking" sequence will yield
 | 
			
		||||
256^1000000 cases to try.
 | 
			
		||||
 | 
			
		||||
But first, a word about quality, which is also called distortion.
 | 
			
		||||
Distortion can be quantified by almost any quality measurement one chooses.
 | 
			
		||||
Commonly, the sum of squared differences is used but more complex methods
 | 
			
		||||
that consider psychovisual effects can be used as well. It makes no
 | 
			
		||||
difference in this discussion.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
First step: that rate distortion factor called lambda...
 | 
			
		||||
Let's consider the problem of minimizing:
 | 
			
		||||
 | 
			
		||||
  distortion + lambda*rate
 | 
			
		||||
 | 
			
		||||
rate is the filesize
 | 
			
		||||
distortion is the quality
 | 
			
		||||
lambda is a fixed value choosen as a tradeoff between quality and filesize
 | 
			
		||||
Is this equivalent to finding the best quality for a given max
 | 
			
		||||
filesize? The answer is yes. For each filesize limit there is some lambda
 | 
			
		||||
factor for which minimizing above will get you the best quality (using your
 | 
			
		||||
chosen quality measurement) at the desired (or lower) filesize.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Second step: splitting the problem.
 | 
			
		||||
Directly splitting the problem of finding the best quality at a given
 | 
			
		||||
filesize is hard because we do not know how many bits from the total
 | 
			
		||||
filesize should be allocated to each of the subproblems. But the formula
 | 
			
		||||
from above:
 | 
			
		||||
 | 
			
		||||
  distortion + lambda*rate
 | 
			
		||||
 | 
			
		||||
can be trivially split. Consider:
 | 
			
		||||
 | 
			
		||||
  (distortion0 + distortion1) + lambda*(rate0 + rate1)
 | 
			
		||||
 | 
			
		||||
This creates a problem made of 2 independent subproblems. The subproblems
 | 
			
		||||
might be 2 16x16 macroblocks in a frame of 32x16 size. To minimize:
 | 
			
		||||
 | 
			
		||||
  (distortion0 + distortion1) + lambda*(rate0 + rate1)
 | 
			
		||||
 | 
			
		||||
we just have to minimize:
 | 
			
		||||
 | 
			
		||||
  distortion0 + lambda*rate0
 | 
			
		||||
 | 
			
		||||
and
 | 
			
		||||
 | 
			
		||||
  distortion1 + lambda*rate1
 | 
			
		||||
 | 
			
		||||
I.e, the 2 problems can be solved independently.
 | 
			
		||||
 | 
			
		||||
Author: Michael Niedermayer
 | 
			
		||||
Copyright: LGPL
 | 
			
		||||
@@ -9,16 +9,16 @@ it's a little late for this year's soc (2006).
 | 
			
		||||
The Goal:
 | 
			
		||||
Our goal in respect to soc is and must be of course exactly one thing and
 | 
			
		||||
that is to improve FFmpeg, to reach this goal, code must
 | 
			
		||||
* conform to the development policy and patch submission guidelines
 | 
			
		||||
* conform to the svn policy and patch submission guidelines
 | 
			
		||||
* must improve FFmpeg somehow (faster, smaller, "better",
 | 
			
		||||
  more codecs supported, fewer bugs, cleaner, ...)
 | 
			
		||||
 | 
			
		||||
for mentors and other developers to help students to reach that goal it is
 | 
			
		||||
essential that changes to their codebase are publicly visible, clean and
 | 
			
		||||
easy reviewable that again leads us to:
 | 
			
		||||
* use of a revision control system like git
 | 
			
		||||
* use of a revision control system like svn
 | 
			
		||||
* separation of cosmetic from non-cosmetic changes (this is almost entirely
 | 
			
		||||
  ignored by mentors and students in soc 2006 which might lead to a surprise
 | 
			
		||||
  ignored by mentors and students in soc 2006 which might lead to a suprise
 | 
			
		||||
  when the code will be reviewed at the end before a possible inclusion in
 | 
			
		||||
  FFmpeg, individual changes were generally not reviewable due to cosmetics).
 | 
			
		||||
* frequent commits, so that comments can be provided early
 | 
			
		||||
 
 | 
			
		||||
@@ -1,46 +0,0 @@
 | 
			
		||||
    The official guide to swresample for confused developers.
 | 
			
		||||
   =========================================================
 | 
			
		||||
 | 
			
		||||
Current (simplified) Architecture:
 | 
			
		||||
---------------------------------
 | 
			
		||||
                        Input
 | 
			
		||||
                          v
 | 
			
		||||
       __________________/|\___________
 | 
			
		||||
      /                   |            \
 | 
			
		||||
     /    input sample format convert   v
 | 
			
		||||
    /                     | ___________/
 | 
			
		||||
    |                     |/
 | 
			
		||||
    |                     v
 | 
			
		||||
    |         ___________/|\___________              _____________
 | 
			
		||||
    |        /            |            \            |             |
 | 
			
		||||
    |   Rematrix          |          resample <---->|   Buffers   |
 | 
			
		||||
    |        \___________ | ___________/            |_____________|
 | 
			
		||||
    v                    \|/
 | 
			
		||||
Special Converter         v
 | 
			
		||||
    v         ___________/|\___________              _____________
 | 
			
		||||
    |        /            |            \            |             |
 | 
			
		||||
    |   Rematrix          |          resample <---->|   Buffers   |
 | 
			
		||||
    |        \___________ | ___________/            |_____________|
 | 
			
		||||
    |                    \|/
 | 
			
		||||
    |                     v
 | 
			
		||||
    |                     |\___________
 | 
			
		||||
    \                     |            \
 | 
			
		||||
     \   output sample format convert   v
 | 
			
		||||
      \_________________  | ___________/
 | 
			
		||||
                         \|/
 | 
			
		||||
                          v
 | 
			
		||||
                        Output
 | 
			
		||||
 | 
			
		||||
Planar/Packed convertion is done when needed during sample format convertion
 | 
			
		||||
Every step can be skipped without memcpy when its not needed.
 | 
			
		||||
Either Resampling and Rematrixing can be performed first depending on which
 | 
			
		||||
way its faster.
 | 
			
		||||
The Buffers are needed for resampling due to resamplng being a process that
 | 
			
		||||
requires future and past data, it thus also introduces inevitably a delay when
 | 
			
		||||
used.
 | 
			
		||||
Internally 32bit float and 16bit int is supported currently, other formats can
 | 
			
		||||
easily be added
 | 
			
		||||
Externally all sample formats in packed and planar configuration are supported
 | 
			
		||||
Its also trivial to add special converters for common cases
 | 
			
		||||
If only sample format and or packed/planar convertion is needed it
 | 
			
		||||
is performed from input to output directly in a single pass with no intermediates.
 | 
			
		||||
@@ -30,7 +30,7 @@ slices, that is, consecutive non-overlapping rectangles of dimension
 | 
			
		||||
 | 
			
		||||
special converter
 | 
			
		||||
    These generally are unscaled converters of common
 | 
			
		||||
    formats, like YUV 4:2:0/4:2:2 -> RGB12/15/16/24/32. Though it could also
 | 
			
		||||
    formats, like YUV 4:2:0/4:2:2 -> RGB15/16/24/32. Though it could also
 | 
			
		||||
    in principle contain scalers optimized for specific common cases.
 | 
			
		||||
 | 
			
		||||
Main path
 | 
			
		||||
@@ -96,3 +96,4 @@ would benefit from it.
 | 
			
		||||
Also, as already hinted at, initFilter() accepts an optional convolutional
 | 
			
		||||
filter as input that can be used for contrast, saturation, blur, sharpening
 | 
			
		||||
shift, chroma vs. luma shift, ...
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										158
									
								
								doc/syntax.texi
									
									
									
									
									
								
							
							
						
						
									
										158
									
								
								doc/syntax.texi
									
									
									
									
									
								
							@@ -1,158 +0,0 @@
 | 
			
		||||
@chapter Syntax
 | 
			
		||||
@c man begin SYNTAX
 | 
			
		||||
 | 
			
		||||
When evaluating specific formats, FFmpeg uses internal library parsing
 | 
			
		||||
functions, shared by the tools. This section documents the syntax of
 | 
			
		||||
some of these formats.
 | 
			
		||||
 | 
			
		||||
@anchor{date syntax}
 | 
			
		||||
@section Date
 | 
			
		||||
 | 
			
		||||
The accepted syntax is:
 | 
			
		||||
@example
 | 
			
		||||
[(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH:MM:SS[.m...]]])|(HHMMSS[.m...]]]))[Z]
 | 
			
		||||
now
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
If the value is "now" it takes the current time.
 | 
			
		||||
 | 
			
		||||
Time is local time unless Z is appended, in which case it is
 | 
			
		||||
interpreted as UTC.
 | 
			
		||||
If the year-month-day part is not specified it takes the current
 | 
			
		||||
year-month-day.
 | 
			
		||||
 | 
			
		||||
@anchor{time duration syntax}
 | 
			
		||||
@section Time duration
 | 
			
		||||
 | 
			
		||||
The accepted syntax is:
 | 
			
		||||
@example
 | 
			
		||||
[-]HH:MM:SS[.m...]
 | 
			
		||||
[-]S+[.m...]
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
@var{HH} expresses the number of hours, @var{MM} the number a of minutes
 | 
			
		||||
and @var{SS} the number of seconds.
 | 
			
		||||
 | 
			
		||||
@anchor{video size syntax}
 | 
			
		||||
@section Video size
 | 
			
		||||
Specify the size of the sourced video, it may be a string of the form
 | 
			
		||||
@var{width}x@var{height}, or the name of a size abbreviation.
 | 
			
		||||
 | 
			
		||||
The following abbreviations are recognized:
 | 
			
		||||
@table @samp
 | 
			
		||||
@item sqcif
 | 
			
		||||
128x96
 | 
			
		||||
@item qcif
 | 
			
		||||
176x144
 | 
			
		||||
@item cif
 | 
			
		||||
352x288
 | 
			
		||||
@item 4cif
 | 
			
		||||
704x576
 | 
			
		||||
@item 16cif
 | 
			
		||||
1408x1152
 | 
			
		||||
@item qqvga
 | 
			
		||||
160x120
 | 
			
		||||
@item qvga
 | 
			
		||||
320x240
 | 
			
		||||
@item vga
 | 
			
		||||
640x480
 | 
			
		||||
@item svga
 | 
			
		||||
800x600
 | 
			
		||||
@item xga
 | 
			
		||||
1024x768
 | 
			
		||||
@item uxga
 | 
			
		||||
1600x1200
 | 
			
		||||
@item qxga
 | 
			
		||||
2048x1536
 | 
			
		||||
@item sxga
 | 
			
		||||
1280x1024
 | 
			
		||||
@item qsxga
 | 
			
		||||
2560x2048
 | 
			
		||||
@item hsxga
 | 
			
		||||
5120x4096
 | 
			
		||||
@item wvga
 | 
			
		||||
852x480
 | 
			
		||||
@item wxga
 | 
			
		||||
1366x768
 | 
			
		||||
@item wsxga
 | 
			
		||||
1600x1024
 | 
			
		||||
@item wuxga
 | 
			
		||||
1920x1200
 | 
			
		||||
@item woxga
 | 
			
		||||
2560x1600
 | 
			
		||||
@item wqsxga
 | 
			
		||||
3200x2048
 | 
			
		||||
@item wquxga
 | 
			
		||||
3840x2400
 | 
			
		||||
@item whsxga
 | 
			
		||||
6400x4096
 | 
			
		||||
@item whuxga
 | 
			
		||||
7680x4800
 | 
			
		||||
@item cga
 | 
			
		||||
320x200
 | 
			
		||||
@item ega
 | 
			
		||||
640x350
 | 
			
		||||
@item hd480
 | 
			
		||||
852x480
 | 
			
		||||
@item hd720
 | 
			
		||||
1280x720
 | 
			
		||||
@item hd1080
 | 
			
		||||
1920x1080
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@anchor{video rate syntax}
 | 
			
		||||
@section Video rate
 | 
			
		||||
 | 
			
		||||
Specify the frame rate of a video, expressed as the number of frames
 | 
			
		||||
generated per second. It has to be a string in the format
 | 
			
		||||
@var{frame_rate_num}/@var{frame_rate_den}, an integer number, a float
 | 
			
		||||
number or a valid video frame rate abbreviation.
 | 
			
		||||
 | 
			
		||||
The following abbreviations are recognized:
 | 
			
		||||
@table @samp
 | 
			
		||||
@item ntsc
 | 
			
		||||
30000/1001
 | 
			
		||||
@item pal
 | 
			
		||||
25/1
 | 
			
		||||
@item qntsc
 | 
			
		||||
30000/1
 | 
			
		||||
@item qpal
 | 
			
		||||
25/1
 | 
			
		||||
@item sntsc
 | 
			
		||||
30000/1
 | 
			
		||||
@item spal
 | 
			
		||||
25/1
 | 
			
		||||
@item film
 | 
			
		||||
24/1
 | 
			
		||||
@item ntsc-film
 | 
			
		||||
24000/1
 | 
			
		||||
@end table
 | 
			
		||||
 | 
			
		||||
@anchor{ratio syntax}
 | 
			
		||||
@section Ratio
 | 
			
		||||
 | 
			
		||||
A ratio can be expressed as an expression, or in the form
 | 
			
		||||
@var{numerator}:@var{denominator}.
 | 
			
		||||
 | 
			
		||||
Note that a ratio with infinite (1/0) or negative value is
 | 
			
		||||
considered valid, so you should check on the returned value if you
 | 
			
		||||
want to exclude those values.
 | 
			
		||||
 | 
			
		||||
The undefined value can be expressed using the "0:0" string.
 | 
			
		||||
 | 
			
		||||
@anchor{color syntax}
 | 
			
		||||
@section Color
 | 
			
		||||
 | 
			
		||||
It can be the name of a color (case insensitive match) or a
 | 
			
		||||
[0x|#]RRGGBB[AA] sequence, possibly followed by "@@" and a string
 | 
			
		||||
representing the alpha component.
 | 
			
		||||
 | 
			
		||||
The alpha component may be a string composed by "0x" followed by an
 | 
			
		||||
hexadecimal number or a decimal number between 0.0 and 1.0, which
 | 
			
		||||
represents the opacity value (0x00/0.0 means completely transparent,
 | 
			
		||||
0xff/1.0 completely opaque).
 | 
			
		||||
If the alpha component is not specified then 0xff is assumed.
 | 
			
		||||
 | 
			
		||||
The string "random" will result in a random color.
 | 
			
		||||
 | 
			
		||||
@c man end SYNTAX
 | 
			
		||||
							
								
								
									
										173
									
								
								doc/t2h.init
									
									
									
									
									
								
							
							
						
						
									
										173
									
								
								doc/t2h.init
									
									
									
									
									
								
							@@ -1,173 +0,0 @@
 | 
			
		||||
# no horiz rules between sections
 | 
			
		||||
$end_section = \&FFmpeg_end_section;
 | 
			
		||||
sub FFmpeg_end_section($$)
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
$EXTRA_HEAD =
 | 
			
		||||
'<link rel="icon" href="favicon.png" type="image/png" />
 | 
			
		||||
<link rel="stylesheet" type="text/css" href="default.css" />
 | 
			
		||||
';
 | 
			
		||||
 | 
			
		||||
$CSS_LINES = <<EOT;
 | 
			
		||||
<style type="text/css">
 | 
			
		||||
<!--
 | 
			
		||||
a.summary-letter { text-decoration: none }
 | 
			
		||||
a { color: #2D6198; }
 | 
			
		||||
a:visited { color: #884488; }
 | 
			
		||||
h1 a, h2 a, h3 a { text-decoration: inherit; color: inherit; }
 | 
			
		||||
p { margin-left: 1em; margin-right: 1em; }
 | 
			
		||||
table { margin-left: 2em; }
 | 
			
		||||
pre { margin-left: 2em; }
 | 
			
		||||
#footer { text-align: center; }
 | 
			
		||||
#body { margin-left: 1em; margin-right: 1em; }
 | 
			
		||||
body { background-color: #313131; margin: 0; }
 | 
			
		||||
 | 
			
		||||
#container {
 | 
			
		||||
    background-color: white;
 | 
			
		||||
    color: #202020;
 | 
			
		||||
    margin-left: 1em;
 | 
			
		||||
    margin-right: 1em;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
h1 {
 | 
			
		||||
    background-color: #7BB37B;
 | 
			
		||||
    border: 1px solid #6A996A;
 | 
			
		||||
    color: #151515;
 | 
			
		||||
    font-size: 1.2em;
 | 
			
		||||
    padding-bottom: 0.2em;
 | 
			
		||||
    padding-left: 0.4em;
 | 
			
		||||
    padding-top: 0.2em;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
h2 {
 | 
			
		||||
    color: #313131;
 | 
			
		||||
    font-size: 1.2em;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
h3 {
 | 
			
		||||
    color: #313131;
 | 
			
		||||
    font-size: 0.8em;
 | 
			
		||||
    margin-bottom: -8px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.note {
 | 
			
		||||
    margin: 1em;
 | 
			
		||||
    border: 1px solid #bbc9d8;
 | 
			
		||||
    background-color: #dde1e1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.important {
 | 
			
		||||
    margin: 1em;
 | 
			
		||||
    border: 1px solid #d26767;
 | 
			
		||||
    background-color: #f8e1e1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
-->
 | 
			
		||||
</style>
 | 
			
		||||
EOT
 | 
			
		||||
 | 
			
		||||
my $FFMPEG_NAVBAR = $ENV{"FFMPEG_NAVBAR"} || '';
 | 
			
		||||
 | 
			
		||||
$AFTER_BODY_OPEN =
 | 
			
		||||
'<div id="container">' .
 | 
			
		||||
"\n$FFMPEG_NAVBAR\n" .
 | 
			
		||||
'<div id="body">';
 | 
			
		||||
 | 
			
		||||
$PRE_BODY_CLOSE = '</div></div>';
 | 
			
		||||
 | 
			
		||||
$SMALL_RULE = '';
 | 
			
		||||
$BODYTEXT = '';
 | 
			
		||||
 | 
			
		||||
$print_page_foot = \&FFmpeg_print_page_foot;
 | 
			
		||||
sub FFmpeg_print_page_foot($$)
 | 
			
		||||
{
 | 
			
		||||
    my $fh = shift;
 | 
			
		||||
    print $fh '<div id="footer">' . "\n";
 | 
			
		||||
    T2H_DEFAULT_print_page_foot($fh);
 | 
			
		||||
    print $fh "</div>\n";
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
$float = \&FFmpeg_float;
 | 
			
		||||
 | 
			
		||||
sub FFmpeg_float($$$$)
 | 
			
		||||
{
 | 
			
		||||
    my $text = shift;
 | 
			
		||||
    my $float = shift;
 | 
			
		||||
    my $caption = shift;
 | 
			
		||||
    my $shortcaption = shift;
 | 
			
		||||
 | 
			
		||||
    my $label = '';
 | 
			
		||||
    if (exists($float->{'id'}))
 | 
			
		||||
    {
 | 
			
		||||
        $label = &$anchor($float->{'id'});
 | 
			
		||||
    }
 | 
			
		||||
    my $class = '';
 | 
			
		||||
    my $subject = '';
 | 
			
		||||
 | 
			
		||||
    if ($caption =~ /NOTE/)
 | 
			
		||||
    {
 | 
			
		||||
        $class = "note";
 | 
			
		||||
    }
 | 
			
		||||
    elsif ($caption =~ /IMPORTANT/)
 | 
			
		||||
    {
 | 
			
		||||
        $class = "important";
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return '<div class="float ' . $class . '">' . "$label\n" . $text . '</div>';
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
$print_page_head = \&FFmpeg_print_page_head;
 | 
			
		||||
sub FFmpeg_print_page_head($$)
 | 
			
		||||
{
 | 
			
		||||
    my $fh = shift;
 | 
			
		||||
    my $longtitle = "$Texi2HTML::THISDOC{'title_no_texi'}";
 | 
			
		||||
    $longtitle .= ": $Texi2HTML::NO_TEXI{'This'}" if exists $Texi2HTML::NO_TEXI{'This'};
 | 
			
		||||
    my $description = $DOCUMENT_DESCRIPTION;
 | 
			
		||||
    $description = $longtitle if (!defined($description));
 | 
			
		||||
    $description = "<meta name=\"description\" content=\"$description\">" if
 | 
			
		||||
         ($description ne '');
 | 
			
		||||
    $description = $Texi2HTML::THISDOC{'documentdescription'} if (defined($Texi2HTML::THISDOC{'documentdescription'}));
 | 
			
		||||
    my $encoding = '';
 | 
			
		||||
    $encoding = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=$ENCODING\">" if (defined($ENCODING) and ($ENCODING ne ''));
 | 
			
		||||
    $longtitle =~ s/Documentation.*//g;
 | 
			
		||||
    $longtitle = "FFmpeg documentation : " . $longtitle;
 | 
			
		||||
 | 
			
		||||
    print $fh <<EOT;
 | 
			
		||||
$DOCTYPE
 | 
			
		||||
<html>
 | 
			
		||||
$Texi2HTML::THISDOC{'copying'}<!-- Created on $Texi2HTML::THISDOC{today} by $Texi2HTML::THISDOC{program} -->
 | 
			
		||||
<!--
 | 
			
		||||
$Texi2HTML::THISDOC{program_authors}
 | 
			
		||||
-->
 | 
			
		||||
<head>
 | 
			
		||||
<title>$longtitle</title>
 | 
			
		||||
 | 
			
		||||
$description
 | 
			
		||||
<meta name="keywords" content="$longtitle">
 | 
			
		||||
<meta name="resource-type" content="document">
 | 
			
		||||
<meta name="distribution" content="global">
 | 
			
		||||
<meta name="Generator" content="$Texi2HTML::THISDOC{program}">
 | 
			
		||||
$encoding
 | 
			
		||||
$CSS_LINES
 | 
			
		||||
$EXTRA_HEAD
 | 
			
		||||
</head>
 | 
			
		||||
 | 
			
		||||
<body $BODYTEXT>
 | 
			
		||||
$AFTER_BODY_OPEN
 | 
			
		||||
EOT
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# declare encoding in header
 | 
			
		||||
$IN_ENCODING = $ENCODING = "utf-8";
 | 
			
		||||
 | 
			
		||||
# no navigation elements
 | 
			
		||||
$SECTION_NAVIGATION = 0;
 | 
			
		||||
# the same for texi2html 5.0
 | 
			
		||||
$HEADERS = 0;
 | 
			
		||||
 | 
			
		||||
# TOC and Chapter headings link
 | 
			
		||||
$TOC_LINKS = 1;
 | 
			
		||||
 | 
			
		||||
# print the TOC where @contents is used
 | 
			
		||||
$INLINE_CONTENTS = 1;
 | 
			
		||||
@@ -1,70 +0,0 @@
 | 
			
		||||
Writing a table generator
 | 
			
		||||
 | 
			
		||||
This documentation is preliminary.
 | 
			
		||||
Parts of the API are not good and should be changed.
 | 
			
		||||
 | 
			
		||||
Basic concepts
 | 
			
		||||
 | 
			
		||||
A table generator consists of two files, *_tablegen.c and *_tablegen.h.
 | 
			
		||||
The .h file will provide the variable declarations and initialization
 | 
			
		||||
code for the tables, the .c calls the initialization code and then prints
 | 
			
		||||
the tables as a header file using the tableprint.h helpers.
 | 
			
		||||
Both of these files will be compiled for the host system, so to avoid
 | 
			
		||||
breakage with cross-compilation neither of them may include, directly
 | 
			
		||||
or indirectly, config.h or avconfig.h.
 | 
			
		||||
This means that e.g. libavutil/mathematics.h is ok but libavutil/libm.h is not.
 | 
			
		||||
Due to this, the .c file or Makefile may have to provide additional defines
 | 
			
		||||
or stubs, though if possible this should be avoided.
 | 
			
		||||
In particular, CONFIG_HARDCODED_TABLES should always be defined to 0.
 | 
			
		||||
 | 
			
		||||
The .c file
 | 
			
		||||
 | 
			
		||||
This file should include the *_tablegen.h and tableprint.h files and
 | 
			
		||||
anything else it needs as long as it does not depend on config.h or
 | 
			
		||||
avconfig.h.
 | 
			
		||||
In addition to that it must contain a main() function which initializes
 | 
			
		||||
all tables by calling the init functions from the .h file and then prints
 | 
			
		||||
them.
 | 
			
		||||
The printing code typically looks like this:
 | 
			
		||||
    write_fileheader();
 | 
			
		||||
    printf("static const uint8_t my_array[100] = {\n");
 | 
			
		||||
    write_uint8_t_array(my_array, 100);
 | 
			
		||||
    printf("};\n");
 | 
			
		||||
 | 
			
		||||
This is the more generic form, in case you need to do something special.
 | 
			
		||||
Usually you should instead use the short form:
 | 
			
		||||
    write_fileheader();
 | 
			
		||||
    WRITE_ARRAY("static const", uint8_t, my_array);
 | 
			
		||||
 | 
			
		||||
write_fileheader() adds some minor things like a "this is a generated file"
 | 
			
		||||
comment and some standard includes.
 | 
			
		||||
tablegen.h defines some write functions for one- and two-dimensional arrays
 | 
			
		||||
for standard types - they print only the "core" parts so they are easier
 | 
			
		||||
to reuse for multi-dimensional arrays so the outermost {} must be printed
 | 
			
		||||
separately.
 | 
			
		||||
If there's no standard function for printing the type you need, the
 | 
			
		||||
WRITE_1D_FUNC_ARGV macro is a very quick way to create one.
 | 
			
		||||
See libavcodec/dv_tablegen.c for an example.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
The .h file
 | 
			
		||||
 | 
			
		||||
This file should contain:
 | 
			
		||||
 - one or more initialization functions
 | 
			
		||||
 - the table variable declarations
 | 
			
		||||
If CONFIG_HARDCODED_TABLES is set, the initialization functions should
 | 
			
		||||
not do anything, and instead of the variable declarations the
 | 
			
		||||
generated *_tables.h file should be included.
 | 
			
		||||
Since that will be generated in the build directory, the path must be
 | 
			
		||||
included, i.e.
 | 
			
		||||
#include "libavcodec/example_tables.h"
 | 
			
		||||
not
 | 
			
		||||
#include "example_tables.h"
 | 
			
		||||
 | 
			
		||||
Makefile changes
 | 
			
		||||
 | 
			
		||||
To make the automatic table creation work, you must manually declare the
 | 
			
		||||
new dependency.
 | 
			
		||||
For this add a line similar to this:
 | 
			
		||||
$(SUBDIR)example.o: $(SUBDIR)example_tables.h
 | 
			
		||||
under the "ifdef CONFIG_HARDCODED_TABLES" section in the Makefile.
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
#! /usr/bin/perl
 | 
			
		||||
#! /usr/bin/perl -w
 | 
			
		||||
 | 
			
		||||
#   Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
 | 
			
		||||
 | 
			
		||||
@@ -23,12 +23,9 @@
 | 
			
		||||
# markup to Perl POD format.  It's intended to be used to extract
 | 
			
		||||
# something suitable for a manpage from a Texinfo document.
 | 
			
		||||
 | 
			
		||||
use warnings;
 | 
			
		||||
 | 
			
		||||
$output = 0;
 | 
			
		||||
$skipping = 0;
 | 
			
		||||
%sects = ();
 | 
			
		||||
@sects_sequence = ();
 | 
			
		||||
$section = "";
 | 
			
		||||
@icstack = ();
 | 
			
		||||
@endwstack = ();
 | 
			
		||||
@@ -38,7 +35,7 @@ $shift = "";
 | 
			
		||||
%defs = ();
 | 
			
		||||
$fnno = 1;
 | 
			
		||||
$inf = "";
 | 
			
		||||
@ibase = ();
 | 
			
		||||
$ibase = "";
 | 
			
		||||
 | 
			
		||||
while ($_ = shift) {
 | 
			
		||||
    if (/^-D(.*)$/) {
 | 
			
		||||
@@ -54,8 +51,6 @@ while ($_ = shift) {
 | 
			
		||||
        die "flags may only contain letters, digits, hyphens, dashes and underscores\n"
 | 
			
		||||
            unless $flag =~ /^[a-zA-Z0-9_-]+$/;
 | 
			
		||||
        $defs{$flag} = $value;
 | 
			
		||||
    } elsif (/^-I(.*)$/) {
 | 
			
		||||
        push @ibase, $1 ne "" ? $1 : shift;
 | 
			
		||||
    } elsif (/^-/) {
 | 
			
		||||
        usage();
 | 
			
		||||
    } else {
 | 
			
		||||
@@ -65,12 +60,10 @@ while ($_ = shift) {
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
push @ibase, ".";
 | 
			
		||||
 | 
			
		||||
if (defined $in) {
 | 
			
		||||
    $inf = gensym();
 | 
			
		||||
    open($inf, "<$in") or die "opening \"$in\": $!\n";
 | 
			
		||||
    push @ibase, $1 if $in =~ m|^(.+)/[^/]+$|;
 | 
			
		||||
    $ibase = $1 if $in =~ m|^(.+)/[^/]+$|;
 | 
			
		||||
} else {
 | 
			
		||||
    $inf = \*STDIN;
 | 
			
		||||
}
 | 
			
		||||
@@ -80,7 +73,7 @@ if (defined $out) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
while(defined $inf) {
 | 
			
		||||
INF: while(<$inf>) {
 | 
			
		||||
while(<$inf>) {
 | 
			
		||||
    # Certain commands are discarded without further processing.
 | 
			
		||||
    /^\@(?:
 | 
			
		||||
         [a-z]+index            # @*index: useful only in complete manual
 | 
			
		||||
@@ -106,20 +99,15 @@ INF: while(<$inf>) {
 | 
			
		||||
        next;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    /^\@include\s+(.+)$/ and do {
 | 
			
		||||
        push @instack, $inf;
 | 
			
		||||
        $inf = gensym();
 | 
			
		||||
 | 
			
		||||
        for (@ibase) {
 | 
			
		||||
            open($inf, "<" . $_ . "/" . $1) and next INF;
 | 
			
		||||
        }
 | 
			
		||||
        die "cannot open $1: $!\n";
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    # Look for blocks surrounded by @c man begin SECTION ... @c man end.
 | 
			
		||||
    # This really oughta be @ifman ... @end ifman and the like, but such
 | 
			
		||||
    # would require rev'ing all other Texinfo translators.
 | 
			
		||||
    /^\@c\s+man\s+begin\s+([A-Za-z ]+)/ and $sect = $1, push (@sects_sequence, $sect), $output = 1, next;
 | 
			
		||||
    /^\@c\s+man\s+begin\s+([A-Z]+)\s+([A-Za-z0-9-]+)/ and do {
 | 
			
		||||
        $output = 1 if exists $defs{$2};
 | 
			
		||||
        $sect = $1;
 | 
			
		||||
        next;
 | 
			
		||||
    };
 | 
			
		||||
    /^\@c\s+man\s+begin\s+([A-Z]+)/ and $sect = $1, $output = 1, next;
 | 
			
		||||
    /^\@c\s+man\s+end/ and do {
 | 
			
		||||
        $sects{$sect} = "" unless exists $sects{$sect};
 | 
			
		||||
        $sects{$sect} .= postprocess($section);
 | 
			
		||||
@@ -236,18 +224,27 @@ INF: while(<$inf>) {
 | 
			
		||||
 | 
			
		||||
    # Single line command handlers.
 | 
			
		||||
 | 
			
		||||
    /^\@(?:section|unnumbered|unnumberedsec|center|heading)\s+(.+)$/
 | 
			
		||||
    /^\@include\s+(.+)$/ and do {
 | 
			
		||||
        push @instack, $inf;
 | 
			
		||||
        $inf = gensym();
 | 
			
		||||
 | 
			
		||||
        # Try cwd and $ibase.
 | 
			
		||||
        open($inf, "<" . $1)
 | 
			
		||||
            or open($inf, "<" . $ibase . "/" . $1)
 | 
			
		||||
                or die "cannot open $1 or $ibase/$1: $!\n";
 | 
			
		||||
        next;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    /^\@(?:section|unnumbered|unnumberedsec|center)\s+(.+)$/
 | 
			
		||||
        and $_ = "\n=head2 $1\n";
 | 
			
		||||
    /^\@(?:subsection|subheading)\s+(.+)$/
 | 
			
		||||
    /^\@subsection\s+(.+)$/
 | 
			
		||||
        and $_ = "\n=head3 $1\n";
 | 
			
		||||
    /^\@(?:subsubsection|subsubheading)\s+(.+)$/
 | 
			
		||||
        and $_ = "\n=head4 $1\n";
 | 
			
		||||
 | 
			
		||||
    # Block command handlers:
 | 
			
		||||
    /^\@itemize\s*(\@[a-z]+|\*|-)?/ and do {
 | 
			
		||||
    /^\@itemize\s+(\@[a-z]+|\*|-)/ and do {
 | 
			
		||||
        push @endwstack, $endw;
 | 
			
		||||
        push @icstack, $ic;
 | 
			
		||||
        $ic = $1 ? $1 : "*";
 | 
			
		||||
        $ic = $1;
 | 
			
		||||
        $_ = "\n=over 4\n";
 | 
			
		||||
        $endw = "itemize";
 | 
			
		||||
    };
 | 
			
		||||
@@ -306,8 +303,8 @@ die "No filename or title\n" unless defined $fn && defined $tl;
 | 
			
		||||
$sects{NAME} = "$fn \- $tl\n";
 | 
			
		||||
$sects{FOOTNOTES} .= "=back\n" if exists $sects{FOOTNOTES};
 | 
			
		||||
 | 
			
		||||
unshift @sects_sequence, "NAME";
 | 
			
		||||
for $sect (@sects_sequence) {
 | 
			
		||||
for $sect (qw(NAME SYNOPSIS DESCRIPTION OPTIONS EXAMPLES ENVIRONMENT FILES
 | 
			
		||||
              BUGS NOTES FOOTNOTES SEEALSO AUTHOR COPYRIGHT)) {
 | 
			
		||||
    if(exists $sects{$sect}) {
 | 
			
		||||
        $head = $sect;
 | 
			
		||||
        $head =~ s/SEEALSO/SEE ALSO/;
 | 
			
		||||
@@ -353,11 +350,9 @@ 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/\(?\@xref\{(?:[^\}]*)\}(?:[^.<]|(?:<[^<>]*>))*\.\)?//g;
 | 
			
		||||
    s/\s+\(\@pxref\{(?:[^\}]*)\}\)//g;
 | 
			
		||||
    s/;\s+\@pxref\{(?:[^\}]*)\}//g;
 | 
			
		||||
    s/\@ref\{([^\}]*)\}/$1/g;
 | 
			
		||||
    s/\@noindent\s*//g;
 | 
			
		||||
    s/\@refill//g;
 | 
			
		||||
    s/\@gol//g;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										109
									
								
								doc/viterbi.txt
									
									
									
									
									
								
							
							
						
						
									
										109
									
								
								doc/viterbi.txt
									
									
									
									
									
								
							@@ -1,109 +0,0 @@
 | 
			
		||||
This is a quick description of the viterbi aka dynamic programing
 | 
			
		||||
algorthm.
 | 
			
		||||
 | 
			
		||||
Its reason for existence is that wikipedia has become very poor on
 | 
			
		||||
describing algorithms in a way that makes it useable for understanding
 | 
			
		||||
them or anything else actually. It tends now to describe the very same
 | 
			
		||||
algorithm under 50 different names and pages with few understandable
 | 
			
		||||
by even people who fully understand the algorithm and the theory behind.
 | 
			
		||||
 | 
			
		||||
Problem description: (that is what it can solve)
 | 
			
		||||
assume we have a 2d table, or you could call it a graph or matrix if you
 | 
			
		||||
prefer
 | 
			
		||||
 | 
			
		||||
    O   O   O   O   O   O   O
 | 
			
		||||
 | 
			
		||||
    O   O   O   O   O   O   O
 | 
			
		||||
 | 
			
		||||
    O   O   O   O   O   O   O
 | 
			
		||||
 | 
			
		||||
    O   O   O   O   O   O   O
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
That table has edges connecting points from each column to the next column
 | 
			
		||||
and each edge has a score like: (only some edge and scores shown to keep it
 | 
			
		||||
readable)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    O--5--O-----O-----O-----O-----O
 | 
			
		||||
     2   / 7   / \   / \   / \   /
 | 
			
		||||
      \ /   \ /   \ /   \ /   \ /
 | 
			
		||||
    O7-/--O--/--O--/--O--/--O--/--O
 | 
			
		||||
     \/ \/ 1/ \/ \/ \/ \/ \/ \/ \/
 | 
			
		||||
     /\ /\ 2\ /\ /\ /\ /\ /\ /\ /\
 | 
			
		||||
    O3-/--O--/--O--/--O--/--O--/--O
 | 
			
		||||
      / \   / \   / \   / \   / \
 | 
			
		||||
     1   \ 9   \ /   \ /   \ /   \
 | 
			
		||||
    O--2--O--1--O--5--O--3--O--8--O
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Our goal is to find a path from left to right through it which
 | 
			
		||||
minimizes the sum of the score of all edges.
 | 
			
		||||
(and of course left/right is just a convention here it could be top down too)
 | 
			
		||||
Similarly the minimum could be the maximum by just fliping the sign,
 | 
			
		||||
Example of a path with scores:
 | 
			
		||||
 | 
			
		||||
    O   O   O   O   O   O   O
 | 
			
		||||
 | 
			
		||||
>---O.  O   O  .O-2-O   O   O
 | 
			
		||||
      5.     .7      .
 | 
			
		||||
    O   O-1-O   O   O 8 O   O
 | 
			
		||||
                       .
 | 
			
		||||
    O   O   O   O   O   O-1-O---> (sum here is 24)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
The viterbi algorthm now solves this simply column by column
 | 
			
		||||
For the previous column each point has a best path and a associated
 | 
			
		||||
score:
 | 
			
		||||
 | 
			
		||||
    O-----5     O
 | 
			
		||||
     \
 | 
			
		||||
      \
 | 
			
		||||
    O  \  1     O
 | 
			
		||||
        \/
 | 
			
		||||
        /\
 | 
			
		||||
    O  /  2     O
 | 
			
		||||
      /
 | 
			
		||||
     /
 | 
			
		||||
    O-----2     O
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
To move one column forward we just need to find the best path and associated
 | 
			
		||||
scores for the next column
 | 
			
		||||
here are some edges we could choose from:
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    O-----5--3--O
 | 
			
		||||
     \      \8
 | 
			
		||||
      \       \
 | 
			
		||||
    O  \  1--9--O
 | 
			
		||||
        \/  \3
 | 
			
		||||
        /\     \
 | 
			
		||||
    O  /  2--1--O
 | 
			
		||||
      /     \2
 | 
			
		||||
     /        \
 | 
			
		||||
    O-----2--4--O
 | 
			
		||||
 | 
			
		||||
Finding the new best pathes and scores for each point of our new column is
 | 
			
		||||
trivial given we know the previous column best pathes and scores:
 | 
			
		||||
 | 
			
		||||
    O-----0-----8
 | 
			
		||||
     \
 | 
			
		||||
      \
 | 
			
		||||
    O  \  0----10
 | 
			
		||||
        \/
 | 
			
		||||
        /\
 | 
			
		||||
    O  /  0-----3
 | 
			
		||||
      /     \
 | 
			
		||||
     /        \
 | 
			
		||||
    O     0     4
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
the viterbi algorthm continues exactly like this column for column until the
 | 
			
		||||
end and then just picks the path with the best score (above that would be the
 | 
			
		||||
one with score 3)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Author: Michael niedermayer
 | 
			
		||||
Copyright LGPL
 | 
			
		||||
							
								
								
									
										409
									
								
								ffmpeg.h
									
									
									
									
									
								
							
							
						
						
									
										409
									
								
								ffmpeg.h
									
									
									
									
									
								
							@@ -1,409 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * 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
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef FFMPEG_H
 | 
			
		||||
#define FFMPEG_H
 | 
			
		||||
 | 
			
		||||
#include "config.h"
 | 
			
		||||
 | 
			
		||||
#include <stdint.h>
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <signal.h>
 | 
			
		||||
 | 
			
		||||
#if HAVE_PTHREADS
 | 
			
		||||
#include <pthread.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include "cmdutils.h"
 | 
			
		||||
 | 
			
		||||
#include "libavformat/avformat.h"
 | 
			
		||||
#include "libavformat/avio.h"
 | 
			
		||||
 | 
			
		||||
#include "libavcodec/avcodec.h"
 | 
			
		||||
 | 
			
		||||
#include "libavfilter/avfilter.h"
 | 
			
		||||
#include "libavfilter/avfiltergraph.h"
 | 
			
		||||
 | 
			
		||||
#include "libavutil/avutil.h"
 | 
			
		||||
#include "libavutil/dict.h"
 | 
			
		||||
#include "libavutil/fifo.h"
 | 
			
		||||
#include "libavutil/pixfmt.h"
 | 
			
		||||
#include "libavutil/rational.h"
 | 
			
		||||
 | 
			
		||||
#include "libswresample/swresample.h"
 | 
			
		||||
 | 
			
		||||
#define VSYNC_AUTO       -1
 | 
			
		||||
#define VSYNC_PASSTHROUGH 0
 | 
			
		||||
#define VSYNC_CFR         1
 | 
			
		||||
#define VSYNC_VFR         2
 | 
			
		||||
#define VSYNC_DROP        0xff
 | 
			
		||||
 | 
			
		||||
#define MAX_STREAMS 1024    /* arbitrary sanity check value */
 | 
			
		||||
 | 
			
		||||
/* select an input stream for an output stream */
 | 
			
		||||
typedef struct StreamMap {
 | 
			
		||||
    int disabled;           /** 1 is this mapping is disabled by a negative map */
 | 
			
		||||
    int file_index;
 | 
			
		||||
    int stream_index;
 | 
			
		||||
    int sync_file_index;
 | 
			
		||||
    int sync_stream_index;
 | 
			
		||||
    char *linklabel;       /** name of an output link, for mapping lavfi outputs */
 | 
			
		||||
} StreamMap;
 | 
			
		||||
 | 
			
		||||
typedef struct {
 | 
			
		||||
    int  file_idx,  stream_idx,  channel_idx; // input
 | 
			
		||||
    int ofile_idx, ostream_idx;               // output
 | 
			
		||||
} AudioChannelMap;
 | 
			
		||||
 | 
			
		||||
typedef struct OptionsContext {
 | 
			
		||||
    /* input/output options */
 | 
			
		||||
    int64_t start_time;
 | 
			
		||||
    const char *format;
 | 
			
		||||
 | 
			
		||||
    SpecifierOpt *codec_names;
 | 
			
		||||
    int        nb_codec_names;
 | 
			
		||||
    SpecifierOpt *audio_channels;
 | 
			
		||||
    int        nb_audio_channels;
 | 
			
		||||
    SpecifierOpt *audio_sample_rate;
 | 
			
		||||
    int        nb_audio_sample_rate;
 | 
			
		||||
    SpecifierOpt *frame_rates;
 | 
			
		||||
    int        nb_frame_rates;
 | 
			
		||||
    SpecifierOpt *frame_sizes;
 | 
			
		||||
    int        nb_frame_sizes;
 | 
			
		||||
    SpecifierOpt *frame_pix_fmts;
 | 
			
		||||
    int        nb_frame_pix_fmts;
 | 
			
		||||
 | 
			
		||||
    /* input options */
 | 
			
		||||
    int64_t input_ts_offset;
 | 
			
		||||
    int rate_emu;
 | 
			
		||||
 | 
			
		||||
    SpecifierOpt *ts_scale;
 | 
			
		||||
    int        nb_ts_scale;
 | 
			
		||||
    SpecifierOpt *dump_attachment;
 | 
			
		||||
    int        nb_dump_attachment;
 | 
			
		||||
 | 
			
		||||
    /* output options */
 | 
			
		||||
    StreamMap *stream_maps;
 | 
			
		||||
    int     nb_stream_maps;
 | 
			
		||||
    AudioChannelMap *audio_channel_maps; /* one info entry per -map_channel */
 | 
			
		||||
    int           nb_audio_channel_maps; /* number of (valid) -map_channel settings */
 | 
			
		||||
    int metadata_global_manual;
 | 
			
		||||
    int metadata_streams_manual;
 | 
			
		||||
    int metadata_chapters_manual;
 | 
			
		||||
    const char **attachments;
 | 
			
		||||
    int       nb_attachments;
 | 
			
		||||
 | 
			
		||||
    int chapters_input_file;
 | 
			
		||||
 | 
			
		||||
    int64_t recording_time;
 | 
			
		||||
    uint64_t limit_filesize;
 | 
			
		||||
    float mux_preload;
 | 
			
		||||
    float mux_max_delay;
 | 
			
		||||
    int shortest;
 | 
			
		||||
 | 
			
		||||
    int video_disable;
 | 
			
		||||
    int audio_disable;
 | 
			
		||||
    int subtitle_disable;
 | 
			
		||||
    int data_disable;
 | 
			
		||||
 | 
			
		||||
    /* indexed by output file stream index */
 | 
			
		||||
    int   *streamid_map;
 | 
			
		||||
    int nb_streamid_map;
 | 
			
		||||
 | 
			
		||||
    SpecifierOpt *metadata;
 | 
			
		||||
    int        nb_metadata;
 | 
			
		||||
    SpecifierOpt *max_frames;
 | 
			
		||||
    int        nb_max_frames;
 | 
			
		||||
    SpecifierOpt *bitstream_filters;
 | 
			
		||||
    int        nb_bitstream_filters;
 | 
			
		||||
    SpecifierOpt *codec_tags;
 | 
			
		||||
    int        nb_codec_tags;
 | 
			
		||||
    SpecifierOpt *sample_fmts;
 | 
			
		||||
    int        nb_sample_fmts;
 | 
			
		||||
    SpecifierOpt *qscale;
 | 
			
		||||
    int        nb_qscale;
 | 
			
		||||
    SpecifierOpt *forced_key_frames;
 | 
			
		||||
    int        nb_forced_key_frames;
 | 
			
		||||
    SpecifierOpt *force_fps;
 | 
			
		||||
    int        nb_force_fps;
 | 
			
		||||
    SpecifierOpt *frame_aspect_ratios;
 | 
			
		||||
    int        nb_frame_aspect_ratios;
 | 
			
		||||
    SpecifierOpt *rc_overrides;
 | 
			
		||||
    int        nb_rc_overrides;
 | 
			
		||||
    SpecifierOpt *intra_matrices;
 | 
			
		||||
    int        nb_intra_matrices;
 | 
			
		||||
    SpecifierOpt *inter_matrices;
 | 
			
		||||
    int        nb_inter_matrices;
 | 
			
		||||
    SpecifierOpt *top_field_first;
 | 
			
		||||
    int        nb_top_field_first;
 | 
			
		||||
    SpecifierOpt *metadata_map;
 | 
			
		||||
    int        nb_metadata_map;
 | 
			
		||||
    SpecifierOpt *presets;
 | 
			
		||||
    int        nb_presets;
 | 
			
		||||
    SpecifierOpt *copy_initial_nonkeyframes;
 | 
			
		||||
    int        nb_copy_initial_nonkeyframes;
 | 
			
		||||
    SpecifierOpt *copy_prior_start;
 | 
			
		||||
    int        nb_copy_prior_start;
 | 
			
		||||
    SpecifierOpt *filters;
 | 
			
		||||
    int        nb_filters;
 | 
			
		||||
    SpecifierOpt *fix_sub_duration;
 | 
			
		||||
    int        nb_fix_sub_duration;
 | 
			
		||||
    SpecifierOpt *pass;
 | 
			
		||||
    int        nb_pass;
 | 
			
		||||
    SpecifierOpt *passlogfiles;
 | 
			
		||||
    int        nb_passlogfiles;
 | 
			
		||||
} OptionsContext;
 | 
			
		||||
 | 
			
		||||
typedef struct InputFilter {
 | 
			
		||||
    AVFilterContext    *filter;
 | 
			
		||||
    struct InputStream *ist;
 | 
			
		||||
    struct FilterGraph *graph;
 | 
			
		||||
    uint8_t            *name;
 | 
			
		||||
} InputFilter;
 | 
			
		||||
 | 
			
		||||
typedef struct OutputFilter {
 | 
			
		||||
    AVFilterContext     *filter;
 | 
			
		||||
    struct OutputStream *ost;
 | 
			
		||||
    struct FilterGraph  *graph;
 | 
			
		||||
    uint8_t             *name;
 | 
			
		||||
 | 
			
		||||
    /* temporary storage until stream maps are processed */
 | 
			
		||||
    AVFilterInOut       *out_tmp;
 | 
			
		||||
} OutputFilter;
 | 
			
		||||
 | 
			
		||||
typedef struct FilterGraph {
 | 
			
		||||
    int            index;
 | 
			
		||||
    const char    *graph_desc;
 | 
			
		||||
 | 
			
		||||
    AVFilterGraph *graph;
 | 
			
		||||
 | 
			
		||||
    InputFilter   **inputs;
 | 
			
		||||
    int          nb_inputs;
 | 
			
		||||
    OutputFilter **outputs;
 | 
			
		||||
    int         nb_outputs;
 | 
			
		||||
} FilterGraph;
 | 
			
		||||
 | 
			
		||||
typedef struct InputStream {
 | 
			
		||||
    int file_index;
 | 
			
		||||
    AVStream *st;
 | 
			
		||||
    int discard;             /* true if stream data should be discarded */
 | 
			
		||||
    int decoding_needed;     /* true if the packets must be decoded in 'raw_fifo' */
 | 
			
		||||
    AVCodec *dec;
 | 
			
		||||
    AVFrame *decoded_frame;
 | 
			
		||||
 | 
			
		||||
    int64_t       start;     /* time when read started */
 | 
			
		||||
    /* predicted dts of the next packet read for this stream or (when there are
 | 
			
		||||
     * several frames in a packet) of the next frame in current packet (in AV_TIME_BASE units) */
 | 
			
		||||
    int64_t       next_dts;
 | 
			
		||||
    int64_t       dts;       ///< dts of the last packet read for this stream (in AV_TIME_BASE units)
 | 
			
		||||
 | 
			
		||||
    int64_t       next_pts;  ///< synthetic pts for the next decode frame (in AV_TIME_BASE units)
 | 
			
		||||
    int64_t       pts;       ///< current pts of the decoded frame  (in AV_TIME_BASE units)
 | 
			
		||||
    int           wrap_correction_done;
 | 
			
		||||
    double ts_scale;
 | 
			
		||||
    int is_start;            /* is 1 at the start and after a discontinuity */
 | 
			
		||||
    int saw_first_ts;
 | 
			
		||||
    int showed_multi_packet_warning;
 | 
			
		||||
    AVDictionary *opts;
 | 
			
		||||
    AVRational framerate;               /* framerate forced with -r */
 | 
			
		||||
    int top_field_first;
 | 
			
		||||
 | 
			
		||||
    int resample_height;
 | 
			
		||||
    int resample_width;
 | 
			
		||||
    int resample_pix_fmt;
 | 
			
		||||
 | 
			
		||||
    int      resample_sample_fmt;
 | 
			
		||||
    int      resample_sample_rate;
 | 
			
		||||
    int      resample_channels;
 | 
			
		||||
    uint64_t resample_channel_layout;
 | 
			
		||||
 | 
			
		||||
    int fix_sub_duration;
 | 
			
		||||
    struct { /* previous decoded subtitle and related variables */
 | 
			
		||||
        int got_output;
 | 
			
		||||
        int ret;
 | 
			
		||||
        AVSubtitle subtitle;
 | 
			
		||||
    } prev_sub;
 | 
			
		||||
 | 
			
		||||
    struct sub2video {
 | 
			
		||||
        int64_t last_pts;
 | 
			
		||||
        AVFilterBufferRef *ref;
 | 
			
		||||
        int w, h;
 | 
			
		||||
    } sub2video;
 | 
			
		||||
 | 
			
		||||
    /* a pool of free buffers for decoded data */
 | 
			
		||||
    FrameBuffer *buffer_pool;
 | 
			
		||||
    int dr1;
 | 
			
		||||
 | 
			
		||||
    /* decoded data from this stream goes into all those filters
 | 
			
		||||
     * currently video and audio only */
 | 
			
		||||
    InputFilter **filters;
 | 
			
		||||
    int        nb_filters;
 | 
			
		||||
} InputStream;
 | 
			
		||||
 | 
			
		||||
typedef struct InputFile {
 | 
			
		||||
    AVFormatContext *ctx;
 | 
			
		||||
    int eof_reached;      /* true if eof reached */
 | 
			
		||||
    int eagain;           /* true if last read attempt returned EAGAIN */
 | 
			
		||||
    int ist_index;        /* index of first stream in input_streams */
 | 
			
		||||
    int64_t ts_offset;
 | 
			
		||||
    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() */
 | 
			
		||||
    int nb_streams_warn;  /* number of streams that the user was warned of */
 | 
			
		||||
    int rate_emu;
 | 
			
		||||
 | 
			
		||||
#if HAVE_PTHREADS
 | 
			
		||||
    pthread_t thread;           /* thread reading from this file */
 | 
			
		||||
    int finished;               /* the thread has exited */
 | 
			
		||||
    int joined;                 /* the thread has been joined */
 | 
			
		||||
    pthread_mutex_t fifo_lock;  /* lock for access to fifo */
 | 
			
		||||
    pthread_cond_t  fifo_cond;  /* the main thread will signal on this cond after reading from fifo */
 | 
			
		||||
    AVFifoBuffer *fifo;         /* demuxed packets are stored here; freed by the main thread */
 | 
			
		||||
#endif
 | 
			
		||||
} InputFile;
 | 
			
		||||
 | 
			
		||||
typedef struct OutputStream {
 | 
			
		||||
    int file_index;          /* file index */
 | 
			
		||||
    int index;               /* stream index in the output file */
 | 
			
		||||
    int source_index;        /* InputStream index */
 | 
			
		||||
    AVStream *st;            /* stream in the output file */
 | 
			
		||||
    int encoding_needed;     /* true if encoding needed for this stream */
 | 
			
		||||
    int frame_number;
 | 
			
		||||
    /* input pts and corresponding output pts
 | 
			
		||||
       for A/V sync */
 | 
			
		||||
    struct InputStream *sync_ist; /* input stream to sync against */
 | 
			
		||||
    int64_t sync_opts;       /* output frame counter, could be changed to some true timestamp */ // FIXME look at frame_number
 | 
			
		||||
    /* pts of the first frame encoded for this stream, used for limiting
 | 
			
		||||
     * recording time */
 | 
			
		||||
    int64_t first_pts;
 | 
			
		||||
    AVBitStreamFilterContext *bitstream_filters;
 | 
			
		||||
    AVCodec *enc;
 | 
			
		||||
    int64_t max_frames;
 | 
			
		||||
    AVFrame *filtered_frame;
 | 
			
		||||
 | 
			
		||||
    /* video only */
 | 
			
		||||
    AVRational frame_rate;
 | 
			
		||||
    int force_fps;
 | 
			
		||||
    int top_field_first;
 | 
			
		||||
 | 
			
		||||
    float frame_aspect_ratio;
 | 
			
		||||
    float last_quality;
 | 
			
		||||
 | 
			
		||||
    /* forced key frames */
 | 
			
		||||
    int64_t *forced_kf_pts;
 | 
			
		||||
    int forced_kf_count;
 | 
			
		||||
    int forced_kf_index;
 | 
			
		||||
    char *forced_keyframes;
 | 
			
		||||
 | 
			
		||||
    /* audio only */
 | 
			
		||||
    int audio_channels_map[SWR_CH_MAX];  /* list of the channels id to pick from the source stream */
 | 
			
		||||
    int audio_channels_mapped;           /* number of channels in audio_channels_map */
 | 
			
		||||
 | 
			
		||||
    char *logfile_prefix;
 | 
			
		||||
    FILE *logfile;
 | 
			
		||||
 | 
			
		||||
    OutputFilter *filter;
 | 
			
		||||
    char *avfilter;
 | 
			
		||||
 | 
			
		||||
    int64_t sws_flags;
 | 
			
		||||
    int64_t swr_dither_method;
 | 
			
		||||
    double swr_dither_scale;
 | 
			
		||||
    AVDictionary *opts;
 | 
			
		||||
    int finished;        /* no more packets should be written for this stream */
 | 
			
		||||
    int unavailable;                     /* true if the steram is unavailable (possibly temporarily) */
 | 
			
		||||
    int stream_copy;
 | 
			
		||||
    const char *attachment_filename;
 | 
			
		||||
    int copy_initial_nonkeyframes;
 | 
			
		||||
    int copy_prior_start;
 | 
			
		||||
 | 
			
		||||
    int keep_pix_fmt;
 | 
			
		||||
} OutputStream;
 | 
			
		||||
 | 
			
		||||
typedef struct OutputFile {
 | 
			
		||||
    AVFormatContext *ctx;
 | 
			
		||||
    AVDictionary *opts;
 | 
			
		||||
    int ost_index;       /* index of the first stream in output_streams */
 | 
			
		||||
    int64_t recording_time;  ///< desired length of the resulting file in microseconds == AV_TIME_BASE units
 | 
			
		||||
    int64_t start_time;      ///< start time in microseconds == AV_TIME_BASE units
 | 
			
		||||
    uint64_t limit_filesize; /* filesize limit expressed in bytes */
 | 
			
		||||
 | 
			
		||||
    int shortest;
 | 
			
		||||
} OutputFile;
 | 
			
		||||
 | 
			
		||||
extern InputStream **input_streams;
 | 
			
		||||
extern int        nb_input_streams;
 | 
			
		||||
extern InputFile   **input_files;
 | 
			
		||||
extern int        nb_input_files;
 | 
			
		||||
 | 
			
		||||
extern OutputStream **output_streams;
 | 
			
		||||
extern int         nb_output_streams;
 | 
			
		||||
extern OutputFile   **output_files;
 | 
			
		||||
extern int         nb_output_files;
 | 
			
		||||
 | 
			
		||||
extern FilterGraph **filtergraphs;
 | 
			
		||||
extern int        nb_filtergraphs;
 | 
			
		||||
 | 
			
		||||
extern char *vstats_filename;
 | 
			
		||||
 | 
			
		||||
extern float audio_drift_threshold;
 | 
			
		||||
extern float dts_delta_threshold;
 | 
			
		||||
extern float dts_error_threshold;
 | 
			
		||||
 | 
			
		||||
extern int audio_volume;
 | 
			
		||||
extern int audio_sync_method;
 | 
			
		||||
extern int video_sync_method;
 | 
			
		||||
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 copy_tb;
 | 
			
		||||
extern int debug_ts;
 | 
			
		||||
extern int exit_on_error;
 | 
			
		||||
extern int print_stats;
 | 
			
		||||
extern int qp_hist;
 | 
			
		||||
extern int same_quant;
 | 
			
		||||
extern int stdin_interaction;
 | 
			
		||||
extern int frame_bits_per_raw_sample;
 | 
			
		||||
extern AVIOContext *progress_avio;
 | 
			
		||||
 | 
			
		||||
extern const AVIOInterruptCB int_cb;
 | 
			
		||||
 | 
			
		||||
extern const OptionDef options[];
 | 
			
		||||
 | 
			
		||||
void term_init(void);
 | 
			
		||||
void term_exit(void);
 | 
			
		||||
 | 
			
		||||
void reset_options(OptionsContext *o, int is_input);
 | 
			
		||||
void show_usage(void);
 | 
			
		||||
 | 
			
		||||
void opt_output_file(void *optctx, const char *filename);
 | 
			
		||||
 | 
			
		||||
void assert_avoptions(AVDictionary *m);
 | 
			
		||||
 | 
			
		||||
int guess_input_channel_layout(InputStream *ist);
 | 
			
		||||
 | 
			
		||||
enum PixelFormat choose_pixel_fmt(AVStream *st, AVCodec *codec, enum PixelFormat target);
 | 
			
		||||
void choose_sample_fmt(AVStream *st, AVCodec *codec);
 | 
			
		||||
 | 
			
		||||
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);
 | 
			
		||||
 | 
			
		||||
#endif /* FFMPEG_H */
 | 
			
		||||
							
								
								
									
										774
									
								
								ffmpeg_filter.c
									
									
									
									
									
								
							
							
						
						
									
										774
									
								
								ffmpeg_filter.c
									
									
									
									
									
								
							@@ -1,774 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * ffmpeg filter configuration
 | 
			
		||||
 *
 | 
			
		||||
 * 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 "ffmpeg.h"
 | 
			
		||||
 | 
			
		||||
#include "libavfilter/avfilter.h"
 | 
			
		||||
#include "libavfilter/avfiltergraph.h"
 | 
			
		||||
#include "libavfilter/buffersink.h"
 | 
			
		||||
 | 
			
		||||
#include "libavutil/audioconvert.h"
 | 
			
		||||
#include "libavutil/avassert.h"
 | 
			
		||||
#include "libavutil/avstring.h"
 | 
			
		||||
#include "libavutil/bprint.h"
 | 
			
		||||
#include "libavutil/pixdesc.h"
 | 
			
		||||
#include "libavutil/pixfmt.h"
 | 
			
		||||
#include "libavutil/imgutils.h"
 | 
			
		||||
#include "libavutil/samplefmt.h"
 | 
			
		||||
 | 
			
		||||
enum PixelFormat choose_pixel_fmt(AVStream *st, AVCodec *codec, enum PixelFormat target)
 | 
			
		||||
{
 | 
			
		||||
    if (codec && codec->pix_fmts) {
 | 
			
		||||
        const enum PixelFormat *p = codec->pix_fmts;
 | 
			
		||||
        int has_alpha= av_pix_fmt_descriptors[target].nb_components % 2 == 0;
 | 
			
		||||
        enum PixelFormat best= PIX_FMT_NONE;
 | 
			
		||||
        if (st->codec->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL) {
 | 
			
		||||
            if (st->codec->codec_id == AV_CODEC_ID_MJPEG) {
 | 
			
		||||
                p = (const enum PixelFormat[]) { PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_NONE };
 | 
			
		||||
            } else if (st->codec->codec_id == AV_CODEC_ID_LJPEG) {
 | 
			
		||||
                p = (const enum PixelFormat[]) { PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ444P, PIX_FMT_YUV420P,
 | 
			
		||||
                                                 PIX_FMT_YUV422P, PIX_FMT_YUV444P, PIX_FMT_BGRA, PIX_FMT_NONE };
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        for (; *p != PIX_FMT_NONE; p++) {
 | 
			
		||||
            best= avcodec_find_best_pix_fmt_of_2(best, *p, target, has_alpha, NULL);
 | 
			
		||||
            if (*p == target)
 | 
			
		||||
                break;
 | 
			
		||||
        }
 | 
			
		||||
        if (*p == PIX_FMT_NONE) {
 | 
			
		||||
            if (target != PIX_FMT_NONE)
 | 
			
		||||
                av_log(NULL, AV_LOG_WARNING,
 | 
			
		||||
                       "Incompatible pixel format '%s' for codec '%s', auto-selecting format '%s'\n",
 | 
			
		||||
                       av_pix_fmt_descriptors[target].name,
 | 
			
		||||
                       codec->name,
 | 
			
		||||
                       av_pix_fmt_descriptors[best].name);
 | 
			
		||||
            return best;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    return target;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void choose_sample_fmt(AVStream *st, AVCodec *codec)
 | 
			
		||||
{
 | 
			
		||||
    if (codec && codec->sample_fmts) {
 | 
			
		||||
        const enum AVSampleFormat *p = codec->sample_fmts;
 | 
			
		||||
        for (; *p != -1; p++) {
 | 
			
		||||
            if (*p == st->codec->sample_fmt)
 | 
			
		||||
                break;
 | 
			
		||||
        }
 | 
			
		||||
        if (*p == -1) {
 | 
			
		||||
            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,
 | 
			
		||||
                   "Incompatible sample format '%s' for codec '%s', auto-selecting format '%s'\n",
 | 
			
		||||
                   av_get_sample_fmt_name(st->codec->sample_fmt),
 | 
			
		||||
                   codec->name,
 | 
			
		||||
                   av_get_sample_fmt_name(codec->sample_fmts[0]));
 | 
			
		||||
            st->codec->sample_fmt = codec->sample_fmts[0];
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static char *choose_pix_fmts(OutputStream *ost)
 | 
			
		||||
{
 | 
			
		||||
     if (ost->keep_pix_fmt) {
 | 
			
		||||
        if (ost->filter)
 | 
			
		||||
            avfilter_graph_set_auto_convert(ost->filter->graph->graph,
 | 
			
		||||
                                            AVFILTER_AUTO_CONVERT_NONE);
 | 
			
		||||
        if (ost->st->codec->pix_fmt == PIX_FMT_NONE)
 | 
			
		||||
            return NULL;
 | 
			
		||||
        return av_strdup(av_get_pix_fmt_name(ost->st->codec->pix_fmt));
 | 
			
		||||
    }
 | 
			
		||||
    if (ost->st->codec->pix_fmt != PIX_FMT_NONE) {
 | 
			
		||||
        return av_strdup(av_get_pix_fmt_name(choose_pixel_fmt(ost->st, ost->enc, ost->st->codec->pix_fmt)));
 | 
			
		||||
    } else if (ost->enc && ost->enc->pix_fmts) {
 | 
			
		||||
        const enum PixelFormat *p;
 | 
			
		||||
        AVIOContext *s = NULL;
 | 
			
		||||
        uint8_t *ret;
 | 
			
		||||
        int len;
 | 
			
		||||
 | 
			
		||||
        if (avio_open_dyn_buf(&s) < 0)
 | 
			
		||||
            exit_program(1);
 | 
			
		||||
 | 
			
		||||
        p = ost->enc->pix_fmts;
 | 
			
		||||
        if (ost->st->codec->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL) {
 | 
			
		||||
            if (ost->st->codec->codec_id == AV_CODEC_ID_MJPEG) {
 | 
			
		||||
                p = (const enum PixelFormat[]) { PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_NONE };
 | 
			
		||||
            } else if (ost->st->codec->codec_id == AV_CODEC_ID_LJPEG) {
 | 
			
		||||
                p = (const enum PixelFormat[]) { PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ444P, PIX_FMT_YUV420P,
 | 
			
		||||
                                                    PIX_FMT_YUV422P, PIX_FMT_YUV444P, PIX_FMT_BGRA, PIX_FMT_NONE };
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        for (; *p != PIX_FMT_NONE; p++) {
 | 
			
		||||
            const char *name = av_get_pix_fmt_name(*p);
 | 
			
		||||
            avio_printf(s, "%s:", name);
 | 
			
		||||
        }
 | 
			
		||||
        len = avio_close_dyn_buf(s, &ret);
 | 
			
		||||
        ret[len - 1] = 0;
 | 
			
		||||
        return ret;
 | 
			
		||||
    } else
 | 
			
		||||
        return NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Define a function for building a string containing a list of
 | 
			
		||||
 * allowed formats,
 | 
			
		||||
 */
 | 
			
		||||
#define DEF_CHOOSE_FORMAT(type, var, supported_list, none, get_name, separator)\
 | 
			
		||||
static char *choose_ ## var ## s(OutputStream *ost)                            \
 | 
			
		||||
{                                                                              \
 | 
			
		||||
    if (ost->st->codec->var != none) {                                         \
 | 
			
		||||
        get_name(ost->st->codec->var);                                         \
 | 
			
		||||
        return av_strdup(name);                                                \
 | 
			
		||||
    } else if (ost->enc->supported_list) {                                     \
 | 
			
		||||
        const type *p;                                                         \
 | 
			
		||||
        AVIOContext *s = NULL;                                                 \
 | 
			
		||||
        uint8_t *ret;                                                          \
 | 
			
		||||
        int len;                                                               \
 | 
			
		||||
                                                                               \
 | 
			
		||||
        if (avio_open_dyn_buf(&s) < 0)                                         \
 | 
			
		||||
            exit_program(1);                                                   \
 | 
			
		||||
                                                                               \
 | 
			
		||||
        for (p = ost->enc->supported_list; *p != none; p++) {                  \
 | 
			
		||||
            get_name(*p);                                                      \
 | 
			
		||||
            avio_printf(s, "%s" separator, name);                              \
 | 
			
		||||
        }                                                                      \
 | 
			
		||||
        len = avio_close_dyn_buf(s, &ret);                                     \
 | 
			
		||||
        ret[len - 1] = 0;                                                      \
 | 
			
		||||
        return ret;                                                            \
 | 
			
		||||
    } else                                                                     \
 | 
			
		||||
        return NULL;                                                           \
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// DEF_CHOOSE_FORMAT(enum PixelFormat, pix_fmt, pix_fmts, PIX_FMT_NONE,
 | 
			
		||||
//                   GET_PIX_FMT_NAME, ":")
 | 
			
		||||
 | 
			
		||||
DEF_CHOOSE_FORMAT(enum AVSampleFormat, sample_fmt, sample_fmts,
 | 
			
		||||
                  AV_SAMPLE_FMT_NONE, GET_SAMPLE_FMT_NAME, ",")
 | 
			
		||||
 | 
			
		||||
DEF_CHOOSE_FORMAT(int, sample_rate, supported_samplerates, 0,
 | 
			
		||||
                  GET_SAMPLE_RATE_NAME, ",")
 | 
			
		||||
 | 
			
		||||
DEF_CHOOSE_FORMAT(uint64_t, channel_layout, channel_layouts, 0,
 | 
			
		||||
                  GET_CH_LAYOUT_NAME, ",")
 | 
			
		||||
 | 
			
		||||
FilterGraph *init_simple_filtergraph(InputStream *ist, OutputStream *ost)
 | 
			
		||||
{
 | 
			
		||||
    FilterGraph *fg = av_mallocz(sizeof(*fg));
 | 
			
		||||
 | 
			
		||||
    if (!fg)
 | 
			
		||||
        exit_program(1);
 | 
			
		||||
    fg->index = nb_filtergraphs;
 | 
			
		||||
 | 
			
		||||
    fg->outputs = grow_array(fg->outputs, sizeof(*fg->outputs), &fg->nb_outputs,
 | 
			
		||||
                             fg->nb_outputs + 1);
 | 
			
		||||
    if (!(fg->outputs[0] = av_mallocz(sizeof(*fg->outputs[0]))))
 | 
			
		||||
        exit_program(1);
 | 
			
		||||
    fg->outputs[0]->ost   = ost;
 | 
			
		||||
    fg->outputs[0]->graph = fg;
 | 
			
		||||
 | 
			
		||||
    ost->filter = fg->outputs[0];
 | 
			
		||||
 | 
			
		||||
    fg->inputs = grow_array(fg->inputs, sizeof(*fg->inputs), &fg->nb_inputs,
 | 
			
		||||
                            fg->nb_inputs + 1);
 | 
			
		||||
    if (!(fg->inputs[0] = av_mallocz(sizeof(*fg->inputs[0]))))
 | 
			
		||||
        exit_program(1);
 | 
			
		||||
    fg->inputs[0]->ist   = ist;
 | 
			
		||||
    fg->inputs[0]->graph = fg;
 | 
			
		||||
 | 
			
		||||
    ist->filters = grow_array(ist->filters, sizeof(*ist->filters),
 | 
			
		||||
                              &ist->nb_filters, ist->nb_filters + 1);
 | 
			
		||||
    ist->filters[ist->nb_filters - 1] = fg->inputs[0];
 | 
			
		||||
 | 
			
		||||
    filtergraphs = grow_array(filtergraphs, sizeof(*filtergraphs),
 | 
			
		||||
                              &nb_filtergraphs, nb_filtergraphs + 1);
 | 
			
		||||
    filtergraphs[nb_filtergraphs - 1] = fg;
 | 
			
		||||
 | 
			
		||||
    return fg;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void init_input_filter(FilterGraph *fg, AVFilterInOut *in)
 | 
			
		||||
{
 | 
			
		||||
    InputStream *ist = NULL;
 | 
			
		||||
    enum AVMediaType type = avfilter_pad_get_type(in->filter_ctx->input_pads, in->pad_idx);
 | 
			
		||||
    int i;
 | 
			
		||||
 | 
			
		||||
    // TODO: support other filter types
 | 
			
		||||
    if (type != AVMEDIA_TYPE_VIDEO && type != AVMEDIA_TYPE_AUDIO) {
 | 
			
		||||
        av_log(NULL, AV_LOG_FATAL, "Only video and audio filters supported "
 | 
			
		||||
               "currently.\n");
 | 
			
		||||
        exit_program(1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (in->name) {
 | 
			
		||||
        AVFormatContext *s;
 | 
			
		||||
        AVStream       *st = NULL;
 | 
			
		||||
        char *p;
 | 
			
		||||
        int file_idx = strtol(in->name, &p, 0);
 | 
			
		||||
 | 
			
		||||
        if (file_idx < 0 || file_idx >= nb_input_files) {
 | 
			
		||||
            av_log(NULL, AV_LOG_FATAL, "Invalid file index %d in filtergraph description %s.\n",
 | 
			
		||||
                   file_idx, fg->graph_desc);
 | 
			
		||||
            exit_program(1);
 | 
			
		||||
        }
 | 
			
		||||
        s = input_files[file_idx]->ctx;
 | 
			
		||||
 | 
			
		||||
        for (i = 0; i < s->nb_streams; i++) {
 | 
			
		||||
            enum AVMediaType stream_type = s->streams[i]->codec->codec_type;
 | 
			
		||||
            if (stream_type != type &&
 | 
			
		||||
                !(stream_type == AVMEDIA_TYPE_SUBTITLE &&
 | 
			
		||||
                  type == AVMEDIA_TYPE_VIDEO /* sub2video hack */))
 | 
			
		||||
                continue;
 | 
			
		||||
            if (check_stream_specifier(s, s->streams[i], *p == ':' ? p + 1 : p) == 1) {
 | 
			
		||||
                st = s->streams[i];
 | 
			
		||||
                break;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        if (!st) {
 | 
			
		||||
            av_log(NULL, AV_LOG_FATAL, "Stream specifier '%s' in filtergraph description %s "
 | 
			
		||||
                   "matches no streams.\n", p, fg->graph_desc);
 | 
			
		||||
            exit_program(1);
 | 
			
		||||
        }
 | 
			
		||||
        ist = input_streams[input_files[file_idx]->ist_index + st->index];
 | 
			
		||||
    } else {
 | 
			
		||||
        /* find the first unused stream of corresponding type */
 | 
			
		||||
        for (i = 0; i < nb_input_streams; i++) {
 | 
			
		||||
            ist = input_streams[i];
 | 
			
		||||
            if (ist->st->codec->codec_type == type && ist->discard)
 | 
			
		||||
                break;
 | 
			
		||||
        }
 | 
			
		||||
        if (i == nb_input_streams) {
 | 
			
		||||
            av_log(NULL, AV_LOG_FATAL, "Cannot find a matching stream for "
 | 
			
		||||
                   "unlabeled input pad %d on filter %s\n", in->pad_idx,
 | 
			
		||||
                   in->filter_ctx->name);
 | 
			
		||||
            exit_program(1);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    av_assert0(ist);
 | 
			
		||||
 | 
			
		||||
    ist->discard         = 0;
 | 
			
		||||
    ist->decoding_needed++;
 | 
			
		||||
    ist->st->discard = AVDISCARD_NONE;
 | 
			
		||||
 | 
			
		||||
    fg->inputs = grow_array(fg->inputs, sizeof(*fg->inputs),
 | 
			
		||||
                            &fg->nb_inputs, fg->nb_inputs + 1);
 | 
			
		||||
    if (!(fg->inputs[fg->nb_inputs - 1] = av_mallocz(sizeof(*fg->inputs[0]))))
 | 
			
		||||
        exit_program(1);
 | 
			
		||||
    fg->inputs[fg->nb_inputs - 1]->ist   = ist;
 | 
			
		||||
    fg->inputs[fg->nb_inputs - 1]->graph = fg;
 | 
			
		||||
 | 
			
		||||
    ist->filters = grow_array(ist->filters, sizeof(*ist->filters),
 | 
			
		||||
                              &ist->nb_filters, ist->nb_filters + 1);
 | 
			
		||||
    ist->filters[ist->nb_filters - 1] = fg->inputs[fg->nb_inputs - 1];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int configure_output_video_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out)
 | 
			
		||||
{
 | 
			
		||||
    char *pix_fmts;
 | 
			
		||||
    OutputStream *ost = ofilter->ost;
 | 
			
		||||
    AVCodecContext *codec = ost->st->codec;
 | 
			
		||||
    AVFilterContext *last_filter = out->filter_ctx;
 | 
			
		||||
    int pad_idx = out->pad_idx;
 | 
			
		||||
    int ret;
 | 
			
		||||
    char name[255];
 | 
			
		||||
    AVBufferSinkParams *buffersink_params = av_buffersink_params_alloc();
 | 
			
		||||
 | 
			
		||||
    snprintf(name, sizeof(name), "output stream %d:%d", ost->file_index, ost->index);
 | 
			
		||||
    ret = avfilter_graph_create_filter(&ofilter->filter,
 | 
			
		||||
                                       avfilter_get_by_name("ffbuffersink"),
 | 
			
		||||
                                       name, NULL, NULL, fg->graph);
 | 
			
		||||
    av_freep(&buffersink_params);
 | 
			
		||||
 | 
			
		||||
    if (ret < 0)
 | 
			
		||||
        return ret;
 | 
			
		||||
 | 
			
		||||
    if (codec->width || codec->height) {
 | 
			
		||||
        char args[255];
 | 
			
		||||
        AVFilterContext *filter;
 | 
			
		||||
 | 
			
		||||
        snprintf(args, sizeof(args), "%d:%d:flags=0x%X",
 | 
			
		||||
                 codec->width,
 | 
			
		||||
                 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"),
 | 
			
		||||
                                                name, args, NULL, fg->graph)) < 0)
 | 
			
		||||
            return ret;
 | 
			
		||||
        if ((ret = avfilter_link(last_filter, pad_idx, filter, 0)) < 0)
 | 
			
		||||
            return ret;
 | 
			
		||||
 | 
			
		||||
        last_filter = filter;
 | 
			
		||||
        pad_idx = 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if ((pix_fmts = choose_pix_fmts(ost))) {
 | 
			
		||||
        AVFilterContext *filter;
 | 
			
		||||
        snprintf(name, sizeof(name), "pixel format for output stream %d:%d",
 | 
			
		||||
                 ost->file_index, ost->index);
 | 
			
		||||
        if ((ret = avfilter_graph_create_filter(&filter,
 | 
			
		||||
                                                avfilter_get_by_name("format"),
 | 
			
		||||
                                                "format", pix_fmts, NULL,
 | 
			
		||||
                                                fg->graph)) < 0)
 | 
			
		||||
            return ret;
 | 
			
		||||
        if ((ret = avfilter_link(last_filter, pad_idx, filter, 0)) < 0)
 | 
			
		||||
            return ret;
 | 
			
		||||
 | 
			
		||||
        last_filter = filter;
 | 
			
		||||
        pad_idx     = 0;
 | 
			
		||||
        av_freep(&pix_fmts);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (ost->frame_rate.num && 0) {
 | 
			
		||||
        AVFilterContext *fps;
 | 
			
		||||
        char args[255];
 | 
			
		||||
 | 
			
		||||
        snprintf(args, sizeof(args), "fps=%d/%d", ost->frame_rate.num,
 | 
			
		||||
                 ost->frame_rate.den);
 | 
			
		||||
        snprintf(name, sizeof(name), "fps for output stream %d:%d",
 | 
			
		||||
                 ost->file_index, ost->index);
 | 
			
		||||
        ret = avfilter_graph_create_filter(&fps, avfilter_get_by_name("fps"),
 | 
			
		||||
                                           name, args, NULL, fg->graph);
 | 
			
		||||
        if (ret < 0)
 | 
			
		||||
            return ret;
 | 
			
		||||
 | 
			
		||||
        ret = avfilter_link(last_filter, pad_idx, fps, 0);
 | 
			
		||||
        if (ret < 0)
 | 
			
		||||
            return ret;
 | 
			
		||||
        last_filter = fps;
 | 
			
		||||
        pad_idx = 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if ((ret = avfilter_link(last_filter, pad_idx, ofilter->filter, 0)) < 0)
 | 
			
		||||
        return ret;
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int configure_output_audio_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out)
 | 
			
		||||
{
 | 
			
		||||
    OutputStream *ost = ofilter->ost;
 | 
			
		||||
    AVCodecContext *codec  = ost->st->codec;
 | 
			
		||||
    AVFilterContext *last_filter = out->filter_ctx;
 | 
			
		||||
    int pad_idx = out->pad_idx;
 | 
			
		||||
    char *sample_fmts, *sample_rates, *channel_layouts;
 | 
			
		||||
    char name[255];
 | 
			
		||||
    int ret;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    snprintf(name, sizeof(name), "output stream %d:%d", ost->file_index, ost->index);
 | 
			
		||||
    ret = avfilter_graph_create_filter(&ofilter->filter,
 | 
			
		||||
                                       avfilter_get_by_name("ffabuffersink"),
 | 
			
		||||
                                       name, NULL, NULL, fg->graph);
 | 
			
		||||
    if (ret < 0)
 | 
			
		||||
        return ret;
 | 
			
		||||
 | 
			
		||||
#define AUTO_INSERT_FILTER(opt_name, filter_name, arg) do {                 \
 | 
			
		||||
    AVFilterContext *filt_ctx;                                              \
 | 
			
		||||
                                                                            \
 | 
			
		||||
    av_log(NULL, AV_LOG_INFO, opt_name " is forwarded to lavfi "            \
 | 
			
		||||
           "similarly to -af " filter_name "=%s.\n", arg);                  \
 | 
			
		||||
                                                                            \
 | 
			
		||||
    ret = avfilter_graph_create_filter(&filt_ctx,                           \
 | 
			
		||||
                                       avfilter_get_by_name(filter_name),   \
 | 
			
		||||
                                       filter_name, arg, NULL, fg->graph);  \
 | 
			
		||||
    if (ret < 0)                                                            \
 | 
			
		||||
        return ret;                                                         \
 | 
			
		||||
                                                                            \
 | 
			
		||||
    ret = avfilter_link(last_filter, pad_idx, filt_ctx, 0);                 \
 | 
			
		||||
    if (ret < 0)                                                            \
 | 
			
		||||
        return ret;                                                         \
 | 
			
		||||
                                                                            \
 | 
			
		||||
    last_filter = filt_ctx;                                                 \
 | 
			
		||||
    pad_idx = 0;                                                            \
 | 
			
		||||
} while (0)
 | 
			
		||||
    if (ost->audio_channels_mapped) {
 | 
			
		||||
        int i;
 | 
			
		||||
        AVBPrint pan_buf;
 | 
			
		||||
        av_bprint_init(&pan_buf, 256, 8192);
 | 
			
		||||
        av_bprintf(&pan_buf, "0x%"PRIx64,
 | 
			
		||||
                   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]);
 | 
			
		||||
 | 
			
		||||
        AUTO_INSERT_FILTER("-map_channel", "pan", pan_buf.str);
 | 
			
		||||
        av_bprint_finalize(&pan_buf, NULL);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (codec->channels && !codec->channel_layout)
 | 
			
		||||
        codec->channel_layout = av_get_default_channel_layout(codec->channels);
 | 
			
		||||
 | 
			
		||||
    sample_fmts     = choose_sample_fmts(ost);
 | 
			
		||||
    sample_rates    = choose_sample_rates(ost);
 | 
			
		||||
    channel_layouts = choose_channel_layouts(ost);
 | 
			
		||||
    if (sample_fmts || sample_rates || channel_layouts) {
 | 
			
		||||
        AVFilterContext *format;
 | 
			
		||||
        char args[256];
 | 
			
		||||
        args[0] = 0;
 | 
			
		||||
 | 
			
		||||
        if (sample_fmts)
 | 
			
		||||
            av_strlcatf(args, sizeof(args), "sample_fmts=%s:",
 | 
			
		||||
                            sample_fmts);
 | 
			
		||||
        if (sample_rates)
 | 
			
		||||
            av_strlcatf(args, sizeof(args), "sample_rates=%s:",
 | 
			
		||||
                            sample_rates);
 | 
			
		||||
        if (channel_layouts)
 | 
			
		||||
            av_strlcatf(args, sizeof(args), "channel_layouts=%s:",
 | 
			
		||||
                            channel_layouts);
 | 
			
		||||
 | 
			
		||||
        av_freep(&sample_fmts);
 | 
			
		||||
        av_freep(&sample_rates);
 | 
			
		||||
        av_freep(&channel_layouts);
 | 
			
		||||
 | 
			
		||||
        snprintf(name, sizeof(name), "audio format for output stream %d:%d",
 | 
			
		||||
                 ost->file_index, ost->index);
 | 
			
		||||
        ret = avfilter_graph_create_filter(&format,
 | 
			
		||||
                                           avfilter_get_by_name("aformat"),
 | 
			
		||||
                                           name, args, NULL, fg->graph);
 | 
			
		||||
        if (ret < 0)
 | 
			
		||||
            return ret;
 | 
			
		||||
 | 
			
		||||
        ret = avfilter_link(last_filter, pad_idx, format, 0);
 | 
			
		||||
        if (ret < 0)
 | 
			
		||||
            return ret;
 | 
			
		||||
 | 
			
		||||
        last_filter = format;
 | 
			
		||||
        pad_idx = 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (audio_volume != 256 && 0) {
 | 
			
		||||
        char args[256];
 | 
			
		||||
 | 
			
		||||
        snprintf(args, sizeof(args), "%f", audio_volume / 256.);
 | 
			
		||||
        AUTO_INSERT_FILTER("-vol", "volume", args);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if ((ret = avfilter_link(last_filter, pad_idx, ofilter->filter, 0)) < 0)
 | 
			
		||||
        return ret;
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#define DESCRIBE_FILTER_LINK(f, inout, in)                         \
 | 
			
		||||
{                                                                  \
 | 
			
		||||
    AVFilterContext *ctx = inout->filter_ctx;                      \
 | 
			
		||||
    AVFilterPad *pads = in ? ctx->input_pads  : ctx->output_pads;  \
 | 
			
		||||
    int       nb_pads = in ? ctx->input_count : ctx->output_count; \
 | 
			
		||||
    AVIOContext *pb;                                               \
 | 
			
		||||
                                                                   \
 | 
			
		||||
    if (avio_open_dyn_buf(&pb) < 0)                                \
 | 
			
		||||
        exit_program(1);                                           \
 | 
			
		||||
                                                                   \
 | 
			
		||||
    avio_printf(pb, "%s", ctx->filter->name);                      \
 | 
			
		||||
    if (nb_pads > 1)                                               \
 | 
			
		||||
        avio_printf(pb, ":%s", avfilter_pad_get_name(pads, inout->pad_idx));\
 | 
			
		||||
    avio_w8(pb, 0);                                                \
 | 
			
		||||
    avio_close_dyn_buf(pb, &f->name);                              \
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int configure_output_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out)
 | 
			
		||||
{
 | 
			
		||||
    av_freep(&ofilter->name);
 | 
			
		||||
    DESCRIBE_FILTER_LINK(ofilter, out, 0);
 | 
			
		||||
 | 
			
		||||
    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);
 | 
			
		||||
    default: av_assert0(0);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int sub2video_prepare(InputStream *ist)
 | 
			
		||||
{
 | 
			
		||||
    AVFormatContext *avf = input_files[ist->file_index]->ctx;
 | 
			
		||||
    int i, ret, w, h;
 | 
			
		||||
    uint8_t *image[4];
 | 
			
		||||
    int linesize[4];
 | 
			
		||||
 | 
			
		||||
    /* Compute the size of the canvas for the subtitles stream.
 | 
			
		||||
       If the subtitles codec has set a size, use it. Otherwise use the
 | 
			
		||||
       maximum dimensions of the video streams in the same file. */
 | 
			
		||||
    w = ist->st->codec->width;
 | 
			
		||||
    h = ist->st->codec->height;
 | 
			
		||||
    if (!(w && h)) {
 | 
			
		||||
        for (i = 0; i < avf->nb_streams; i++) {
 | 
			
		||||
            if (avf->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
 | 
			
		||||
                w = FFMAX(w, avf->streams[i]->codec->width);
 | 
			
		||||
                h = FFMAX(h, avf->streams[i]->codec->height);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        if (!(w && h)) {
 | 
			
		||||
            w = FFMAX(w, 720);
 | 
			
		||||
            h = FFMAX(h, 576);
 | 
			
		||||
        }
 | 
			
		||||
        av_log(avf, AV_LOG_INFO, "sub2video: using %dx%d canvas\n", w, h);
 | 
			
		||||
    }
 | 
			
		||||
    ist->sub2video.w = ist->st->codec->width  = w;
 | 
			
		||||
    ist->sub2video.h = ist->st->codec->height = h;
 | 
			
		||||
 | 
			
		||||
    /* rectangles are PIX_FMT_PAL8, but we have no guarantee that the
 | 
			
		||||
       palettes for all rectangles are identical or compatible */
 | 
			
		||||
    ist->st->codec->pix_fmt = PIX_FMT_RGB32;
 | 
			
		||||
 | 
			
		||||
    ret = av_image_alloc(image, linesize, w, h, PIX_FMT_RGB32, 32);
 | 
			
		||||
    if (ret < 0)
 | 
			
		||||
        return ret;
 | 
			
		||||
    memset(image[0], 0, h * linesize[0]);
 | 
			
		||||
    ist->sub2video.ref = avfilter_get_video_buffer_ref_from_arrays(
 | 
			
		||||
            image, linesize, AV_PERM_READ | AV_PERM_PRESERVE,
 | 
			
		||||
            w, h, PIX_FMT_RGB32);
 | 
			
		||||
    if (!ist->sub2video.ref) {
 | 
			
		||||
        av_free(image[0]);
 | 
			
		||||
        return AVERROR(ENOMEM);
 | 
			
		||||
    }
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
 | 
			
		||||
                                        AVFilterInOut *in)
 | 
			
		||||
{
 | 
			
		||||
    AVFilterContext *first_filter = in->filter_ctx;
 | 
			
		||||
    AVFilter *filter = avfilter_get_by_name("buffer");
 | 
			
		||||
    InputStream *ist = ifilter->ist;
 | 
			
		||||
    AVRational tb = ist->framerate.num ? av_inv_q(ist->framerate) :
 | 
			
		||||
                                         ist->st->time_base;
 | 
			
		||||
    AVRational fr = ist->framerate.num ? ist->framerate :
 | 
			
		||||
                                         ist->st->r_frame_rate;
 | 
			
		||||
    AVRational sar;
 | 
			
		||||
    AVBPrint args;
 | 
			
		||||
    char name[255];
 | 
			
		||||
    int pad_idx = in->pad_idx;
 | 
			
		||||
    int ret;
 | 
			
		||||
 | 
			
		||||
    if (ist->st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) {
 | 
			
		||||
        ret = sub2video_prepare(ist);
 | 
			
		||||
        if (ret < 0)
 | 
			
		||||
            return ret;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    sar = ist->st->sample_aspect_ratio.num ?
 | 
			
		||||
          ist->st->sample_aspect_ratio :
 | 
			
		||||
          ist->st->codec->sample_aspect_ratio;
 | 
			
		||||
    if(!sar.den)
 | 
			
		||||
        sar = (AVRational){0,1};
 | 
			
		||||
    av_bprint_init(&args, 0, 1);
 | 
			
		||||
    av_bprintf(&args,
 | 
			
		||||
             "video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:"
 | 
			
		||||
             "pixel_aspect=%d/%d:sws_param=flags=%d", ist->st->codec->width,
 | 
			
		||||
             ist->st->codec->height, ist->st->codec->pix_fmt,
 | 
			
		||||
             tb.num, tb.den, sar.num, sar.den,
 | 
			
		||||
             SWS_BILINEAR + ((ist->st->codec->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,
 | 
			
		||||
             ist->file_index, ist->st->index);
 | 
			
		||||
 | 
			
		||||
    if ((ret = avfilter_graph_create_filter(&ifilter->filter, filter, name,
 | 
			
		||||
                                            args.str, NULL, fg->graph)) < 0)
 | 
			
		||||
        return ret;
 | 
			
		||||
 | 
			
		||||
    if (ist->framerate.num) {
 | 
			
		||||
        AVFilterContext *setpts;
 | 
			
		||||
 | 
			
		||||
        snprintf(name, sizeof(name), "force CFR for input from stream %d:%d",
 | 
			
		||||
                 ist->file_index, ist->st->index);
 | 
			
		||||
        if ((ret = avfilter_graph_create_filter(&setpts,
 | 
			
		||||
                                                avfilter_get_by_name("setpts"),
 | 
			
		||||
                                                name, "N", NULL,
 | 
			
		||||
                                                fg->graph)) < 0)
 | 
			
		||||
            return ret;
 | 
			
		||||
 | 
			
		||||
        if ((ret = avfilter_link(setpts, 0, first_filter, pad_idx)) < 0)
 | 
			
		||||
            return ret;
 | 
			
		||||
 | 
			
		||||
        first_filter = setpts;
 | 
			
		||||
        pad_idx = 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if ((ret = avfilter_link(ifilter->filter, 0, first_filter, pad_idx)) < 0)
 | 
			
		||||
        return ret;
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int configure_input_audio_filter(FilterGraph *fg, InputFilter *ifilter,
 | 
			
		||||
                                        AVFilterInOut *in)
 | 
			
		||||
{
 | 
			
		||||
    AVFilterContext *first_filter = in->filter_ctx;
 | 
			
		||||
    AVFilter *filter = avfilter_get_by_name("abuffer");
 | 
			
		||||
    InputStream *ist = ifilter->ist;
 | 
			
		||||
    int pad_idx = in->pad_idx;
 | 
			
		||||
    char args[255], name[255];
 | 
			
		||||
    int ret;
 | 
			
		||||
 | 
			
		||||
    snprintf(args, sizeof(args), "time_base=%d/%d:sample_rate=%d:sample_fmt=%s"
 | 
			
		||||
             ":channel_layout=0x%"PRIx64,
 | 
			
		||||
             1, ist->st->codec->sample_rate,
 | 
			
		||||
             ist->st->codec->sample_rate,
 | 
			
		||||
             av_get_sample_fmt_name(ist->st->codec->sample_fmt),
 | 
			
		||||
             ist->st->codec->channel_layout);
 | 
			
		||||
    snprintf(name, sizeof(name), "graph %d input from stream %d:%d", fg->index,
 | 
			
		||||
             ist->file_index, ist->st->index);
 | 
			
		||||
 | 
			
		||||
    if ((ret = avfilter_graph_create_filter(&ifilter->filter, filter,
 | 
			
		||||
                                            name, args, NULL,
 | 
			
		||||
                                            fg->graph)) < 0)
 | 
			
		||||
        return ret;
 | 
			
		||||
 | 
			
		||||
#define AUTO_INSERT_FILTER_INPUT(opt_name, filter_name, arg) do {                 \
 | 
			
		||||
    AVFilterContext *filt_ctx;                                              \
 | 
			
		||||
                                                                            \
 | 
			
		||||
    av_log(NULL, AV_LOG_INFO, opt_name " is forwarded to lavfi "            \
 | 
			
		||||
           "similarly to -af " filter_name "=%s.\n", arg);                  \
 | 
			
		||||
                                                                            \
 | 
			
		||||
    snprintf(name, sizeof(name), "graph %d %s for input stream %d:%d",      \
 | 
			
		||||
                fg->index, filter_name, ist->file_index, ist->st->index);   \
 | 
			
		||||
    ret = avfilter_graph_create_filter(&filt_ctx,                           \
 | 
			
		||||
                                       avfilter_get_by_name(filter_name),   \
 | 
			
		||||
                                       name, arg, NULL, fg->graph);         \
 | 
			
		||||
    if (ret < 0)                                                            \
 | 
			
		||||
        return ret;                                                         \
 | 
			
		||||
                                                                            \
 | 
			
		||||
    ret = avfilter_link(filt_ctx, 0, first_filter, pad_idx);                \
 | 
			
		||||
    if (ret < 0)                                                            \
 | 
			
		||||
        return ret;                                                         \
 | 
			
		||||
                                                                            \
 | 
			
		||||
    first_filter = filt_ctx;                                                  \
 | 
			
		||||
} while (0)
 | 
			
		||||
 | 
			
		||||
    if (audio_sync_method > 0) {
 | 
			
		||||
        char args[256] = {0};
 | 
			
		||||
 | 
			
		||||
        av_strlcatf(args, sizeof(args), "min_comp=0.001:min_hard_comp=%f", audio_drift_threshold);
 | 
			
		||||
        if (audio_sync_method > 1)
 | 
			
		||||
            av_strlcatf(args, sizeof(args), ":max_soft_comp=%f", audio_sync_method/(double)ist->st->codec->sample_rate);
 | 
			
		||||
        AUTO_INSERT_FILTER_INPUT("-async", "aresample", args);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
//     if (ost->audio_channels_mapped) {
 | 
			
		||||
//         int i;
 | 
			
		||||
//         AVBPrint pan_buf;
 | 
			
		||||
//         av_bprint_init(&pan_buf, 256, 8192);
 | 
			
		||||
//         av_bprintf(&pan_buf, "0x%"PRIx64,
 | 
			
		||||
//                    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]);
 | 
			
		||||
//         AUTO_INSERT_FILTER_INPUT("-map_channel", "pan", pan_buf.str);
 | 
			
		||||
//         av_bprint_finalize(&pan_buf, NULL);
 | 
			
		||||
//     }
 | 
			
		||||
 | 
			
		||||
    if (audio_volume != 256) {
 | 
			
		||||
        char args[256];
 | 
			
		||||
 | 
			
		||||
        snprintf(args, sizeof(args), "%f", audio_volume / 256.);
 | 
			
		||||
        AUTO_INSERT_FILTER_INPUT("-vol", "volume", args);
 | 
			
		||||
    }
 | 
			
		||||
    if ((ret = avfilter_link(ifilter->filter, 0, first_filter, pad_idx)) < 0)
 | 
			
		||||
        return ret;
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int configure_input_filter(FilterGraph *fg, InputFilter *ifilter,
 | 
			
		||||
                                  AVFilterInOut *in)
 | 
			
		||||
{
 | 
			
		||||
    av_freep(&ifilter->name);
 | 
			
		||||
    DESCRIBE_FILTER_LINK(ifilter, in, 1);
 | 
			
		||||
 | 
			
		||||
    switch (avfilter_pad_get_type(in->filter_ctx->input_pads, in->pad_idx)) {
 | 
			
		||||
    case AVMEDIA_TYPE_VIDEO: return configure_input_video_filter(fg, ifilter, in);
 | 
			
		||||
    case AVMEDIA_TYPE_AUDIO: return configure_input_audio_filter(fg, ifilter, in);
 | 
			
		||||
    default: av_assert0(0);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int configure_filtergraph(FilterGraph *fg)
 | 
			
		||||
{
 | 
			
		||||
    AVFilterInOut *inputs, *outputs, *cur;
 | 
			
		||||
    int ret, i, init = !fg->graph, simple = !fg->graph_desc;
 | 
			
		||||
    const char *graph_desc = simple ? fg->outputs[0]->ost->avfilter :
 | 
			
		||||
                                      fg->graph_desc;
 | 
			
		||||
 | 
			
		||||
    avfilter_graph_free(&fg->graph);
 | 
			
		||||
    if (!(fg->graph = avfilter_graph_alloc()))
 | 
			
		||||
        return AVERROR(ENOMEM);
 | 
			
		||||
 | 
			
		||||
    if (simple) {
 | 
			
		||||
        OutputStream *ost = fg->outputs[0]->ost;
 | 
			
		||||
        char args[255];
 | 
			
		||||
        snprintf(args, sizeof(args), "flags=0x%X", (unsigned)ost->sws_flags);
 | 
			
		||||
        fg->graph->scale_sws_opts = av_strdup(args);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if ((ret = avfilter_graph_parse2(fg->graph, graph_desc, &inputs, &outputs)) < 0)
 | 
			
		||||
        return ret;
 | 
			
		||||
 | 
			
		||||
    if (simple && (!inputs || inputs->next || !outputs || outputs->next)) {
 | 
			
		||||
        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)
 | 
			
		||||
            return ret;
 | 
			
		||||
    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;) {
 | 
			
		||||
            fg->outputs = grow_array(fg->outputs, sizeof(*fg->outputs),
 | 
			
		||||
                                     &fg->nb_outputs, fg->nb_outputs + 1);
 | 
			
		||||
            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;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int ist_in_filtergraph(FilterGraph *fg, InputStream *ist)
 | 
			
		||||
{
 | 
			
		||||
    int i;
 | 
			
		||||
    for (i = 0; i < fg->nb_inputs; i++)
 | 
			
		||||
        if (fg->inputs[i]->ist == ist)
 | 
			
		||||
            return 1;
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										2504
									
								
								ffmpeg_opt.c
									
									
									
									
									
								
							
							
						
						
									
										2504
									
								
								ffmpeg_opt.c
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										4
									
								
								ffpresets/libx264-baseline.ffpreset
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								ffpresets/libx264-baseline.ffpreset
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,4 @@
 | 
			
		||||
coder=0
 | 
			
		||||
bf=0
 | 
			
		||||
flags2=-wpred-dct8x8+mbtree
 | 
			
		||||
wpredp=0
 | 
			
		||||
							
								
								
									
										22
									
								
								ffpresets/libx264-default.ffpreset
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								ffpresets/libx264-default.ffpreset
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,22 @@
 | 
			
		||||
coder=1
 | 
			
		||||
flags=+loop
 | 
			
		||||
cmp=+chroma
 | 
			
		||||
partitions=+parti8x8+parti4x4+partp8x8+partb8x8
 | 
			
		||||
me_method=hex
 | 
			
		||||
subq=7
 | 
			
		||||
me_range=16
 | 
			
		||||
g=250
 | 
			
		||||
keyint_min=25
 | 
			
		||||
sc_threshold=40
 | 
			
		||||
i_qfactor=0.71
 | 
			
		||||
b_strategy=1
 | 
			
		||||
qcomp=0.6
 | 
			
		||||
qmin=10
 | 
			
		||||
qmax=51
 | 
			
		||||
qdiff=4
 | 
			
		||||
bf=3
 | 
			
		||||
refs=3
 | 
			
		||||
directpred=1
 | 
			
		||||
trellis=1
 | 
			
		||||
flags2=+mixed_refs+wpred+dct8x8+fastpskip+mbtree
 | 
			
		||||
wpredp=2
 | 
			
		||||
							
								
								
									
										22
									
								
								ffpresets/libx264-fastfirstpass.ffpreset
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								ffpresets/libx264-fastfirstpass.ffpreset
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,22 @@
 | 
			
		||||
coder=1
 | 
			
		||||
flags=+loop
 | 
			
		||||
cmp=+chroma
 | 
			
		||||
partitions=-parti8x8-parti4x4-partp8x8-partp4x4-partb8x8
 | 
			
		||||
me_method=dia
 | 
			
		||||
subq=2
 | 
			
		||||
me_range=16
 | 
			
		||||
g=250
 | 
			
		||||
keyint_min=25
 | 
			
		||||
sc_threshold=40
 | 
			
		||||
i_qfactor=0.71
 | 
			
		||||
b_strategy=1
 | 
			
		||||
qcomp=0.6
 | 
			
		||||
qmin=10
 | 
			
		||||
qmax=51
 | 
			
		||||
qdiff=4
 | 
			
		||||
bf=3
 | 
			
		||||
refs=1
 | 
			
		||||
directpred=3
 | 
			
		||||
trellis=0
 | 
			
		||||
flags2=-bpyramid-wpred-mixed_refs-dct8x8+fastpskip+mbtree
 | 
			
		||||
wpredp=2
 | 
			
		||||
							
								
								
									
										22
									
								
								ffpresets/libx264-hq.ffpreset
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								ffpresets/libx264-hq.ffpreset
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,22 @@
 | 
			
		||||
coder=1
 | 
			
		||||
flags=+loop
 | 
			
		||||
cmp=+chroma
 | 
			
		||||
partitions=+parti8x8+parti4x4+partp8x8+partb8x8
 | 
			
		||||
me_method=umh
 | 
			
		||||
subq=8
 | 
			
		||||
me_range=16
 | 
			
		||||
g=250
 | 
			
		||||
keyint_min=25
 | 
			
		||||
sc_threshold=40
 | 
			
		||||
i_qfactor=0.71
 | 
			
		||||
b_strategy=2
 | 
			
		||||
qcomp=0.6
 | 
			
		||||
qmin=10
 | 
			
		||||
qmax=51
 | 
			
		||||
qdiff=4
 | 
			
		||||
bf=3
 | 
			
		||||
refs=4
 | 
			
		||||
directpred=3
 | 
			
		||||
trellis=1
 | 
			
		||||
flags2=+wpred+mixed_refs+dct8x8+fastpskip+mbtree
 | 
			
		||||
wpredp=2
 | 
			
		||||
							
								
								
									
										7
									
								
								ffpresets/libx264-ipod320.ffpreset
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								ffpresets/libx264-ipod320.ffpreset
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,7 @@
 | 
			
		||||
coder=0
 | 
			
		||||
bf=0
 | 
			
		||||
flags2=-wpred-dct8x8+mbtree
 | 
			
		||||
level=13
 | 
			
		||||
maxrate=768000
 | 
			
		||||
bufsize=3000000
 | 
			
		||||
wpredp=0
 | 
			
		||||
							
								
								
									
										8
									
								
								ffpresets/libx264-ipod640.ffpreset
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								ffpresets/libx264-ipod640.ffpreset
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,8 @@
 | 
			
		||||
coder=0
 | 
			
		||||
bf=0
 | 
			
		||||
refs=1
 | 
			
		||||
flags2=-wpred-dct8x8+mbtree
 | 
			
		||||
level=30
 | 
			
		||||
maxrate=10000000
 | 
			
		||||
bufsize=10000000
 | 
			
		||||
wpredp=0
 | 
			
		||||
							
								
								
									
										20
									
								
								ffpresets/libx264-lossless_fast.ffpreset
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								ffpresets/libx264-lossless_fast.ffpreset
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,20 @@
 | 
			
		||||
coder=0
 | 
			
		||||
flags=+loop
 | 
			
		||||
cmp=+chroma
 | 
			
		||||
partitions=-parti8x8+parti4x4+partp8x8-partp4x4-partb8x8
 | 
			
		||||
me_method=hex
 | 
			
		||||
subq=3
 | 
			
		||||
me_range=16
 | 
			
		||||
g=250
 | 
			
		||||
keyint_min=25
 | 
			
		||||
sc_threshold=40
 | 
			
		||||
i_qfactor=0.71
 | 
			
		||||
b_strategy=1
 | 
			
		||||
qcomp=0.6
 | 
			
		||||
qmin=10
 | 
			
		||||
qmax=51
 | 
			
		||||
qdiff=4
 | 
			
		||||
directpred=1
 | 
			
		||||
flags2=+fastpskip+mbtree
 | 
			
		||||
cqp=0
 | 
			
		||||
wpredp=0
 | 
			
		||||
							
								
								
									
										21
									
								
								ffpresets/libx264-lossless_max.ffpreset
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								ffpresets/libx264-lossless_max.ffpreset
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,21 @@
 | 
			
		||||
coder=1
 | 
			
		||||
flags=+loop
 | 
			
		||||
cmp=+chroma
 | 
			
		||||
partitions=+parti8x8+parti4x4+partp8x8+partp4x4-partb8x8
 | 
			
		||||
me_method=esa
 | 
			
		||||
subq=8
 | 
			
		||||
me_range=16
 | 
			
		||||
g=250
 | 
			
		||||
keyint_min=25
 | 
			
		||||
sc_threshold=40
 | 
			
		||||
i_qfactor=0.71
 | 
			
		||||
b_strategy=1
 | 
			
		||||
qcomp=0.6
 | 
			
		||||
qmin=10
 | 
			
		||||
qmax=51
 | 
			
		||||
qdiff=4
 | 
			
		||||
refs=16
 | 
			
		||||
directpred=1
 | 
			
		||||
flags2=+mixed_refs+dct8x8+fastpskip+mbtree
 | 
			
		||||
cqp=0
 | 
			
		||||
wpredp=2
 | 
			
		||||
							
								
								
									
										20
									
								
								ffpresets/libx264-lossless_medium.ffpreset
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								ffpresets/libx264-lossless_medium.ffpreset
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,20 @@
 | 
			
		||||
coder=1
 | 
			
		||||
flags=+loop
 | 
			
		||||
cmp=+chroma
 | 
			
		||||
partitions=-parti8x8+parti4x4+partp8x8+partp4x4-partb8x8
 | 
			
		||||
me_method=hex
 | 
			
		||||
subq=5
 | 
			
		||||
me_range=16
 | 
			
		||||
g=250
 | 
			
		||||
keyint_min=25
 | 
			
		||||
sc_threshold=40
 | 
			
		||||
i_qfactor=0.71
 | 
			
		||||
b_strategy=1
 | 
			
		||||
qcomp=0.6
 | 
			
		||||
qmin=10
 | 
			
		||||
qmax=51
 | 
			
		||||
qdiff=4
 | 
			
		||||
directpred=1
 | 
			
		||||
flags2=+fastpskip+mbtree
 | 
			
		||||
cqp=0
 | 
			
		||||
wpredp=2
 | 
			
		||||
							
								
								
									
										21
									
								
								ffpresets/libx264-lossless_slow.ffpreset
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								ffpresets/libx264-lossless_slow.ffpreset
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,21 @@
 | 
			
		||||
coder=1
 | 
			
		||||
flags=+loop
 | 
			
		||||
cmp=+chroma
 | 
			
		||||
partitions=+parti8x8+parti4x4+partp8x8+partp4x4-partb8x8
 | 
			
		||||
me_method=umh
 | 
			
		||||
subq=6
 | 
			
		||||
me_range=16
 | 
			
		||||
g=250
 | 
			
		||||
keyint_min=25
 | 
			
		||||
sc_threshold=40
 | 
			
		||||
i_qfactor=0.71
 | 
			
		||||
b_strategy=1
 | 
			
		||||
qcomp=0.6
 | 
			
		||||
qmin=10
 | 
			
		||||
qmax=51
 | 
			
		||||
qdiff=4
 | 
			
		||||
refs=2
 | 
			
		||||
directpred=1
 | 
			
		||||
flags2=+dct8x8+fastpskip+mbtree
 | 
			
		||||
cqp=0
 | 
			
		||||
wpredp=2
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user