This is a pretty difficult problem to solve generally using android assuming that you are attempting to add the text to the actual video file, and not simply displaying a TextView
over a VideoView
. You mention that you currently have the time and video separately, so I assume you are trying to add text to the video file itself.
In order to add text to a video you would need to re-encode the video on the actual device. Re-encoding video on Android is tricky primarily due to the different processors on Android phones, and that encoding is processor dependent. There is an open source iOS library called GPUImage
that allows you to do this, but this is unfortunately not available on Android.
There has been some effort to compile FFMPEG for Android (which would theoretically allow this kind of thing to occur), but this involves some serious work with underlying C++ code, and I haven't found any application that implements this simply on many devices (check out this video converter, and notice how for different phones different codecs need to be downloaded). For one specific device you may have more luck, but if you are looking for easy distribution across many devices you may have a hard time doing this.
At this time, there is no easy solution for this problem.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…