CN115022725A - Video playing method and device - Google Patents

Video playing method and device Download PDF

Info

Publication number
CN115022725A
CN115022725A CN202210574916.2A CN202210574916A CN115022725A CN 115022725 A CN115022725 A CN 115022725A CN 202210574916 A CN202210574916 A CN 202210574916A CN 115022725 A CN115022725 A CN 115022725A
Authority
CN
China
Prior art keywords
player
player window
web page
window process
control command
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210574916.2A
Other languages
Chinese (zh)
Inventor
张召勇
孙瑞龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jingdong City Beijing Digital Technology Co Ltd
Original Assignee
Jingdong City Beijing Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jingdong City Beijing Digital Technology Co Ltd filed Critical Jingdong City Beijing Digital Technology Co Ltd
Priority to CN202210574916.2A priority Critical patent/CN115022725A/en
Publication of CN115022725A publication Critical patent/CN115022725A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/478Supplemental services, e.g. displaying phone caller identification, shopping application
    • H04N21/4782Web browsing, e.g. WebTV
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/443OS processes, e.g. booting an STB, implementing a Java virtual machine in an STB or power management in an STB
    • H04N21/4438Window management, e.g. event handling following interaction with the user interface
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/18Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Human Computer Interaction (AREA)
  • Software Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a video playing method and device, and relates to the technical field of computers. One embodiment of the method comprises: responding to a player window creating command sent by a web page end, creating a player window process, and sending the created player window process to the web page end; and after receiving a play 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 play control command. The implementation method can realize that the H.265 format video can be played at the Web end with low delay and fluency, supports the playing of the H.265 format video with different resolutions and different frame rates, reduces the cost of the server, reduces the volume of the video stream, and reduces the network transmission time.

Description

