question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

-vf subtitles=example.srt not work

See original GitHub issue

how can i insert .srt format subtitle into mp4 video ?

ffmpeg.run('-i', 'output.mp4', '-vf', 'subtitles=xxx.srt', this.output)

not work

should compile ffmpeg.wasm with --enable-filter=subtitles ?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:19

github_iconTop GitHub Comments

3reactions
loe-lobocommented, Apr 15, 2021

Hi @kkxlkkxllb . I’m glad It compiled nicely. I have one more tip for you. You will need to upload the font file you want to use on your subtitles and then specify it on your command. I’m away from the computer, but as soon as possible, I’ll share some code to show how I’m doing.

Here is the example code:

ffmpeg.FS('writeFile', 'output.mp4', YourVideoFile);
ffmpeg.FS('writeFile', 'xxx.srt', YourSubtitleFile);
ffmpeg.FS('writeFile', `tmp/arial`, Arial.ttf); 

ffmepg.run('-i', 'output.mp4', '-vf', 'subtitles=xxx.srt:fontsdir=/tmp:force_style="Fontname=Arial"', this.output);
2reactions
jeromewucommented, May 3, 2021

Thanks @loe-lobo , the PR has been merged and this feature is included in release v0.9.8. 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

ffmpeg subtitles command not showing text, tried with .srt and ...
I see the required libraries in the output. The command: ffmpeg -y -i "input.mp4" -vf subtitles=MySubtitle.srt "output.mp4". I see this ...
Read more >
9103 (srt subtitles fails to be read if numbering not present)
When you watch you do no see subtitles, this is because the srt files does not contain the expected numbering before the timecodes....
Read more >
How to Add Subtitles to a Video File Using FFmpeg
First, we need to prepare an SRT subtitle file for the video. You can use any text editor to add texts to the...
Read more >
[SOLVED] ffmpeg and subtitle .srt - LinuxQuestions.org
My suspect was correct! The "problems" was the some string .srt file write wrong (time). I try to open it by Subtitle Editor...
Read more >
ffmpeg merge audio, video and subtitle does not work. What ...
Could it be the video player configurations? Try using VLC media player, and enable the subtitles (Subtitles -> Sub track -> Track 1)....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found