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 > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 31st January 2005, 00:23   #61  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,391
Quote:
Originally posted by tritical
Wouldn't it be:
Yes of course. Didn't have my brain with me. Corrected.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)

Last edited by Didée; 31st January 2005 at 00:29.
Didée is offline   Reply With Quote
Old 31st January 2005, 00:39   #62  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,370
Quote:
What about having dgdecode set a global variable colormatrix could read? To make it multi instance compatible the name would need to depend on the d2v file, so colormatrix would need the name of the d2v file as input as well. Good or bad idea?
Something like this should be possible. I will ask Neuron2 about it.

Quote:
Can this filter safely be used after resizing (for speed reasons) or better to put it before?
Doesn't matter.
Wilbert is offline   Reply With Quote
Old 4th February 2005, 01:30   #63  |  Link
jp80
Registered User
 
jp80's Avatar
 
Join Date: Jan 2002
Posts: 141
Hi,

I would like to use matrixcolor in Gordian Knot to encode an interlaced PAL DVD source to xvid. In order to do so I was told by len0x that I had to add this filter at the end of the AVS script. But as I'm a total newbie in modifying avs script with a filter in GK, could somebody please tell me exactly how to do all of those required steps :

-Which avs script should I modify, is it LastCompCheck.avs located at the GK root folder, or the one created after having set up the encoding options for a d2v file in GK? If it's the 2nd case, then at which moment could I do so? Because to me it seems GK starts the encoding as soon as the the customized avs is created?
-What do I need to write for colormatrix in the avs file, knowing that I want to output a 672x496 xvid from a interlaced PAL DVD ? For instance in this case, is it correct to write this?:

----------------------------------------------------------
LoadPlugin("C:\Program Files\GordianKnot\AviSynthPlugins\ColorMatrix\ColorMatrix.dll")
clip(width=720,height=576,pixel_type="YUY2",color_yuv=$954080).ConvertToYV12
ColorMatrix("Rec.709->Rec.601",mmx=false)
ColorMatrix("Rec.601->Rec.709",mmx=false)
ColorYUV(analyze=true)
-----------------------------------------------------------

And about the line "clip(width=720,height=576,pixel_type="YUY2",color_yuv=$954080).", should the width and height match the size of the input file, thus should I write width=720,height=480 for a PAL source? And does the name of "clip" matter and should have the same one as an intermediate file possibly created in the GK encoding process?

Last edited by jp80; 4th February 2005 at 11:46.
jp80 is offline   Reply With Quote
Old 4th February 2005, 05:09   #64  |  Link
gte024h
Registered User
 
Join Date: Sep 2003
Location: USA
Posts: 33
Quick question:

If I am doing no colorspace conversions in my workflow (maintaining YV12 throughout) should I be using ColorMatrix?

From the readme, and the discussions here, it seems that the original MPEG2 source (DVD, DVB, etc.) should have one of many possible coefficient matrices declared in it's header and if not, Rec.709 is to be assumed. The problem is that the decoder (Divx or Xvid) assumes Rec.601. Would it be possible to just copy the flags in the source header into the output header (assuming there are no colorspace conversions in between), then hope that the decoder will honor those flags?

BTW, great work on this filter, thanks!
gte024h is offline   Reply With Quote
Old 4th February 2005, 11:20   #65  |  Link
Dark-Cracker
Registered User
 
Dark-Cracker's Avatar
 
Join Date: Feb 2002
Posts: 1,195
@Wilbert

could you please let us know when DGindex will add a flag in the header of the .d2v file and when to apply colormatrix for the given flag

keep up the good work.

Bye.
__________________

AutoDub v1.8 : Divx3/4/5 & Xvid Video codec and .OGG/.MP3/.AC3/.WMA audio codec.
AutoRV10 v1.0 : Use RealVideo 10 Codec and support 2 Audio Streams and Subtitles.

Dark-Cracker is offline   Reply With Quote
Old 4th February 2005, 11:43   #66  |  Link
len0x
I'm afraid we've to stop
 
len0x's Avatar
 
Join Date: Mar 2003
Location: Amongst mad people
Posts: 5,398
Its not gonna be a flag, its gonna be a hint that ColorMatrix has to take advantage of (but that will work only for progressive sources).

@jp80

