Fix video pixel aspect ratio
Updated: November 23, 2026
If the picture looks stretched, check the file’s pixel aspect ratio before changing the player. Resolution tells you how many samples are in a frame. Sample aspect ratio, or SAR, tells you whether each sample is displayed as a square or a rectangle. Display aspect ratio, or DAR, is width divided by height, multiplied by SAR.
Measure the source
Run ffprobe on the original and note width, height, sample_aspect_ratio, and display_aspect_ratio. A 720 × 576 raster with a 16:15 SAR displays at 4:3. Play the source in software that honors those values and check a shape you recognize, such as a circle. If the file looks right outside the website, also check whether CSS stretches its display box.
ffprobe -v error -select_streams v:0 -show_entries stream=width,height,sample_aspect_ratio,display_aspect_ratio -of csv=p=0 input.mp4Make a square-pixel copy
For that example, scale to 768 × 576 and set SAR to 1 with setsar. Scaling changes the number of horizontal samples to retain the 4:3 shape. The command below re-encodes the video and applies to this example. Choose a different output size for material with a different display aspect ratio. Keep the source so you can revisit the interpretation.
Look for black bars encoded into the source as well. Frame dimensions describe the whole raster, including any bars that are part of the picture. If the circle looks right in the corrected file but bars remain, decide separately whether to retain them or crop before preparing the final copy.
ffmpeg -i input.mp4 -vf 'scale=768:576,setsar=1' -c:v libx264 square.mp4Verify in the destination
Run ffprobe again. Expect 768 × 576, SAR 1:1, and DAR 4:3. Open the result in a browser and compare the circle with the reference source. If you use a video host, upload a short sample first and check the embedded player too.
Frequently asked questions
Yes, if the source has incorrect metadata and its dimensions already reflect the intended shape. For the 720 × 576 example, that alone would produce a 5:4 picture.