0

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!

DonkeyTomy
  • 23
  • 3
  • You might be interested in my answer to a similiar question [here](https://stackoverflow.com/a/65505230/361413). – bk138 Dec 30 '20 at 10:13

2 Answers2

4
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.

Community
  • 1
  • 1
Bhupinder
  • 1,329
  • 1
  • 14
  • 29
  • 1
    Hi,Bhupinder.Thank you very much for your reply!But I'm so sorry that I don't know how to complete the step 4.Could you give me some suggestion or links to study this knowledge?However Thanks! – DonkeyTomy Sep 23 '13 at 10:48
  • Here are few tutorials see below http://boofcv.org/index.php?title=Example_Android_Video http://stackoverflow.com/questions/1817742/how-can-i-capture-a-video-recording-on-android http://stackoverflow.com/questions/1893072/getting-frames-from-video-image-in-android/2164906#2164906 – Bhupinder Sep 23 '13 at 11:23
  • Thanks for your patient!I'll look these carefully. – DonkeyTomy Sep 24 '13 at 02:20
0

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" + "\""));
bk138
  • 3,033
  • 1
  • 34
  • 28