Method for compatible private video format webpage player

文档序号:38489 发布日期:2021-09-24 浏览:20次 中文

阅读说明:本技术 一种兼容私有视频格式网页播放器方法 (Method for compatible private video format webpage player ) 是由 刘其元 张宏 夏祥均 肖源 于 2021-05-28 设计创作,主要内容包括:本发明公开了一种兼容私有视频格式网页播放器方法,包括以下具体步骤:步骤一,在PC端安装本地服务插件,创建配置中指定端口的websocket服务服务端口并等待浏览器的连接;步骤二,所述浏览器用于接收用户在网页上点击申请观看新视频格式的信息;步骤三,判断所述视频流是否为标准格式;步骤四,在判断出步骤三中的视频流为标准格式时,调用标准内嵌播放器播放从流媒体拉来的视频流,否则,浏览器需要创建webSocket连接本地解码服务;步骤五,将视频数据解码之后的YUV图像数据再推回网页。本发明与现有技术相比的优点在于:可对不同格式的视频进行解码播放,无需打开两个画面进行视频观看,操作便捷,用户体验感较好。(The invention discloses a method for a webpage player compatible with a private video format, which comprises the following specific steps: step one, installing a local service plug-in at a PC end, creating a websocket service port of a designated port in the configuration and waiting for the connection of a browser; step two, the browser is used for receiving information of a user clicking on a webpage to apply for watching a new video format; step three, judging whether the video stream is in a standard format; step four, when the video stream in the step three is judged to be in the standard format, calling a standard embedded player to play the video stream pulled from the streaming media, otherwise, the browser needs to create a webSocket connection local decoding service; and step five, pushing the YUV image data after the video data decoding back to the webpage. Compared with the prior art, the invention has the advantages that: the video of different formats can be decoded and played without opening two pictures for video watching, the operation is convenient and fast, and the user experience is good.)

1. A compatible private video format webpage player method is applied to video stream playing equipment, the video stream playing equipment comprises a browser and local service, the browser and the local service are communicated through websocket, and the compatible private video format webpage player method comprises the following specific steps:

step one, installing a local service plug-in at a PC (personal computer) end, wherein the local service plug-in is used for reading configuration, creating a websocket service port of a specified port in the configuration and waiting for connection of a browser;

the browser is used for receiving information of applying for watching a new video format clicked on a webpage by a user, acquiring a video stream corresponding to the video playing request, and returning video format information, the address of a streaming media forwarding server and a verification key;

analyzing according to the video stream, and judging whether the video stream is in a standard format;

step four, when the video stream in the step three is judged to be in the standard format, calling a standard embedded player to play the video stream pulled from the streaming media, and when the video stream in the step three is judged to be in the new video format, the browser needs to create a webSocket connection local decoding service and pushes the video stream data pulled up by the streaming media forwarding server to the local decoding service;

and step five, after local decoding service is carried out on the video stream in the new video format in the step four, the YUV image data after the video data decoding is pushed back to the webpage, the webpage player obtains the YUV image data, and the image is generated by using the canvas and displayed.

2. The method of claim 1, wherein the method further comprises: and the local service is connected with decoding hardware for assisting multi-path decoding.

3. The method of claim 2, wherein the method further comprises: and the local service pushes the received video stream with the new format to locally connected decoding hardware, and the decoding hardware returns the original image data and then pushes the original image data back to the browser.

4. The method of claim 1, wherein the method further comprises: the local service simultaneously adopts a public decoding algorithm and a pick-up decoding algorithm.

5. The method of claim 1, wherein the method further comprises: the local service plug-in is used for circularly decoding until the webpage is disconnected.

Technical Field

The invention relates to the technical field related to video decoding, in particular to a method for a webpage player compatible with a private video format.

Background

A4-time lossless compression algorithm which is newly developed by a pick-up algorithm team is combined with a 3559A chip in compression, but the computational power of a reduction algorithm chip is insufficient, a GPU computational power is required to be used for reducing images on x86, an original pick-up web page player only supports decoding of h264 and h265 video formats, if an original webpage system needs to play the latest video format seamlessly, a new method is required for solving the problem, otherwise, the webpage system can only play the latest video format in a local version, two pictures need to be opened, the operation is troublesome, and the user experience is very poor.

With the continuous development of video technology, the iterative innovation of video compression technology is more and more frequent, when a more excellent compression algorithm is not yet standard, embedded video players of various browsers do not support the latest video compression algorithm, if the latest compression algorithm is required to be applied, the latest algorithm is required to be used for compression at a video source end, and a picture is restored and displayed at a front end by the latest algorithm. When a new algorithm comes out, the encoding and decoding are provided with a calling library below x86 (since the new algorithm improves the compression rate, needs N times of calculation power, basically needs to use a GPU for acceleration, and therefore can be realized below x 86), at this time, a player in a common webpage application cannot play, and therefore a uniform method of a webpage player compatible with a private video format is needed.

Disclosure of Invention

