12-04-2006 11:41 PM
12-05-2006 07:29 AM
12-05-2006 01:56 PM
12-07-2006 02:25 AM
01-30-2007 09:32 AM
Hi! I found this thread and i would like to ask you if you could get any closer to 1000frames, cause i have the same problem.
I am trying to get higher but i am stucked at around 650/s, and still couldnt find any solution for sending more frames.
If you solved this problem pls let me know the details of your trick! 🙂
Thx in advance!
Gábor
01-30-2007 05:54 PM
Yes, I did break 1,000 Frames Per Second. I got up to 1,714 and 1,742 using two different methods. This is at 250 kbps, if you used 500 or 1 Mbps, you could get more frames. If you have 125 kbps, you might not be able to break 1,000 Frames per Second.
ncWriteMult is the key. You can load 512 frames in a queue at a time. I would put 256 on at a time and check to see if there was less than 256 frames left in the queue and if there was, load it up, that way the queue would never be empty. I went about it 2 ways, one was using ncGetAttribute to determine space left, and that got the faster method, however, I was also trying to read the messages to verify that it worked, and I had problems with logging every frame. It would also send the first 40 ncWriteMults quickly, as if the queue it was filling was much larger than 512.
The other way, was using trial and error to determine how many MS to sleep before writing the next batch of 256 frames. There are variables outside of my control that determined the time it would take and it would vary a few ms. I wanted a stable environment that could send forever without filling the queue so I went with a value that would wait 2 or 3 ms, depending on conditions before writing again. The value I used was 142 ms, I think. Your Mileage May Vary.
There is also a way to do some error handling that I did not try to utilize. Instead of the process crashing, there is a way to tell it to wait if this error is returned. That might be the best way for me to implement what I wanted to do, but I was assigned another task before I tried to get that to work.
There is a timing element in ncWriteMult's documentation I didn't look into very much, but that would space the frames out and could send 1,000 frames a second evenly distributed, instead of sending them as quickly as possible, wait some ms then send another batch.
If anyone could link us, or provide some code snippets of the error handling, or proper usage of ncGetAttribue, or some way to read faster, that would be greatly appreciated.