View Full Version : Adding WSS (line 23) to video?
CyberShaman
20th August 2006, 06:48
http://www.cubicreality.com/kuvat/misc/cropped_snap.jpg
On the top of the image there's those white lines. They make my TV to switch into anamorphic wide screen mode. I'm trying to find out how to draw those lines myself.
Here are the specs for Wide Screen Signalling (WSS):
http://webapp.etsi.org/action/OP/OP20030411/en_300294v010401o.pdf
The problem is, I have no idea on how to translate those specs to pixels.
So does anyone have an idea on how to draw those lines? How many pixels is one bit... etc?
CyberShaman
29th August 2006, 19:21
Any ideas?
ApPojken
29th August 2006, 19:43
That sure sounds a bit stone age to me. Now that we have moved into the 21st century, why don't you just add an aspect ratio flag instead? :confused:
CyberShaman
29th August 2006, 20:17
Aspect ratio flag?
I'm building a video player for HTPC and this is the only way to control TV's aspect ratio mode from the program, as far as i know :confused:. Of course there's pin 8 in the scart but it requires external hardware.
ApPojken
30th August 2006, 09:56
Aaah I see.
So you're building a software player and you are going to read the aspect ratio flag and add a WSS overlay for anamorphic content? Interesting...
Sorry, then i am not much help but please post how you solved this one.
bill_baroud
30th August 2006, 10:47
Are you sure you can control line 23 (like it's the tv tuner which add it around the computer signal or it's the 23th line of the computer signal) ?
Well, else, a good start would be defining how you can translate a Ts = 200ns period in pixel. Since the clock is 5Mhz, you could assume 1 Ts = 1 Pixel but it's a wild guess.
So in that case, bit 1 would translate to something like 3 white pixels and 3 black pixels and bit 0 to 3 black pixels and 3 white pixels. But you'll need to define the white/black level, i'm not sure how to interpret the specs here.
And you have to find the begining of line 23 and count 11µs (that should make 55 pixels, but beware of my math skillz :D) to start your wss signaling.
Perhaps analyzing your screen shot should help you here.
Hoping that help and that i'm not totally wrong here...
CyberShaman
30th August 2006, 11:22
So you're building a software player and you are going to read the aspect ratio flag and add a WSS overlay for anamorphic content? Yes that's exactly what i'm after.
Are you sure you can control line 23 (like it's the tv tuner which add it around the computer signal or it's the 23th line of the computer signal) ?Line 23 is the first visible line (in PAL) so there's no problem. If it would only be possible to go below line 23. Lot's of great stuff there, you could even throw some teletext pages there :D.
Anyway, I'll try the numbers you gave.
CyberShaman
30th August 2006, 18:31
Success! :D and failure :(.
I got the magic number of 2.7 pixel per bit in 720x576 image. For some unknown fact, there's 6 bits (zero) before the WSS data.
Anyway, it doesn't work. I read some place that the line 23 is a line before the first visible line. So maybe it never was ment to work. Funny thing is, it did work on my TV with the above screenshot but doesn't work anymore. So more research needs to be done.
There seems to be some tvout chips that support WSS signalling. I have no idea how to control them but it's possible since TVTool does it.
vhelp
2nd September 2006, 19:34
Hi CyberShaman,
I was reading your post, and came up with an idea. What is stopping you
from taking an existing image (w/ the on/off of the change) and copying
the first two scanlines (or is it 4, for interlace) and remove the top
2 (or 4) lines in your existing .AVI video source with these lines, keeping
the video at the same pixel demenstion.
Later, you can examine two (on/off) images scanlines for their pixel values
and find out exactly what they are and where they start/end. Then, knwoing
this, you can create a template 2 lines, and padd them into your .AVI
video source's.
The way I see it.. is like this, if your video's have these two special
lines, and every time you run them, and they do exactly what they are suppose
to do, (according to your posted note above) and copying the two lines and
analising them and find out what and where each pixel is, etc. then when
you create these two lines, all it takes is for you to conjour up some code
to *peek* those values into the images, and vualla. This is what I would do,
unless I missunderstood something.
-vhelp
pandy
3rd September 2006, 00:03
CyberShaman at first - WSS is on the first visible line (same similarity is on the NTSC video sugnal which use some few lines of visible video for closed captioning) so it is possibly to encode WSS inside a video. I'm try to find some video which have a WSS inside MPEG-2 broadcasted signal, also i try to find part of datasheet which describe how WSS is impelemented on the ST Omega STB chipset (this chipset and many other STB chipsets have WSS encoding, simply You must create some data structure in memory, put the location to the registers and after this startup the DMA).
btw always You can create proper signal WSS line (on exactly sampling frequency - You have square piksel ie native sampling frequency then simply rescale by bilinear or bicubic algorithm to the 720 pixels).
CyberShaman
3rd September 2006, 18:31
Hi CyberShaman,
I was reading your post, and came up with an idea. What is stopping you
from taking an existing image (w/ the on/off of the change) and copying
the first two scanlines (or is it 4, for interlace) and remove the top
2 (or 4) lines in your existing .AVI video source with these lines, keeping
the video at the same pixel demenstion.
No need for that anymore. I managed to produce exactly same kind of line from the spec. What confused me was the start and run bits and also the 6 zero bits at the beginning.
There's 137 bits in total (+ 6 zero bits). So what I did was a bitmap with dimentions of 143x1 pixel. That way each pixel is one bit. Then I set the bits(pixels) according to the specs. Now this bitmap is stretched using bilinear algorithm to 386 pixels width (in 720x576 PAL) .
CyberShaman at first - WSS is on the first visible line (same similarity is on the NTSC video sugnal which use some few lines of visible video for closed captioning) so it is possibly to encode WSS inside a video. I'm try to find some video which have a WSS inside MPEG-2 broadcasted signal, also i try to find part of datasheet which describe how WSS is impelemented on the ST Omega STB chipset (this chipset and many other STB chipsets have WSS encoding, simply You must create some data structure in memory, put the location to the registers and after this startup the DMA). So there's still hope to get this to work :). I'll definitelly take a look on how to access the tv encoder. It would be nice to have control to other properties of that chip also.
I don't know exactly what kind of video are you looking but here's a short clip from the same source I captured that snapshot above.
Duration is 27s, size about 10MB.
http://koti.mbnet.fi/cyberos/misc/wss_clip.dvr-ms
pandy
4th September 2006, 15:59
ok, i find some free time so i upload all materials to the WSS sigaling ie part of transport stream, norm ETSI 300294, captured 2 lines from live source signal (the same is on trasnport stream), *.csv which have inside values of the same live video lines.
Simply according to the ETS300294 there is 5MHz clock, pulses are shaped by simple FIR filter (coeficient of FIR filter are values of the sin^2). Maybe somebody create a simple tool for creating WSS lines.
This a link to the archive with all files:
http://rapidshare.de/files/31931920/WSS.7z.html
(7z are 7-zip archive - freeware)
best regards
pandy
24th November 2009, 14:42
13.5MHz is common for NTSC and for PAL in BT656/601, also WSS "bit" is made from 6x 200ns pix (3 + 3) ie data bit in WSS is made from 16.2 video pix in BT656/601 - do all calculation on that rule ie half bit is made from 81 video pix , whole bit is 162 video pix, when you finish construct your WSS line then do downresize (bilinear should be sufficient) 10x - everything should work OK.
Wilbert
26th November 2009, 23:28
I have the specs 'EBU ETSI EN 300 294 V1.4.1 - WSS signalling.pdf', maybe that's of any use here?
BingoWingo
11th December 2009, 16:07
Hmm, seams it´s only a factor of 2.7 as mentioned above,
when the values you listed represent the run in and start!
(Some 0 pixel offset on the start - also mentioned above)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.