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
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 17th June 2004, 16:35   #1  |  Link
91638
Registered User
 
Join Date: Jul 2002
Location: Germany
Posts: 42
picture too dark with avisynth script

Hi,

i noticed that the picture ist too dark when i use avysinth as frameserver. No matter what Version of Avisynth i use, always the same problem. If i open the *.d2v file in TMPG the picture is O.K.
Does anybody know a solution for this problem. I used the search in this forum but found no thread helping me.

I know my english is worth to improve but maybe you can understand my problem and help me. Thanks.

Last edited by 91638; 17th June 2004 at 16:38.
91638 is offline   Reply With Quote
Old 17th June 2004, 22:11   #2  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
Please post your Avisynth script and tell us what you were frameserving it into when you observed the dark colors.
Guest is offline   Reply With Quote
Old 18th June 2004, 05:44   #3  |  Link
91638
Registered User
 
Join Date: Jul 2002
Location: Germany
Posts: 42
I used the following script just to if the problem occurs in Avisynth. For this reason i did not
use any filters. Source Material is from DVD.

LoadPlugin("D:\Videobearbeitung\AviSynth 2.5\plugins\MPEG2DEC3dg.dll")

Mpeg2Source("G:\chucky.d2v")

ConvertToYUY2()

To solve the problem i inserted the following line

Levels(0,1.18,255,0,255,false)

the colors seems to be correct now, but i do not know if this is the best way.

Thanks for your help.
91638 is offline   Reply With Quote
Old 18th June 2004, 08:44   #4  |  Link
DarkNite
Almost Silent Member
 
DarkNite's Avatar
 
Join Date: Jun 2002
Location: Purgatory
Posts: 273
If you check the documentation you will notice that the luminance offset of MPEG2Dec3 is by default -2, and I don't recall if that was changed in MPEG2Dec3dg.
__________________
Rethinking the "Why?" chromosome.
DarkNite is offline   Reply With Quote
Old 18th June 2004, 10:23   #5  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,391
mpeg2dec3 does not perform any luma offset.

it's LumaFilter() which defaults to a -2 offset.

- Didée
__________________
- 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!)
Didée is offline   Reply With Quote
Old 18th June 2004, 14:26   #6  |  Link
Leak
ffdshow/AviSynth wrangler
 
Leak's Avatar
 
Join Date: Feb 2003
Location: Austria
Posts: 2,441
Re: picture too dark with avisynth script

Quote:
Originally posted by 91638
Hi,

i noticed that the picture ist too dark when i use avysinth as frameserver. No matter what Version of Avisynth i use, always the same problem. If i open the *.d2v file in TMPG the picture is O.K.
Does anybody know a solution for this problem. I used the search in this forum but found no thread helping me.
What do you do with your AviSynth files? Open them in a media player?

If so, maybe the media player uses the graphics card's video overlay while TMP doesn't - since you should be able to control contrast, brightness, saturation, gamma and hue of the overlay independently from the desktop settings, that might explain the difference...

Which graphics card do you have? Which OS? What other software do you use?

