-
Notifications
You must be signed in to change notification settings - Fork 180
Closed
Description
I am trying to cut a video recorded by my phone. When cutting, the following error is displayed:
Failed to stop the muxer
video path : /storage/emulated/0/Android/data/com.vitor.videoeditor/files/Movies/Speeacht/VID_20200718_121633.mp4
destine path: /storage/emulated/0/Android/data/com.vitor.videoeditor/files/Movies/Speeacht/VID_20200718_121643.mp4
my code:
private fun clipVideos() {
videoPath = intent.extras?.getString("video")
Log.i("VIDEOEDITOR","path - $videoPath")
val uri = Uri.fromFile(File(videoPath))
val dataSource = UriDataSource(this,uri)
val duration = dataSource.durationUs
val startTime: Long = 0
val endTime: Long = if (duration > 3000) 3000 else duration
val clip = ClipDataSource(dataSource, startTime, endTime)
val diretorioSaida = FileUtils.getVideosDir(this).absolutePath
val destPath = (diretorioSaida + File.separator + FileUtils.VIDEO_PREFIX
+ LocalTimeUtils.getFormatedTime()
+ FileUtils.VIDEO_EXTENSION)
Log.i("VIDEOEDITOR","Dest - $destPath")
Transcoder.into(destPath)
.addDataSource(clip)
.setListener(object : TranscoderListener {
override fun onTranscodeCompleted(successCode: Int) {
videoList.add(destPath)
recyclerVideos.adapter?.notifyDataSetChanged()
toast("OK!")
}
override fun onTranscodeProgress(progress: Double) {
Log.i("PROGRESS", progress.toString())
}
override fun onTranscodeCanceled() {
toast("CANCELED")
}
override fun onTranscodeFailed(exception: Throwable) {
Log.i("VIDEOEDITOR",exception.message.toString())
}
}).transcode()
}
How to fix this error?
Another question: is it possible to cut a video for example every 3 seconds?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels