Last active
May 7, 2018 19:15
-
-
Save dzeitman/b3b63f39f89d84b642633a3e51436d7d to your computer and use it in GitHub Desktop.
Cloudinary Video upload with Caterorization and VTT creation options example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Cloudinary Video upload with Caterorization and VTT creation options. | |
// step one: Add Cloudinary Credentials, and Subcribe to google speech and google video tagging addons. | |
cloudinary.config({ | |
"cloud_name": "<CLOUD NAME>", | |
"api_key": "<API KEY>", | |
"api_secret": "<API SECRET>" | |
}); | |
let url = "http://res.cloudinary.com/amitshachak/video/upload/v1522054829/invltuezcypmv9xnwvpc.mp4"; | |
let publicID = "cloudinary-video-promo"; | |
var options = { | |
public_id :publicID, | |
resource_type:"video", | |
type:"upload", | |
raw_convert:"google_speech:vtt", | |
categorization: "google_video_tagging", | |
auto_tagging:0 | |
}; | |
cloudinary.v2.uploader.upload(url, options, | |
function(error, result) { | |
if(error){ | |
console.log(error); | |
} | |
if(result){ | |
console.log(result); | |
} | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"public_id": "cloudinary-video-promo", | |
"version": 1525707742, | |
"signature": "7b87e2472042e8565e51c212d5c37be05498c96f", | |
"width": 1920, | |
"height": 1080, | |
"format": "mp4", | |
"resource_type": "video", | |
"created_at": "2018-05-07T15:42:22Z", | |
"tags": [], | |
"pages": 0, | |
"bytes": 18665130, | |
"type": "upload", | |
"etag": "e3c52c84d3a9411f386dc33a76f3860c", | |
"placeholder": false, | |
"url": "http://res.cloudinary.com/de-demo/video/upload/v1525707742/cloudinary-video-promo.mp4", | |
"secure_url": "https://res.cloudinary.com/de-demo/video/upload/v1525707742/cloudinary-video-promo.mp4", | |
"access_mode": "public", | |
"info": { | |
"raw_convert": { | |
"google_speech": { | |
"status": "pending", | |
"data": { | |
"formats": [ | |
"vtt" | |
] | |
} | |
} | |
}, | |
"categorization": { | |
"google_video_tagging": { | |
"status": "pending", | |
"data": 0 | |
} | |
} | |
}, | |
"audio": { | |
"codec": "aac", | |
"bit_rate": "125588", | |
"frequency": 44100, | |
"channels": 2, | |
"channel_layout": "stereo" | |
}, | |
"video": { | |
"pix_format": "yuv420p", | |
"codec": "h264", | |
"level": 40, | |
"profile": "High", | |
"bit_rate": "1225810", | |
"dar": "16:9" | |
}, | |
"is_audio": false, | |
"frame_rate": 25, | |
"bit_rate": 1356686, | |
"duration": 110, | |
"rotation": 0, | |
"original_filename": "invltuezcypmv9xnwvpc" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment