Highlighted

Video Action Script

Community Beginner ,
May 03, 2019

Copy link to clipboard

Copied

Hi All,

I am looking for advice on how to accomplish an action or maybe I need to create a script.

Summary :

I would like to bring a video into photoshop and export it as a series of 1 second gifs to a folder.

A little more detail:

With the video, I would like to use a photoshop action or script to cut the video into a series of 1 second gifs.

Id like to  be able to import a video into photoshop, run an action and have it export the video as a bunch of 1 second gif for the entire length of the video.

For instance a 60 second video would be cut into 60 separate - 1 second gifs.

Any advice? Can I tell the action to move the play head forward one second and repeat until end of video? I may be looking to hire someone to do this for me if I can't figure it out. Any advice on where I could find someone with this knowledge for hire?

I appreciate your help.

Jesse

TOPICS
Actions and scripting

Views

166

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Video Action Script

Community Beginner ,
May 03, 2019

Copy link to clipboard

Copied

Hi All,

I am looking for advice on how to accomplish an action or maybe I need to create a script.

Summary :

I would like to bring a video into photoshop and export it as a series of 1 second gifs to a folder.

A little more detail:

With the video, I would like to use a photoshop action or script to cut the video into a series of 1 second gifs.

Id like to  be able to import a video into photoshop, run an action and have it export the video as a bunch of 1 second gif for the entire length of the video.

For instance a 60 second video would be cut into 60 separate - 1 second gifs.

Any advice? Can I tell the action to move the play head forward one second and repeat until end of video? I may be looking to hire someone to do this for me if I can't figure it out. Any advice on where I could find someone with this knowledge for hire?

I appreciate your help.

Jesse

TOPICS
Actions and scripting

Views

167

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
May 03, 2019 0
Most Valuable Participant ,
May 05, 2019

Copy link to clipboard

Copied

As I wrote in your thread in the Photoshop forum I do not believe an Action can be recorded or edited to do what you want to do.  A Photoshop Script would be able to do what you want to do.  However, It would not be fast or elegant with my knowledge of Photoshop and  my script hacking abilities.  The ironic part is I would need to use Action Manager code to accomplish the your  process.  Script can use logic to segment thing and create script functions  from action manager code the have variable passed to them.  I opened a video I created in Photoshop. An MP4 that is 4 second. I created 4,  1 second mp4  from that video.  I was also able to Open the 1 second mp4 and use save for web to save and animated gif for each one.  Looking at what the scriptlisener recorded for the export steps like export a 30 frame mp4 ie 1sec.  One could easily create functions that perform the required steps. Pass the function the output file to create and which frames to output like frame 1 to 30, then from 31 to 60 etc.. Here is what I saw recorded.

// =======================================================

var idExpr = charIDToTypeID( "Expr" );

    var desc63 = new ActionDescriptor();

    var idUsng = charIDToTypeID( "Usng" );

        var desc64 = new ActionDescriptor();

        var iddirectory = stringIDToTypeID( "directory" );

        desc64.putPath( iddirectory, new File( "E:\\My Files\\Pictures\\3D\\Earth 1" ) );

        var idNm = charIDToTypeID( "Nm  " );

        desc64.putString( idNm, """Earth31.mp4""" );

        var idameFormatName = stringIDToTypeID( "ameFormatName" );

        desc64.putString( idameFormatName, """H.264""" );

        var idamePresetName = stringIDToTypeID( "amePresetName" );

        desc64.putString( idamePresetName, """1_High Quality.epr""" );

        var iduseDocumentSize = stringIDToTypeID( "useDocumentSize" );

        desc64.putBoolean( iduseDocumentSize, true );

        var iduseDocumentFrameRate = stringIDToTypeID( "useDocumentFrameRate" );

        desc64.putBoolean( iduseDocumentFrameRate, true );

        var idpixelAspectRatio = stringIDToTypeID( "pixelAspectRatio" );

        var idpixelAspectRatio = stringIDToTypeID( "pixelAspectRatio" );

        var idDcmn = charIDToTypeID( "Dcmn" );

        desc64.putEnumerated( idpixelAspectRatio, idpixelAspectRatio, idDcmn );

        var idfieldOrder = stringIDToTypeID( "fieldOrder" );

        var idvideoField = stringIDToTypeID( "videoField" );

        var idpreset = stringIDToTypeID( "preset" );

        desc64.putEnumerated( idfieldOrder, idvideoField, idpreset );

        var idmanage = stringIDToTypeID( "manage" );

        desc64.putBoolean( idmanage, true );

        var idinFrame = stringIDToTypeID( "inFrame" );

        desc64.putInteger( idinFrame, 31 );

        var idoutFrame = stringIDToTypeID( "outFrame" );

        desc64.putInteger( idoutFrame, 60 );

        var idrenderAlpha = stringIDToTypeID( "renderAlpha" );

        var idalphaRendering = stringIDToTypeID( "alphaRendering" );

        var idNone = charIDToTypeID( "None" );

        desc64.putEnumerated( idrenderAlpha, idalphaRendering, idNone );

        var idQlty = charIDToTypeID( "Qlty" );

        desc64.putInteger( idQlty, 3 );

        var idZthreeDPrefHighQualityErrorThreshold = stringIDToTypeID( "Z3DPrefHighQualityErrorThreshold" );

        desc64.putInteger( idZthreeDPrefHighQualityErrorThreshold, 5 );

    var idvideoExport = stringIDToTypeID( "videoExport" );

    desc63.putObject( idUsng, idvideoExport, desc64 );

