Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


After Effects/Premiere Plugin Renders Black in Media Encoder

Contributor ,
Aug 14, 2021 Aug 14, 2021

Copy link to clipboard

Copied

I have a custom LUT plugin that uses Smart FX to render in AE, and normal Render() in PR. When rendering directly out of AE and PR, it works great! But as soon as I send it to Media Encoder, it only renders out black, with the audio. Any ideas of why this might be happening? 

 

Here are my Global Out Flags:

out_data->out_flags =  PF_OutFlag_DEEP_COLOR_AWARE |
		PF_OutFlag_WIDE_TIME_INPUT;

out_data->out_flags2 = PF_OutFlag2_FLOAT_COLOR_AWARE |
		PF_OutFlag2_SUPPORTS_SMART_RENDER;

 

Any other information, I'm happy to provide!

TOPICS
Dynamic link, Error or problem, SDK

Views

101

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
community guidelines

correct answers 1 Correct answer

Contributor , Aug 19, 2021 Aug 19, 2021
Caching would be storing the resources in sequence or global data once (or as few times as needed) and then accessing them from there.  I imagine AE's utility->Apply Color Lut plugin would read the lut from disk once when the user first applies the plugin, and would then cache it inside sequence data so it does not need to be read from disk each time. Sequence data is saved inside the ae project so it doesn't matter if the composition is loaded on another machine. That's just my speculation.

Likes

Translate

Translate
Contributor ,
Aug 17, 2021 Aug 17, 2021

Copy link to clipboard

Copied

I haven't encountered this specific issue before so I'm just thinking of any/all possible causes. Do you have any external file dependencies such as the lut itself? 

 

A way to debug further could be as soon as you enter the render function, copy the input to the output buffer and return. If that is still black, then you've narrowed down where the problem occurs. 

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
community guidelines
Contributor ,
Aug 18, 2021 Aug 18, 2021

Copy link to clipboard

Copied

@James Whiffin I'm fairly certain it has to do with the LUT process! And yes, actually I do use some additional files as part of the lut file reading and math process! Specifically: 

#include <iostream>
#include <fstream>
#include <string>
#include <iomanip>
#include <sstream>
using namespace std;

Additionally, in my Visual Studio setup, I changed Configuration Properties -> C/C++ -> Code Generation -> Runtime Library. It was set at "Multi-threaded DLL (/MD)", and I changed it "Multi-threaded (/MT)", which resolved other issues these dependencies were causing.

 

Perhaps there's another setting in the build settings that can help with this?

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
community guidelines
Contributor ,
Aug 18, 2021 Aug 18, 2021

Copy link to clipboard

Copied

Do you cache the resources? If so I would try loading them per render request, just to see if the caching is the cause. I'm not too cluey on whether or not those render settings could cause the issue, hopefully someone more knowledgeable can give you an answer. 

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
community guidelines
Contributor ,
Aug 19, 2021 Aug 19, 2021

Copy link to clipboard

Copied

That actually might be on the right path! I have noticed if the plugin caches some frames from me scrubbing through the time, those get rendered ok, the rest are black. 

 

I'm not sure if I am caching the resources. How can I do that? Additionally, is caching the frames myself possible to solve this issue?

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
community guidelines
Contributor ,
Aug 19, 2021 Aug 19, 2021

Copy link to clipboard

Copied

Caching would be storing the resources in sequence or global data once (or as few times as needed) and then accessing them from there. 

 

I imagine AE's utility->Apply Color Lut plugin would read the lut from disk once when the user first applies the plugin, and would then cache it inside sequence data so it does not need to be read from disk each time. Sequence data is saved inside the ae project so it doesn't matter if the composition is loaded on another machine. That's just my speculation.

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
community guidelines
Contributor ,
Aug 29, 2021 Aug 29, 2021

Copy link to clipboard

Copied

Ok sequence_data is definitely the way to go! Upon SequenceSetup(), I stored a single lut file in my sequence data, and it applies and renders through AME perfectly! However, no matter where I try to change the sequence_data later, it retains the original values.

 

So my issue now is that I cannot change the sequence_data, is this possible to do? I made this changed param setup which updates a global variable keeping track of the dropdown selection, and then run SequenceSetup() again to try to update the sequence_data LUT property using the new dropdown selection. But no matter what the sequence_data stays the same values as it initally receives.

NathanLovell_52_0-1630271054221.png

 

case PF_Cmd_USER_CHANGED_PARAM:
err = randomSeedChange(in_data, out_data, (PF_SmartRenderExtra*)extra, params); // update global variable for which dropdown item is selected
err = SequenceSetdown(in_data, out_data, params, output); // clean sequence_data
err = SequenceSetup(in_data, out_data, params, output);
break; // store lut into sequence_data

 

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
community guidelines
Contributor ,
Aug 29, 2021 Aug 29, 2021

Copy link to clipboard

Copied

Sequence data can be changed but there are some considerations such as there are two copies (one on the UI thread, one on the render thread) and they are only synchronised at certain points and there are certain things you can do to force this synchronisation to occur. I found this very confusing, and so did a lot of others so thankfully there are a lot of threads on this specific issue.

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
community guidelines
Contributor ,
Aug 30, 2021 Aug 30, 2021

Copy link to clipboard

Copied

LATEST

Appreciate it! Will do more research here on sequence_data!

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
community guidelines