Video playback method and device

By using C++ language decoding and websocket protocol to manage the player window process on the web side, the problem of insufficient H.265 video decoding performance is solved, low-latency and smooth high-definition video playback is achieved, and server costs and network transmission time is reduced. Real-time monitoring of scenes in video.

CN115022725BActive Publication Date: 2024-11-15JINGDONG CITY BEIJING DIGITS TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202210574916.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-25
Publication Date
2024-11-15
Estimated Expiration
2042-05-25

AI Technical Summary

Technical Problem

In the video playback of the prior art, the decoding performance of H.265 format videos is weak, resulting in large server performance consumption and increased video fluid volume, making it impossible to achieve low latency and smooth high-definition video playback, especially not suitable for real-time video monitoring and other scenarios. .

Method used

By using C++ language on the web side to decode the video obtained from the streaming media server, combined with the websocket protocol and player window process management, low-latency and smooth H.265 video playback is achieved, and video playback at different resolutions and frame rates is supported. , and control multiple video streams in multiple window positions.

Benefits of technology

It reduces server costs, reduces video fluid volume, reduces network transmission time, and realizes low latency and smooth playback of H.265 videos on the web, which is suitable for real-time video monitoring and other scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115022725B_ABST
    Figure CN115022725B_ABST
Patent Text Reader

Abstract

The present invention discloses a video playback method and device, and relates to the field of computer technology. A specific implementation of the method includes: in response to a player window creation command sent by a web page end, creating a player window process, and sending the created player window process to the web page end; after receiving a playback control command issued by the web page end corresponding to the player window process, controlling the player window process to play the video according to the playback control command. This implementation can achieve low-latency and smooth playback of H.265 format videos on the Web end, support playback of H.265 format videos with different resolutions and different frame rates, reduce server costs, reduce video stream volume, and reduce network transmission time. Another implementation of the present invention can also achieve playback of multiple high-definition H.265 videos that are controlled separately at multiple random positions in the Web end window, which is suitable for scenarios such as real-time video monitoring.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a video playing method and device. Background Art

[0002] The existing video playback solution decodes the video in H.265 encoding format on the streaming media server and then transcodes it into H.264 format, which is then transmitted to the front-end browser for playback. Since H.265 has a higher compression rate than H.264, decoding requires higher performance requirements. Currently, most computer CPUs have difficulty in soft decoding (i.e., software decoding) H.265 high-definition videos, and hardware compatibility is not good, so there are very few browsers that natively support H.265 decoding. There are also some front-end video components that use pure js or wasm solutions for H.265 decoding and playback, but the performance of js or wasm is significantly weaker than the browser's native video tags. <video>< / video> The decoding capability of C language.

