fafbe472341982e492655c47c92686faf932f473
[HTML5TV.git] / README
1 HTML5TV
2
3 This is my attempt to finish my masters degree. I'm just kidding :-)
4
5 Actually, in 1997 I had idea to have masters degree on topic of video
6 delivery over Internet. I was few years too early to make it actually
7 work, but now-days we have all components needed to create good video
8 archive on the web.
9
10 I envision this as combination of two parts:
11
12  * powerful editing suite running locally to annotate video
13  * good web interface with sync between slides and video
14
15
16 SOURCE MATERIAL
17
18 I have some of my presentations in video with slides, but I also have
19 few of freely available presentations which would benefit from
20 audio-video slide annotation. So you are assumed to have two files:
21
22  1. video file in Ogg Theora format
23  2. pdf file with slides of presentation
24
25 all other meta-data should be stored in git under media/
26
27 If you have different file formats, go ahead and use ffmpeg2theora:
28
29   http://v2v.cc/~j/ffmpeg2theora/
30
31 New Theora encoder 1.1 create videos that are better than anything I saw
32 on the web, oggz tool has chop support, so extracting part of video is
33 very easy and possible.
34
35
36 VIDEO EDITING
37
38 I really don't want to learn another set of tools. I like mplayer,
39 it works on all platforms I'm interested in (including EeePC and
40 PlayStation 3) and i all-ready know keyboard shortcuts for it.
41
42 So, I used it over it's slave protocol which is described on
43
44   http://www.mplayerhq.hu/DOCS/tech/slave.txt
45
46 and available locally as docs/slave.txt which I used to implement new keyboard
47 commands:
48
49   dpavlin@t61p:~/t61p/html5tv$ grep -A10 'keyboard' bin/mplayer.pl 
50
51         # XXX keyboard shortcuts
52
53           $1 eq 'c'  ? repl
54         : $1 eq ','  ? add_subtitle
55         : $1 eq 'F1' ? prev_subtitle
56         : $1 eq 'F2' ? move_subtitle( -0.3 )
57         : $1 eq 'F3' ? move_subtitle( +0.3 )
58         : $1 eq 'F4' ? next_subtitle
59         : $1 eq 'F9' ? add_subtitle
60         : $1 eq 'F12' ? edit_subtitles
61         : warn "CUSTOM $1\n"
62         ;
63
64 I used to work with semi-professional Sony U-matic video montage back in 1990
65 and have grown to love it's work flow which doesn't force you to click
66 all over the screen to do something useful.
67
68 In fact, with it, you need 3-5 times more time to finish material,
69 and with most video editing solutions available in open source,
70 I needed at least 10-20 times more time to do anything useful.
71
72
73 SUBTITLING
74
75 I decided to store subtitles in array-of-arrays in yaml with simple structure
76 of start,end,title. On every save, I need also to create .srt subtitle format
77 for mplayer and json data for web interface.
78
79 Effective subtitle editing requires preroll. This is feature from my U-matic days
80 because scopes (U-matic video recorders with magnetic tape) couldn't speed up
81 instantly, so they would rewind, start AND SHOW YOU FEW SECONDS BEFORE YOUR EDIT.
82
83 This is crucial part in implementing following work flow with mplayer:
84
85   1. press i to record EDL point (start of subtitle)
86   2. press i to end EDL (end of subtitle)
87   3. press , to enter subtitle (usually you want to enter subtitle after end of sentence)
88   4. preroll 3 seconds before subtitle and review it
89   5. continue subtitling, goto 1
90
91 You can also use F9 to add subtitle (nicely located near i key) or F12 to enter vi
92 and make bulk subtitle changes (remove empty subtitles and so on).
93
94 SLIDES
95
96 Subtitles are least common denominator for meta data which I want to preserve.
97 However, to sync subtitles with slides, I have introduced magic syntax:
98
99      [42] slide title
100
101 which triggers switch to slide 42.
102
103
104 HTML5 WEB INTERFACE
105
106 Web interface using HTML5 <video> tag based on work from BBC R&D TV
107
108 http://open.bbc.co.uk/rad/demos/html5/rdtv/episode2/index.html
109
110 http://www.bbc.co.uk/blogs/rad/2009/08/html5.html
111
112
113 I removed most of nice design, added support for slides and made it
114 scale to accomodate different resolutions of video materials. 
115
116
117 TRY IT OUT
118
119 Create media/conference-title/www file with source urls for video and presentation
120
121         $ cd media/conference-title
122         $ wget -nc -i www
123
124         # set default video
125         $ ln -s 20090704183304_dobrica.mts.ogv video.ogv
126
127         # generate hires slide jpegs using ghostscript
128         $ ./bin/slides-hires.sh media/conference-title/presentation.pdf
129
130         # setup interface
131         $ cd www 
132         $ ln -sf ../media/conference-title media
133         $ cd -
134
135         # annotate some material
136         $ ./bin/mplayer.pl
137
138         # resize presentation and show montage preview
139         $ ./bin/slides-resize.sh
140
141 You will probably want to run resize after you made first annotation in mplayer
142 because you will get visual overview of all available slides which is useful
143 when typing in slide markers [42] in subtitles.
144
145 When slide reisze finish, you might want to open http://localhost/html5tv/www/tv.html
146 in Firefox and check final result.