You complicate things a lot. I'm gonna reply to you in GK forum...
__________________
Gordian Knot Family:
Gordian Knot: website, download
Auto Gordian Knot: Website and download, tutorial, FAQ
len0x is offline   Reply With Quote
Old 4th February 2005, 12:00   #67  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,370
Quote:
If I am doing no colorspace conversions in my workflow (maintaining YV12 throughout) should I be using ColorMatrix?

From the readme, and the discussions here, it seems that the original MPEG2 source (DVD, DVB, etc.) should have one of many possible coefficient matrices declared in it's header and if not, Rec.709 is to be assumed. The problem is that the decoder (Divx or Xvid) assumes Rec.601.
I think you gave the answer yourself here. If it's not clear you should propose specific examples, and then i will tell you if you should use it.

Quote:
Would it be possible to just copy the flags in the source header into the output header (assuming there are no colorspace conversions in between), then hope that the decoder will honor those flags?
If you open your source mpeg2/avi directly in the encoder (application), then yes it should be possible to do this (i guess, but i'm not a coder). If you use AviSynth/dvdavi/vfapi/whatever in between then the frameserver should somehow preserve this info. We are working on this (see response of len0x).
Wilbert is offline   Reply With Quote
Old 4th February 2005, 12:07   #68  |  Link
Dark-Cracker
Registered User
 
Dark-Cracker's Avatar
 
Join Date: Feb 2002
Posts: 1,195
ok if colormatrix can find to enable it or not it's perfect i was thinking that a new field (somethink like matrix=709 will be added in the .d2v) thak you len0x for the answer

i will stay tuned

Bye.
__________________

AutoDub v1.8 : Divx3/4/5 & Xvid Video codec and .OGG/.MP3/.AC3/.WMA audio codec.
AutoRV10 v1.0 : Use RealVideo 10 Codec and support 2 Audio Streams and Subtitles.

Dark-Cracker is offline   Reply With Quote
Old 4th February 2005, 12:46   #69  |  Link
jp80
Registered User
 
jp80's Avatar
 
Join Date: Jan 2002
Posts: 141
Err did I do something wrong in my post, because I feel like everybody's ignoring it?
jp80 is offline   Reply With Quote
Old 4th February 2005, 12:51   #70  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,800
jp80,

len0x told you that he will answer your question in the GKnot forum.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 4th February 2005, 12:52   #71  |  Link
jp80
Registered User
 
jp80's Avatar
 
Join Date: Jan 2002
Posts: 141
Oh ok sorry I didn't see his reply.
jp80 is offline   Reply With Quote
Old 5th February 2005, 23:42   #72  |  Link
len0x
I'm afraid we've to stop
 
len0x's Avatar
 
Join Date: Mar 2003
Location: Amongst mad people
Posts: 5,398
When comparing mmx=true vs false - it seems to me that mmx implementation always makes image darker. I wonder if rounding errors can be directed to make image lighter instead? (coz main usage of this filter will be to correct darker pictures). Mmx implentation is about 10% faster than C in my testing environment (i.e. overall speed of a script is considered), so its more attractive to use it, but not at a cost of still having darker image.
__________________
Gordian Knot Family:
Gordian Knot: website, download
Auto Gordian Knot: Website and download, tutorial, FAQ

Last edited by len0x; 5th February 2005 at 23:44.
len0x is offline   Reply With Quote
Old 5th February 2005, 23:45   #73  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
@Wilbert

DGMPGDec 1.2.0 RC1 hints the colorimetry now. Refer to the Decomb source code for utilities.c for reading the hints. Use FieldDeinterlace() as your model. The colorimetry field is now bits 2-4 inclusive (zero-based). Here is the new header file:

Code:
bool PutHintingData(unsigned char *video, unsigned int hint);
bool GetHintingData(unsigned char *video, unsigned int *hint);

#define HINT_INVALID 0x80000000
#define PROGRESSIVE  0x00000001
#define IN_PATTERN   0x00000002
#define COLORIMETRY  0x0000001C
#define COLORIMETRY_SHIFT  2
@Dark-Cracker

If you open the D2V in DGDecode(...,info=1), you can see the colorimetry type displayed.

Last edited by Guest; 5th February 2005 at 23:54.
Guest is offline   Reply With Quote
Old 6th February 2005, 00:22   #74  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
Quote:
When comparing mmx=true vs false - it seems to me that mmx implementation always makes image darker. I wonder if rounding errors can be directed to make image lighter instead? (coz main usage of this filter will be to correct darker pictures).
Yes, this is possible. Adding a small adjustment factor to the pixel values before multiplying would shift the resulting output upwards.
tritical is offline   Reply With Quote
Old 6th February 2005, 00:35   #75  |  Link
Dark-Cracker
Registered User
 
Dark-Cracker's Avatar
 
Join Date: Feb 2002
Posts: 1,195
@neuron2
thank u for the answer. but the result will be hard to catch for an external sofware.

@wilbert
do you think it's possible to made colormatrix to work like :
1) detect if it need to apply the matrix convertion
2) if the conversion is needed apply it
3) if the conversion is not needed only apply the "limiter()" function.

this could allow to always add the colormatrix in the avisynth script without problems.

++
__________________

AutoDub v1.8 : Divx3/4/5 & Xvid Video codec and .OGG/.MP3/.AC3/.WMA audio codec.
AutoRV10 v1.0 : Use RealVideo 10 Codec and support 2 Audio Streams and Subtitles.

Dark-Cracker is offline   Reply With Quote
Old 6th February 2005, 01:42   #76  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
Quote:
Originally posted by Dark-Cracker
but the result will be hard to catch for an external sofware.
Umm, what do you want, a telegram?

I output the info screen, the debug output, and hints. What else can I do?
Guest is offline   Reply With Quote
Old 6th February 2005, 02:07   #77  |  Link
Dark-Cracker
Registered User
 
Dark-Cracker's Avatar
 
Join Date: Feb 2002
Posts: 1,195
@neuron2
lol in fact i have to rewrite my previous msg

but the result will be hard to catch for an external vb6 sofware.

we have enough way to get the infos but in vb there is some limitations it's for that i have say there is no *easy* way to retrieve the info (for exemple somethink like a flag when you read the .d2v header).

but i am sure wilbert will come with an automatic solution and i will could add .colormatrix() in each my script and the filter will (like a big boy) speak with .dgdecode() and decid or not to apply the convertion.

and more this could avoid me to have to catch the debugoutputstring (note to myself : "i realize i am a lazzy guy").

++
__________________

AutoDub v1.8 : Divx3/4/5 & Xvid Video codec and .OGG/.MP3/.AC3/.WMA audio codec.
AutoRV10 v1.0 : Use RealVideo 10 Codec and support 2 Audio Streams and Subtitles.

Dark-Cracker is offline   Reply With Quote
Old 6th February 2005, 02:13   #78  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
Glad you have a sense of humor...

A header line in the D2V won't do because it can change during the stream. It gets yucky to start including more dynamic stuff in the D2V.

I'm sure Wilbert will do it because he is the guy that asked me to add hinting.
Guest is offline   Reply With Quote
Old 6th February 2005, 02:33   #79  |  Link
Dark-Cracker
Registered User
 
Dark-Cracker's Avatar
 
Join Date: Feb 2002
Posts: 1,195
i have a good sense of humor but english is not my mother tonge and my jokes often turn into somethink ...hum not really funny so i prevent myself to made a lot of jokes in this forum

i was not thinking the matrix info could change during the stream but i think this could made sense when there is advertisments or trailers at the strart/middle of the video stream.

to sumup all my hopes are in wilbert

++
__________________

AutoDub v1.8 : Divx3/4/5 & Xvid Video codec and .OGG/.MP3/.AC3/.WMA audio codec.
AutoRV10 v1.0 : Use RealVideo 10 Codec and support 2 Audio Streams and Subtitles.

Dark-Cracker is offline   Reply With Quote
Old 8th February 2005, 01:02   #80  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
Well, I've been debating putting this up since I don't know if Wilbert is planning to release a new version soon, but I'll just put it up temporarily for those interested in testing. [link removed]. I changed the mmx routines so the rounding is almost a 100% match with the c routine, the difference is now truely indistinguishable. It is slightly slower due to the needed changes but not much, and it seemed like matching the c output was more important.

It also includes experimental support for reading dgdecode hints and an internal interlaced mode so hints are supported for that as well. Extra parameters are: bool debug, bool hints, bool interlaced (defaults: false, true, false). When reading hints, if hints are found then the conversion is only applied when needed... i.e. if you specify mode="rec.709->rec.601" and hints indicate its already rec.601 it doesn't apply the conversion. If no hints are found in the stream, it acts as if hints=false and always applys the conversion. You can use debug=true to check that it is finding the hints.

Last edited by tritical; 14th February 2005 at 23:22.
tritical is offline   Reply With Quote
Reply

Tags
colormatrix

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 22:22.


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