FFmpeg - Scale and Letterbox: Difference between revisions
From PiRho Knowledgebase
Jump to navigationJump to search
No edit summary |
m Knowledgebaseadmin moved page FFmpeg - Scale and Latterbox to FFmpeg - Scale and Letterbox |
||
(No difference)
| |||
Latest revision as of 12:41, 6 March 2025
ffmpeg -i <input.file> -c:v libx264 -filter:v "scale=(iw*sar)*min(640/(iw*sar)\,480/ih):ih*min(640/(iw*sar)\,480/ih), pad=640:480:(640-iw*min(640/iw\,480/ih))/2:(480-ih*min(640/iw\,480/ih))/2" -f mp4 <output.file>
Reference: FFMPEG - Encoding Optimal Videos for Streaming#Change_Resolution_and_add_Letterbox
Reference: [stackoverflow: Proper way to letterbox with ffmpeg]