ffmpeg – substitles stuck around the16/17 secs for the rest of the video

I am running FFMPEG on n8n. After using whisper Api to generate subtitles and saved as a .ass file to disk. I used this file along with the video to render it . the video output is complete , the subtitles freeze around the 16-17secs and does not change for the rest of the video, even though the audio continues to the end. My n8n instance is currently hosted on a server.
So far what i have done:

  1. i have used whisper locally
  2. tried Openai whisper
  3. i have switched from .ass to srt
  4. I have updated my ffmpeg version. It was at 4…. , I have updated to 7.0.2
  5. I have also cleaned up the .ass file to remove any formatting errors but so far no luck .
    Has anyone encountered and resolved this before? i am not sure what else to check

Below is the code iam using to render the video:
#!/bin/bash

Configuration

FOLDER=”{{ $(‘Settings’).item.json.path_to_folder }}”
INPUT_VIDEO=”$FOLDER/input.mp4″
OUTPUT_VIDEO=”$FOLDER/final.mp4″
SUBTITLE_FILE=”$FOLDER/subtitles.ass”
FONTS_DIR=”$FOLDER/fonts/”
FONT_NAME=”DynaPuff”

Run FFmpeg to burn subtitles into the video using specific styling options

ffmpeg -y -i “$INPUT_VIDEO” -vf “subtitles=${SUBTITLE_FILE}:fontsdir=${FONTS_DIR}:force_style=’FontName=${FONT_NAME}'” -c:v libx264 -crf 7 -preset slow -c:a copy “$OUTPUT_VIDEO”