Introduction to watch-folders
If you’re processing a larger volume of files through Telestream Cloud one of the first things you will want to do is automating your workflow. The easiest way to do it is using watch-folders.
A watch-folder is a directory that's being regularly monitored by Telestream Cloud for new content. Any file uploaded to this directory will automatically trigger media processing workflow, e.g. start a transcode using Flip service and delivery to output store once finished. You can enable any store to act as watch-folder using web console.
On thing to bear in mind is that specific set of permissions and access policy is required for watch-folder to work properly with Telestream Cloud. This will vary depending on your storage provider. We will describe this in details in dedicated tutorials.
On top of that, you can define Watch Rules which let you define a Factory or Project that will use that watch folder. It will also give you more control over what will be processed, using regular expressions to match specified file types or folders within bucket:
- match only files of certain type to be processed: *.(mxf|mp4) will only transcode files with mp4 or mxf extension that are uploaded to watch folder
- match certain file types in specific folders within the bucket: folder/${dir1}/${dir2}/*.mp4
Avoiding the infinity loop
There might be cases when you want to use the same storage for both, output files and as location for source files.
When doing so it's critical to ensure you create watch-rules that clearly define criteria which files should trigger job submission. Otherwise, when an encoded output is delivered to the same store where source files are located, a new job will be started every time. This can quickly lead to a huge costs, as jobs will be processed in an infinite loop.
You can avoid it, by creating more strict watch-rules using regular expressions, for example:
- matching certain file types (e.g. MOV or MXF) which should start encoding jobs - *.(mov|mxf)
- matching files in specific folders within the bucket - folder/${dir1}/${dir2}/.
Updated over 2 years ago
Guides on setting up watch-folders