Skip to main content
Participant
Jan 10, 2025 9:45 PM UTC
Answered

Getting Error: Unknown Error when using exportAsMediaDirect()

I'm trying to execute exportAsMediaDirect() in a simple script and am getting the error "Error: Unknown Error" as a result, no matter which preset I use. If I try to export with the same presets directly in Premiere it works fine, so it doesn't seem to be a problem with the project itself (I even tried using a dummy project with a single video imported from the samples and got the same result).

 

I've tried using the same script found in the PPanel sample here and it also doesn't work. Am I doing something wrong? Running on Windows, Premiere Pro version is 25.1.0.

 

This is the script I've used:

 

    var activeSequence = app.project.activeSequence;

    if (activeSequence) {
        var outputPath = "C:/Users/Fernando/Desktop/dummy-project/Output.mov";
        var presetPath = "C:/Program Files (x86)/Common Files/Adobe/CEP/extensions/PProPanel/payloads/example.epr";
        
        const result = activeSequence.exportAsMediaDirect(outputPath, presetPath, app.encoder.ENCODE_ENTIRE);
        alert(result);
    } else {
        alert("No active sequence found.");
    }

 

bbb_999
bbb_999Correct answer
Community Manager
Jan 10, 2025 10:01 PM UTC

Have you tried with double backslashes, instead of forward slashes, in those paths?

[probably need escape'd spaces in the path(s), as well]



3 replies

Participant
Jan 10, 2025 10:27 PM UTC

That was the issue, thanks!

Translate
bbb_999
Community Manager
bbb_999Community ManagerCorrect answer
Community Manager
Jan 10, 2025 10:01 PM UTC

Have you tried with double backslashes, instead of forward slashes, in those paths?

[probably need escape'd spaces in the path(s), as well]



Translate
Participant
Feb 5, 2025 7:37 AM UTC

I had the same issue I was stuck on it 2 days and just used python but I didn't like the code becasue it was junky so I was sad Until I used double \\ insted of / which fixed everything wow I just feel so dumb 

Translate