CN114866810A - Streaming video downloading method and device, storage medium and electronic device - Google Patents

Streaming video downloading method and device, storage medium and electronic device Download PDF

Info

Publication number
CN114866810A
CN114866810A CN202210786048.4A CN202210786048A CN114866810A CN 114866810 A CN114866810 A CN 114866810A CN 202210786048 A CN202210786048 A CN 202210786048A CN 114866810 A CN114866810 A CN 114866810A
Authority
CN
China
Prior art keywords
target
service
video
request
streaming video
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
CN202210786048.4A
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.)
Zhejiang Huachuang Video Signal Technology Co Ltd
Original Assignee
Zhejiang Huachuang Video Signal 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 Zhejiang Huachuang Video Signal Technology Co Ltd filed Critical Zhejiang Huachuang Video Signal Technology Co Ltd
Priority to CN202210786048.4A priority Critical patent/CN114866810A/en
Publication of CN114866810A publication Critical patent/CN114866810A/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/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • H04N21/234309Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements by transcoding between formats or standards, e.g. from MPEG-2 to MPEG-4 or from Quicktime to Realvideo
    • 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/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/14Systems for two-way working
    • H04N7/15Conference systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/14Systems for two-way working
    • H04N7/15Conference systems
    • H04N7/152Multipoint control units therefor
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/14Systems for two-way working
    • H04N7/15Conference systems
    • H04N7/155Conference systems involving storage of or access to video conference sessions

Landscapes

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

Abstract

The embodiment of the invention provides a streaming video downloading method, a streaming video downloading device, a storage medium and an electronic device, wherein the method comprises the following steps: the method comprises the steps that a first service receives a first request of a client, wherein the first request is sent after the client receives a first trigger instruction, the first request is used for requesting transcoding of a target streaming video indicated by target video information, and the first request comprises target parameters of the target streaming video; the first service calls a target downloading program based on the target parameters to indicate the target downloading program to initiate a second request to the second service, wherein the second request is used for indicating the second service to transmit the target streaming video to the target downloading program and indicating the target downloading program to convert the target streaming video into a target video file and write the target streaming video file into a first storage area for the client to download. The invention solves the problem that plug-ins are required to be used for downloading the streaming files by using the browser in the related art.

Description

