Log in

View Full Version : using AVIFileGetStream et al results in not respecting fps?


rogerdpack
16th May 2012, 19:31
Hello all.
I notice there seem to be two ways to "get avisynth" input.

You can use AVIFileGetStream, AVIStreamRead etc. like ffmpeg:

https://github.com/FFmpeg/FFmpeg/blob/master/libavformat/avisynth.c

or you can use
avs_create_script_environment, avs_get_frame etc. like mplayer:

https://github.com/rdp/mplayer-svn/blob/master/libmpdemux/demux_avs.c

The former, if you pass it a "graphedit" within an avs file, like

DirectShowSource("screen-capture-recorder.GRF", audio=False, framecount=1000000, fps=0.1)

ignores the fps setting, while the latter seems to respect it. Anybody know what might be going on? Is this expected?

Thanks.
-roger-

IanB
16th May 2012, 22:59
If you add an Info() call to your script, what FPS does it display in each case.


Also the rate at which an application fetches frames has no relation to the nominal FPS of the stream.

Generally a player application will on average fetch frames at the FPS rate, but it is free to fill any internal buffers at the maximum available decoding and rendering processing rate. It may also display the frames at a user nominated alternate speed like frame step, slow motion, x2, x3 or x4, etc.

An encoding application will fetch frames at the maximum available rendering and encoding processing rate. It will write the FPS values into the encoded output stream.

rogerdpack
17th May 2012, 16:53
Looks like you were right and my question was ill-posed. Every player "except VLC" seems to accept the right fps (and display it at the right speed). I guess VLC is in "greedy" mode and displays things as quickly as possible.
Thanks for the help.
-r