Quantcast
Channel: Adobe Community : Popular Discussions - Premiere Pro SDK
Viewing all 53010 articles
Browse latest View live

Writing script to automate lip-syncing in Premiere for animation series

$
0
0

Hello all,

 

I am a veteran PPro/AE user and beginner programmer attempting to write a script to automate the lip-syncing tasks I do within an animation series.

 

Workflow

This project involves video clips that can stretch to 30+ minutes, making placing the required mouth images over each frame of footage a very numbing, tedious process. In short, I'm given a Premiere Project that contains near complete footage, with the only thing missing being the mouths for each character onscreen. We are provided the correct mouth images - in .PNG format - within a separate folder.

 

I then go through and place the correct mouth images over each character in my footage, with the particular image used being dictated by whether the character is speaking. Luckily, I don't need to move the mouths around using any of the Transform properties or keyframe anything...they are already saved with the correct dimensions and placement, so all I'm doing is dragging-and-dropping the correct mouth image over my footage, one frame at a time. However, placing images of one frame length for each and every frame can quickly get tedious when you're working with shots that can be 30+ seconds, in an animation project that runs over 30min.

 

As far as the variety of our mouthsets goes, we use three main images to cover each character speaking. These images are divided as such:

  • Closed Mouth (character isn't speaking) - usually designated as FILENAME-C.PNG
  • Mid Mouth (character's mouth is halfway open) - usually designated as FILENAME-M.PNG
  • Open Mouth (character's mouth is fully open) - usually designated as FILENAME-O.PNG

 

Quick visual example of this:

example mouths v2.png

 

 

Scripting Solution

Now, for the scripting goodness...I'm trying to write a script that would automate this workflow. The idealized, script-assisted workflow would look as such:

1) I set In and Out points on the timeline over the footage I want to automate mouth placement. This keeps it contained to just one shot and one corresponding mouthset, instead of the entire timeline.

2) I launch the UI/panel for my script

3) I drag and drop the three main images I need placed into the panel. The script would ideally know which mouth to use based on the filename (FILENAME-C.PNG to designate a mouth that's closed, FILENAME-M.PNG for a mouth that's midway open, FILENAME-O.PNG for a mouth that's fully open, etc).

4) I hit Run.

5) The script looks through the specific frames I've selected via In and Out points. For each frame where the underlying audio is at a minimum (-260dB to -30dB), it pastes the closed mouth file (FILENAME-C.PNG). For each frame where the audio is between -30dB and -10dB, it pastes the mid mouth file (FILENAME-M.PNG). For each frame where the audio is between -10dB and 0dB, it pastes the fully open mouth file (FILENAME-O.PNG).

 

Now, as far as how to specify this in coding?

I have absolutely no clue. This is where I turn to the community for guidance and suggestions.

 

My understanding of Javascript is pretty minimal but I can crunch through the basic coding and tutorials and learn it quickly (I did some programming in C/C++ many years ago; it wasn't too hard for me to pick up, nor have I had difficulty with HTML or CSS).

 

From my searches, I believe that I would need to build the basic panel in HTML 5 with some buttons that trigger the scripting. Once I have a working panel/UI, I can start to communicate with Premiere using ExtendScript.

 

I've seen examples of this done in After Effects, so I know it can be done (see mamoworld's very impressive Auto Lip-Sync ), but I have no idea how to pull this off inside of Premiere. Most importantly, the part where I tell the program to look at the underlying audio and paste a one-frame image file based on the audio clip's volume is one thing I'm very uncertain about.

 

Any ideas, help, suggestions or advice about what to do?


How to call render when specific event happens?

$
0
0

Hi, All.

I am developing a plugin by Premiere pro and After Effects SDK.

By the way I have a question.

Now render function is called only when parameters are changed or rendering is in process...etc.

..................

Problem:

I added a thread in the plugin and it is running in every 10 seconds.

I want to call render function by emitting certain event in the thread even though rendering is not in process.

Is it possible?

 

Regards,

Anthonie.

Can't getValueAtKey

$
0
0

Thanks for the help in advance.

