Commit 16001373 authored by Nicolas George's avatar Nicolas George

lavf: TED Talks JSON captions demuxer.

parent 18eb3196
......@@ -39,6 +39,7 @@ version <next>:
- Paris Audio File demuxer
- Virtual concatenation demuxer
- VobSub demuxer
- JSON captions for TED talks decoding support
version 1.0:
......
......@@ -215,4 +215,25 @@ backslash or single quotes.
@end table
@section tedcaptions
JSON captions used for @url{http://www.ted.com/, TED Talks}.
TED does not provide links to the captions, but they can be guessed from the
page. The file @file{tools/bookmarklets.html} from the FFmpeg source tree
contains a bookmarklet to expose them.
This demuxer accepts the following option:
@table @option
@item start_time
Set the start time of the TED talk, in milliseconds. The default is 15000
(15s). It is used to sync the captions with the downloadable videos, because
they include a 15s intro.
@end table
Example: convert the captions to a format most players understand:
@example
ffmpeg -i http://www.ted.com/talks/subtitles/id/1/lang/en talk1-en.srt
@end example
@c man end INPUT DEVICES
......@@ -924,6 +924,7 @@ performance on systems without hardware floating point support).
@item SAMI @tab @tab X @tab @tab X
@item SubRip (SRT) @tab X @tab X @tab X @tab X
@item SubViewer @tab @tab X @tab @tab X
@item TED Talks captions @tab @tab X @tab @tab X
@item VobSub (IDX+SUB) @tab @tab X @tab @tab X
@item 3GPP Timed Text @tab @tab @tab X @tab X
@item WebVTT @tab @tab X @tab @tab X
......
......@@ -346,6 +346,7 @@ OBJS-$(CONFIG_SUBVIEWER_DEMUXER) += subviewerdec.o
OBJS-$(CONFIG_SWF_DEMUXER) += swfdec.o swf.o
OBJS-$(CONFIG_SWF_MUXER) += swfenc.o swf.o
OBJS-$(CONFIG_TAK_DEMUXER) += takdec.o apetag.o img2.o rawdec.o
OBJS-$(CONFIG_TEDCAPTIONS_DEMUXER) += tedcaptionsdec.o
OBJS-$(CONFIG_THP_DEMUXER) += thp.o
OBJS-$(CONFIG_TIERTEXSEQ_DEMUXER) += tiertexseq.o
OBJS-$(CONFIG_MKVTIMESTAMP_V2_MUXER) += mkvtimestamp_v2.o
......
......@@ -244,6 +244,7 @@ void av_register_all(void)
REGISTER_DEMUXER (SUBVIEWER, subviewer);
REGISTER_MUXDEMUX (SWF, swf);
REGISTER_DEMUXER (TAK, tak);
REGISTER_DEMUXER (TEDCAPTIONS, tedcaptions);
REGISTER_MUXER (TG2, tg2);
REGISTER_MUXER (TGP, tgp);
REGISTER_DEMUXER (THP, thp);
......
This diff is collapsed.
......@@ -30,7 +30,7 @@
#include "libavutil/avutil.h"
#define LIBAVFORMAT_VERSION_MAJOR 54
#define LIBAVFORMAT_VERSION_MINOR 48
#define LIBAVFORMAT_VERSION_MINOR 49
#define LIBAVFORMAT_VERSION_MICRO 100
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
......
<!DOCTYPE html>
<html>
<head>
<!--
This file is part of FFmpeg.
All scripts contained in this file can be considered public domain.
-->
<title>FFmpeg bookmarklets</title>
<meta charset="UTF-8">
<script type="text/javascript">
function convert(js) {
js = js.replace(/\/\*.*?\*\//g, ""); /* comments */
js = js.replace(/\s+/g, " ");
js = js.replace(/\s+\z/, "");
js = "(function(){" + js + "})();void 0";
return "javascript:" + escape(js);
}
function init() {
var pre = document.getElementsByTagName("pre");
for (var i = 0; pre.length > i; i++) {
document.getElementById(pre[i].id + "-link").href = convert(pre[i].textContent);
}
}
</script>
<style type="text/css">
pre { border: solid black 1px; padding: 0.2ex; font-size: 80% }
</style>
</head>
<body onload="init()">
<h1>Introduction</h1>
The scripts in this page are
<a href="http://en.wikipedia.org/wiki/Bookmarklet">bookmarklets</a>: store
their link version in a bookmark, and later activate the bookmark on a page
to run the script.
<h1>TED Talks captions</h1>
<p><a id="ted_talks_captions-link" href="#">Get links to the captions</a></p>
<pre id="ted_talks_captions">
d = window.open("", "sub", "width=256,height=512,resizable=yes,scrollbars=yes").document;
l = document.getElementById("languageCode").getElementsByTagName("option");
for (i = 1; i &lt; l.length ; i++) {
d.body.appendChild(p = d.createElement("p"));
p.appendChild(a = d.createElement("a"));
a.appendChild(d.createTextNode(l[i].textContent));
a.href="http://www.ted.com/talks/subtitles/id/" + talkID+"/lang/" + l[i].value;
}
</pre>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment