mifi / lossless-cut

The swiss army knife of lossless video/audio editing
https://losslesscut.app/
GNU General Public License v2.0
26.03k stars 1.25k forks source link

Attach font to video #1620

Open gsxhnd opened 1 year ago

gsxhnd commented 1 year ago

I have a lot of issues to go through, so in order to make it easier for me to help you, I ask that you please try these things first

Description

I want export video with subtitle, then this ass subtitle need some font, like ttf,ttc,otf In ffmpeg cli like

ffmpeg.exe -i INPUT -c copy -attach INPUT_FONT -metadata:s:t:0 mimetype=application/x-truetype-font
mifi commented 1 year ago

can you provide an example file? what is INPUT? your ffmpeg command doesn't work because it doesn't have any output

gsxhnd commented 1 year ago

Anyone support add subtitle video type is ok.

ffmpeg.exe -i example.mkv  -c copy -attach "arial.ttf" -metadata:s:t:0 mimetype=application/x-truetype-font  example.mkv

input example.mkv

input example font

output example1.mkv

ffmpeg.mkv

mifi commented 1 year ago

Ok, I think I understand, you want to do the opposite of -dump_attachment (as can be seen here):

https://github.com/mifi/lossless-cut/blob/b426023d5149cb6e83b5ab077257b860108c0aec/src/ffmpeg.js#L395

instead of extracting attachments from a file, you want to attach them to a file. (-attach) I think it's a useful feature request.

gsxhnd commented 1 year ago

yeh, video add subtitle, some of them dependent on the specified font. If not exist, subtitle will still work, but it's not well in expected.