[FFmpeg-user] How to cut a clip from video with subtitles?
Moritz Barsnick
barsnick at gmx.net
Mon Feb 17 14:07:55 EET 2025
On Sat, Feb 15, 2025 at 14:17:42 +0100, Ferdi Scholten wrote:
> On 15-02-2025 13:25, mbork at mbork.pl wrote:
> > time ffmpeg -y -i some_film.mp4 -i some_film.srt -ss 121052ms -to 140392ms -c:v libx264 -vf scale=240:-1 -c:a copy -c:s mov_text clip.mp4
> >
> > but it didn't work - the clip was selected correctly, the resolution was
> > correct, but I couldn't see the subtitles.
It does help if you post the complete, uncut console output of your
command.
> FFmpeg does not write subtitle files as far as i know.
What are you trying to say? ffmpeg does write subtitle files, but mbork
wasn't trying to do that.
ffmpeg does clip subtitle files correctly as well. I tried an
equivalent of the posted second command line, and it worked for me.
(The subtitles were included into the MP4 with the correct "-ss"
offset, and when extracted, looked correct.)
> Alternatively you can convert your srt input, mp4 only supports one type of
> subtitle stream, so you will have to convert your srt input to mov_text,
> remove the subtitle filter and add -c:s mov_text
That's exactly what the second given command line did. ;-)
> > What am I doing wrong?
What does you media player say? Does it say there is a subtitle stream,
yet you see nothing? Or does it not recognize the subtitles? (And which
media player is this? Are you sure it can display mov_text?) Perhaps
the player has issues overlaying text on a small 240x180 video.
Cheers,
Moritz
More information about the ffmpeg-user
mailing list