TelegramMessenger / TelegramMessenger/Telegram-iOS

Black screen instead of video uploaded via Telegram API (only in iOS app)

Open
#301 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Swift
Stars
9k
Forks
2.9k
PR merge metrics
No merged PRs in 30d

Description

Checklist
  • I am reporting an issue in existing functionality that does not work as intended
  • I've searched for existing GitHub issues
Description

I use MTProto Telegram API and Telegram Bot API to upload small videos to Telegram.
Format of video: h264+mp4 (audio stream doesn't matter)
Resolution: 720p or 1080p
Size of video file: > 10 MB (but less than 20MB)
Source of video: doesn't matter (you can use any valid h264 video).
Method: sendVideo if Telegram Bot API or messages.sendMedia if MTProto API.

I upload my video to the Telegram server using mentioned API and don't provide explicit info about width and height of this video. According to the documenation of sendVideo I don't need to provide info about width and height. They are both marked as optional. In this case Telegram server is reported that video was uploaded successfully (with width=0 and height=0).
After that I try to watch video in different Telegram clients. Video is played correctly in Desktop client and Android app. But in iOS app I see a black screen instead of video (see attached screenshot).

If I explicitly set width and height of video or use video is less than 10 MB than video is played correctly iOS app. As I understand, if video is less than 10 MB then telegram server is calculated its width and height.

Expected Behavior

I can watch the video uploaded via Telegram Bot API or MTProto API in the Telegram-iOS app
(even if I don't provide info about width and height in API method)

Actual Behavior

Black screen instead of the video in iOS app. But I can hear sound and can see video thumbnails.

Steps to Reproduce
  1. Upload h264+mp4 video (size of file between 10MB and 20MB) from your PC using MTProto Telegram API or Telegram Bot API.
    Don't provide explicit info about video's width and height (these are optional parameters according to the documentation).
  2. Check that video was uploaded successfully (use any other platform except iOS to watch it).
  3. Try to watch the video using iPhone. You can see a black screen instead of video.
  4. Upload the same video using MTProto Telegram API or Telegram Bot API, but provide info about width and height at this time (e.g. width=1920, height=1080).
  5. Congrats! Now you can watch this video in your Telegram-iOS app.
Screenshots and Videos

black_screen

Environment

Device: iPhone X

iOS version: 13.4, 13.5

App version: 6.1.2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue in the Telegram-iOS app with a 10–20 MB H.264 MP4 uploaded through sendVideo or messages.sendMedia without width and height. Compare playback with explicitly supplied dimensions and with other clients. Done means the affected video renders correctly on iOS while preserving audio and thumbnails.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, swift
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.