Search

CN-122027830-A - Video playing method, device, electronic equipment, storage medium and program product

CN122027830ACN 122027830 ACN122027830 ACN 122027830ACN-122027830-A

Abstract

The invention discloses a video playing method, a video playing device, electronic equipment, a storage medium and a program product. The method comprises the steps of receiving a video playing instruction sent by WEB terminal equipment, obtaining a real-time streaming protocol RTSP video stream corresponding to the video playing instruction, decoding the RTSP video stream to obtain intermediate video data, dividing the intermediate video data according to a first appointed duration to obtain a plurality of video fragments, determining coding parameters corresponding to the video fragments according to current network parameters and current bandwidth of the WEB terminal equipment for any video fragment, coding the video fragments by utilizing the coding parameters to obtain coded video fragments, packaging the coded video fragments into files in a target format, and sending the files to the WEB terminal equipment for playing. Therefore, the RTSP video stream can be converted into a file which can be played by the WEB terminal equipment without installing any plug-in, and the video is segmented, so that the low delay of video playing is ensured.

Inventors

  • WANG TENGFEI
  • YANG LI
  • Xi Zekun
  • WEI KANG

Assignees

  • 鸿湖万联(江苏)科技发展有限公司

Dates

Publication Date
20260512
Application Date
20260211

Claims (10)

  1. 1. A video playing method, the method comprising: receiving a video playing instruction sent by a WEB WEB terminal device, and acquiring a real-time streaming protocol (RTSP) video stream corresponding to the video playing instruction; Decoding the RTSP video stream to obtain intermediate video data; Dividing the intermediate video data according to a first appointed duration to obtain a plurality of video fragments; The method comprises the steps of determining coding parameters corresponding to any video fragment according to current network parameters and current bandwidth of WEB terminal equipment, coding the video fragment by utilizing the coding parameters to obtain coded video fragments, and packaging the coded video fragments into a file in a target format, wherein the network parameters are used for representing the stability of the current network of the WEB terminal equipment, and the target format is a WEB-friendly streaming media format; And sending the files to the WEB terminal equipment for playing.
  2. 2. The method of claim 1, wherein after the sending the plurality of files to the WEB terminal device for playing, the method further comprises: acquiring the current bandwidth and the current network parameters of the WEB terminal equipment every second designated time length; determining a target coding parameter according to the current bandwidth and the current network parameter; and if the target coding parameters are different from the coding parameters corresponding to the video fragments in the current playing file, acquiring a target video file corresponding to the target coding parameters, and sending the target video file to the WEB terminal equipment for playing, wherein the target video file is obtained by coding the video fragments in the current playing file according to the target coding parameters.
  3. 3. The method of claim 2, wherein said determining a target coding parameter based on said current bandwidth and said current network parameter comprises: And determining a target playing parameter corresponding to the current triggering index by utilizing the preset corresponding relation between each triggering index and each coding parameter, wherein the triggering index comprises a bandwidth and a network parameter, and the current triggering index comprises the current bandwidth and the current network parameter.
  4. 4. The method according to claim 1, wherein the determining the coding parameters corresponding to the video slices according to the current network parameters and the current bandwidth of the WEB terminal device includes: Determining a playing parameter corresponding to the current triggering index by utilizing the preset corresponding relation between each triggering index and each coding parameter, and determining the playing parameter as the coding parameter corresponding to the video slicing, wherein the triggering index comprises a bandwidth and a network parameter, and the current triggering index comprises the current bandwidth and the current network parameter.
  5. 5. The method of claim 1, wherein the video playing instruction includes a shooting device identifier; After receiving the video playing instruction sent by the WEB terminal equipment, the method further comprises the following steps: acquiring a user identifier corresponding to the video playing instruction; Determining a target access white list corresponding to the user identification by utilizing a preset corresponding relation between the user identification and the access white list; if the shooting equipment identifier in the video playing instruction is in the target access white list, executing a step of acquiring a real-time streaming protocol (RTSP) video stream corresponding to the video playing instruction; And if the shooting equipment identifier in the video playing instruction is not in the target access white list, rejecting the video playing instruction.
  6. 6. A video playback device, the device comprising: The acquisition module is used for receiving a video playing instruction sent by the world wide WEB WEB terminal equipment and acquiring a real-time streaming protocol RTSP video stream corresponding to the video playing instruction; the decoding module is used for decoding the RTSP video stream to obtain intermediate video data; the segmentation module is used for segmenting the intermediate video data according to a first appointed duration to obtain a plurality of video fragments; The encoding module is used for determining encoding parameters corresponding to the video fragments according to the current network parameters and the current bandwidth of the WEB terminal equipment aiming at any video fragment, encoding the video fragments by utilizing the encoding parameters to obtain encoded video fragments, and packaging the encoded video fragments into a file in a target format, wherein the network parameters are used for representing the stability of the current network of the WEB terminal equipment, and the target format is a WEB-friendly streaming media format; and the sending module is used for sending the files to the WEB terminal equipment for playing.
  7. 7. The apparatus of claim 6, wherein the encoding module is further configured to: Determining a playing parameter corresponding to the current triggering index by utilizing the preset corresponding relation between each triggering index and each coding parameter, and determining the playing parameter as the coding parameter corresponding to the video slicing, wherein the triggering index comprises a bandwidth and a network parameter, and the current triggering index comprises the current bandwidth and the current network parameter.
  8. 8. An electronic device, the electronic device comprising: at least one processor, and A memory communicatively coupled to the at least one processor, wherein, The memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the video playback method of any one of claims 1-5.
  9. 9. A computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, the computer instructions for causing a processor to perform the video playback method of any one of claims 1-5.
  10. 10. A computer program product, characterized in that the computer program product comprises a computer program which, when executed by a processor, implements the video playback method according to any one of claims 1-5.