Video playing method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a video playing method and apparatus.
Background
In the existing video playing scheme, a streaming media server decodes and transcodes a video in an h.265 coding format into a video in an h.264 format, and then transmits the video to a front-end browser for playing. Because h.265 has a higher compression rate than h.264, decoding requires a higher performance requirement, most of the current computer CPU soft decoding (i.e. software decoding) h.265 high-definition video is still more laborious, and hardware compatibility is also not good, so few browsers originally supporting h.265 decoding are available. There are also front-end video components that are played by h.265 decoding with pure js or wasm schemes, but js or wasm performance is significantly weaker than the decoding capability of c language in the browser native video tag < video/>.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
the video transcoding through the streaming media server consumes a large amount of server performance, increases the server cost, and the size of the transcoded video stream is larger, which is not favorable for network transmission of high-definition videos. The decoding of the streaming media server can increase the use cost of the server and the network transmission time, and is not suitable for scenes such as video real-time monitoring. Some existing browser plug-ins only support parsing of the h.264 encoding format, and for the h.265 encoding format with higher definition and higher compression rate, there is no solution for parsing a video stream in real time to play video pictures. The decoding performance of js or wasm components is weak, and multi-channel high-definition H.265 video cannot be played smoothly.
Disclosure of Invention
In view of this, embodiments of the present invention provide a video playing method and apparatus, which can implement low-delay and smooth playing of an h.265 format video at a Web end, support playing of h.265 format videos with different resolutions and different frame rates, implement playing of multiple paths of separately controlled high-definition h.265 videos at multiple random positions of a window at the Web end, reduce server cost, reduce video stream volume, reduce network transmission time, and are suitable for scenes such as video real-time monitoring.
To achieve the above object, according to an aspect of an embodiment of the present invention, a video playing method is provided.
A video playback method, comprising: responding to a player window creating command sent by a web page end, creating a player window process, and sending the created player window process to the web page end; and after receiving a playing 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 playing control command.
Optionally, before creating a player window process in response to a player window creation command sent by the web page side, the method includes: and receiving a player window creating command sent by the web page end through establishing a websocket connection, wherein the player window creating command comprises a player size corresponding to the player window process and a position of a player at the web page end.
Optionally, the player window creation command includes a player unique identifier; the method further comprises the following steps: and after the player window process is created, distributing the corresponding unique player identification for the created player window process.
Optionally, the number of the created player window processes is multiple, and the play control command includes a unique player identifier corresponding to the player window process to be controlled; the method further comprises the following steps: and after receiving a play control command sent by the web page end corresponding to the player window process, identifying the player window process to be controlled according to the unique player identifier included in the play control command.
Optionally, after receiving a play control command sent by the web page end corresponding to the player window process, controlling the player window process to play a video according to the play control command, where the controlling includes: after receiving a play control command sent by the web page end corresponding to the player window process, executing the play control command, and returning a reply message corresponding to the play control command to the web page end according to an execution result of the play control command, so that the web page end executes a corresponding callback function according to the content of the reply message, wherein the callback function comprises predefined operation corresponding to the content of the reply message.
Optionally, the player window process decodes the video obtained from the streaming media server using C + + language for real-time playing.
According to another aspect of the embodiments of the present invention, a video playing device is provided.
A video playback apparatus comprising: the player window process creating module is used for responding to a player window creating command sent by the web page end, creating a player window process and sending the created player window process to the web page end; and the video playing control module is used for controlling the player window process to play video according to the playing control command after receiving the playing control command sent by the web page end corresponding to the player window process.
Optionally, the system further comprises a player window creation command receiving module, configured to: and receiving a player window creating command sent by the web page end through establishing websocket connection, wherein the player window creating command comprises a player size corresponding to the player window process and a position of a player at the web page end.
Optionally, the player window creation command includes a player unique identifier; the apparatus further comprises an identity assignment module to: and after the player window process is created, distributing the corresponding unique player identification for the created player window process.
Optionally, the number of the created player window processes is multiple, and the play control command includes a unique player identifier corresponding to the player window process to be controlled; the apparatus further comprises a player window process identification module configured to: and after receiving a playing control command sent by the web page end corresponding to the player window process, identifying the player window process to be controlled according to the unique player identifier included in the playing control command.
Optionally, the video playback control module is further configured to: after receiving a play control command sent by the web page end corresponding to the player window process, executing the play control command, and returning a reply message corresponding to the play control command to the web page end according to an execution result of the play control command, so that the web page end executes a corresponding callback function according to the content of the reply message, wherein the callback function comprises predefined operation corresponding to the content of the reply message.
Optionally, the player window process decodes the video acquired from the streaming media server using C + + language to play the video in real time.
According to yet another aspect of an embodiment of the present invention, an electronic device is provided.
An electronic device, comprising: one or more processors; a memory for storing one or more programs, which when executed by the one or more processors, cause the one or more processors to implement the video playing method provided by the embodiments of the present invention.
According to yet another aspect of an embodiment of the present invention, a computer-readable medium is provided.
A computer-readable medium, on which a computer program is stored, the computer program, when being executed by a processor, implementing a video playing method provided by an embodiment of the present invention.
One embodiment of the above invention has the following advantages or benefits: and responding to a player window creating command sent by the web page end, creating a player window process, sending the created player window process to the web page end, and after receiving a playing 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 playing control command. The method can realize that the H.265 format video can be played at the Web end with low delay and fluency, supports the playing of the H.265 format video with different resolutions and different frame rates, reduces the cost of the server, reduces the volume of the video stream and reduces the network transmission time. After receiving the playing control command, identifying the player window process to be controlled according to the unique player identifier included in the playing control command so as to control the player window process to play video, thereby realizing the playing of multiple paths of separately controlled high-definition H.265 videos at multiple random positions of a Web window, and being suitable for scenes such as video real-time monitoring.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
fig. 1 is a schematic diagram of the main steps of a video playing method according to an embodiment of the present invention;
FIG. 2 is a functional block diagram of video playback according to one embodiment of the present invention;
FIG. 3 is a schematic diagram of the main modules of a video playback device according to an embodiment of the present invention;
FIG. 4 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 5 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram illustrating the main steps of a video playing method according to an embodiment of the present invention.
As shown in fig. 1, the video playing method of the embodiment of the present invention mainly includes the following steps S101 to S102:
step S101: responding to a player window creating command sent by a web page end, creating a player window process, and sending the created player window process to the web page end;
step S102: and after receiving a playing 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 playing control command.
The web page side is the terminal device (e.g., computer) web page side.
In response to a player window creation command sent by a web page side, before creating a player window process, receiving the player window creation command sent by the web page side through establishing a websocket connection, wherein the player window creation command comprises a player size (such as width and height of a player) of a corresponding player window process and a position of the player at the web page side. A websocket is a protocol for full duplex communication over a single TCP connection.
The player window creation command includes a player unique identification.
After creating the player window process, the created player window process may be assigned a corresponding player unique identifier.
Illustratively, the number of player window processes created is plural.
The playing control command comprises a player unique identification corresponding to the player window process to be controlled.
And after receiving a playing control command sent by the web page end corresponding to the player window process, identifying the player window process to be controlled according to the unique player identification included in the playing control command.
After receiving a play control command sent by a web page end corresponding to a player window process, controlling the player window process to play a video according to the play control command, which specifically comprises the following steps: after receiving a play control command sent by a player window process corresponding to the web page end, executing the play control command, and returning a reply message corresponding to the play control command to the web page end according to an execution result of the play control command, so that the web page end executes a corresponding callback function according to the content of the reply message, wherein the callback function comprises predefined operation corresponding to the content of the reply message. The reply message body may carry fields of uuid, errorCode, etc., uuid is the unique identifier of the player, errorCode indicates the execution result, e.g., errorCode is 0 indicating success, 1 indicating failure, -1 indicating interface call failure (player process without uuid identifier), -2 indicating service parameters are illegal, etc. The web page side judges whether the CS main control program successfully executes the play control command through the errorCode. The callback function is written in the web page end in advance, the invention adopts a plan asynchronous programming solution, and the callback function is two parameters of a plan callback object.
The player window process of the embodiment of the present invention decodes the video acquired from the Streaming media server by using the C + + language to play in Real Time, and the video in the Streaming media server may be obtained by Streaming the video data acquired by the camera through a Real Time Streaming Protocol (RTSP Protocol).
Fig. 2 is a functional block diagram of video playback according to one embodiment of the present invention. As shown in fig. 2, the web page calls the CS master program to create a CS player process in the form of creating an iframe, and specifically, the web page may call the CS master program through a front-end script when the page is initialized. The CS master control program is a program for executing the video playing method according to the embodiment of the present invention, and prompts downloading of the CS player if the CS player is not installed on the terminal device. An iframe is an HTML tag that functions as a document within a document, or a floating FRAME (FRAME). The CS player is client playing software according to an embodiment of the present invention, and includes a CS master control program and a CS player process created by the CS master control program, where the CS player process is a player window process described in the above embodiment, and is a player window process based on websocket communication. The websocket is a protocol for full-duplex communication over a single TCP connection, and is used for bidirectional communication between a web page side and a CS side (i.e., a player side) in the solution of the embodiment of the present invention. The CS master program is an intermediate agent for forwarding the websocket message between the web page side and the CS player process.
promise is a solution for asynchronous programming that is more reasonable and more powerful than conventional solutions to call back functions and events. The web page terminal of the embodiment of the invention actively initiates a websocket request through the premium to establish a link with the CS main control program, thereby controlling the creation, position, size, CS player and stop of the CS player. Specifically, the web page side first sends a createWind command, which is a player window creation command, including information such as width and height of a player, a position, and uuid (player unique identifier, which may be a random unique string code). Meanwhile, the web page side creates a { resolve, reject } callback object with this uuid as a key. uuid may be constant over the life cycle of the CS player process. The CS master program adjusts the player window to the corresponding position of the web page by the corresponding parameters (width and height, position, etc. of the player) in the createWind command. The web page end also carries a randomly generated unique character string code (namely a sequence parameter) when sending the websocket message to the CS player every time, and the CS player carries the sequence parameter when replying the websocket command of the web page end and is used for marking a complete life cycle of the websocket command sent from the web page end to the web page end and received the reply.
After receiving a play control command sent by a web page end corresponding to a player window process, the CS main control program executes the play control command, and then feeds back a reply to the web page end corresponding to the play control command, i.e. a reply message corresponding to the play control command, where the reply message body carries fields of uuid, errorCode, etc., where errorCode, for example, 0 indicates success, 1 indicates failure, 1 indicates interface invocation failure (player process without uuid identification), and 2 indicates that service parameters are illegal, etc. The web page side judges whether the CS main control program successfully executes the play control command through the error code, reads the stored premium callback object { resolve, reject } of which the uuid is key, and executes corresponding resolve or reject, thereby executing the callback corresponding to the premium. The resolve and reject are callback functions, which are two parameters of the plan callback object, and call the resolve function when the asynchronous task is successfully completed and the result is returned, and call the reject function when the asynchronous task fails and the reason for failure is returned. The resolve and reject include predefined operations, for example, if the execution of the play control command is successful (errorCode ═ 0), the predefined buried point statistics operation in the resolve function is executed, and if the execution of the play control command is failed (errorCode ═ 1), the predefined failed interface display operation in the reject function is executed.
The web page side can instantiate the player multiple times through the CS master program, that is: and sending the createWind command through websocket connection for multiple times, creating a CS player process for playing video pictures after the CS main control program receives the createWind command every time, distributing a unique uuid to the CS player process in a monitoring scene, such as a monitoring picture, and sending the uuid to a web page end through websocket callback. The method includes the steps that players instantiated at the web page end correspond to unique fixed uuids, each web page sends playing control commands to a CS main control program through a websocket, the playing control commands carry the corresponding uuids, the CS main control program identifies corresponding CS player processes through the uuids and controls the corresponding CS player processes to respond to the corresponding playing control commands, and therefore the effect that the web pages control a plurality of CS player windows is achieved.
The web page end and the CS player process of the embodiment of the invention can have a one-to-many relationship, and the CS main control program can distribute the unique uuid after the CS player process is established and inform the web page end. And the web page side determines the CS player interacting with the web page side through the unique uuid parameter in the websocket response command of the CS player.
The embodiment of the invention avoids the performance bottleneck in the aspect of language of js/Wasm decoding multi-channel high-definition video, the embodiment of the invention uses C + + for decoding, the decoding performance is more excellent, the CS player decodes and plays in the form of a CS client, js (JavaScript, which is a Web programming language) code at the Web page end is responsible for awakening the CS player and interacts through websocket, js scripts respectively control a plurality of CS player windows to be positioned at different positions of the Web page, and the CS player is responsible for fetching, decoding and playing multi-channel high-definition H.265 video, so that the effect similar to the native video is achieved, and the decoding performance of the embodiment of the invention is higher than that of a js/Wasm decoding scheme. The embodiment of the invention can also realize that the CS player plays videos with various formats and supports various streaming modes, compared with the existing streaming media transcoding mode, the embodiment of the invention can reduce the decoding pressure of the streaming media server more greatly and save the server cost.
Fig. 3 is a schematic diagram of main blocks of a video playback apparatus according to an embodiment of the present invention. As shown in fig. 3, a video playing apparatus 300 according to an embodiment of the present invention mainly includes: a player window process creation module 301 and a video playing control module 302.
A player window process creation module 301, configured 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;
the video playing control module 302 is configured to, after receiving a playing control command sent by the web page corresponding to the player window process, control the player window process to play a video according to the playing control command.
The video playing apparatus 300 further comprises a player window creation command receiving module for: and receiving a player window creating command sent by the web page end through establishing the websocket connection, wherein the player window creating command comprises the player size of the corresponding player window process and the position of the player at the web page end.
The player window creation command includes a player unique identification.
The video playback device 300 further comprises an identifier assignment module configured to: after the player window process is created, the corresponding unique player identification is allocated to the created player window process.
The number of the established player window processes is multiple, and the playing control command comprises a unique player identifier corresponding to the player window process to be controlled;
the video playing apparatus 300 further comprises a player window process identification module, configured to: and after receiving a playing control command sent by the web page end corresponding to the player window process, identifying the player window process to be controlled according to the unique player identification included in the playing control command.
The video playback control module 302 may also be configured to: after receiving a playing control command sent by a web page end corresponding to a player window process, executing the playing control command, and returning a reply message corresponding to the playing control command to the web page end according to an execution result of the playing control command, so that the web page end executes a corresponding callback function according to the content of the reply message, wherein the callback function comprises predefined operation corresponding to the content of the reply message.
The player window process decodes the video acquired from the streaming media server using the C + + language for real-time playing.
In addition, the detailed implementation of the video playing apparatus in the embodiment of the present invention has been described in detail in the above-mentioned video playing method, so that the repeated content will not be described again.
Fig. 4 shows an exemplary system architecture 400 to which the video playing method or video playing apparatus of the embodiments of the present invention can be applied.
As shown in fig. 4, the system architecture 400 may include terminal devices 401, 402, 403, a network 404, and a server 405. The network 404 serves as a medium for providing communication links between the terminal devices 401, 402, 403 and the server 405. Network 404 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use terminal devices 401, 402, 403 to interact with a server 405 over a network 404 to receive or send messages or the like. The terminal devices 401, 402, 403 may have installed thereon various communication client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 401, 402, 403 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 405 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 401, 402, 403. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.
It should be noted that the video playing method provided by the embodiment of the present invention is generally executed by the server 405, and accordingly, the video playing apparatus is generally disposed in the server 405.
It should be understood that the number of terminal devices, networks, and servers in fig. 4 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 5, a block diagram of a computer system 500 suitable for use in implementing a terminal device or server of an embodiment of the present application is shown. The terminal device or the server shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 5, the computer system 500 includes a Central Processing Unit (CPU)501 that 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 section 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the system 500 are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The above-described functions defined in the system of the present application are executed when the computer program is executed by the Central Processing Unit (CPU) 501.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor comprises a player window process creation module and a video playing control module. The names of these modules do not constitute a limitation to the modules themselves in some 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 the web page side and sending the created player window process to the web page side".
As another aspect, the present invention also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be separate and not assembled into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: responding 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; and after receiving a playing 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 playing control command.
According to the technical scheme of the embodiment of the invention, the player window process is created in response to the player window creation command sent by the web page terminal, the created player window process is sent to the web page terminal, and after the playing control command sent by the web page terminal corresponding to the player window process is received, the player window process is controlled to play the video according to the playing control command. The method can realize that the H.265 format video can be played at the Web end with low delay and fluency, supports the playing of the H.265 format video with different resolutions and different frame rates, reduces the cost of the server, reduces the volume of the video stream and reduces the network transmission time. After receiving the playing control command, identifying the player window process to be controlled according to the unique player identifier included in the playing control command so as to control the player window process to play video, thereby realizing the playing of multiple paths of separately controlled high-definition H.265 videos at multiple random positions of a Web window, and being suitable for scenes such as video real-time monitoring.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (14)

