user15971: I was trying to do some video editing and encoding. I have a so-called SD video that should supposedly be in 4:3 aspect ratio. But instead of 640x480, it is 720x480. Interestingly, when I play it with a media player, what I see is 640x480- it is not played as 720x480!
What is going on?! How could it be possible?

user22079: 525/60 digitized SD video according to Rec. 601 is indeed 720 pixels wide, 480 pixels high, including some blanking on the sides. Digital equivalent of 625/50 is 720x576. In both cases, frame aspect ratio is 4:3, this simply means that the pixels are not square. See https://en.wikipedia.org/wiki/D-1_(Sony)
To make matters more complex, only a subset of the frame has 4:3 proportions. I believe, only the 704x480 (for 525/60) and 704x576 (for 625/50) has 4:3 proportions. See discussion here: https://lurkertech.com/lg/video-systems/
So, 480 pixels are 10/11 in proportion, 576 pixels are 59/54 in proportion. Also see here: https://en.wikipedia.org/wiki/Pixel_aspect_ratio And do not forget, that both 480-line and 576-line formats can also be widescreen (16:9) yet having the same number of pixels per line! Plus, numbers like 59/54 are not easy to work with. All of this caused that for 576-line format pixel aspect ratio has been chosen as 12/11 for 4:3 screen aspect ratio, and as 16/11 for 16:9.
Square pixels became the norm starting from VGA video adapter I believe, and then from HD specs for 720-line and 1080-line video. By the way, there are some HD formats that record 1440x1080 or 960x720, yet having 16:9 frame aspect ratio, they also have non-square pixels. Square pixels are relatively recent development and should not be automatically expected.

user18155: There are 2 different things:

The real width and height of frames (in pixels) – see the green part of the following picture.
The displayed width and height (during the playback) – see the blue part of the same picture.

The problem arose in old bad days, when the resolution of devices (number of pixels in the image) was very low, but the required ratio of width to high for the playback was 4:3.
The solution (in those days) was the invention of non-square pixels.

For the sake of simplicity let's suppose (theoretically) very low dimensions:

required: 4×3 pixels (i.e. 12 pixels) per frame.
real possible (for the acceptable price): 3×3 (i.e. 9 pixels).

The solution was non-square pixels with the pixel aspect ratio (PAR) 4:3, as here:

So the pixel aspect ratio (PAR) is the ratio of sizes of every one individual pixel:
Every blue pixel in our image has PAR 4:3, and every orange and every green one has PAR 1:1.
Now our whole (blue) image is displayed correctly, as we wanted - e.g. as 12 cm x 9 cm – so its Display Aspect Ratio (DAR) is 12:9, or 4:3.
In spite of it, it's saved as 3 × 3 pixels – so the Storage Aspect Ratio (SAR) is  3 pixels : 3 pixels, or 1:1.
Hint:

pixel aspect ratio (PAR) is micrometers : micrometers
display aspect ratio (DAR) is centimeters : centimeters
storage aspect ratio (SAR) is pixels : pixels

Consequently, the relation between these 3 values is
             
DAR = SAR × PAR
The important note:
Sometimes is PAR (Pixel Aspect Ratio) called Sample Aspect Ratio – as in FFmpeg*. Unfortunately, the abbreviation for it is then SAR, which is very confusing, because – as we saw – it's also the abbreviation for Storage Aspect ratio.

The main problem:
Nowadays all devices have pixel aspect ratio 1:1 (square pixels), and many media players, mainly for small devices (cell phones, tablets), rely on it, fully ignoring the DAR value stored in video streams.
So you may encounter the situation when the same video (made from all sources) is played back correctly in your desktop or laptop computer, but incorrectly (narrowed) in your smartphone. Or even on the other media player on the same computer or device.
In our example, the frames may be wrongly displayed as a square (see the green part of the image above).

The solution of this problem in FFmpeg:

resize the problematic video, then
set the SAR of it to 1, and
the DAR has very likely the correct value, but you may set it to be sure.

In our (unreal) example you may use the filtergraph
-vf scale=4:3,setsar=1,setdar=w/h

where w is the width of (just scaled) frames in pixels, h is their height. FFmpeg will substitute the appropriate values automatically.
The result will be the orange part of the above image.

