portets
Posts: 186
Joined: Sat Oct 29, 2011 6:24 am

Composite Video Resolution

Wed Jun 19, 2013 2:44 am

Is it defined in firmware or hardware?

Why is NTSC output 720x480 and not the standard 720x525? After overscan, the average NTSC TV will only display 656x448 on a Pi. But if the standard is used, the average TV will output 656x483 after overscan and blank data removal.

That's an 8% increase in scanlines. Which is pretty significant when dealing with such low resolutions.

If the issue is because the scanlines need to be a multiple of 16, why not have it be 720x512? That'll give us a visible resolution of 656x476 on the average TV, which is still a 7% increase in scanlines.

All of this also applies to PAL. The Pi puts out 720x576 in PAL, but PAL standard is 720x625.

User avatar
rpdom
Posts: 13159
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Composite Video Resolution

Wed Jun 19, 2013 4:00 am

Because 480 (NTSC) and 576 (PAL) is the number of visible lines defined in the format. The other lines are off the top and bottom of the screen, originally because of timing requirements, and later used to carry other broadcast information in digital form (like teletext, time, PDC, station ID, etc). These lines are probably output on the composite signal for compatibility, but the Pi only reports the visible area of the screen.

From wikipedia (as reliable as that is...)
576i is a standard-definition video mode used in (former) PAL and SECAM countries. In digital applications it is usually referred to as "576i"; in analogue contexts it is often called "625 lines",[1] and the aspect ratio is usually 4:3 unless otherwise specified. Its NTSC counterpart is 480i; these are the two common forms of standard-definition television.

portets
Posts: 186
Joined: Sat Oct 29, 2011 6:24 am

Re: Composite Video Resolution

Wed Jun 19, 2013 4:58 am

I thought that might be the case too, but only 448 scanlines are visible on my Pi with various TV's. I've read that this is usually how many are visible when a signal only contains 480 scanlines instead of 525. I also read that the average (NTSC)TV will display about 483 scanlines when the signal contains all 525.

And many digital devices do only output 480 instead of 525 scanlines due to 525 not being divisible by 16(something to do with math simplification).

techpaul
Posts: 1512
Joined: Sat Jul 14, 2012 6:40 pm
Location: Reading, UK
Contact: Website

Re: Composite Video Resolution

Wed Jun 19, 2013 9:14 am

Actually for composite outputs it gets way more complicated than that and people have produced for years digitalyl driven analog composite video with half lines, interlace and the full visible (non-blanked) portions of images. It is nothing to do with easy multiples. Most computer monitors (also more modern TVs) handle non-interlaced without half line offsets on their VGA, DVI, HDMI and computer network linked ports. (Most modern TVs are actually small Linux systems these days).

In the 70's people were doing it with large arrays of electronics, in the 80's all the home computers that drove TVs did it, as well as from the late 70's a lot of TV studio equipment.

Whether certain pieces of equipment manage it is a different matter, that is down to how something is designed and how well tested it is. I have not looked at the composite output of the Pi, but some of your figures dont make sense.

The Pi reports resolutions for all types of monitors by its maximum visible portion.

I would suggest you have overscan settings to reduce the amount of visible lines, try changing the overscan settings.
Just another techie on the net - For GPIO boards see http:///www.facebook.com/pcservicesreading
or http://www.pcserviceselectronics.co.uk/pi/

drgeoff
Posts: 8891
Joined: Wed Jan 25, 2012 6:39 pm

Re: Composite Video Resolution

Wed Jun 19, 2013 3:05 pm

Everything that outputs a video signal intended for an NTSC system TV must produce a signal with a horizontal sweep frequency of close to 15750* Hz and a vertical sweep frequency close to 60* Hz. Otherwise the oscillators in the TV may not lock (=synchronise) to them. A simple bit of maths shows that in one vertical period of 16.66 ms there will be close to 262 horizontal sweeps. For a signal that properly conforms to the NTSC spec there are exactly 262.5 such sweeps. Two vertical sweep periods are required to span 525 horizontal times. The two sets of lines are interlaced, every other spatial line being drawn on each vertical sweep.

With such interlace, although large areas of the picture are refreshed 60 times per second, very fine detail of the order of one line in height is only refreshed 30 times each second. With CRT type displays (with short phosphors) this gives rise to annoying interline flicker on horizontal lines eg portions of characters. Hence it became commonplace on home computers etc that were using TVs as display devices to slightly modify the signal away from true NTSC to a non-interlaced approximation having an exact integer number of horizontal sweep periods per vertical sweep period. Hence a set of eg 262 lines in the same spatial position every 16.67 ms. Flicker now at 60 Hz which is very much less visible.

The RPi does produce an interlaced signal. At least when set to 625 (European PAL) as I noticed yesterday when I had Raspbmc connected via composite to an old CRT based TV.

Because CRT deflection needs some time for both vertical and horizontal retrace, the analogue signal contains blanking periods when no picture information is present. This occupies about 20 horizontal periods per vertical scan and about 11 microseconds per horizontal. Hence the number of 'active lines' is about 483 for NTSC and 575 for 625 line systems.

It was also common practice for CRT based TVs to overscan. The scanning amplitudes were set slightly higher and wider than just getting to the edges of the CRT. This was to hide some distortions that could occur there and also to prevent aging valves and mains voltage variations resulting in black areas at the edges. So it wasn't uncommon for a so-called 525 line TV to only show 460 lines or so.

(With the introduction of colour those numbers were changed slightly. The vertical frequency became 60/1001. Still 262.5 horizontals per vertical, so approx 15734 Hz.)

portets
Posts: 186
Joined: Sat Oct 29, 2011 6:24 am

Re: Composite Video Resolution

Mon Jun 24, 2013 2:42 am

Thanks for clarifying things a bit, still learning.

So you're saying that the Pi does output the full 525/625 scanlines?

drgeoff
Posts: 8891
Joined: Wed Jan 25, 2012 6:39 pm

Re: Composite Video Resolution

Mon Jun 24, 2013 10:38 pm

portets wrote:Thanks for clarifying things a bit, still learning.

So you're saying that the Pi does output the full 525/625 scanlines?
It outputs a signal comparable to the 525 or 625 line composite video obtainable from other devices (STBs, VCRs, DVD players, camcorders, some still cameras, games consoles etc) which offer a composite video output. And just like all those other devices the number of lines containing picture information is, or close to, 480 or 576.

However some of those 480 or 576 lines might be black (or whatever) depending on settings (eg overscan) in config.txt.

Return to “Advanced users”