Streaming video downloading method and device, storage medium and electronic device
Technical Field
The embodiment of the invention relates to the technical field of data processing, in particular to a streaming video downloading method and device, a storage medium and an electronic device.
Background
The video conference system comprises a MCU (multipoint control unit, namely a video conference server) and various participating devices such as a soft terminal, a hard terminal, a recording and broadcasting server and the like. The terminals collect image and sound and send the image and sound to the MCU through coding, the MCU fuses or does not fuse the images sent by the terminals according to the conference requirements, and the sound is sent to each participating terminal after mixing or not mixing, thereby realizing the audio and video conversation of the multi-party participants. And for some important meetings, the video is required to be opened for future reference or training courseware making. In order to utilize the advantages of non-attenuation, random slicing, no fragmentation and the like of the performance of a streaming File System, in the related art, a CQFS (Circular Queue File System) is used for storing conference videos, and the CQFS File System stores conference audio and video streams instead of video files. In recent severe economic situation of the world, many enterprises or institutions in China accelerate the process of purchasing and replacing the localized software and hardware. In a homemade PC operating system environment, if a browser plug-in scheme is used to download a streaming-stored video file, great technical difficulties will exist. Namely, the problem that the related art needs to rely heavily on the plug-in when downloading the streaming file in the browser exists.
Aiming at the problem that the downloading of the streaming file in the related art needs to depend on a plug-in, an effective solution is not provided at present.
Disclosure of Invention
The embodiment of the invention provides a streaming video downloading method, a streaming video downloading device, a storage medium and an electronic device, which are used for at least solving the problem that downloading a streaming file in the related art needs to depend on a plug-in.
According to an embodiment of the present invention, there is provided a streaming video download method, including: a first service receives a first request of a client, wherein the first request is sent after the client receives a first trigger instruction, the first request is used for requesting to transcode a target streaming video indicated by target video information, and the first request comprises target parameters of the target streaming video; and the first service calls a target downloading program based on the target parameters to indicate the target downloading program to initiate a second request to a second service, wherein the second request is used for indicating the second service to transmit the target streaming video to the target downloading program and indicating the target downloading program to convert the target streaming video into a target video file and write the target streaming video file into a first storage area for the client to download.
In an exemplary embodiment, the first service invoking a target downloading program based on the target parameter to instruct the target downloading program to initiate a second request to a second service includes: constructing a target Uniform Resource Locator (URL) by the first service based on the target parameter, wherein the target URL is used for indicating the position of the target streaming video in a second storage area; and the first service calls the target downloading program by inputting the target URL into the target downloading program so as to instruct the target downloading program to initiate the second request to the second service.
In one exemplary embodiment, after the first service receives the first request of the client, the method further includes: the first service creates a target directory in the first storage area, wherein the target directory is used for storing the target video file; the first service invoking the target downloading program by inputting the target URL into the target downloading program to instruct the target downloading program to initiate the second request to the second service comprises: and the first service calls the target downloading program by inputting the target URL and the target directory into the target downloading program, so as to instruct the target downloading program to request the second service to transmit the target streaming video to the target downloading program, and instruct the target downloading program to convert the target streaming video into the target video file and write the target streaming video into the target directory.
In one exemplary embodiment, the method further comprises: the first service receives a third request sent by the client, where the third request is used to request to obtain a target state parameter of the target streaming video, where the target state parameter includes a conversion state of the target streaming video and target timestamp information of current frame data, and the current frame data is frame data currently being converted and included in the target streaming video; the first service returns the target state parameter to the client based on the third request.
In one exemplary embodiment, the returning, by the first service, the target state parameter to the client based on the third request includes: the first service acquires the target state parameter from a target state file based on the third request, wherein the target state file is a file constructed by the target downloading program based on a target directory, the target directory is created in the first storage area by the first service based on the target parameter and is input to the target downloading program, and the target state parameter is determined by the target downloading program based on a conversion process of the target streaming video and is written into the target state file after the first service calls the target downloading program; the first service returns the target state parameter to the client; the conversion status includes a first status, a second status and a third status, where the first status is used to indicate a status that the target streaming video is in conversion, the second status is used to indicate a status that the target streaming video has been converted, and the third status is used to indicate a status that the target streaming video has failed to be converted.
In one exemplary embodiment, the method further comprises: the first service acquires a target video file list from a target directory under the condition that the target streaming video is determined to be converted and completed based on the target state parameter, wherein the target video file list comprises one or more target video files, and the target directory is used for storing the one or more target video files; the first service generates a target address list based on the target video file list, wherein the target address list comprises one or more target addresses corresponding to the target video files; the first service returns the target address list to the client, instructs the client to display the target address list, and sends the target video file to the client under the condition that the first service receives a first downloading instruction, wherein the first downloading instruction is sent after the client receives a second triggering instruction.
In one exemplary embodiment, the returning, by the first service, the target state parameter to the client based on the third request includes: and the first service returns the target state parameter to the client to indicate the client to determine a target conversion progress based on the target timestamp information and the target parameter, and the target conversion progress is displayed on the client.
In one exemplary embodiment, after the first service receives the first request of the client, the method further includes: and returning a second target address list to the client for downloading by the client under the condition that the first service determines that the target video file corresponding to the target parameter exists in the first storage area, wherein the second target address list is generated by the first service based on the target video file.
In one exemplary embodiment, the target parameters include: the target identification of the target streaming video, the target start time of the target streaming video and the target end time of the target streaming video.
According to another embodiment of the present invention, there is also provided a streaming video downloading method, including: a target downloading program receives a second call instruction of a first service, wherein the second call instruction is sent after the first service receives a first request of a client, the first request is sent after the client receives a first trigger instruction, the first request is used for requesting transcoding of a target streaming video indicated by target video information, and the first request comprises a target parameter of the target streaming video; the target downloading program initiates a second request to a second service based on the second calling instruction so as to request the second service to transmit the target streaming video to the target downloading program; and the target downloading program receives the target streaming video, converts the target streaming video into a target video file and writes the target video file into a first storage area so as to be downloaded by the client.
In an exemplary embodiment, after the target downloading program receives the second call instruction of the first service, the method further includes: the target downloading program requests the second service to transmit the target streaming video to the target downloading program based on a target Uniform Resource Locator (URL) included in the second calling instruction, wherein the target URL is constructed by the first service based on the target parameter, and the target URL is used for indicating the position of the target streaming video in a second storage area; and the target downloading program receives the target streaming video, converts the target streaming video into the target video file and writes the target video file into a target directory for the client to download, wherein the target directory is created in the first storage area by the first service after receiving the first request, and the target directory is used for storing the target video file.
In an exemplary embodiment, the target downloading program initiates a second request to a second service to request the second service to transmit the target streaming video to the target downloading program, including: the target downloading program sets a target transmission rate; and the target downloading program initiates the second request to the second service to request the second service to transmit the target streaming video to the target downloading program according to the target transmission rate.
In one exemplary embodiment, the method further comprises: the target downloading program checks target state parameters of the target streaming video according to a predetermined period, wherein the target state parameters include a conversion state of the target streaming video and target timestamp information of current frame data, the conversion state includes a first state, a second state and a third state, the first state is used for indicating a state in which the target streaming video is being converted, the second state is used for indicating a state in which the target streaming video is already converted, the third state is used for indicating a state in which the target streaming video is failed to be converted, and the current frame data is current conversion frame data included in the target streaming video; the target downloading program writes the target state parameters into a target state file to indicate that the first service returns the target state parameters to the client when receiving a third request sent by the client, wherein the third request is used for requesting to acquire the target state parameters of the target streaming video, the target state file is a file constructed by the target downloading program based on a target directory, and the target directory is created by the first service in the first storage area based on the target parameters and input to the target downloading program.
In one exemplary embodiment, the target parameters include: the target identification of the target streaming video, the target start time of the target streaming video and the target end time of the target streaming video.
According to another embodiment of the present invention, there is provided a streaming video downloading apparatus, located in a first service, including: a first receiving module, configured to receive a first request of a client, where the first request is sent after the client receives a first trigger instruction, the first request is used to request to transcode a target streaming video indicated by target video information, and the first request includes a target parameter of the target streaming video; and the first processing module is used for calling a target downloading program based on the target parameters so as to instruct the target downloading program to initiate a second request to a second service, wherein the second request is used for instructing the second service to transmit the target streaming video to the target downloading program and instructing the target downloading program to convert the target streaming video into a target video file and write the target streaming video into a first storage area for the client to download.
According to another embodiment of the present invention, there is also provided a streaming video downloading apparatus, located in a target downloading program, including: a second receiving module, configured to receive a second call instruction of a first service, where the second call instruction is sent after the first service receives a first request of a client, the first request is sent after the client receives a first trigger instruction, the first request is used to request transcoding of a target streaming video indicated by target video information, and the first request includes a target parameter of the target streaming video; a request module, configured to initiate a second request to a second service based on the second call instruction, so as to request the second service to transmit the target streaming video to the target downloading program; and the second processing module is used for receiving the target streaming video, converting the target streaming video into a target video file and writing the target video file into a first storage area for the client to download.
According to a further embodiment of the present invention, there is also provided a computer-readable storage medium having a computer program stored thereon, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
According to yet another embodiment of the present invention, there is also provided an electronic device, including a memory in which a computer program is stored and a processor configured to execute the computer program to perform the steps in any of the above method embodiments.
According to the method and the device, a first service receives a first request of a client, wherein the first request is used for requesting transcoding of the target streaming video, the first request comprises target parameters of the target streaming video, the first service calls a target downloading program based on the target parameters to indicate the target downloading program to initiate a second request to a second service, request the second service to transmit the target streaming video to the target downloading program, and indicate the target downloading program to convert the target streaming video into a target video file and write the target streaming video file into a first storage area for the client to download. The purpose of downloading the streaming video without depending on a plug-in is achieved. Therefore, the problem that plug-ins are required to be used for downloading the streaming file by using the browser in the related technology is solved, and the effect of improving the applicability of the streaming video downloading method is achieved.
Drawings
Fig. 1 is a block diagram of a hardware structure of a mobile terminal of a streaming video downloading method according to an embodiment of the present invention;
fig. 2 is a flow chart of a streaming video download method according to an embodiment of the present invention;
FIG. 3 is a flow diagram of another streaming video download method according to an embodiment of the present invention;
fig. 4 is a diagram of a streaming video download system architecture according to an embodiment of the present invention;
FIG. 5 is a diagram of an example of a private frame header of a media stream according to an embodiment of the invention;
FIG. 6 is a diagram illustrating an example of a video recording storage format in a CQFS file system according to an embodiment of the present invention;
FIG. 7 is an exemplary diagram of a CQFS streaming according to an embodiment of the present invention;
FIG. 8 is a flowchart of a method for plug-in-less download of streaming video according to an embodiment of the present invention;
fig. 9 is a block diagram of a streaming video download apparatus according to an embodiment of the present invention;
fig. 10 is a block diagram of another streaming video download apparatus according to an embodiment of the present invention.
Detailed Description
Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings in conjunction with the embodiments.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
The method embodiments provided in the embodiments of the present application may be executed in a mobile terminal, a computer terminal, or a similar computing device. Taking the mobile terminal as an example, fig. 1 is a block diagram of a hardware structure of the mobile terminal of the streaming video downloading method according to the embodiment of the present invention. As shown in fig. 1, the mobile terminal may include one or more (only one shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA), and a memory 104 for storing data, wherein the mobile terminal may further include a transmission device 106 for communication functions and an input-output device 108. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration, and does not limit the structure of the mobile terminal. For example, the mobile terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store computer programs, for example, software programs and modules of application software, such as a computer program corresponding to the streaming video downloading method in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, so as to implement the method described above. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the mobile terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a Network adapter (NIC), which can be connected to other Network devices through a base station so as to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
In this embodiment, a streaming video downloading method is provided, and fig. 2 is a flowchart of a streaming video downloading method according to an embodiment of the present invention, as shown in fig. 2, the flowchart includes the following steps:
step S202, a first service receives a first request of a client, wherein the first request is sent after the client receives a first trigger instruction, the first request is used for requesting transcoding of a target streaming video indicated by target video information, and the first request comprises a target parameter of the target streaming video;
step S204, the first service invokes a target downloading program based on the target parameter to instruct the target downloading program to initiate a second request to a second service, where the second request is used to instruct the second service to transmit the target streaming video to the target downloading program, and instruct the target downloading program to convert the target streaming video into a target video file and write the target streaming video into a first storage area, so that the target streaming video is downloaded by the client.
Through the steps, a first service receives a first request of a client, wherein the first request is used for requesting transcoding of a target streaming video, the first request comprises target parameters of the target streaming video, the first service calls a target downloading program based on the target parameters to indicate the target downloading program to initiate a second request to a second service, request the second service to transmit the target streaming video to the target downloading program, and indicate the target downloading program to convert the target streaming video into a target video file and write the target streaming video file into a first storage area for downloading by the client. The purpose of downloading the streaming video without depending on a plug-in is achieved. Therefore, the problem that plug-ins are required to be used for downloading the streaming file by using the browser in the related technology is solved, and the effect of improving the applicability of the streaming video downloading method is achieved.
The main body of the above steps may be a server, or an application service included in the server, for example, the first service, or a web server, or a processor with human-computer interaction capability configured on a storage device, or a processing device or a processing unit with similar processing capability, but is not limited thereto. The following description is given by taking the first service as an example (which is only an exemplary description, and in actual operation, other devices or modules may also perform the above operation).
In the foregoing embodiment, the first service receives a first request of a client, where the first request is sent after the client receives a first trigger instruction, the first request is used to request transcoding of a target streaming video indicated by target video information, the first request includes target parameters of the target streaming video, for example, the client is a web server or a mobile terminal, the first service is a web server, the first trigger instruction may be an instruction generated after a user clicks or touches target video information related to the target streaming video on the web terminal, the target video information may be presented on the web terminal in the form of a tag or a control or a link or a picture, the target streaming video is an audio and video stream stored in a CQFS file system, for example, a conference video in a video conference system is stored in the CQFS file system, or, in the field of video monitoring application, storing multimedia data streams collected by a camera device (a camera, a gunlock, a dome camera, or the like) in a CQFS file system, wherein the target parameters can include an identifier of a target streaming video and start time and end time of the target streaming video, and the target parameters can be called transcoding request parameters, namely the identifier, the start time and the end time of a video clip; then, the first service calls a target downloading program based on the target parameter to instruct the target downloading program to initiate a second request to the second service, wherein the second request is used for instructing the second service to transmit a target streaming video to the target downloading program and instructing the target downloading program to convert the target streaming video into a target video file and write the target video file into a first storage area for downloading by the client, for example, the first service calls the target downloading program by inputting the target parameter into the target downloading program, the target downloading program can request the second service to transmit the target streaming video based on the target parameter, for example, the second service can be a streaming media server, the target downloading program can start an RTSP client, and initiate an audio and video stream playback request to the second service by an RTSP protocol, that is, request the second service to transmit an audio and video stream to the target downloading program, and the target downloading program receives the target streaming video, the target video stream is converted into a video File with a standard format and stored in a first storage area, for example, the first storage area may be a File System EXT4 (Fourth generation Extended File System), and EXT4 may be a temporary File System, so that when a user clicks a download portal at a web browser end, the corresponding video File may be downloaded from the first storage area, and the target video File may include one or more video files. The purpose of downloading the streaming video without depending on a plug-in is achieved. Therefore, the problem that plug-ins are required to be used for downloading the streaming file by using the browser in the related technology is solved, and the effect of improving the applicability of the streaming video downloading method is achieved.
In an optional embodiment, the first service invoking a target downloading program based on the target parameter to instruct the target downloading program to initiate a second request to a second service includes: constructing a target Uniform Resource Locator (URL) by the first service based on the target parameter, wherein the target URL is used for indicating the position of the target streaming video in a second storage area; and the first service calls the target downloading program by inputting the target URL into the target downloading program so as to instruct the target downloading program to initiate the second request to the second service. In this embodiment, the first service may construct a target URL based on target parameters, that is, construct an rstp URL downloaded by a target streaming video (or called a video clip), where the target parameters may include a stream ID, a start timestamp, and an end timestamp of the video clip, the target streaming video is stored in a second storage area, for example, the second storage area is a CQFS file system, and the first service inputs the target parameters into a target downloading program to call the target downloading program and instructs the target downloading program to initiate a second request to the second service. By the embodiment, the purposes of constructing the target URL based on the target parameters and calling the target downloading program are achieved.
In an optional embodiment, after the first service receives the first request of the client, the method further comprises: the first service creates a target directory in the first storage area, wherein the target directory is used for storing the target video file; the first service invoking the target downloading program by inputting the target URL into the target downloading program to instruct the target downloading program to initiate the second request to the second service comprises: and the first service calls the target downloading program by inputting the target URL and the target directory into the target downloading program, so as to instruct the target downloading program to request the second service to transmit the target streaming video to the target downloading program, and instruct the target downloading program to convert the target streaming video into the target video file and write the target streaming video into the target directory. In this embodiment, after receiving the first request, the first service may further create a target directory in the first storage area, where the target directory is used to store a target video file, and optionally, a name of the target directory may include the target parameters, such as a stream ID, a start timestamp, and an end timestamp of the video segment, and when invoking the target downloading program, the first service may input a target URL and the target directory into the target downloading program to invoke the target downloading program, so that after transcoding the target streaming video, the target video file may be stored in the target directory for the user to download at the client; optionally, in practical applications, when the target URL and the target directory are input to the target downloading program, the first service may further input a target path prefix of the video storage, so that the target downloading program constructs a storage path of the video file based on the target directory and the target path prefix, for example, the target directory is "/data", and the target path prefix is "8312", so that the file name "8312 _1.mp 4" or "8312 _2.mp 4" or other file after the target downloading program converts the target streaming video into the target video file, that is, the complete path is "/data/8312 _1.mp 4"; furthermore, the target downloading program may also obtain the type of the data stream, such as the presentation stream or the video main stream, from the audio/video frame data transmitted by the second service, and when a storage path of the video file is constructed, include the stream type in the name of the storage path, so that the video files corresponding to the presentation stream or the video main stream may be written into the corresponding storage paths, respectively; optionally, in an actual application, when a user sets a slicing policy at a web browser end, for example, a target streaming video needs to be sliced into a plurality of segments, and a target downloading program generates segment indexes (or called file marks) corresponding to different segments when converting the target streaming video, such as the above 8312_1 and 8312_2, which respectively represent the first segment and the second segment, so that the user can more conveniently request to transcode or download the required video segments. Through the embodiment, the purpose of creating the target directory is achieved, and the purpose of storing the transcoded target video file in the target directory is achieved.
In an optional embodiment, the method further comprises: the first service receives a third request sent by the client, where the third request is used to request to obtain a target state parameter of the target streaming video, where the target state parameter includes a conversion state of the target streaming video and target timestamp information of current frame data, and the current frame data is frame data currently being converted and included in the target streaming video; the first service returns the target state parameter to the client based on the third request. In this embodiment, the first service may further receive a third request sent by the client to request to acquire a target state parameter of the target streaming video, for example, whether the target streaming video is converted or not, or timestamp information of frame data of the target streaming video currently being converted (or timestamp information of a latest frame), and the first service returns the target state parameter to the client. By the embodiment, the purpose of returning the target state parameter of the target streaming video to the client based on the third request sent by the client is achieved.
In an optional embodiment, the returning, by the first service, the target state parameter to the client based on the third request includes: the first service acquires the target state parameter from a target state file based on the third request, wherein the target state file is a file constructed by the target downloading program based on a target directory, the target directory is created in the first storage area by the first service based on the target parameter and is input to the target downloading program, and the target state parameter is determined by the target downloading program based on a conversion process of the target streaming video and is written into the target state file after the first service calls the target downloading program; the first service returns the target state parameter to the client; the conversion status includes a first status, a second status and a third status, where the first status is used to indicate a status that the target streaming video is in conversion, the second status is used to indicate a status that the target streaming video has been converted, and the third status is used to indicate a status that the target streaming video has failed to be converted. In this embodiment, the first service may obtain the target status parameter from a target status file based on the third request, the target status file being a file constructed by the target downloading program based on the target directory, in practical application, when the first service inputs the target directory into the target downloading program, a target file prefix can also be simultaneously input, so that the target downloading program constructs a path of the video download status file based on the target directory and the target file prefix, the target status file is used to store information of the conversion status of the target streaming video, for example, the conversion status is "converting" (or "in progress"), or "completed", or "failed" (or "conversion failed"), and the target status parameter is determined by the target downloading program during the transcoding process of the target streaming video, and the target status parameter is written into the target status file by the target downloading program. By the embodiment, the aim of acquiring the target state parameters and returning the target state parameters to the client is fulfilled.
In an optional embodiment, the method further comprises: the first service acquires the target video file from a target directory under the condition that the target streaming video is determined to be converted and completed based on the target state parameter, wherein the target video file list comprises one or more target video files, and the target directory is used for storing the one or more target video files; the first service generates a target address list based on the target video file list, wherein the target address list comprises one or more target addresses corresponding to the target video files; the first service returns the target address list to the client, instructs the client to display the target address list, and sends the target video file to the client under the condition that the first service receives a first downloading instruction, wherein the first downloading instruction is sent after the client receives a second triggering instruction. In this embodiment, when the first service determines that the target streaming video is converted to be complete, for example, when the first service determines that the target state parameter of the target streaming video is "complete" (corresponding to the second state), a target video file list may be obtained from the target directory, where the target video file list may include one or more target video files, and then a target address list may be generated based on the target video file list, for example, when the target streaming video has a large capacity, for example, the target streaming video is a 3-hour or 5-hour or 8-hour conference video, when transcoding the target streaming video to a standard video file, multiple video files may be generated for storage, then, the first service returns the target address list to the client, the client may display the address list to facilitate downloading by the user, when the target video file list includes multiple target files, the client also displays a plurality of target addresses, so that the user can download each target video file respectively. By the embodiment, the purpose of generating the video downloading address list and returning the video downloading address list to the client for downloading after the target streaming video transcoding is determined to be completed is achieved.
In an optional embodiment, the returning, by the first service, the target state parameter to the client based on the third request includes: and the first service returns the target state parameter to the client to indicate the client to determine a target conversion progress based on the target timestamp information and the target parameter, and the target conversion progress is displayed on the client. In this embodiment, after the first service returns the target state parameter to the client, the client may determine a target conversion progress, for example, the conversion progress is 60% or 80% according to the start time and the end time of the target streaming video and the target timestamp information of the current frame data included in the target state parameter, so that the user can know the conversion condition of the current target streaming video more intuitively, and the user experience is further improved.
In an optional embodiment, after the first service receives the first request of the client, the method further comprises: and returning a second target address list to the client for downloading by the client under the condition that the first service determines that the target video file corresponding to the target parameter exists in the first storage area, wherein the second target address list is generated by the first service based on the target video file. In this embodiment, after receiving the first request, when it is determined that the target video file corresponding to the target parameter already exists in the first storage area, the first service may directly return the download address list corresponding to the target video file to the client, so that the user may directly download the file, thereby implementing a multiplexing mechanism for transcoding the video file that has been completed.
In an alternative embodiment, the target parameters include: the target identification of the target streaming video, the target start time of the target streaming video and the target end time of the target streaming video. In this embodiment, the target parameter of the target video stream may include an identifier (e.g., a stream ID), a start time, and an end time of the target video stream.
In this embodiment, another streaming video downloading method is further provided, and fig. 3 is a flowchart of another streaming video downloading method according to an embodiment of the present invention, as shown in fig. 3, the flowchart includes the following steps:
step S302, a target downloading program receives a second call instruction of a first service, where the second call instruction is sent after the first service receives a first request of a client, the first request is sent after the client receives a first trigger instruction, the first request is used to request transcoding of a target streaming video indicated by target video information, and the first request includes a target parameter of the target streaming video;
step S304, the target downloading program initiates a second request to a second service based on the second call instruction, so as to request the second service to transmit the target streaming video to the target downloading program;
step S306, the target downloading program receives the target streaming video, converts the target streaming video into a target video file, and writes the target video file into a first storage area, so that the client downloads the target video file.
Through the steps, the target downloading program receives a second call instruction of the first service, wherein the second call instruction is sent by the first service after receiving a first request sent by the client for transcoding the target streaming video, the first request comprises target parameters of the target streaming video, then the target downloading program sends a second request to the second service based on the second call instruction to request the second service to transmit the target streaming video to the target downloading program, and the target streaming program receives the target streaming video, converts the target streaming video into a target video file and writes the target streaming video file into the first storage area for the client to download. The purpose of downloading the streaming video without depending on a plug-in is achieved. Therefore, the problem that plug-ins are required to be used for downloading the streaming file by using the browser in the related technology is solved, and the effect of improving the applicability of the streaming video downloading method is achieved.
The execution subject of the above steps may be a server, or an application program included in the server, for example, the above target downloading program, or a processor with human-computer interaction capability configured on a storage device, or a processing device or a processing unit with similar processing capability, and the like, but is not limited thereto. The following description will be given by taking the target downloading program as an example (which is only an exemplary description, and in actual operation, other devices or modules may also be used to perform the above operations):
in the above embodiment, the target downloading program receives a second call instruction of the first service, where the second call instruction is issued after the first service receives a first request of the client, the first request is issued after the client receives a first trigger instruction, the first request is used to request transcoding of a target streaming video indicated by the target video information, the first request includes target parameters of the target streaming video, for example, the client is a web server or a mobile terminal, the first service is a web server, the first trigger instruction may be an instruction generated after a user clicks or touches target video information related to the target streaming video on the web terminal, the target video information may be presented on the web terminal in the form of a tag, a control, a link, or a picture, and the target streaming video is an audio/video stream stored in a CQFS file system, for example, storing conference videos in a video conference system in a CQFS file system, or, in the field of video monitoring applications, storing multimedia data streams collected by a camera device (a camera, a gunshot, a dome camera, or the like) in the CQFS file system, where the target parameters may include an identifier of a target streaming video, start time and end time of the target streaming video, the target parameters may be called transcoding request parameters, which are equivalent to identifiers, start time and end time of video segments, the second call instruction includes target parameters, and the first service may call a target downloading program by inputting the target parameters into the target downloading program; then, the target downloading program initiates a second request to a second service based on a second call instruction to request the second service to transmit the target streaming video to the target downloading program, for example, the second service may be a streaming media server, the target downloading program may start an RTSP client, and initiate an audio/video stream playback request to the second service through an RTSP protocol, that is, request the second service to transmit the audio/video stream to the target downloading program; and the target downloading program receives the target streaming video, converts the target streaming video into a target video file and writes the target video file into a first storage area for downloading by the client. For example, the target downloading program receives a target streaming video, converts the target streaming video into a video File with a standard format, and stores the video File in a first storage area, where the first storage area may be an EXT4 (Fourth generation Extended File System) File System, and EXT4 may be a temporary File System, so that when a user clicks a download portal at a web browser end, a corresponding video File may be downloaded from the first storage area, and the target video File may include one or more video files. The purpose of downloading the streaming video without depending on a plug-in is achieved. Therefore, the problem that plug-ins are required to be used for downloading the streaming file by using the browser in the related technology is solved, and the effect of improving the applicability of the streaming video downloading method is achieved.
In an optional embodiment, after the target downloading program receives the second call instruction of the first service, the method further includes: the target downloading program requests the second service to transmit the target streaming video to the target downloading program based on a target Uniform Resource Locator (URL) included in the second calling instruction, wherein the target URL is constructed by the first service based on the target parameter, and the target URL is used for indicating the position of the target streaming video in a second storage area; and the target downloading program receives the target streaming video, converts the target streaming video into the target video file and writes the target video file into a target directory for the client to download, wherein the target directory is created in the first storage area by the first service after receiving the first request, and the target directory is used for storing the target video file. In this embodiment, after receiving the second call instruction, the target downloading program may request the second service to transmit the target streaming video based on the target URL included in the second call instruction, so that after the target downloading program transcodes the target streaming video, the target video file may be stored in the target directory for the user to download at the client. By the embodiment, the purpose of requesting the second service to transmit the target streaming video based on the target URL is achieved, and the purpose of storing the transcoded target video file in the target directory is achieved.
In an optional embodiment, the target downloading program initiates a second request to a second service to request the second service to transmit the target streaming video to the target downloading program, including: the target downloading program sets a target transmission rate; and the target downloading program initiates the second request to the second service to request the second service to transmit the target streaming video to the target downloading program according to the target transmission rate. In this embodiment, the target downloading program may set a target transmission rate (or called playback rate), for example, a configurable fast playback speed (e.g., 128 times, or other speed), and the target transmission rate may be adjusted as needed to quickly transmit the target streaming video. Through the embodiment, the purpose of setting the target transmission rate to transmit the target streaming video is achieved.
In an optional embodiment, the method further comprises: the target downloading program checks target state parameters of the target streaming video according to a predetermined period, wherein the target state parameters include a conversion state of the target streaming video and target timestamp information of current frame data, the conversion state includes a first state, a second state and a third state, the first state is used for indicating a state in which the target streaming video is being converted, the second state is used for indicating a state in which the target streaming video is already converted, the third state is used for indicating a state in which the target streaming video is failed to be converted, and the current frame data is current conversion frame data included in the target streaming video; the target downloading program writes the target state parameters into a target state file to indicate that the first service returns the target state parameters to the client when receiving a third request sent by the client, wherein the third request is used for requesting to acquire the target state parameters of the target streaming video, the target state file is a file constructed by the target downloading program based on a target directory, and the target directory is created by the first service in the first storage area based on the target parameters and input to the target downloading program. In this embodiment, the target downloading program may be configured to periodically check the target status parameter of the target streaming video, for example, check the target status parameter every 2 seconds (or 3 seconds, or other period), and write the target status parameter into the target status file, so that when the first service receives a request from the client to obtain the transcoding status of the target streaming video, the target status parameter may be returned to the client. By the embodiment, the purpose of periodically checking the transcoding state of the target streaming video is achieved, and the purpose of writing the target state parameters into the target state file by the target downloading program and returning the target state parameters to the client by the first service so that the client can obtain the transcoding state in time is also achieved.
In an alternative embodiment, the target parameters include: the target identification of the target streaming video, the target start time of the target streaming video and the target end time of the target streaming video. In this embodiment, the target parameter of the target video stream may include an identifier (e.g., a stream ID), a start time, and an end time of the target video stream.
It is to be understood that the above-described embodiments are only a few, but not all, embodiments of the present invention. The present invention will be described in detail with reference to examples.
An embodiment of the present invention provides a streaming video downloading system, and fig. 4 is an architecture diagram of a streaming video downloading system according to an embodiment of the present invention, including: recorded and live broadcast service 402 (corresponding to the second service), streaming downloader 404 (corresponding to the target downloader), recorded WEB service 406 (corresponding to the first service), WEB browser 408 (corresponding to the client), CQFS file system 410 (long-term) corresponding to the second storage area, EXT4 file system 412 (temporary) corresponding to the first storage area. The following description will take a video conference recording and playing system as an example.
Common video conference media stream types are shown in table 1, with media stream SSRC generating rules, SSRC = media stream producer ID 10 + media stream type.
Figure DEST_PATH_IMAGE002AAA
FIG. 5 is an exemplary diagram of a private frame header of a media stream, where the key field datetime is system wall time for video indexing and video lookup, according to an embodiment of the invention; the key field pts is system monotonic clock time and is used for synchronously sending and synchronously playing video and audio; the audio frame contains audio coding format information, and the video key frame contains extended information such as resolution, frame rate, coding format and the like.
Fig. 6 shows a video storage format in the CQFS file system 410, and fig. 6 is an exemplary diagram of a video storage format in a CQFS file system according to an embodiment of the present invention; CQFS streaming storage content fig. 7 is a diagram illustrating a CQFS streaming according to an embodiment of the present invention, and fig. 7 is a diagram illustrating an example of a CQFS streaming.
Of course, the above system can also be applied to a video monitoring system, for example, multimedia data streams collected by a camera (a camera, or a gunlock, or a ball machine, etc.) are stored in a CQFS file system, and multimedia streaming video can also be downloaded through a browser without a plug-in.
The logic or functions of the other components in the above system are described separately below.
1. Recorded broadcast and live broadcast service logic
(1) Providing a streaming media playback service based on a streaming media protocol (such as an RTSP protocol), and realizing that streaming media data is obtained from a CQFS file system and sent to a streaming media client;
(2) the streaming media playback supports double-speed fast playback, and the range can be set to be 1X to 128X times;
(3) and providing browser plug-in-free audio and video stream playback service, wherein the protocol comprises HLS, HTTPFLV, WEBRTC and the like.
2. Streaming download program streamDownloader logic
(1) Inputting an RTSP URL address, wherein the address represents a video conference recording segment;
(2) inputting a video storage path prefix for constructing a video file path recordFile and a video download state file path recordStatus;
(3) initializing the video downloading state file by using a video downloading state file path recordStatus, and writing the downloading initial state into 'in progress';
(4) initializing a standard video file writing module, and opening a video file by using a recordFile, wherein a video file is respectively opened by a presentation stream and a video main stream;
(5) starting an RTSP client, and initiating a video playback request of an RTSP protocol to a recording and broadcasting and live broadcasting service;
(6) setting the playback rate to a configurable fast playback multiple speed (e.g., 128 times) for fast playback of the video;
(7) receiving audio and video frame data sent by recorded broadcast and live broadcast services, comprising:
1) calling a standard video file writing module, and writing audio and video frame data into a video file, wherein the video file comprises a video file corresponding to a demonstration stream and a video main stream;
2) recording the wall time stamp of the current latest frame of audio and video frame data;
(8) the RTSP client status is checked at a time interval (e.g. 2 seconds), specifically:
1) if not, writing the state 'in progress' into the video downloading state file recordStatus, and writing the latest frame of the time stamp on the wall;
2) if the recording is finished, writing the state 'finished' into the recording download state file recordStatus, and writing the latest frame of wall timestamp;
3) if an error is reported, writing the state 'failed' into the video downloading state file recordStatus, and writing the latest frame of time stamp on the wall;
(9) closing the RTSP client after the stream receiving is finished;
(10) calling a video file writing module, writing source data, closing all currently opened video files, and generating a complete video file with a standard format;
(11) and (6) ending.
3. Recorded broadcast web service logic
(1) Providing a video clip information query interface for a web browser, and returning the stream ID, the start timestamp and the end timestamp of the video clip stored in the CQFS file system to the web browser;
(2) providing a video transcoding interface for a web browser to realize transcoding of video clip audio/video stream in a CQFS file system into a video file (such as MP 4) in a standard format, including:
1) according to the web video transcoding request parameter, constructing rtspURL of video downloading, including stream ID, start time stamp and end time stamp of video segment, IP using loop network device IP, thereby avoiding leaving the outlet network, for example: rtsp// 127.0.0.1/vod/2811/1634627939/1634628011;
2) creating a special directory recordPath in a set EXT4 file system (temporary storage), wherein the directory name comprises a stream ID, a start timestamp and an end timestamp of a video clip, and is used for storing a transcoded video file;
3) calling a streamDownloader command line of a streaming downloading program, transmitting parameters rtspURL and recordPath, and starting to download transcoding;
(3) a video transcoding status acquisition interface is provided to the web browser,
1) constructing a recordStatus file name according to the stream ID, the start timestamp and the end timestamp of the video clip;
2) returning the file writing state in the recordStatus file and the latest frame of wall timestamp to the browser;
3) when the file writing state is 'finished', acquiring all video files under the recordPath, generating a video downloading address list and returning the video downloading address list to the browser;
(4) providing a video downloading interface, reading the standard video files stored in the EXT4 file system (temporary storage) and returning the standard video files to the browser;
(5) periodically checking the remaining space of the EXT4 file system (temporary storage), and triggering the deletion operation of the video files from old to new when the remaining space is less than 20 percent so as to release the temporary storage space;
(6) a video file multiplexing mechanism with completed transcoding is realized, if the video files corresponding to the stream ID, the start timestamp and the end timestamp requested by the user are transcoded and exist, the video files are directly returned to a video downloading list, and the transcoding step is skipped;
(7) the concurrent number limitation of the video transcoding task is realized, and the problem of video data loss during video storage caused by the exhaustion of the disk performance during downloading is avoided;
(8) the downloading speed limit of the standard video file after transcoding is realized, and the bandwidth of a recording and broadcasting server is prevented from being exhausted by a video downloading request;
4. recorded web browser side logic
(1) Calling a video clip information query interface of the web service, displaying the video clip information query interface on a page, providing online playback or transcoding downloading, and providing a 'transcoding' inlet for triggering transcoding of a video at a server side;
(2) the received video segments are further sliced, and the following strategies can be selected:
1) automatic slicing, namely cutting a video clip every 2 hours in order to avoid overlarge generated video files in formats such as MP4 and the like, and providing each slice for a user to carry out transcoding and downloading respectively; for example, a video segment of 5 hours is automatically divided into three video segments of 2 hours, 2 hours and 1 hour for transcoding and downloading;
2) manually selecting the segments, selecting a segment of video returned by the web service, then providing manual selection of the video starting time and the video ending time within the range of the segment, and providing a user with transcoding and downloading as a segment after selection;
(3) when a user clicks a transcoding entrance, a video transcoding interface of the web service is called, a stream ID, a start timestamp and an end timestamp corresponding to a video fragment are sent to the web service, and transcoding is started;
(4) the video transcoding state acquisition interface for periodically calling the web service comprises the following steps:
1) acquiring a file writing state and a latest frame of wall timestamp, generating a transcoding progress (the value range is 0-100%) according to three values of a starting timestamp, the latest frame of timestamp and an ending timestamp, and displaying the transcoding state and progress on a page;
2) when transcoding is completed, acquiring a video file list after transcoding, and displaying a video list and a downloading inlet;
(5) when a user selects a video file and clicks a download inlet, a video download interface of the web service is called to download the video file from the video recording server to the browser end;
(6) and after all the generated video files are downloaded to the browser end from the recording and broadcasting server, the process is ended.
The above description is made on the recording and broadcasting service, the streaming download program, the recording and broadcasting web service, the logic of the web browser, and the functions of the CQFS file system and the EXT4 file system included in the above system.
An embodiment of the present invention provides a method for downloading a streaming video without plug-in, where fig. 8 is a flowchart of a method for downloading a streaming video without plug-in according to an embodiment of the present invention, where the flowchart includes:
s802, the web browser calls a video recording segment information query interface of the recorded and broadcast web service; for example, the video clip information can be inquired by searching the key words; optionally, in practical application, the required video clip information may also be searched for by turning a page at the web browser side, instead of through a query means;
s804, the recording and playing web service returns the information (for example, including the stream ID, the start timestamp and the end timestamp information of the video clip) of the video clip stored in the CQFS file system to the web browser;
s806, providing an online playback or transcoding entrance for the web browser page;
the recording and playing web service provides a video transcoding interface for the web browser to transcode the video clip audio/video stream in the CQFS file system into a video file with a standard format (such as MP 4);
s808, clicking a transcoding inlet by a user, calling a video transcoding interface of the recorded and broadcasted web service, and sending a stream ID, a start timestamp and an end timestamp corresponding to a video segment to the recorded and broadcasted web service;
in practical application, before the user clicks the transcoding entrance, the user may set a processing policy for the received video segment, for example, automatically slicing or manually selecting the segment;
s810, the recorded and broadcast web service calls a streaming downloading program;
s812, the streaming download program starts an RTSP client, and initiates a video playback request of an RTSP protocol to the recorded broadcast and live broadcast service;
the recorded broadcast and live broadcast service provides streaming media playback service based on a streaming media protocol (such as RTSP protocol), and realizes that streaming media data is obtained from a CQFS file system and is sent to a streaming media client (such as the RTSP client);
s814, writing the state into the video downloading state file, ending the stream receiving, and generating a video file with a standard format;
in step S814, the streaming download program periodically checks the status of the RTSP client in the audio/video frame data sent by the recording and broadcasting and live broadcasting service, and writes the corresponding status into the recording download status file recordStatus;
the recording and broadcasting web service can provide a video transcoding state acquisition interface for the web browser, and the file writing state in the recordStatus file and the timestamp on the latest frame wall are returned to the browser, so that a user can acquire the transcoding state of the video at the browser end;
in practical application, a web browser end can periodically call a video transcoding state acquisition interface of a web service to acquire a file writing state and a latest frame wall timestamp, and then a transcoding progress of a video segment can be obtained by combining a start timestamp and an end timestamp of the video segment, such as 80%, 50%, 100% and the like;
when the streaming download program writes the status "completed" into the record download status file recordPath, the recording and broadcasting web service can acquire all the record files under the recordPath, generate a record download address list and return the list to the browser, namely, step S816 is performed;
s816, the recording and broadcasting web service generates a recording and downloading address list and returns the recording and downloading address list to the web browser;
s818, the user selects a video file and clicks a download entrance, and the video download interface of the recorded web service is called to download the video file with the standard format to the browser end.
In the embodiment, the video segment and the refined slice are inquired on the browser, transcoding of the server is triggered, then the streaming downloading program is started on the recording and broadcasting server, the RTSP protocol request is initiated to quickly playback, the audio and video stream in the CQFS file system is downloaded and dumped into the video file with the standard format, and then the video file is provided for the browser to download the standard video file, so that the technical problem that the video in the streaming file system CQFS can not be downloaded without using the browser and without plug-in is solved.
Compared with the scheme in the related technology, the embodiment of the invention has the following advantages: 1) the video clip in the streaming file system CQFS can be downloaded by using a general web browser without special application software and special browser plug-ins. Therefore, the video conference streaming video storage scheme is adaptive to a domestic operating system, and the scheme compatibility is greatly improved; 2) when the video is downloaded, automatic slicing or manual time window slicing can be further optionally refined, and important video data can be selected for downloading according to needs by a user, so that the waiting time for downloading the video is shortened, the disk space occupation of a video file is reduced, and the post-processing manufacturing complexity is reduced; the online clipping function of the conference audio and video recording is realized to a certain extent; 3) the transcoding process realized here is a process of reading and dumping the audio and video stream in the CQFS file system into a standard format video file, does not relate to secondary coding of a video coding format, and only changes the video packaging format, so compared with transcoding and synthesizing video in a comparison file, the hardware cost is much lower, the hardware requirement is much lower, and the hardware cost of the recording and broadcasting system is saved; 4) audio and video stream data in a CQFS file system are stored for a long time, and transcoded standard video files are temporarily stored for a short time, so that the space overhead of a disk is reduced, and video data serving as an original material can be stored for a long time for long-term tracing; 5) the CQFS file system instance is started only by the recording and broadcasting and live broadcasting service all the time, so that the same IO queue is used for processing the video downloading request and the video storage request. Meanwhile, the concurrent number limitation of the video transcoding task is realized, so that the problem that the video data are lost due to the failure of video storage caused by video downloading is avoided.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
In this embodiment, a streaming video downloading device is further provided, which is located in the first service, and fig. 9 is a block diagram of a structure of a streaming video downloading device according to an embodiment of the present invention, as shown in fig. 9, the device includes:
a first receiving module 902, configured to receive a first request of a client, where the first request is sent after the client receives a first trigger instruction, the first request is used to request to transcode a target streaming video indicated by target video information, and the first request includes a target parameter of the target streaming video;
a first processing module 904, configured to invoke a target downloading program based on the target parameter, so as to instruct the target downloading program to initiate a second request to a second service, where the second request is used to instruct the second service to transmit the target streaming video to the target downloading program, and instruct the target downloading program to convert the target streaming video into a target video file and write the target streaming video into a first storage area, so as to be downloaded by the client.
In an alternative embodiment, the first processing module 904 includes: a constructing unit, configured to construct a target uniform resource locator URL based on the target parameter, wherein the target URL is used to indicate a location of the target streaming video in a second storage area; the first processing unit is used for calling the target downloading program by inputting the target URL into the target downloading program so as to instruct the target downloading program to initiate the second request to the second service.
In an optional embodiment, the apparatus further comprises: the creating module is used for creating a target directory in the first storage area after receiving a first request of a client, wherein the target directory is used for storing the target video file; the first processing unit includes: a first processing subunit, configured to invoke the target downloading program by inputting the target URL and the target directory into the target downloading program, to instruct the target downloading program to request the second service to transmit the target streaming video to the target downloading program, and to instruct the target downloading program to convert the target streaming video into the target video file and write the target streaming video into the target directory.
In an optional embodiment, the apparatus further comprises: a third receiving module, configured to receive a third request sent by the client, where the third request is used to request to obtain a target state parameter of the target streaming video, where the target state parameter includes a conversion state of the target streaming video and target timestamp information of current frame data, where the current frame data is frame data that is currently being converted and included in the target streaming video; a first returning module, configured to return the target state parameter to the client based on the third request.
In an optional embodiment, the first returning module includes: a first obtaining unit, configured to obtain the target state parameter from a target state file based on the third request, where the target state file is a file constructed by the target downloading program based on a target directory created in the first storage area by the first service based on the target parameter and input to the target downloading program, and the target state parameter is determined based on a conversion process of the target streaming video and written in the target state file after the first service calls the target downloading program and instructs the target downloading program to determine and write the target status file; the first returning unit is used for returning the target state parameter to the client; the conversion status includes a first status, a second status and a third status, where the first status is used to indicate a status that the target streaming video is in conversion, the second status is used to indicate a status that the target streaming video has been converted, and the third status is used to indicate a status that the target streaming video has failed to be converted.
In an optional embodiment, the apparatus further comprises: a first obtaining module, configured to obtain a target video file list from a target directory when it is determined that the target streaming video is converted based on the target state parameter, where the target video file list includes one or more target video files, and the target directory is used to store the one or more target video files; a generating module, configured to generate a target address list based on the target video file list, where the target address list includes one or more target addresses corresponding to the target video files; and the second returning module is used for returning the target address list to the client, instructing the client to display the target address list, and sending the target video file to the client under the condition that the first service receives a first downloading instruction, wherein the first downloading instruction is sent after the client receives a second triggering instruction.
In an optional embodiment, the first returning module includes: and the second processing unit is used for returning the target state parameter to the client so as to instruct the client to determine a target conversion progress based on the target timestamp information and the target parameter, and displaying the target conversion progress on the client.
In an optional embodiment, the apparatus further comprises: and a third processing module, configured to, after a first service receives a first request of a client and when it is determined that the target video file corresponding to the target parameter exists in the first storage area, return a second target address list to the client for downloading by the client, where the second target address list is generated by the first service based on the target video file.
In an alternative embodiment, the target parameters include: the target identification of the target streaming video, the target start time of the target streaming video and the target end time of the target streaming video.
In this embodiment, another streaming video downloading device is further provided, and is located in a target downloading program, and fig. 10 is a block diagram of a structure of another streaming video downloading device according to an embodiment of the present invention, as shown in fig. 10, the device includes:
a second receiving module 1002, configured to receive a second call instruction of a first service, where the second call instruction is sent after the first service receives a first request of a client, the first request is sent after the client receives a first trigger instruction, the first request is used to request to transcode a target streaming video indicated by target video information, and the first request includes a target parameter of the target streaming video;
a requesting module 1004, configured to initiate a second request to a second service based on the second call instruction, so as to request the second service to transmit the target streaming video to the target downloading program;
the second processing module 1006 is configured to receive the target streaming video, convert the target streaming video into a target video file, and write the target video file into the first storage area, so that the target streaming video can be downloaded by the client.
In an optional embodiment, the apparatus further comprises: a second request module, configured to, after a target downloading program receives a second call instruction of a first service, request the second service to transmit the target streaming video to the target downloading program based on a target uniform resource locator URL included in the second call instruction, where the target URL is constructed by the first service based on the target parameter, and the target URL is used to indicate a location of the target streaming video in a second storage area; a fourth processing module, configured to receive the target streaming video, convert the target streaming video into the target video file, and write the target video file into a target directory for the client to download, where the target directory is created in the first storage area by the first service after receiving the first request, and the target directory is used to store the target video file.
In an alternative embodiment, the request module 1004 includes: a setting unit for setting a target transmission rate; and the request unit is used for initiating the second request to the second service so as to request the second service to transmit the target streaming video to the target downloading program according to the target transmission rate.
In an optional embodiment, the apparatus further comprises: the checking module is configured to check a target state parameter of the target streaming video according to a predetermined period, where the target state parameter includes a conversion state of the target streaming video and target timestamp information of current frame data, the conversion state includes a first state, a second state and a third state, the first state is used to indicate a state in which the target streaming video is being converted, the second state is used to indicate a state in which the target streaming video has been converted, the third state is used to indicate a state in which the target streaming video has failed to be converted, and the current frame data is frame data included in the target streaming video that is currently being converted; a fifth processing module, configured to write the target status parameter into a target status file, so as to indicate that the first service returns the target status parameter to the client when receiving a third request sent by the client, where the third request is used to request to acquire the target status parameter of the target streaming video, the target status file is a file constructed by the target downloading program based on a target directory, and the target directory is created in the first storage area by the first service based on the target parameter and is input to the target downloading program.
In an alternative embodiment, the target parameters include: the target identification of the target streaming video, the target start time of the target streaming video and the target end time of the target streaming video.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
Embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program is arranged to perform the steps of any of the above-mentioned method embodiments when executed.
In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
In an exemplary embodiment, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary embodiments, and details of this embodiment are not repeated herein.
It will be apparent to those skilled in the art that the various modules or steps of the invention described above may be implemented using a general purpose computing device, they may be centralized on a single computing device or distributed across a network of computing devices, and they may be implemented using program code executable by the computing devices, such that they may be stored in a memory device and executed by the computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into various integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the principle of the present invention should be included in the protection scope of the present invention.

