There are currently 50 players online.
 
Warsow


 
 

backOn The Fly Framerate Super Resampler

Forum index
Demos / Movies
On The Fly Framerate Super Resampler
Posted by
Post Scroll to bottom
Pierre

Member
(771 posts)

I'm currently working on a new tool for moviemakers : "On The Fly Framerate Super Resampler" (OTFFSR).

It will apply a motion blur during screenshots capture.
For the same result, OTFFSR is 3x faster than Sony Vegas and uses 4x less space disk :]

How to use it ?

- Edit the config file (config.txt)
- line 1 : input folder address
Example : E:\Pierre\Warsow\basewsw\avi (without the last "\")

- line 2 : output folder address
Example : D:\output (without the last "\")

- line 3 : image width in pixel
Example : 1280

- line 4 : image heigth in pixel
Example : 720

- line 5 : Blur frames
Example : 20
Blur frames = capture fps / final fps (must be an integer)

- line 6 : output file extension
Example : jpg
Availables extensions are : jpg, bmp and png

- line 7 : thread limit
Example : 4

- Run OTFFSR, check config, press OK

- Run your game, and capture demo

That's all :D

download :

windows binaries : http://www.fuckingfrogs.fr/pierre/OTFFS ... -09-15.zip
source code : http://www.fuckingfrogs.fr/pierre/OTFFS ... ources.zip

Pierre

Member
(771 posts)

config OTFFSR (example) :

http://img253.imageshack.us/img253/218/otffsrconfigok0.jpg


I use blur frames=20 because i need to "blur" 20 frames to produces 1.

I capture fps is 1000 and final fps is 50 :
1000/50=20

joko

Member
(116 posts)

you should have mentioned that it relys on FreeImage (http://freeimage.sourceforge.net/ ) ; trying to build on ubuntu with latest version from the repos doesn' work. Just getting the sources for the lib and trying again

Pierre

Member
(771 posts)

ho yes sorry :(
it uses free image :D

i will try tomorrow with my ubuntu

clownfart

aka simon
(1024 posts)

Very nice, Pierre. Could you show us an example of moving at over 1000ups? I'd like to see how it looks. :)

Pierre

Member
(771 posts)

clownfart wrote:

Very nice, Pierre. Could you show us an example of moving at over 1000ups? I'd like to see how it looks. :)

it's not ups, but FPS xD

http://www.fuckingfrogs.fr/pierre/OTFFS ... OTFFSR.avi (look in the first post)

My first movie (h1oGL5) will use 1000fps capturing, but not with OTFFSR

clownfart

aka simon
(1024 posts)

No I mean record someone at 1000fps moving at over 1000ups and resample it.

Pierre

Member
(771 posts)

Rivon

Member
(150 posts)

On Linux I'd prefer to use GLC (capturing right from framebuffer, low-memory, low-cpu) + Avidemux ;)

Btw VirtualDub is not available for Linux :)

Pierre

Member
(771 posts)

I did some tests about performance (render time and space disk used).

I used 3 methods :
- Normal : capture @ 50fps and no resample
- Vegas : capture @ 1000fps and resample with vegas after capture
- OTFFSR : capture @ 1000fps and resample with OTFFSR during capture

Here the results :

Final video
Duration : 16s
Framerate : 50fps
Resolution : 1280x720
Codec : x264
Quantizer : 8

---------------------------------------------

Normal method

Time: 190s
Warsow capture 50fps : 44s
VirtualDub video x264 lossless : 146s

Space disk : 338MB
Warsow screenshots jpg : 800 files, 338MB

Quality : low

---------------------------------------------

Vegas method

Time : 3311s
Warsow capture 1000fps : 911s
VirtualDub video x264 lossless : 2040s
Vegas video x264 lossless : 360s

Space disk : 8161MB
Warsow screenshots jpg : 16000 files, 6767MB
VirtualDub video x264 lossless : 1394MB

Quality : high

---------------------------------------------

OTFFSR method

Time : 1109s
Warsow capture 1000fps : 960s
VirtualDub video x264 lossless : 149s

Space disk : 2109MB
Motion blur frames bmp : 800 files, 2109MB

Quality : high

Conclusion :
- OTFFSR is 3x faster than Vegas
- OTFFSR uses 4x less space disk than Vegas

I used 1000fps, but results are exactly the same with less fps (500 or 200)

Here a video demo : http://www.fuckingfrogs.fr/pierre/OTFFS ... st2_HQ.avi

Pierre

Member
(771 posts)

New release :D

Some improvements :
- CPU is not used if OTFFSR is not resampling (1 sec pause time)
- Config file
- Some optimizations in code
- Can stop and resume at anytime
- Error messages
- ...

http://www.fuckingfrogs.fr/pierre/.pixel/.transparent.png?warsow_OTFFSR

Download link : http://www.fuckingfrogs.fr/pierre/OTFFS ... -08-26.zip

KILLME

Member
(1508 posts)

Realy good work pierre!
I didn't test it yet tho but the comparisson video is impressive!

Pierre

Member
(771 posts)

KoFFiE

Member
(1895 posts)

Nice :) You could still optimize some by integrating your add_image_array and divide_image_array into your blur_frames in loop in the resample function I think :)

Some remarks though:
- if anything else than the image files is present in the directory it might give problems ;)
- you should replace the empty_image_array by memset(array, 0, image_width*image_heigth*3*sizeof(int)); - or better, use the calloc(count, size) function to allocate the buffers, which immediately clears the memory.
- Could give problems if the file-count in the directory is not a multiple of the blur_frames - you don't check if readdir returns NULL ;)

