Investigation of fraps / lags / hddperformance / fpsdrops

Discussion in 'Fraps General Discussion' started by heldiX, Oct 6, 2011.

  1. heldiX New Member

    Advertisement
    Hi to you,

    i am from Germany and have to apologize for my bad english which i will use in the following lines.

    My System specs (its from 2008 so not really fast)
    Intel i7 920 @ 4 Ghz
    Asus P6T Deluxe
    6 GB Mushkin @1600 DDR3
    280GTX OC
    2x500 GB WD Raid 0

    Goals
    Recording World of Tanks 1680:1050 or 1080p at 30fps stutterfree and without negative effects on my gaming performance (i already play bad enough :( )!

    Lags / FPS-Drops / HDD-Performance / CPU-Performance?

    I bought fraps years ago and now i play a game called World of Tanks which made me remember Fraps.
    Because WoT is NOT multithreaded and uses only 1 CPU-Core i was confident that the whole thing just would work fine!
    NOT!
    60 fps for ~10 Seconds than the fps go down to ~25-30 and stay there. Shoot up to 60+ for some seconds and the same slowdown again.
    That wrecks my nerves i can not stand that.

    So i went deeper into this.

    I installed a RAMDISK (HDD = ~100 MB/SEC, Ramdisk = ~4500MB/SEC) on my computer and frapsed on that 3 GB Ramdisk.
    Guess what? 60fps + stutterfree, just perfect!
    But: The ramdisk is full too early :)

    I write computer programs sometimes. So iwrote a program that simply checks the ramdrive, checks the file Fraps is writing on it and if fraps finished with that file it moves it to the hard drive.

    I was sure that fraps is recording faster than my program can copy the file from the ramdisk to the harddrive and that sooner or later the ramdisk will exceed its space.

    But: NOT! I could now ENDLESSLY record 30 fps 1080p on my computer (ingame 60fps+, stutterfree etc!) with the trick that fraps records on ramdisk and my program moves the Fraps-Parts to the Harddrive.
    (Files were moved at half of the time the recording time was ! ( That makes sense, because 30 fps 1080p is ~40 MB/sec and my Raid 0 can handle around 100MB/sec)).

    That leads me to some thoughts:
    * In my system is NO bottleneck (too slow HDD, CPU, FSB, RAM, Drivers, Settings, Defrag.)
    (That to so many posts in this forum where everywhere the answer is: HDD to slow, use external HDD, Defrag, check Drivers, Reinstall...)
    * Fraps may be not perfectly programmed - I think off the file operations especially. I think there are timing problems like the fraps "screen capturing" and "file writing" process are not well divided and block each other on high settings
    => Why not recording the stream to a buffer which may be 256MB or so (RAM costs nothing these days) and a second thread of fraps (second thread means it could use more than 1 cpu core) is just always emptying the buffer to the harddrive.
    => With a system which can handle stable ~100MB/sec writedatarate on its HDD it should be possible to nonstop record a stream which is 40 MB/sec without lags/spikes/stuttering.

    2. Realtime conversion!!!

    With my little program i tried to go further! I didn't want to just move the file constantly from Ramdrive to HDD, no, now i wanted to realtime compress it!

    And not just anyhow! I wanted to compress it via x264 at lossless quality!

    It was just so simple to program. The hardest part of my programs code was to get together this line:

    runProcessAndWait(sVideoLanExecutableDir+'\vlc.exe -I dummy --dummy-quiet "'+sDateiUrsprung+'" --sout=#transcode{threads=auto,vcodec=h264,venc=x264{crf=20,preset=ultrafast},fps=30,acodec=mp3,ab=192,audio-sync,samplerate=44100,channels=2}:standard{access=file,mux=mp4,dst="'+sDateiZiel+'"} vlc://quit');

    My program now does this in a loop:
    * List all fraps-movies on ramdrive
    * Take the first which is not written into at the moment
    * Convert that file via the opensource tool VLC/VideoLAN using the fresh x264 plugin (one of the best h264 codecs (+opensource) there is) with some individual options directly from the ramdisk onto my harddisk.
    * Delete the sourcefile of fraps from the Ramdisk to free the space
    * Restart Loop

    What should i say? It just works. And it works good! And: The amount of data written to my HDD has reduced drastically because the parts are now well compressed via x264. With my previous solution where i just moved the fraps parts my HDD had to write 800 MB / 20 Seconds which is 40 MB/sec, now its ~100MB / 20 Seconds = 5 MB/Sec.
    At that rate it is no problem if the antivirus scans, windows indexes files etc, concerning the I/O / HDD-Load the system has much more room.

    My tools finishes conversion of the fraps parts to the HDD ~5-10 seconds before the new parts arrive so the ramdisk never runs full.

    But the CPU-Load has increased drastically. That should be clear. My 4/8 CPU-Core which have been ~5-10% each now are nearly at 100% each (VLC-process takes what it gets at low priority).

    Just gaming and recording fraps the old way like big files no compression my system consumed ~300 Watts, with realtime compression it's nearly 400 Watts :rolleyes:

    I now nearly have what i've been dreaming off all day long! Flawless stutterfree highresolution capturing using fraps! PLUS on the fly maximum quality conversion to h264/x264/AVC or how u call it.

    The ppl still awake will detect what i still lack off:
    Yea Fraps Parts are ~4GB of size. And my ramdisk only has 3 GB. How do i handle that?
    I implemented a sperated timer in my tool that hits F9 (recording hotkey) two times in a row with a delay of 50 milliseconds every 20 seconds.
    What does that lead to?
    At 1680x1050@30fps this leads to 900MB Chunks on the Ramdrive and not 4 GB Chunks. But yes u miss 1-2 Frames between and with good eyes u see a shooort stutter between the 900MB Chunks if u join them :(

    What would be the better solution?
    Go and buy additional 6 GB of DDR3 RAM for 50€.
    With then 12 GB of RAM i can easily put the RAMDISK to 9 GB.
    Then i dont need my custom 900 MB Chunkfunction anymore and can just use the standard 4 GB Fraps Chunks and then FINALLY would have 100% exactly what i wanted to have...

    3. Looped files getting to big

    I now could go on and say that i wrote another function that checks the movies fraps recorded, checks wheter "looped" files are within and trims them within 2 seconds to the size they really should be and not 4 GB! Onthefly and in the background.

    4. Conclusion:
    Dont understand me wrong! I think fraps is a great tool with a impressive history especially at gaming recording. And consider how cheap it is for that!
    But systems have got bigger and stronger in a way it might be at the time to use this... Playing games with 8 core cpus, every core at 5% makes ur CPU sleepy.

    5. Wishes

    *Different Chunksizes -> Cap at 500 MB / 1GB / 2GB / 4GB (i can understand the 4 GB because of FAT32 Limits and possible errors) (than i dont need to buy 6 GB of RAM :) )
    + That would ALSO reduce the effect of the loop effect, that when long recording even when u just choose 1 second of looped recording the file is 4 GB of size...
    + Imho that function should not take too much time to code. Maybe it is just as little as to make one little variable be changeable in the frontend :rolleyes:

    *Try to locate the weakspot in fraps filewriting process

    Ok its 4am here but i am a kind of guy who just can not sleep if he is onto sth.

    Greetings,
    heldiX

    Attachment 1 - Benchmark of my RAM-Disk
    hddtune.png

    Attachment 2 - Different Fraps - Chunksizes (mentioned F9 timed function)
    size.png
    Arek and raffriff like this.
  2. raffriff Active Member

    :):):):):)

    I was surprised that you can copy the file off the RAMdisk while Fraps is writing a new one. Amazing!

    Personally I like the Fraps file format - but lots of people need real-time compression. Great!

    I hope Beepa.plc offers you a job. Think carefully before you release a program yourself though, because your life will be occupied from then on with answering questions on the internet! ("why can't I record 2560x1600 @60 fps", etc)
  3. Shadow456732 New Member

    Sorry if this thread is old. But i beleive im having the same issue. My pc specs are:

    Asus n53sv-Xe1 (laptop)

    Processor: Intel i7 QM 2.0GHZ
    Graphix: Nvidea geforce GT 540m (1gb)
    Hard drive: 500 gb's (thats all i know)
    RAM: 4GB
    OS: Windows 7 home premium

    I tried using fraps to record some gameplay on minecraft. Though my PC specs are well above the recommended for both fraps and minecraft, i noticed random lag throughout the recording! I looked around and found that it was the same problem. Now as i have not been programming long, i could not write myself a program to do what yours did. So i was wondering what you would recommend as a solution. Its just been a real headache trying to get this to work. Thanks for any help i can get!
  4. raffriff Active Member

  5. plonk420 New Member

    think you'll ever release this?

    careful when you take CPU usage up this high. it may steal performance away from GPU/game. case in point: try running a 3DMark with and without prime95 (or similar, like, say, seti@home)
  6. Shukaku Member

    Seeing as the OP hasn't been viewing the forums since they posted this thread, I highly doubt it.
  7. frapsforum.com Administrator

    You could try private messaging him, he might get an email.
  8. raffriff Active Member

    Anybody want to try partitioning with FAT32, for a maximum file size of 2GB?
    You can force an even smaller max size by formatting with smaller clusters.
    http://en.wikipedia.org/wiki/FAT_file_system#Size_limits
    EDIT - a FAT32 RAMDisk with 8 sectors/cluster *should* result in 1GB Fraps segments...

    BTW the 4GB size limit is not due to the file system but is for backwards compatibility:

Share This Page