1. A video playback method, comprising:
responding 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;
and after receiving a playing 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 playing control command.
2. The method according to claim 1, wherein before creating a player window process in response to a player window creation command sent by a web page side, the method comprises:
and receiving a player window creating command sent by the web page end through establishing websocket connection, wherein the player window creating command comprises a player size corresponding to the player window process and a position of a player at the web page end.
3. The method of claim 1, wherein the player window creation command comprises a player unique identifier; the method further comprises the following steps:
and after the player window process is created, distributing the corresponding unique player identification for the created player window process.
4. The method according to claim 3, wherein the number of the created player window processes is plural, and the playing control command includes a unique player identifier corresponding to the player window process to be controlled;
the method further comprises the following steps:
and after receiving a playing control command sent by the web page end corresponding to the player window process, identifying the player window process to be controlled according to the unique player identifier included in the playing control command.
5. The method according to claim 1, wherein after receiving a play control command issued by the web page end corresponding to the player window process, controlling the player window process to perform video playing according to the play control command, includes:
after receiving a play control command sent by the web page end corresponding to the player window process, executing the play control command, and returning a reply message corresponding to the play control command to the web page end according to an execution result of the play control command, so that the web page end executes a corresponding callback function according to the content of the reply message, wherein the callback function comprises predefined operation corresponding to the content of the reply message.
6. The method of claim 1, wherein the player window process decodes the video obtained from the streaming media server using C + + language for real-time playing.
7. A video playback apparatus, comprising:
the player window process creating module is used for responding to a player window creating command sent by the web page end, creating a player window process and sending the created player window process to the web page end;
and the video playing control module is used for controlling the player window process to play video according to the playing control command after receiving the playing control command sent by the web page end corresponding to the player window process.
8. The apparatus of claim 7, further comprising a player window creation command receiving module configured to:
and receiving a player window creating command sent by the web page end through establishing websocket connection, wherein the player window creating command comprises a player size corresponding to the player window process and a position of a player at the web page end.
9. The apparatus of claim 7, wherein the player window creation command comprises a player unique identifier; the apparatus further comprises an identity assignment module to:
and after the player window process is created, distributing the corresponding unique player identification for the created player window process.
10. The apparatus according to claim 9, wherein the number of the created player window processes is plural, and the play control command includes a unique player identifier corresponding to the player window process to be controlled;
the apparatus further comprises a player window process identification module configured to:
and after receiving a playing control command sent by the web page end corresponding to the player window process, identifying the player window process to be controlled according to the unique player identifier included in the playing control command.
11. The apparatus of claim 7, wherein the video playback control module is further configured to:
after receiving a play control command sent by the web page end corresponding to the player window process, executing the play control command, and returning a reply message corresponding to the play control command to the web page end according to an execution result of the play control command, so that the web page end executes a corresponding callback function according to the content of the reply message, wherein the callback function comprises predefined operation corresponding to the content of the reply message.
12. The apparatus of claim 7, wherein the player window process decodes the video obtained from the streaming media server using C + + language for real-time playing.
13. An electronic device, comprising:
one or more processors;
a memory for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method recited in any of claims 1-6.
14. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-6.
CN202210574916.2A 2022-05-25 2022-05-25 Video playing method and device Pending CN115022725A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210574916.2A CN115022725A (en) 2022-05-25 2022-05-25 Video playing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210574916.2A CN115022725A (en) 2022-05-25 2022-05-25 Video playing method and device

