Log in

View Full Version : x264 CLI/VFW changing frame rate


allclone
4th July 2005, 10:53
Not a major issue but I looked around the forum and could not find anything and I would like to change the frame rate of video that x264 encodes to see what file sizes I can get at lower bitrates and higher resolutions.

Is there another way to change the frame rate of a video for encoding other then using something like VirtualDub/receding the file?

I also looked a little for a frame rate adjuster in AviSyth but did not find anything.

Most of the sources are MPEG2 streams and a few avi’s, most of the content is cartoons/anime.

Thanks for any help.

berrinam
4th July 2005, 11:13
Not a major issue but I looked around the forum and could not find anything and I would like to change the frame rate of video that x264 encodes to see what file sizes I can get at lower bitrates and higher resolutions.

Is there another way to change the frame rate of a video for encoding other then using something like VirtualDub/receding the file?

I also looked a little for a frame rate adjuster in AviSyth but did not find anything.

Most of the sources are MPEG2 streams and a few avi’s, most of the content is cartoons/anime.
Thanks for any help.
I assume you mean changing the framerate of the input before encoding (so AviSynth would be ideal). In that case, I point you to the AviSynth filter called ChangeFPS. This is available in two forms:

ChangeFPS(float fps, bool linear) and
ChangeFPS(int numerator, int denominator, bool linear)

Hope that helps.

PS Wouldn't this be more appropriate in the AviSynth forum?

Doom9
4th July 2005, 11:46
uhh.. what do you expect of changing the framerate? You'll still have the same number of frames. Sure, bits/second of video changes if you encode a clip twice at the same bitrate and different framerates, but that just corresponds to changing the bitrate with the same fps.

berrinam
4th July 2005, 12:23
uhh.. what do you expect of changing the framerate? You'll still have the same number of frames.
Actually, ChangeFPS will delete/duplicate frames, whereas AssumeFPS will just assume a new FPS

allclone
4th July 2005, 12:38
Thanks for the info on the avisyth, sorry dunno what I was thinking, this could be moved to the avisyth section since x264 does not have much to do with the video input framerate.

sorry for the trouble mods

Edit:
I believe that changing the input fps/total frames outputed by the encoding will lower total frames then the original which creates a smaller file, so then more can be added to bitrate for beter quality for little loss to the human eye.

Just to clarify I am not trying to trying to change the speed of the frames displayed, I am changing the total amount frames per a clip.

bond
4th July 2005, 20:44
x264 has a --fps option which can change the output framerate i think

allclone
5th July 2005, 06:39
Thanks for the tip I'm testing it now :), if it works out right, its what I was looking to use.

Is there anyway that can be built into later builds of MeGUI or x264CLIGUI, just woundering.

Doom9
5th July 2005, 07:45
Is there anyway that can be built into later builds of MeGUI or x264CLIGUI, just woundering.It already is.. just plug in --fps <your frame rate> into the custom commandline options in MeGUI.

I believe that changing the input fps/total frames outputed by the encoding will lower total frames then the original which creates a smaller file, so then more can be added to bitrate for beter quality for little loss to the human eye.Here's where you go wrong. You effectively need to decimate frames to do that. the fps option won't do that for you. AviSynth's changeFPS will drop duplicate frames.. yet if your source has none.. once again no change in the number of frames. You can effectively reduce a 29.97fps source to 23.976 via inverse telecine (IVTC), but this only works properly if the original source was shot at 24fps (Hollywood movies, recent TV series).

Or you can drop one frame every X frames using AviSynth (I don't know which method.. this really is something for the AviSynth forum but please do read up first.. there's tons of documentation available on the subject).. I won't spare you my comment on what I think of doing that.. it involves a lot of words that require a parental advisory sticker.

Doom9
5th July 2005, 07:45
Is there anyway that can be built into later builds of MeGUI or x264CLIGUI, just woundering.It already is.. just plug in --fps <your frame rate> into the custom commandline options in MeGUI.

I believe that changing the input fps/total frames outputed by the encoding will lower total frames then the original which creates a smaller file, so then more can be added to bitrate for beter quality for little loss to the human eye.Here's where you go wrong. You effectively need to decimate frames to do that. the fps option won't do that for you. AviSynth's changeFPS will drop duplicate frames.. yet if your source has none.. once again no change in the number of frames. You can effectively reduce a 29.97fps source to 23.976 via inverse telecine (IVTC), but this only works properly if the original source was shot at 24fps (Hollywood movies, recent TV series).

Or you can drop one frame every X frames using AviSynth (I don't know which method.. this really is something for the AviSynth forum but please do read up first.. there's tons of documentation available on the subject).. I will spare you my comment on what I think of doing that.. it involves a lot of words that require a parental advisory sticker.

allclone
5th July 2005, 08:55
Yes this should get moved to the AviSyth section, other then the info about --fps # in cli for x264 its more focused around AviSyth, sorry.

Well sence x264 --fps is not really going to help sence what I'm trying to do is drop fames.

mg262
5th July 2005, 17:35
@allclone:

There are two built-in AVISynth functions that will change the frame rate, ChangeFPS mentioned above and also ConvertFPS. Both are described in the documentation that comes with AVISynth.

But bear in mind that it is very rare that you gain something for nothing. Codecs tend to recognise duplicates and encode them using a very small amount of space. You can help them along the way by using the external plug-in Dup, which replaces near duplicates (resulting from noise) with duplicates; you can find out more about it with the search function. If you're using an NTSC source, you might also want to search for pulldown/telecine and its inverse (sometimes abbreviated IVTC) and read about these -- there's a document about it on the main site called something like "video-basics".

If you have ever watched the original He-Man, you will know why reducing the frame rate too much is not a great idea... but you can try it for yourself and see.