CowLog: Open-source software for coding behaviors from digital video

Similar documents
Transcribing and Coding Audio and Video Files

07 - TRANSCRIPTION... 1 TRANSCRIPTION MODE Turning on Transcription Mode Start transcribing... 2

Meeting Visuals UCF Toolkit User Guide

ChemSense Studio Client Version 3.0.7

History of Unix and Linux

Parallels Remote Application Server

History of Video in Linux

Parallels Remote Application Server

New Features. BioGraph Infiniti version 5.0. Overall Improvements. Enhancing Compatibility with Windows Vista. Quick and Easy Sessions

Logger Pro 3. Quick Reference

VSPlayer Software User Manual

Share Content. Share Content

PONEMAH V5.30 WITH NOLDUS MEDIA RECORDER 4.0 QUICK START GUIDE

Sub Edit version 1.0 User's Manual

User Manual. Introduction. About this release. For existing MacroScope users

TrainingCentre Getting Started with the Universal

Open Systems Interconnection Model

Host Release Notes Version

VISUAL QUICKSTART GUIDE QUICKTIME PRO 4. Judith Stern Robert Lettieri. Peachpit Press

ViconNet / VMDC Version 7.0SP1 (Build 24)

The user guide may be freely distributed in its entirety, either digitally or in printed format, to all EPiServer Composer users.

TacticalPad Table of Contents

Computer Software A computer contains two major sets of tools, software and hardware. Software is generally divided into Systems software and

TOF-Watch SX Monitor

Product Release Note

Tutorial to QuotationFinder_0.6

Backup App V7. Quick Start Guide for Windows

The Kronometer Handbook. Elvis Angelaccio

MagicInfo VideoWall Author

Introduction to the SAM Student Guide 4. How to Use SAM 5. Logging in the First Time as a Pre-registered Student 5 Profile Information 7

MDA V8.3.1 What s New. Functional Enhancements & Usability Improvements

ViconNet Version 6.6SP3 (Build 93)

Using Movie Clips in PowerPoint Presentations: Part 1, Compatibility Issues

5.2. Click these tabs to jump to the Table of Contents, Index or start of each chapter.

PUB. DIE A. Canon XF Utility. Instruction Manual. Macintosh. Version 1.2

Ekran System v Program Overview

Textadept Quick Reference

Mirasys NVR. User s Guide

MacVCD X Read Me.

1.1 Technical Evaluation Guidelines and Checklist:

Fundamental of Digital Media Design. Introduction to Audio

EXPERIENCES WITH VIRTUALIZATION TECHNOLOGY IN EDUCATION

Lesson 5: Multimedia on the Web

Smart Logger II. User Guide SMART LOGGER II. Multichannel Call Recording and Monitoring System STC-S303. User Guide

Mac OS X Server Print Service Administration. For Version 10.3 or Later

1. Introduction Accessing imediatrans How to Register as a New User How to Login to imediatrans... 4

Xton Access Manager GETTING STARTED GUIDE

Microsoft Word 2007 on Windows

Table of Contents. Tops Digital Solutions DVS 2000 Series Users Manual Ver.2.0 2

Program manual for BirdOriTrack

Certified Audacity Professional VS-1112

Schedule User Guide PowerSchool Student Information System

BORIS Documentation. Release v7

The Observer XT. Quick Start Guide. Using The Observer XT for studying human behavior

GSEQ for Windows: New Software for the Sequential Analysis of Behavioral Data, with an Interface to The Observer

Manual Shell Script Linux If Not Equals. Statement >>>CLICK HERE<<<

LIGNES DE TEMPS GUIDEBOOK

minimum 800 X 600 screen (15' monitor) 32 MB memory 30 MB hard disc space


Railroad Crossing Pilot Study Video System User s Guide. Provided by:

Viewer for Luma Fisheye IP Surveillance Camera. Software Manual

FmPro Migrator Developer Edition - Table Consolidation Procedure

FXMovieManager Manual

FRACTAL COMPRESSION USAGE FOR I FRAMES IN MPEG4 I MPEG4

Computing in the Modern World

CA SOLVE:Access Session Management. User Guide

Use a Cisco DME to Transcode Video

Scribe 4 Manual 2. Scribe 4

TITLE CLOUD BASED VIDEO ANIMATION RENDERING MANAGEMENT SYSTEM INVENTOR: Thomas Ryan Mikota, of Orem Utah

EMC SourceOne for Microsoft SharePoint Version 6.7

Copy Music from CDs for Videos & Slideshows

Systems Programming. The Unix/Linux Operating System

HyperMedia User Manual

Enhanced ELAN functionality for sign language corpora

EEG and Video Data Acquisition with ASA. Tutorial

MOTIF XF Editor Owner s Manual

eclass Grades Classroom Teacher Guide Windows CSL

Student Outcomes. Lesson Notes. Classwork. Discussion (4 minutes)

E-ROW HELP V3.1. Creating a Race. Modify Race Dialog Box. Preferences Dialog Box

Adobe Flash Player 12 Problems Windows 7 S

User Guide Preface Readme Audience Vocabulary Navigation

Focus X2 Concepts. Contents

Configuring Job Monitoring in SAP Solution Manager 7.2

zenon manual Batch Control v.7.60

ATLAS.ti 6 Features Overview

Installing the Software

Replication Guide. Applications. Terminology. March, Premiere Line Server. Kaleidescape System. Replication Source.

NoteList 3.3 User Guide

jmetrik 2.1 What is jmetrik? Obtaining and installing the software Formatting and importing your data

AuraTester User Guide

Usability Test Report: Bento results interface 1

Student User Manual December 2017

Get QuickTime Pro. QuickTime 3 Pro: MoviePlayer for Mac OS. Overview. Find Out More

BBFlashBack Training for Library Staff

Chronotron - Change log

I. Introduction... 3 What is AVIDAnet SONUS...3 Interface...4 Colours... 4 Size... 4 Controls... 5 Volume... 5 View... 5 Always on top...

NoteList 4.1 User Guide

WinScribe Client User Guide

Creating Content in a Course Area

Ekran System v Program Overview

Transcription:

Behavior Research Methods 2009, 41 (2), 472-476 doi:10.3758/brm.41.2.472 CowLog: Open-source software for coding behaviors from digital video LAURA HÄNNINEN AND MATTI PASTELL University of Helsinki, Helsinki, Finland We have developed CowLog, which is open-source software for recording behaviors from digital video and is easy to use and modify. CowLog tracks the time code from digital video files. The program is suitable for coding any digital video, but the authors have used it in animal research. The program has two main windows: a coding window, which is a graphical user interface used for choosing video files and defining output files that also has buttons for scoring behaviors, and a video window, which displays the video used for coding. The windows can be used in separate displays. The user types the key codes for the predefined behavioral categories, and CowLog transcribes their timing from the video time code to a data file. CowLog comes with an additional feature, an R package called Animal, for elementary analyses of the data files. With the analysis package, the user can calculate the frequencies, bout durations, and total durations of the coded behaviors and produce summary plots from the data. Most behavior observations rely on video recordings because direct observation has a high risk of disturbing the observed subject. The observer scores the video data, usually with the help of behavior coding software. For complex video readings, the observer needs to be able to move forward and backward in the video, as well as to use different playback speeds. To read such video data successfully and fluently, the coding program needs to be able to track the video time code accurately. For behavioral recording from the videos, one can use different sampling methods. When recording behaviors continuously, one records each time the behavior occurs (frequency), the length of the behavioral sequence (bout duration), and the total time the subject exhibits each of the behaviors during the time period. During instantaneous behavioral recording, an observed behavior is scored in predefined time intervals. During one zero sampling, the observer records only frequencies for example, whether the behavior occurs (frequency) during the observed time periods (Martin & Bateson, 1995). We have developed the open-source software CowLog for recording behaviors from digital video. CowLog is easy to use and modify, and tracks the time code from video files and records the time with the coded behavior to a data file. The program is suitable for coding any digital video, but the authors have used it only in animal research. The new program is different from existing, similar software in three significant ways: (1) CowLog is the only software targeting Linux and BSD operating systems, (2) it is open-source software released under the GNU GPL license, and (3) it supports all popular video codecs, because it uses MPlayer as a video player. CowLog is the only solution that can be used without any software costs, because it works on free operating systems. This makes it especially appealing to students. The use of the GPL license means that the source code is available to all users, and users are free to use, modify, and redistribute the source code. Therefore, future developments of open-source software, unlike developments of freeware, are not dependent on a single developer. Digital video recorders use a variety of different video formats to encode video, and thus it is also important that the coding software has the ability to be used with as many formats as possible without the need to transcode the video. Several behavioral data collection programs are available, some of which are also freeware. However, these are not open-source programs and operate only in Microsoft Windows mfor example, Etholog (Ottoni, 2000), which does not read the video time code, and ODCS (MacLin & MacLin, 2005), which supports only mpeg and AVI video formats and does not provide any analysis tools. More powerful programs, such as The Observer (Noldus, Wageningen, The Netherlands), also read the video time code and have multiple analysis tools; however, The Observer is expensive and its license is restricted to a predefined number of computers. In many studies, the user needs only the simpler features of programs, such as coding the video and calculating total duration, bout duration, and frequencies from the data. The aim of this article is to introduce CowLog as a new open-source tool for behavioral research. We present information on the basic features, use, and structure of the software and also present the basic behavioral analysis of the data using a package called Animal for M. Pastell, matti.pastell@helsinki.fi 2009 The Psychonomic Society, Inc. 472

COWLOG 473 on one screen, and the coding window can be visible on another). Users type the key codes for their predefined behavioral categories, and CowLog transcribes their timing from the video time code to a data file. The data file can be used to calculate frequencies, bout durations, and total durations for each of the behaviors. CowLog comes with an additional analysis component, a package called Animal, for elementary analysis of data files. Animal is written with the open-source statistical software R. Packages provide a convenient way to distribute users own functions in order to extend the functionality of R. With the analysis program, the user can calculate the frequencies, bout durations, and total durations of the coded behaviors. The most recent version of CowLog can be freely downloaded from its homepage: www.mm.helsinki.fi/~mpastell/cowlog. Figure 1. The coding window of CowLog. The name of the video file being used is shown in the upper file dialog, and the userdefined name for the data file under it. B1, B2, and B3 are the behavioral classes available for the scoring, and squares below show the status of the users previous recordings in each of the behavioral classes. The left column of keys are the operator keys for the video window. Use Before starting the behavioral observations, the user must assign behavioral codes. The behavioral class is a set of behaviors, in which each occurrence is exclusive (i.e., the subject can either stand or walk, but not both). The behaviors belonging to parallel classes may occur simultaneously (e.g., standing and eating). At the moment, the program consists of three behavioral classes, each with eight behaviors. The names for the key codes are always the same (numbers from 1 to 24). The user decides which key code represents each of the coded behaviors. No initial setup is needed, since the key code definitions are always the same; however, the user needs to keep track of codes elsewhere. The user should also note that in this program the behavioral states (i.e., behaviors for which the user wants to record both the occurrence and duration) and events (behaviors for which only the number of occurrences is recorded) are defined in the analysis stage. Coding is performed continuously elementary analysis of data files, written with the opensource statistical software R, supplied with CowLog. COWLOG The program reads all common digital video formats and also works on older computers. The recommended operating system for CowLog is Ubuntu Linux 8.04, but it has also been tested on FreeBSD 7.0. The graphical user interface for the CowLog program has two windows: a coding window (Figure 1), for choosing the video files, defining the output file, and scoring behaviors, and a video window (Figure 2), showing the video used for coding. The windows can be used in separate displays (i.e., the video can be viewed in full screen Figure 2. The video window of CowLog with a test picture from a calf study.

474 HÄNNINEN AND PASTELL Table 1 Example Output From the Software Time (sec) Code 1.3 3 49.3 4 53.7 3 71.6 4 97.5 3 103.7 4 140.5 3 159.3 4 171.0 3 by logging the time each behavior starts. In the analysis stage, the type of the behavior is given as an input for the analysis function, and the start time of the next state is used as the end time of the previous state. Accordingly, the start time of events is used to mark the occurrence of a behavior. An example output from the software is shown in Table 1. After the program has been started, the user defines the video observation file to be used for coding and the prefix and location of the data files. After the files have been defined, the user simply presses the start button to start coding. The user can enter the scores by pressing the buttons in the coding window (Figure 1) or by pressing keyboard shortcuts. Each of the behavioral classes has a representative display from which the user can follow the five last-entered codes. If the user wants to code several behaviors with the same time code, he or she pauses the video, enters the codes, and resumes playing. The coding is ended simply by closing the program, and can be directly resumed to the same data files by moving to the correct position in the video. The program does not automatically give the user the resuming point; the user needs to check the time stamp in the last row of the data file. The user can run the video at different speeds up to five times the normal speed. To ease the search for a wanted point in a video, CowLog can automatically jump 30 sec forward or backward. CowLog saves the outputs for each behavioral class in separate data files. The output files have the extensions.bh1,.bh2, and.bh3, where the number corresponds to the behavioral class. The files contain the complete data of the observed sessions. The program saves the data after each scoring, so that no data are lost if the computer crashes or is disconnected. Coding errors are easy to remove manually from the data files after the recording has finished. Users can also define one key code in each of the classes as an error key. Pressing this key after the coding error has occurred marks the data point, which makes the removal of the wrong codes possible while using the descriptive analyses function. Software Description and System Requirements The recommended operating system for CowLog is Ubuntu Linux 8.04 (Canonical Ltd.), but it has also been tested with FreeBSD 7.0 (The FreeBSD Project). The program should run on most Linux and BSD distributions, as well as Mac OS X (Apple Inc.), provided the software dependencies are met. CowLog supports all video formats playable with MPlayer (which means most common video formats). The codecs for the required video formats need to be installed on the computer. The program consists of a graphical front end made with Kommander 1.3 (Britton, King, Laffoon, & Mantja, 2008), and it uses the MPlayer media player running in slave mode to show the video files and read the time code. A set of underlying shell and Gawk (Robbins, 2007) scripts are used to pass commands between the graphical user interface and MPlayer. Because of its modular structure, the program needs other software packages to run. All of the dependencies are open source and can be easily installed in Ubuntu using the graphical package manager. The following software packages are needed by CowLog. Kommander 1.3. Kommander is a tool for creating graphical applications with a simple user interface. Kommander produces noncompiled dialogs and very small applications that run fast and can be distributed without binary compatibility issues. It was used to create the coding window of the CowLog, and the commands passed on to MPlayer are called from Kommander scripts. MPlayer. MPlayer is a movie player that runs on many systems. It plays almost all existing video formats, such as MPEG/VOB, AVI, Ogg/OGM, ASF/WMA/WMV, and DivX 3/4/5. CowLog runs MPlayer in slave mode to play the videos and read the time codes. Gawk. Gawk is a GNU implementation of the popular Awk programming language (Robbins, 2007). The Awk utility interprets a special-purpose programming language that makes it possible to handle simple data-reformatting jobs with just a few lines of code. CowLog calls Gawk to format the output from MPlayer to a cleaner form before writing to the data file. Example Output From the Software CowLog writes the output files in plain text format. The output data are organized in columns: The first column shows the time in seconds from the beginning of video recording, and the second column represents the behavioral key code (Table 1). Each row represents each of the observations. Table 2 An Example Output From the Analysis Function Behavioral Feature Standing Still Locomotion Lying Down Hidden Frequency 270 269 30 9 Bout length (min) 0.8 0.37 37.33 4.03 Total duration of behaviors (min) 214.81 99.35 1,120.03 36.28

COWLOG 475 Input parameters from function call Order observations by time Calculate frequency of events Event Observation type State Remove duplicated codes Merge Calculate total duration, bout duration, and frequency of states Show table of Plot Figure 3. A flowchart showing the operation of the main analysis function in the Animal R package. DESCRIPTIVE ANALYSES OF RECORDED DATA The data files created by the program can be processed with almost any statistical software. We have written an analysis package, Animal, with the open-source statistical software R 2.72 (R Development Core Team, 2008). Packages provide a convenient way to extend the functionality of R. The package has a main analysis function to process CowLog data files. Other functions are called internally from the main function to perform specific tasks. We have also written a basic R manual for the package, and all its code is accessible for users to modify. The Animal package is available for download with CowLog. The from the analysis can be exported to other programs using the clipboard or R s functions for saving data. The main function (cowanalyze) takes the data file name, labels of the codes, and type (event or state) of the codes as inputs, and gives a summary table (Table 2) and a plot of the as output. The descriptive statistics will appear on-screen and can be saved to a variable and to a file. An example function is shown below: cowanalyze(file 'filename.bh1',states c(1,2,3), events c(4,5),state.names c('state1','state2', 'state3'), event.names c('event4','event5')) The function also removes double-state (duplicated) errors for state codes. The operation of the main analysis function in the package is shown as a flowchart in Figure 3. AN EXAMPLE PROJECT The sample files are obtained from the project studying calves activity, in which calves overall activity was scored continuously for 24 h. We show here an example of the behavior of 1 calf scored from a 24-h.avi video file. The data file was analyzed with the provided R function. The output obtained from the analysis is shown in Table 2 and the function produced is shown in Figure 4.

476 HÄNNINEN AND PASTELL Bout Duration of Different Behaviors 120 100 Bout Duration (min) 80 60 40 20 0 Standing Still Locomotion Lying Hidden Behavior Figure 4. An example output from the analysis function: A boxplot of the bout duration, in minutes, for different scored behaviors. DISCUSSION AND FURTHER DEVELOPMENT At the moment, CowLog is a basic program designed for coding the behavior of 1 subject from one video at a time. The development version of CowLog also works with two parallel videos. This can be beneficial in study designs in which 1 subject is filmed with several videos simultaneously, using synchronized time codes. In this case, only one data file is saved. Using several videos, however, requires the messages from the coding window to be passed to several instances of MPlayer, and this is not yet implemented in the distributed version. The maximum number of video files the program can read simultaneously depends on how many instances of MPlayer the computer can run. The R package Animal is provided with the software for easy calculation of elementary statistics. The package can be freely modified by users, just like CowLog. The analyzed data can also be exported in ASCII format or via the clipboard to other statistical software for the user s own calculations. The use of the analysis package requires a basic knowledge of how to use R, but the user can get descriptive statistics of a data file with a single function call. No advanced programming is needed. We are currently working on a graphical front end so that the user does not need to use R to get the descriptive statistics. The program can be used as is, because it does not need any modifications for the codes to be used. The behavioral codes are only saved as numbers; thus, the labels for different behaviors need to be supplied in the analysis stage. Thus, users can change states to events and vice versa, and return to already transcribed data for new analyses, if needed. Because CowLog is an open-source program, and the main window is created with a graphical tool, users can also modify the interface and data file formats for their own purposes. The use of an open-source license contributes to the reproducible research, because everyone can see exactly how the coding and analysis are executed. The program is freely available from its Web page, where users may share their comments and applications or ask for help from other users when troubleshooting. AUTHOR NOTE We thank DVM Ann-Helena Hokkanen for her valuable comments on the user interface and for testing of the software. Correspondence concerning this article should be addressed to M. Pastell, Department of Agrotechnology, P.O. Box 28, 00014 University of Helsinki, Helsinki, Finland (e-mail: matti.pastell@helsinki.fi). REFERENCES Britton, M., King, T., Laffoon, E., & Mantja, A. (2008). The Kommander handbook. Available from http://docs.kde.org/kde3/en/kdewebdev/kommander/index.html. MacLin, O. H., & MacLin, M. K. (2005). Coding observational data: A software solution. Behavior Research Methods, 37, 224-231. Martin, P., & Bateson, P. (1995). Measuring behavior: An introductory guide (2nd ed.). Cambridge: Cambridge University Press. Ottoni, E. B. (2000). EthoLog 2.2: A tool for the transcription and timing of behavior observation sessions. Behavior Research Methods, Instruments, & Computers, 32, 446-449. R Development Core Team (2008). R: A language and environment for statistical computing. Vienna: R Foundation for Statistical Computing. Robbins, A. D. (2007). GAWK: Effective AWK programming. A user s guide for GNU Awk. Boston: Free Software Foundation. (Manuscript received December 18, 2008; revision accepted for publication February 25, 2009.)