Log in

View Full Version : Full range tutorial


juGGaKNot
19th December 2008, 10:23
This thread is a reply to Color variations between source and x264 output in QuickTime Player and others (http://forum.doom9.org/showthread.php?t=143189) thread.

I use FULL RANGE ALL the time so i want to make a small tutorial for other moviemakers ( that use game footage )

From what i read the

1'st Step would be changing the color range from the GFX card driver To :

http://i286.photobucket.com/albums/ll105/juGGaKNot4cs/range1.jpg (http://i286.photobucket.com/albums/ll105/juGGaKNot4cs/range1.jpg)

so all footage captured with FRAPS or other programs will be [0,255]

2'nd Step : Setting BT.601 ( to keep original colors ) and FULL range from ffdshow :

Start/ffdshow/video decoder configuration :

http://i286.photobucket.com/albums/ll105/juGGaKNot4cs/range3.jpg (http://i286.photobucket.com/albums/ll105/juGGaKNot4cs/range3.jpg)

Start/ffdshow/video encoder configuration :

http://i286.photobucket.com/albums/ll105/juGGaKNot4cs/range4.jpg (http://i286.photobucket.com/albums/ll105/juGGaKNot4cs/range4.jpg)

3'rd Step : Record and make the uncompressed or huffyuv AVI with vdub

I use default setting :

http://i286.photobucket.com/albums/ll105/juGGaKNot4cs/range7.jpg (http://i286.photobucket.com/albums/ll105/juGGaKNot4cs/range7.jpg)

The AVI will be [0,255], it will be worked on in a NLE program and rendered again with the final FPS

4'th Step : Change the AVS script like so :

ConvertToYV12(clip, matrix="PC.601") ( don't understand the syntax here, is "ConvertToYV12(d:/movie.avi, matrix="PC.601")" good ? )

and NOT

ConvertToYV12()


The result : the encoded mpeg-4 file will be FULL RANGE as the original and it will have same colors


WHAT I DO NOT UNDERSTAND :

why set high quality YV12 to RGB conversion in ffdshow ?

does this also force high quality RGB to YV12 conversion ? ( in the encoder, in this case megui )

Start/ffdshow/video decoder configuration :

http://i286.photobucket.com/albums/ll105/juGGaKNot4cs/range5.jpg (http://i286.photobucket.com/albums/ll105/juGGaKNot4cs/range5.jpg)

Start/ffdshow/video encoder configuration :

http://i286.photobucket.com/albums/ll105/juGGaKNot4cs/range6.jpg (http://i286.photobucket.com/albums/ll105/juGGaKNot4cs/range6.jpg)

Waiting for your input, thnx!

Selur
19th December 2008, 11:12
don't understand the syntax here, is "ConvertToYV12(d:/movie.avi, matrix="PC.601")" good ?
depends on the input,... see: http://avisynth.org/mediawiki/Convert

why set high quality YV12 to RGB conversion in ffdshow ?
to make sure one get's a high quality conversion from yv12 to RGB if the graphic card yo use does not support yv12 output.

does this also force high quality RGB to YV12 conversion ? ( in the encoder, in this case megui )
No.

juGGaKNot
19th December 2008, 11:36
depends on the input,... see: http://avisynth.org/mediawiki/Convert

input is always RGB32 uncompressed of huffyuv, i will read now thnx!

to make sure one get's a high quality conversion from yv12 to RGB if the graphic card yo use does not support yv12 output.

don't understand, gfx card output is YV12 that gets converted to RGB or what ?

if i get RGB from the gfx card that i will convert to YV12 for final render than why use

"high quality YV12 to RGB conversion in ffdshow" ?

i never convert to RGB from YV12.

thnx for the reply.

Selur
19th December 2008, 11:59
Since you posted in the h.264 section I assume you use a h.264 codec and decode it with ffdshow, since afaik all h.264 encoders that are normally used only use Yv12 internally and a lot of graphic cards output RGB there needs to be a conversion somewhere from Yv12 to RGB.

If you like you stated "get RGB from the gfx card that i will convert to YV12" this has nothing to do with the "high quality YV12 to RGB conversion in ffdshow".

juGGaKNot
19th December 2008, 12:28
Since you posted in the h.264

I made it here because original thread was here, admin please move to newbies if it is in the wrong place.

If you like you stated "get RGB from the gfx card that i will convert to YV12" this has nothing to do with the "high quality YV12 to RGB conversion in ffdshow".

k, so it is useless for what i want ( uncompressed RGB to h.264 full range )

is the "tutorial" good in this form :

I use FULL RANGE ALL the time so i want to make a small tutorial for other moviemakers ( that use game footage )

From what i read the

1'st Step would be changing the color range from the GFX card driver To :

http://i286.photobucket.com/albums/ll105/juGGaKNot4cs/range1.jpg (http://i286.photobucket.com/albums/ll105/juGGaKNot4cs/range1.jpg)

so all footage captured with FRAPS or other programs will be [0,255]

2'nd Step : Setting BT.601 ( to keep original colors ) and FULL range from ffdshow :

Start/ffdshow/video decoder configuration :

http://i286.photobucket.com/albums/ll105/juGGaKNot4cs/range3.jpg (http://i286.photobucket.com/albums/ll105/juGGaKNot4cs/range3.jpg)

Start/ffdshow/video encoder configuration :

http://i286.photobucket.com/albums/ll105/juGGaKNot4cs/range4.jpg (http://i286.photobucket.com/albums/ll105/juGGaKNot4cs/range4.jpg)

3'rd Step : Record and make the uncompressed or huffyuv AVI with vdub

I use default setting :

http://i286.photobucket.com/albums/ll105/juGGaKNot4cs/range7.jpg (http://i286.photobucket.com/albums/ll105/juGGaKNot4cs/range7.jpg)

The AVI will be [0,255], it will be worked on in a NLE program and rendered again with the final FPS

4'th Step : Change the AVS script like so :

ConvertToYV12(clip, matrix="PC.601") ( don't understand the syntax here, is "ConvertToYV12(d:/movie.avi, matrix="PC.601")" good ? )

and NOT

ConvertToYV12()


The result : the encoded mpeg-4 file will be FULL RANGE as the original and it will have same colors

do i have to set ffdshow encoder only or decoder to ?

Selur
19th December 2008, 13:45
so it is useless for what i want ( uncompressed RGB to h.264 full range )
Yes, "high quality YV12 to RGB conversion in ffdshow" has nothing to do with RGB -> h.264.

is the "tutorial" good in this form :
Not really. i see no real reason for processing the captured material in Virtual Dub at all. (Step 3)
Also one has to be aware of the fact that you will lose color information when converting to Yv12.
So if one really wanted to preserve all color information you would need a codec that supports 4:4:4 color space.

Not sure if the fraps even uses a codec for capturing which supports this, but that can probably be answered by someone who uses fraps. :)

---
do i have to set ffdshow encoder only or decoder to ?
since you didn't write down where you want to use ffdshow I can't answer that. :)

Personally I would suspect, that if you
1. use your step number one
2. capture your material with a lossless codec supporting RGB/4:4:4
and then open the material with a suited decoder in an NLE program of your choosing would have tv scale input without any information loss.
3. when editing you material in you NLE program and then saving it you again would have to make sure you don't change color space and range to not lose anything.
4. assuming you then would reencode the material to h.264 with a encoder that also supports RGB/4:4:4 you would keep the original color.

The general idea behind losing some color information RGB->Yv12 and try to reconstruct it during decoding (Yv12->RGB) is connected to the whole process. :)