executeAction( idExpr, desc63, DialogModes.NO );

The Clean SC script made that code easier to read and into a function export2.

export2(new File( "E:\\My Files\\Pictures\\3D\\Earth 1" ), "Earth31.mp4", "H.264", "1_High Quality.epr", true, true, true, 31, 60, 3, 5);

The Paths woul be set and constant the mp4 names will chanede with each use as will the start and end frames numbers

Yoy shold check out Clean SL

// =======================================================

export2(new File( "E:\\My Files\\Pictures\\3D\\Earth 1" ), "Earth31.mp4", "H.264", "1_High Quality.epr", true, true, true, 31, 60, 3, 5);

function export2(directory, name2, ameFormatName, amePresetName, useDocumentSize, useDocumentFrameRate, manage, inFrame, outFrame, quality, Z3DPrefHighQualityErrorThreshold) {

var descriptor = new ActionDescriptor();

var descriptor2 = new ActionDescriptor();

descriptor2.putPath( stringIDToTypeID( "directory" ), directory );

descriptor2.putString( stringIDToTypeID( "name" ), name2 );

descriptor2.putString( stringIDToTypeID( "ameFormatName" ), ameFormatName );

descriptor2.putString( stringIDToTypeID( "amePresetName" ), amePresetName );

descriptor2.putBoolean( stringIDToTypeID( "useDocumentSize" ), useDocumentSize );

descriptor2.putBoolean( stringIDToTypeID( "useDocumentFrameRate" ), useDocumentFrameRate );

descriptor2.putEnumerated( stringIDToTypeID( "pixelAspectRatio" ), stringIDToTypeID( "pixelAspectRatio" ), stringIDToTypeID( "document" ));

descriptor2.putEnumerated( stringIDToTypeID( "fieldOrder" ), stringIDToTypeID( "videoField" ), stringIDToTypeID( "preset" ));

descriptor2.putBoolean( stringIDToTypeID( "manage" ), manage );

descriptor2.putInteger( stringIDToTypeID( "inFrame" ), inFrame );

descriptor2.putInteger( stringIDToTypeID( "outFrame" ), outFrame );

descriptor2.putEnumerated( stringIDToTypeID( "renderAlpha" ), stringIDToTypeID( "alphaRendering" ), stringIDToTypeID( "none" ));

descriptor2.putInteger( stringIDToTypeID( "quality" ), quality );

descriptor2.putInteger( stringIDToTypeID( "Z3DPrefHighQualityErrorThreshold" ), Z3DPrefHighQualityErrorThreshold );

descriptor.putObject( stringIDToTypeID( "using" ), stringIDToTypeID( "videoExport" ), descriptor2 );

executeAction( stringIDToTypeID( "export" ), descriptor, DialogModes.NO );

}

JJMack

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 05, 2019 1
Community Beginner ,
May 06, 2019

Copy link to clipboard

Copied

Thank you JJMack,

This is going to be difficult for me to understand and process - but I appreciate your response and will study your post. Thank you for that

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 06, 2019 0
Most Valuable Participant ,
May 06, 2019

Copy link to clipboard

Copied

If you do not have any programming skill you will not be able to program a Photoshop script. Adobe's Plug-in Scriptlisener records Photoshop Steps like the Action recorder in script code. However, the Code is just like action steps every setting is hard coded. You need to be a programmer to change the hard coded setting into variables and add logic to  perform the processing you want to do. Using the variable you added.

JJMack

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 06, 2019 0
New Here ,
Oct 26, 2020

Copy link to clipboard

Copied

JJMack thanks a lot for this function, it save my day!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 26, 2020 0