use DateTime::Format::Strptime qw( );
# Set our ffmpeg creation_time format
-$ffmpeg_time_format = DateTime::Format::Strptime->new(pattern=>'%Y-%m-%dT%H:%M:%S', time_zone => 'UTC', on_error => 'croak');
+$ffmpeg_time_format_utc = DateTime::Format::Strptime->new(pattern=>'%Y-%m-%dT%H:%M:%S', time_zone => 'UTC', on_error => 'croak');
+$ffmpeg_time_format_local = DateTime::Format::Strptime->new(pattern=>'%Y-%m-%dT%H:%M:%S', time_zone => 'local', on_error => 'croak');
####################################################################################################
# Configuration parameters
if(! -r "$video") { die "-E- Unable to read input video file: $video\n"; }
my $mtime_epoch = 0;
my $creation_time = `$ffmpeg -i "$video" 2>&1 | grep "creation_time" | head -n 1 | awk '{print \$3}'`;
+ my $brands = `$ffmpeg -i "$video" 2>&1 | grep "compatible_brands" | tail -n 1`; chomp($brands);
if($creation_time) {
- my $date_taken = $ffmpeg_time_format->parse_datetime($creation_time);
+ my $date_taken = $ffmpeg_time_format_utc->parse_datetime($creation_time);
+ if ($brands && $brands =~ /$local_tz_brands/) {
+ $date_taken = $ffmpeg_time_format_local->parse_datetime($creation_time);
+ }
$date_taken->set_time_zone('local');
$mtime_epoch = $date_taken->epoch;
} else {
my $sec = 0;
my $mtime_epoch = 0;
my $creation_time = `$ffmpeg -i "$video" 2>&1 | grep "creation_time" | head -n 1 | awk '{print \$3}'`;
- if($creation_time) {
- my $date_taken = $ffmpeg_time_format->parse_datetime($creation_time);
+ my $brands = `$ffmpeg -i "$video" 2>&1 | grep "compatible_brands" | tail -n 1`; chomp($brands);
+ if($creation_time) {
+ my $date_taken = $ffmpeg_time_format_utc->parse_datetime($creation_time);
+ if ($brands && $brands =~ /$local_tz_brands/) {
+ $date_taken = $ffmpeg_time_format_local->parse_datetime($creation_time);
+ }
$date_taken->set_time_zone('local');
$mtime_epoch = $date_taken->epoch;
} else {
use DateTime::Format::Strptime qw( );
# Set our ffmpeg creation_time format
-$ffmpeg_time_format = DateTime::Format::Strptime->new(pattern=>'%Y-%m-%dT%H:%M:%S', time_zone => 'UTC', on_error => 'croak');
+$ffmpeg_time_format_utc = DateTime::Format::Strptime->new(pattern=>'%Y-%m-%dT%H:%M:%S', time_zone => 'UTC', on_error => 'croak');
+$ffmpeg_time_format_local = DateTime::Format::Strptime->new(pattern=>'%Y-%m-%dT%H:%M:%S', time_zone => 'local', on_error => 'croak');
$ctime_format = DateTime::Format::Strptime->new(pattern=>'%a %b %d %H:%M:%S %Y', time_zone => 'local', on_error => 'croak');
# Early command line options processing
# Make a note of the month, year, and day this video was taken
$creation_time = `$ffmpeg -i "$srcdir/$srcfile" 2>&1 | grep "creation_time" | head -n 1 | awk '{print \$3}'`;
+ $brands = `$ffmpeg -i "$srcdir/$srcfile" 2>&1 | grep "compatible_brands" | tail -n 1`; chomp($brands);
if($creation_time) {
- $date_taken = $ffmpeg_time_format->parse_datetime($creation_time);
+ $date_taken = $ffmpeg_time_format_utc->parse_datetime($creation_time);
+ if ($brands && $brands =~ /$local_tz_brands/) {
+ $date_taken = $ffmpeg_time_format_local->parse_datetime($creation_time);
+ }
} else {
# From the modification time of the file since we couldn't find it in the video file
$date_modified = ctime(stat("$srcdir/$srcfile")->mtime);
# Path to move the originals to
$origpathname = "/naspool/dropbox/Originals";
$originals_file_ext = qr/(mov|mp4)/i;
-$originals_no_copy_brands = qr/mp42avc1/i; # Don't copy videos from camcorder to Originals because we keep these videos on those cards
+#$originals_no_copy_brands = qr/mp42avc1/i; # Don't copy videos from camcorder to Originals because we keep these videos on those cards
+$originals_no_copy_brands = qr/none/i; # We no longer keep the cards
$save_originals = 1;
+# Brands that store time as local vs UTC
+$local_tz_brands = qr/mp42avc1/i; # the camcorder sets the creation time to the local time with no timezone (so UTC), so treat them as local timestamps, not UTC timestamps
+
# Path to a dir (or dirs separated by semis) to watch for videos to move to $srcpathname to be organized
$watchpathname = "/naspool/cloud/alan/files/InstantUpload/Camera;/naspool/cloud/mary/files/InstantUpload/Camera;";