Copy link to clipboard
Copied
Hi
I am trying to build a plugin which can use a custom codec to export an imported video to h264 format.
The codec which i have to use converts a YUV420 raw video to h264 format. As given in the Premiere SDK Guide
the SDK Exporter supports uncompressed 8-bit RGB with or without alpha, and packed
10-bit YUV (v410). The initial rendering is performed by the RenderVideoFrame() function call which is called in RenderAndWriteVideoFrame().
This is then converted using various calls like ConvertFrom8uTo32f(), ConvertFromBGRA32fToVUYA32f(), and ConvertFrom32fToV410().
The problem i m facing is that i m not able to verify if the RenderVideoFrame() is working correctly and the format in which it writes.
Is there any way to check using any media player that can play the exported video. Unless i know the exact(correct) exported format
i wont be able to convert it to the required YUV420 format that i need.
Also if i dont use the ConvertFrom functions and use only the video stream written by RenderVideoFrame, can u specify clearly the format
and any media player which can play it, so as to check the working.
Thanks
Agam
Hi Agam,
The exporter is what writes the actual file, so technically you can create it wherever you wish. The exporter gets exDoExportRec.fileObject during the exSelExport selector. You can use the Export File Suite to get the file path provided by the host (Premiere Pro), and instead write the media to a different file path using your own filesystem calls.
However, writing to a different location can have undesirable side effects, since the host will not know if you have changed the file destin
...Copy link to clipboard
Copied
YUV420 is planar not packed btw. ie HxW Y then H/2 x W/2 U then repeat.
V410 is packed 10bit YUV 4:4:4.
You are better off dumping the convert functions and making your own
(or leverage open source if lgpl is ok) 10 bit (integer) BGRA 4:4:4:0
to YUV 4:2:0 planar. Then hand off to your h264 encoder.
As for a player that can play v410 - mplayer might do it. I assume
there is a command lune to tell it that the file is v410
Note: if youre using x264 as your codec (yuv420 to h264 suggests that)
it is GPL licensed so you're limited by that license. If you ship (eg
sell) it you have to ship your source code to your prm too. Also much
of the mpeg4 standard is patent protected (world wide) and agreesively
protected with firrce lawyers so you need a stack of different patent
licenses if you are using for commercial use.
Copy link to clipboard
Copied
Thanks for ur reply. I was able to do the conversion.
I have one more doubt though. As written in the SDK guide ,
the host i.e. Premiere Pro names the files being exported itself.
I wanted to know if it is possible to obtain the names of the imported/exported
file or set the name of the exported file within the exporter while exporting.
Thanks
Agam
Copy link to clipboard
Copied
Hi Agam,
The exporter is what writes the actual file, so technically you can create it wherever you wish. The exporter gets exDoExportRec.fileObject during the exSelExport selector. You can use the Export File Suite to get the file path provided by the host (Premiere Pro), and instead write the media to a different file path using your own filesystem calls.
However, writing to a different location can have undesirable side effects, since the host will not know if you have changed the file destination. This could cause a few things to not work, including:
* Auto-import after doing a direct export (not using the AME render queue)
* XMP embedding (for metadata)
* FTP post encode process (which can be specified by the user in the FTP tab of the Export Settings)
Zac
Copy link to clipboard
Copied
Hi Zac
Thanks a lot.
Problem solved.
Copy link to clipboard
Copied
Hi Zac
I need ur help again. I m trying to export audio in the exporter.
The function GetAudio() of PrSDKSequenceAudioSuite fills the buffer with uninterleaved 32 bit float.
I want to convert it to interleaved 8 bit integer format using the function
ConvertAndInterleaveTo8BitInteger()
The problem i m facing is that in the ExportSettings struct defined as
typedef struct ExportSettings
{
SDK_File SDKFileRec; // The struct of the file header
VideoSequenceParser *videoSequenceParser;
SPBasicSuite *spBasic;
PrSDKExportParamSuite *exportParamSuite;
PrSDKExportProgressSuite *exportProgressSuite;
PrSDKExportInfoSuite *exportInfoSuite;
PrSDKExportFileSuite *exportFileSuite;
PrSDKClipRenderSuite *clipRenderSuite;
PrSDKMarkerSuite *markerSuite;
PrSDKPPixSuite *ppixSuite;
PrSDKTimeSuite *timeSuite;
PrSDKMemoryManagerSuite *memorySuite;
PrSDKSequenceAudioSuite *sequenceAudioSuite;
PrSDKSequenceRenderSuite *sequenceRenderSuite;
PrSDKWindowSuite *windowSuite;
long videoRenderID;
} ExportSettings;
there is no pointer defined of the struct type PrSDKAudioSuite.
So, i m not able to use its member function to convert the audio format.
Can u suggest anything in this matter.
Thanks
Agam
Copy link to clipboard
Copied
Hi Agam,
If you have any other questions, let's start a different thread to keep the issues separate and easy to digest for any others who may come to the forum with the same question.
This particular ExportSettings struct is defined by the exporter plug-in, and you can modify it to add any members you wish. So you can just add a pointer to the PrSDKSequenceAudioSuite, and make sure to acquire and release it along with the other suites.
Hope this helps,
Zac
Copy link to clipboard
Copied
Hi Zac,
Thanks for ur quick reply.
I did add PrSDKAudioSuite
but forgot (how can i ? ) the acquiring and releasing part.
And any future queries i will surely post on a new thread.
Thanks Again.
Agam
Copy link to clipboard
Copied
Hi Agam,
In the SDK Exporter code, you can see in the exSelBeginInstance selector handler, it calls spBasic->AcquireSuite() on every suite needed. Then in the exSelEndInstance handler, it calls spBasic->ReleaseSuite(). Just add any new suites following the pattern of the existing suites, and you should be all set!
Zac
Copy link to clipboard
Copied
Hi Agam,
RenderVideoFrame() may return various pixel formats, depending on what's requested, and how the video segment is composed. You can provide your own list of requested pixel formats for RenderVideoFrame(). After calling RenderVideoFrame(), the SDK Exporter calls GetPixelFormat() on the returned frame, to check the pixel format of the returned frame, whether it's BGRA_4444_8u or VUYA_4444_32f.
In CS5, the Image Processing Suite exposes the conversion functions built-in to Premiere Pro, but in CS4 that suite is not available, which is what the ConvertFrom...() functions are for in the sample. This allows the exporter to request several different pixel formats, and gracefully handle any format that is returned.
To view the resultant video frames in a video player, you'd need to write these frames to a file and generate a proper file header, so that the video player will know how to parse it and interpret the video data.
Regards,
Zac
Copy link to clipboard
Copied
Zac do you have any charts on what the pixel formats each filter supports?
If you use quirky filters (Adobe or 3rd party) you know they implemented with the mandated pixel format (BGRA_4444_8u) but probably no others. The result is that no matter what the importer/workflow/compiler combo you think you're working in you are forced to use BGRA_4444_8u from that point on in the workflow. - so much for "native" DV, HDV, MPEG2, MPEG4, CineForm, RED, etc etc etc.
Can you provide a list of what PixelFormats the Adobe filters support?
It would great to see it for CS5|4|3 & Prem Pro 2.0*
Eg: FILTER PIXELFORMATS
MOTION BGRA_4444_8u YUVA_4444_8u V410 DV etc etc
BLUR BGRA_4444_8u YUVA_4444_8u V410 DV etc etc
XXXXXX BGRA_4444_8u YUVA_4444_8u V410 DV etc etc
YYYYYY BGRA_4444_8u YUVA_4444_8u V410 DV etc etc
That would be a fantastic table for the user to have. That way you know when you're forcing the workflow from the native import pixelformat type (and colorspace for that matter) back to 8bit RGBA. (and potentially loosing 10bit quality and screwing up the colorspace of rec601 and rec709).
I mention Premiere Pro 2.0 because it was the last version that processed the Timeline single threaded and thus the last version that single-threaded filters can be used on. 'fortunately plugins intended for later versions of Premiere will work with it because Prem Pro 2.0 understands the version 8 API of CS3 and CS4.
For this reason (legacy plugins) I'm in the process of pulling some plugins from CS3 into the Prem Pro directory to see it they work. I'm willing to do that even though the filter I want to use is BGRA_4444_8u only. - the filter is THAT important to me.
Sidenote: this is why I'm SO disappointed with CS5. Forcing plugins to be 64bit has killed the use of hundreds of 3rd party plug-ins created over the last 20 years - many of which are End Of Life and thus will only ever be 32bit. I would have been a lot happier to have CS5 implement proxy editing (ie OffLine editing) and then on Export click a button to use the Online (ie full res) material instead. That feature would have allowed v fast timeline rendering (with or without CUDA) and much lower requirements on cpu/gpu and storage. In the few instances that you need to edit in native 2k or 4k etc then sure do it but I bet 90% of the time you can work in 1080p or lower to get your movie produced.
Copy link to clipboard
Copied
Hey Rallymax,
CS5 provides icons in the Effects panel that let you filter the effects to see which ones support YUV, or 32-bit, or both. For earlier versions, I don't have a comprehensive list, but here’s a list of the built-in effects (not including transitions) that I’m aware of, and there may be more:
ColorFast
ColorRGBCorrector
ColorThreeWay
Crop
GarbageMatte4/8/16
GaussianBlur
LumaCorrector
LumaCurve
LumaKey
ProcAmp
RGBCurves
Timecode
TrackMatte
VideoLimiter
AlphaAdjust
AntiAlias
BlackAndWhite
HorizontalFlip
BGRA_8u is no longer a required pixel format starting in CS4 and later. If a quirky filter only supports 8-bit, then there's really not much we can do to preserve the full range of 10-bit data. After all, the user has decided to use the 8-bit filter. But yes, it's important for the user to make an educated decision, and the new effects badging was implemented with that in mind.
If there are any effects or other plug-ins that are end-of-life but still sorely needed, that would be a great thread for this forum. The active developer community would be really interested to hear if there's a development opportunity.
Cheers,
Zac
Copy link to clipboard
Copied
Hi Zac,
Thanks for the list. It's great to know that CS5 provides icons that can be masked to YUV, etc etc!
The filter that is sorely missing is 3d motion stabilization. I have hours of amazing B roll that was handheld and needs to be stabilized to be watchable in HD. - the shake makes it unusable.
An excellent example done at an academic level is here (by Adobe Labs!):-
http://www.youtube.com/watch?v=3TlCGh5Pc90
I talked to the authors a few years ago about it but it went nowhere. One of the problems is that it uses the Voodoo motion suite and is limited by copyright/patent. These issues would have to be addressed to commercialize it.
I was REALLY hoping it made it into CS5 but alas. If it had I would upgrade from CS3 and upgrade my PC to 64bit - it's that important to me.
Rallymax.
Copy link to clipboard
Copied
Thanks for ur reply. I was able to do the conversion.
I have one more doubt though. As written in the SDK guide ,
the host i.e. Premiere Pro names the files being exported itself.
I wanted to know if it is possible to obtain the names of the imported/exported
file or set the name of the exported file within the exporter while exporting.
Thanks
Agam