Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It works only on low bitrate video #108

Open
ravisorathiya opened this issue Nov 24, 2021 · 0 comments
Open

It works only on low bitrate video #108

ravisorathiya opened this issue Nov 24, 2021 · 0 comments

Comments

@ravisorathiya
Copy link

ravisorathiya commented Nov 24, 2021

when I try to add a watermark on video download from pixels it throws an error as below

2021-11-24 10:43:12.879 5748-5959/com.example.fastsaveapp E/Mp4Composer: This device cannot codec with that setting. Check width, height, bitrate, and video format.
android.media.MediaCodec$CodecException: Error 0xfffffc0e
at android.media.MediaCodec.native_configure(Native Method)
at android.media.MediaCodec.configure(MediaCodec.java:1882)
at com.example.fastsaveapp.mp4compose.composer.VideoComposer.setUp(VideoComposer.java:78)
at com.example.fastsaveapp.mp4compose.composer.Mp4ComposerEngine.compose(Mp4ComposerEngine.java:198)
at com.example.fastsaveapp.mp4compose.composer.Mp4Composer$2.run(Mp4Composer.java:319)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)

but video downloaded from youtube or from any Instagram video works like charm,

what can be done to add a watermark or encode video with such a high bitrate video like download from Pexels or so..


Mp4Composer(videoPath!!, getDestinationPath())
                .filter(GlWatermarkFilter(bitmap, getRepostWatermarkPosition()))
                .listener(object : Mp4Composer.Listener {
                    override fun onProgress(progress: Double) {
                        mainScoopLauncher {
                            loadStateEnable(true)
                            val progressValue = (progress * 100).toString()
                            val isUnder10Percentage = progressValue.take(2).contains(".")
                            val under10PercentageValue = "${progress * 100}".take(1) + "%"
                            val upto10PercentageValue = progressValue.take(2) + "%"
                            val loadValue =
                                if (isUnder10Percentage) under10PercentageValue else upto10PercentageValue
                            binding.txtPercentage.text = loadValue
                        }
                    }

                    override fun onCurrentWrittenVideoTime(timeUs: Long) {
                        mainScoopLauncher { loadStateEnable(true) }
                    }

                    override fun onCompleted() {
                        mainScoopLauncher {
                            loadStateEnable(false)
                            toast("Repost Video Complate")
                        }
                    }

                    override fun onCanceled() {
                        logger("cancelled")
                        mainScoopLauncher {
                            loadStateEnable(false)
                            toast("Repost Process Cancel..")
                        }
                    }

                    override fun onFailed(exception: Exception?) {
                        mainScoopLauncher {
                            loadStateEnable(false)
                            toast("Repost Process Failed..")
                        }
                    }
                }).start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant