Skip to content

Add Text to Image #38

Description

@daliborristic883

Describe the bug
I changed AddTextOnVideo feature to add text on Image.
Here are queries. but when I run this command, I can see error ffmpeg error initializing filter 'drawtext' with args
Please help me
Screenshot 2022-04-19 at 12 45 24 PM

This is my sample code.

private fun addTextProcess(imagePath: String) {
        val outputPath = Common.getFilePath(this, Common.IMAGE)
        val dateString = Date().dateToString("yyyy-MM-dd HH:mm:ss.SSS")
        val fontPath = Common.getFileFromAssets(this, "roboto_regular.ttf").absolutePath
        val query = ffmpegQueryExtension.addTextOnVideo(imagePath, dateString,
            0.0f,
            0.0f,
            fontPath = fontPath,
            isTextBackgroundDisplay = false,
            fontSize = 30,
            fontcolor = "red",
            output = outputPath
        )
        CallBackOfQuery().callQuery(query, object : FFmpegCallBack {
            override fun process(logMessage: LogMessage) {
                Log.d("Dalibor", logMessage.text)
            }

            override fun success() {
               Log.d("Dalibor", "Sucess")
            }

            override fun cancel() {
                addTimeStampToPhotos()
            }

            override fun failed() {
                addTimeStampToPhotos()
            }
        })
    }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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