Log in

View Full Version : How do stand-alone players know which colour systems to output?


SeeMoreDigital
7th October 2004, 13:37
There has been a lot of discussions on the forum with regards to converting, NTSC to PAL or PAL to NTSC but they all seem to involve changing the the encodes frame rate!

Are there any methods of changing the colour system only. So you could convert say, PAL at 25fps to NTSC at 25fps or NTSC at 30fps to PAL at 30fps?

And,... how does a stand-alone player "really know" which colour system to output?


Cheers


EDIT: Changed thread title

Soulhunter
7th October 2004, 16:58
Uhm, converting what ???

If its on ya PC (not analog) the color-format should be already equal... :confused:

If Ive missed the point, sorry then !!!


Bye

SeeMoreDigital
7th October 2004, 17:09
It was just an idea for a little experiment.

I wanted to see how well modern equipment is able to cope with unconventional Mpeg2 video streams, when output to a multi-standard TV.


Cheers

Wilbert
7th October 2004, 17:38
Like Soulhunter said, the colorformat is the same for digital stuff. For analog stuff you have turn the chroma (about) 30 degrees (and the color subcarrier frequency is diferent, etc ...).

SeeMoreDigital
7th October 2004, 18:18
Originally posted by Wilbert
... For analog stuff you have turn the chroma (about) 30 degrees (and the color subcarrier frequency is diferent, etc ...). Are there any tools for doing this?

However, when you generate say, an Mpeg4 cropped and re-sized encode from an NTSC source and play it back via a stand-alone player thru' to your TV. What's telling your equipment, this is an NTSC file?


Cheers

Mug Funky
7th October 2004, 19:03
hmm... the mpeg-4 player thing i have no idea about, but as far as colour formats go, most multi-system TVs will do PAL 60 and NTSC 50... they just have to look for the colour signal, and it it's not where the TV expects to find it, it plumps for the other system (there's only really 2 choices, not counting SECAM et al, which are just wacky formats that i haven't a clue about and have no experience with).

both my TV and (crappy) VCR will do all combinations of pal and ntsc colours/framerates. old equipment can be hacked to do it as well.

SeeMoreDigital
7th October 2004, 20:20
Originally posted by Mug Funky
...they just have to look for the colour signal, and it it's not where the TV expects to find it, it plumps for the other system (there's only really 2 choices, not counting SECAM et al, which are just wacky formats that i haven't a clue about and have no experience with). Yes... but where is the "colour system" information stored in the Mpeg4 (or Mpeg2) stream... And more importantly... can it be changed?


Cheers

Wilbert
7th October 2004, 20:29
Yes... but where is the "colour system" information stored in the Mpeg4 (or Mpeg2) stream
There is no colour system stored in a mpeg2/4 stream. I'm not sure how it works. I guess your hardplayer should know whether it outputs to a pal or ntsc tv, and upsample accordingly. But again, I don't really know ...

Soulhunter
7th October 2004, 20:45
Guess the player simply checks the fps-flag, maybe the resolution as well... :confused:


Bye

SeeMoreDigital
7th October 2004, 20:56
Originally posted by Wilbert
There is no colour system stored in a mpeg2/4 stream. I'm not sure how it works. I guess your hardplayer should know whether it outputs to a pal or ntsc tv, and upsample accordingly. But again, I don't really know ... I wonder whether there's some people on the forum who know more about this?

I'm interested because every now and again, when muxing PAL Mpeg4 streams into MP4, some of them start playing back in NTSC....

If there are some lines of code buried somewhere in the stream (or container), it might prove useful....


Cheers

jorel
7th October 2004, 21:01
Originally posted by SeeMoreDigital
Are there any tools for doing this?

However, when you generate say, an Mpeg4 cropped and re-sized encode from an NTSC source and play it back via a stand-alone player thru' to your TV. What's telling your equipment, this is an NTSC file?


Cheers

What's telling your equipment, this is an NTSC file
yes cos your output signal from video card is ntsc in this case but if your video card is PAL-G you can't see anyhting cos you change the color system and the standards.

when we see differences from PAL and NTSC we're have lots of changes
and not only the color systems..example:

NTSC-M = color system NTSC - standard M
PAL-G = color system PAL - standard G
Pal-M = color system Pal - standard M
PAL-N = color system Pal - standard N
...and lots more

in Brasil is PAL-M!

if you take an NTSC-M tv from USA to Brasil you see all but without colors,only in B&W because the difference is the color system but the standadr M is equal.

but if you take an PAL-G tv to Brasil(PAL-M) you can't see anything cos the standard G have big differences from standard M .
then not only the color systems have big differences but the stsndards too.
the differences from standards are too big, more than colors systems;
form NTSC to PAL color the differences is that the red color change the phasis but from standard G change the whole signal.

of course ( sorry poor english) :o

SeeMoreDigital
7th October 2004, 21:14
Hi jorel,

... if you set your stand-alone players colour output to "auto detect" and your TV to "auto detect". How does the stand-alone player know what colour system the stream is?

There's got to some "colour system" information stored somewhere!


Cheers

mpucoder
7th October 2004, 22:04
I have the feeling this info might just add to the confusion, but...
There is "colour system" information in MPEG-2 video streams (not sure about MPEG-4), stored in the Sequence_Display_Extension.

But this is NOT what you are talking about. What you are talking about is the television standard (NTSC, PAL/SECAM). For DVDs this is encoded in the ifo, but for playing program streams I'd agree with Wilbert and Soulhunter, that the player makes a decision based on resolution, framerate, and user preference (you might not have a multi-standard television). Of course my player, being made for region 1, will output only NTSC.

Now, the colour system - MPEG allows several different "color primaries and transfer characteristics" to be used. These different standards came about due to changes in CRTs. NTSC is firmly fixed on the older phosphors in use when the standard was created, but PAL diverged a little to accomodate newer phosphors without any processing to correct the color. This means that red, green, and blue for PAL are not the same as NTSC primary colors. MPEG decoders should be aware of this and produce the correct colors for the target standard. And, theoretically, for DVDs, PAL colors should not be used in NTSC material, and vice-versa. A good decoder won't care, though. And the difference is very minor.
Here are the values for ITU-R BT.470 (NTSC is 470 M, PAL is 470 B or G) and use the CIE coordinate system of 1931.

Color NTSC x NTSC y PAL x PAL y
red 0.67 0.33 0.64 0.33
green 0.21 0.71 0.29 0.60
blue 0.14 0.08 0.15 0.06

NTSC can also use SMPTE 170 M

SeeMoreDigital
7th October 2004, 22:32
Thanks mpucoder, for that information.

I had wondered whether the frame rate and pixel frame size might have had something to do with Mpeg2. That said, it is possible, is it not, to generate Mpeg2 encodes with variable frame rates, and any pixel frame size you want.

So given this to be the case, maybe it does have something to do with the SDE (Sequence Display Extension).

When it comes to Mpeg4, the encodes can most certainly be generated to just about any image pixel frame size you like. And variable frame rate, is also possible...

Come to think of it, I'm sure I remember reading somewhere that video stream data encoded onto DV tape is "colour format" free. And that it's possile to modify DV camcoders to puke out both NTSC or PAL video!

Arachnotron
7th October 2004, 23:03
@SeeMoreDigital

just stumbled over this thread :D
There has been a lot of discussions on the forum with regards to converting, NTSC to PAL or PAL to NTSC but they all seem to involve changing the the encodes frame rate!

Are there any methods of changing the colour system only. So you could convert say, PAL at 25fps to NTSC at 25fps or NTSC at 30fps to PAL at 30fps?

Most PAL DVD players are multi-standard, and some can even be fixed on a setting (like mine)

If you feed my player a NTSC disk, it will output PAL-60 when set to auto or PAL (= 29.97 fps, PAL colour) but pure NTSC when set to NTSC

I'm not sure if it will also output PAL timing with NTSC colour encoding, never tried it.

So basically, most european equipment will at least do the NTSC at 30fps to PAL at 30fps bit.

sysKin
8th October 2004, 02:52
Originally posted by SeeMoreDigital
How does the stand-alone player know what colour system the stream is?It's hardcoded in the hardware. The actual chip which creates TV signal from digital representation knows how to do it, and therefore knows all the frequency offsets defined in the TV standard.

There's got to some "colour system" information stored somewhere!I'd say it's either hard-coded in the TV chip itself (ie different versions of a chip for different standards) or programmable by player's firmware. For example, the chip for computer's TV-out is fully programmable (it would be silly to build different versions of video cards for different standards).

As for the colour system of a video signal, TVs are just able to figure out which system is used. It's no big deal to check which of possible carrier frequencies is present in given signal.
Still, my TV - for example - lets me switch between different PAL standards just in case auto-detection fails.

Radek

SeeMoreDigital
8th October 2004, 08:44
Originally posted by Arachnotron
Most PAL DVD players are multi-standard, and some can even be fixed on a setting (like mine) Yes... I understand all this, thankfully they are, so the manufacturers can maximize their options.

Personally speaking, all my TV's are multi-standard too


Originally posted by sysKin
It's hardcoded in the hardware. The actual chip which creates TV signal from digital representation knows how to do it, and therefore knows all the frequency offsets defined in the TV standard. Okay... But how does the chip know?

If say, both our stand-alone players and TV's are set to "auto" (like mine are). How does the player really know the correct colour system to output?

Where is the information stored?

And do Mpeg4 streams, follow the same rules to Mpeg2 streams!


Cheers

smok3
8th October 2004, 10:22
Originally posted by SeeMoreDigital
Come to think of it, I'm sure I remember reading somewhere that video stream data encoded onto DV tape is "colour format" free. And that it's possile to modify DV camcoders to puke out both NTSC or PAL video! of course, when you are in 'digital' world, this has nothing to do with pal/ntsc, this are 'analog' standards.

(lots of cheap 'film like' stuff in us is shoot to dvpal to get more of that 'filmic look' and later in post turned to 'ntsc' (iam talking about resolution and frame rate here only).

jorel
8th October 2004, 11:15
Originally posted by mpucoder
Now, the colour system - MPEG allows several different "color primaries and transfer characteristics" to be used. These different standards came about due to changes in CRTs. NTSC is firmly fixed on the older phosphors in use when the standard was created, but PAL diverged a little to accomodate newer phosphors without any processing to correct the color. This means that red, green, and blue for PAL are not the same as NTSC primary colors. MPEG decoders should be aware of this and produce the correct colors for the target standard. And, theoretically, for DVDs, PAL colors should not be used in NTSC material, and vice-versa. A good decoder won't care, though. And the difference is very minor.
Here are the values for ITU-R BT.470 (NTSC is 470 M, PAL is 470 B or G) and use the CIE coordinate system of 1931.

Color NTSC x NTSC y PAL x PAL y
red 0.67 0.33 0.64 0.33
green 0.21 0.71 0.29 0.60
blue 0.14 0.08 0.15 0.06

NTSC can also use SMPTE 170 M

excuse me but you wrote some mistakes and some confused informations.
don't exist any differences between trcs phosphors for color systems.
i don't know all colors systems but the crt only can be different if the difference is the standards cos the number of lines for each frames is differents in standards and not in color systems.
in Brasil and around the world have lots of labels/models with 2 or more colors systems tvs and if was true that the ctr is different, what type the factory will chosse for mlti-systems tv? seems a paradox!
the phosphorus don't have anything to do with the processing to correct the colors.the crt only answer more or less light encreasing or decreasing the light of the primaries colors to get the white-balance you need:
30% of RED + 59% of GREEN + 11% of BLUE = 100% white
no matter what color system or standard this combination is the same.
the differences of color systems is how the signal of the colors is processed in transmissions and restored in receptions and no matter if across the air or if you're using an rca cable to do that!
you can use one crt from one tv build in USA for one tv build in Brasil that don't have any difference in how they work cos NTSC and PAL(Brasil) is the same M standard and with differents colors processing.Athen,theoretically,for DVDs,PAL colors can be used in NTSC material, and vice-versa.

Pal sytems are more stable for air transmission cos have a circuit called pal-key that restore the -R to +R in the reception and ntsc have fixed positions in the vector for blue,red and the burst that have the identity of the whole color signal.

ntsc and vector (degree):
0 - burst signal
90 - RED
180 - BLUE
long time ago ntsc transmissions have problems with thre phase of the colors cos if the phase spin,and the RED change from 90 to 180, the burst istill see the RED as 90 degrees distnce and the BLUE still at 180 degrees but the red appears as green and the blue as purple and the whole matizes changes.
for this reason NTSC tvs have the CUE adjust for rotate the phase of the colors to correct the BLUE AND RED to his original degree in the color vector.....the change odf phases was a phenomenon in trasmissions across the air.

Pal and vector (degree)
0 - burst
90 - RED (+R)
180 - BLUE
270 - RED(-R) will be restored to +R to get the right color
Pal system was build to correct this phenomenon automatically cos the RED color is intentionaly transmited changing the phases as +R and -R and the pal-key of PAL system find what is +R and -R and restore the -R to +R cos the signal of burst in PAl transmissions have identification for - and + R cos +R is in 90 degress and -R is in 270 degress (called -90 too).
in pal system don't have the CUE adjust to correct the phase of the colors cos the pal-key do it automatically and in mutisystems tvs when you select as NTSC you have the feature to correct the phase ut if you change the system to PAL this feature is faded!
after the pal-key job restore the right phase of the RED color,the remainder of the color process is just the same for NTSC or PAL cos now we have the BLUE and RED and it's time to rebuild the green to do the matrix and take it to trcs that work in the same way no matter the system you have.

a little prejudice in PAL receptions: when the -R signal is restored to the original R it don't create a perfect RED and show the red a little pink in one field cos to restore the -R was happen and this process change the matiz just a little but when you are watching you have a "impression that all is red but one frame is red and another is a little pink resulting in a little poor red in the resulting field.
in this detail ntsc is champion cos you can adjust the perfect matizes adjusting the cue.
in the other side PAL is champion to stable signal rtransmission and reception cos restore the original RED no matter if the phenomenon happen or not.

o c'mon boys excuse that horrible english please and some redundants and repetitives phrases,ok?
:o :o

sysKin
8th October 2004, 11:20
Originally posted by SeeMoreDigital
If say, both our stand-alone players and TV's are set to "auto" (like mine are). How does the player really know the correct colour system to output?

Where is the information stored?[/b]
Must be in firmware :)
And do Mpeg4 streams, follow the same rules to Mpeg2 streams!
But it's not in the digital stream at all. Digital video streams don't control your hardware's video logic. They only contain the video and audio, they don't care if your cables from player to display are composite, s-video, antenna, rgb, dvi or computer screen.

