Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > HDTV / DVB / TiVo

Reply
 
Thread Tools Search this Thread Display Modes
Old 14th September 2008, 08:45   #1  |  Link
halsboss
likes to tinker
 
Join Date: Jan 2004
Location: girt by sea
Posts: 635
Colourspace conversion ? 1080i -> 576i DVD

Think I've been missing something .
Have used .TS -> VideoReDo QuickStreamFix -> DGindex -> Avisynth -> HC
eg
Code:
MPEG2Source("c:\test\test.d2v",cpu=6)
buit have never used anything like what I saw on another board ...
Code:
ColorMatrix(mode="Rec.709->Rec.601")
Australia, 1080i MPEG2 ... do I need a conversion of that kind ?

Last edited by halsboss; 14th September 2008 at 14:03. Reason: added step "VideoReDo QuickStreamFix"
halsboss is offline   Reply With Quote
Old 14th September 2008, 12:38   #2  |  Link
scharfis_brain
brainless
 
scharfis_brain's Avatar
 
Join Date: Mar 2003
Location: Germany
Posts: 3,653
depends on the colour mode of your source video 709 or 601
and the ability of your mpeg2-encoder to switch between 709 and 601.
dgdecode will tell you which mode your source video was encoded in.
__________________
Don't forget the 'c'!

Don't PM me for technical support, please.
scharfis_brain is offline   Reply With Quote
Old 14th September 2008, 14:02   #3  |  Link
halsboss
likes to tinker
 
Join Date: Jan 2004
Location: girt by sea
Posts: 635
Thanks! DGIndex says "BT709*" and it's HC023 used to encode ... if PAL DVD is BT601 then I suppose I should be using ColorMatrix(mode="Rec.709->Rec.601") ?
This is the code in question:-
Code:
MPEG2Source("c:\test\test.d2v",cpu=6) # 1080i PAL -> DVD
Converttoyv12(interlaced=true) 
Global NewHeight=576
Global NewWidth=704
SeparateFields() 
Shift = (GetParity() ? -0.25 : 0.25) * (Height()/Float(NewHeight/2)-1.0)
E  = SelectEven().Spline36resize(NewWidth, NewHeight/2, 0,    Shift)
O  = SelectOdd( ).Spline36resize(NewWidth, NewHeight/2, 0,   -Shift)
Ec = SelectEven().Spline36Resize(NewWidth, NewHeight/2, 0,  2*Shift)
Oc = SelectOdd( ).Spline36Resize(NewWidth, NewHeight/2, 0, -2*shift)
#E  = SelectEven().Lanczos4resize(NewWidth, NewHeight/2, 0,    Shift)
#O  = SelectOdd( ).Lanczos4resize(NewWidth, NewHeight/2, 0,   -Shift)
#Ec = SelectEven().Lanczos4resize(NewWidth, NewHeight/2, 0,  2*Shift)
#Oc = SelectOdd( ).Lanczos4resize(NewWidth, NewHeight/2, 0, -2*shift)
Interleave(E, O)
IsYV12() ? MergeChroma(Interleave(Ec, Oc)) : Last
Weave()
Hmm, also wondering if NTSC HDTV sources are different ? Guess I'll have to google to find out if there's a quick reference, unless someone has a link and/or some knowledge to share ?
halsboss is offline   Reply With Quote
Old 14th September 2008, 14:09   #4  |  Link
halsboss
likes to tinker
 
Join Date: Jan 2004
Location: girt by sea
Posts: 635
HC's manual says
Quote:
*COLOUR
parameter colorimetry type integer
Status not required
Default -
Example *COLOUR 5
This command flags the colorimetry of the stream by outputting the Sequence Display Extension
header. For playback this header is ignored (Rec.601 will always be used for SD color
conversion, Rec.709 for HD color conversion) but it's useful for MPEG2 compliancy.
Possible settings: 1: BT.709, 4: BT.470-2M, 5: BT.470-2BG, 6: SMPTE170M, 7: SMPTE240M.
By default this header is not written.
and I'm no wiser on whether HC detects incoming colorspace and converts it automatically or not.

Here http://forum.doom9.org/showthread.ph...81#post1058881 jdobbs says default DVD spec is bt709 ...

