How may I burn srt subtitles to video with avconv?

14,020

Solution 1

Why subtitles filter is missing

Libav tends to ignore features from FFmpeg, so avconv and their counterfeit "ffmpeg" (removed as of 14.04) do not support libass, and therefore does not support the subtitles video filter among many other filters.


How to fix

You have several options to get the real ffmpeg from FFmpeg:


Usage

Hardsubs

This will "burn" the subtitles into the video, but of course requires that the video be re-encoded:

ffmpeg -i video.mkv -vf subtitles=subtitle.srt -codec:a copy output.mkv

Softsubs

Consists of a susbtitle stream that is muxed into the file. Any player worth using will allow you to turn the subtitles on and off and choose from other subtitle streams that may be present. Does not require any re-encoding.

ffmpeg -i video.mkv -i subtitle.srt -codec copy -map 0 output.mkv

Solution 2

ffmpeg is not exactly the same as avconv. See this about burning subtitles with avconv.

There is another option, easier and with GUI: Avidemux. Install it with:

sudo apt-get install avidemux

Open a video file, then go to Video, choose a video encoder (anything else than Copy), Filters and Subtitles. Choose the Subtitler filter:

enter image description here

Share:
14,020

Related videos on Youtube

neuront
Author by

neuront

Updated on September 18, 2022

Comments

  • neuront
    neuront over 1 year

    System : Xubuntu 13.04 x64

    I've found usage of this functionality in ffmpeg here

    ffmpeg -i video.avi -vf subtitles=subtitle.srt out.avi
    

    but it doesn't work. I get an error

    No such filter: 'subtitles'
    

    on that. Same thing happens if I replace ffmpeg by avconv.

    So I tried downloading the libav source here and compile. Again I'm frustrated when I run

    ./configure --enable-libass
    

    in the source directory, and this time I got

    Unknown option "--enable-libass"
    

    I wonder if this is a very particular thing that avconv doesn't support at all. And

  • neuront
    neuront almost 10 years
    Thanks for introducing that tool to me. But I still need a CLI approach (I need to merge videos on a server).
  • Cornelius
    Cornelius almost 10 years
    @neuront I just found this ubuntuforums.org/showthread.php?t=1155877