[FFmpeg-user] Adding Subtitles Problem...

Mike Kavanagh mike.kavanagh at netpipe.biz
Tue Jun 18 15:43:58 CEST 2013


I was surprised to find out that the source mp4 file already has
subtitles/captions  - I was not aware of this as they do not appear.

This is particularly odd since the video has been created from jpg images.
I'm hoping I can do this in ffmpeg as a first pass.

As suggested I've added the mapping and the log file produces the predicted
output - all seems to work fine.

However I still cannot see the subtitles when I play it through wmp or
ffplay (not expecting this but just checked).

I'm wondering if the subtitles have actually been successfully inserted into
the video and that I simply cannot see them with the players I'm using? 

The ultimate viewing destination for this is a jwplayer embedded on a web
page. Are the subtitles likely to be displayed on that player - does anyone

I have used a codec of mov_text - what other options do I have?



-----Original Message-----
From: ffmpeg-user-bounces at ffmpeg.org [mailto:ffmpeg-user-bounces at ffmpeg.org]
On Behalf Of Moritz Barsnick
Sent: 17 June 2013 20:26
To: FFmpeg user discussions
Subject: Re: [FFmpeg-user] Adding Subtitles Problem...

Hi Mike,

On Mon, Jun 17, 2013 at 16:51:52 +0100, Mike Kavanagh wrote:
> The source video does not contain any subtitles, as I am expecting 
> them to be feed in afresh from the srt file - am I right in thinking 
> an srt file can be created as an ascii file?

Your files are being identified correctly, incl. your manually crafted SRT
file, but ffmpeg sees subtitles in the MP4 input file and passes them on to
the output file, ignoring your SRT file. Looking at your

First file (MP4), incl. subtitle stream:

  Duration: 00:00:05.00, start: 0.000000, bitrate: 613 kb/s
    Stream #0:0(und), 1, 1/16384: Video: h264 (High) (avc1 / 0x31637661),
yuv420p, 1340x886, 611 kb/s, 1 fps, 1 tbr, 16384 tbn, 2 tbc
      handler_name    : VideoHandler
    Stream #0:1(und), 0, 1/1000: Subtitle: mov_text (tx3g / 0x67337874)
      handler_name    : SubtitleHandler

Second file (SRT):

Input #1, srt, from 'test.srt':
  Duration: N/A, bitrate: N/A
    Stream #1:0, 0, 1/1000: Subtitle: subrip

But here's the output mapping:

Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> libx264)
  Stream #0:1 -> #0:1 (mov_text -> mov_text)

See, ffmpeg is taking 0:1 as subtitle input, not 1:0. You should be adding
map options:

-map 0:0 -map 1:0

which would/should result in something like this:

Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> libx264)
  Stream #1:0 -> #0:1 (subrip -> mov_text)

ffmpeg-user mailing list
ffmpeg-user at ffmpeg.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg-20130618-132130.log
Type: application/octet-stream
Size: 7578 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20130618/f24f7ee5/attachment.obj>

More information about the ffmpeg-user mailing list