ffmpeg hardsubbing ass file into mp4

1

I am unable to hardsub a subtitle file into a mp4 file. The code that I used (which seems to work once or twice) is:

ffmpeg -i "videofile" -vf "ass=assfile" -scodec copy "outputfile"

As I understood it, it is a static build. I am using ffmpeg version:

ffmpeg version N-70239-g111d79a Copyright (c) 2000-2015

and --enable-libass appears in the configuration list.

When I add "-v debug" to the command I can see how it's parsing the options, and it seems to be understanding "-scodec copy" somehow:

Reading option '-scodec' ... matched as option 'scodec' (force subtitle codec ('copy' to copy stream)) with argument 'copy'.

Does anyone have any idea why is it not working?

Wee Leong Tay

Posted 2015-06-26T02:51:00.333

Reputation: 21

Answers

1

It seems that the issue is due to the static build that I am using and that as a result of it I need to set some environment variables and have a fonts.conf file. The place that I got my answer was:

https://ffmpeg.zeranoe.com/forum/viewtopic.php?f=10&t=318&start=20

The fonts.conf can also be found there.

I set the environment variables to:

FC_CONFIG_DIR=C:\Program Files\ffmpeg
FONTCONFIG_FILE=fonts.conf
FONTCONFIG_PATH=C:\Program Files\ffmpeg

... in which I basically saved the fonts.conf to root of ffmpeg folder and created new variables.

Wee Leong Tay

Posted 2015-06-26T02:51:00.333

Reputation: 21

0

Reason:

Your code has -scodec copy. I don't think there is a scodec like -vcodec and acodec, I think that's your mistake and so try removing it.

Solution:

ffmpeg -i "videofile" -vf "ass=assfile" "outputfile"

Consider:

The ass filter needs ffmpeg to be compiled with --enable-libass.

Also you must be sure that you are using ass files if not, please convert them to ass using:

ffmpeg -i yourSubtitle.srt yourSubtitle.ass

Kiran Dash

Posted 2015-06-26T02:51:00.333

Reputation: 101

2-scodec, or the alias -c:s, does exist. – llogan – 2015-06-26T06:34:11.863

Ok. And do we need it. Because I have hard coded my subtitle a lot of times and never used them. – None – 2015-06-27T03:13:19.597