Here is what I'm running and only getting a Bad Argument error for the getValueAtKey

 

var seq = app.project.activeSequence;
var audioClip = seq.audioTracks[0].clips[0];
var levels = audioClip.components[0].properties[1];
var time = app.project.activeSequence.getPlayerPosition();
var value = levels.getValueAtKey(time);

 

I've tried using the time object on it's own, and also using the .seconds and .ticks.

Using a number also causes the same issue.

Not sure which argument to pass since the guide says:

"Parameters

A Time from which the keyframe value should be retrieved;"

 

Any ideas?

 

Thanks!

 

Henrique

How to run Media Encoder in Silent Mode from Premiere SDK?

$
0
0

Hi,

 

I am using Adobe Media Encoder to export videos programmatically using SDK and every time I use it, it loads a splash screen and then shows a GUI. It then proceeds to do everything I need automatically, but the splash screen and GUI is very distracting and make it possible for user to mess things up. Is there a way to make Media Encoder run silently in the background when using Premier SDK? If not, what other tools available to programmatically export parts of the track?

 

Thanks!

Adjust audio levels of a clip with ExtendScript

$
0
0

Hey folks, I'm just starting out trying to learn some scripting and so I'm not entirely sure what's even possible yet, but one thing I'm trying to figure out is if it's possible to select multiple clips in a bin, then run a script and set all of their audio levels to a pre-defined value. Browsing around, I can't really find any attributes related to this, but like I said, I'm just starting to learn.

 

Thanks! 

ExtendScript & Premiere not working/connecting? properly (NewWorld? - no "main")

$
0
0

Hello! I been having some troubles with this. It seems like it is connected to the premiere but it doesn't show me "main" where it shows "NewWorld" after I updated my Premiere Pro. I have no idea what could be causing this but! None of the commands seems to be working anymore. Could you help me with this?

 

ExtendScript_Toolkit_2018-11-26_06-04-26.jpg


things i've tried so far;

  •      reseting all my preferences (literally deleted my premiere folder in documents folder)
  •      restarting pc & softwares

 

note: im not a programmer or something like that i just make little scripts which saves my time here and there, so sorry if this was caused by something I've done without knowing it.

How to use Exporter Utility Suite and DoMultiPassExportLoop()

$
0
0

Hi,

 

I’m hoping to improve the performance of our Exporter Plugin. Currently sequenceRenderSuite->RenderVideoFrame() is taking about 30ms to render a video frame.

 