[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:

[0004] Video transcoding through a streaming server consumes a lot of server performance and increases server costs. The transcoded video stream is larger, which is not conducive to network transmission of high-definition video. Decoding through a streaming server increases server usage costs and network transmission time, and is not suitable for scenarios such as real-time video monitoring. Some existing browser plug-ins only support parsing the H.264 encoding format. For H.265, a clearer and more compressed encoding format, there is no solution for real-time parsing of video streams to play video images. The decoding performance of js or wasm components is relatively weak, and it is impossible to smoothly play multi-channel high-definition H.265 videos. Summary of the invention

[0005] In view of this, the embodiments of the present invention provide a video playback method and device, which can realize low-latency and smooth playback of H.265 format videos on the Web side, support the playback of H.265 format videos with different resolutions and frame rates, and realize the playback of multiple high-definition H.265 videos controlled separately at multiple random positions in the Web window, reduce server costs, reduce video stream volume, and reduce network transmission time, and is suitable for scenarios such as real-time video monitoring.

[0006] To achieve the above objective, according to one aspect of an embodiment of the present invention, a video playback method is provided.

[0007] A video playback method comprises: in response to a player window creation command sent by a web page end, creating a player window process, and sending the created player window process to the web page end; after receiving a playback control command issued by the web page end corresponding to the player window process, controlling the player window process to play the video according to the playback control command.

[0008] Optionally, before creating a player window process in response to a player window creation command sent by the web page, it includes: receiving the player window creation command sent by the web page by establishing a websocket connection, and the player window creation command includes the player size corresponding to the player window process and the position of the player on the web page.

[0009] Optionally, the player window creation command includes a player unique identifier; the method further includes: after the player window process is created, allocating the corresponding player unique identifier to the created player window process.

[0010] Optionally, the number of player window processes created is multiple, and the playback control command includes a player unique identifier corresponding to the player window process to be controlled; the method also includes: after receiving the playback control command issued by the web page corresponding to the player window process, identifying the player window process to be controlled according to the player unique identifier included in the playback control command.

[0011] Optionally, after receiving the playback control command issued by the web page end corresponding to the player window process, controlling the player window process to play the video according to the playback control command, including: after receiving the playback control command issued by the web page end corresponding to the player window process, executing the playback control command, and returning a reply message corresponding to the playback control command to the web page end according to the execution result of the playback control command, so that the web page end executes a corresponding callback function according to the content of the reply message, and the callback function includes pre-defined operations corresponding to the content of the reply message.

[0012] Optionally, the player window process uses C++ language to decode the video obtained from the streaming media server for real-time playback.

[0013] According to another aspect of an embodiment of the present invention, a video playback device is provided.

[0014] A video playback device includes: a player window process creation module, which is used to create a player window process in response to a player window creation command sent by a web page end, and send the created player window process to the web page end; a video playback control module, which is used to control the player window process to play the video according to the playback control command after receiving the playback control command sent by the web page end corresponding to the player window process.

[0015] Optionally, it also includes a player window creation command receiving module, which is used to: receive the player window creation command sent by the web page end by establishing a websocket connection, and the player window creation command includes the player size corresponding to the player window process and the position of the player on the web page end.

[0016] Optionally, the player window creation command includes a player unique identifier; the device also includes an identifier allocation module, which is used to: after the player window process is created, allocate the corresponding player unique identifier to the created player window process.

[0017] Optionally, the number of player window processes created is multiple, and the playback control command includes a player unique identifier corresponding to the player window process to be controlled; the device also includes a player window process identification module, which is used to: after receiving the playback control command issued by the web page corresponding to the player window process, identify the player window process to be controlled according to the player unique identifier included in the playback control command.

[0018] Optionally, the video playback control module is also used to: after receiving the playback control command issued by the web page end corresponding to the player window process, execute the playback control command, and return a reply message corresponding to the playback control command to the web page end according to the execution result of the playback control command, so that the web page end executes a corresponding callback function according to the content of the reply message, and the callback function includes pre-defined operations corresponding to the content of the reply message.

[0019] Optionally, the player window process uses C++ language to decode the video obtained from the streaming media server for real-time playback.

[0020] According to yet another aspect of the embodiments of the present invention, an electronic device is provided.

[0021] An electronic device includes: one or more processors; and a memory for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the video playback method provided by an embodiment of the present invention.

[0022] According to yet another aspect of an embodiment of the present invention, a computer readable medium is provided.

[0023] A computer-readable medium stores a computer program, which, when executed by a processor, implements a video playback method provided by an embodiment of the present invention.

[0024] An embodiment of the above invention has the following advantages or beneficial effects: in response to a player window creation command sent by a web page, a player window process is created, and the created player window process is sent to the web page. After receiving a playback control command sent by the corresponding player window process on the web page, the player window process is controlled to play the video according to the playback control command. It is possible to play H.265 format videos with low latency and smoothly on the Web side, support the playback of H.265 format videos with different resolutions and different frame rates, reduce server costs, reduce video stream volume, and reduce network transmission time. After receiving the playback control command, the player window process to be controlled is identified according to the player unique identifier included in the playback control command, so as to control the player window process to play the video, thereby playing multiple high-definition H.265 videos that are controlled separately at multiple random positions in the Web window, which is suitable for scenarios such as real-time video monitoring.

[0025] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0027] Figure 1 is a schematic diagram of main steps of a video playback method according to an embodiment of the present invention;

[0028] Figure 2 is a principle block diagram of video playback according to an embodiment of the present invention;

[0029] Figure 3 is a schematic diagram of main modules of a video playback device according to an embodiment of the present invention;

[0030] Figure 4 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0031] Figure 5It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0032] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0033] Figure 1 4 is a schematic diagram of main steps of a video playback method according to an embodiment of the present invention.

[0034] like Figure 1 As shown, the video playback method of the embodiment of the present invention mainly includes the following steps S101 to S102:

[0035] Step S101: in response to a player window creation command sent by a web page end, a player window process is created, and the created player window process is sent to the web page end;

[0036] Step S102: after receiving the play control command sent by the player window process corresponding to the web page, the player window process is controlled to play the video according to the play control command.

[0037] The web page end is the web page end of the terminal device (such as a computer).

[0038] In response to the player window creation command sent by the web page, before creating the player window process, the web page receives the player window creation command sent by establishing a websocket connection, and the player window creation command includes the player size (such as the width and height of the player) of the corresponding player window process and the position of the player on the web page. Websocket is a protocol for full-duplex communication on a single TCP connection.

[0039] The player window creation command includes the player unique identifier.

[0040] After the player window process is created, a corresponding player unique identifier may be allocated to the created player window process.

[0041] Exemplarily, the number of player window processes created is multiple.

[0042] The playback control command includes the unique player identifier corresponding to the player window process to be controlled.

[0043] After receiving the playback control command sent by the player window process corresponding to the web page, the player window process to be controlled is identified according to the player unique identifier included in the playback control command.

[0044] After receiving the playback control command issued by the corresponding player window process on the web page side, the player window process is controlled to play the video according to the playback control command, specifically including: after receiving the playback control command issued by the corresponding player window process on the web page side, the playback control command is executed, and a reply message of the corresponding playback control command is returned to the web page side according to the execution result of the playback control command, so that the web page side executes the corresponding callback function according to the content of the reply message, and the callback function includes a predefined operation corresponding to the content of the reply message. The reply message body can carry fields such as uuid and errorCode, where uuid is the unique identifier of the player, and errorCode indicates the execution result, for example, errorCode is 0 for success, 1 for failure, -1 for interface call failure (player process without uuid identifier), -2 for illegal business parameters, and so on. The web page side uses errorCode to determine whether the CS main control program has successfully executed this playback control command. The callback function is pre-written on the web page side, and the present invention adopts the solution of Promise asynchronous programming, and the callback function is two parameters of the promise callback object.

[0045] The player window process of the embodiment of the present invention uses C++ language to decode the video obtained from the streaming media server for real-time playback. The video in the streaming media server can be obtained by streaming the video data collected by the camera through the RTSP protocol (Real Time Streaming Protocol).

[0046] Figure 2 FIG. 1 is a block diagram of the principle of video playback according to an embodiment of the present invention. Figure 2As shown, the web page invokes the CS master control program to create a CS player process by creating an iframe. Specifically, the web page can invoke the CS master control program through a front-end script when the page is initialized. The CS master control program is a program that executes the video playback method of the embodiment of the present invention. If the CS player is not installed on the terminal device, it prompts to download the CS player. Iframe is an HTML tag, which acts as a document in a document, or a floating frame (FRAME). The CS player is the client playback software of the embodiment of the present invention, which includes the CS master control program and the CS player process created by the CS master control program. The CS player process is the player window process described in the above embodiment, which is a player window process based on websocket communication. Websocket is a protocol for full-duplex communication on a single TCP connection. In the solution of the embodiment of the present invention, it is used for two-way communication between the web page end and the CS end (i.e., the player end). The CS master control program is an intermediate agent that forwards websocket messages between the web page end and the CS player process.

