[FFmpeg-user] synching multilingual subtitles using ffmpeg ...

Clément Bœsch ubitux at gmail.com
Fri Oct 19 16:51:11 CEST 2012


On Fri, Oct 19, 2012 at 05:24:16AM -0400, Albretch Mueller wrote:
>  I double as teacher and tech monkey and once saw a functionality on
> ted.com/talks that I think could be very effectively used for teaching
> ~
>  1) go: ted.com/talks/julian_assange_why_the_world_needs_wikileaks.html
> ~
>  2) click on the "show transcript" javascript widget to select a
> language (say Arabic)
> ~
>  3) then click on any text segment and you will see how the video feed
> gets synched, to what is said in English (in this case)
> ~
>  They use Flash player and javascript. If you look into the html
> source you will see something like:
> ~
> <p>
> <a href="#420000" class="transcriptLink" rel="nofollow">CA: I mean, if
> you did receive thousands</a>
> <a href="#422000" class="transcriptLink" rel="nofollow">of U.S.
> embassy diplomatic cables ...</a>
> </p>
> <p><a href="#425000" class="transcriptLink" rel="nofollow">JA: We
> would have released them. (CA: You would?)</a>
> </p>
> ~
>  with a transcriptSeek function as part of a very long java script
> functionality. So all you need are those "#425000" timing/synching
> anchors, which of course are extracted from the audio stream + video
> synching track in the video
> ~
>  I would like to use ffmpeg and C, C++ or java to do such a thing
> ~
>  I have read about extracting the sound stream or subtitles, editing
> and synching them back into the file using ffmpeg, but I hasn't been
> able to find such a functionality
> ~
>  What would be the steps one should go to synch a textual and video
> feed a la ted talks?

We have an old work in progress for supporting TED subtitles:
http://ffmpeg.org/pipermail/ffmpeg-devel/2012-June/126332.html

...assuming they are still using JSON. Maybe Nicolas can comment on it.
Now that we have a text decoder, we should be able to transcode these
subtitles into MOV/MP4 subtitles if you want to add them into a MP4, or in
ASS/SSA for MKV, etc.

When it's in FFmpeg, you will be able to do it with something like

  ffmpeg -i in.mp4 -i subtitles.json -c copy -c:s mov_text out.mp4
  ffmpeg -i in.mkv -i subtitles.json -c copy -c:s ass      out.mkv

BTW, I saw you mentioning avconv later in the thread: we can't support it
here (it's a fork).

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20121019/93886b10/attachment.asc>


More information about the ffmpeg-user mailing list