Monday, October 06, 2008

Photoshop Template for Epson R260 Printing to CD

Printer manufactures bug me. Their razor-and-blade method of marketing with the capacity of ink cartridges getting smaller and smaller and the cost getting higher and higher is really annoying. Fortunately, I found a great Continuous Ink System for my Epson. More on that later.

I have an Epson R260 printer. It's a great printer. I rarely use it to print directly on CDs because I prefer to use glossy labels which give me a much better look. But I had a project where the label was all text and it became practical (and cost-effective) to print on the disc directly. I'd long since thrown the driver disk away - I always just download the latest drivers from the Internet. Unfortunately, the Epson PrintCD software was on that disk, and you can't download it ANYwhere (at the time of writing - I looked all over and couldn't find it, except here - where the web page author will email you instructions on how to download it apparently - I put in a request and haven't heard back yet...we'll see). [UPDATE: The author did contact with me with a link to download the software but I don't really need it now that I have a Photoshop template. But if you want it, I won't steal his thunder. Go to the page linked above and make a request under feedback.] It is really annoying that Epson does not provide this as a download. What about updates??? Apparently for $9.95 they'll send you another CD. Thanks a lot, Epson. Anyway, I don't need their lame software other than to align where in the world I am supposed to print so that it lines up on the CD properly. I normally just design in Photoshop, save to JPG, and use their software to print. I got tired of looking for the software and figured it wouldn't take me that long to just design a Photoshop template with guides to print the label in the right place.

It didn't take too long. The Epson driver software sets the paper size to A4 when you select CD/DVD as the source, so I created an A4 blank Photoshop page (300 dpi) and put a black circle on it (taken from another template I already had so I knew the size was right). After a few print-move iterations, I got it right.

So basically, in Epson's driver software (printing preferences) set the Source to CD/DVD, the Type to CD/DVD, and the Size (which will automatically change) to A4 (210 x 297 mm). Then use this template to line up your artwork.

In my experience, it seemed to print a little lighter than normal when printing to the CD (a matte surface on my CDs). Normally when I print from Photoshop I go into the "advanced" area of the Epson driver, select ICM, and leave the "Off (no color adjustment)" box unchecked. Using ICM seems to normally give me better color matching. In this case, I set it to ICM and CHECKED the "Off (no color adjustment)" box and this seemed to give me very accurate results. Of course, I was only printing colored text and a simple small football image, so I didn't exactly have a really colorful sample to go off, but that seemed to work best.

epsonR260-CDTemplate.psd

Thursday, August 07, 2008

Script to reverse order of open documents in Photoshop

I am constantly scanning batches of documents into Photoshop and needed a way to reverse the order of the open documents. For example, I'm scanning 50 documents of a child growing up from age 0 to 20. I start with the baby picture and end with the picture of them at 20. When I'm done scanning I then want to save them in order, starting with 001.jpg as the youngest picture and 050.jpg as the oldest picture. Problem is, when I'm done scanning the active document is the oldest picture, and I often don't know exactly how many documents I've scanned, so I can't just start with 050.jpg and start counting down. If only I could reverse the order of the open documents - then I could start with 001.jpg and just end with whatever number of documents I scanned.

I used to do this by automating a save action and just saving all the documents and then reopening them. This worked OK because the documents were all Untitled-4, Untitled-5, etc, and I could open them in alphabetical order. But I thought that surely there must be a better way. I finally broke down and wrote a very simple vbscript to accomplish this task.

Here it is:
**************
'declare variables:
dim app
dim doc
dim arrDocs
dim strDocs

'set object reference to photoshop:
set app=createObject("Photoshop.Application")

'create a comma delimited string of all open photoshop documents:
for each doc in app.documents
strDocs=strDocs & doc.name & ","
next

'take off the last comma:
strDocs=left(strDocs,len(strDocs)-1)

'split the string into an array:
arrDocs=split(strDocs,",")

'iterate through the array in reverse order, making each document the active document as you go:
i=ubound(arrDocs)
do while i=>0
app.ActiveDocument=app.documents(arrDocs(i))
i=i-1
loop

