MOVING TO NEW FORUM link https://telestreamforum.forumbee.com This forum will become READ ONLY on Wednesday May 25, 2016

Telestream Community Forum
Decrease font size
Increase font size
Topic Title: Frame rate instability and dropped frames when recording to disk
Topic Summary:
Created On: 6/10/2010 10:42 AM
Status Read Only
Linear : Threading : Single : Branch
Topic Tools Search Topic
Topic Tools Topic Tools
View topic in raw text format. Print this topic.
 6/10/2010 10:42 AM
User is offline View Users Profile Print this message

Author Icon
ngn

Posts: 5
Joined: 6/10/2010

EDIT: I'm really sorry about the double post.

Hi Everyone,
I've encountered an issue and hope you can help me solve it.

I'm working in a psychology research lab and we want to set up a behavioral observation system. Basically, this system will consist of 3 cameras in a room observing our subjects. We'd like to record from these cameras to a disk. We'd like to get the best quality possible in the smallest file size (H.264 seems ideal). However, we need a stable system that will hold its frame rate and won't drop any frames throughout the recording (recordings usually last about 1.5 hours). This is important because we will be using these videos to code our subjects' behaviors and we'd like to be confident that the observations of our subjects are frame accurate in time (i.e. if a subject moves his/her arm and it takes one second, we'd like to be sure that our one second of video is accurate to reality -- no dropped frames or drifting frame rate).

I thought Wirecast would be the ideal system. I would like to use wirecast primarily as a switcher and--if it's stable enough--a recorder to disk (read on to see the problem I've encountered). I do not need it to stream over the internet or perform any other feature. I'd just like it to switch and record. The reason why Wirecast is ideal is because it allows any configuration of picture in picture. With our three camera setup, I'd like to have all cameras on the screen at the same time, with a "primary" camera scaled much larger on the screen than the other two cameras. I then will switch between what camera is the "primary camera". This allows for a view of all cameras at all times, while the primary camera provides the best and largest view at all times.

Because I knew this would be a demanding task, I just recently purchased the following Mac Pro:
2.93GHz Quad-Core Intel Xeon
6 GB of ram (3x2GB)
1TB 7200 rpm Serial ATA 3Gb/s Drive
ATI Radeon HD 4870 512MB Graphics Card
I also installed 3 Sonnet PCIe Firewire Cards and am using one for each camera.

For the A/D conversion, I am sending 2 cameras via analog out to Canopus Advc110 converters (firewire). I am sending another camera analog out to a DV deck (firewire) for conversion. I've noticed that the DV deck is one frame behind the Canopuses, so I'm ordering a 3rd canopus so that everything syncs.