The invention provides a method for enabling a webpage player to play compatibly by local decoding, aiming at overcoming the problem that the video format of the latest compression algorithm cannot be played by the existing webpage player and enabling the new algorithm to be applied most quickly.

In order to solve the technical problems, the technical scheme provided by the invention is as follows: a compatible private video format webpage player method is applied to video stream playing equipment, the video stream playing equipment comprises a browser and local service, the browser and the local service are communicated through websocket, and the compatible private video format webpage player method comprises the following specific steps:

step one, installing a local service plug-in at a PC (personal computer) end, wherein the local service plug-in is used for reading configuration, creating a websocket service port of a specified port in the configuration and waiting for connection of a browser;

the browser is used for receiving information of applying for watching a new video format clicked on a webpage by a user, acquiring a video stream corresponding to the video playing request, and returning video format information, the address of a streaming media forwarding server and a verification key;

analyzing according to the video stream, and judging whether the video stream is in a standard format;

step four, when the video stream in the step three is judged to be in the standard format, calling a standard embedded player to play the video stream pulled from the streaming media, and when the video stream in the step three is judged to be in the new video format, the browser needs to create a webSocket connection local decoding service and pushes the video stream data pulled up by the streaming media forwarding server to the local decoding service;

and step five, after local decoding service is carried out on the video stream in the new video format in the step four, the YUV image data after the video data decoding is pushed back to the webpage, the webpage player obtains the YUV image data, and the image is generated by using the canvas and displayed.

As an improvement, the local service connects decoding hardware for assisting in multi-path decoding.

As an improvement, the local service pushes the received video stream with the new format to locally connected decoding hardware, and the decoding hardware returns the original image data and then pushes the original image data back to the browser.

As an improvement, the local service adopts a public decoding algorithm and a pick-up decoding algorithm at the same time.

As an improvement, the local service plug-in is used for circularly decoding until the webpage is disconnected.

Compared with the prior art, the invention has the advantages that: the method for the webpage player compatible with the private video format can decode and play videos with different formats, two pictures do not need to be opened for video watching, the operation is convenient and fast, the user experience is good, the decoding hardware is connected in the local service and used for assisting the multi-channel decoding shell to improve the video stream decoding performance, and the phenomenon of video playing blockage is avoided.

Drawings

Fig. 1 is a schematic block diagram of a method for playing a web page compatible with a proprietary video format according to the present invention.

FIG. 2 is a flow chart of the present invention for a web page invoking local decode service.

FIG. 3 is a flow chart of the operation of the local service plug-in of the present invention.

Detailed Description

The present invention will be described in further detail with reference to the accompanying drawings.

The following further describes embodiments of the present invention with reference to the accompanying drawings. In which like parts are designated by like reference numerals.

It should be noted that the terms "front," "back," "left," "right," "upper" and "lower" used in the following description refer to directions in the drawings, and the terms "inner" and "outer" refer to directions toward and away from, respectively, the geometric center of a particular component.

In order to make the content of the present invention more clearly understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention.

With reference to fig. 1-3, a method for playing a web page compatible with a private video format is applied to a video stream playing device, where the video stream playing device includes a browser and a local service, and the browser and the local service communicate with each other through a websocket, and the method for playing the web page compatible with the private video format includes the following specific steps:

step one, installing a local service plug-in at a PC (personal computer) end, wherein the local service plug-in is used for reading configuration, creating a websocket service port of a specified port in the configuration and waiting for connection of a browser;

the browser is used for receiving information of applying for watching a new video format clicked on a webpage by a user, acquiring a video stream corresponding to the video playing request, and returning video format information, the address of a streaming media forwarding server and a verification key;

analyzing according to the video stream, and judging whether the video stream is in a standard format;

step four, when the video stream in the step three is judged to be in the standard format, calling a standard embedded player to play the video stream pulled from the streaming media, and when the video stream in the step three is judged to be in the new video format, the browser needs to create a webSocket connection local decoding service and pushes the video stream data pulled up by the streaming media forwarding server to the local decoding service;

and step five, after local decoding service is carried out on the video stream in the new video format in the step four, the YUV image data after the video data decoding is pushed back to the webpage, the webpage player obtains the YUV image data, and the image is generated by using the canvas and displayed.

And the local service is connected with decoding hardware for assisting multi-path decoding.

And the local service pushes the received video stream with the new format to locally connected decoding hardware, and the decoding hardware returns the original image data and then pushes the original image data back to the browser.

The local service simultaneously adopts a public decoding algorithm and a pick-up decoding algorithm.

The local service plug-in is used for circularly decoding until the webpage is disconnected.

The present invention and its embodiments have been described above, and the description is not intended to be limiting, and the drawings are only one embodiment of the present invention, and the actual structure is not limited thereto. In summary, those skilled in the art should appreciate that they can readily use the disclosed conception and specific embodiments as a basis for designing or modifying other structures for carrying out the same purposes of the present invention without departing from the spirit and scope of the invention as defined by the appended claims.

7页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:低码率视频优化编码方法和装置、设备及存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类