np: The Orb - Orb Is (Shopping Version) (Bicycles & Tricycles)
Leak is offline   Reply With Quote
Old 18th June 2004, 14:38   #7  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
If you feed your avs script to TMPGEnc (I guess you do that, but that's not entirely clear from your post), you should end with

ConvertToRGB24()

I think that will solve it. As for the cause of this. Could you open the script

LoadPlugin("D:\Videobearbeitung\AviSynth 2.5\plugins\MPEG2DEC3dg.dll")
Mpeg2Source("G:\chucky.d2v")
ConvertToYUY2()

in VDub, and tell us which decoder is used (under file -> file information)?
Wilbert is offline   Reply With Quote
Old 18th June 2004, 19:38   #8  |  Link
91638
Registered User
 
Join Date: Jul 2002
Location: Germany
Posts: 42
i feed the script in vdub and recognized the darker picture in comparison to open the vobs in DVD2AVI or the created d2v file in TMPG.

I only opened the d2v file in TMPG to check if the problem is caused by DVD2AVI, but the result shows that the error appears in Avisynth.

In VirtualDub the used decoder is YUV 4:2:2 (YUY2).

Maybe this helps you for a hint to solve the problem. Thanks a lot.
91638 is offline   Reply With Quote
Old 18th June 2004, 21:16   #9  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
The error is not in AviSynth, the problem is the luma range when converting YUV to RGB (in VDub or TMPGEnc).

Try

LoadPlugin("D:\Videobearbeitung\AviSynth 2.5\plugins\MPEG2DEC3dg.dll")
Mpeg2Source("G:\chucky.d2v")
ConvertToRGB()

and open it in VDub. Do you still have that problem?
Wilbert is offline   Reply With Quote
Old 19th June 2004, 01:07   #10  |  Link
jorel
Guest
 
Posts: n/a
Quote:
Originally posted by 91638
I used the following script just to if the problem occurs in Avisynth. For this reason i did not
use any filters. Source Material is from DVD.

LoadPlugin("D:\Videobearbeitung\AviSynth 2.5\plugins\MPEG2DEC3dg.dll")

Mpeg2Source("G:\chucky.d2v")

ConvertToYUY2()

To solve the problem i inserted the following line

Levels(0,1.18,255,0,255,false)

the colors seems to be correct now, but i do not know if this is the best way.

Thanks for your help.
i agree,the same here. a few months ago,gerti67 post here great explanations about levels and send me this link with pictures to do comparisons : http://free.pages.at/gerti67/pictures/tweak-levels.jpg
and i did that *thread with his link and Wilbert post his great impressions and observations cos i was getting the same problems like 91638 posted and without use ConvertToYUY2() or ConvertToRGB() in the script. i always get dark scenes using avisynth comparing with the dvd source. this thread here will give me great clarifications about this problems cos i always post about it but don't knew that avisynth give this "darkness" in the scenes(if is avisynth the reason)
before all my encodes (always from dvds) i test the script with levels to get the seamless brightness as the source using from 1.02 to 1.2 in gamma adjusts. last week i did "chicken run" and i'm doing again cos is too dark in tv using gamma 1.03!

edited> forgive me,
i forgot to post the thread with Wilbert clarifications:
http://kvcd.net/forum/viewtopic.php?...ghlight=levels
  Reply With Quote
Old 19th June 2004, 03:11   #11  |  Link
jorel
Guest
 
Posts: n/a
screenshots for comparisons.

from vob in vdubmpeg2: http://img37.imageshack.us/img37/6026/vob.jpg

from avisynth script(using dvd2avi project) in vdubmpeg2: http://img37.imageshack.us/img37/541...ynthscript.jpg
  Reply With Quote
Old 19th June 2004, 06:30   #12  |  Link
91638
Registered User
 
Join Date: Jul 2002
Location: Germany
Posts: 42
Thanks jorel. That is exactly the problem i tried to describe. I will read the threads and hope that i will see clear after that.

@ Wilbert

there is no difference between ConvertToYUY2() and ConvertToRGB().

@all

To make the difference visible i've uploaded the following three pictures

Picture in DVD2AVI

http://img31.imageshack.us/my.php?lo...e=dvd2avi2.jpg

or

http://de.geocities.com/saufkopp2001/dvd2avi2.jpg
("Right-click" and "Save target as..." )


Picture in VirtualDub with the AVS-Script

LoadPlugin("D:\Videobearbeitung\AviSynth 2.5\plugins\MPEG2DEC3dg.dll")
Mpeg2Source("G:\chucky.d2v")
ConvertToYUY2()

http://img31.imageshack.us/my.php?lo...=avisynth0.jpg

or

http://de.geocities.com/saufkopp2001/avisynth0.jpg
("Right-click" and "Save target as..." )


Picture in VirtualDub with the script from above and

Tweak(0 , 0.87 , 10.0 , 1.0)

http://img31.imageshack.us/my.php?lo...age=tweak2.jpg

or


http://de.geocities.com/saufkopp2001/tweak2.jpg
("Right-click" and "Save target as..." )

Last edited by 91638; 19th June 2004 at 15:02.
91638 is offline   Reply With Quote
Old 19th June 2004, 07:49   #13  |  Link
jorel
Guest
 
Posts: n/a
i can't see the pictures posted (geocities problems-Diese Seite ist nicht verfügbar),try "host" your pictures here(thanks DDogg): http://www.imageshack.us/
  Reply With Quote
Old 19th June 2004, 09:42   #14  |  Link
91638
Registered User
 
Join Date: Jul 2002
Location: Germany
Posts: 42
Try "Right-click" and "Save target as..." and have a look at them.

Also posted the images at ImagShack. Links in the thread above.

Last edited by 91638; 19th June 2004 at 09:49.
91638 is offline   Reply With Quote
Old 20th June 2004, 23:37   #15  |  Link
baz00ie
Registered User
 
Join Date: Dec 2001
Posts: 36
Hello 91638,

I haven't seen much disscussion on this topic, but i know that it can be an issue. Here are some AviSynth settings that i've found to be effective when dealing with a "too dark" image from a DVD

Levels(0,1.22,255,8,255)

... and if you think the colours seem a little too thin you might try boosting the saturation a bit as well...

Tweak(hue=0.0,sat=1.2,bright=0.0,cont=1.0)

good luck
baz
baz00ie is offline   Reply With Quote
Old 21st June 2004, 11:33   #16  |  Link
91638
Registered User
 
Join Date: Jul 2002
Location: Germany
Posts: 42
Thanks for your hints baz00ie. I will test your settings.
91638 is offline   Reply With Quote
Old 21st June 2004, 11:59   #17  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
I would like to see the same screenshot (in VDub) for the following script

LoadPlugin("D:\Videobearbeitung\AviSynth 2.5\plugins\MPEG2DEC3dg.dll")
Mpeg2Source("G:\chucky.d2v")
ConvertToRGB()
Wilbert is offline   Reply With Quote
Old 21st June 2004, 14:03   #18  |  Link
91638
Registered User
 
Join Date: Jul 2002
Location: Germany
Posts: 42
Picture with the following script:

LoadPlugin("D:\Videobearbeitung\AviSynth 2.5\plugins\MPEG2DEC3dg.dll")
Mpeg2Source("G:\chucky.d2v")
ConvertToRGB()

http://img32.imageshack.us/my.php?lo...age=chucky.jpg

Maybe you have an idea Wilbert.
91638 is offline   Reply With Quote
Old 21st June 2004, 14:11   #19  |  Link
trevlac
budala
 
Join Date: Oct 2003
Location: U.S.
Posts: 545
@91638

Your black level in the avs jpg is set to 0 while in the d2v jpg, it is set to 16. It of course should be 16. The white level is the same in both.

You should not muck with the gamma, the hue, the sat ...

To move the black level up and keep the same white level do:

Tweak(bright=14, cont=.89)

This is what I see when I measure the samples with a histogram. BTW, I would not use levels. It will also change the saturation. The theoretical fix is Tweak(bright=16, cont=.93). So the 'right' answer maybe somewhere in between, seeing that I had to convert a bit to get a working sample.

It seems to me that Wilbert is on the right track. The difference could be due to how MPEG2DEC3dg serves RGB data vs YUV data. It could also be due to how YUV data (which is what comes out of avs) gets converted to RGB on your machine. RGB is what you see in vdub and TMPGEnc, btw. Wilbert is trying to determin the latter.


[edit]

Now with your ConvertToRGB I would say look at MPEG2DEC3dg. It must output YUV to Avisynth and RGB to VDub/TMPGEnc. I'm not sure how to get it to output RGB to Avisynth. Can't say I know much about it, so do don't take my word on it.

Last edited by trevlac; 21st June 2004 at 14:22.
trevlac is offline   Reply With Quote
Old 21st June 2004, 14:36   #20  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
Quote:
Your black level in the avs jpg is set to 0 while in the d2v jpg, it is set to 16.
So that means that MPEG2DEC3dg.outputs [0,255] (well, at least in this case)? How can this be?

@91638,

Could you upload 10 (dark) frames of the vob somewhere (cutting it with vobedit)?

If that's not possible, could you make the same screenshots with mpeg2dec3 (v1.10) and dvd2avi (v1.76)?
Wilbert is offline   Reply With Quote
Reply


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


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