Skip to content

Failed to stop the muxer #95

@Vitor238

Description

@Vitor238

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions