<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.magnific.com/v2/videos/upscale",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'creation_id' => '<string>',
'upscale_factor' => 4.5,
'target_fps' => 30,
'target_resolution' => 2240,
'focus' => 0.5,
'sharpen' => 123,
'creativity' => 50,
'premium_quality' => true,
'fps_boost' => true,
'smart_grain' => 50,
'strength' => 50,
'turbo' => true,
'preview' => true,
'pro_res_output' => true,
'details' => 0.5,
'compression' => 0.5,
'recover_original_detail_value' => 0.5,
'noise' => 0.5,
'halo' => 0.5,
'prenoise' => 0.05,
'preblur' => 0.5,
'blur' => 0.5,
'grain' => 0.05,
'grain_size' => 0.5,
'astra_prompt' => '<string>',
'astra_creativity' => 0.5,
'astra_realism' => 0.5,
'astra_sharp' => 0.5,
'webhook_url' => '<string>',
'folder_reference' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-magnific-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}