Claims (18)

1. A method for downloading streaming video, comprising:
a first service receives a first request of a client, wherein the first request is sent after the client receives a first trigger instruction, the first request is used for requesting to transcode a target streaming video indicated by target video information, and the first request comprises target parameters of the target streaming video;
and the first service calls a target downloading program based on the target parameters to indicate the target downloading program to initiate a second request to a second service, wherein the second request is used for indicating the second service to transmit the target streaming video to the target downloading program and indicating the target downloading program to convert the target streaming video into a target video file and write the target streaming video file into a first storage area for the client to download.
2. The method of claim 1, wherein the first service invoking a target downloading program based on the target parameter to instruct the target downloading program to initiate a second request to a second service comprises:
constructing a target Uniform Resource Locator (URL) by the first service based on the target parameter, wherein the target URL is used for indicating the position of the target streaming video in a second storage area;
and the first service calls the target downloading program by inputting the target URL into the target downloading program so as to instruct the target downloading program to initiate the second request to the second service.
3. The method of claim 2,
after the first service receives the first request of the client, the method further includes: the first service creates a target directory in the first storage area, wherein the target directory is used for storing the target video file;
the first service invoking the target downloading program by inputting the target URL into the target downloading program to instruct the target downloading program to initiate the second request to the second service comprises: and the first service calls the target downloading program by inputting the target URL and the target directory into the target downloading program, so as to instruct the target downloading program to request the second service to transmit the target streaming video to the target downloading program, and instruct the target downloading program to convert the target streaming video into the target video file and write the target streaming video into the target directory.
4. The method of claim 1, further comprising:
the first service receives a third request sent by the client, where the third request is used to request to obtain a target state parameter of the target streaming video, where the target state parameter includes a conversion state of the target streaming video and target timestamp information of current frame data, and the current frame data is frame data currently being converted and included in the target streaming video;
the first service returns the target state parameter to the client based on the third request.
5. The method of claim 4, wherein the first service returns the target state parameter to the client based on the third request, comprising:
the first service acquires the target state parameter from a target state file based on the third request, wherein the target state file is a file constructed by the target downloading program based on a target directory, the target directory is created in the first storage area by the first service based on the target parameter and is input to the target downloading program, and the target state parameter is determined by the target downloading program based on a conversion process of the target streaming video and is written into the target state file after the first service calls the target downloading program;
the first service returns the target state parameter to the client;
the conversion status includes a first status, a second status and a third status, where the first status is used to indicate a status that the target streaming video is in conversion, the second status is used to indicate a status that the target streaming video has been converted, and the third status is used to indicate a status that the target streaming video has failed to be converted.
6. The method of claim 5, further comprising:
the first service acquires a target video file list from a target directory under the condition that the target streaming video is determined to be converted and completed based on the target state parameter, wherein the target video file list comprises one or more target video files, and the target directory is used for storing the one or more target video files;
the first service generates a target address list based on the target video file list, wherein the target address list comprises one or more target addresses corresponding to the target video files;
the first service returns the target address list to the client, instructs the client to display the target address list, and sends the target video file to the client under the condition that the first service receives a first downloading instruction, wherein the first downloading instruction is sent after the client receives a second triggering instruction.
7. The method of claim 4, wherein the first service returns the target state parameter to the client based on the third request, comprising:
and the first service returns the target state parameter to the client to indicate the client to determine a target conversion progress based on the target timestamp information and the target parameter, and the target conversion progress is displayed on the client.
8. The method of claim 1, wherein after the first service receives the first request from the client, the method further comprises:
and returning a second target address list to the client for downloading by the client under the condition that the first service determines that the target video file corresponding to the target parameter exists in the first storage area, wherein the second target address list is generated by the first service based on the target video file.
9. The method according to any one of claims 1-8, wherein the target parameters include:
the target identification of the target streaming video, the target start time of the target streaming video and the target end time of the target streaming video.
10. A method for downloading streaming video, comprising:
a target downloading program receives a second call instruction of a first service, wherein the second call instruction is sent after the first service receives a first request of a client, the first request is sent after the client receives a first trigger instruction, the first request is used for requesting transcoding of a target streaming video indicated by target video information, and the first request comprises a target parameter of the target streaming video;
the target downloading program initiates a second request to a second service based on the second calling instruction so as to request the second service to transmit the target streaming video to the target downloading program;
and the target downloading program receives the target streaming video, converts the target streaming video into a target video file and writes the target video file into a first storage area so as to be downloaded by the client.
11. The method of claim 10, wherein after the target downloading program receives the second call instruction of the first service, the method further comprises:
the target downloading program requests the second service to transmit the target streaming video to the target downloading program based on a target Uniform Resource Locator (URL) included in the second calling instruction, wherein the target URL is constructed by the first service based on the target parameter, and the target URL is used for indicating the position of the target streaming video in a second storage area;
and the target downloading program receives the target streaming video, converts the target streaming video into the target video file and writes the target video file into a target directory for the client to download, wherein the target directory is created in the first storage area by the first service after receiving the first request, and the target directory is used for storing the target video file.
12. The method of claim 10, wherein the target downloading program initiates a second request to a second service to request the second service to transmit the target streaming video to the target downloading program comprises:
the target downloading program sets a target transmission rate;
and the target downloading program initiates the second request to the second service to request the second service to transmit the target streaming video to the target downloading program according to the target transmission rate.
13. The method of claim 10, further comprising:
the target downloading program checks target state parameters of the target streaming video according to a predetermined period, wherein the target state parameters include a conversion state of the target streaming video and target timestamp information of current frame data, the conversion state includes a first state, a second state and a third state, the first state is used for indicating a state in which the target streaming video is being converted, the second state is used for indicating a state in which the target streaming video is already converted, the third state is used for indicating a state in which the target streaming video is failed to be converted, and the current frame data is current conversion frame data included in the target streaming video;
the target downloading program writes the target state parameters into a target state file to indicate that the first service returns the target state parameters to the client when receiving a third request sent by the client, wherein the third request is used for requesting to acquire the target state parameters of the target streaming video, the target state file is a file constructed by the target downloading program based on a target directory, and the target directory is created by the first service in the first storage area based on the target parameters and input to the target downloading program.
14. The method according to any one of claims 10-13, wherein the target parameters include:
the target identification of the target streaming video, the target start time of the target streaming video and the target end time of the target streaming video.
15. A streaming video download apparatus in a first service, comprising:
a first receiving module, configured to receive a first request of a client, where the first request is sent after the client receives a first trigger instruction, the first request is used to request to transcode a target streaming video indicated by target video information, and the first request includes a target parameter of the target streaming video;
and the first processing module is used for calling a target downloading program based on the target parameter so as to instruct the target downloading program to initiate a second request to a second service, wherein the second request is used for instructing the second service to transmit the target streaming video to the target downloading program, and instructing the target downloading program to convert the target streaming video into a target video file and write the target streaming video into a first storage area so as to be downloaded by the client.
16. A streaming video download device in a target download program, comprising:
a second receiving module, configured to receive a second call instruction of a first service, where the second call instruction is sent after the first service receives a first request of a client, the first request is sent after the client receives a first trigger instruction, the first request is used to request transcoding of a target streaming video indicated by target video information, and the first request includes a target parameter of the target streaming video;
a request module, configured to initiate a second request to a second service based on the second call instruction, so as to request the second service to transmit the target streaming video to the target downloading program;
and the second processing module is used for receiving the target streaming video, converting the target streaming video into a target video file and writing the target video file into a first storage area for the client to download.
17. A computer-readable storage medium, in which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 9 or 10 to 14.
18. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method as claimed in any one of claims 1 to 9 or 10 to 14 are implemented when the computer program is executed by the processor.
CN202210786048.4A 2022-07-06 2022-07-06 Streaming video downloading method and device, storage medium and electronic device Pending CN114866810A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210786048.4A CN114866810A (en) 2022-07-06 2022-07-06 Streaming video downloading method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210786048.4A CN114866810A (en) 2022-07-06 2022-07-06 Streaming video downloading method and device, storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN114866810A true CN114866810A (en) 2022-08-05

Family

ID=82626690

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210786048.4A Pending CN114866810A (en) 2022-07-06 2022-07-06 Streaming video downloading method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN114866810A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160191598A1 (en) * 2014-08-04 2016-06-30 Likqid Media, Inc. System and methods that enable embedding, streaming, and displaying video advertisements and content on internet webpages accessed via mobile devices
CN110213616A (en) * 2018-05-15 2019-09-06 腾讯科技(深圳)有限公司 Video providing method, acquisition methods, device and equipment
CN113766317A (en) * 2021-03-08 2021-12-07 京东城市(北京)数字科技有限公司 Video transmission method, video transmission device, electronic equipment and storage medium
CN114697712A (en) * 2022-05-16 2022-07-01 浙江华创视讯科技有限公司 Method, device and equipment for downloading media stream and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160191598A1 (en) * 2014-08-04 2016-06-30 Likqid Media, Inc. System and methods that enable embedding, streaming, and displaying video advertisements and content on internet webpages accessed via mobile devices
CN110213616A (en) * 2018-05-15 2019-09-06 腾讯科技(深圳)有限公司 Video providing method, acquisition methods, device and equipment
CN113766317A (en) * 2021-03-08 2021-12-07 京东城市(北京)数字科技有限公司 Video transmission method, video transmission device, electronic equipment and storage medium
CN114697712A (en) * 2022-05-16 2022-07-01 浙江华创视讯科技有限公司 Method, device and equipment for downloading media stream and storage medium

