Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEATURE REQUEST: Make all video streamable in Telegram #68

Open
NyaMisty opened this issue Nov 19, 2024 · 5 comments
Open

FEATURE REQUEST: Make all video streamable in Telegram #68

NyaMisty opened this issue Nov 19, 2024 · 5 comments

Comments

@NyaMisty
Copy link

Due to various reason, many files on Telegram does not have supportsStreaming flags set, making the video cannot be streamed even if a user have Telegram Premium subscription.

Please add a global switch to allow user to manually override the flag. Thank you!

@Kylmakalle
Copy link

An ability to stream the video is defined not only by the supportsStreaming flag. To stream the video, it must contain metadata at the very beginning of the file. If metadata is placed in the end, there's nothing we can do from the client without full download.

@NyaMisty
Copy link
Author

NyaMisty commented Nov 19, 2024

First of all, It's obvious that ther's no way to reliably check the video format thoroughly without fully downloading. There are tooooo many points that can affect video streaming, like format/encoder, platforms also have different levels of support on private encoders like HEVC. Considering that, what you're saying is actually correct-but-useless words. Even if the video cannot be streamed in anyway, there's ALWAYS a fallback because user can still download the video and play it afterwards. It's totally no point to talk about video encoding here.

Also, your word and understanding on video streaming is incorrect. Video streaming is way different from live streaming, the former mainly focus on seamless jumping to any frame in the video, while the latter one simply plays segments one by one, with no fast forward/backward.
The core of a streamable video is the global index that let decoder know the mapping between timestamp and file offset, which makes player able to use methods like to HTTP Range to skip file bytes. In the MP4 case, that index tables stores at the END of file, instead of beginning.

Lastly, as a mobile developer, most modern platform won't put additional check on streaming video format at high level API. For example, HTML 5 and iOS API simply allow you to play any video file as long as you can provide a random-access file object/URL, even if the video can't plays, it will only silently fail, without crash and panic, . So all we need to do is allow user to ignore the flag.

@Kylmakalle
Copy link

So why do you think Telegram has not deprecated supportsStreaming and just hardcoded it to true?

@NyaMisty
Copy link
Author

Because

  1. Telegram probably wants to lower down server pressure, as random access lead to poor performance.
  2. Telegram already drops this flags even if you manually specify it using things like Telethon. Probably they got some bugs in their upload logic, or they intentionally dropped it for reason1.
  3. Telegram's official tdesktop overrides the supportsStreaming for all videos from Stories. So technically supportsStreaming can be hardcoded to true.
  4. Please stop asking non-sense questions if you CAN'T GIVE ANY SINGLE constructive proposal. This feature request is talking about an opt-in option, not a opt-out one, and this feature flag is pretty easy to implement. Talking about the format and Telegram internal logic won't push any progress for this issue.

@Kylmakalle
Copy link

this feature flag is pretty easy to implement. Talking about the format and Telegram internal logic won't push any progress for this issue.

I agree. Your PR will be welcome @NyaMisty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants