S
S
Shporsoft2021-02-24 20:39:56
JavaScript
Shporsoft, 2021-02-24 20:39:56

Change the quality of video playback?

I was making a site like an online cinema, and then a problem arose: how to make it possible to change the quality of the video? When I have only one video file (for example, as 720p), it was possible to change its playback quality, while not having a copy of this video in different qualities. What can you recommend?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergo Zar, 2021-02-24
@Sergomen

As far as I know (but I could be wrong), you can't do without converting the video to the desired quality.
I recommend installing ffmpeg on the server and running the conversion through python.
for example

import os
os.system('ffmpeg -i "видео которое хочешь скомпилить.mp4" -vf scale=640:360 "видео которое получится.mp4"')
#в scale указывается размер видео, если соотношение сторон в видео не обычное то можешь вместо первого числа поставить «-1» и тода видео не будет слишком растянутым или суженым

I think you'll figure it out)

S
Sergey Tikhonov, 2021-02-25
@tumbler

Well, as long as you have exactly one client, you can transcode the video on the fly. But it doesn't scale at all.

M
MrZed, 2021-03-08
@MrZed

Well, as an option, if you have a video with other qualities, then when changing the video quality:
1. Save the viewing time to a variable.
2. Upload a video with the selected quality.
3. Set the time of the video that was.
PS: For example, on the site https://rezka.ag separately, each video with the desired quality (When the quality is changed, the video file itself changes.)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question