Well well, I just checked a couple of recordings with DGindex and PAL HDTV 1080i (after a VideoReDo Quickstreamfix) comes up as "BT.709*" and PAL SD 576i comes up as "BT470-2 B,G*" ...

Till now with SD I've been simply using .TS -> VideoReDo QuickStreamFix -> straight into a DVD author program without any recoding/tinkering and it authors/records/plays DVD OK. Wonder what it's doing ?

With HDTV the steps were .TS -> VideoReDo QuickStreamFix -> DGindex -> Avisynth to SD size -> HC -> author to DVD so I wonder what colourspace it ended up as on the DVD (and whether it's right).


EDIT: http://forum.doom9.org/showthread.ph...92#post1060292 says "DGIndex won't show Rec.601 unless there is a sequence_display_extension() calling it out. If it is missing, DGIndex assumes Rec.709 (as it should)." so I'm not sure if that's of much help then... I'm not sure if there's any rec.601 or not

Last edited by halsboss; 14th September 2008 at 15:10.
halsboss is offline   Reply With Quote
Old 14th September 2008, 14:37   #5  |  Link
halsboss
likes to tinker
 
Join Date: Jan 2004
Location: girt by sea
Posts: 635
http://www.dvddemystified.com/dvdfaq.html#1.1 says
Quote:
Pictures are subsampled from 4:2:2 ITU-R BT.601 down to 4:2:0 before encoding, allocating an average of 12 bits/pixel in Y'CbCr format.
which seems to impliy DVD's (which are essentially SD size) are supposed to be BT.601 ...

http://www.glennchan.info/articles/t...olor-space.htm has a nice ""HD" versus "SD" color space" roundup too, which says
Quote:
The 3 sets of primaries in common use today are usually referred to as EBU, SMPTE C, and Rec. 709. All modern HD formats use Rec. 709 primaries (there are some obsolete HD formats that do not) while the standard for SD is either EBU or SMPTE C, depending on the country ... The EBU primaries are the standard for PAL countries and Japan ... The Rec. 709 set of primaries are a (silly) political compromise between the EBU and SMPTE C primaries. EBU red and blue were adopted, with a green halfway between EBU and SMPTE C.
http://encyclopedia2.thefreedictiona...ITU-R%20BT.601 talks about bt.601 and by.709


Interestingly, http://forum.doom9.org/showthread.ph...257#post807257 says
Quote:
5 ITU-R BT.470-2 (exactly the same as ITU-R BT.601)
(recommendation BT.601 is an update BT.470-2)
and
Quote:
You should use the interlaced=true parameter in ColorMatrix
Can anyone confirm whether that means my "BT470-2 B,G" is in fact bt.601 ?

Last edited by halsboss; 14th September 2008 at 15:40.
halsboss is offline   Reply With Quote
Old 15th September 2008, 11:15   #6  |  Link
pandy
Registered User
 
Join Date: Mar 2006
Posts: 1,049
halsboss - in fact You can have on DVD mpeg with BT.709 so transcoding of colorspaces is not mandatory.

btw
470 BG it is BT601 (norm 470 is for analog signal, norms 601 and 656 for digital representation of the 470)
pandy is offline   Reply With Quote
Old 24th September 2008, 11:59   #7  |  Link
halsboss
likes to tinker
 
Join Date: Jan 2004
Location: girt by sea
Posts: 635
OK. Pandy, how do I tell HCEnc this and ensure it does the right thing with producing the .mpv ? If I have an SD clip and an HDTV clip to combine into a 2-title DVD I guess I should settle on a standard ...

Unless someone says otherwise, assuming (a) AU PAL HDTV is Rec.709 and (b) AU PAL SD is Rec.470-2B,G (which is really Rec.601) (c) that HCEnc is my encoder and (d) PAL DVD is Rec.601, then I suppose I'll settle for this when processing HDTV
Quote:
MPEG2Source("Input.d2v",info=3,ipp=true,cpu=4) #ipp=true means interlaced; cpu=4 means deblock luma, chroma;info=3 means give colormetry etc hints
ColorMatrix(mode="Rec.709->Rec.601",hints=true,interlaced=true,threads=4)
where colormatrix is the latest from tcritical at http://bengal.missouri.edu/~kes25c/

Last edited by halsboss; 27th September 2008 at 10:19. Reason: removed d2v= as it didn't work (something about #frames mismatch), replaced by info=3 and hints=true
halsboss is offline   Reply With Quote
Old 28th September 2008, 02:27   #8  |  Link
halsboss
likes to tinker
 
Join Date: Jan 2004
Location: girt by sea
Posts: 635
Well, so much for that theory... the combination of HC with the colorspace plugin yields "odd" reds ... if I leave that off, it seems fine. Oh well, less cpu cycles used anyway. So, the result seem to be for Aus HDTV->DVD :-

Assuming (a) AU PAL HDTV is Rec.709 and (b) AU PAL SD is Rec.470-2B,G (which is really Rec.601) (c) that HCEnc is my encoder, then I suppose I'll settle for this when processing AU HDTV
Quote:
MPEG2Source("Input.d2v",info=3,ipp=true,cpu=4) #ipp=true means interlaced; cpu=4 means deblock luma, chroma;info=3 means give colormetry etc hints
#ColorMatrix(mode="Rec.709->Rec.601",hints=true,interlaced=true,threads=4) # nope, don't use this for Aus HDTV -> DVD via HCenc
halsboss is offline   Reply With Quote
Old 28th September 2008, 17:23   #9  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
Quote:
Well, so much for that theory... the combination of HC with the colorspace plugin yields "odd" reds
It shouldn't. Most players ignore the header, or assume Rec.601 when playing dvd's.

If i understand it correctly, HC doesn't write the colorimetry parameter in the header. Meaning that it should be treated as Rec.601. Yes, first we thought it should be treated as Rec.709 (like jdobbs stated at that time), based on some outdated mpeg-2 specs. Based on the latest mpeg-2 specs, and what players do, we changed our opinion. I'm sure you can find those discussions in the AviSynth forum, or wherever they took place.

What does info=1 report on the source?
Code:
MPEG2Source("Input.d2v",info=1,ipp=true,cpu=4)
More important. How are you playing the file?
Wilbert is offline   Reply With Quote
Old 29th September 2008, 02:37   #10  |  Link
halsboss
likes to tinker
 
Join Date: Jan 2004
Location: girt by sea
Posts: 635
Quote:
Originally Posted by Wilbert View Post
What does info=1 report on the source?
Code:
MPEG2Source("Input.d2v",info=1,ipp=true,cpu=4)
More important. How are you playing the file?
just deleted the source, just my luck. Will capture another -> VideoRedo -> Avisynth -> author DVD -> Nero burn -> Play with standard Sony Aus DVD player. Not sure why but the reds seemed "pinker". Beats me.
halsboss is offline   Reply With Quote
Old 29th September 2008, 08:52   #11  |  Link
pandy
Registered User
 
Join Date: Mar 2006
Posts: 1,049
Quote:
Originally Posted by halsboss View Post
OK. Pandy, how do I tell HCEnc this and ensure it does the right thing with producing the .mpv ?
Hmm... i simply use *COLOUR 5 or *COLOUR 1 and HCEnc properly signaling chosen color space inside Sequence Display Extension

Quote:
Originally Posted by halsboss View Post
If I have an SD clip and an HDTV clip to combine into a 2-title DVD I guess I should settle on a standard ...
I think that DVD should not "guess" colorimetry if decoded MPEG-2 stream is valid from DVD point of view and have valid Sequence Display Extension

Quote:
Originally Posted by halsboss View Post
Unless someone says otherwise, assuming (a) AU PAL HDTV is Rec.709 and (b) AU PAL SD is Rec.470-2B,G (which is really Rec.601) (c) that HCEnc is my encoder and (d) PAL DVD is Rec.601, then I suppose I'll settle for this when processing HDTV
If i have MPEG-2 with valid Sequence Display Extension then DVD player must fulfill MPEG-2 standard - if from unknown reason DVD player is not capable to properly decode and display valid MPEG-2 stream with valid Sequence Display Extension then such DVD player is not compatible with MPEG-2 standard
pandy is offline   Reply With Quote
Old 29th September 2008, 08:56   #12  |  Link
pandy
Registered User
 
Join Date: Mar 2006
Posts: 1,049
Quote:
Originally Posted by Wilbert View Post
If i understand it correctly, HC doesn't write the colorimetry parameter in the header.
HCEnc properly signaling colorimetry - streams produced by HCEnc are correct (they have valid Sequence Display Extension)
pandy is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 20:04.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.