mixiyihao / spydroid-ipcamera

Automatically exported from code.google.com/p/spydroid-ipcamera
GNU General Public License v3.0
0 stars 0 forks source link

AMR and H.263 are not synchronized after Spydroid runs for a few minutes #70

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Phenomenon:
Run Spydroid with AMR and H.263. After a few minutes the video and audio are 
not synchronized. 

Probable reason:
I have checked the code of AMR and H.263 packetizer class. I find they use 
different ways to calculate RTP time stamp. I tried to change the way of AMR to 
the one of H.263 and it was better.

Original issue reported on code.google.com by jiachu...@gmail.com on 12 Oct 2012 at 9:18

GoogleCodeExporter commented 8 years ago
the reason for that is audio time is calculated solely based number of frames 
while video time is estimated with system clock. 

my simple fix is use audio time as reference while estimating video time. 
Basically adjust video time increment according so it won't outrun audio.

Original comment by xianzhan...@gmail.com on 4 Jan 2013 at 6:38