Pelican Parts
Parts Catalog Accessories Catalog How To Articles Tech Forums
Call Pelican Parts at 888-280-7799
Shopping Cart Cart | Project List | Order Status | Help



Go Back   Pelican Parts Forums > Miscellaneous and Off Topic Forums > Off Topic Discussions


Reply
 
LinkBack Thread Tools Rate Thread
Author
Thread Post New Thread    Reply
Registered
 
id10t's Avatar
 
Join Date: Mar 2003
Posts: 10,318
fellow geeks (esp. linux users) - i need help

OK, so we've been building a new building here at work, and I wanted to do a stop motion movie of it. I've done it before, looks way cool, oohs and aaahs at the opening ceremonies.

This time I forgot to not take pictures at night, so approximately half my movie is boring nothingness.

So now I've got not quite 100,000 jpegs, each taken 5 minutes apart, and with sequential file names (2000000001.jpeg, 2000000002.jpeg, etc)

I need to get rid of the boring night stuff. I've tried making my movie and using a NLE (premier on a winxp box) to remove the night stuff, but my skills are weak in that area, and it took forever to just do a few days worth of it, and it would take me weeks to finish it that way.

I'm thinking I'd need to loop thru all the files and check the creation date and then get rid of whatever happened from 7pm to 6am, then re-loop thru them again and rename them so I'm back to consecutive file names (berkeley's mjpeg encoder doesn't like to skip anything in a sequence of names).

Any creative ideas on this?

__________________
“IN MY EXPERIENCE, SUSAN, WITHIN THEIR HEADS TOO MANY HUMANS SPEND A LOT OF TIME IN THE MIDDLE OF WARS THAT HAPPENED CENTURIES AGO.”
Old 08-18-2006, 09:02 AM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #1 (permalink)
Feelin' Solexy
 
Tishabet's Avatar
 
Join Date: Oct 2003
Location: WA
Posts: 3,786
Perl, baby! Regex that shizz!
__________________
Grant
In the stable: 1938 Buick Special model 41, 1963 Solex 2200, 1973 Vespa Primavera 125, 1974 Vespa Rally 200, 1986 VW Vanagon Syncro Westfalia, 1989 VW Doka Tristar, 2011 Pursuit 315 OS, 2022 Tesla Y
Gone but not forgotten: 1973 VW Beetle, 1989 Porsche 944, 2008 R56 Mini Cooper S
Old 08-18-2006, 09:05 AM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #2 (permalink)
Registered
 
id10t's Avatar
 
Join Date: Mar 2003
Posts: 10,318
Yeah, I'll need to use some regexes (maybe)... I can get a long listing of the files that will include the date/time they were taken. Some fancy work with grep and cut could give me the names of the files I want to keep, or vice versa and give me the names of what I want to delete. I'm just trying to figure out the best/easiest way, since if I make a copy of the images it changes the ctime/mtime/atime to now, so I've basically only got one shot ...
__________________
“IN MY EXPERIENCE, SUSAN, WITHIN THEIR HEADS TOO MANY HUMANS SPEND A LOT OF TIME IN THE MIDDLE OF WARS THAT HAPPENED CENTURIES AGO.”
Old 08-18-2006, 09:28 AM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #3 (permalink)
Too big to fail
 
widebody911's Avatar
 
Join Date: Jan 2002
Location: Carmichael, CA
Posts: 33,894
Garage
Send a message via AIM to widebody911 Send a message via Yahoo to widebody911
Use perl readdir structure to loop thru the files, for each file grab the fstat (File::stat) structure to get the timestamp, then copy the new file using a new index counter.

hacked-out psuedocode off the top of my head
Code:
use File::copy;
use File::stat;
use Time::locatime;

$new_index=1;
opendir(DIR, "your/data/directory") || die "ooops!"
foreach my $old_file (readdir(DIR)) {
   my $time = ctime(stat($old_file)->mtime);
  next if ($time outside my range) # you have to work out this bit
  
  copy ("$old_file", "file.$new_index)
   $new_index++;
}
close(dir);

__________________
"You go to the track with the Porsche you have, not the Porsche you wish you had."
'03 E46 M3
'57 356A
Various VWs
Old 08-18-2006, 09:37 AM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #4 (permalink)
Reply


 


All times are GMT -8. The time now is 11:04 PM.


 
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0
Copyright 2025 Pelican Parts, LLC - Posts may be archived for display on the Pelican Parts Website -    DMCA Registered Agent Contact Page
 

DTO Garage Plus vBulletin Plugins by Drive Thru Online, Inc.