views:

1140

answers:

4

In short

For a project I need an audio/video-chat for 2 people, with the ability to record (part of) the session. I am running into issues where the 2nd user's recorded video gets messed up, with massive amounts of (seemingly) skipping frames and/or audio loss, most likely caused by the audio stream (when not recording the audio, the problem doesn't appear to occur).

Overview

For a project I need a setup where two clients can video(+audio, obviously :) chat with one another. Also, the 'host' should be able to record the session when (s)he presses a button, and stop recording in the same way.

While this setup is far from rocket science, I've been experiencing issues that I can't seem to figure out. The clients connect fine, and each other's videos show up propely and they can even hear each other just fine. I chose to re-initialize the connection when the host starts the recording, which also works just fine. The recorded files, however, at times experience issues.

The possible cause

Usually the hosts' recording is great, with audio and video working as it should. The client video shows problems, with the video literally jumping when played back (in a number of applications such as VLC, KMPlayer, Adobe's own media player, etc.). I tried to debug the situation and it seems to be directly related to the audio, though how this happens I'm not sure. When I did tests with no recorded audio, both videos played back fine.

The problem

I'll try to explain what happens in the client video; the video plays back normally, with audio working fine too. But in seemingly random locations of the video, playback suddenly skips seconds of the video (and audio), so a one minute video sometimes lasts mere seconds (even though the playback bar and the such show that the video in fact lasts for a minute).

I have not found any logic in how it skips --some videos show only 4/5 gaps of a few seconds each, others jump 20-30 seconds ahead--, so I'm assuming it's a random thing.

Scenarios

I have tested multiple scenarios, and the problem seems consistent enough (as in, it occurs every time, just not when I dont record audio). I have used a local (developer edition) FMS server, the hosted influxis service, and I have used two local computers, one local machine (using 2 webcams) and 1 local, 1 (really) remote computer. All setups seem to have the same issues with the recorded (client) video.

In closing

I'm not sure what details you need, so please, ask me for anything you might need to help me find a solution to this. I have searched and debugged like there was no tomorrow, and haven't been able to figure out what is causing this.

Many, many thanks in advance!

-Dave

A: 

Dave, have you ruled out latency? are the computers with both cams connected to a high speed network? I would also check the processor utilisation on the machine which is recording.

Nasa
Yeah, I think I ruled it out as much as I can. I've used a local development server (in fact, on the exact same machine), and even used two webcams from the same machine (using different web browsers, just to be safe).
Dave
+1  A: 

Hi Dave,

I've had some pretty extensive experience with FMS and specifically with influxis... Also did recording of both audio and video as the system I had needed it for security reasons. However, in all cases the video and audio were recorded on the server - not on the same machine as either client.

The issues I've seen include a vast amount of tweaking of both audio and video quality - to find the correct mix to get optimal results. That's where I'd start, adjust quality down and see where that gets you.

For a test environment, I'd suggest using different machines so the CPU doesn't become your issue - as the actual environment would have the clients on different boxes with more CPU.

Contact me with addition information, etc - I and several friends have a system working and I'm happy to help.

<>

Looked over my notes - we were able to talk to influxis about the lagging audio - and there were a couple of server setting they played with AND it was our frames-per-second and other quality guys...

Gabriel
Hi Gabriel! I've tried several environments to rule out the possible 'client same as server machine' issues. I too suspected that it would result in me having to find the perfect settings mix, but I am pretty much in the dark here. It's also very irritating that Flex Builder has absolutely no hinting or help information on what you can or cannot do in the main.asc file, so any help you can offer me is MUCH appreciated.
Dave
A: 

Hi there,

I'm also experiencing the very same issue. In my case, I'm trying to record 2, 3 or four videos at the same time. The problem seems to be random.

I've tested bandwidth, CPU utilization and some other variables, but none of them seems to be related to the problem.

Any ideas?

Ricardo
Hi Ricardo,Just testing purposes, could you do me a favor and disable sound recording? I'm not entirely sure, but it somehow seems like it's directly related to audio. Since you're recording up to 4 streams at the same time, it sounds like a great testing environment to see if I'm right.Thanks!
Dave
Thanks for your help Dave.I upgraded to a Xeon 2-core server (512 or ram!) and now everything seems to be smooth, even recording one hour of video+audio.Before the upgrade, I tested with the mic var muted by actionscript (but still attaching the mic to the out stream), and the problem was still there, happening randomly... Random issues are the ones that scare me more, but my guesses are:1) hardware problemor2) codec audio problemBandwidth and quality/compression didn't seem to be related, as even running on local gigbit lan with only 1 video, the problem was there.Thanks.
Ricardo
Btw, processor seems to be not related, as even with the previous server, the cpu consumption was below 10%. Now it stays below 5 or maybe 3% while recording.Funny thing is: the previous server had 1MB or RAM (Linux). The Xeon one has only 512MB (Windwows OS)
Ricardo
A: 

I'm not sure if my problem was the same as yours, but we found a solution.

The flash piece needed to set the silence level (setSilenceLevel) such that it didn't insert audio packets that signal no audio. These audio packets caused recording problems that produced random skips and audio drops.

AndreLiem