[0047] Promise is a solution for asynchronous programming, which is more reasonable and powerful than traditional solution callback functions and events. The web page end of the embodiment of the present invention actively initiates a websocket request through promise to establish a link with the CS main control program, thereby controlling the creation, position, size, and stop of the CS player. Specifically, the web page end first sends a createWind command, which is a player window creation command, which contains information such as the width and height, position, and uuid (player unique identifier, which can be a random unique string encoding) of the player. At the same time, the web page end creates a {resolve, reject} callback object with this uuid as the key. The uuid can remain unchanged during the life cycle of the CS player process. The CS main control program adjusts the player window to the corresponding position of the web page through the corresponding parameters in the createWind command (the width and height, position, etc. of the player). Each time the web page sends a websocket message to the CS player, it also carries a randomly generated unique string code (i.e., the sequence parameter). When the CS player replies to the web page's websocket command, it carries this sequence parameter to mark the complete life cycle of a websocket command from the time it is sent by the web page to the time it receives a reply.

[0048] After receiving the playback control command issued by the corresponding player window process on the web page, the CS main control program executes the playback control command, and then feeds back a reply to the web page corresponding to the command, that is, a reply message corresponding to the playback control command. The reply message body carries fields such as uuid and errorCode. For example, errorCode is 0 for success, 1 for failure, -1 for interface call failure (player process without uuid identification), -2 for illegal business parameters, and so on. The web page uses errorCode to determine whether the CS main control program has successfully executed this playback control command, and reads the stored promise callback object {resolve, reject} with uuid as the key, executes the corresponding resolve or reject, and thus executes the corresponding callback of promise. Resolve and reject are callback functions, which are two parameters of the promise callback object. When the asynchronous task is successfully completed and the result is returned, the resolve function will be called, and when the asynchronous task fails and the reason for the failure is returned, the reject function will be called. Resolve and reject include predefined operations. For example, if the playback control command is executed successfully (errorCode=0), the predefined point statistics operation in the resolve function is executed. If the playback control command fails to be executed (errorCode=1), the predefined failure interface display operation in the reject function is executed. The embodiment of the present invention does not limit the specific operation of the callback function.

[0049] The web page can instantiate the player multiple times through the CS master program, that is, send the createWind command multiple times through the websocket connection. Each time the CS master program receives the createWind command, it creates a CS player process to play the video screen. In the monitoring scenario, the video screen is such as the monitoring screen, and assigns a unique uuid to this CS player process, and then sends it to the web page through the websocket callback. Each time the web page instantiates the player, each corresponds to a unique fixed uuid. Each web page sends a playback control command to the CS master program through the websocket. The playback control command carries the corresponding uuid. The CS master program identifies the corresponding CS player process through the uuid and controls the corresponding CS player process to respond to the corresponding playback control command, thereby achieving the effect of the web page controlling multiple CS player windows.

[0050] The web page end of the embodiment of the present invention and the CS player process may have a one-to-many relationship. The CS main control program will assign a unique uuid after creating the CS player process and notify the web page end. The web page end determines the CS player interacting with it through the unique uuid parameter in the websocket response command of the CS player.

[0051] The embodiment of the present invention avoids the language performance bottleneck of js / wasm decoding of multiple high-definition videos. The embodiment of the present invention uses C++ for decoding, and the decoding performance is better. The CS player decodes and plays in the form of a CS client. The web page js (JavaScript, which is the programming language of the Web) code is responsible for waking up the CS player and interacting through websocket. The js script controls multiple CS player windows to be located at different positions on the web page. The CS player is responsible for streaming, decoding and playing multiple high-definition H.265 videos, achieving an effect similar to that of native video, so that the decoding performance of the embodiment of the present invention is higher than that of the js / Wasm decoding solution. The embodiment of the present invention can also play videos of various formats through the CS player, and supports multiple streaming methods. Compared with the existing streaming media transcoding method, the embodiment of the present invention can greatly reduce the decoding pressure of the streaming media server and save server costs.

