Link to home
Start Free TrialLog in
Avatar of aclaus225

asked on

Understanding Streaming Issue

Today I used Facebook Live with Wirecast's presets of 4 Mbps and 30 fps. In an hour I had over 65000 drops frames. My camera is set to 29.97 which I guess explains some of the dropped frames, but when I viewed my completed video it was only 36 minutes and the audio was at least 3 minutes behind the video. Is this because I don't have enough bandwidth or is there another problem with my computer? I never noticed my processor nor memory maxxing out.
Avatar of Owen Rubin
Owen Rubin
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of aclaus225


When I say three minutes it is a conservative estimate. For the last three minutes of the stream that speaker was not on stage and the video cuts off when I stopped the stream.
For the first 40 minutes real-time there was no audio at all because it wouldn't stream. When I did get it to finally stream then what I was hearing going out was in sync with the video.
That is fine, I was just trying to save doing math to see if I could figure out why.

What player are you using to watch the video? Have you tried VLC?
I did it by accident. I reported my comment after I realized that I marked it as solved. I did not discover anything yet.
Thanks. Took me by surprise!  :-)
Alright, so the video displays as being 34:51 in Facebook Videos and the true length is 1:01:06.  As far as codecs, I used the Wirecast defaults.  I know it defaults to 720p30 and 4 mb.
Everything I read says that Wirecast's default settings should work with Facebook Live, but mostly selecting their defaults, I cannot change anything, so I know it is doing H.264, 44.100 on audio, along with 128kbps.
This is the streaming video that is messed up.  I know that there are skips in it, but my original estimate was wrong.  He stopped talking over 5 minutes before the video ended. is the bad video.  I re-streamed the audio with a mostly empty room with full audio:
But was the audio ever correct, even at the beginning?

I am failry sure that all those dropped frames have added up to a lot of sync errors. I do not know that codec you used, but if it does not do keyframes (a place where a full video frame is saved) often enough, sync can be a big issue, especially with that many dropped frames.

Back of envelope, the difference between 29.97 fps and 30 fps can cause some errors:
29.97 fps in one hour is 107892 frames  (basically, frames per hour)
30.00 fps in one hour is 108000 frames  (basically, frames per hour)
In one hour, the difference is about 62892 frames, not far off from your dropped frames count. So a difference between the 29.97 and 30.00 frames IF the playback speed is wrong can be very big.
Think what 62829 frames at 30 fps = approx 2094 seconds, or 34.9 minutes difference.

I am guessing the playback rate may be wrong, causing you to "loose" that much time, and get way out of sync.
The video that ended up on Facebook was never in sync. The video that I saw being sent from the computer was in sync. So, I guess, my question would be, are dropped frames on input or output? In other words, am I dropping frames from the capture or on encoding?
I guess I would have to see a diagram of how it is all connected and study the pieces. But fairly sure that the two systems were running at different rates, which caused problems. Any place where the frame rate changed can be a cause of dropped frames. I am not sure in your set up where it went from 30 to 29.97, but I suspect the encoding.

In the future, they should all be at the same video rate and you can always transcode (to a different rate) after you have a good master.

Can you get access to the file on the computer to encode again?
As a side note,  I tried to convert some HD video into SD video, and had the creeping sync errors, and for me, it was.not using the same video rate as the source. But what happens when you can’t use the same rate?

Just as an example: Frame rate was a problem when converting film, at 24 fps to video at (approx) 30 fps for TV. It required encoding trick called 3:2 pull down. This is a great example of how things might go badly, and a clever trick to get around it. The conversion really shows up in a panning scene where you can see a small stutter in the video that was not in the film. Otherwise the film would run silly fast.

User generated image
Similar problem was seen when British TV (PAL) is 625 lines at 50 fields/s (25 frames per second) is converted to  American TV (NTSC) is 525 lines at 59.94 fields/s (60,000/1,001 fields/s). Aside from the line count being different, converting to a format that requires 60 fields every second from a format that has only 50 fields poses difficulty. Every second, an additional 10 fields must be generated—the converter has to create new frames (from the existing input) in real time. Often, British TV in America runs a bit faster than in Britain.

Just a few examples to show that this has been a problem for some time now.
The video was encoded live with no recording existing apart from what was sent to Facebook so I cannot encode it again.

My camera itself runs at either 59.94 or 29.97 fps and Wirecast was configured for 30 fps. The video should have come off my camera, gone to Wirecast, then gone to Facebook. OBS Studio and FMLE do not seem to have any issues, apart from lines in OBS if the people move, but no dropped frames.
The bitrate is automatically set at 4128k in Wirecast, which makes sense.  It is using 4000k for video and 128k for audio.  I was also wrong on the audio sample rate, which is 48.000 not 44.100.
In the end, I changed Wirecast to my own presets of 29.97 fps and 1 Mbps and everything works with 1 total frame dropped.

I think the combination of 4 Mbps and 30 fps that Wirecast uses simply overloaded the computer.
Excellent. I am actually surprised in the setup you described that you should have had such problems, so maybe it happened after it got to Wirecast, but happy that you were able to get things working. These kinds of errors are often a surprise, and actually Wirecast should have been able to detect your incoming stream info and transcode it properly.