'cleanup:
set app=nothing
*************************

Copy and paste the area between the asterisks into notepad, save it as reverseOrder.vbs, and double click it. Voila (assuming you have Photoshop open with all your documents open).

Your reason for wanting to reverse the order of open documents in Photoshop could be different, but at least this is a way to do it. I searched the web and couldn't find a way, so there you go. If there is a simple way, and I'm a moron for resorting to a script to accomplish something easily done another way, please let me know!

For more information on Photoshop scripting, refer to the Photoshop CS3 scripting guide, downloadable from Adobe, and maybe on your computer if you installed the content CD with the Master Collection (in my case, this is found in C:\Program Files\Adobe\Master Collection Content CD\Documentation\Scripting\Adobe Photoshop CS3)

Friday, May 09, 2008

From YouTube to Powerpoint

I get asked this question quite often: How can I take a video from YouTube (or some other video site) and put it in PowerPoint? Unfortunately, it's definitely not a drag and drop operation. These instructions are kind of long, but really not that difficult, and once you do it it's easy to figure it out. There are two basic ways to do it.
1 - Download the flv, get a flv player, associate flv files with the flv player, and link to the file in PowerPoint
2 - Download the flv, convert it to a wmv file, and insert it as a movie file in PowerPoint.

The latter is definitely preferable. So here are the instructions for both ways:
1 - Find the video on YouTube. Once you've located it, clear your browser cache. This isn't totally necessary, but makes the video easier to find. In Internet Explorer this is done via Tools -> Options -> Delete. If you're using IE and haven't done this for awhile (or ever) prepare to wait awhile while it clears the cache. I figure if you are using Firefox then you know how to do this.
2 - Load the video, or if you are already on the page with the video, refresh the page. Wait for the video to finish downloading - you don't need to play it all the way through (you can even pause it if you want) but let the red bar indicating how much it has downloaded progress all the way to the end.
3 - Once downloaded, go back to Tools -> Options and access your cache. If you are using Firefox, browse to your cache in windows explorer. In XP, this will be c:\Documents and Settings\[yourusername]\Local Settings\Application Data\Mozilla\Firefox\Profiles\[nameofyourprofile]\Cache. Make sure you are viewing protected operating system files or you won't see the necessary folders (in windows explorer: Tools -> Folder Options -> View -> UNcheck "Hide Protected Operating System Files"). The nameofyourprofile mentioned is probably the only folder listed, and probably ends in "default." Whether using IE or Firefox, sort the cache by size. The largest file is probably the video file you want, and for YouTube videos will likely start with "getVideo." Copy it to your computer somewhere, like your desktop, and rename it to MyVideo.flv (or whatever, as long as it ends in flv). You can also use Real Player to download the video easier than pulling it from your cache, but personally I hate Real Player, so I'm not going to encourage you to use it. There are also several web services out there that will create the flv for you to download if you give it the video ID, but why bother? It's easy enough to just get it from your cache.
4 - If you plan to convert it to a WMV to play inside PowerPoint, then go to step 5 - otherwise do step 4 and then you are done. If you are just going to link to the file in PowerPoint, then create a hyperlink in PowerPoint that points to the FLV file. You will need a FLV player installed on the computer that will be showing the PowerPoint. There are lots of them out there - Wimpy Flash Player is a good one - just a simple standalone exe (nothing to install). You do need to tell windows to use this program to open .flv files though - the easiest way to do this is just to double click the flv file, and when prompted, point Windows to "Wimpy FLV Player.exe" (wherever you put it) and make sure the box "Always use this program to open this kind of file" is checked.
5 - Again, there are lots of programs you could use to convert FLV to WMV. I recommend VLC Player from VideoLan. It's free (open source), and plays just about any kind of video or audio file, and can be used to convert from one type to the other. Download it and install it using the above link.
6 - Someone has already written instructions on how to use VLC to convert FLV to WMV, so I'm not going to reinvent the wheel, but let me know if the above link no longer works.
7 - Once converted to WMV, insert the file into PowerPoint as a movie file.

