Re: Make a clip with subtitles?

Miriam English <[email protected]>
Newsgroups gmane.comp.video.mplayer.user
Message-ID <[email protected]>
Just occured to me that I seem to recall the original reason for 
splitting the video into frames with subtitles hardcoded in was to make 
an animgif. ffmpeg can do this for you.


convert mp4 video to 10fps animated gif

The framerate -r 10 is not necessary, but can reduce filesize
and most animgifs are played at 10fps anyway.

ffmpeg -i input.mp4 -r 10 out.gif


You could probably burn the subtitles into the result while converting 
it to an animgif in just one step, though I haven't tried this.

ffmpeg -i input.mp4  -vf subtitles=subtitles.srt  -r 10  out.gif


Animgifs I've made looked fine with the conversion above, but you may 
have difficulties with colors. They can be improved with a custom 
palette. The following is copied from a suggestion I found online 
somewhere. I haven't tried it, so haven't bothered to find out what all 
the options are for. They're left as an exercise for the reader. :)

generate the palette

ffmpeg -y -ss 30 -t 3 -i input.mp4 \
-vf fps=10,scale=320:-1:flags=lanczos,palettegen palette.png

convert using the palette

ffmpeg  -ss 30  -t 3  -i input.mp4  -i palette.png -filter_complex \
"fps=10,scale=320:-1:flags=lanczos[x];[x][1:v]paletteuse" output.gif


Hope this helps,

     - Miriam

-- 
What is the most important thing in the world you could be working on 
right now, and if you are not working on that, why aren't you?
  -- Aaron Swartz (internet genius, philanthropist)

_______________________________________________
MPlayer-users mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.