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 11th January 2017, 18:05   #1  |  Link
johnny27depp
Registered User
 
Join Date: Dec 2016
Posts: 4
Encoding Rec.601 and Rec.709 footage

Hi there

I would like to combine Rec.601 and Rec.709 footage to be encoded at Rec.709 in HD using x264

I've used DGIndexNV to decode the HD footage and DGIndex to decode the SD footage.

I'm not sure if I am understanding Rec.601 and Rec.709 correctly. Is it a type of color encoding?

So once I have decoded the footage according to its coding (Rec.601/Rec.709) then if I try to encode it to HD using the x264 encoder then it will encode it at Rec.709, but is there anything I should add to my script for the DVD footage? Or does it not matter after decoding the footage?

By decoding the footage, I mean indexing with DGIndex:

DGSource("C:\BD.dgi")

Mpeg2Source("C:\DVD.d2v")

Please help, I'm a bit confused. A bit of clarity would go a long way.

Thanks
johnny27depp is offline   Reply With Quote
Old 11th January 2017, 18:38   #2  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 4,662
Something like:
Code:
a=DGSource("C:\BD.dgi")
b=Mpeg2Source("C:\DVD.d2v", info=3)

b=ColorMatrix(b, hints=true, dest=0)

b=Spline16Resize(a.Width, a.Height)

a++b
sneaker_ger is offline   Reply With Quote
Old 11th January 2017, 19:41   #3  |  Link
johnny27depp
Registered User
 
Join Date: Dec 2016
Posts: 4
Thanks for the response

What will happen if I do not apply ColorMatrix to the Rec.601 footage, will the encoder be unable to process it/crash?

Also if I want to match the color grading of the SD footage with that of the HD footage then which filter should I use?

Thanks
johnny27depp is offline   Reply With Quote
Old 11th January 2017, 20:07   #4  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 4,662
Quote:
Originally Posted by johnny27depp View Post
What will happen if I do not apply ColorMatrix to the Rec.601 footage, will the encoder be unable to process it/crash?
No, the encoder doesn't care. But colors will look wrong on playback.

Quote:
Originally Posted by johnny27depp View Post
Also if I want to match the color grading of the SD footage with that of the HD footage then which filter should I use?
That's what my example does.
sneaker_ger is offline   Reply With Quote
Old 11th January 2017, 20:35   #5  |  Link
johnny27depp
Registered User
 
Join Date: Dec 2016
Posts: 4
Quote:
Originally Posted by sneaker_ger View Post
That's what my example does.
Sorry I should've phrased it better. Yes the example puts them in the same color space, but the SD footage needs to actually be adjusted/tweaked to match the color grading of the HD footage. Like maybe some kind of autocorrecting filter that will compare and match the colors to the HD footage?
johnny27depp is offline   Reply With Quote
Old 11th January 2017, 21:10   #6  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 3,483
Quote:
Originally Posted by johnny27depp View Post
I'm not sure if I am understanding Rec.601 and Rec.709 correctly. Is it a type of color encoding?
They're formulas for converting YUV to RGB or RGB to YUV. They're not hugely different, but the colours might look a little "off" if the wrong colorimetry is used. It's most noticeable for "red" which can look a bit dark or a bit orange.
When encoding YUV it's normally just decoded & re-encoded as YUV so the colorimetry doesn't change and you don't have to think about it, except when upscaling or downscaling, as HD is generally converted to RGB on playback using rec.709 and for SD it's rec.601.

You can also use the colormatrix plugin to manually convert the colours like this if it's easier.
Downscaling:
ColorMatrix(mode="Rec.709->Rec.601", clamp=0)
Upscaling:
ColorMatrix(mode="Rec.601->Rec.709", clamp=0)

I don't know if there's any plugins for automatically adjusting the colours, but for doing it manually I find the Avisynth RGBAdjust function easiest.

ConvertToRGB()
RGBAdjust(1.0,1.0,1.0)
ConvertToYV12()

ColorYUV() and Tweak() can both adjust colours without the need to convert to RGB and back but I can't think in YUV.
hello_hello is offline   Reply With Quote
Old 11th January 2017, 21:50   #7  |  Link
johnny27depp
Registered User
 
Join Date: Dec 2016
Posts: 4
Thank you so much for that explanation

Quote:
Originally Posted by hello_hello View Post

I don't know if there's any plugins for automatically adjusting the colours, but for doing it manually I find the Avisynth RGBAdjust function easiest.

ConvertToRGB()
RGBAdjust(1.0,1.0,1.0)
ConvertToYV12()

ColorYUV() and Tweak() can both adjust colours without the need to convert to RGB and back but I can't think in YUV.
How would one know which aspect of the color to tweak - saturation, temperature, exposure etc. if doing it manually? Is there no plugin to detect these differences? Or one that can be guided while previewing the footage?
johnny27depp is offline   Reply With Quote
Old 11th January 2017, 23:15   #8  |  Link
davidhorman
I'm the Doctor
 
Join Date: Jan 2004
Posts: 1,331
Is it the same footage? As in, you have an HD version and an SD version of the same content, but you want to replace some parts of the HD with SD?
__________________
My AviSynth filters / I'm the Doctor
davidhorman is offline   Reply With Quote
Reply

Tags
avisynth, colorimetry, rec.601, rec.709, x264

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 23:09.


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