Publications (1)

Publication Number Publication Date
CN115022725A true CN115022725A (en) 2022-09-06

Family

ID=83069769

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210574916.2A Pending CN115022725A (en) 2022-05-25 2022-05-25 Video playing method and device

Country Status (1)

Country Link
CN (1) CN115022725A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117499736A (en) * 2023-12-29 2024-02-02 杭州阿启视科技有限公司 Method for playing front-end camera video by web browser plug-in based on windows operating system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019179264A1 (en) * 2018-03-22 2019-09-26 杭州海康威视数字技术股份有限公司 Video playing method and device, electronic equipment and storage medium
US20210105314A1 (en) * 2018-06-22 2021-04-08 Hangzhou Hikvision System Technology Co., Ltd. Associating browser with application
CN113556579A (en) * 2021-06-07 2021-10-26 武汉众智数字技术有限公司 Method for playing security real-time video without web plug-in based on HTML5
CN114285836A (en) * 2022-03-03 2022-04-05 苏州万店掌网络科技有限公司 Video playing method, device and medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019179264A1 (en) * 2018-03-22 2019-09-26 杭州海康威视数字技术股份有限公司 Video playing method and device, electronic equipment and storage medium
US20210105314A1 (en) * 2018-06-22 2021-04-08 Hangzhou Hikvision System Technology Co., Ltd. Associating browser with application
CN113556579A (en) * 2021-06-07 2021-10-26 武汉众智数字技术有限公司 Method for playing security real-time video without web plug-in based on HTML5
CN114285836A (en) * 2022-03-03 2022-04-05 苏州万店掌网络科技有限公司 Video playing method, device and medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117499736A (en) * 2023-12-29 2024-02-02 杭州阿启视科技有限公司 Method for playing front-end camera video by web browser plug-in based on windows operating system
CN117499736B (en) * 2023-12-29 2024-04-19 杭州阿启视科技有限公司 Method for playing front-end camera video by web browser plug-in based on windows operating system

