snowmoon,
is there a way of telling avisynth to select only a certain group of frames? more specifically, i'd like to be able to select the first 24 frames, then skip the next 24 frames, then select the next 24 frames, then skip the next 24 frames, and so on, and feed this to tmpgenc for encoding. any ideas?
+ Reply to Thread
Results 1 to 9 of 9
-
-
Use SelectEvery(48,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14, 15,16,
17,18,19,20,21,22,23,24)
It's ugly, but it will work..... -
snowmoon,
You've put together a very ambitious script, but I think it might require more experience than you intended. Borrowing an example from your "Load Audio Source", suppose I wanted to dub an external WAV file, which also has a 1 second skew. As a beginner, I might uncomment the lines like this:
audio = WAVSource( "Mymovieaudio.wav" )
movie.audiodub(audio)
#2 bump audio if necessary -in seconds-
move.delayaudio(1)
A beginner might not realize more editing is necessary because the 'movie.audiodub(audio)' doesn't modify 'movie' itself--it returns a clip that gets discarded when the next statement executes. An experienced AviSynth user would fix the problem by either assigning back into 'movie' or by deleting the 'movie' from the 'delayaudio(1)' line. (The fact that 'movie' is misspelled suggests you didn't just paste this in from one of your working scripts!)
I realize this is a bit presumptious, but I'd propose replacing "movie" with "last". This exploits the fact that any line that any statement without an assignment gets implicitly assigned to "last", and any statement without a source implicitly uses "last".
The "last" arguments are now a little redundant, but the script will work no matter what lines a user chooses, and the script will always have a return value.
################################################## #####
# Copyright 2001 Eric Warnke
# (Modified from the author's original format)
# Free for non-commercial use, please give credit
################################################## #####
#
# Generic .avi to VCD, and SVCD conversion
# script. Allows converion between PAL->NTSC
# frame rates.
#
# Follow directions and uncomment lines where necessary
# when done you should have a complete conversion sctipt.
# For simplicity I assume..
# VCD = 352x240/288 with a frmae rate of 23.976,29.97/25
# SVCD = 480x480/576 @ 23.976,29.97/25
#
# I do not answer simple questions at above email address
# but I will take any corrections/alterations.
#
################################################## ######
#
# Load video source
#
# Uncomment ONE of the following last= lines to load
# your source. Make sure to include the full path to
# your avi source or this may not work.
#
#1 Use for most normal .avi files including Divx
#last = AVIFileSource( "moviename.avi" )
#2 Use next line only for LARGE .avi's
#last = OpenDMLSource( "moviename.avi" )
#3 Use Next line only for virtualdub/avi_io segmented .avi's
#last = SegmentedAVISource( "moviebase.avi" )
#4 Use for odd formats that play though MP see AVIsynth doc
# for more info
#last = DirectShowSource( "movie.mpg" )
#
################################################## #######
#
# Load external audio source ( if necessary )
#
# This will overlay an .wav file over the movie
#
#1 If necessary load external .wav file for movie uncomment
# both lines
#audio = WAVSource( "Mymovieaudio.wav" )
#last.audiodub(audio)
#2 bump audio if necessary -in seconds-
#last.delayaudio(1)
#
################################################## #######
#
# Frame rate conversion ( if necessary )
#
# Uncomment one of the assumefps or change fps lines if
# frame rate conversion is necessary. If you video is
# already in one of the three following 23,976,25,29,97
# and not chaning it's format you do not need to use
# one of the following lines.
#
# First three add and drop frames, last two speed/slow
# video and audio to proper FPS ( 1.0b3 only ) it's a
# better method, but is only applicable to two specific
# conversion senarios.
#
#1 Irregualr FPS converison to NTSC film rate
# use this for 10,15,20 -> NTSC film conversion
#last.ChangeFPS(23.976)
#2 Irregualr FPS -> NTSC frame rate
# use for 10,15,20 -> NTSC conversion
#last.ChangeFPS(29.76)
#3 Irregular FPS to PAL frame rate
#last.ChangeFPS(25)
#4 NTSC film 23.976 -> PAL 25
#last.assumeFPS(25,sync_audio=true)
#5 PAL 25 -> NTSC film 23.976
#last.assumeFPS(23.976,sync_audio=true)
#
################################################## ########
#
# Video size / bordering
#
# Use one of the following to get a properly resized borderd
# video based on input and output. All resize values have
# been rounded to the nearest 16 to prevent macroblock waste.
#
# NOTE: These are only applicable to PROGRESSIVE materal
# do not appemt to use these for interlaced materal as
# you will end up with a big mess.
#
# If you input is -- 4:3 -- and you are going to ....
# NTSC and a format of
#1 VCD
#last.bicubicresize(352,240)
#2 SVCD
#last.bicubicresize(480,480)
# PAL and a format of
#3 VCD
#last.bicubicresize(352,28
#4 SVCD
#last.bicubicresize(480,576)
#
# If you input is -- 16:9 -- and you are going to ....
# NTSC and a format of
#5 VCD
#last.bicubicresize(352,176).addborders(0,32,0,32)
#6 SVCD
#last.bicubicresize(480,352).addborders(0,64,0,64)
# PAL and a format of
#7 VCD
#last.bicubicresize(352,20.addborders(0,40,0,40)
#8 SVCD
#last.bicubicresize(480,576).addborders(0,72,0,72)
#
# If you input is -- 2.35:1 -- and you are going to ....
# NTSC and a format of
#9 VCD
#last.bicubicresize(352,144).addborders(0,48,0,4
#10 SVCD
#last.bicubicresize(480,272).addborders(0,104,0,10 4)
# PAL and a format of
#11 VCD
#last.bicubicresize(352,160).addborders(0,64,0,64)
#12 SVCD
#last.bicubicresize(480,320).addborders(0,128,0,12
#
################################################## ########
#
# Misc functions
#
#1 Clean up head noise or other garbage at top and bottom
# of the video frame by adding black borders VCD only
#last.letterbox(8,
#2 Clean up head noise SVCD
#last.letterbox(16,16)
#3 If you get a technicolor mess as your mpeg output, this option
# may be necessary. If you have YUY2 or huffyuv as source and
# going to CCE you will probably need this option.
#last.ConvertToRGB()
#4 PC -> TV brightness correction
#last.levels(0,1,255,16,239)
#5 Audio rate correction. If your audio is not already 44,100
# many encoders will complain, use this to correct
#last.resampleaudio(44100)
#
#
# Thats all folks, assuming you have everything installed properly
# You can now open this file in TMPGenc, CCE, MP, and most other video
# applications.
#
# END OF SCRIPT
-
mmmm a most usefull post worthy of resurection...
Snowmoon or tacosalad..if u are still alive....wondering if it would be possible to add some scripts that convert from 2.35:1 TO 4:3 full screen cutting off the sides? as well as 16:9 to 4:3 again choping off the sides and making a normal 4:3 pic without letterboxing....
want it mainly for kids flics....plus i am too stingy to buy a widescreen TV...well for now......
I know I can use TMPGE to do this...but I want to use CCE cuz it produces fantastic results @ low bit rates.....get more than an hr SVCD on a 90 min disk....hence need AVIsynth -
I'm not dead yet...
yep i've fixed the issues with the assignment.
I've just gotten back into SVCD creation with the re-run of farscape. Whoohoo... -
Hi Snowmoon good to have u back....
But I am stuffed if i can follow what u mean in your last message? "fixed last assignment?"
do u mean u have changed some of your script?.....but ur messages have not been edited...i am confused now (which is not hard) -
Here is the latest version
################################################## #####
# Copyright 2001 Eric Warnke
# Free for non-commercial use, please give credit
################################################## #####
#
# Generic .avi to VCD, and SVCD conversion
# script. Allows converion between PAL->NTSC
# frame rates. Please use AVISynth 1.0b3, as not all
# functions work under 0.3
#
# Follow directions and uncomment lines where necessary
# when done you should have a complete conversion sctipt.
# For simplicity I assume..
# VCD = 352x240/288 with a frmae rate of 23.976,29.97/25
# SVCD = 480x480/576 @ 23.976,29.97/25
#
# I do not answer simple questions at above email address
# but I will take any corrections/alterations.
#
################################################## ######
#
# Load video source
#
# Uncomment ONE of the following lines to load
# your source. Make sure to include the full path to
# your avi source or this may not work.
#
#1 Use for most normal .avi files including Divx
#AVIFileSource("moviename.avi")
#2 Use next line only for LARGE .avi's
#OpenDMLSource("moviename.avi")
#3 Use Next line only for virtualdub/avi_io segmented .avi's
#SegmentedAVISource("moviebase.avi")
#4 Use for odd formats that play though MP see AVIsynth doc
# for more info. Can open MS DV files.
#DirectShowSource("movie.mpg")
#4a if you notice off colored lines when using Directshowsource
# use the following line
#FixBrokenChromaUpsampling()
#
################################################## #######
#
# Load external audio source ( if necessary )
#
# This will overlay an .wav file over the movie. Great for use
# with program like DVD2AVI that produce a seperate .wav file.
#
#1 If necessary load external .wav file for movie
#audioDub ( WAVSource("Mymovieaudio.wav") )
#2 bump audio if necessary -in seconds-
#delayaudio(1)
#
################################################## ########
#
# Video size / bordering
#
# Use one of the following to get a properly resized borderd
# video based on input and output. All resize values have
# been rounded to the nearest 16 to prevent macroblock waste.
#
# NOTE: These are only applicable to PROGRESSIVE material
# do not attempt to use these for interlaced material as
# you will end up with a big mess.
#
# If you input is -- 4:3 -- and you are going to ....
# NTSC and a format of
#1 VCD
#bicubicresize(352,240)
#2 SVCD
#bicubicresize(480,480)
# PAL and a format of
#3 VCD
#bicubicresize(352,28
#4 SVCD
#bicubicresize(480,576)
#
# If you input is -- 16:9 -- and you are going to ....
# NTSC and a format of
#5 VCD
#bicubicresize(352,176).addborders(0,32,0,32)
#6 SVCD
#bicubicresize(480,352).addborders(0,64,0,64)
# PAL and a format of
#7 VCD
#bicubicresize(352,20.addborders(0,40,0,40)
#8 SVCD
#bicubicresize(480,432).addborders(0,72,0,72)
#
# If you input is -- 2.35:1 -- and you are going to ....
# NTSC and a format of
#9 VCD
#bicubicresize(352,144).addborders(0,48,0,4
#10 SVCD
#bicubicresize(480,272).addborders(0,104,0,104)
# PAL and a format of
#11 VCD
#bicubicresize(352,160).addborders(0,64,0,64)
#12 SVCD
#bicubicresize(480,320).addborders(0,128,0,12
#
################################################## ########
#
# Misc functions
#
#1 Clean up head noise or other garbage at top and bottom
# of the video frame by adding black borders VCD only
#letterbox(8,
#2 Clean up head noise SVCD
#letterbox(16,16)
#3 If you get a technicolor mess as your mpeg output, this option
# may be necessary. If you have YUY2 or huffyuv as source and
# going to CCE you will probably need this option.
#ConvertToRGB()
#4 PC -> TV brightness correction
#levels(0,1,255,16,239)
#5 Audio rate correction. If your audio is not already 44,100
# many encoders will complain, use this to correct
#resampleaudio(44100)
#6 Fix for broken codecs that decompress upside-down
#FlipVertical()
#
################################################## #######
#
# Frame rate converion ( if necessary )
#
# Uncomment one of the assumefps or change fps lines if
# frame rate conversion is necessary. If you video is
# already in one of the three following 23,976,25,29,97
# and not chaning it's format you do not need to use
# one of the following lines.
#
# First three add and drop frames, last two speed/slow
# video and audio to proper FPS ( 1.0b3 only ) it's a
# better method, but is only applicable to two specific
# conversion senarios.
#
#1 Irregualr FPS converison to NTSC film rate
# use this for 10,15,20 -> NTSC film conversion
#ChangeFPS(23.976)
#2 Irregualr FPS -> NTSC frame rate
# use for 10,15,20 -> NTSC conversion
#ChangeFPS(29.76)
#3 Irregular FPS to PAL frame rate
#ChangeFPS(25)
#4 NTSC film 23.976 -> PAL 25
#assumeFPS(25,sync_audio=true)
#5 PAL 25 -> NTSC film 23.976
#assumeFPS(23.976,sync_audio=true)
#
#
# Thats all folks, assuming you have everything installed properly
# You can now open this file in TMPGenc, CCE, MP, and most other video
# applications.
#
# END OF SCRIPT
-
Hi Snowmoon,
I know what you are doing is obvious to you however I just can't quite get what it is.....when you say ..."if your input is 16:9 and u want to make a SVCD does this mean you are keeping the 16:9 image and making it into a SVCD with letterboxing??? or is it removing letterboxing....my brain hurts....
also what is the best way to deinterlace using avisynth, i tryed doubleweave last night but it did not seem to do anything....the encoded video still seemed to be interlaced...I do not agree with verticalreduce by 2 then re enlarging..this seems to be a unecessary extra processing step.......btw i am a PAL person
Actually using DVD2SVCD I found that selecting 4:3 on the encode tab will convert 16:9 to 4:3 (***Wrong it made egg heads...)but it does not seem to do anything for 2.35:1 so I am going to try this below......
I found this on the doom forum....it converts 2.35 to 16:9 using croping and resizing......which is a nice intermediate step for those who find 2.35 telescope material on their TVs but do not want to go all the way to 4:3....credit goes to "Frank" from the doom9 forum
Resizing 2.35 films to 16:9
--------------------------------------------------------------------------------
2.35:1 movies only use 50% of the display area.
For better viewing on television it's better to crop and resize to 2:1 or 16:9 format.
Today some examples for enlarging 2.35:1 to 16:9 aspect ratio.
1. Cropping
vertical
PAL: y1 = 3/4 * 576 = 432 -> y2 = 576
NTSC: y1 = 3/4 * 480 = 360 -> y2 = 480
increasing factor k = y2/y1 = 4/3 for PAL and NTSC
horizontal
x1 = x2/k = 720 * 3/4 = 540 -> x2 = 720
crop x2 - x1 = 720 - 540 = 180
2. Resizing
PAL:
x = 540 -> 720 (2/3 * 720 = 480 for SVCD)
y = 576 unchanged
NTSC:
x = 540 -> 720 (2/3 * 720 = 480 for SVCD)
y = 480 unchanged
Pixel aspect ratio is fully unchanged!
AviSynth Scripts enlarging 2.35 to 16:9
----------------------------------------
ATTENTION: Telecine (NTSC) and deinterlacing problems
are not discussed.
Basicly you have to deinterlace BEFORE resizing!
# SVCD PAL
Crop(90,0,540,576).BicubicResize(480,576)
# or a bit faster, because less pixels have to resize
Crop(90,72,540,432).BicubicResize(480,432).AddBord ers(0,72,0,72)
# SVCD NTSC
Crop(90,0,540,480).BicubicResize(480,480)
# or a bit faster, because less pixels have to resize
Crop(90,60,540,360).BicubicResize(480,360).AddBord ers(0,60,0,60)
# DIVX PAL
# SAR = 54/59, cropped x = 704
Crop(96,72,528,432)
BicubicResize(512,28
# DIVX NTSC
# SAR = 11/10, cropped x = 704
Crop(96,60,528,360)
BicubicResize(512,28
<font size=-1>[ This Message was edited by: nsdn on 2001-08-30 05:18:12 ]</font> -
Maybe a wee addition to your script:
version()
With this line you can check if AVISynth is installed properly and what version your using. I reckon when you're new to AVISynth it's assuring to see that at least you installed it properly.
Thank you Snowmoon for sharing your script. A previous version helped me understanding how to use AVISynth. Now I use it almost daily.
Regards,
Willem
Similar Threads
-
Should i use and avisynth script for Dv ?
By smartel in forum Newbie / General discussionsReplies: 0Last Post: 10th Mar 2012, 08:29 -
AVSTODVD: Avisynth script edit - colorspace conversion question...
By JRM75 in forum Video ConversionReplies: 2Last Post: 26th Jul 2010, 18:43 -
Avisynth script problem (aac to wav conversion)
By greggery in forum Video ConversionReplies: 0Last Post: 22nd Nov 2007, 11:59 -
avisynth script
By magenta2007 in forum SVCD2DVD & VOB2MPGReplies: 7Last Post: 25th Sep 2007, 11:29 -
Feedback -- how to get rid of hints overshadowing VH script balloons ?
By vhelp in forum FeedbackReplies: 4Last Post: 19th May 2007, 17:42