HTML5TV
Create TV like experience for subtitling (with preroll) and web interface using HTML5 video tag
Install / Use
/learn @dpavlin/HTML5TVREADME
HTML5TV
This is my attempt to finish my masters degree. I'm just kidding :-)
Actually, in 1997 I had idea to have masters degree on topic of video delivery over Internet. I was few years too early to make it actually work, but now-days we have all components needed to create good video archive on the web.
I envision this as combination of two parts:
- powerful video editing suite running locally with annotations
- good web interface with sync between slides and video
SOURCE MATERIAL
I have some of my presentations in video with slides, but I also have few of freely available presentations which would benefit from audio-video slide annotation. So you are assumed to have two files:
- video file in Ogg Theora format
- pdf file with slides of presentation
- create html file with meta-data
All of this is stored under media in directory conference-lecture.
If you have different file formats, go ahead and use ffmpeg2theora:
http://v2v.cc/~j/ffmpeg2theora/
New Theora encoder 1.1 create videos that are better than anything I saw on the web, oggz tool has chop support, so extracting part of video is very easy and possible.
When re-encoding video materials following command line gives more-or-less resonable video size while inserting keyframes for nice seek:
ffmpeg2theora -p padma --keyint 1 source_video.flv
VIDEO EDITING
I like mplayer, and lerning another set of tools to do video editing didn't make sense to me.
It works on all platforms I'm interested in (including EeePC and PlayStation 3) and I know keyboard shortcuts for it.
So, I used it over it's slave protocol which is described on
http://www.mplayerhq.hu/DOCS/tech/slave.txt
and available locally as docs/slave.txt which I used to implement new keyboard commands:
dpavlin@t61p:~/t61p/html5tv$ grep -A10 'keyboard' bin/mplayer.pl
# XXX keyboard shortcuts
$1 eq 'c' ? repl
: $1 eq ',' ? add_subtitle
: $1 eq 'F1' ? prev_subtitle
: $1 eq 'F2' ? move_subtitle( -0.3 )
: $1 eq 'F3' ? move_subtitle( +0.3 )
: $1 eq 'F4' ? next_subtitle
: $1 eq 'F5' ? save_subtitles
: $1 eq 'F9' ? add_subtitle
: $1 eq 'F12' ? edit_subtitles
: warn "CUSTOM $1\n"
;
I used to work with semi-professional Sony U-matic video montage back in 1990 and have grown to love it's workflow which doesn't force you to click all over the screen to do something useful.
In fact, with this tool, I need 3-5 times more time to finish material, and with most video editing solutions available in open source, I needed at least 10-20 times more time to do anything useful.
SUBTITLING
I decided to store subtitles in array-of-arrays in yaml with simple structure of start,end,title. On every save, I need also to create .srt subtitle format for mplayer and json data for web interface.
Effective subtitle editing requires preroll. This is feature from my U-matic days because scopes (U-matic video recorders with magnetic tape) couldn't speed up instantly, so they would rewind, and than start FEW SECONDS BEFORE your edit point.
This was crucial concept for implementing the following workflow with mplayer:
- press i to record EDL point (start of subtitle)
- press i to end EDL (end of subtitle)
- press , to enter subtitle (usually you want to enter subtitle after end of sentence)
- mplayer will preroll 3 seconds before subtitle and review it
- continue subtitling, goto 1
You can also use F9 to add subtitle (nicely located near i key) or F12 to enter vi and make bulk subtitle changes (remove empty subtitles and so on).
SLIDES
Subtitles are least common denominator for meta data which I want to preserve. However, to sync subtitles with slides, I have introduced magic syntax:
[42] slide title
which triggers switch to slide 42.
In presentations which are created using Takahashi method (lot of slides with transitions which follow speaker) you might use just add subtitle to mark transition to next slide.
HTML5 WEB INTERFACE
Web interface using HTML5 <video> tag based on work from BBC R&D TV
http://open.bbc.co.uk/rad/demos/html5/rdtv/episode2/index.html
http://www.bbc.co.uk/blogs/rad/2009/08/html5.html
Which in turn is based on jCarousel from
http://sorgalla.com/projects/jcarousel/
I removed most of nice design, added support for slides and made it scale to accomodate different resolutions of video materials.
Additional media info (author, title, location, date) is kept in hcalendar.html using microformat which defines classes. For more info about hCalendar see
http://microformats.org/wiki/hcalendar-cheatsheet
TRY IT OUT
Create media/conference-title/www file with source urls for video and presentation
# install dependecies from Debian packages
$ sudo bin/install-debian.sh
$ cd media/conference-title
$ wget -nc -i www
# create metadata
$ vi hCalendar.html
# create presentation.pdf symlink from pdf file with slides
$ ln -s original-slides.pdf presentation.pdf
# annotate some material
$ ./bin/mplayer.pl media/conference-Title/video.ogv
After adding first slide you will get visual overview of all slides which is useful when typing in slide markers [42] in subtitles.
When slide reisze finish, you might want to open http://localhost/html5tv/www/_editing.html in Firefox (you will have to open it through http server!) and check final result.
MULTI MONITOR SETUP
I'm using awesome as window manager, and since HTML5TV uses xdotool to focus between terminal to enter subtitle and mplayer, it will switch to same virtual desktop on both monitors, so it's helpful to start ./bin/mplayer.pl on same virtual desktop at least with awesome.
Related Skills
qqbot-channel
354.0kQQ 频道管理技能。查询频道列表、子频道、成员、发帖、公告、日程等操作。使用 qqbot_channel_api 工具代理 QQ 开放平台 HTTP 接口,自动处理 Token 鉴权。当用户需要查看频道、管理子频道、查询成员、发布帖子/公告/日程时使用。
docs-writer
100.8k`docs-writer` skill instructions As an expert technical writer and editor for the Gemini CLI project, you produce accurate, clear, and consistent documentation. When asked to write, edit, or revie
model-usage
354.0kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
arscontexta
3.1kClaude Code plugin that generates individualized knowledge systems from conversation. You describe how you think and work, have a conversation and get a complete second brain as markdown files you own.
