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 Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 23rd July 2005, 14:46   #1  |  Link
scharfis_brain
brainless
 
scharfis_brain's Avatar
 
Join Date: Mar 2003
Location: Germany
Posts: 3,642
@mantis2k:
I suggest this script for a Pulldown Conversion from PAL to NTSC:
Code:
loadplugin("D:\x\dgdecode.dll")
loadplugin("D:\x\decomb.dll")

mpeg2source("man.d2v")

# crop away black borders
crop(0,72,0,-96) 

# match fields
telecide(order=1,guide=2,post=0)

#shift chroma and remove chroma flicker
mergechroma(crop(0,4,0,0).addborders(0,0,0,4).blur(0,1))

# convert image size to NTSC
converttoyuy2()
last.lanczosresize(last.width,round(last.height/1.2))
addborders(0,ceil((480-last.height)/2),0,floor((480-last.height)/2))
I think this is enough filtering.
__________________
Don't forget the 'c'!

Don't PM me for technical support, please.
scharfis_brain is offline   Reply With Quote
Old 23rd July 2005, 14:53   #2  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,922
@scharfi,

Isn't it better to do the color space up conversion in MPEG2Source (using upConv=true), where you can be sure you are doing the correct upsampling on the original encoded MPEG2 pictures? It's perhaps a small point, but worth noting.
Guest is offline   Reply With Quote
Old 23rd July 2005, 14:58   #3  |  Link
Carpo
Registered User
 
Carpo's Avatar
 
Join Date: Dec 2002
Location: /dev/null
Posts: 1,369
Quote:
Originally Posted by neuron2
If it's 3:2 pulled-down material, you can just do IVTC first and then do the traditional 4% speedup. What kind of material are you talking about?

bit of all sorts really animation mainstream films and the such - just wondered how it would be done so i could mess about and see if i could get the hang of it as there has been a few ntsc films my uncle has brought with him on visits fromt he states (he lives there now) that my standalone has an issue with - was wondering if converting it to pal might solve the issue
__________________
The Internet: where men are men, women are men, and children are FBI Agents
Carpo is offline   Reply With Quote
Old 23rd July 2005, 15:05   #4  |  Link
scharfis_brain
brainless
 
scharfis_brain's Avatar
 
Join Date: Mar 2003
Location: Germany
Posts: 3,642
since I am SURE, that I have a progressive image after telecide, I can upconvert it progressively after teleciding with a simple converttoyuy2().

also, I don't think, that relying on the frametype alone for upconversion is so good (but it is a starting point...).
I've seen several DVB-S streams where the image content was interlaced, but the image was coded progressively (motion probably was und a certain threshold).

In past I've done some motion adaptive YV12<->YUY2 conversions for hybrid video:
http://forum.doom9.org/showpost.php?...64&postcount=1

of course, for this video those routines will probably fail due te big imperfection.
__________________
Don't forget the 'c'!

Don't PM me for technical support, please.
scharfis_brain is offline   Reply With Quote
Old 23rd July 2005, 15:17   #5  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,922
The flags reliably state how the video was *encoded*. And that is how the upsampling should be done at the time an MPEG picture is decoded. Whether the *content* is actually progressive is irrelevant.

I think your idea that since you've decombed you can now treat it as if it was *encoded* progressively is a misconception. Think about that carefully, please.
Guest is offline   Reply With Quote
Old 23rd July 2005, 15:22   #6  |  Link
scharfis_brain
brainless
 
scharfis_brain's Avatar
 
Join Date: Mar 2003
Location: Germany
Posts: 3,642
An interlaced encoded progressive PAL-movie is better upsampled progressively.

interlaced downsampling of progressive frame contents can be
upsampled progressively without drawbacks.

Have I written drawback?
upsampling interlaced mpeg2 with progressive video in a progressive way enhances chroma quality!