In the documentation (page 194 of Premiere_SDK_Guide.pdf) released with the Premiere SDK (https://www.adobe.com/devnet/premiere/sdk/cc.html), it mentions that CS6 exports can use the new push model:

 

Get Video Frames and Audio Samples

 

Starting in CS6, exporters can use the new push model, or the legacy pull model for obtaining

frames. The new push model is supported starting in CS6, and the pull model is still supported.

Developing for Encore and previous versions of Premiere Pro and Media Encoder requires using

the pull model.

 

Push Model

 

Using the push model, the exporter host can simply push frames to a thread-safe exporter-specified

callback. Use DoMultiPassExportLoop in the Exporter Utility Suite to register the callback.

 

Compared with the pull model, this will cut down on the code previously required for render

loop management. It should also yield substantial performance increases for exporters that

haven’t finely tuned their multithreaded rendering.

 

Please can I have some examples of how to implement the push model via DoMultiPassExportLoop() and the Exporter Utility Suite.

 

Many thanks in advance,

 

Andy.

 

Keywords: kPrSDKExporterUtilitySuite, DoMultiPassExportLoop(), ReportIntermediateProgressForRepeatedVideoFrame(), ReportEvent()

where to put premiere script, then where can i find it in premiere UI?

$
0
0

where to put premiere script, then where can i find it in premiere UI?


[Feature Requests] For Inserting/Moving/Removing Clips

$
0
0

Hello,

 

Reading through forum posts I've seen a few times where a moderator has added to feature requests.  I'm not sure if there is an official place to make them, but I'd love to see these features:

 

insertClip() :  add a bool to the existing method which ripple shifts all tracks (I'd also like to add my vote for the ability to insert just the audio or just the video)

removeClip() :  method to remove a clip from a sequence

moveClip() :  method to move a clip already in a sequence to a new start time and/or track number

 

and/or this could be useful:

nestClips() : create a sequence from the selected clips (although if I could delete clips I could just ignore channel mappings with createSubsequence() and then re-import the new Sequence with insertClip(), I think.

 

Also, I'm a few hundred lines of code into scripting a custom panel to use in my day job as a video editor, and I've already made workarounds for the following things that I thought should be pretty simple but couldn't find in the API:

 

projectItem.Bin :  the bin that a project item is in (useful for cloning or importing into the same bin)

project.allItems :  a collection of all project items (or something like project.sequences for bins, files, etc; useful for iterating)

 

If there are any known workarounds for the inserting, moving, or removing clips, I'd love to hear them!  Otherwise I will have to set this script aside for now since I can't get it working with the API as is, though I'll begin working on other scripts for the panel.  Essentially, this script is a version-maker, where an existing sequence is cloned and renamed any number of times (according to check boxes), replacing certain clips each time with clips in the same drive folder (all identified by a standard naming convention).  Unfortunately, certain versions need title and end slates, and the end slates aren't a problem, but trying to add the title slates breaks the edit because it misaligns the target track from all other tracks. 

 

Thanks!

Mask(Path) Pixels using Premiere Pro SDK

$
0
0

Hi, I came into a situation where I need be able to access the frame already with the path of the mask(s) applied into. I've tried many different ways without success. I know that it would be a better approach to develop a AE plugin, but i wanted to know if there is a possible way to achieve this using Premiere Pro's SDK.

 

When I execute the render command once finishing closing a path, Premiere Pro seems to handle the path itself after the render call. I mean I can create a new world filled with white color, during the render call and after the call itself, visually the user would see the just the path filled with white, with the entire frame itself into the background, I'm not and expertise of AE/Pr maybe I'm misunderstanding something, but I wanted to access to the entire frame with the path already filled with white color during the render call.

 

Hope someone can clarify me if I'm doing something wrong or if there is a possible way to access such data in the manner I wanted to.

Finding sequenceID based on projectItem

$
0
0

Hi everyone,

 

I'm trying to write a script that will open the selected Project panel sequence, but I'm having trouble locating the necessary sequence ID to use project.openSequence(sequenceID). I'm using this script from PPP to return the projectItem of the selected object(s):

 

var viewIDs = app.getProjectViewIDs();

var selectedItems = app.getProjectViewSelection(viewIDs[a]);

 

Unfortunately, sequenceID is property of sequence, not projectItem. Is it somehow possible to find the sequence ID using the project item?

 

Thanks!

Export frames or subclip between two markers

$
0
0

Hi!

 

I'm currently developing an extension using extendscript and i want to export frames or subclip between two markers.

I read the premiere scripting guide and didn't found any method that allows me to navigate the frames of a clip.

 

Is there any way that to get the next frame of a marker? Or the clip(s) between two markers?

CSInterface.requestOpenExtension not working in 2019

$
0
0

Hey guys,

Because there isn't anything in the API for guis, I need my script (which is running from a panel) to open another panel. I used CSInterface.requestOpenExtension up until this point, which worked on 2018 and below. This no longer seems to work for 2019. Has this feature been removed?

QE: What is this rabbithole?

$
0
0

Soooo as the title asks: What is QE? There's absolutely no documentation on it, and it appears to house most of the information that we want to access, albeit not reliably.

Most importantly out of anything that I'm looking for - why is there no documentation on not just QE, but the rest of everything within Premiere's capabilities of extendscript?

A single piece of code on Github is not sufficient for a documentation substitute.

 

As far as the seeming instability of QE:

Consider the following code for Premiere Pro CC 2015:

 

app.project.activeSequence.exportAsFinalCutProXML("C:\\Users\\user\\Desktop\\XML_Testing.xml")


app.enableQE()
var mySeq = qe.project.getActiveSequence(0)
var myTrack = mySeq.getVideoTrackAt(0)
var myClip = myTrack.getItemAt(0)
myClip.name

 

If I have a project open in Premiere and execute this using ExtendScript Toolkit, I receive back a myTrack object with a name of 'Wildlife.wmv'.
If I then switch to a new project in Premiere(does not contain 'Wildlife.wmv') and re-execute that same code in ExtendScript Toolkit, the myTrack object stays the same, and I don't receive a new object.

 

This seems hazardous at best.

 

Thank you.

Premiere Pro Programming language

$
0
0

Hello!

 

What is the programming language Adobe used to develop Premiere Pro and where can I find information about how they developed it?


AWS S3: Download media file get corrupted

$
0
0

Hi All,

 

I am trying to download media file (image or video) from AWS S3 using nodejsaws-sdk module. The file is downloaded but I couldn't open as it looks corrupted. Also noted that file size is not same as source file. Refer below code:

 

 

var AWS = require('aws-sdk');

var options = {
accessKeyId: "XXX",
secretAccessKey: "XXX"
};
var s3 = new AWS.S3(options);

var bucketName = 'test-bucket';
var keyName = 'test.jpg';
var params = {Bucket: bucketName, Key: keyName};

var fsModule = "fs";
var fs = require(fsModule);

// This requires when running this code in panel
AWS.util.stream = require('stream');

var writeStream = fs.createWriteStream('D:/test.jpg');
var readStream = s3.getObject(params).createReadStream();

readStream.pipe(writeStream);

 

I have added aws-sdk node module in my extension folder.

 

Note:
(1) I can download and open txt file without any issue
(2) If I run this code outside panel context (run in local nodejs server) it works for all type of files including text and media!!

 

 


Premiere Pro version: 9.0.0
Extension Type: Panel

 


Thanks & Regards,
Meet Tank

Passing information from jsx to js.

$
0
0

Hello Community,

I have a problem with passing information from jsx to js file.

 

my jsx file:

$.extendScript = {  test : function() {    return "string";  },
}

 

my js file.

(function () {    var cs = new CSInterface();    var variable = "";    cs.evalScript('$.extendScript.test()', function(result) {       variable = result;       alert("variable in evalScript =" + variable);     });    alert("variable in outside = " + variable);    
}());

 

In evalScript function the variable get's the string from jsx function but when I want to use it outside I get empty string again.

Also I get the alert outside evalScript first in order. Why this happens?

 

 

Does anyone know why this happens and how to fix this?

Best Regards

Can't access sequence tracks or markers through ExtendScript

$
0
0

I'm using the following code in the ExtendScript Toolkit:

 

var seq = app.project.activeSequence;

alert(seq.name); // This returns the correct sequence name, so seq is not null

var tracks = seq.videoTracks;

alert(tracks.length); // This returns 'undefined' and is the start of my headaches

 

To confirm there are definitely video tracks on my sequence. I've tried this with new projects, new sequences, adding and deleting video tracks, locking and unlocking them but nothing seems to work. Have I missed something obvious?

 

Also, on a slightly related note, I am having problems accessing the markers on the sequence. The following seems bizarre:

 

var seq = app.project.activeSequence;

var markers = seq.markers;

alert(markers.length); // Returns 'undefined'

var newMarker = markers.createMarker(1); // Successfully adds a marker at one second.

alert(markers.length); // Returns 'undefined'

 

Thanks,

Pete

How can I open a local folder view by clicking on a link

$
0
0

Hello All,

 

Is there any way to open a local folder (file explorer not a file chooser) from a link in a premiere pro panel? Is this possible using cep API?

 

Premiere Pro version: 11.1.0

Extension Type: Panel

 


Thanks & Regards,
Meet Tank

Adding fonts to Premier from a Panel?

$
0
0

Can you import a font into Premier from code in a Panel?

I know the function app.project.importFiles exists, but I have tried using that without success. The project I open still complain about not having the font. Ideally I'd like to first check if Premier has the font, then if not load it so it becomes available when opening the project from the Panel.

Viewing all 53010 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>