Assignment 2: Extract still images from video
DATE DUE: February 22, 2016
Points possible: 10 points
CS-161: Software Project
Instructor: Rob Bruce

OVERVIEW

For this assignment, you will use ffprobe (part of the FFMPEG library of tools) to retrieve metadata from a user-input video file. Your program will then store this metadata in Postgres.

SPECIFICATIONS

1. You may write this program in C, C++, Java, Perl, Python, BASH, or csh.

2. Your program should accept command line input through argc and argv. Your program will thus use argv to pass in the filename of an input video filename.

3. If you use C or C++, you will need to use popen() or use fork, exec, and named pipes to execute ffprobe in a shell and redirect output through a pipe into your program for processing.

Using ffprobe, Your program will extract the following metadata from the input video:

  • The frame rate (frames per second) of the input video file.
  • The number of frames in the input video file.
  • The horizontal resolution of the input video (in pixels).
  • The vertical resolution of the input video (in pixels).

4. Your program will store this metadata (above) in a Postgres table.

5. Your program will create a local directory with a unique name (a positive integer) under a repository. Still images from your video will be stored there. HINT: use the auto incrementing primary key from your video metadata table for the name of the directory!

6. Your program will use FFMPEG to extract and store (in the repository) every still image from the input video.

SUBMITTING YOUR PROGRAM

1. Please submit your program as a text file to the Canvas dropbox. I only need the source code. I will build the program myself.

2. Please name your program using the following naming convention:

Lastname_Firstname_assignment_2.c (for C programs)

Lastname_Firstname_assignment_2.cpp (for C++ programs)

Lastname_Firstname_assignment_2.java (for Java programs)

Lastname_Firstname_assignment_2.pl (for Perl programs)

Lastname_Firstname_assignment_2.py (for Python programs)

Lastname_Firstname_assignment_2.sh (for BASH programs)

Lastname_Firstname_assignment_2.csh (for csh programs)

For example, my name is Rob Bruce. If I write my program in the C programming language, my assignment 2 should be named: Bruce_Rob_assignment_2.c

3. Please include your name as a comment at the beginning of your program like this:

/* Rob Bruce */

or this:

// Rob Bruce

4. I usually do not need a makefile to build your programs, regardless of language; however, in the unlikely event that I cannot build your project, I will send an email inquiry as appropriate.

5. I expect your program to build without syntax errors.

6. I expect your program to execute without run-time errors.

GRADING

Points will be deducted for any program that does not meet the specification as outlined above.

LATE ASSIGNMENTS

Assignments submitted after the due date will be worth, at most, 5 points. Additional points will be deducted for programs not meeting the specification as outlined above.