View Full Version : Changing fps from 60 to 30.


DangeR!
25th April 2007, 11:32
Hi,
I have fraps footage that I put together in Virtualdub and saved as an .avi file (non compressed). Basically so its just one file. Its about 30GB in total and is shot at 640x512 @ 60fps, 20 mins long.

based on this thread http://forum.doom9.org/showthread.php?t=125079 (great work btw)

Now I am encoding it into x264 using a batch file I created (attached) with switches. Could some of the more experienced look over it and see if its ok. It encodes the file down to 300MB and the quality is excellent, took 3 hours for one pass (first), but it doesn't seem to change the fps from 60 to 30fps. I am assuming it will reduce the file size further if its @ 30fps so I need to convert it. Is the --fps switch broken or am I missing something?

This is my very first time doing this sort of thing. Ripping from DVD's is easy, point and click lol. But doing this from scratch with avi files etc requires me to get some advice.


@ECHO OFF
ECHO. ------------------------------
ECHO. Setting Variables.
ECHO. ------------------------------
SET bitrate=2000
SET threads=2
SET fps=30.00
SET input=frapScript.avs
SET output=output.mp4
ECHO. ------------------------------
ECHO. Encode First Pass
ECHO. ------------------------------
x264.exe --fps %fps% --trellis 2 --me umh --bime --merange 64 --no-fast-pskip --partitions all --8x8dct --pass 1 --bitrate %bitrate% --subme 7 --bframes 16 --b-pyramid --ref 5 --b-rdo --aq-strength 0.5 --mixed-refs --direct auto --weightb --progress --deblock 1:-1 --threads %threads% -o %output% %input%
ECHO. ----------------------------------
ECHO. Encode Second Pass
ECHO. ----------------------------------
x264.exe --fps %fps% --trellis 2 --me umh --bime --merange 64 --no-fast-pskip --partitions all --8x8dct --pass 2 --bitrate %bitrate% --subme 7 --bframes 16 --b-pyramid --ref 5 --b-rdo --aq-strength 0.5 --mixed-refs --direct auto --weightb --progress --deblock 1:-1 --threads %threads% -o %output% %input%
ECHO. ------------------------------
ECHO. Finished Encoding
ECHO. ------------------------------
PAUSE
CLS
EXIT

Thanks,
D.

EDIT: once I have done 2 passes, what software can i use to put music and title screens in. Will I have to encode it again? won't it loose quality.

AVmaniac
25th April 2007, 15:42
hi .. what about using avisynth internal conversion of fps ?

convertfps(30) ... but the value choosen can be max. 2/3
of source fps.
so if you want to perhaps go convert to 25fps you can combine
multiple convertfps
convertfps(30).convertfps(25)

see also avisynth docs ConvertFPS().

About audio:
try ...

video = yourvideosource
audio = wavsource("your.wav")
#or directshowsource("your.something.soundfile")

audiodub(video,audio)

convertfps(30)


... you can extract a *.wav file using virtualdub and loading your *.avs .

akupenguin
25th April 2007, 15:57
Multiple calls to convertfps? That's just asking for trouble. The convertfps doc (http://avisynth.org/mediawiki/FPS#ConvertFPS) even says so.

DangeR!
25th April 2007, 17:00
Hi,
thanks for the replys.

this is whats in my .avs file
DirectShowSource("video.avi")
ConvertToYV12()

so just add convertfps(30) to the end of it?

didn't realise .avs files could do that (don't really know what they do tbh lol.)

This is a good site for x264 commands, witch I have followed http://aflux.deltaanime.net/Zero1/MP4/x264.html

Also, does my x264 settings look ok + will 30fps reduce the file size by half, if any?

LoRd_MuldeR
25th April 2007, 17:12
didn't realise .avs files could do that (don't really know what they do tbh lol.)

Avisynth is one of the most powerful softwares for video editing.
With Avisynth scripts you can do almost everything (some additional Plugins might be necessary though)

You might like to read this:
http://avisynth.org/YourFirstScript

DangeR!
25th April 2007, 18:41
Thanks LoRd_MuldeR, I'll have a read of that soon.

I have a problem. x264 cannot open my avs file, any ideas why?

my error:
avis [error]: unsupported input format (DIB )
x264 [error]: could not open input file 'frapScript.avs'

DangeR!
25th April 2007, 19:19
VLC doesn't play my original .avi file now :/. WMP and virtualDub do though, very strange.

Blue_MiSfit
25th April 2007, 19:26
It might be a lot faster if you re-encode to HuffYUV, or a similar universal lossless codec. It will save space and time.

~Misfit

