문제

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!

도움이 되었습니까?

해결책

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.

다른 팁

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" + "\""));
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top