[0052] Figure 3 FIG. 1 is a schematic diagram of the main modules of a video playback device according to an embodiment of the present invention. Figure 3 As shown, a video playback device 300 according to an embodiment of the present invention mainly includes: a player window process creation module 301 and a video playback control module 302.

[0053] The player window process creation module 301 is used to create a player window process in response to a player window creation command sent by the web page end, and send the created player window process to the web page end;

[0054] The video playing control module 302 is used to control the player window process to play the video according to the playing control command after receiving the playing control command sent by the player window process corresponding to the web page end.

[0055] The video playback device 300 also includes a player window creation command receiving module, which is used to: receive a player window creation command sent by the web page end by establishing a websocket connection. The player window creation command includes the player size of the corresponding player window process and the position of the player on the web page end.

[0056] The player window creation command includes the player unique identifier.

[0057] The video playback device 300 also includes an identification allocation module, which is used to: after creating a player window process, allocate a corresponding player unique identification to the created player window process.

[0058] The number of player window processes created is multiple, and the play control command includes a player unique identifier corresponding to the player window process to be controlled;

[0059] The video playback device 300 also includes a player window process identification module, which is used to: after receiving a playback control command issued by the player window process corresponding to the web page end, identify the player window process to be controlled according to the player unique identifier included in the playback control command.

[0060] The video playback control module 302 can also be used to: after receiving the playback control command issued by the corresponding player window process on the web page side, execute the playback control command, and return a reply message corresponding to the playback control command to the web page side according to the execution result of the playback control command, so that the web page side executes the corresponding callback function according to the content of the reply message, and the callback function includes pre-defined operations corresponding to the content of the reply message.

[0061] The player window process uses C++ language to decode the video obtained from the streaming media server for real-time playback.

[0062] In addition, the specific implementation content of the video playback device in the embodiment of the present invention has been described in detail in the above-mentioned video playback method, so the repeated content will not be described again here.

[0063] Figure 4 An exemplary system architecture 400 to which the video playback method or video playback device according to the embodiment of the present invention can be applied is shown.

[0064] like Figure 4 As shown, system architecture 400 may include terminal devices 401, 402, 403, network 404 and server 405. Network 404 is used to provide a medium for communication links between terminal devices 401, 402, 403 and server 405. Network 404 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0065] Users can use terminal devices 401, 402, 403 to interact with server 405 through network 404 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 401, 402, 403, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).

[0066] The terminal devices 401 , 402 , and 403 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.

[0067] The server 405 may be a server that provides various services, such as a backend management server (only an example) that provides support for shopping websites browsed by users using the terminal devices 401, 402, and 403. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as target push information, product information - only an example) to the terminal device.

[0068] It should be noted that the video playing method provided in the embodiment of the present invention is generally executed by the server 405 , and accordingly, the video playing device is generally disposed in the server 405 .

[0069] It should be understood that Figure 4 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.

[0070] Reference below Figure 5 , which shows a schematic diagram of the structure of a computer system 500 of a terminal device or server suitable for implementing an embodiment of the present application. Figure 5 The terminal device or server shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0071] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0072] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.

[0073] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present application are executed.

[0074] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0075] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0076] The modules involved in the embodiments of the present invention may be implemented in software or hardware. The modules described may also be set in a processor, for example, may be described as: a processor includes a player window process creation module and a video playback control module. The names of these modules do not constitute a limitation on the modules themselves in certain cases. For example, the player window process creation module may also be described as "a module for creating a player window process in response to a player window creation command sent by a web page end, and sending the created player window process to the web page end".

[0077] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: in response to a player window creation command sent by a web page end, creating a player window process, and sending the created player window process to the web page end; after receiving a playback control command sent by the web page end corresponding to the player window process, controlling the player window process to play the video according to the playback control command.

[0078] According to the technical solution of the embodiment of the present invention, in response to the player window creation command sent by the web page end, a player window process is created, and the created player window process is sent to the web page end. After receiving the playback control command issued by the corresponding player window process on the web page end, the player window process is controlled to play the video according to the playback control command. It can achieve low-latency and smooth playback of H.265 format videos on the Web end, support the playback of H.265 format videos with different resolutions and different frame rates, reduce server costs, reduce video stream volume, and reduce network transmission time. After receiving the playback control command, the player window process to be controlled is identified according to the player unique identifier included in the playback control command to control the player window process for video playback, thereby achieving the playback of multiple high-definition H.265 videos controlled separately at multiple random positions in the Web end window, which is suitable for scenarios such as real-time video monitoring.

[0079] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A video playback method, characterized in that: include: In response to the player window creation command sent by the web page end, the CS main control program creates a player window process and sends the created player window process to the web page end; After receiving a playback control command issued by the web page end corresponding to the player window process, controlling the player window process to play the video according to the playback control command; The number of the created player window processes is multiple, and the player window creation command includes a player unique identifier corresponding to the player window process to be controlled; After the CS main control program creates the player window process, the corresponding player unique identifiers are assigned to the multiple player window processes created; after receiving the playback control command issued by the web page corresponding to the player window process, the player window process to be controlled is identified according to the player unique identifier included in the playback control command.

2. The method according to claim 1, characterized in that: The step of creating a player window process in response to a player window creation command sent by the web page end includes: Receive the player window creation command sent by the web page end by establishing a websocket connection, wherein the player window creation command includes the player size corresponding to the player window process and the position of the player on the web page end.

3. The method according to claim 1, characterized in that After receiving the play control command issued by the web page end corresponding to the player window process, controlling the player window process to play the video according to the play control command includes: After receiving the playback control command issued by the web page end corresponding to the player window process, the playback control command is executed, and a reply message corresponding to the playback control command is returned to the web page end according to the execution result of the playback control command, so that the web page end executes the corresponding callback function according to the content of the reply message, and the callback function includes pre-defined operations corresponding to the content of the reply message.

4. The method according to claim 1, characterized in that: The player window process uses C++ language to decode the video obtained from the streaming media server for real-time playback.

5. A video playback device, characterized in that: include: A player window process creation module, which is used to respond to a player window creation command sent by a web page end, and the CS main control program creates a player window process, and sends the created player window process to the web page end; A video playback control module, configured to control the player window process to play the video according to the playback control command after receiving the playback control command issued by the web page end corresponding to the player window process; The number of the created player window processes is multiple, and the player window creation command includes a player unique identifier corresponding to the player window process to be controlled; The identification allocation module is used to: after the CS main control program creates a player window process, allocate the corresponding player unique identification to the created multiple player window processes; The player window process identification module is used to: after receiving the playback control command issued by the web page end corresponding to the player window process, identify the player window process to be controlled according to the player unique identifier included in the playback control command.

6. The device according to claim 5, characterized in that It also includes a player window creation command receiving module, which is used to: Receive the player window creation command sent by the web page end by establishing a websocket connection, wherein the player window creation command includes the player size corresponding to the player window process and the position of the player on the web page end.

7. The device according to claim 5, characterized in that The video playback control module is also used for: After receiving the playback control command issued by the web page end corresponding to the player window process, the playback control command is executed, and a reply message corresponding to the playback control command is returned to the web page end according to the execution result of the playback control command, so that the web page end executes the corresponding callback function according to the content of the reply message, and the callback function includes pre-defined operations corresponding to the content of the reply message.

8. The device according to claim 5, characterized in that The player window process uses C++ language to decode the video obtained from the streaming media server for real-time playback.

9. An electronic device, characterized in that: include: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the method according to any one of claims 1 to 4.

10. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Web plug-in-free security protection real-time video playing method based on HTML5

    CN113556579A

  • Video playing method and device and medium

    CN114285836A

  • Associating browser with application

    US20210105314A1

  • Video playing method and device, electronic equipment and storage medium

    WO2019179264A1