Similar Documents

Publication Publication Date Title
CN106165434B (en) It is a kind of for obtaining the method and computer-readable medium of media data
US9882951B2 (en) Method and device for playing streaming media, and non-transitory storage medium
CN106803974B (en) The real-time retransmission method of live video stream
US20160080470A1 (en) Server-side playlist stitching
US9344517B2 (en) Downloading and adaptive streaming of multimedia content to a device with cache assist
CN111010614A (en) Method, device, server and medium for displaying live caption
CN105681827B (en) Poster generation method, system and the relevant apparatus of direct broadcast band
CN108810657B (en) Method and system for setting video cover
US8817983B2 (en) Streaming video to cellular phones
CN107534793B (en) Receiving apparatus, transmitting apparatus, and data processing method
CN112616065B (en) Screen image initiating method, device and system and readable storage medium
CN102447956A (en) Method for sharing video of mobile phone and system
CN114363715A (en) Video playing method and related equipment
CN105577645A (en) Agent-based HLS client-end device and realization method thereof
CN111629283B (en) Multi-stream media gateway service system and method
CN114040232A (en) Screen projection system, method, electronic device and storage medium
CN112243158B (en) Media file processing method and device, computer readable medium and electronic equipment
CN110113298B (en) Data transmission method, device, signaling server and computer readable medium
CN110198493A (en) Media data method for down loading, device, computer equipment, storage medium and system
KR20160138044A (en) Targeted advertisement insertion for streaming media data
CN113727189A (en) Media playing method and system supporting multiple streaming media transmission protocols
CN108632681B (en) Method, server and terminal for playing media stream
CN110049360B (en) Cross-platform content control method, device, terminal, server and storage medium
CN114866810A (en) Streaming video downloading method and device, storage medium and electronic device
CN108616760B (en) Live broadcasting method based on browser, server, anchor terminal and user terminal

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20220805

RJ01 Rejection of invention patent application after publication