Please note that there are often copyright ramifications. Just because something is on YouTube doesn't mean that the person who put it there didn't violate copyright by putting it there in the first place.

Wednesday, April 30, 2008

Scripting JPGs to WMV to create Time Lapse videos

At my primary job I am responsible for 5 construction cameras that monitor a major downtown redevelopment project. These cameras provide video as well as take period snapshots, both of which can be accessed remotely via a web interface. The cameras are 4 Axis 232D+, and one Axis 233D. There's a ton I could write about this whole project, but I mainly wanted to document my current procedure for taking the JPG images and converting them to video files to be used in powerpoint, put on DVD, etc. I'm writing this for my own benefit and documentation, so things may be sketchy, feel free to ask me if you have any questions. This is a work in process...

These are PTZ cameras, and they are each programmed with 3-6 preset positions at which they take a still image, every half an hour from 8am to 6pm. That means that every half an hour I get still shots of about 20 different views. All of these views can be used to create time lapse videos. The powers that be would like a time lapse video of every sequence (or view) once per quarter. I use Adobe Premiere all the time, but it would be insane to try to accomplish this with that product - enter open source.

Ok, here is the basic workflow:

  1. Use windows find to get just the images I want. I'm using vista, so I can use advanced query syntax. The cameras take images every half an hour - for longer spanning time lapses I typically just want one picture per day. Because I want a certain time each day, I can't use date/time criteria for search, so I use the file name, which are all datetime stamped. Syntax for one per day:
    name:*16-0?-??-??.jpg

    syntax for range:
    name:*12-0?-??-??.jpg OR name:*13-0?-??-??.jpg OR name:*14-0?-??-??.jpg OR name:*15-0?-??-??.jpg OR name:*16-0?-??-??.jpg OR name:*17-0?-??-??.jpg OR name:*18-0?-??-??.jpg OR name:*19-0?-??-??.jpg OR

    The latter would give me all images at 12pm, 1,2,3,4,5,6,and 7pm. By the way, I use a vbs script to sort all the images the camera takes into folders for each camera, sequence, year, and quarter. Maybe I'll write about that part of it later.

  2. Once I've found the images I want, I process them with a utility called MakeAVI (http://sourceforge.net/projects/makeavi/). Two things I'd like to see in this program: drag and drop and command line scripting. I found some paid versions out there that do this, but I like free, and for the most part this program does the simple job it's programmed to do (a user on sourceforge actually took the source code and made it scriptable through a CLI, but neither the source or the binary for that is posted - I emailed to see if it was available). Because I can't drag from my search window into MakeAVI, I copy the files to an empty folder and then add the files from there. When using MakeAVI, I use the DivX encoder to compress the AVI files. Uncompressed takes longer and the file size is unnecessarily huge. I don't want to lose much quality, so my DivX settings are: Certification Profile: Home Theater Profile; Use presets to configure the encoder: checked; Rate control mode: 1 pass quality based; Target quantizer: 1; no other changes.

  3. Convert the DivX avi to a WMV file. Personally, I'd be happy with DivX, but these will be used in PowerPoint, so WMV is your best bet for compatability there. For this I use a slick little program called SUPER. It's basically a gui to a ton of different codecs and open source utilities. You can batch process, so I typically create all of my avi's first, then batch process them all to WMV. My settings in SUPER are: Output Container: WMV; Output Video Codec: WMV8; audio is disabled; Video Scale size: no change; aspect: no selection; Frame/Sec: 25; Bitrate: 4032 (quite high, I know, but I've found it needs to be at least this high to avoid blocky compression artifacts);Options: High Quality. SUPER is scriptable, so I may create a script to automatically process all my AVIs for me, but it's pretty easy to just add them manually and batch process them.


Other notes:
Because the files are all on a server on my network, it would be a pain to copy all the files locally that I needed. So I use offline files in Vista. Vista handles caching all the files locally, then when I want to process them I tell Vista to work offline. The when processing the images it uses the local copies.

I'm working on a script to automatically copy the appropriate images I need into various folders, all ready to be processed with MakeAVI, rather than having to do a windows search, and copy routine, like in step #1.

