digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Avisynth Scripting (http://www.digitalfaq.com/archives/avisynth/)
-   -   Avisynth with PAL analogue source? (http://www.digitalfaq.com/archives/avisynth/13254-avisynth-pal-analogue.html)

zafh 01-26-2005 09:56 AM

Avisynth with PAL analogue source?
 
I am currently capturing a PAL analogue source on my hard drive recorder, then burning it to DVD.

I rip the DVD on my pc and run it through the KDVD templates for CCE by Vmesquita.

I have been playing around with various scripts today but to be honest I really don't know what I am doing.

I have chopped together bits from various people scripts and managed to get about a 22% reduction in file size.

I started with this:



Quote:

LoadPlugin("C:\PROGRA~1\AutoGK\DGMPGDec\DGDecode.d ll")
################################################## ################
# Using Kwag’s Motion Adaptive Filtering to get more compression #
################################################## ################
##############
# Parameters #
##############
movie="rawpt1.d2v"
sound="rawpt1 MPA T01 DELAY 0ms.mpa"
video=MPEG2Source(movie)++mpeg2source("rawpt2.d2v" )++mpeg2source("rawpt3.d2v")
audio = DirectShowSource(sound)++directshowsource("rawpt2 MPA T01 DELAY 0ms.mpa")++directshowsource("rawpt3 MPA T01 DELAY -120ms.mpa")
audiodub(video,audio)
#copy trim from video avs
trim(2957,15016)++trim(19576,32250 )++trim(41774,60609)++trim(66092,74146)++trim(7871 3,82517)++trim(85075,85874)++trim(91103,93086)
++trim(93252,104043)++trim(110133,124310)++trim(13 7267,147385)+trim(152919,157485)+trim(161495,16396 6)
+trim(169857,180627)+trim(185184,199940)
SelectRangeEvery(1200, 12)
This gave me a 29.5 Mb file.

Currently I am doing this:

Quote:

LoadPlugin("C:\PROGRA~1\AutoGK\DGMPGDec\DGDecode.d ll")
################################################## ################
# Using Kwag’s Motion Adaptive Filtering to get more compression #
################################################## ################
##############
# Parameters #
##############
myanamorphic=false # change to false if on step 6 you had 4:3 instead of 16:9
#Use 720 or 352 to KDVD, 528 352 to K(S)VCD
m_width=720
#Use 576 for PAL and 480 for NTSC
m_height=576
subtitle="VTS_01_0.sub" # Add a# in the beginning of this line if you don't need
#subtitles or change for the name of the sub file created on step 7.
movie="rawpt1.d2v"
myoverscan=1 # Test values from 0 to 3 here. Bigger files produce more quality but
#a value too big will cause undesirable black borders on your TV.
MaxTreshold = 1.50
nf = 0 # Current frame.


################
## Functions ###
################
function fmin( int f1, int f2) {
return ( f1<f2 ) ? f1 : f2
}


##########
# Script #
##########
MPEG2Source(movie)++mpeg2source("rawpt2.d2v")++mpe g2source("rawpt3.d2v")

#Post-Process
Blockbuster(method="noise",detail_min=1,detail_max =8,variance=0.3,seed=5823)
ATC(1,2,4,0.5,false)
TemporalSoften(2,7,7,3,2)
Blockbuster(method="noise",detail_min=1,detail_max =10,variance=0.5,seed=5823)
#Resize, overscan and borders
gripCrop(m_width, 480, overscan=myoverscan,source_anamorphic=false,dest_a namorphic=false)
GripSize(resizer="lanczosresize")

STMedianFilter(3, 3, 1, 1 )
MergeChroma(blur(MaxTreshold))
MergeLuma(blur(0.1))
## Linear Motion Adaptive Filtering ##
#
# ( Portions from AviSynth's manual ) - This will apply temporalsoften to
# very static scenes, and apply variable blur on moving scenes.
# We also assign a variable - and this is why a line break is inserted:
SwitchThreshold = (Width<=352) ? 4 : (Width<=480) ? 3 : 2
ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf >= SwitchThreshold ? \
unfilter( -(fmin(round(nf)*2, 100)), -(fmin(round(nf)*2, 100)) ) : \
TemporalSoften( fmin( round(2/nf), 6), round(1/nf) , round(3/nf) , 1, 1) ")
#
#
#

GripBorders()

ColorYUV(off_y=6,gain_y=-18)
RemoveGrain(mode=2)
CNR2()
converttoyuy2()
PeachSmoother(baseline=1.38,noiselevel=2.04,dospat ial=false)
unfilter(-5,-5)
Limiter()


trim(2957,15016)++trim(19576,32250 )++trim(41774,60609)++trim(66092,74146)++trim(7871 3,82517)++trim(85075,85874)
++trim(91103,93086)++trim(93252,104043)++trim(1101 33,124310)
++trim(137267,147385)+trim(152919,157485)+trim(161 495,163966)
+trim(169857,180627)+trim(185184,199940)
SelectRangeEvery(1200, 12)

Which has given me a 23 Mb file.

The trims are to get rid of the ads etc.

The SelectRangeEvery is to give me 1% of the frames to test on.

Anything else I can do to improve it?

Thanks in advance.

Zaf

Dialhot 01-26-2005 10:07 AM

VMesquita templates were inspired by one of my old script for avi -> kvcd jobs. You give a look to last one and update that part of your current script :

http://www.kvcd.net/forum/viewtopic.php?t=7223

zafh 01-26-2005 10:17 AM

Quote:

Originally Posted by Dialhot
VMesquita templates were inspired by one of my old script for avi -> kvcd jobs. You give a look to last one and update that part of your current script :

http://www.kvcd.net/forum/viewtopic.php?t=7223

Thanks Phil,

One more really stupid question.

When you say last one do you mean the last on in the list or version 4.
They are numbered backwards.

Zaf

incredible 01-26-2005 10:17 AM

Re: newbie question
 
Quote:

Originally Posted by zafh
I am currently capturing a PAL analogue source on my hard drive recorder, then burning it to DVD.

I rip the DVD on my pc and run it through the KDVD templates for CCE by Vmesquita.

A harddrive recorder already uses a non optimal compression, and even when targeting a single DVD-R using the harddiskrecorders internal comprssion will result in a Picture which is anything but not good for a recompression via CCE or whatever.

My 2 cents, do use your harddrive recorder capturing at highest possible quality and keep the capture on its internal HD. If possible do connect your harddrive recorder to the pc and try to access that data from the harddrive recorder (is it possible like if connecting to an ext. Harddrive?).

Dialhot 01-26-2005 10:29 AM

Quote:

Originally Posted by zafh
When you say last one do you mean the last on in the list or version 4. They are numbered backwards.

As said in top of the message, the old version are given for historical reason, but latest is V4

Dialhot 01-26-2005 10:31 AM

Re: newbie question
 
Quote:

Originally Posted by incredible
A harddrive recorder already uses a non optimal compression, and even when targeting a single DVD-R using the harddiskrecorders internal comprssion will result in a Picture which is anything but not good for a recompression via CCE or whatever.

Last Recoders have a 400 GB disc and a "HQ+" recording mode that is a CBR at 15 MB/s. :o

incredible 01-26-2005 10:46 AM

YEP, but he said that he captures, burns it ta a DVD-R and on the PC that DVD-R Content will be reencoded ;) So I dont think that this HQ Quality on the HD at 18Mbit/s will be on a HDrecorder-burned DVD-R ;)

