Kaltura Dropfolder upload not working correctly

Hi All,

We have a dropfolder set up for one of our Faculty on one of our on-prem servers. We use API calls to pull the videos in the dropfolder to upload them to Kaltura, and these calls are done through PHP scripts.
The script functions correctly when manually navigating to the page destination, but we have an issue with the script when we introduce a scheduled task that runs on the server, running the script at a certain time each day.
I looked into the script and searched line by line where breakpoints would come up successful, instead of the error we were getting initially, (0xffff). I found that one line was causing the issue (with a little bit of context):

$url=“http:/{ServerHostName}/KalturaDropFolder/Processed_videos/{FileName}”;
$entry=new KalturaMediaEntry();
$result = $kclient->media->addFromUrl($entry, $url); //This is the line causing the issue.
return $result;

Now I understand that this call has since been deprecated. I have tried to implement the updated version (media->addContent($entryId, $resource)) but cannot seem to get it to work correctly with the script when I try these lines of code:

$entry=new KalturaMediaEntry();
$entryId = $entry->Id; //Have tried referenceId as well as entryId as well
$resource = new KalturaUrlResource();
$resource->url = “http:/{ServerHostName}/KalturaDropFolder/Processed_videos/{FileName}”;
$result = $kclient->media->addContent($entryId, $resource);
return $result;

According to the documentation, this should work, but It doesn’t seem to whenever I run it. Beyond that, I don’t see how this might solve the initial issue with the scheduled task. Where do I go from here? Have you seen anything similar to this? Any information helps.

Thank you!

Hi @czehner1,

Firstly, I must confess that I’m unsure as to why you need a custom script for this? Kaltura supports setting up drop folder profiles and then fetching the files placed in said dropfolders via the batch mechanism. You can create/edit these profiles via Admin Console->Publishers->Your partner->Actions->Drop Folders. In order to use this mechanism, one must first enable Content Ingestion - Drop Folder/s via Admin Console->Publishers->Your partner->Actions->Configure

When using Kaltura in SaaS mode [www.kaltura.com, as opposed to a self hosted ENV], this needs to be set up for you. If that’s your case, please contact your account manager.

Regardless, as per your question, actions marked as deprecated will still continue to work. We mark actions as such to denote that their use is discouraged but we do not disable them.

In any event and while it’s unlikely to be the reason for your failure, it is indeed recommended that you use media->addContent() instead. Please refer to this step by step howto for ingesting media:
https://developer.kaltura.com/workflows/Ingest_and_Upload_Media

Thanks,

Thank you Jess for your quick reply. We will bring up to the faculty this first option you provided. I think we will have to go through with this as I wasn’t entirely sure the updated API would make a difference either.

Cheers!

  • Cody

Hi again @jess ,

Thank you for the suggestions, but the dropfolder provided by Kaltura do not meet the needs of this particular end user, plus do not have the functions you suggested within the admin console.

The reason we need a custom script, is due to the end user uploading many videos per day. When first developed our process worked as follows: Videos are recorded in the Schools of Journalism’s “TV station” The end user has all the metadata in the name of the file(.mp4), which aredelimited by semicolons, (e.g. videoTitle;User;Category;etc.mp4) They upload these video files to a shared network drive, then an automated task runs at 2am daily.

Thanks,
Cody

Hi @czehner1,

As mentioned previously, when using Kaltura in SaaS mode, you need to contact your account manager in order to provision a dropfolder. As for your requirements, these can easily be addressed by configuring an “XML” dropfolder. In that mode, you upload an bulk upload XML file onto the dropfolder which contains all the metadata relevant to the entry, as well as a URL pointing to the media source. Please see:
https://knowledge.kaltura.com/kaltura-drop-folders-service-content-ingestion-0

We need a solution that is a bit more automated, unfortunately, as our faculty are uploading many videos at a time through this shared drive and we can’t ask them to go through the trouble of writing up an XML file for every video. Is there any alternative or more convenient solution for this?

If you only need the entry name, reference ID and category association, that is supported with a “simple” drop folder to which you can upload media files [without the use of XML]. The entry name will be deduced from the filename [minus the extension] and category mapping is done by means of a custom metadata schema. Reference ID can also be discerned from the entry name. If you require additional metadata fields then you’ll either have to go with the XML method I proposed before or debug your custom script.

Hello,

We implemented a "Mezzanine server " as I guess is what you need and I’l give you a short description.

We configured a linux server with a Samba share and some folders. When a user copies a file into one of these folders, an inotify script performs a first ffmpeg transcoding (from MXF into mp4), creates a valid Kaltura XML file and puts them into a Kaltura drop folder.

Kaltura detects both files and imports them creating an entry. In order to add the correct categories we decided to use nested folders matching the entries categories.

The trick is to use inotify-tools (write-close event), at and some shell scripts. If your are using the same kaltura server, create a different shared folder and move the files into the drop folder.

It works very well, even under heavy load (100 videos /day)

Hope this idea helps,

David

I appreciate all the help, we have a few suggestions to sift through and we’ll see which route works out best for us. For now we’re going to contact our account manager as well as our server department to see if we can’t debug this script and work out a possible future solution, should this custom script break again. I’ll also see about setting up that ‘mezzanine server’ though it may be a bit out of our scope. Thanks anyway for the suggestion!

Thank you,
Cody

The mezzanine is needed because the origin files are huge (20-50GB) and need to be pre-converted from mxf into 720p mp4 before they are uploaded into Kaltura.

However, you can take on the idea of watching a folder with inotify instead of cron and then creating the xmls with a script.

Regards,

David