Log in

View Full Version : Frame rate conversion?


gyb
11th February 2002, 11:03
I have an avi file that runs at 20fps. I would like to know the best way to convert this into either a SVCD or VCD.
The problem I have is, if I convert the frame rate so that the length of the movie is altered, because of the large change in frame rate (to 23.97fps) the length of the movie is reduced by 10%. But, if I convert the frame rate by inserting static frames then the movie becomes jerky.
Any help would be appreciated. Thanks

gyb

hakko504
11th February 2002, 13:33
First extract the audio to a separate file. Then load it into an audio tool and slow it down to 99.9% (19.98/20.00)
Then use AVISynth to do the following (for SVCD & assuming 4:3 video):

#Open the video file
AviSource("c:\Video.avi")
#Slow it down
AssumeFPS(19.98)
#Resize to correct SVCD size
BiCubicResize(480,480,0,0.5)
#Create interlaced structure for 29.97fps
ChangeFPS(59.94)
SeparateFields()
SelectEvery(4,0,3)
Weave()

This will produce 1 full frame and 1 extra field out of every frame in the original video, i.e. all frames will be displayed the same length of time in the SVCD, hence no jerkiness.
You should now be able to feed the .avs and the audio file to a SVCD encoder.

Oh yes, and do read the AVISynth docs at Videotools.net (http://www.videotools.net) before you do anything with AVISynth, it can be quite hard to understand.

VCD is much harder to get non-jerky video from, but you could try Decomb (http://sauron.mordor.net/dgraft/decomb.html) by Don Graft (http://sauron.mordor.net/dgraft/) to create this .avs:#Load Decomb
LoadPlugin("c:\Decomb.dll")
#Open the video file
AviSource("c:\Video.avi")
#Slow it down
AssumeFPS(19.98)
#Resize to correct VCD size
BiCubicResize(352,240,0,0.5)
#Create 29.97fps
ChangeFPS(39.96)
Decimate(4)
This does mean that some frames are doubled and some are left single, but Decimate usually does a good job of deciding what frames to discard in order to get the most fluent video.

gyb
11th February 2002, 13:35
Thanks for the help. I'll try that. I wanted to use SVCD more than VCD anyway. How do I slow down the WAV file?

hakko504
11th February 2002, 14:26
Wave Length Adjust (http://www.doom9.org/software2.htm#audio) or something like that.

gyb
11th February 2002, 18:44
Could you give me a hand with AVISynth. I have installed the dll in my system32 directory and run the install.reg file, but I don't know what to do now. I went to the site you said, but the FAQ was about things like I get an error while using it. The guide just seems to be about all the commands that can be used in a script. I just need to know how to load the scripts.

gyb

hakko504
11th February 2002, 20:09
It is a scripting language: Just copy & paste the code into notepad and save it as "framerateconv.avs" WITH the quotes to avoid having .txt added automatically. You might want to read some of Doom9's (http://www.doom9.org/guides.htm) guides on (S)VCD and AVISynth (http://www.doom9.org/mpg/d2a-mpeg2dec.htm). The original author's homepage (http://www.math.berkeley.edu/%7Ebenrg/avisynth.html) is also useful for understanding AVIsynth. Don not use his version though, but stick to 1.0b5.

gyb
13th February 2002, 00:24
I've got TMPGEnc setup so that I can load *.avs files now. When I load the .avs file into TMPGEnc it loads the file specified in the script. Is this setup so that I can now press the Start button and it will encode the movie, or do I need to frameserve to TMPGEnc, or from TMPGEnc to another encoder?

hakko504
13th February 2002, 08:45
I'm not really into (S)VCD, I mostly do DivX, but I think you should be able to press start and encode it. You don't say anything about audio, if you can't load the adjusted audio into TMPGEnc or if you get out of sync audio then you should adjust the last line of the SVCD script to this:video=Weave()
audio=WavSource(c:\adjusted_audio.wav")
AudioDub(video,audio)AVISynth isn't very good at audio so if you don't have to use it for audio then don't.

gyb
13th February 2002, 12:53
I hadn't got as far as multiplexing the audio back in yet. I was just starting to re-encode the video. Thanks for your help.

gyb
13th February 2002, 13:54
Sorry, but I've another question now. When I load the *.avs file into either VirtualDub or TMPGEnc it doesn't see the whole file. The movie is 57:13 minutes long, but it only sees the 19:05 minutes of it. Do you know the reason why?

hakko504
13th February 2002, 14:29
I think there's a problem with ChangeFPS sometimes. Try this:#Open the video file
AviSource("c:\Video.avi")
#Resize to correct SVCD size
BiCubicResize(480,480,0,0.5)
#Create interlaced structure for 29.97fps
SeparateFields()
SelectEvery(4,0,1,0,3,2,3)
Weave()
#Set correct framerate (slow down)
AssumeFPS(29.97)

gyb
13th February 2002, 17:00
Thanks. It sees the whole of the movie now.