Page History

Turn Off History

Most video hosting sites have terms of service or usage that are problematic for us. For example there isn't a legal way to have a single "CHTC" YouTube account shared by multiple staff short of making a special arrangement with Google.

The good news is that there is no reason we can't just host the video ourselves!

The following is a general strategy; as of May 2014 it has not been tested.

Downloads

Put the files up for download! There is no reason to not just offer for download the exact same files created for streaming (below). Might be a symlink.

You might want to ensure the web server sets the Content-Disposition header so that it's downloaded and not viewed in browser. promising looking summary of the technique

Streaming

Dive Into HTML5 has a good overview of what you need to do. The situation is even better if you're willing to require a "recent" web browser (2011+), in which case you can ignore Flash and Theora+Vorbis+Ogg and exclusively rely on H.264(baseline)+AAC(low complexity)+MP4 and WebM.

Dive Into HTML5's recommendations for creating the files should work, but are probably overkill. If you've got a good ffmpeg install (Try /u/a/d/adesmet/bin/opt/ffmpeg/bin/ffmpeg ) it can do the job. The full details are a bit long, but here is a summary:

ffmpeg -i input.mp4 -c:v libvpx -qmax 42 -qmin 10 -b:v 1M -c:a libvorbis -q:a 4 -f webm out.webm
ffmpeg -i input.mp4 -c:v libx264 -profile:v baseline  -movflags faststart -crf 23 -c:a libfdk_aac out.mp4

Warning: iPhones (as of 3S) can apparently only accept video up to 640x480. (Maybe? Double check.) If this is true, we may want to also export low-resolution versions and have a link to a different place to view the videos for lower end devices.

(Instead of libfdk_aac, you can use libfaac. The original source did so. It appears that libfdk_aac is a superior replacement.)

Note that the above adds "-movflags faststart" to the mp4 creation. This causes a second pass on the file (slow, sadly) that moves the metadata to the start of the file, making it faster for a web browser to seek into the middle of the file. Instead of "-movflags faststart" you can use the tool qt-faststart.

You can use ffmpeg to do lossless trimming of files (say, to break a single video into multiple videos, or to trim off dead time). source

# START and LENGTH are seconds or hh:mm:ss.
ffmpeg -acodec copy -vcodec copy -ss START -t LENGTH -i ORIGINALFILE.mp4 OUTFILE.mp4

You can also crop the video with ffmpeg, which may be useful if part of the video feel is always empty (say, the video is wide enough to handle a 16:9 slide, but only 4:3 slides are shown. This is lossy, so you'll probably want to merge it into the conversion step. source

ffmpeg -i ORIGINALFILE.mp4 -filter:v "crop=out_w:out_h:x:y" OUTFILE.mp4