Skip to main content
Inspiring
Jan 6, 2025 11:40 PM UTC
Answered

Error export frames from markers in sample project [SDK]

Hi folks

I'm getting an error running exportCurrentFrameAsPNG function in the sample ppro panel.

It's complaining about an illegal parameter type.

I'm also having issues using 

activeSequence.exportFramePNG(time, outputFileName);
It is ignoring a burn-in track I have on v3, and only exporting the video on track v1. Is that expected behaviour? Clicking the export frame button in the UI does export the burnins, which is the metadata effect applied to a video clip.

I'm on mac premiere 2025.
 
Many thanks
Justin Taylor-Hyper Brew
Community Expert
Jan 7, 2025 4:20 PM UTC

I'd check each param to ensure it's not null at that point in time, but my best guess just by looking at it is that you need the .fsName of each of the paths, not the file object. More info in the docs: https://ppro-scripting.docsforadobe.dev/general/encoder.html#encoder-encodesequence

13 replies

Adobe Employee
Jan 9, 2025 7:54 PM UTC

Also, if anyone is still listening; Adobe Premiere Pro scripting is moving from CEP to UXP
See documentation here: https://developer.adobe.com/premiere-pro/uxp/

and samples here: https://github.com/AdobeDocs/uxp-premiere-pro-samples

 

Translate
Inspiring
Jan 13, 2025 6:57 PM UTC

Thanks Dan

I will start reading up on how to port my extensions over to UXP

Translate
Adobe Employee
Jan 7, 2025 6:45 PM UTC

Hi, Imkindofabigdeal,

What are you passing for the parameter, presetPath? All of the other paraemeters appear to be defined

(I keep a file named "test.epr" on my desktop within easy reach, just for such occasions.)

Also, life hack: you could set breakpoints in your code, before calling that function, so you can check which param(s) might be invalid.

I hope this helps,

Dan

 

Also, thanks Kevin and Justin for weighing in, you guys are great.

Translate
Inspiring
Jan 7, 2025 8:30 PM UTC

Hey Dan, 

 

I was initially just trying out the PProPanel and got the error, not sure why presetPath was not populated for me. I have the QE exportFramePNG() working in my own panel, but I wanted to test this non-qe method as a fallback.

Now that I understand what was missing, and that I need an epr file, I should be good to go

Translate
Justin Taylor-Hyper Brew
Community Expert
Community Expert
Jan 7, 2025 4:20 PM UTC

I'd check each param to ensure it's not null at that point in time, but my best guess just by looking at it is that you need the .fsName of each of the paths, not the file object. More info in the docs: https://ppro-scripting.docsforadobe.dev/general/encoder.html#encoder-encodesequence

Translate
Inspiring
Jan 7, 2025 4:52 PM UTC

Hey Justin,

Thanks for the reply. I figured it out with your help, presetPath was undefined, it's a property of the function
exportCurrentFrameAsPNG : function (presetPath)

But in the panel, no preset is passed into it.

 
	exportFramesForMarkers : function () {
		var activeSequence = app.project.activeSequence;
		if (activeSequence) {
			var markers 	= activeSequence.markers;
			var markerCount = markers.numMarkers;
			if (markerCount) {
				var firstMarker = markers.getFirstMarker();
				if (firstMarker){
					var previousMarker;
					activeSequence.setPlayerPosition(firstMarker.start.ticks);
					$._PPP_.exportCurrentFrameAsPNG();
					var currentMarker;
					for (var i = 0; i < markerCount; i++) {
						if (i === 0) {
							currentMarker = markers.getNextMarker(firstMarker);
						} else {
							currentMarker = markers.getNextMarker(previousMarker);
						}
						if (currentMarker) {
							activeSequence.setPlayerPosition(currentMarker.start.ticks);
							previousMarker = currentMarker;
							$._PPP_.exportCurrentFrameAsPNG();
						}
					}
				}
			} else {
				$._PPP_.updateEventPanel("No markers applied to " + activeSequence.name + ".");
			}
		} else {
			$._PPP_.updateEventPanel("No active sequence.");
		}
	},


I exported a png preset from media encoder, hard coded that, and it worked as expected.

Translate
Justin Taylor-Hyper Brew
Community Expert
Community Expert
Jan 7, 2025 5:00 PM UTC

In the sample panel you're testing with it is, it's just in exportCurrentFrameAsPNG() not in exportFramesForMarkers()

 

You need to make an EPR preset file with Media Encoder and ship it with your panel

Translate
Kevin J. Monahan Jr.
Legend
Jan 6, 2025 11:52 PM UTC

Hi @Imkindofabigdeal,

Thanks for the post and welcome to the forum. Perhaps one our Adobe experts like @Justin Taylor-Hyper Brew can assist with this issue. I hope we can help you shortly. Sorry for the hassle.

 

Cheers,
Kevin

 

Translate
Kevin Monahan - Sr. Community and Engagement Strategist – Adobe Pro Video and Audio