FFmpeg - Scale and Letterbox: Difference between revisions
From PiRho Knowledgebase
Jump to navigationJump to search
mNo edit summary |
m Knowledgebaseadmin moved page FFMpeg - Scale and Latterbox to FFmpeg - Scale and Latterbox |
(No difference)
| |
Revision as of 11:31, 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]