In your case, your video has (from your info)

DAR 4:3 (640:480),
SAR (Storage Aspect Ratio) 720:480 = 3:2, and – consequently –
PAR = DAR / SAR = 8:9. (In the FFmpeg terminology it is **SAR – Sample Aspect Ratio).

So to avoid problems with media players ignoring the DAR value (and play back it in the proportion 720:480, you may consider converting it with the command
ffmpeg -i your_input_file -vf -scale=640:480,setsar=1 -c:a copy your_output_file


Problems with pictures with non-square pixels:
With pictures, the situation is even much worse:
Almost all Picture Viewers/Editors and Internet Browsers simply ignore images SAR and DAR, supposing that all pictures over the world have SAR 1:1.
The honorable exception is (interestingly and surprisingly enough) Microsoft Windows Photo Viewer, which displays all pictures correctly.
You may become convinced of it e.g. by the The Pixel Aspect Ratio Acid Test - all 9 pictures there should be displayed correctly in your browser, but – highly likely – they aren't.

15971: <p>I was trying to do some video editing and encoding. I have a so-called SD video that should supposedly be in <code>4:3</code> aspect ratio. But instead of <code>640x480</code>, it is <code>720x480</code>. Interestingly, when I play it with a media player, what I see is <code>640x480</code>- it is not played as <code>720x480</code>!</p>

<p>What is going on?! How could it be possible?</p>
 22079: <p>525/60 digitized SD video according to Rec. 601 is indeed 720 pixels wide, 480 pixels high, including some blanking on the sides. Digital equivalent of 625/50 is 720x576. In both cases, frame aspect ratio is 4:3, this simply means that the pixels are not square. See <a href="https://en.wikipedia.org/wiki/D-1_(Sony)" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/D-1_(Sony)</a></p>

<p>To make matters more complex, only a subset of the frame has 4:3 proportions. I believe, only the 704x480 (for 525/60) and 704x576 (for 625/50) has 4:3 proportions. See discussion here: <a href="https://lurkertech.com/lg/video-systems/" rel="nofollow noreferrer">https://lurkertech.com/lg/video-systems/</a></p>

<p>So, 480 pixels are 10/11 in proportion, 576 pixels are 59/54 in proportion. Also see here: <a href="https://en.wikipedia.org/wiki/Pixel_aspect_ratio" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Pixel_aspect_ratio</a> And do not forget, that both 480-line and 576-line formats can also be widescreen (16:9) yet having the same number of pixels per line! Plus, numbers like 59/54 are not easy to work with. All of this caused that for 576-line format pixel aspect ratio has been chosen as 12/11 for 4:3 screen aspect ratio, and as 16/11 for 16:9.</p>

<p>Square pixels became the norm starting from VGA video adapter I believe, and then from HD specs for 720-line and 1080-line video. By the way, there are some HD formats that record 1440x1080 or 960x720, yet having 16:9 frame aspect ratio, they also have non-square pixels. Square pixels are relatively recent development and should not be automatically expected.</p>
 18155: <p>There are 2 different things:</p>
<ul>
<li>The <em>real</em> width and height of frames (in pixels) – see the <em>green</em> part of the following picture.</li>
<li>The <em>displayed</em> width and height (during the playback) – see the <em>blue</em> part of the same picture.</li>
</ul>
<p>The problem arose in old bad days, when the resolution of devices (number of pixels in the image) was very low, but the required ratio of width to high for the playback was 4:3.</p>
<p>The solution (in those days) was the invention of <em>non-square pixels.</em></p>
<hr />
<p>For the sake of simplicity let's suppose (theoretically) very low dimensions:</p>
<ul>
<li>required: 4×3 pixels (i.e. 12 pixels) per frame.</li>
<li>real possible (for the acceptable price): 3×3 (i.e. 9 pixels).</li>
</ul>
<p>The solution was non-square pixels with the <em>pixel aspect ratio (<strong>PAR</strong>) 4:3</em>, as here:</p>
<p><a href="https://i.stack.imgur.com/it5LI.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/it5LI.jpg" alt="enter image description here" /></a></p>
<p>So the pixel aspect ratio (<strong>PAR</strong>) is the ratio of sizes of every one <em>individual pixel:</em></p>
<p>Every blue pixel in our image has <strong>PAR</strong> 4:3, and every orange and every green one has <strong>PAR</strong> 1:1.</p>
<p>Now our whole (blue) image is displayed correctly, as we wanted - e.g. as 12 cm x 9 cm – so its <em>Display Aspect Ratio (<strong>DAR</strong>)</em> is 12:9, or 4:3.</p>
<p>In spite of it, it's saved as 3 × 3 pixels – so the <em>Storage Aspect Ratio (<strong>SAR</strong>)</em> is  <em>3 pixels : 3 pixels,</em> or 1:1.</p>
<p>Hint:</p>
<ul>
<li>pixel aspect ratio (<strong>PAR</strong>) is micrometers : micrometers</li>
<li>display aspect ratio (<strong>DAR</strong>) is centimeters : centimeters</li>
<li>storage aspect ratio (<strong>SAR</strong>) is pixels : pixels</li>
</ul>
<p>Consequently, the relation between these 3 values is</p>
<p>             
<strong>DAR</strong> = <strong>SAR</strong> × <strong>PAR</strong></p>
<p><strong>The important note:</strong></p>
<p>Sometimes is <strong>PAR</strong> (Pixel Aspect Ratio) called <em>Sample Aspect Ratio – as in FFmpeg</em>*. Unfortunately, the abbreviation for it is then <strong>SAR</strong>, which is very confusing, because – as we saw – it's also the abbreviation for Storage Aspect ratio.</p>
<hr />
<p><em>The main problem:</em></p>
<p>Nowadays all devices have pixel aspect ratio 1:1 (square pixels), and many media players, mainly for small devices (cell phones, tablets), rely on it, fully ignoring the <strong>DAR</strong> value stored in video streams.</p>
<p>So you may encounter the situation when the same video (made from all sources) is played back correctly in your desktop or laptop computer, but incorrectly (narrowed) in your smartphone. Or even on the other media player on the same computer or device.</p>
<p>In our example, the frames may be wrongly displayed as a square (see the green part of the image above).</p>
<hr />
<p><em><strong>The solution of this problem in FFmpeg:</strong></em></p>
<ul>
<li>resize the problematic video, then</li>
<li>set the <strong>SAR</strong> of it to 1, and</li>
<li>the <strong>DAR</strong> has very likely the correct value, but you may set it to be sure.</li>
</ul>
<p>In our (unreal) example you may use the filtergraph</p>
<pre><code>-vf scale=4:3,setsar=1,setdar=w/h
</code></pre>
<p>where <code>w</code> is the width of (just scaled) frames in pixels, <code>h</code> is their height. FFmpeg will substitute the appropriate values automatically.</p>
<p>The result will be the orange part of the above image.</p>
<hr />
<p>In your case, your video has (from your info)</p>
<ul>
<li><strong>DAR</strong> 4:3 (640:480),</li>
<li><strong>SAR</strong> (Storage Aspect Ratio) 720:480 = 3:2, and – consequently –</li>
<li><strong>PAR</strong> = <strong>DAR</strong> / <strong>SAR</strong> = 8:9. (In the FFmpeg terminology it is **SAR – Sample Aspect Ratio).</li>
</ul>
<p>So to avoid problems with media players ignoring the <strong>DAR</strong> value (and play back it in the proportion 720:480, you may consider converting it with the command</p>
<pre><code>ffmpeg -i your_input_file -vf -scale=640:480,setsar=1 -c:a copy your_output_file
</code></pre>
<hr />
<p><strong>Problems with pictures with non-square pixels:</strong></p>
<p>With pictures, the situation is even much worse:</p>
<p>Almost all Picture Viewers/Editors and Internet Browsers simply ignore images <strong>SAR</strong> and <strong>DAR</strong>, supposing that all pictures over the world have <strong>SAR</strong> 1:1.</p>
<p><em>The honorable exception is (interestingly and surprisingly enough) Microsoft Windows Photo Viewer,</em> which displays all pictures correctly.</p>
<p>You may become convinced of it e.g. by the <a href="http://frs.badcoffee.info/PAR_AcidTest/" rel="nofollow noreferrer">The Pixel Aspect Ratio Acid Test</a> - all 9 pictures there should be displayed correctly in your browser, but – highly likely – they aren't.</p>
