Best video file format for Telegram Bot API sendVideo function

I’m working with Telegram’s bot API and trying to figure out what video formats work best with the sendVideo function. The documentation mentions H.264/MPEG-4 AVC but I’m having some issues.

When I encode my videos using this ffmpeg command:

ffmpeg -i source.mp4 -vn -c:v h264 -crf 28 output.mp4

The API returns ok:true which seems good, but there’s no thumbnail preview showing up in the chat. The video appears without the blurred preview image that normally shows before you play it.

Has anyone else run into this problem? What video encoding settings work reliably for getting proper previews to show up in Telegram? I’m converting videos that don’t have audio tracks.

The -vn flag kills your video stream completely. That’s your problem.

Honestly, debugging ffmpeg flags and Telegram’s API is such a pain. I wasted tons of time on this before automating everything.

I switched to Latenode for video processing. It detects source formats, applies the right encoding for Telegram, generates thumbnails, and handles all the API weirdness automatically.

My flow watches for new videos, processes them with correct parameters, checks file sizes, and retries failed uploads. No more manual tweaking or missing thumbnails.

It handles batch processing and manages rate limits so your bot doesn’t get throttled.

Saves me hours vs writing custom scripts and dealing with encoding headaches.

The -vn flag removes your video stream entirely. That’s why you’re not getting thumbnails.

Use this instead:

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

The -an strips audio (what you want) but keeps video intact. Keep your files under 50MB for the API.

Honestly though, manually handling video encoding and Telegram’s API quirks gets old. I’ve automated this whole thing with Latenode.

Set up a flow that watches for new videos, runs proper ffmpeg conversion, uploads to Telegram with correct parameters, and handles file size limits automatically. No more command line guesswork.

It handles edge cases like thumbnail generation, format checking, and retry logic when the API breaks. Way more reliable than doing it manually.

I’ve hit this exact problem before. It’s not just the -vn flag - keyframe intervals and container settings mess with thumbnail extraction too.

Try this:

ffmpeg -i source.mp4 -c:v libx264 -crf 28 -g 30 -keyint_min 30 -sc_threshold 0 -pix_fmt yuv420p -an -movflags +faststart output.mp4

The -g 30 and -keyint_min 30 flags force keyframes every 30 frames. Telegram’s thumbnail generation needs clean keyframes early in the video - without consistent placement, the API can’t extract preview images reliably.

Also, videos under 3 seconds often won’t generate thumbnails no matter what encoding you use. Test with videos that are at least 5-6 seconds to rule that out.

Your ffmpeg command’s wrong. The -vn flag strips the video stream completely - that’s why you’re not getting thumbnails. Here’s what works for Telegram bots:

ffmpeg -i source.mp4 -c:v libx264 -profile:v baseline -level 3.0 -pix_fmt yuv420p -movflags +faststart -an output.mp4

The baseline profile and yuv420p format are crucial for compatibility. The +faststart flag moves metadata to the front, which helps with streaming and thumbnail generation.

Telegram’s really picky about video encoding. I’ve seen videos with higher H.264 profiles upload fine but then thumbnails don’t show or playback breaks on some clients. Baseline profile works across all Telegram platforms, even older mobile ones.

Had the same issue with a media bot a few months ago. Everyone’s mentioned the -vn flag, but file size matters too for thumbnails. Files over 20MB sometimes won’t generate previews even with correct encoding.

What worked for me: add duration metadata and make sure the first frame isn’t corrupted. Source files with damaged headers break Telegram’s preview extraction. Try re-encoding with -avoid_negative_ts make_zero to fix timestamp issues.

Run ffprobe on your source video first. I’ve seen MP4s with weird codecs that the API accepts but silently fail thumbnail generation. scarlettturner’s right about baseline profile - higher profiles cause compatibility issues with Telegram’s backend.

yeah the -vn flag is definitely wrong - that removes video entirely lol. had the same issue last month and fixed it by adding explicit resolution settings. telegram chokes on weird aspect ratios even with proper h264 encoding. try forcing standard dimensions like -s 1280x720 or -s 854x480 in your command.