VideoHelp Forum




+ Reply to Thread
Results 1 to 11 of 11
  1. Before you ask, I have FFmpeg compiled with --enable-libass and I'm a Windows user.

    First I convert one of the audio streams from the video to AAC, then I try to hardcode from the source video with a external ASS subtitle file but nothing works.

    Code:
    FOR %%I in (%idir1%\*.%ext%) DO ("%ffmpeg64%" ^
     -i "%%I" ^
     -map 0:a:%AIDN% ^
     -f wav - | "%qaac%" ^
     --ignorelength ^
     --adts ^
     --tvbr 127 ^
     --no-delay - -o "%idir2%\%%~nI.aac" ^
     --threading
    )
    FOR %%O in (%idir1%\*.%ext%) DO ("%ffmpeg64%" ^
     -i "%%O" ^
     -i "%idir2%\%%~nO.AAC" ^
     -filter:v 'ass="%idir1%\%%~nO.ass":charenc=UTF-8:fontsdir="%idir1%\Candara.ttf"' ^
     -vcodec libx264 ^
     -crf 18 ^
     -preset slow ^
     -profile:v high ^
     -level 4.0 ^
     -acodec:1:a copy ^
     -map 0:v ^
     -map 1:0 ^
     "%odir1%\%%~nO.mp4"
    )
    The only thing I get is error messages like this

    Code:
    [AVFilterGraph @ 000001d666a13c80] No such filter: 'ass=\path\sub.ass:charenc=UTF-8:fontsdir=\path\Candara.ttf'
    Error reinitializing filters!
    Failed to inject frame into filter network: Invalid argument
    Error while processing the decoded data for stream #0:0
    Quote Quote  
  2. (Deleted)
    Last edited by cholla; 28th Dec 2025 at 17:10.
    Quote Quote  
  3. Use
    subtitles=
    instead of ass=

    or use clever FFmpeg-GUI.
    Quote Quote  
  4. Although it's easier to create an Avisynth script with L-SMASH and TextSub and then run a batch script in x264, using FFmpeg functions for the same purpose is something I want to try. If the subtitle file I wanted to hardcode was .srt, I would use "subtitles=", but that's not the case.
    Quote Quote  
  5. Give ProWo's Clever a try. I have not tried it for something like this but ProWo has helped me use Clever for other video projects.
    You should have this filter but the code is not finding it.
    Last edited by cholla; 28th Dec 2025 at 17:09.
    Quote Quote  
  6. No matter how I write code, the result is the same, but it's strange that FFmpeg says there's no filter even though --enable-libass is in the compilation. "ass" and "subtitles" have specific uses.
    Quote Quote  
  7. This is a ffmpeg code that works from command with ffmpeg.
    I do not know if you can adapt it to your script.

    Even though I have ffmpeg in my Enviorment paths I still needed to put the path to the file.
    Also the "' & \\ need to be in the path for the ass subtitle file.

    Code:
    ffmpeg -copyts -i C:\Users\User\Desktop\Final\input.mp4 -vf ass="'C\:\\Users\\User\\Desktop\\Final\\subtitles.ass'" -c:a copy -crf 14 -preset veryslow -profile:v high -level 4.1 C:\Users\User\Desktop\Final\output.mp4
    The input.mp4 has no subtiles.
    The subtitles.ass is the subtitle file for this video.(I had to put the subtitles.ass in a .zip file to upload it here)
    The output.mp4 is the video file with the subtitles burned in with ffmpeg.
    I'm uploading them in case you want to try the code.
    Image Attached Files
    Last edited by cholla; 28th Dec 2025 at 17:44.
    Quote Quote  
  8. Originally Posted by ProWo View Post
    @ ProWo,
    I could not figure out how to hard code the .ass subtitles into a .MP4 with Clever.
    If there is a way then please give some instructions.
    Quote Quote  
  9. Originally Posted by cholla View Post
    Originally Posted by ProWo View Post
    @ ProWo,
    I could not figure out how to hard code the .ass subtitles into a .MP4 with Clever.
    If there is a way then please give some instructions.
    Load your mp4, click encode videostream, set the encoder and his settings, check the Burn-in subtitles checkbox, drag your ass subtitle, confirm with ok and click encode.
    If finished, click multiplex and mux the new created videostream to mp4.
    Quote Quote  
  10. Originally Posted by ProWo View Post
    Load your mp4, click encode videostream, set the encoder and his settings, check the Burn-in subtitles checkbox, drag your ass subtitle, confirm with ok and click encode.
    If finished, click multiplex and mux the new created videostream to mp4.
    Thanks ProWo,
    This worked except I needed to do one additional step.
    The original video needs to be unchecked in multiplex.
    If this is not done then the multiplexed .mp4 will have two video tracks.
    Track 2 will not have burned in subtitles.
    If you want both tracks one with & one without burned in subtitles then leave both video tracks checked.
    Quote Quote  
  11. Originally Posted by cholla View Post
    This is a ffmpeg code that works from command with ffmpeg.
    I do not know if you can adapt it to your script.

    Even though I have ffmpeg in my Enviorment paths I still needed to put the path to the file.
    Also the "' & \\ need to be in the path for the ass subtitle file.

    Code:
    ffmpeg -copyts -i C:\Users\User\Desktop\Final\input.mp4 -vf ass="'C\:\\Users\\User\\Desktop\\Final\\subtitles.ass'" -c:a copy -crf 14 -preset veryslow -profile:v high -level 4.1 C:\Users\User\Desktop\Final\output.mp4
    I'm sorry, but your suggestion didn't work. As you may have noticed, the script is designed to work with variables and can process multiple files in batches.

    In fact, the parameters before code execution are like this.

    Code:
    set DIR=%~d1\Transcoding
    set "ffmpeg64=%DIR%\Tools\ffmpeg\64bits\ffmpeg.exe"
    set "qaac=%DIR%\Tools\eac3to\UsEac3to\qaac.exe"
    set idir1=%DIR%\Video\input
    set idir2=%DIR%\Video\input\AAC
    set odir1=%DIR%\Video\output
    And everything works fine as long as -vf is not included in the script-
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!