|
|
|
|
@ -145,13 +145,19 @@ class ReplayExportService : Service() { |
|
|
|
|
val tmpDir = animator.generateVideoContent(drawer, this@ReplayExportService) |
|
|
|
|
val dpath = "${tmpDir.path}/$FFMPEG_DESCRIPTOR_FILE" |
|
|
|
|
|
|
|
|
|
val directory = context.getExternalFilesDir(null) ?: throw PAIllegalStateException("File is invalid") |
|
|
|
|
val output = "${directory.path}/video_${Date().dateTimeFileFormatted}.mp4" |
|
|
|
|
// val directory = context.getExternalFilesDir(null) ?: throw PAIllegalStateException("File is invalid") |
|
|
|
|
// val output = "${directory.path}/video_${Date().dateTimeFileFormatted}.mp4" |
|
|
|
|
|
|
|
|
|
val formattedDate = Date().dateTimeFileFormatted |
|
|
|
|
val output = File( |
|
|
|
|
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MOVIES), |
|
|
|
|
"video_${formattedDate}.mp4" |
|
|
|
|
).path |
|
|
|
|
|
|
|
|
|
Environment.getExternalStorageState(tmpDir) |
|
|
|
|
|
|
|
|
|
Timber.d("Assembling images for video...") |
|
|
|
|
FFmpeg.executeAsync("-f concat -safe 0 -i $dpath -vsync vfr -s ${width}x${height} -pix_fmt yuv420p $output") { id, rc -> |
|
|
|
|
FFmpeg.executeAsync("-f concat -safe 0 -i $dpath -vb 20M -vsync vfr -s ${width}x${height} -pix_fmt yuv420p $output") { id, rc -> |
|
|
|
|
|
|
|
|
|
if (rc == RETURN_CODE_SUCCESS) { |
|
|
|
|
Timber.d("FFMPEG command execution completed successfully") |
|
|
|
|
|