Skip to main content
Participant
January 10, 2025
Answered

Getting Error: Unknown Error when using exportAsMediaDirect()

  • January 10, 2025
  • 2 replies
  • 404 views

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.");
    }

 

Correct answer bbb_999

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

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



2 replies

Participant
January 10, 2025

That was the issue, thanks!

bbb_999
Community Manager
bbb_999Community ManagerCorrect answer
Community Manager
January 10, 2025

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

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



Participant
February 5, 2025

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