Wayne a876d24cd9 Add readme | 6 年之前 | |
---|---|---|
src | 6 年之前 | |
.gitignore | 6 年之前 | |
README.md | 6 年之前 | |
build.gradle | 6 年之前 | |
proguard-rules.pro | 6 年之前 |
Example
val w = 320
val h = 240
val speed = 6
val imageCount = 120
val file = File(Environment.getExternalStorageDirectory(), "qq.mp4")
val encoder = FFMPEGEncode()
encoder.start(w, h, speed, imageCount, file)
val bitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_4444)
val canvas = Canvas(bitmap)
val paint = Paint(Paint.ANTI_ALIAS_FLAG).apply {
strokeWidth = 10f
color = Color.WHITE
}
for (i in 0..imageCount) {
canvas.drawColor(Color.BLUE)
canvas.drawText(i.toString(), 30f, 30f, paint)
encoder.addImage(bitmap)
}
encoder.end()