one can do so, because the inventor of YUV 4:2:0 has wisely choosen the position of the sampling points.
They are the same for interlaced and progressive. Only their origin is different.
__________________
Don't forget the 'c'!

Don't PM me for technical support, please.
scharfis_brain is offline   Reply With Quote
Old 23rd July 2005, 15:26   #7  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,922
We'll have to agree to differ. I am giving the correct MPEG2 theory. You are giving unsupported claims.

It is not correct that the sampling points for interlaced and progressive encoding are the same.

I remind you that quality DVD players that avoid the chroma upsampling bug all follow the progressive flag and upsample per MPEG2 picture.

I will try to prepare a demonstration that illustrates the perils of not upsampling at picture decode time.
Guest is offline   Reply With Quote
Old 23rd July 2005, 15:43   #8  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,922
Quote:
Originally Posted by Carpo
bit of all sorts really animation mainstream films and the such - just wondered how it would be done so i could mess about and see if i could get the hang of it as there has been a few ntsc films my uncle has brought with him on visits fromt he states (he lives there now) that my standalone has an issue with - was wondering if converting it to pal might solve the issue
The method to use is going to depend on whether the material is 3:2 pulled down, video, or field-blended. You can show us a clip of one that you'd like to convert and we can advise you. But not in a thread about PAL --> NTSC. Please start a new thread.
Guest is offline   Reply With Quote
Old 23rd July 2005, 15:43   #9  |  Link
scharfis_brain
brainless
 
scharfis_brain's Avatar
 
Join Date: Mar 2003
Location: Germany
Posts: 3,642
how can I convince you?

EDIT: I have several interlaced encoded movies, that look MUCH better using progressive upsampling than interlaced upsampling.

also, I claim that motion adaptive upsampling of real interlaced content looks better than plain interlaced upsampling.

According the this page, the chroma sampling points are located in the SAME spatial position for interlaced and progressive YUV 4:2:0:
http://www.mir.com/DMG/chroma.html
__________________
Don't forget the 'c'!

Don't PM me for technical support, please.
scharfis_brain is offline   Reply With Quote
Old 23rd July 2005, 15:45   #10  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,922
Quote:
Originally Posted by scharfis_brain
how can I convince you?
Let's take it offline and then we'll come back to the thread with our conclusion. First, I'll prepare and send you a PM with my position. Please standby. It'll come this weekend, but not immediately as I've to go pick up some drugs for my dad and then I'm off to the pool.

I read your argument as that the method may not be fully correct per MPEG2, but it has useful side effects that may improve matters in some cases. I can accept that in principle, but I'd like to see a specific example if you can provide one. And I'll try to give a counter example. It may be yet another case where the nature of the content is the determining factor. But let's do it offline. Thanks for engaging in this with me. I always learn a lot from our interactions.
Guest is offline   Reply With Quote
Old 23rd July 2005, 15:56   #11  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,922
Quote:
Originally Posted by scharfis_brain
According to this page, the chroma sampling points are located in the SAME spatial position for interlaced and progressive YUV 4:2:0:
But they come from different fields in the original full resolution image that was sampled. So they need to be recreated in the same way. That's the whole point. But can we please take it offline as I suggested, because I think we may be having some terminology differences as well that will just confuse things for people. We can come back with a clear analysis. Is that OK?
Guest is offline   Reply With Quote
Old 23rd July 2005, 15:58   #12  |  Link
scharfis_brain
brainless
 
scharfis_brain's Avatar
 
Join Date: Mar 2003
Location: Germany
Posts: 3,642
Quote:
We can come back with a clear analysis. Is that OK?
This is fully okay.
I also have to leave now.

EDIT: could you split this thread in a way, that our chroma-discussion is located in a new thread?
__________________
Don't forget the 'c'!

Don't PM me for technical support, please.
scharfis_brain is offline   Reply With Quote
Old 23rd July 2005, 23:23   #13  |  Link
mantis2k
Registered User
 
Join Date: Nov 2002
Posts: 151
Quote:
You're showing your lack of knowledge again. The best players analyse the video to determine the appropriate mode of decombing to use. So they do "know about" the nature of the source video.
In that case, the deinterlacing software should also be able to analyse the source when converting to progressive. I shouldn't need to know anything specific about my DVD video.

Quote:
Like me, he hasn't the time to repeat existing explanations for every newbie that arrives wanting to be spoonfed.
I'm not asking for a big explanation. He could atleast say which software each script/function uses, to put them into context. He's just being lazy, and I doubt English is his native language either.

Quote:
Within the domain of this site and it's history, his comments are very well placed in context.
Not everyone who visits this site is a part of the board's history. Your comments are bordering on elitism.

Quote:
loadplugin("dgdecode.dll")
loadplugin("leakkerneldeint.dll")
MPEG2Source("kungfu.d2v",upConv=true)
leakkerneldeint(order=1,threshold=0)
You're getting ahead of yourself again, like Mr. Brain. Correct me if I'm wrong, but I assume you're biased towards AviSynth, which in turn uses TMPGEnc? Well, TMPGEnc is not the best MPEG encoder on the market, and downgraded my video last time I tried it, making it appear too bright. Anyway, I'm willing to give your scripts a try, so can you please tell me how to use them? If it's too much trouble, just give me a link to a guide/tutorial...

Quote:
@mantis: why are you capturing to lossy MPEG2?
I'm capturing to DVD, which in turn uses MPEG2 video streams.

Quote:
the video is blocky and totally smoothed.
That's because it's from a rare VHS tape, which is not original or the best of quality to start with.

Quote:
loadplugin("D:\x\dgdecode.dll")
loadplugin("D:\x\decomb.dll")

mpeg2source("man.d2v")

# crop away black borders
crop(0,72,0,-96)

# match fields
telecide(order=1,guide=2,post=0)

#shift chroma and remove chroma flicker
mergechroma(crop(0,4,0,0).addborders(0,0,0,4).blur(0,1))

# convert image size to NTSC
converttoyuy2()
last.lanczosresize(last.width,round(last.height/1.2))
addborders(0,ceil((480-last.height)/2),0,floor((480-last.height)/2))
Wow, I didn't realise you guys had the time of day to insert comments into your code!

Thanks for all your help so far! However, I don't wish to muck around with the boarders!? Surely, the picture would look the wrong aspect ratio when authored back to DVD?
mantis2k is offline   Reply With Quote
Old 24th July 2005, 01:33   #14  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,922
Quote:
Originally Posted by mantis2k
He's just being lazy...

You're getting ahead of yourself again, like Mr. Brain.

Wow, I didn't realise you guys had the time of day to insert comments into your code!
You've just crossed the line, mantis2k. We're trying to help you and you respond with insults. Please see forum rule 4. Thank you.
Guest is offline   Reply With Quote
Old 24th July 2005, 01:35   #15  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,922
Quote:
Originally Posted by scharfis_brain
could you split this thread in a way, that our chroma-discussion is located in a new thread?
I can't do it because I'm not a moderator on this forum. We can resume in the Avisynth development forum if you like.
Guest is offline   Reply With Quote
Old 24th July 2005, 01:52   #16  |  Link
mantis2k
Registered User
 
Join Date: Nov 2002
Posts: 151
Quote:
Originally Posted by neuron2
You've just crossed the line, mantis2k. We're trying to help you and you respond with insults. Please see forum rule 4. Thank you.
No need to feel insulted! Noticed the smily I used after my comment, indicating that I was joking being sarcastic... If I've violated a rule then you've also violated the same rule several times, by some of your comments towards me.
mantis2k is offline   Reply With Quote
Old 24th July 2005, 02:08   #17  |  Link
mantis2k
Registered User
 
Join Date: Nov 2002
Posts: 151
scharfis_brain (copied and pasted),

Do you personally feel insulted that I referred to you as Mr. Brain because I couldn't remember the first part of your nickname?
mantis2k is offline   Reply With Quote
Old 24th July 2005, 13:11   #18  |  Link
communist
Registered User
 
Join Date: Jul 2003
Posts: 1,157
Quote:
Originally Posted by mantis2k
I'm not asking for a big explanation. He could atleast say which software each script/function uses, to put them into context. He's just being lazy, and I doubt English is his native language either.
AviSynth + mentioned external plugins which can be found here:
www.avisynth.org
Also his explanations make totally sense to me and my native language isnt English either

Quote:
Originally Posted by mantis2k
You're getting ahead of yourself again, like Mr. Brain. Correct me if I'm wrong, but I assume you're biased towards AviSynth, which in turn uses TMPGEnc? Well, TMPGEnc is not the best MPEG encoder on the market, and downgraded my video last time I tried it, making it appear too bright. Anyway, I'm willing to give your scripts a try, so can you please tell me how to use them? If it's too much trouble, just give me a link to a guide/tutorial...
Yes you're wrong - AviSynth has nothing to do with TMPGEnc. TMPGEnc is an MPEG Encoder, AviSynth is a frameserver using a scripting language that can be easily learned. For an overview / manual how to use AviSynth have a look at the abovementioned link.

Quote:
Originally Posted by mantis2k
I'm capturing to DVD, which in turn uses MPEG2 video streams.

That's because it's from a rare VHS tape, which is not original or the best of quality to start with.
Capturing lossless or *almost* lossless would have saved you from the blocks introduced by the real time encoder used in your DVD recorder and would allow for some cleanup and improved picture that you could have encoded to MPEG (for DVD).


Quote:
Originally Posted by mantis2k
Thanks for all your help so far! However, I don't wish to muck around with the boarders!? Surely, the picture would look the wrong aspect ratio when authored back to DVD?
Hence they added the AddBorders command to AviSynth
communist is offline   Reply With Quote
Old 24th July 2005, 17:02   #19  |  Link
mg262
Clouded
 
mg262's Avatar
 
Join Date: Jul 2003
Location: Cambridge, UK
Posts: 1,148
Can I add to @communist's answer:

If you're working from VHS, please read the analogue capture guide; it tells you, among other things, that AVISynth is unrelated to any encoder, that capturing in MPEG is (to put it mildly) not the preferred method and, perhaps of more use to you at the moment, exactly how you should preserve the aspect ratio. I believe it also has an introduction to using AVISynth in it.

Out of curiosity, may I ask what you are capturing? (Preservation of old tapes -- mainly children's programmes! -- being my main interest.)

Grrr.. the speech recogniser posted this before I was finished again. I wanted to say one other thing, which is that in a limited medium like this, it can be very hard to read the tone of people's posts. So it is best to try and make sure that there is absolutely no way that your comments can be interpreted as being aggressive, sarcastic or critical unless that is really what you intend (and if that is really what you intend then you would be better off starting flame wars on USENET). Something to bear in mind is that, despite the fact that they have answered these questions literally hundreds of times, @scharfis_brain and @neuron2 still seem to take the time to keep answering them... so it is if nothing else more polite to say 'I'm sorry, I really didn't understand that, could you give me an idea of what terms to search for so I can' rather than that something 'makes no sense to the average person'.
__________________
a.k.a. Clouded. Come and help by making sure your favourite AVISynth filters and scripts are listed.
mg262 is offline   Reply With Quote
Old 26th July 2005, 15:24   #20  |  Link
scharfis_brain
brainless
 
scharfis_brain's Avatar
 
Join Date: Mar 2003
Location: Germany
Posts: 3,642
@neuron2: Did you've got some time to check my claims?
__________________
Don't forget the 'c'!

Don't PM me for technical support, please.
scharfis_brain 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:28.


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