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 > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 19th December 2008, 10:23   #1  |  Link
juGGaKNot
Registered User
 
juGGaKNot's Avatar
 
Join Date: Feb 2008
Posts: 733
Full range tutorial

This thread is a reply to Color variations between source and x264 output in QuickTime Player and others 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 :



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 :



Start/ffdshow/video encoder configuration :



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

I use default setting :



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 :



Start/ffdshow/video encoder configuration :



Waiting for your input, thnx!

Last edited by juGGaKNot; 19th December 2008 at 10:28.
juGGaKNot is offline   Reply With Quote
Old 19th December 2008, 11:12   #2  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 5,279
Quote:
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

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

Quote:
does this also force high quality RGB to YV12 conversion ? ( in the encoder, in this case megui )
No.
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 19th December 2008, 11:36   #3  |  Link
juGGaKNot
Registered User
 
juGGaKNot's Avatar
 
Join Date: Feb 2008
Posts: 733
Quote:
Originally Posted by Selur View Post
depends on the input,... see: http://avisynth.org/mediawiki/Convert
input is always RGB32 uncompressed of huffyuv, i will read now thnx!

Quote:
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.
juGGaKNot is offline   Reply With Quote
Old 19th December 2008, 11:59   #4  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 5,279
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".
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 19th December 2008, 12:28   #5  |  Link
juGGaKNot
Registered User
 
juGGaKNot's Avatar
 
Join Date: Feb 2008
Posts: 733
Quote:
Originally Posted by Selur View Post
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.

Quote:
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 :

Quote:
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 :



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 :



Start/ffdshow/video encoder configuration :



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

I use default setting :



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 ?
juGGaKNot is offline   Reply With Quote
Old 19th December 2008, 13:45   #6  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 5,279
Quote:
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.

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

---
Quote:
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
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 19th December 2008, 14:07   #7  |  Link
juGGaKNot
Registered User
 
juGGaKNot's Avatar
 
Join Date: Feb 2008
Posts: 733
Quote:
Originally Posted by Selur View Post
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 )

Quote:
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 )

Quote:
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 ?

Quote:
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

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

Quote:
reconstruct it during decoding (Yv12->RGB) is connected to the whole process.
so high quality Yv12->RGB box should be checked for decoder ?

thnx.

Last edited by juGGaKNot; 19th December 2008 at 14:18.
juGGaKNot is offline   Reply With Quote
Old 19th December 2008, 14:34   #8  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 5,279
Quote:
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,....

Quote:
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

Quote:
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
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 19th December 2008, 14:58   #9  |  Link
juGGaKNot
Registered User
 
juGGaKNot's Avatar
 
Join Date: Feb 2008
Posts: 733
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.

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

Quote:
Originally Posted by Selur View Post
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 ?
juGGaKNot is offline   Reply With Quote
Old 19th December 2008, 15:03   #10  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 5,279
Quote:
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

Quote:
it should be

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

Quote:
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
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 19th December 2008, 15:06   #11  |  Link
juGGaKNot
Registered User
 
juGGaKNot's Avatar
 
Join Date: Feb 2008
Posts: 733
k, i will come back in 12 hours with some samples

thnx!.

btw any app to check color space and range at any time ?
juGGaKNot 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 05:40.


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