zafh 01-26-2005 11:12 AM

Quote:

Originally Posted by Dialhot
Quote:

Originally Posted by zafh
When you say last one do you mean the last on in the list or version 4. They are numbered backwards.

As said in top of the message, the old version are given for historical reason, but latest is V4

Yup, must read first post later. :oops:

I'll let you know how I get on.

Zaf

zafh 01-26-2005 11:19 AM

Re: newbie question
 
Quote:

Originally Posted by incredible
Quote:

Originally Posted by zafh
I am currently capturing a PAL analogue source on my hard drive recorder, then burning it to DVD.

I rip the DVD on my pc and run it through the KDVD templates for CCE by Vmesquita.

A harddrive recorder already uses a non optimal compression, and even when targeting a single DVD-R using the harddiskrecorders internal comprssion will result in a Picture which is anything but not good for a recompression via CCE or whatever.

My 2 cents, do use your harddrive recorder capturing at highest possible quality and keep the capture on its internal HD. If possible do connect your harddrive recorder to the pc and try to access that data from the harddrive recorder (is it possible like if connecting to an ext. Harddrive?).

Can't connect it to the PC, well not easily anyway.

I can burn my DVDs at the highest setting I can record at which works out at just over an hour on a DVD-R.

I have always assumed is was because my source was mainly fast action that I was having probelms with compression.

