P
P
Petro Boyko2020-12-18 16:08:23
PHP
Petro Boyko, 2020-12-18 16:08:23

How to turn a square video into a round one?

Connoisseurs of the telegram bot, tell me how to make a round video from a square video ???

function send_message($method, $params, $headers = [] ){
  
  $url = 'https://api.telegram.org/bot' . TOKEN . '/' . $method;
  // Отправить сообщение	
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_POST, true);
  curl_setopt($ch, CURLOPT_HEADER, false);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_URL, $url);	
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);  	
    curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 	
    curl_setopt($ch, CURLOPT_HTTPHEADER, array_merge(array("Content-Type:multipart/form-data"), $headers));	
    $result = curl_exec($ch);
    curl_close($ch);
    return (json_decode($result, true) ? json_decode($result, true) : $result);
}

  $path = $site."/bot/video/video1.mp4";
  
  $file_id = "DQACAgIAAxkBAAIBMV_bLnunyi1vlMqDiSkH6FKHIiixAAI_CwACdud4Sq4xIK6CuC5eHgQ";
  
  # Формируем массив для отправления в телеграм
  $out = send_message('sendVideoNote', [chat_id' => $chat_id,
                     //'video_note' => $file_id ]);
                       'video_note' => new CURLFile(realpath($path))]);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
nokimaro, 2020-12-18
@nokimaro

In any case, the video is square (rectangular).
Telegram itself adds round frames if it sees that it is VideoNote.
If you download the original of any such video, you will see that it is square. As an example, download any video from https://t.me/StikStok and see for yourself

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question