|
||||||
| Forums FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Novell Archives Archived content from Novell openSUSE support forums |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hello,
I'm new to using Linux as my full time PC at home (though I have been using a MythTV box for about a year now, so I have some Linux experience). One process I have yet to figure out how to replicate is transferring my images and movies from my camera and renaming them. Actually it is just the renaming portion that I need assisstance with. On my Windows PC I had renamed all of my images as YYYY-MM-DD-HHMMSS.<ext> (jpg or mov) during the import process. I have tried searching for a script or something that would perform this task on Linux. I found that JHead would do this for all of my images, using the EXIF information, but I would still need something to rename all of my movies. I figure that this is possible with some sort of shell script, but I don't know how to get the file date information in the script. I'm hoping that someone here can offer some insight. -- ----------------------------------------------------------------- Timothy M. Musa Community Consolidated School District 93 Carol Stream, IL http://www.ccsd93.com/ ----------------------------------------------------------------- |
|
|||
|
Tim Musa wrote:
> Hello, > > I'm new to using Linux as my full time PC at home (though I have been using > a MythTV box for about a year now, so I have some Linux experience). One > process I have yet to figure out how to replicate is transferring my images > and movies from my camera and renaming them. Actually it is just the > renaming portion that I need assisstance with. On my Windows PC I had > renamed all of my images as YYYY-MM-DD-HHMMSS.<ext> (jpg or mov) during the > import process. I have tried searching for a script or something that > would perform this task on Linux. I found that JHead would do this for all > of my images, using the EXIF information, but I would still need something > to rename all of my movies. > > I figure that this is possible with some sort of shell script, but I don't > know how to get the file date information in the script. I'm hoping that > someone here can offer some insight. > I made a hack to dump my camera into a directory, where all files is named after the date in the EXIF field. You can maybe use some of it for your own script. #!/bin/bash Olympus=/media/usbdisk cd ${Olympus}/dcim/100olymp || exit for i in *.jpg do exif=$(exiftran -d $i |grep '0x0132' |\ sed -e 's,.*Date and Time.*\(20..\) (..\) (..\) \(..\) (..\) (..\),\1\2\3-\4\5\6.jpg,')if [ ! -e $exif ] then cp $i ~/Olympus/$exif fi done If you will have YYYY-MM-DD-HHMMSS , change the sed to \1-\2-\3-\4\5\6.jpg For movies I don't know, since my own movies are from dv format first, and I use dvgrab --timestamp , so they get this name from start. Some day I must test MythTV , but I'm not there yet. /birre |
|
|||
|
Birger wrote:
> Tim Musa wrote: >> Hello, >> >> I'm new to using Linux as my full time PC at home (though I have been using >> a MythTV box for about a year now, so I have some Linux experience). One >> process I have yet to figure out how to replicate is transferring my images >> and movies from my camera and renaming them. Actually it is just the >> renaming portion that I need assisstance with. On my Windows PC I had >> renamed all of my images as YYYY-MM-DD-HHMMSS.<ext> (jpg or mov) during the >> import process. I have tried searching for a script or something that >> would perform this task on Linux. I found that JHead would do this for all >> of my images, using the EXIF information, but I would still need something >> to rename all of my movies. >> >> I figure that this is possible with some sort of shell script, but I don't >> know how to get the file date information in the script. I'm hoping that >> someone here can offer some insight. >> > > I made a hack to dump my camera into a directory, where all files is named after the date > in the EXIF field. > > You can maybe use some of it for your own script. > > #!/bin/bash > > Olympus=/media/usbdisk > > cd ${Olympus}/dcim/100olymp || exit > > > for i in *.jpg > do > exif=$(exiftran -d $i |grep '0x0132' |\ > sed -e 's,.*Date and Time.*\(20..\) (..\) (..\) \(..\) (..\) (..\),\1\2\3-\4\5\6.jpg,')> if [ ! -e $exif ] > then > cp $i ~/Olympus/$exif > fi > done > > If you will have YYYY-MM-DD-HHMMSS , change the sed to \1-\2-\3-\4\5\6.jpg > > For movies I don't know, since my own movies are from dv format first, and I use > dvgrab --timestamp , so they get this name from start. > Some day I must test MythTV , but I'm not there yet. > > > /birre Hmm, I saw some error :-( it should be: if [ ! -e ~/Olympus/$exif ] /birre |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|