Playing .avi file

Colin Law clanlaw at
Thu Apr 4 14:24:43 UTC 2013

On 4 April 2013 09:04, JD <jd1008 at> wrote:
> Using mplayer to play an avi file.
> the dir where the file resides also contains an srt (subtitles file).
> The files are named
> Sams_Journey.avi  and
> If I play the avi file with mplayer, the subtitles do appear.
> However,if I copy the avi file alone to another dir and I
> play the avi file in that dir, the subtitles do not appear.
> Is there a way for me to incorporate the subtitles file into the
> avi file, or (any other format, such as mpg or mp4)?

If you first convert it to an mp4 using ffmpeg or avconv, example,
then you can add the subtitles using MP4Box
MP4Box -add file.mp4

To convert to mp4 I use something like
avconv -y -i file.avi -vcodec libx264 -pre libx264-medium -crf  22
-threads 0 file.mp4
You might have to add something for the audio track, I don't know.
Mine are video only.  Also you may want to tweak the settings to get
the quality you require.

There may be better ways, but that is what I do.


More information about the ubuntu-users mailing list