Similar Documents

Publication Publication Date Title
US10567809B2 (en) Selective media playing method and apparatus according to live streaming and recorded streaming
CN112437122B (en) Communication method, communication device, computer readable medium and electronic equipment
JP4363847B2 (en) Digital TV application protocol for interactive TV
CN112738140B (en) Video stream transmission method, device, storage medium and equipment based on WebRTC
CN112738644B (en) Video stream transmission method and device based on WebRTC
US20180213301A1 (en) Media playback apparatus and method for synchronously reproducing video and audio on a web browser
CN104396263A (en) Methods and systems for real-time transmuxing of streaming media content
CN108063769B (en) Method and device for realizing content service and content distribution network node
EP3267331B1 (en) Method and apparatus for cloud streaming service
CN114040232B (en) Screen projection system, screen projection method, electronic equipment and storage medium
CN113727184B (en) Video playing method, device, system, storage medium and electronic equipment
CN107509086B (en) Video redirection method and device under cloud desktop
CN112243158B (en) Media file processing method and device, computer readable medium and electronic equipment
CN114040245B (en) Video playing method and device, computer storage medium and electronic equipment
CN115022725A (en) Video playing method and device
CN113079386B (en) Video online playing method and device, electronic equipment and storage medium
CN110113298A (en) Data transmission method, device, signal server and computer-readable medium
CN108712434A (en) A kind of implementation method based on the HD video live streaming recorded broadcast meeting consultation of doctors
EP4117294A1 (en) Method and device for adjusting bit rate during live streaming
CN116112476A (en) Multimedia playing method, system, equipment and storage medium of cloud desktop
WO2016107174A1 (en) Method and system for processing multimedia file data, player and client
CN113055714B (en) Video information processing method, device, equipment and storage medium
CN112738056B (en) Encoding and decoding method and system
CN106998365B (en) Audio and video processor, intelligent teaching device, intelligent teaching system and method
CN116781977A (en) Video playing method, device, equipment, storage medium and product based on webpage

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination