Playing .avi file

JD jd1008 at gmail.com
Fri Apr 5 00:14:18 UTC 2013


On 04/04/2013 01:42 PM, Colin Law wrote:
> On 4 April 2013 18:52, JD <jd1008 at gmail.com> wrote:
>> On 04/04/2013 08:24 AM, Colin Law wrote:
>>> On 4 April 2013 09:04, JD <jd1008 at gmail.com> 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
>>>> Sams_Journey.srt
>>>>
>>>> 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.srt 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.
>>>
>>> Colin
>>>
>> Will this work if I only want to convert to mpeg1 format?
> The commands I posted converts to mp4 and then adds the audio track,
> so obviously those commands will not convert to mpeg1.  avconv can
> convert to mpeg1 but MP4Box only works with mp4.  The clue is in the
> name.
>
> Colin
Found on the web this invocation of ffmpeg from ffmpeg.org
which converts avi to mpg and merges the subs in one command:

ffmpeg -i Canyon_Trip.avi -vf subtitles=Canyon_Trip.srt  -y Canyon_Trip.mpg

which worked, but the resulting resolution is bad (it pixellates badly).
Amy other args would help retain high resolution?





More information about the ubuntu-users mailing list