Skip to main content
Skip table of contents

IFileSupervisor [VF AgSDK]

If you want to create a media asset file that shall be accessible by other VidiFlow tasks in a workflow you must use an instance of this interface (created using the IFileSupervisorFactory interface). A typical use case for this would be a transcoding task that creates a new file for an existing VidiFlow media item. The interface provides five methods to indicate different states of the file processing and a property to receive the VidiFlow identifier for the newly created file.
TargetFileReference
The property returns a value of type FileReference that identifies a file in VidiFlow. The existence of this file reference does not indicate that the file physically exists in a file system. It is just a VidiFlow representative of a file that might exist in the specified file system location.
FileCreated
This method must be called if you want to indicate that the physical file is created on a file system, i.e. actual bytes are written into the file. If you cannot 100% ensure that actual bytes are written, do not call this method.
Note that it is sufficient that some bytes are written but not the complete file (growing file support).

Note

Also use this method if the file cannot be processed while growing like an mp4 file.

This method will use a non-blocking background thread to execute. Therefore, errors occurring in this thread will be indicated by calling the callback method specified when calling the factory.
FileCreatedWithEvent
This method must be called if you want to indicate that the physical file is created on a file system, i.e. actual bytes are written into the file and the workflow shall be informed about this to allow processing on the growing file. Conditions for calling this method are:

  • Some bytes are written into the file.

  • The file can be processed while growing.


Note

If you cannot 100% ensure that both conditions are fulfilled, do not call this method.


This method will use a non-blocking background thread to execute. Therefore, errors occurring in this thread will be indicated by calling the callback method specified when calling the factory.
FileClosed
You must call this method if the file that you created has been completely written.

Note

If you do not call this method, the file will be automatically closed (unless you have called the ProcessingFailed() method or the FileSupervisor itself ran into an internal error before) when the FileSupervisor instance is disposed, even if the file might be still growing!


This method will wait for the non-blocking background thread created in the previously mentioned FileCreated… methods (if they have been called). It will re-throw all exceptions thrown in the background thread. The callback method will not be executed in this case.
ProcessingFailed
If you encounter an error in the task processor that should prevent the FileSupervisor from continue working, you must call this method.
Upon invocation of this method the FileSupervisor will revert all his work done so far, and the previously created target file reference will be invalid.

Note

Calling any of the File…() methods later on will throw an InvalidOperationException.
Calling the TargetFileReference property later will return a null value.


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.