just directly to subtitle *text*
[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 video editing suite running locally with annotations
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  3. create html file with meta-data
25
26 All of this is stored under media in directory conference-lecture.
27
28 If you have different file formats, go ahead and use ffmpeg2theora:
29
30   http://v2v.cc/~j/ffmpeg2theora/
31
32 New Theora encoder 1.1 create videos that are better than anything I saw
33 on the web, oggz tool has chop support, so extracting part of video is
34 very easy and possible.
35
36 When re-encoding video materials following command line gives more-or-less
37 resonable video size while inserting keyframes for nice seek:
38
39   ffmpeg2theora -p padma --keyint 1 source_video.flv
40
41
42 VIDEO EDITING
43
44 I like mplayer, and lerning another set of tools to do video editing
45 didn't make sense to me.
46
47 It works on all platforms I'm interested in (including EeePC and
48 PlayStation 3) and I know keyboard shortcuts for it.
49
50 So, I used it over it's slave protocol which is described on
51
52   http://www.mplayerhq.hu/DOCS/tech/slave.txt
53
54 and available locally as docs/slave.txt which I used to implement new keyboard
55 commands:
56
57   dpavlin@t61p:~/t61p/html5tv$ grep -A10 'keyboard' bin/mplayer.pl 
58
59         # XXX keyboard shortcuts
60
61           $1 eq 'c'  ? repl
62         : $1 eq ','  ? add_subtitle
63         : $1 eq 'F1' ? prev_subtitle
64         : $1 eq 'F2' ? move_subtitle( -0.3 )
65         : $1 eq 'F3' ? move_subtitle( +0.3 )
66         : $1 eq 'F4' ? next_subtitle
67         : $1 eq 'F5' ? save_subtitles
68         : $1 eq 'F9' ? add_subtitle
69         : $1 eq 'F12' ? edit_subtitles
70         : warn "CUSTOM $1\n"
71         ;
72
73 I used to work with semi-professional Sony U-matic video montage back in 1990
74 and have grown to love it's workflow which doesn't force you to click
75 all over the screen to do something useful.
76
77 In fact, with this tool, I need 3-5 times more time to finish material,
78 and with most video editing solutions available in open source,
79 I needed at least 10-20 times more time to do anything useful.
80
81
82 SUBTITLING
83
84 I decided to store subtitles in array-of-arrays in yaml with simple structure
85 of start,end,title. On every save, I need also to create .srt subtitle format
86 for mplayer and json data for web interface.
87
88 Effective subtitle editing requires preroll. This is feature from my U-matic days
89 because scopes (U-matic video recorders with magnetic tape) couldn't speed up
90 instantly, so they would rewind, and than start FEW SECONDS BEFORE your edit point.
91
92 This was crucial concept for implementing the following workflow with mplayer:
93
94   1. press i to record EDL point (start of subtitle)
95   2. press i to end EDL (end of subtitle)
96   3. press , to enter subtitle (usually you want to enter subtitle after end of sentence)
97   4. mplayer will preroll 3 seconds before subtitle and review it
98   5. continue subtitling, goto 1
99
100 You can also use F9 to add subtitle (nicely located near i key) or F12 to enter vi
101 and make bulk subtitle changes (remove empty subtitles and so on).
102
103 SLIDES
104
105 Subtitles are least common denominator for meta data which I want to preserve.
106 However, to sync subtitles with slides, I have introduced magic syntax:
107
108      [42] slide title
109
110 which triggers switch to slide 42.
111
112 In presentations which are created using Takahashi method (lot of slides with
113 transitions which follow speaker) you might use just add subtitle to mark
114 transition to next slide.
115
116
117 HTML5 WEB INTERFACE
118
119 Web interface using HTML5 <video> tag based on work from BBC R&D TV
120
121         http://open.bbc.co.uk/rad/demos/html5/rdtv/episode2/index.html
122
123         http://www.bbc.co.uk/blogs/rad/2009/08/html5.html
124
125 Which in turn is based on jCarousel from
126
127         http://sorgalla.com/projects/jcarousel/
128
129 I removed most of nice design, added support for slides and made it
130 scale to accomodate different resolutions of video materials. 
131
132
133 Additional media info (author, title, location, date) is kept in hcalendar.html
134 using microformat which defines classes. For more info about hCalendar see
135
136         http://microformats.org/wiki/hcalendar-cheatsheet
137
138
139 TRY IT OUT
140
141 Create media/conference-title/www file with source urls for video and presentation
142
143         # install dependecies from Debian packages
144         $ sudo bin/install-debian.sh
145
146         $ cd media/conference-title
147         $ wget -nc -i www
148
149         # create metadata
150         $ vi hCalendar.html
151
152         # generate hires slide jpegs using ghostscript
153         $ ./bin/slides-hires.sh media/conference-title/presentation.pdf
154
155         # annotate some material
156         $ ./bin/mplayer.pl media/conference-Title/video.ogv
157
158 After adding first slide you will get visual overview of all slides
159 which is useful when typing in slide markers [42] in subtitles.
160
161 When slide reisze finish, you might want to open http://localhost/html5tv/www/_editing.html
162 in Firefox (you will have to open it through http server!) and check final result.
163
164 MULTI MONITOR SETUP
165
166 I'm using awesome as window manager, and since HTML5TV uses xdotool to focus between terminal
167 to enter subtitle and mplayer, it will switch to same virtual desktop on *both* monitors,
168 so it's helpful to start ./bin/mplayer.pl on same virtual desktop at least with awesome.