TelegramBots / Telegram.Bot

.NET Client for Telegram Bot API
https://telegrambots.github.io/book
MIT License
3.17k stars 686 forks source link

Send video note problem #496

Closed Ramin-Bateni closed 6 years ago

Ramin-Bateni commented 6 years ago

Steps to reproduce

using (var fileStream = new FileStream(@"E:\path\video.mp4", FileMode.Open))
{
    var fileToSend = new FileToSend("MyVideoNote.mp4", fileStream);
    await Bot.SendVideoNoteAsync(chat_Id, fileToSend);
}

Expected behavior

Rounded Video image

Actual behavior

Square Video with black thumb image

Environment data

NuGet Package Version: Telegram.Bot.Core.13.2.0

Where is my mistake? and how I should change my codes to send rounded videos? Is there any problem in the library that I used (Telegram.Bot.Core.13.2.0) about sending video note messages?

tuscen commented 6 years ago

I've not been able to reproduce your problem. 2017-10-28 22 24 42

Have you tried to send video note manually to check if the problem isn't in the video file itself (e.g. using Postman or Insomnia rest clients)?

poulad commented 6 years ago

@Ramin-Bateni First, try this video that we use in our sys integ tests:

https://github.com/TelegramBots/telegram.bot/blob/develop/test/Telegram.Bot.Tests.Integ/Files/Video/golden-ratio-240px.mp4

Telegram decides about how to render the video. It should be because of either resolution or length.

Ramin-Bateni commented 6 years ago

@pouladpld, It worked with the file that you linked to it.👍

Then now the question is why my video failed? In the other words: What are all the video file requirements (require format) to make a VideoNotesuccessfully?

poulad commented 6 years ago

I told you why. Convert your video to that format, resolution, and length.

Ask @botsupport for more details and please let us know the answer.

Ramin-Bateni commented 6 years ago

@botsupport: They should be squared (same height and width) ;)

Edgar-P-yan commented 1 year ago

Right now i'm doing some experiments with telegram, and it looks like maximum video size is 639px. Even 640px gives an error, but up to 639 everything works fine. So for now i can say that requirements for sending video note are:

  1. Video shouldn't be longer than a minute.
  2. It should be a square, meaning that width and height required to be equal
  3. The size of it must be not bigger than 639px.
  4. The video format/encoding better to be .mp4, although others might also work.

I'll edit this comment as i'll get some more information