It's like asking how does mpeg-4 stream tell your standalone which TV channel it should tune for output. Firmware knows if you're using antenna at all, and you set the channel you need. Not the video stream.

I hope it's clearer now :)

jorel
8th October 2004, 11:31
like i wote the informationis in the siganl and not in the firmware or any other item...the differences of system color are inside the siganl always and your multi-sistem tv will choose that or you do your choice but for my tate NTSC color is better! and for defintions the standard G is better than standard M.
yeah they build it all to drive us mad!
:p

Wilbert
8th October 2004, 11:49
like i wote the informationis in the siganl and not in the firmware or any other item...the differences of system color are inside the siganl always
I'm not sure if you understand the problem we are discussing here. The problem is that the video (which is YV12) must be upsampled in the firmware before it goes to your tv. The "upsampling" (*) is different for pal and ntsc (because pal is YUV and ntsc is YIQ, modulo the exceptional flavors). So, your firmware must know whether the video goes to a pal or a ntsc system.

The point we are discussing is: How does your firmware know? Does it only look at the framerate to decide how to upsample?

(*) To be correct: the upsampling is the same, difference is somewhere in the digital-analog conversion.

mpucoder
8th October 2004, 12:18
@jorel - I suggest you get a copy of ITU-R BT.470, which defines three (system M, B, and G) of the several color primaries, transfer characteristics, and matrix cooefficients used by MPEG-2. The phosphors have changed over time, and NTSC is locked to the phosphors in use at the time NTSC was written, whereas PAL was defined using newer phosphors. The result is that modern NTSC receivers have to compensate for the difference. These differences are in the color, and also the gamma correction (transfer characteristics). White is also defined differently for NTSC and PAL.

edit: you can also find this information in tables 6-7, 6-8, and 6-9 of ISO 13818-2.

But, as I said, this has nothing to do with which analog standard the player uses.

The question is, given that a choice exists, whether to output using PAL or NTSC.

stephanV
8th October 2004, 12:26
whether your standalone outputs PAL or NTSC, should depend on the setting of your TV right? (as mentioned before, an MPEG4 stream is in principle not PAL or NTSC)

I'm guessing the TV is requesting a format and the standalone will comply (or the other way around). If TV and standalone are both set to auto (and thus not really requesting a format), the stand alone will probably make a decision based on resolution/PAR and frame rate. Shouldn't be too hard to code that in the firm ware. :)

I don't think this has really anything to do with MPEG2 or MPEG4 or whatever, by definition they are never really PAL or NTSC.

Actually, the usefulness of such data is in the video stream is at its best debatable, as the setting is not unlikely to be ignored because either TV or standalone cannot comply.

SeeMoreDigital
8th October 2004, 14:51
I guess what we need is a "gender unspecific" Mpeg2 or Mpeg4 source file.

What I mean by "gender unspecific" is. A source that is 24fps (ie: film speed) and has a pixel frame size of 1280x720 (ie: high-def). And that has been created without a colour system profile (ie: not NTSC or PAL).

So what I'm proposing to do, is make a test card.

I've never done this before so may I ask, would a series of 24No animated TIFF images do. And if so, is there anybody here who can convert them into an Mpeg2 stream?


Cheers

stephanV
8th October 2004, 15:08
Originally posted by SeeMoreDigital
What I mean by "gender unspecific" is. A source that is 24fps (ie: film speed) and has a pixel frame size of 1280x720 (ie: high-def). And that has been created without a colour system profile (ie: not NTSC or PAL).

There so no such thing as MPEG2/4 which uses the colour system profile of PAL or NTSC. The colour information is stored completely different...

I'm not sure what you're trying to do here...

Arachnotron
8th October 2004, 15:42
Maybe this tool is of interest for the current discussion: restream (http://shh.sysh.de/restream.html). It allows you to change values in the mpeg2 sequence header, which also illustrates what kind of info is in there in the first place.

SeeMoreDigital
8th October 2004, 17:00
Thanks Arachnotron,

I will certainly try playing with this tool, to see what I can come up with.

stephanV,
As you've said so yourself "the stand alone will probably make a decision based on resolution/PAR and frame rate".

So, lets see what a player does with an encode running at 24fps and with various pixel frame sizes!


Cheers

Zhnujm
8th October 2004, 17:38
Most likely they will only read the framerate, at least with MPEG-4. With some players the automatic does not even work with MPEG-4 files.
I had a player that played everything that was not exactly 25fps as NTSC (for example 24.999).

SeeMoreDigital
8th October 2004, 21:09
Hi Zhnujm,

After having used the "ReStream" tool Arachnotron put me on to, I'm inclined to agree with you. It would indeed appear that the analogue colour system is determined via the frame rate!

As a test I fed ReStream with an PAL 720x576 source running at 25.000FPS and converted it to 29.970 and 30.000FPS and the colour system changed over to NTSC.

And likewise, when I fed ReStream with an NTSC 720x480 source running at 29.970FPS and converted it to 25.000, the colour system changed over to PAL.

Also, when PAL 25.000FPS and NTSC 29.970FPS sources were converted to 24.000FPS (ie: film speed) the "auto" detect played them back in NTSC.

Well... it seems as though this little experiment over and done with. Many thanks to you all.

I would however, still be most grateful if somebody here could convert my 24No PNG (not TIFF) images into an HD Mpeg2 stream.

One other thing to note... via composite output the colours looked very different between the two systems but via RGB, they were the same.


Cheers

EDIT: Here's what the test card looks like at half HD resolution.

http://img23.exs.cx/img23/8791/SMDTestCardhalfres.png

Each number at the botton of the image changes with each frame.

Arachnotron
8th October 2004, 21:45
I would however, still be most grateful if somebody here could convert my 24No PNG (not TIFF) images into an HD Mpeg2 stream.

Make a 1 line avs script and feed it into your favorite mpeg encoder using the avisynth imagereader/imagesource command. That is how I make my test sequences.

http://www.avisynth.org/ImageSource

SeeMoreDigital
1st April 2005, 16:21
I thought it might be useful to issue some follow-up information...

Anyway, I generated a whole bunch of 720x480 and 720x576 Mpeg2 streams at various frame rates. And here are my findings: -Mpeg2 Source Info - via Pioneer DV-575A | via Sigma Xcard
720x480 @ 23.976fps - Displayed as NTSC | Displayed as NTSC
720x480 @ 24.000fps - Displayed as NTSC | Displayed as NTSC
720x480 @ 25.000fps - Displayed as PAL | Displayed as PAL
720x480 @ 29.970fps - Displayed as NTSC | Displayed as NTSC
720x480 @ 30.000fps - Displayed as NTSC | Displayed as NTSC
Mpeg2 Source Info - via Pioneer DV-575A | via Sigma Xcard
720x576 @ 23.976fps - Displayed as PAL | Displayed as NTSC
720x576 @ 24.000fps - Displayed as PAL | Displayed as NTSC
720x576 @ 25.000fps - Displayed as PAL | Displayed as PAL
720x576 @ 29.970fps - Displayed as NTSC | Displayed as NTSC
720x576 @ 30.000fps - Displayed as PAL | Displayed as NTSCSo from this "quick test" it would indeed seem that different equipment analyses the streams contents differently and outputs the colour system accordingly.

I have several other players I can try... and will report back later.


Cheers