API URL:
Method:POST
https://video-gif.denda.ro/api/v1/denda/convert/<<Api KEY>>
Parametri:
La conversia videoclipurilor de pe Youtube exista o limita de durata prestabilita, videoclipurile mai mari de 5 minute nu vro fi procesate.
La conversia videoclipurilor din alte surse exista o limita prestabilita, videoclipurile mai mari de 15 mb nu vro fi procesate.
'Content-Type': 'application/json' { "url_video" : "https://domain.ro/video.mp4 sau https://www.youtube.com/watch?v=SQQQ9kmbp_w", "type" : "video" sau "youtube" "start_time" : "00:00", "set_duration" : 20, "gif_width" : dimensiunea <<valori numerice >> sau null, "gif_height" : dimensiunea <<valori numerice >> sau null, "frame_number" : 40, "fps" : 5, "webp_status" : true or false }
Fragment de cod:
let header = new Headers(); header.append("Content-Type", "application/json");
let data = JSON.stringify({ "url_video": "https://exemple.com/video.mp4 || https://www.youtube.com/watch?v=Pj3q0ZChgFE", "type": "video" || "youtube", "start_time": "00:00", "set_duration": 20, "gif_width": 800, "gif_height": 800, "frame_number": 40, "fps": 5 "webp_status":true || false });
let options = { method: 'POST', headers: header, body: data, redirect: 'follow' };
fetch("https://video-gif.denda.ro/api/v1/denda/convert/<<APY KEY>>", options) .then(response => response.json()) .then(result => console.log(result)) .catch(error => console.log('error', error));
const axios = require('axios');
let data = JSON.stringify({ "url_video": "https://exemple.com/video.mp4 || https://www.youtube.com/watch?v=Pj3q0ZChgFE", "type": "video" || "youtube", "start_time": "00:00", "set_duration": 20, "gif_width": 800, "gif_height": 800, "frame_number": 40, "fps": 5 "webp_status":true || false });
let config = { method: 'post', url:"https://video-gif.denda.ro/api/v1/denda/convert/<<APY KEY>>", headers: { 'Content-Type': 'application/json' }, data : data };
axios(config) .then(function (response) { console.log(JSON.stringify(response.data)); })
.catch(function (error) { console.log(error); });
<?php
$curl = curl_init();
curl_setopt_array($curl, array( CURLOPT_URL => 'https://video-gif.denda.ro/api/v1/denda/convert/<<APY KEY>>', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS =>'{ "url_video":"https://exemple.com/video.mp4 || https://www.youtube.com/watch?v=Pj3q0ZChgFE", "type": "video" || "youtube", "start_time":"00:00", "set_duration":20, "gif_width":800, "gif_height":800, "frame_number":40, "fps":40, "webp_status":true || false, }', CURLOPT_HTTPHEADER => array( 'Content-Type: application/json' ), ));
$response = curl_exec($curl); echo '<pre>'; print_r($response); echo '<pre>'; curl_close($curl);
let settings = { "url": "https://video-gif.denda.ro/api/v1/denda/convert/<<APY KEY>>", "method": "POST", "timeout": 0, "headers": { "Content-Type": "application/json" },
"data": JSON.stringify({ "url_video": "https://exemple.com/video.mp4 || https://www.youtube.com/watch?v=Pj3q0ZChgFE", "type": "video" || "youtube", "start_time": "00:00", "set_duration": 20, "gif_width": 800, "gif_height": 800, "frame_number": 40, "fps": 5 "webp_status":true || false }), }
$.ajax(settings).done(function (response) { console.log(response); });
Răspunsul cererilor:
Apare atunci când toate funcțiile sau executat fără problema.
{ "status":"success", "gif":"https://video-gif.denda.ro/file.gif", "webp":"https://video-gif.denda.ro/file.webp" }
Apare atunci când URL sitului este invalid sau nu conține fișierul respectiv.
{ "status":"failed", "message":"url invalid" }
Apare atunci campul timp are o valoare incorecta.
{ "status":"failed", "message":"invalid conversion type" }
Apare atunci când vidieoclipul de la youtube depaseste limita de 5 minute.
{ "status":"failed", "message":"YouTube video is too big" }
Apare atunci când fisierul video depaseste dimensiunea prestabilita.
{ "status":"failed", "message":"Video File is too big" }
Apare atunci când exista o eroare la extragerea videoclipului de pe YouTube sau de pe alte surse.
{ "status":"failed", "message":"Error extracting video from (youtube || source)" }
Apare atunci când exista o eroare la convertirea videoclipului in gif.
{ "status":"failed", "message":"Error converting to gif: ((error))" }