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 1st August 2009, 20:25   #1  |  Link
Avisynth_challenged
Registered User
 
Join Date: Dec 2007
Posts: 117
Need advice on BT.709 to BT.601 conversion

Hi all,

I'm converting a 1080i HD .ts file into a 480p SD DVD. I just learned that the conversion from HD to SD requires a colorimetry conversion from BT.709 to BT.601.

So I need to revise my script. Where in the following script should I do the colorimetry conversion?


############
############
# These lines call the scripts required for IVTC
Import("C:\program files\avisynth 2.5\plugins\jdl_util.avs")
Import("C:\program files\avisynth 2.5\plugins\jdl_telecine.avs")

LoadPlugin("C:\program files\avisynth 2.5\plugins\DGDecode.dll")
LoadPlugin("C:\program files\avisynth 2.5\plugins\deblock.dll")
############

# This line loads the MPEG source
MPEG2Source("mpeg2source.d2v")
############

# IVTC Section:
# If source has perfect 3:2 pulldown pattern, choose JDL_IVTCPattern
# Otherwise, choose telecide().decimate()
# Use only one, comment out the other!

JDL_IVTCPattern(2, false) #3:2 pulldown removal for this clip
#telecide().decimate()
############

# This line removes macroblocking
deblock(35,0,0)
############

# This line converts from MPEG2 YV12 to YUY2
converttoyuy2()
############

spline36resize(720,480)
############

sharpen(0.20)
############
############


If you see anything else that's wrong in the above, please let me know about it as well. Thanks
Avisynth_challenged is offline   Reply With Quote
Old 1st August 2009, 20:44   #2  |  Link
TheRyuu
warpsharpened
 
Join Date: Feb 2007
Posts: 787
You can either put it post source with interlaced=true or post telecide with interlaced=false (I put it post telecide).

People have claimed that there are issues (artifacts?) with interlaced=true, I've never had a problem with it though.

Also, lets stop using telecide().decimate()
Lets enter the 21st century with TIVTC.

Edit:
Or you could just do nothing and flag it in the encoder.
TheRyuu is offline   Reply With Quote
Old 2nd August 2009, 05:06   #3  |  Link
manono
Moderator
 
Join Date: Oct 2001
Location: Hawaii
Posts: 7,360
Quote:
Originally Posted by TheRyuu View Post
Also, lets stop using telecide().decimate()
Lets enter the 21st century with TIVTC
I find that remark insulting to the developer of Decomb and many other great filters and applications, without whose work we would be virtually hamstrung in our video encoding hobby. I could be wrong about this, but I believe Decomb to be the most commonly used AviSynth IVTC, as it's used in so many popular all-in-one programs. It's also well known that many of the ideas used in TIVTC were first developed for Decomb.

Use what you like, but if I were you I wouldn't be throwing around gratuitous insults in a forum moderated by that same developer. Instead I think you should be thanking him for his work for the AviSynth-using community.

Last edited by manono; 2nd August 2009 at 05:08.
manono is offline   Reply With Quote
Old 5th August 2009, 04:45   #4  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
any reason you're finishing in yuy2? you could probably dick that line.

as far as neatness and "flow" are concerned, i'd want to put the colorimetry change just after the resize to SD land. reason is just because it should be considered part of a HD to SD downconvert, and placing it immediately after the resize rather than before it just means it's processing less pixels and giving you a little more speed.

@ manono: hear, hear. a majority of the time decomb and TIVTC give identical results. it's only when video is wacky that there's any difference, and even then it's more down to user preference than technical advancement to determine what to choose.

writing an IVTC procedure is exceedingly difficult, too. there's always many exceptions to any assumptions you can make about 3:2 patterns. my solution is to work with PAL as much as possible, and it's a very good solution . having access to telecine and digital intermediate equipment helps a lot too
__________________
sucking the life out of your videos since 2004
Mug Funky is offline   Reply With Quote
Old 5th August 2009, 05:33   #5  |  Link
thewebchat
Advanced Blogging
 
Join Date: May 2009
Posts: 483
Or you could stop being in the 20th century and only work with progressive material. Every time I see an interlaced DVD, I just put it into the rubbish.
thewebchat is offline   Reply With Quote
Old 5th August 2009, 07:41   #6  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
@ thewebchat:

omg, you best be trollin'

please bear in mind this thread is actually about converting between 709 and 601 colourspaces.

that's gonna work well for you:
"why are you returning this DVD? does it not work?"
"no, it works perfectly. it's just that... you know... it's... interlaced..."
*blank stare from shop assistant*

[edit]
i love how some people around here talk as if they invented moving pictures, and someone came along and just perverted it by adding interlace. why do people take it personally or even religiously that interlace is evil just because their computer screen can't deal with it properly? i wonder if people never ever saw the combing effect on a progressive screen, would they even care that the picture is in fact 2 pulses of half the lines rather than 1 pulse with all the lines?
__________________
sucking the life out of your videos since 2004

Last edited by Mug Funky; 5th August 2009 at 07:46.
Mug Funky is offline   Reply With Quote
Old 5th August 2009, 07:50   #7  |  Link
Blue_MiSfit
Derek Prestegard IRL
 
Blue_MiSfit's Avatar
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 5,760
I'd convert the colorimetry after IVTC (right?). I'd use use something like this:

Code:
MPEG2Source("movie.d2v")

# IVTC Section:
# If source has perfect 3:2 pulldown pattern, choose JDL_IVTCPattern
# Otherwise, choose telecide().decimate()
# Use only one, comment out the other!

JDL_IVTCPattern(2, false) #3:2 pulldown removal for this clip
#telecide().decimate()
#Your method should work fine.. I personally prefer TFM.TDecimate, but that's just me!

Deblock(35,0,0)
#I'd probably use something like DeblockQED() for this.
#It's definitely source dependent!

ColorMatrix(mode="Rec.709->Rec.601") 
#This should do the trick...

ConvertToYUY2()
#YU2 for CCE? Otherwise, avoid.

spline36resize(720,480)

# sharpen(0.20)
# I'd say this is a little harsh, especially when downsizing.
# Also, recall that if you're targeting a CRT SDTV, you should almost blur vertically!
Blue_MiSfit is offline   Reply With Quote
Old 5th August 2009, 07:55   #8  |  Link
Blue_MiSfit
Derek Prestegard IRL
 
Blue_MiSfit's Avatar
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 5,760
Quote:
aren't all DVDs that aren't created from 30p interlaced?
Not necessarily. DVDs can come from almost any source. For example, I can output 23.976fps progressive video from Premiere CS4, and encode that using HC into 23.976fps MPEG-2, with "soft" pulldown enabled, to make it DVD compliant.

~MiSfit
Blue_MiSfit is offline   Reply With Quote
Old 5th August 2009, 08:04   #9  |  Link
shoopdabloop
Registered User
 
Join Date: Mar 2009
Posts: 166
oh, i thought dvds had to fit progressive content into 50/60i when burning.

Last edited by shoopdabloop; 5th August 2009 at 08:07.
shoopdabloop is offline   Reply With Quote
Old 5th August 2009, 09:04   #10  |  Link
Blue_MiSfit
Derek Prestegard IRL
 
Blue_MiSfit's Avatar
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 5,760
That's true. You still have to soft telecine a 24p stream to 50i or 60i when targeting DVD. However, this is trivial compared to hard telecine.

~MiSfit
Blue_MiSfit is offline   Reply With Quote
Old 5th August 2009, 14:27   #11  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 1,098
Quote:
Originally Posted by Mug Funky View Post
i love how some people around here talk as if they invented moving pictures, and someone came along and just perverted it by adding interlace. why do people take it personally or even religiously that interlace is evil just because their computer screen can't deal with it properly? i wonder if people never ever saw the combing effect on a progressive screen, would they even care that the picture is in fact 2 pulses of half the lines rather than 1 pulse with all the lines?
are you denying that an interlaced stream effectively has half the resolution of a non-interlaced one if there is any motion at all?
TheFluff is offline   Reply With Quote
Old 5th August 2009, 14:29   #12  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,922
Please get back on topic and not start a war about interlacing.
Guest is offline   Reply With Quote
Old 5th August 2009, 14:42   #13  |  Link
Revgen
Registered User
 
Join Date: Sep 2004
Location: Near LA, California, USA
Posts: 1,545
I always add it at the end. I'd rather my filters work with the original colors first. But either at the beginning or the end is fine. Just be sure that if your material is interlaced that the colorimetry filter always has interlaced=true if you are loading the colorimetry filter at the beginning. If you've deinterlaced your material than putting the colorimetry filter at the end doesn't require you specify anything about interlacing.

Beginning if interlaced:

Code:
Colormatrix( sourcecolorimetry->changedcolorimetry, interlaced=true)
End if deinterlaced or IVTC'd:

Code:
Colormatrix(sourcecolorimetry->changedcolorimetry)
__________________
Pirate: Now how would you like to die? Would you like to have your head chopped off or be burned at the stake?

Curly: Burned at the stake!

Moe: Why?

Curly: A hot steak is always better than a cold chop.

Last edited by Revgen; 5th August 2009 at 14:50.
Revgen 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 10:19.


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