DangeR!
25th April 2007, 20:31
how do i solve my error?

is HuffYUV as good quality as x264?

LoRd_MuldeR
25th April 2007, 20:52
how do i solve my error?

is HuffYUV as good quality as x264?

HuffYUV is lossless, x264 usually is not (except you use CQ=0)

But don't expect HuffYUV to achieve a decent compression-ratio, it's more intended for real-time capturing and intermediate storage!

Shinjite
25th April 2007, 22:57
Hi,
thanks for the replys.

this is whats in my .avs file
DirectShowSource("video.avi")
ConvertToYV12()

so just add convertfps(30) to the end of it?

didn't realise .avs files could do that (don't really know what they do tbh lol.)

This is a good site for x264 commands, witch I have followed http://aflux.deltaanime.net/Zero1/MP4/x264.html

Also, does my x264 settings look ok + will 30fps reduce the file size by half, if any?

to reduce the size of the output clip is depends on the target bitrate you want in the x264 settings.

DangeR!
25th April 2007, 23:19
HuffYUV is lossless, x264 usually is not (except you use CQ=0)

But don't expect HuffYUV to achieve a decent compression-ratio, it's more intended for real-time capturing and intermediate storage!
do you mean use virtualdub to record my game play using HuffYUV (using VD as a fraps substitute)?

I take it no one knows why this error has come up when the file used to encode fine before.

I also thought that reducing the fps would also reduce the overall size of the footage when encoded. less frames less size.

DangeR!
25th April 2007, 23:29
I figured out my error, or at least why it wouldn't open properly. its the command ConvertFPS(30). I took this out and it started to encode as it should.

If reducing the fps isn't going to reduce the file size, then there is no need to change it. I'm fine with 2000 bitrate, though I may experiment with it to get the file size down a bit.

ballofsnow
25th April 2007, 23:39
Why not just use selecteven()? By using ConvertFPS(30) you're removing half the frames, same as selecting every other frame.

edit- whoops, nevermind. Confused this with changefps. You may be looking to use changefps instead!

DangeR!
25th April 2007, 23:40
ok read a bit more.

Because the source file is at 60 fps and I have to do 2/3 of that, the convertfps will have to be 40fps.

DangeR!
25th April 2007, 23:42
Why not just use selecteven()? By using ConvertFPS(30) you're removing half the frames, same as selecting every other frame.
I'm new to this (1 day lol) and reading allot of info on the subject... haven't come across that command yet, thanks for the heads up. I will look into it.

DangeR!
25th April 2007, 23:55
The encoded footage wont play on WMP or QuickTime, but it plays in VCL. How can I make it more compatable? is it to do with --merange should I use 64 or 32, as I hear 32 allows it to be played in quicktime/ipod.

sorry for all the questions :D and thanks for the help so far.

ballofsnow
26th April 2007, 00:06
You may have missed my edit above. You should look into both selecteven(), and ChangeFPS(30). Changefps will delete or duplicate frames to meet the desired framerate. In your case it'd delete half of them, which I'm pretty sure is what you want.

To make it Quicktime 7 compatible, in MeGUI you'd select main profile, and make sure that bpyramid is off. Not sure what the exact command line would be though.

DangeR!
26th April 2007, 00:08
what about windows media player... thanks for reply

LoRd_MuldeR
26th April 2007, 00:08
I also thought that reducing the fps would also reduce the overall size of the footage when encoded. less frames less size.

When compressing video, you usually select the target bitrate (when not using Constant Quantizer mode)
Bitrate is selected as "Kilobits per Second" and not "Bits per Frame" or something ;)
This means the resulting Filesize will be the same, no matter which Framerate the video has!
Of course if the video has a lower Framerate, then you can usually encode at a lower Bitrate and still get a decent quality.
So reducing the Framerate will not make your file any smaller, as long as you don't adjust the Bitrate too!

ballofsnow
26th April 2007, 00:14
If I'm not mistaken.. WMP needs a directshow filter to play h264. You'd have to download something like ffdshow or coreavc to make it work.

foxyshadis
26th April 2007, 05:15
To make it Quicktime 7 compatible, in MeGUI you'd select main profile, and make sure that bpyramid is off. Not sure what the exact command line would be though.

MeGUI has the CE-QuickTime profile. Make sure you use mp4, as avc in avi or mkv won't work in QT.

The error (DIB ) is the key that means that your script is wrong, load it into vdub to find the error when that happens.

You can't record d3d games with virtualdub, you're pretty much stuck with fraps. You can set the fps to 30 in fraps though; there are also some scripts out there to make game captures more film-y, by adding motion blur, but that might be too advanced.