Pierre

Member
(771 posts)

Thx KoFFiE

then :

KoFFiE wrote:

Nice :) You could still optimize some by integrating your add_image_array and divide_image_array into your blur_frames in loop in the resample function I think :)

I did it for a better code look. Does it change performances ?

KoFFiE wrote:

- if anything else than the image files is present in the directory it might give problems ;)

Download last sources, and look at load_image()
error("Input file format error");
It stops the program :)

KoFFiE wrote:

- you should replace the empty_image_array by memset(array, 0, image_width*image_heigth*3*sizeof(int)); - or better, use the calloc(count, size) function to allocate the buffers, which immediately clears the memory.

calloc looks cool, thx :)

KoFFiE wrote:

- Could give problems if the file-count in the directory is not a multiple of the blur_frames - you don't check if readdir returns NULL ;)

Where ? I don't understand :s

Pierre

Member
(771 posts)

new release
download link : http://www.fuckingfrogs.fr/pierre/OTFFS ... -08-27.zip

Change :
- Faster, remove useless operation
- Lighter, 40% less memory

Thanks KoFFiE ;)

SNP

Member
(481 posts)

Very very nice Pierre :)

Pierre

Member
(771 posts)

Thx Snp !
I'm currently working on :
- other format export (easy)
- multithreading (not easy)

learn_more

Member
(3316 posts)

what do u want to do multithreaded?

KoFFiE

Member
(1895 posts)

The blurring could easily be multithreaded, and probably also the image loading and writing (if the FreeImage is thread-safe at least), but that would require a full rewrite I think ;) Dno if you'll gain a lot by doing so however, I think the main limit will be the disk I/O. You should use a profiler to check if it would be worth the trouble (threading is complicated). Most of the time will probably be spent in the FreeImage library anyway, loading and saving files, and the FreeImage_GetPixelColor/FreeImage_SetPixelColor calls...

[edit] Another optimization you could do is do the malloc and free of the image buffers in the resample_loop outside the loop, and use memset to clear the image_array var. The malloc & free functions might seem to be instant, they're not - they consume quite a bit of CPU power + context switches if the buffer is rather large (which is the case for this program). Since all buffers are always the same size - you could just keep them (make them parameters or global variables - whatever).

Also - you never check if the input images have the correct size ;)


Scroll to top



RSSRSSRSSRSS

Copyright © 2013 Chasseur De Bots

Warsow in social media



Warsow is an indie game developed by group of hobbyists. Please consider giving us a small donation: