README.md 567 B

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()