MediaRecorder get Timestamps while recording

拜拜、爱过 提交于 2020-06-28 04:27:17

问题


In my application I am recording video using MediaRecorder. Is there a way how I can count up a timestamp (as precise as possible) durring recording a video. I need this timestamp in order to synchronize some data with the recorded video afterwards.


回答1:


You can get the timestamp by calling to:

Long timestamp = System.currentTimeMillis()

Just call it after you call start().




回答2:


I think you can get timestamp from SurfaceTextur getTimestamp().

The base time (zero point) will be set by the source who is updating SurfaceTexture using updateTexImage(). I assume for you it will be camera.



来源:https://stackoverflow.com/questions/26502238/mediarecorder-get-timestamps-while-recording

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!