问题
I need to design a app.That when Record the Video through Camera,Show and Record the SystemTimeStamp above the Video. Can it work with current Android Frameworks? If can, How can i do this? Thanks for anybody to read this!
回答1:
Follow the procedure below.
1. Capture video byte array (of each frame).
2. Now create bitmap from byte array.
3. Use link below to overlay text over bitmap.
4. Save those bitmaps to create video.
Text Overlay bitmap.
回答2:
You could follow a two-stage approach. First, record the video using the MediaRecorder API (which IMO is easier to use than MediaCodec - the Camera2 example is quite useful). Second, post-process the video with Taner Şener's wonderful mobile-ffmpeg, where you can simply add millisecond timestamps in the lower right corner with a command like:
FFmpeg.execute("-i \"" + pathToVideo + "\" -vf drawtext=\"fontsize=60:fontcolor=yellow@0.8:box=1:boxcolor=black@0.8:boxborderw=10:text='%
{e\\:" + startMillis + "+t*1000}':x=(w-text_w+6.8*max_glyph_w):y=(h-text_h)\" \"" + pathToVideo.replace(".mp4", "_overlaid.mp4" + "\""));
来源:https://stackoverflow.com/questions/18955655/how-to-record-the-video-through-camera-and-record-the-systemtimestamp-over-the