Zaf

Dialhot 01-26-2005 11:51 AM

Re: newbie question
 
Quote:

Originally Posted by zafh
I have always assumed is was because my source was mainly fast action that I was having probelms with compression.

Not at all. Recoders often use a CBR method for encoding that set the recorded time whatever the source kind.

SP = 1 hour
LP = 2 hours
ELP = 4 hours...

zafh 01-26-2005 12:49 PM

Re: newbie question
 
Quote:

Originally Posted by Dialhot
Quote:

Originally Posted by zafh
I have always assumed is was because my source was mainly fast action that I was having probelms with compression.

Not at all. Recoders often use a CBR method for encoding that set the recorded time whatever the source kind.

SP = 1 hour
LP = 2 hours
ELP = 4 hours...

Mine has

Fine - 60 mins
SP - 120 mins
LP - 240 mins
EP -360 mins

With 32 in between settings.

Most TV I record and watch at LP.
The quality is good enough to watch for me.
Sports and fast action I record at Fine.

I used to burn my DVD's somewhere between fine and sp depending on the length of footage.

The only footage I have really played around with is wrestling, hence me thinking fast action was my problem.

Still these filters have managed to reduce my file size by about 25%.
~6 hours on a half D1 DVD-R is in my sights. :lol:

Zaf

Dialhot 01-26-2005 12:51 PM

Re: newbie question
 
Quote:

Originally Posted by zafh
With 32 in between settings.

These are generally VBR ! Check the manual or your recoder, it should be indicated.

Quote:

Still these filters have managed to reduce my file size by about 25%.
~6 hours on a half D1 DVD-R is in my sights. :lol:
Which min and max video bitrate are you using ?

Note: 6hours on a DVD is okay but not wiht fullscreen footage !

zafh 01-26-2005 01:22 PM

Re: newbie question
 
Quote:

Originally Posted by Dialhot
Quote:

Originally Posted by zafh
With 32 in between settings.

These are generally VBR ! Check the manual or your recoder, it should be indicated.

Yup you are right.


Quote:

Quote:

Still these filters have managed to reduce my file size by about 25%.
~6 hours on a half D1 DVD-R is in my sights. :lol:
Which min and max video bitrate are you using ?

300 and 2500 with Q 40 in CCE.
Vmesquita defaults.

I haven't really started playing around with these yet.
I was just using them as a constant while testing out the filters.

Quote:

Note: 6hours on a DVD is okay but not wiht fullscreen footage !
I am recording for a friend and average about 3 hours per week.

If I can get 6 hours on one DVD at a watchable quality I will be happy.

What I have managed so far is better than the 3 hours I was getting using DVD shrink.

Zaf

Dialhot 01-26-2005 02:45 PM

Thinks about audio : if the tv show is mono, use mono mp2 at 64 kbit/s. It's far enought.


All times are GMT -5. The time now is 07:38 AM  —  vBulletin © Jelsoft Enterprises Ltd

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.