I got everything set up and it looked great. However, when I imported my recorded video into Adobe Premiere (we use AP to code our subject's behaviors) and looked at the specs on the video, Adobe reported that there were dropped frames. I opened the video in quicktime and looked at the inspector and it said the frame rate was something like 29.86 (not 29.97). I scrolled through the video and did find a section where a frame seemed to be skipped. I went back to my wirecast setup and did a lot of tests. What I found was that on the highest quality of basically any codec, the video I recorded was not stable. When I imported the video into quicktime, it would give me a frame rate that was always lower than 29.97. This happened even if I was using a simple DV codec. I would like to use H.264, so I spent the most time testing that. At the highest settings, the frame rate issue was there. However, my CPU wasn't being taxed too greatly. At most, it went up to 40%. I dropped the compression rate down to Medium and that seemed to help the issue a bit but it still wasn't stable. Sometimes a video would come out perfect. At other times, I would see that the frame rate was lower. There didn't seem to be a pattern to the it. I did notice that I could somewhat predict when this issue would happen because when watching the video live while recording, I would sometimes notice a stutter, very quick and subtle, but it was there. This would result in a lower frame rate reading in quicktime. Again, though, my CPU never came close to 100%.

As for my Wirecast settings, I went into asset manager and made sure all my devices were set at 720x480. I am setting my screen size to 854x480. I'd like to record at that size, because then I can get a full size 720x480 image for my primary camera and position that camera all the way to the left of the screen. This leaves enough space on the right side of the screen for my other two cameras which I scale down to fit.

I've tried several tests. I've turned GPU processing off, which results in a better quality image, but the frame rate is less stable. Even with GPU off, the computer isn't being taxed that much (maybe 50%). I've checked and unchecked most of the preferences in wirecast with nothing that works. My device size is set to Native and my deinterlacing to Blend. I'd like to keep it that way for maximum image quality.

I've also tried different compression settings. I've tried to limit the peak bit rate, but the resulting video is much harder to play back in Adobe Premiere and Quicktime. I can't easily jump to different places in the video and scrolling through the video results in hangups. Even with peak limit on, though, I still get the frame rate instability. Lowering the bit rate doesn't help fully either. It helps some, in that some videos I record are locked at 29.97 (quicktime lists this as the frame rate). But it doesn't help fully. About half the time, quicktime will report a lower frame rate. I should also note that when quicktime reports this lower frame rate, it isn't always the same. It can range from 29.70 to 29.95

So, I have multiple questions at this point:
1. What does it mean when I get a frame rate reading of 29.86 in quicktime?

2. Is there any way of using wirecast just as a switcher and then recording to some other software encoder dedicated to stable and accurate encoding? Like I said, the CPU isn't being taxed too much. There seems to be a lot of unused processing resources. Perhaps running some other software encoder is a better option? If so, any recommendations on what encoder/software to purchase and how to route wriecast to it?

3. If #2 isn't an option, how can I go about identifying/solving this problem in wirecast, so that I can use it as a total package (switching and recording)?

4. What tests can I do to track down the source of this problem?

5. Could this have something to do with the fact that I am running two canopuses and a DV deck? Will replacing the dv deck with a thrid canopus help?

6. Could this be a hard drive speed issue?

7. This seems to be happening at any codec I choose. DV-NTSC was bad, Mpeg4 was bad, others too at several different bit rates. So then, is this an encoder issue, bit rate issue, computer issue or what?

As for the image and the quality, everything looks great! I would be completely in love with Wirecast right now if it weren't for this one issue. So, I'm really hoping that I'm able to solve this. Thank you in advance for your help.
 6/10/2010 12:53 PM
User is offline View Users Profile Print this message

Author Icon
CraigS

Posts: 54277
Joined: 4/4/2007

1. frame rates can vary slightly. Try using Apple Intermediate Codec.
2. yes, use Broadcast>External Display Out and send to the recorder of your choice.
3. Currently no way easy way to do this. Changing to MainConcept codec in Wirecast 4 may help this.
4. See above.
5. It has to do with system resources, codecs, other things and it may not even be CPU use specific.
6. Some have said using SSD have resolved dropped frames issues but I haven't tested for verification.
7. Try AIC although no guarantee that'll be a complete cure.

-------------------------
CraigS
Telestream Desktop Forum Moderator
 6/10/2010 2:05 PM
User is offline View Users Profile Print this message

Author Icon
ngn

Posts: 5
Joined: 6/10/2010

Thanks for the reply. It should be noted that I'm currently working with the trial version of wirecast, in case that makes a difference. I will try AIC today and let you know how it goes. I forgot to mention that I tried to see if this was somehow related to the complexity of the image. So, I would wave my hands in front of the cameras to get a picture with a high degree of movement. It was hard to tell if this increased the problem. Like I said it was somewhat unpredictable. However, I think it may have something to do with it.

How can I best use Brodcast>External Display? Does it output to firewire? Or will I have to go out my monitor out? If the latter is true, what kind of resolution will I get? What's the best setup for sending the live picture to another recorder?

Thanks
 6/10/2010 4:32 PM
User is offline View Users Profile Print this message

Author Icon
CraigS

Posts: 54277
Joined: 4/4/2007

The trial of Wirecast is fully functional except for the watermark.
Do try AIC. It might lock to the frame rate.
Apple's H.264 is highly variable whereas MainConcept H.264 is much more consistent. That's one of the reason's Telestream is making the switch in Wirecast 4.
Broadcast>External Display uses the Graphics Card out. It's DVI on a MacPro. You can use a DVI converter to send it to something else. We'll be looking at these more closely (not officially tested yet) but some example devices are:
http://www.blackmagic-design.com/products/dviextender/
http://www.matrox.com/video/en/products/mac/mxo/
http://www.matrox.com/video/en...ducts/mac/convert_dvi/
I know a few users have used the MXO out and have been very happy with the resolution.


-------------------------
CraigS
Telestream Desktop Forum Moderator
 6/17/2010 10:35 AM
User is offline View Users Profile Print this message

Author Icon
ngn

Posts: 5
Joined: 6/10/2010

Craig,
Thanks for the hints. I have some updates to share. First, is that the engineers got in touch with me and sent me the following email:

"Due to the nature of Wirecast, we cannot ever guarantee a specific frame rate. However, Wirecast does specify the duration of each frame and when dropping frames properly accounts for that on playback. Meaning even if frames are being dropped, the total duration is the same. So 5 seconds worth of video will still be 5 seconds, even if it was technically 29.86fps because the frames surrounding the missing frames will be longer (producing the nearly imperceptible "stutter" of ~30ms)."

However, after further tests, I think my issue is not an inherent naturally functioning issue with Wirecast, but some sort of bug with the OS X version. I say this first because the issue is not a variable frame rate issue per se, but a stuttering/glitch in wirecast causing it to drop frames. Second, I tested Wirecast on OSX and Windows 7 using the same exact computer and got hugely different results. Here's what happened:

In OS X, the problem shows up as this: I set wirecast to record to disk. I have the output statistics up so that I can see the FPS. If I start to wave my hands in front of the camera, or create some sort of complex image to encode, eventually, I'll see a stutter in the picture (i.e. it freezes for a second and then releases). At the same time, I hear the computer stutter (not sure if this is the sound of the CPU or the hard drive crunching), and then I see a little blip in the FPS in the output statistics. The FPS falls and then recovers. In other words, the FPS doesn't stay steady and constant. CPU usage hovers the whole time around 20%. I have tried this with every codec, every preference option in wirecast checked and unchecked. No matter what I do, if I hit record and start to wave my hands, it will happen eventually. Sometimes I have to wait a little while, but I eventually get a stutter and a drop in FPS. It seems to be marginally better if I lower the bit rate, but it really isn't stable. It gets worse if I unclick GPU processing. And, like I said, it seems to be somewhat related to the complexity of the image. Strangely enough, it seems that the problem isn't when I'm actually waving my hands, but when I stop waving them and pause for a second. Give it a test on your end. Sometimes you have to wait a bit, but it happens.

I thought this might be due to the hard drive, so I installed an SSD. That didn't fix the problem at all. Same thing.

The problem is that for the work I want to do (recording behavior), I need the frame rate to stay constant and consistent. I don't mind as much what frame rate it locks to (somewhere around 30fps) as long as it locks to something and stays steady and consistent from recording to recording. I feel like this isn't how Wirecast is supposed to behave. It might be some sort of bug or driver issue or something causing a bottleneck somewhere.

I was sadly about to give up (and wait for Wirecast 4 with fingers crossed). But, I decided to install Windows 7 on the same computer and test out Wirecast with H.264 encoding. To my amazement, I hit record and the frame rate was locked and steady at 29.97 in the output statistics. No matter how much I tried to tax the encoding by waving my hands in front of the camera, I could not cause a single stutter or blip like I got in OS X. This gives me hope that the problem is a problem in OS X, and that Wirecast normally will stay steady with a good enough computer. I was doing this Windows recording to the system drive (7200rpm). I didn't need to test it on the SSD because it was steady without it. This worked best for H.264 encoding and the Windows Video codec (though the latter codec would cause a crash when I went to stop the recording). I tried the DV codec, but found that the frame rate was blipping (blips seemed rhythmic and steady and unrelated to waving my hands). Sorensen codecs were impossible. Mpeg4 codec had some blipping too.

To summarize, in OSX, I got blipping at every setting and every codec and no matter what hard drive I recorded to. In Windows 7, it seems a lot more stable and I got a locked frame rate in H.264 and the windows codecs, and more stable, though not perfect fps in the DV codec, recording to my system drive. I also noticed that when turning GPU processing off in OS X, this made the problem way worse. Turning it off in Windows 7 didn't have any effect at all. Also, raising the bit rate didn't have any effect in Windows 7 like it did in OS X. Somehow, Windows 7 is running a lot smoother, though CPU usage in both OS X and Windows is identical.

That said, there is one remaining problem. Although the frame rate in Windows 7 is locked and stable and the recordings are consistent, regardless of the complexity of the image, I always end up with a video stream that is 29.96 fps. I am happy that this is always consistent and steady (in OS X, the fps of the recorded files were always variable due to the random blips). But, I'd like to get it to 29.97 if I can. This is not a rounding or header issue. I've verified that the video is actually playing at 29.96. Is there any setting I could tweak (monitor refresh rate, preferences, codec setting) to see if I can get it to move up just .01 fps? My problems would be over if I could do that.

I've been reading the boards and will run some more tests today. One issue that might be causing my 29.96 fps video files is that maybe Wirecast can't record at 29.97 perfectly. Wirecast only allows you to display the video at 25, 30, 60, and Monitor Refresh Rate in the preferences. There is no option for 29.97. So, when I record with the codec at 29.97, maybe it can't do it. It has to choose 29.96. Why is there not an option on Wirecast for displaying the video at 29.97? Or, better yet, an option to set a custom display? That might solve this issue and others. Is there a way I can tweak the preferences to unlock this option? Or, is there a way I can set my monitor refresh rate to fool wirecast into displaying at 29.97.

When it comes down to it, I'd be happy to record in 30fps if it stays locked and steady and consistent. I've read on the boards that others recommend 30fps over 29.97 fps. So, I will do some tests today at 30fps and let you know. Maybe, since I can set wirecast to display at 30fps, choosing 30fps in the codec will lock it at that rate, which is a more conventional rate for video display and editing. In OSX, I could never get it to lock no matter what frame rate I used. Hopefully in Windows 7, it will stay locked at 30fps and the resulting video will be clean and stable. I'll let you know.

Any suggestions are greatly appreciated. Thank you!
 6/17/2010 11:15 AM
User is offline View Users Profile Print this message

Author Icon
CraigS

Posts: 54277
Joined: 4/4/2007

Update OSX to 10.6.4 and ONLY use Apple's Combo Updater, NOT software update.
Wirecast frame rate control only exist via the settings you've found as engineers noted for various reasons related to the nature of decode and encode for live streaming, the end result may not be precisely 29.97 whether Mac or Windows. When Wirecast switches from Apple's H.264 to MainConcept H.264 in version 4, that may help that particular codec but the issues around frame rate impact all codecs.

Another solution worth investigating is using Wirecast's External Display Out feature and using a DVI to video convertor going to a recording device. That may give you output pre finale encode.
BTW you should fill out this form and send it to the engineers with the URL of this thread in the Comments area.
http://www.telestream.net/tele...st/contact-support.htm
This way they can follow our discussion on the forum and may be able to send you ideas or do additional testing and respond.

-------------------------
CraigS
Telestream Desktop Forum Moderator
 6/21/2010 10:50 AM
User is offline View Users Profile Print this message

Author Icon
13zebras

Posts: 19
Joined: 4/15/2010

Just a quick comment for ngn: I did some research on recording to disk with regard to the best hardware to use, and, surprisingly, SSDs are NOT a good choice. They have great random write speeds but fairly mediocre sustained write speeds, which is what you need to record video. Looking at test results from various hardware websites, it appears that the best bet is a 10K hard drive like the WD VelociRaptor. A 300 GB drive was reasonably priced, so I popped one in my Mac Pro, and it records smooth as silk in 720p AIC 30 fps. It is quiet, too. I'm recording about 90 minutes of video at at time in AIC, and it although it created a file that was 18 GB, no big deal with this drive. Frame rates were solid as a rock, too, and that was with two live streams heading out to the Internet.

I also tossed an SSD into my Mac Pro as a boot drive and for applications. Again, with incredibly fast random writes and reads, the SSD is ideal for boot drive and applications. I use the 640 GB stock hard drive for all other data (my Home folder is on it). The basic premise is to separate hard drive tasks to the best drive for the job.

Also, nice thing about AIC is that it is an easy encode to any other format via Compressor. It takes a little time, but that's not too big a deal.

Anyway, I hope the above is of use to you. Good luck.... Tom
 6/21/2010 12:34 PM
User is offline View Users Profile Print this message

Author Icon
CraigS

Posts: 54277
Joined: 4/4/2007

Tom, thanks for that. There was another customer who said that switching to SSD eliminated dropped frames issue. Of course it may be some SSD are better at sustained writes than others and of course they may have been using a codec set to a low data rate.

It's good to hear that a 10K VelociRaptor worked.
Although these tests were focused on boot drive, the large block writes with the VelociRaptor far exceeded the speed of the SSD they used. Dual drive was faster than single.
http://www.barefeats.com/hard103.html
also see these tests
http://www.barefeats.com/hard112.html

Tom, if you open your file in Quicktime (either 7.6.x or 10) what frame do you see in Movie Inspector? Is it 30fps or 29.97 or a slightly lower number?

-------------------------
CraigS
Telestream Desktop Forum Moderator

Edited: 6/22/2010 at 12:54 PM by CraigS
 6/21/2010 2:57 PM
User is offline View Users Profile Print this message

Author Icon
13zebras

Posts: 19
Joined: 4/15/2010

Hi Craig,

Movie Inspector shows 29.85 fps. I monitored Wirecast off and on during my broadcast and saw nothing by 30 fps. However, for my purposes 29.85 ~ 30.00 fps. However, I never saw Wirecast report anything but 30 fps, and I remember with some of the tests I was running seeing frame rates drop. In the end, a 2 x 2.26 GHz 8 core Mac Pro, SSD, Velociraptor, etc, gave me rock steady performance and very CPU usage (15%) for my two streams (1.0 Mbps and 400 Kbps) and record to disk. I am surprised to see that Quicktime shows 29.85 fps, though. Is Quicktime showing an average for the entire movie?

I saw the tests you referenced above. I had seem similar data. The key is sustained writes and large blocks. SSDs just don't cut it. The best are 15K drives, but all those are Serial Attached SCSI drives. I don't care to have another PCI card and the noise from one of those whining. The Velociraptor is very quiet. It's a cool little drive, actually the form factor is 2.5" but package in a 3.5" plastic outer case. Very cool. Anyway, it works great for me!

From everything I could find, the optimum system would seem to be an SSD for the boot/application drive, a regular 7200 drive for data and a Velociraptor for recording video.

Tom
 6/22/2010 12:58 PM
User is offline View Users Profile Print this message

Author Icon
CraigS

Posts: 54277
Joined: 4/4/2007

Quicktime shows average. There may be slight fluctuations in frame rate. What Wirecast does is adjust frame duration so timing remains constant.
Thanks for the feedback on your experience with the VelociRaptor. Having that on the forum will help lots of users in their record to hard drive selection.

-------------------------
CraigS
Telestream Desktop Forum Moderator

FuseTalk Basic Edition v4.0 - © 1999-2019 FuseTalk Inc. All rights reserved.

MOVING TO NEW FORUM link https://telestreamforum.forumbee.com This forum will become READ ONLY on Wednesday May 25, 2016