1
votes

I have a roadblock here. I want to get the video duration from Cloudinary. Is there any function I can use to get my desired result?

The Only option I found is using Cloudinary API's resource method. I am using the PHP Cloudinary API in this way:

$api = new \Cloudinary\Api();

$result = $api->resource("public_id",array("resource_type" => video","duration"=>true));

 print_r($result);

This function gets most of the info of the video but not the video's duration.

I have also tried with PHP 'getID3' Library but it returns an error that says:

Remote files are not supported - please copy the file locally first

If you guys have any idea how to do this in Cloudinary or in PHP, please Share.

Thanks in advance.

1

1 Answers

2
votes

Cloudinary supports returning more extensive information by setting the image_metadata parameter to true. For example:

$result = $api->resource("public_id",array("resource_type" => "video","image_metadata"=>true));

This will also return the duration of the video.