4 Replies Latest reply on Oct 1, 2012 12:18 PM by Paul Riggott

    Batchexporting Stills from Video in PS CS6

    Constant Production Level 1

      I'm trying to figure out how to export stills at separate points in a video, exporting 1 still with 15 seconds of space between them throughout the whole video file.

      What I'm trying to do is to export hundreds of images from a movie but with some space between them.

      I tried creating a batch that jumps ahead in the timeline 15 sec, but I cannot figure out how to export a frame at that point and then continue jumping forward 15 sec to do the same again. I want this to automate throughout an entire feature film.

        • 1. Re: Batchexporting Stills from Video in PS CS6
          Mylenium Most Valuable Participant

          I wouldn't bother. Download the After Effects trial (or Premiere pro), read up on time-remapping and renderuing there. You're trying to do a simple thing the hard way by using the wrong tools...

           

          Mylenium

          • 2. Re: Batchexporting Stills from Video in PS CS6
            Constant Production Level 1

            I know After Effects, I work primarily in filmmaking/television, but if you have a solution to how I batch export stills with 15 sec of space between them, then please do explain to me how it's done, because time-remapping in AE doesn't do it alone.

             

            1 still grab with 15 seconds of space between them in the original movie. Batch for the entire movie, or a folder of movies. That is what I need to do.

            • 3. Re: Batchexporting Stills from Video in PS CS6
              Paul Riggott Level 6

              It might be possible to do this with a script, is there anywhere I could get a short clip to do some tests? also what format would you want the frames saving as?

              • 4. Re: Batchexporting Stills from Video in PS CS6
                Paul Riggott Level 6

                I have found a clip and think have got it working. A Film/clip needs to be in Photoshop.

                 

                 

                #target photoshop
                app.bringToFront();
                main();
                function main(){
                if(!documents.length) return;
                var outputFolder = Folder.selectDialog( "Please select output folder");
                if(outputFolder == null ) return;
                var Name = decodeURI(activeDocument.name).replace(/\.[^\.]+$/, '');
                var ref = new ActionReference();
                ref.putEnumerated( charIDToTypeID('Lyr '), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') ); 
                var desc = executeActionGet(ref);
                if(desc.hasKey (stringIDToTypeID('videoLayer'))){
                var desc = executeActionGet(ref).getObjectValue(stringIDToTypeID('videoLayer'));
                var footageInfo = desc.getObjectValue(stringIDToTypeID('footageInfo'));
                var duration = footageInfo.getObjectValue(stringIDToTypeID('duration'));
                var FilmDuration  = duration.getInteger (stringIDToTypeID('numerator')) / duration.getInteger (stringIDToTypeID('denominator'));
                var fRate = footageInfo.getObjectValue(stringIDToTypeID('frameRate'));
                var frameRate  = fRate.getInteger (stringIDToTypeID('numerator')) / fRate.getInteger (stringIDToTypeID('denominator'));
                var Path = footageInfo.getString( stringIDToTypeID('path'));
                var Alpha = footageInfo.getBoolean( stringIDToTypeID('hasAlpha'));
                var Count = parseInt(FilmDuration/15);
                gotoFrame(0,0,frameRate);
                app.refresh();
                var saveFile = File(outputFolder + "/" +Name + "_0.png");
                var Seconds=0;
                SavePNG(saveFile);
                for(z = 0; z<Count;z++){
                Seconds+=15;
                saveFile = File(outputFolder + "/" +  Name + "_" + Seconds + ".png");
                gotoFrame(Seconds,0,frameRate);
                app.refresh();
                SavePNG(saveFile);
                }
                gotoFrame(FilmDuration,0,frameRate);
                app.refresh();
                saveFile = File(outputFolder + "/" + Name + "_" + parseInt(FilmDuration) + ".png");
                SavePNG(saveFile);
                }else{return;}
                };
                function gotoFrame(Seconds,Frame,frameRate) {
                    var desc69 = new ActionDescriptor();
                        var ref33 = new ActionReference();
                        ref33.putProperty( charIDToTypeID('Prpr'), stringIDToTypeID('time') );
                        ref33.putClass( stringIDToTypeID('timeline') );
                    desc69.putReference( charIDToTypeID('null'), ref33 );
                        var desc70 = new ActionDescriptor();
                        desc70.putInteger( stringIDToTypeID('seconds'), Seconds );
                        desc70.putInteger( stringIDToTypeID('frame'),Frame );
                        desc70.putDouble( stringIDToTypeID('frameRate'), frameRate );
                    desc69.putObject( charIDToTypeID('T   '), stringIDToTypeID('timecode'), desc70 );
                    executeAction( charIDToTypeID('setd'), desc69, DialogModes.NO );
                };
                function SavePNG(saveFile){
                    pngSaveOptions = new PNGSaveOptions(); 
                activeDocument.saveAs(saveFile, pngSaveOptions, true, Extension.LOWERCASE); 
                }