Description

Video playing method, device, electronic equipment, storage medium and program product Technical Field The present invention relates to the field of video processing, and in particular, to a video processing method, apparatus, electronic device, storage medium, and program product. Background In intelligent construction such as mine scenes, a large number of devices such as monitoring cameras supporting RTSP (REAL TIME STREAMING Protocol) video streams are deployed. However, the RTSP video stream cannot be directly played in a universal WEB browser, because modern browsers generally do not support directly parsing RTSP protocols any more, and need to rely on browser plug-ins or specific client software, which greatly limits the convenience and universality of real-time video monitoring at the WEB end for users. Especially in the field of mines and the like which have extremely high requirements on safe production, the realization of low-delay real-time video preview of the WEB end without installing additional plug-ins is very important. Disclosure of Invention The embodiment of the invention provides a video playing method, a device, electronic equipment, a storage medium and a program product, which are used for realizing automatic conversion of an RTSP video stream into a video which can be played at a WEB end, and have the advantages of no need of installing additional plug-ins, low delay and improvement of the real-time performance of video playing. According to an aspect of the embodiment of the present invention, there is provided a video playing method, applied to a server, the method including: Receiving a video playing instruction sent by WEB terminal equipment, and acquiring a real-time streaming protocol (RTSP) video stream corresponding to the video playing instruction; Decoding the RTSP video stream to obtain intermediate video data; Dividing the intermediate video data according to a first appointed duration to obtain a plurality of video fragments; The method comprises the steps of determining coding parameters corresponding to any video fragment according to current network parameters and current bandwidth of WEB terminal equipment, coding the video fragment by utilizing the coding parameters to obtain coded video fragments, and packaging the coded video fragments into a file in a target format, wherein the network parameters are used for representing the stability of the current network of the WEB terminal equipment, and the target format is a WEB-friendly streaming media format; And sending the files to the WEB terminal equipment for playing. According to another aspect of an embodiment of the present invention, there is provided a video playing device, including: the acquisition module is used for receiving a video playing instruction sent by the WEB terminal equipment and acquiring a real-time streaming protocol (RTSP) video stream corresponding to the video playing instruction; the decoding module is used for decoding the RTSP video stream to obtain intermediate video data; the segmentation module is used for segmenting the intermediate video data according to a first appointed duration to obtain a plurality of video fragments; The encoding module is used for determining encoding parameters corresponding to any video fragment according to current network parameters and current bandwidth of the WEB terminal equipment, encoding the video fragment by utilizing the encoding parameters to obtain an encoded video fragment, and packaging the encoded video fragment into a file in a target format, wherein the network parameters are used for representing the stability of the current network of the WEB terminal equipment, and the target format is a WEB-friendly streaming media format; and the sending module is used for sending the files to the WEB terminal equipment for playing. According to another aspect of an embodiment of the present invention, there is provided a server including: at least one processor, and A memory communicatively coupled to the at least one processor, wherein, The memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the video playing method according to any one of the embodiments of the present invention. According to another aspect of the embodiments of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to implement the video playing method according to any one of the embodiments of the present invention. According to another aspect of embodiments of the present invention, there is also provided a computer program product comprising a computer program which, when executed by a processor, implements the steps of the video playing method according to any of the embodiments of the present invention. According to the technical scheme, the RTSP video stream is decoded to obtain intermediate video data by acquiring the real-time st