Cu Selur

juGGaKNot
19th December 2008, 14:07
Not really. i see no real reason for processing the captured material in Virtual Dub at all. (Step 3)

full story :

i capture with "startmovie"

i get 200 pictures a second, have to use vdub to make the AVI file ( all default, just change the FPS )

Also one has to be aware of the fact that you will lose color information when converting to Yv12

i know, that is why i want full range to begin with ( less loss )

+ i do not convert manually, i just open the uncompressed avi in ripbot ( i encode with ripbot ) and it does it via .avs

so :

-pictures from games
-uncompressed AVI vdub
-uncompressed render from NLE
-h264 render with ripbot ( converttoYV12 here )

So if one really wanted to preserve all color information you would need a codec that supports 4:4:4 color space.

like what codec ?

since you didn't write down where you want to use ffdshow I can't answer that. :)

the ffdshow part would be for encoding the AVI to h.264

i was thinking that if source is [0,255] and BT.601 and ffdshow setting is [16-235] and BT.709 the output would not be the same as the source

3. when editing you material in you NLE program and then saving it you again would have to make sure you don't change color space and range to not lose anything.

The NLE render is just uncompressed. same as vdub.

reconstruct it during decoding (Yv12->RGB) is connected to the whole process. :)

so high quality Yv12->RGB box should be checked for decoder ?

thnx.

Selur
19th December 2008, 14:34
do i have to set ffdshow encoder only or decoder to ?
if you encode with ffdshow then the encoder if you use it only for decoding configure the decoder,....

the ffdshow part would be for encoding the AVI to h.264

i was thinking that if source is [0,255] and BT.601 and ffdshow setting is [16-235] and BT.709 the output would not be the same as the source
if you use AviSource to open the .avi file that assumtion is correct :)

so high quality Yv12->RGB box should be checked for decoder ?
If you input is yv12 and you need RGB as output yes. :)

Cu Selur

juGGaKNot
19th December 2008, 14:58
now that i set the ffdshow decoder and the gfx card to full range the same video that i noticed the problem on has good colours

( before i could see that the border is "more" black )

weird because the GFX card had TV range when i recorded the pictures.

If you input is yv12 and you need RGB as output yes. :)

kmplayer says input YV12, output YV12

input is YV12 for sure, i will set the decodor to HQ RGB.

if you use AviSource to open the .avi file that assumtion is correct :)

ripbot uses OpenDMLSource

OpenDMLSource("D:\1.avi",audio=false).ConvertToYV12()

and this is TV range right ?

it should be

OpenDMLSource("D:\1.avi",audio=false).ConvertToYV12("D:\1.avi", matrix="PC.601") for FULL range

SO :

-I set the GFX card to full range
-I set the decoder and encoder ( ffdshow decodes avi and is needed for ripbot so i think i setting encoder also is needed ) to full range and BT.601
-I record and render ( adding matrix="PC.601" for full range )

is the way to go ?

Selur
19th December 2008, 15:03
kmplayer says input YV12, output YV12

input is YV12 for sure, i will set the decodor to HQ RGB.
kmplayer does not use directshow filters and as such does not use ffdshow :)

it should be

OpenDMLSource("D:\1.avi",audio=false).ConvertToYV12("D:\1.avi", matrix="PC.601") for FULL range
yes

so i think i setting encoder also is needed
No, afaik ripbot264 does not use ffdshow for encoding but a x264 binary, so configuring ffdshow in vfw should be enough when using avi as input (and not using DirectShowSource),

Cu Selur

juGGaKNot
19th December 2008, 15:06
k, i will come back in 12 hours with some samples

thnx!.

btw any app to check color space and range at any time ?