D
D
DWZ2019-10-17 10:24:24
Browsers
DWZ, 2019-10-17 10:24:24

What and how does the video decode in the browser?

Can you please tell me how the video is decoded when playing it in a browser under Windows7? Here is a script that pulled several megabytes from the server, which are, say, a TS file or a piece of an MP-4 file. What happens next? Who further understands this mess of bytes? Who parses the format, that here we have a sound, and here is an image? Who decompresses the image into the final form that we see on the screen? Script? Browser? OS? Video card?
Does it use the standard codecs installed in the system? Who is calling them? What and in what form is fed to the input and what do we have at the output? Who decides what exactly this codec should be used?
How does all this interact with each other? Where to read about it? (Answer "Internet/Google" - not accepted ;) )

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Ronald McDonald, 2019-10-17
@Zoominger

Who further understands this mess of bytes? Who parses the format, that here we have a sound, and here is an image? Who decompresses the image into the final form that we see on the screen?

Codec.
They are usually built into the browser.
Well, I have nothing more to add. The video is decoded, all of a sudden, by the codec that is tweaked into the browser. Google "H264", for example, or whatever.

A
Armenian Radio, 2019-10-17
@gbg

Depends on the browser and operating system.
Chrome honestly uses pieces from ffmpeg, and if the video card supports (and it usually does), then it decodes directly on it.
A video file is usually a complex container containing many streams of data - sound, video, subtitles, and so on. The process of packaging into a container is called muxing, unpacking is called demuxing. Accordingly, the piece first enters the demuxer and the necessary streams are taken out of it.
The demuxer may be part of ffmpeg or gstreamer, may be part of DirectX, may be part of Android (AMediaFormat).
After the demuxer, the video specifically goes to the decoder - hardware (on the video card) or software, and then to the screen.
The software decoder, again, can be part of ffmpeg or gstreamer, or from DirectX (this is a question of whether installed codecs are used)

A
alex1478, 2019-10-17
@alex1478

Roughly speaking, everything works like this:
The video is decoded by the browser using the decoding algorithm for this video format. Decoding takes place by means of the processor, the picture is also created by the browser itself inside the window. The entire browser window, with the exception of the window frames, is created by the browser itself using the processor. This picture is sent to the video card, which displays it on the screen, combining it with the rest of the DE elements.
If the browser supports hardware decoding on the video card, then the browser window with a void instead of the video and the byte stream of the video itself with coordinates, layer, transparency, etc. are sent to the video card. The video card combines it all and displays it.
But again, I say that this is a very rough description of the process, there are too many nuances.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question