Saturday, December 22, 2007

Eliminating shaky frame holds

In a previous blog I mentioned I'd talk about getting good frame holds, so I'd better be true to my word. See my blog about getting good slow motion in Premiere for details on why frame holds can be shaky - I won't duplicate that here.

Shaky frame holds can be a sure sign of amateur work, but it's very easy to fix. The basic rule is this: ALWAYS deinterlace your frame hold clip (field options on the clip). It's now a still shot, so you don't need interlacing, and it can cause shakiness in any area of the frame where details differs from field to field (which is why someone's hand may be shaky in the frame hold when the rest is perfectly still). Some people prefer to simply export the frame and put the still .bmp or .tif on the timeline - that works too.

One other guideline - do not stretch out a frame hold clip by using speed - move the end point instead. Slowing it down too much (even though it's only one frame) can cause Premiere to do wierd things. If you're already at the end of your clip and need it to frame hold for more time, then repeat it - don't stretch the time. If you can't repeat it because you want a consistent zoom/pan across the entire frame hold, then put the individual clips in a separate sequence and then nest the sequence and zoom in on the sequence (which will be one "clip").

One other note - with CS3's time remapping feature, you can now gradually slow the footage down to a still, something I've longed to be able to do inside of Premiere for quite some time. Very cool. The deinterlacing rule still applies on the still frame.

Labels: ,

Monday, November 12, 2007

VOB Files and Adobe Premiere - Editing from DVD

I often find myself being given DVDs as source videos for a project. Whether it's creating a wedding video, a sports highlight film, a tribute video, or some other project, more and more people have their video footage on DVDs (only) these days. Obviously this is not a great situation for editing - the video file has already been compressed, so you've already lost quality to begin with. But the fact is that you have to work with what you've got.

You'd think that getting the files off the DVD to edit in Premiere (or the NLE of your choice) would be simple - copy the VOB files and drop them into Premiere. Oh that life were so simple. Premiere doesn't recognize VOB files. So you rename them to .MPG (or .AVI) and drop them into. That seems to work until you put one on the timeline and get no audio. If the DVD used AC3 as the audio track, then you'll have no audio because you can't bring an AC3 file into Premiere. I wish you could, but you can't - I think it's a copyright thing. Maybe you're lucky and the DVD you have was created using MPEG-1 Layer II as the audio. You drop it on the timeline and get audio but it just doesn't play back very well. Premiere stutters and playback is so bad it's unusable.

I've used a slew of tools to try to make this process easy on me and while there is no "Easy button" I've figured out something that works for me.

Enter VirtualDubMod. You can download it from sourceforge at:
http://sourceforge.net/project/showfiles.php?group_id=65889
Yeah, I know - it hasn't been updated forever, but it still works great. Sure it's not the most user friendly and pretty "open-source-ish" and to be honest I don't know what half of its features actually do, but it's a wonderful tool. The basic idea is that you open each VOB file and save it as an AVI. What? Render each file? That will take forever and gobs of hard disk space! Don't fret just yet, keep reading. (I'll talk using different tools to edit the compressed files later, but I prefer to edit with DV AVI files).

The first thing is getting the files off the DVD. Sure you can just copy them, and most of the time that works (for non-encrypted files) but sometimes it doesn't, you can get very weird results. For best results, I use another great little utility called DVDDecrypter. Its main purpose is really to break the Macrovision (or other) encryption on copyrighted DVDs and let you get at the video files. But that's a legal gray area, and that's not what I actually use it for. Most of the DVDs I'm given to use are not copy-protected. You can download DVDDecrypter from:
http://www.dvddecrypter.org.uk/

Ok, now you've got a bunch of .VOB files on your hard drive. It's time for VirtualDubMod. The first thing is that VirtualDubMod will create uncompressed AVI files. Many people think that's what they want, but actually it isn't. What you want (for optimal editing in Premiere) are DV AVI files, which VirtualDubMod doesn't make (out of the box). You have to get a DV AVI codec, which can be suprisingly hard to find. I use the Panasonic DV codec because it's free and you can download it from:
http://www.free-codecs.com/download/Panasonic_DV_Codec.htm
which also contains instructions on installing it. Once installed, it will show up as an available codec in VirtualDubMod (save as -> select AVI as the file type -> click change button -> select Panasonic DV Codec.) Now you can open the VOB file directly with VirtualDubMod and save it as a DV avi file and bring it into Premiere. Life's getting better (we're not done yet)!

