Skip to content
This repository was archived by the owner on Jun 23, 2025. It is now read-only.
This repository was archived by the owner on Jun 23, 2025. It is now read-only.

text_align throwing Option not found error - React Native Ffmpeg #1038

@ChristopherGabba

Description

@ChristopherGabba

Description
I am trying to use the text_align property noted in the docs:

drawtext=text='Test caption that is long enough to wrap on the screen':x=60:y=120:fontcolor=white:text_align=C:text_align=C+M:line_spacing=10:fontsize=46,

I've ruled down the text_align property as the source and I have tried numerous combinations of entering it. I found this thread on reddit and it talks about needing ffmpeg 6.1?
https://www.reddit.com/r/ffmpeg/comments/18pcr34/why_dont_we_allow_drawtext_option_align_text_yet/

And I get this error:

'drawtext': Option not found\nError reinitializing filters!
Failed to inject frame into filter network: Option not found
Error while processing the decoded data for stream #0:0
Conversion failed!

Expected behavior
The text should align center.

Current behavior
The ffmpeg fails to compile.

To Reproduce
Use the code above to generate an image with text.
Here is my full ffmpeg command:

    command = `-f lavfi -i color=color=white:size=${captionWidth}x${captionHeight} -vf " \
    drawbox=x=0:y=0:w=iw:h=ih:color=black:t=fill, \
    drawtext=text='Chris':x=60:y=50:fontfile=${semiBoldFont}:fontcolor=0xFF3981:fontsize=46, \
    drawtext=text='This is a long caption test in order to try\nfor wrapping font':x=60:y=${BASE_HEIGHT_OF_FIRST_NAME}:fontfile=${semiBoldFont}:fontcolor=white:line_spacing=${LINE_SPACING}:fontsize=46, \
    drawtext=text='Other User:x=60:y=${positionOfSecondName}:fontfile=${semiBoldFont}:fontcolor=0xFF3981:fontsize=46, \
    drawtext=text='This is a super long caption that should \n wrap as well and be centered.':x=60:y=${positionOfSecondCaption}:fontfile=${semiBoldFont}:line_spacing=${LINE_SPACING}:fontcolor=white:fontsize=46 \
  " -frames:v 1 -update 1 ${captionOutput}`

Logs
Logs shown above

Environment

  • Platform: ReactNative
  • "ffmpeg-kit-react-native": "^6.0.2",
  • "react-native": "0.74.5",
  • "@config-plugins/ffmpeg-kit-react-native": "^8.0.0",

Other
Add any other context about the problem here.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions