What is the proper video container for the Telegram Bot API sendVideo function?

Which video container works with Telegram’s sendVideo method? The official documentation only cites H.264/MPEG-4 AVC. When I convert a muted video with the command below:

ffmpeg -i source.avi -an -c:v libx264 -crf 28 output.mp4

I receive an ‘ok:true’ response, yet the Telegram client only displays a blurred static image as a preview.

Based on my experience, the container itself isn’t usually the problem but rather how the video is encoded. I encountered a similar issue where the Telegram client showed only a static image despite a successful send. The solution involved setting appropriate keyframe intervals during encoding so that the preview frame was properly identifiable by Telegram. Adjusting the FFmpeg command and ensuring that metadata remains intact made a significant difference. It appears that making these changes helps the client generate the expected preview from the transmitted video.

I encountered a similar issue when sending videos using the Telegram Bot API. For me, the container format wasn’t the root cause; it was more about how the file was structured and what metadata was included. I found that correctly positioning the moov atom in MP4 files was essential to allow Telegram to generate an accurate preview image. Using ffmpeg with a shift in the metadata location – for example, by adding the ‘-movflags faststart’ flag – improved the situation significantly in my testing environment.

i’ve used mp4 and found it works best if settings are tuned. try checking ffmpeg settings for key frame spacing and metadata, not just the container. minor tweaks like changing pixel format might help too, sometimes its those small details that count.

An effective solution is to ensure that the MP4 file is encoded with the proper keyframe placement and metadata organization. My personal experience indicates that using H.264 in an MP4 container works reliably when the metadata is written at the beginning of the file. This can be achieved by fine-tuning your FFmpeg command so that the file structure clearly indicates keyframes. While testing various configurations, I found that refining these parameters enabled Telegram to generate a proper preview, confirming that the issue lies in encoding details rather than the chosen container.