Procedures for editing, uploading, and annotating ethnographic videos

This document describes the basic workflow for the preparation of ethnographic videos in the open source Ogg Theora format [1]. See /convertvideos.sh for a complete, annotated shell script that will automatically rename, convert, and package raw video clips for uploading to the wiki (note the hard-coded metadata).

1. Overview

1.1. Video settings

The original set of sample videos accompanying this document were recorded using a Canon PowerShot A590 consumer-grade digital camera, which produces MJPEG recordings in an AVI container. Some of the clips were recorded in 640x480@20fps, while others were recorded in 320x240@30fps, resulting in a lower file size but visibly reduced image quality. Based on experimentation with various resolutions and framerates the most reasonable compromise between file size and quality seems to be the following:

  • 480x360 resolution, or 640x360 for widescreen format (same as used by YouTube in "normal" view)

  • 30 fps (15-20 fps video is also usable but becomes choppy when there is considerable movement)
  • medium compression (ffmpeg video quality setting "6")

The process described here applies the above settings assuming a high-definition input, providing for separate storage of versions of the same clips in HD and in normal resolution. Since the sample input recordings are of a lower framerate or resolution in some cases than the output, the samples provide a somewhat lower quality than might be expected of subsequent recordings. In all cases I have attempted to work using inexpensive, handheld consumer-grade recording equipment as a deliberate strategy for developing participatory ethnographic video methods with low cost and technical barriers.

1.2. Tools

All software tools listed here are open source programs that have been tested on Ubuntu linux, v.9.10 (http://ubuntu.com). Required packages are:

2. Process

2.1. Convert original raw HD video footage to Theora

  1. Since ffmpeg does not work well with the uncompressed 8-bit PCM audio generated by digital cameras, re-encode the audio track if necessary:

    • ffmpeg -i INPUT.AVI -vcodec copy -acodec pcm_s16le -ac 2 OUTPUT.AVI

  2. Convert the original file to HD Ogg Theora:

    • ffmpeg2theora -a 4 -v 10 INPUT.AVI

    This gives us a fairly large file, but no loss of quality due to compression or resizing.

The following shell script converts a batch of AVI files in a given folder, and dumps them into the subfolder "ogv".

   1 # Convert audio stream and dump files into "ogv/" directory. Comment out if unnecessary.
   2 for file in *.avi; do
   3  ffmpeg -i $file -vcodec copy -acodec pcm_s16le -ac 2 ogv/$file
   4  echo "converted audio track: $file..."
   5 done
   6 cd ogv
   7 
   8 # Convert to Theora and remove intermediate avi
   9 for file in *.avi; do
  10  ffmpeg2theora -a 4 -v 10 --location "Mongolia" --artist "Eric Thrift" --copyright "Copyright Mongolia Ethnographic Film Collective" --license "Creative Commons BY-NC-SA 3.0" --contact "http://mandal.ca/MongoliaEthnographicFilmCollective" $file
  11  rm $file
  12  echo "converted to ogg: $file..."
  13 done
download

2.2. Cut into clips

To cut into clips, use the command oggz-chop: oggz-chop --start S --end E --no-skeleton INPUT.ogv -o SECTION.ogv, where S and E are digits indicating the start and end times in seconds.

To facilitate this extraction it is possible to list the clips in a shell script file. Using a file in this manner is also helpful as it provides a log of clips and their sources.

   1 oggz-chop --start 11 --end 22 --no-skeleton INPUT.ogv -o aarc_chanax.ogv
   2 oggz-chop --start 22 --end 64 --no-skeleton INPUT.ogv -o togoo_nerex.ogv
download

Clips are named according to the format MefD{YYYYmmdd}T{HHMMss}.

2.3. Annotate clips

Open the clip with gnome-subtitles, and annotate as required. Save as SubRip file, using the format "<filename>.commentary.en.srt" (e.g., for a video named "aaruul05.ogv", save the subtitles as "aaruul05.commentary.en.srt).

For the purpose of this project, subtitles are used provide descriptive commentry rather than verbatim translations of spoken text. This allows for indexing and searching of actions and keywords.

2.4. Embed subtitles

Subtitles can be embedded into the Ogg container using the oggz tools, following conversion from SubRip to kate encoding. The principal advantage of embedded subtitles is that they are distributed along with the video itself, and therefore can be streamed over the web--unlike SubRip and other non-embedded formats, which require both video and subtitles to be downloaded prior to use [2]. Hard-coded subtitles are also a popular alternative, but present the limitations of requiring a complete re-encoding of a video every time annotations or modified, and do not allow for multiple subtitle tracks in the same recording.

   1 for FILE in *.ogv; do
   2  SOURCE=${FILE%.*}
   3  mkdir /tmp/$SOURCE/
   4  kateenc -t srt -o /tmp/$SOURCE/commentary.en.srt.ogg -c commentary -l en $SOURCE.commentary.en.srt
   5  mv $SOURCE.ogv _$SOURCE.ogv
   6  oggz-merge -o $SOURCE.ogv _$SOURCE.ogv /tmp/$SOURCE/commentary.en.srt.ogg
   7  rm -R /tmp/$SOURCE/
   8  rm _$SOURCE.ogv
   9 done
download

2.5. Resize

Call this script from the directory containing full-resolution videos with embedded subtitles.

   1 for file in *.ogv; do
   2  echo "$file... "
   3  ffmpeg2theora -y 360 -F 30 -a 3 -v 6 -o web/$file $file
   4  echo "done "
   5 done
download

2.6. Copy web-resolution clips to wiki

To create a page with the video player embedded:

  1. Create a new page using the VideoTemplate. The page name should be the same as the video filename, without the extension (e.g., MakingAaruul05 for the video MakingAaruul05.ogv).

  2. Edit the description and contributors values in the list, in Mongolian and in English. Also add any relevant category tags.
  3. Click on the "upload new attachment" link and upload the video. Repeat as necessary to upload the caption / annotation files.

3. Notes

[1] See Adam Hyde et al., Theora Cookbook, http://en.flossmanuals.net/TheoraCookbook/ (2010) for more general technical advice on using Theora video tools. Detailed information on the Ogg container and Theora video format are available from the Xiph.org Foundation's websites (http://www.xiph.org/ and http://www.theora.org/). The help pages on converting files to the Theora format for uploading to Wikimedia Commons (http://commons.wikimedia.org/wiki/Help:Converting_video) provide additional guidance on using simpler tools on Windows and Mac platforms. Many of the operations

[2] The new HTML5 <video> element will eventually allow for the designation of external subtitles files using the "track" element, but this feature has not yet been formally defined; for implementation status see HTML Living Standard, section 4.8.9, Web Hypertext Application Technology Working Group, http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html (February 11, 2009). The Kaltura video media library, based on code developed originally for Wikipedia/Mediawiki, provides a cross-browser javascript-based implementation of the "track" element (http://www.kaltura.org/project/HTML5_Video_Media_JavaScript_Library), but does not work completely in offline environments, limiting the applicability of this method the present project.

There are 0 attachment(s) stored for this page.

VideoCookbook (last edited 2011-03-02 07:23:16 by EricThrift)