Sometimes I have 10-12 DVDs of a whole football season and I need to make a highlight video. Sometimes the VOB files are little 5 minute clips on the DVD (depending on how it was created), so there are hundreds of VOB files. I don't want to open each one individually and click save as hundreds of times and wait for each file to transcode. Here's where VirtualDubMod gets cool. You can save that task for later, and then run them all at once with "Job Control." Ok, so that's better, but I still need to open the file (which takes a few seconds by itself), click save as, and give it a file name. That can still take forever. This brings me to the real reason I'm writing this article: scripting the VOB to AVI Job Control list for VirtualDubMod.

I wrote a little vbs utility (I know, you PHP and perl gurus out there are gagging) to search through a directory structure, find all the VOB files, and create a job control script that can be opened in VDubMod. (download link below) Ok, now your work flow looks like this:
1 - Use DVDDecrypter to get the VOB files onto your hard disk, in a separate folder for each DVD, all in the same parent folder. (I use two machines for this so I have two going at once, then copy the VOBs over to the same machine later)
2 - Run my script to create the Job Control List for VDubMod
3 - Open VDubMod, load the script, hit start and watch it crank away.
4 - Go to bed. It's going to be awhile. (Or if you have a fancy enough processor do something else while it's processing, like write a blog about it, which is what I'm doing write now. :-) )

Here is the script (lots of programs might complain about you downloading a VBS file, so I've renamed the extension to JRR. Rename it back to VBS after downloading):
createVirtualDubModJobs.jrr

My script is VERY unrefined, as I just created it. I'll probably refine it and upload a better version, but it works. You just need to edit the script and find the variables that set the parent folder for all your VOB files and the destination folder. The script assumes you have one parent folder with one or more subfolders that contain VOB files. Feel free to tweak to your liking.

Yes this will take gobs of hard disk space. Yes you still need to copy all the VOB files from the disks to your computer. Yes you still need to wait for VirtualDobMod to transcode all the VOB (MPEG II) files to DV AVI files.

Can't I just edit the VOB files in Premiere you ask? Yes - sort of. You can get a AVISynth Premiere Plugin, but it's a complicated, laborious process that you can't really script (have to do each VOB one by one). Also, I haven't played with it a lot, but I haven't had much luck getting it to work with Premiere CS3 anyway. If you want to look into it, here's the instructions and all download links for the relevant utilities:
http://www.wrigleyvideo.com/forum/index.php?s=776d0be8c3c99092874bce53a3756694&showtopic=22869

Labels: ,

Wednesday, June 20, 2007

ATI Avivo Video Converter

I originally posted this on a different blog, but thought it was relevant for this blog as well:

This is a great product when it works. The accelerated rendering of AVI to MPEG2 is lightning fast, and is the main reason I purchased this card. HOWEVER, in true ATI fashion, the gui that lets you accomplish this is buggy. Specifically, if I export a movie to AVI from Adobe Premiere Pro and then try to encode it to DVD format (or MPEG2) with the Avivo Video Converter, the application will crash every time you try to move the slider bar to adjust the bitrate. I am putting this in my blog in the hopes that by some miracle someone else will stumble across it who may have found a workaround for this problem. It's driving me crazy. I have this expensive video card virtually sitting idle in my machine because I don't want to encode professional DVD video at a bitrate of 6.0 Mbps - I always use 7.0 Mbps and sometimes 8.0 Mbps. I've been working with ATI on this issue for 6 MONTHS now, and have been throu SIX, count 'em SIX driver revisions. There support is horrific at best to work with - they simply do not listen to what you are telling them. I have submitted trouble tickets, feedback to the catalyst crew, and feature requests. They have all fallen on deaf ears, and their support cannot give me a solution.

Labels: