[FFmpeg-devel] [PATCH] doc/filters: add an example to scale

James Darnley james.darnley at gmail.com
Fri Jan 22 03:53:10 CET 2016


Someone on IRC asked for a scale that would fit in a given box.  This is the
answer.  I couldn't see it in the existing examples so I thought I would add it.
---
 doc/filters.texi | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/doc/filters.texi b/doc/filters.texi
index dd1f203..56236c6 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -10298,6 +10298,12 @@ keeping the same aspect ratio as the input:
 @example
 scale=w='min(500\, iw*3/2):h=-1'
 @end example
+
+ at item
+Scale a video so that it fits within a 720x720 box and correct for aspect ratio:
+ at example
+scale=w=if(gte(dar,1),720,720*dar):h=if(lte(dar,1),720,720/dar)
+ at end example
 @end itemize
 
 @subsection Commands
-- 
2.7.0



More information about the ffmpeg-devel mailing list