before use opencv compress video
modify AVFrame pts according to make video and audio syn

http://thompsonng.blogspot.com.au/2011/09/ffmpeg-avinterleavedwriteframe-return.html+&cd=1&hl=en&ct=clnk&gl=hkrintf("before system")