Skip to content

Commit

Permalink
Capture and pass along the capture directory
Browse files Browse the repository at this point in the history
Toward #42.
  • Loading branch information
waldoj committed Jan 14, 2018
1 parent 5695ee7 commit 48bd5be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bin/handler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ fi

# Create the record for this video in the database.
cd ..
export VIDEO_ID="$(php ../bin/save_metadata.php "$filename")" || exit
export VIDEO_ID="$(php ../bin/save_metadata.php "$filename" "$output_dir")" || exit

# Insert the chyrons into the database.
php ../bin/parse_video.php "$VIDEO_ID"
Expand Down
7 changes: 7 additions & 0 deletions bin/save_metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@
* The filename must be specified at the command line.
*/
$filename = $_SERVER['argv'][1];
$capture_dir = $_SERVER['argv'][2];

if (empty($filename))
{
die('You must specify the filename');
}

if (empty($capture_dir))
{
die('You must specify the output directory');
}

/*
* Make sure the file exists.
*/
Expand Down Expand Up @@ -43,6 +49,7 @@
* Use mplayer to get some metadata about this video.
*/
$video->path = $filename;
$video->capture_directory = $capture_dir;
if ($video->extract_file_data() === FALSE)
{
echo 'Could not get metadata about ' . $filename . ' from mplayer';
Expand Down

0 comments on commit 48bd5be

Please sign in to comment.