CN116033187A - Video processing system, method, device, electronic equipment and storage medium - Google Patents

Video processing system, method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116033187A
CN116033187A CN202310011807.4A CN202310011807A CN116033187A CN 116033187 A CN116033187 A CN 116033187A CN 202310011807 A CN202310011807 A CN 202310011807A CN 116033187 A CN116033187 A CN 116033187A
Authority
CN
China
Prior art keywords
video
processing
video processing
processed
result
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.)
Granted
Application number
CN202310011807.4A
Other languages
Chinese (zh)
Other versions
CN116033187B (en
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.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and 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 Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN202310011807.4A priority Critical patent/CN116033187B/en
Publication of CN116033187A publication Critical patent/CN116033187A/en
Application granted granted Critical
Publication of CN116033187B publication Critical patent/CN116033187B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The embodiment of the invention provides a video processing system, a method, a device, electronic equipment and a storage medium, which are applied to the field of computer application, wherein the video processing system comprises: the system comprises a client, an object storage server and a video processing server, wherein the client is used for sending a video processing request, and the video processing request comprises a video identifier of a video to be processed; the object storage server is used for receiving the video processing request; determining a video processing server corresponding to the video identifier; forwarding the video processing request to a video processing server; the video processing server is used for receiving the video processing request and acquiring a processing result or a video to be processed corresponding to the video identifier based on the video identifier. The video processing system, the method, the device, the electronic equipment and the storage medium can improve the video processing speed.

Description

Video processing system, method, device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer applications, and in particular, to a video processing system, a video processing method, a video processing device, an electronic apparatus, and a storage medium.
Background
Object storage (OSS) is used for storing a large amount of videos produced by video services, in the related art, if an upstream service needs to perform some processing operation on the videos, such as video screenshot, GIF (graphics interchange format) extraction, etc., for each video request, a complete video needs to be downloaded from the object storage, and then some processing operation can be performed on the video, so that a video processing result can be obtained, which results in slower video processing speed.
Disclosure of Invention
The embodiment of the invention aims to provide a video processing system, a method, a device, electronic equipment and a storage medium, so as to improve the video processing speed. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a video processing system, including: the system comprises a client, an object storage server and a video processing server;
the client is used for sending a video processing request, wherein the video processing request comprises a video identifier of a video to be processed;
the object storage server is used for receiving the video processing request; determining a video processing server corresponding to the video identifier; forwarding the video processing request to the video processing server;
The video processing server is used for receiving the video processing request and acquiring a processing result or a video to be processed corresponding to the video identifier based on the video identifier.
Optionally, the object storage server is specifically configured to determine, according to the video identifier, a storage location of the video to be processed, and determine, as a video processing server corresponding to the video identifier, a video processing server with a distance between the storage location and the storage location in a preset range.
Optionally, the video processing request further includes video processing parameters;
the video processing server is specifically configured to obtain, when a result cache includes a first processing result corresponding to the video identifier and the video processing parameter, the first processing result from the result cache.
Optionally, the video processing server is specifically configured to determine whether the video buffer includes a to-be-processed video corresponding to the video identifier and the video processing parameter when the result buffer does not include the first processing result corresponding to the video identifier and the video processing parameter, and obtain the to-be-processed video from the video buffer when the video buffer includes the to-be-processed video corresponding to the video identifier and the video processing parameter.
Optionally, the object storage server is further configured to obtain an authorized address based on the storage location of the video to be processed, and forward the authorized address of the video to be processed to the video processing server;
the video processing server is specifically configured to download the video to be processed from the authorized address when the video cache does not include the video identifier and the video to be processed corresponding to the video processing parameter.
Optionally, the video processing server is specifically configured to segment the video to be processed in the authorization address according to the video processing parameter to obtain a video segment address, and download the video segment from the video segment address.
Optionally, the video processing server is further configured to process the video clip according to the video processing parameter to obtain a second processing result, and cache the second processing result in a result cache.
Optionally, the video processing server is specifically configured to obtain, when the result cache includes a first processing result corresponding to the video identifier and the video processing parameter, a cache key value according to the video processing parameter and attribute information of the video to be processed, and obtain the first processing result from the result cache according to the cache key value.
Optionally, the video processing parameter includes a video processing type;
the video processing server is specifically configured to distribute the video processing request to a processing module corresponding to the video type; and under the condition that the result cache contains the first processing result corresponding to the video identification and the video processing parameter, acquiring the first processing result from the result cache through the processing module.
In a second aspect, an embodiment of the present invention further provides a video processing method, which is applied to a video processing system, where the video processing system includes an object storage server and a video processing server, and the method includes:
the object storage server receives a video processing request sent by a client; the video processing request comprises a video identifier of a video to be processed; determining a video processing server corresponding to the video identifier; forwarding the video processing request to the video processing server;
the video processing server receives a video processing request sent by the object storage server and acquires a processing result or a video to be processed corresponding to the video identifier based on the video identifier.
Optionally, the determining the video processing server corresponding to the video identifier includes:
The object storage server determines the storage position of the video to be processed according to the video identification, and determines a video processing server with the distance between the storage position and the storage position in a preset range as the video processing server corresponding to the video identification.
Optionally, the video processing request further includes video processing parameters; the step of obtaining the processing result or the video to be processed corresponding to the video identifier based on the video identifier comprises the following steps:
and under the condition that the result cache contains the first processing result corresponding to the video identification and the video processing parameter, the video processing server acquires the first processing result from the result cache.
Optionally, the obtaining, based on the video identifier, a processing result or a video to be processed corresponding to the video identifier includes:
the video processing server judges whether the video cache contains a video to be processed corresponding to the video identification and the video processing parameter under the condition that the result cache does not contain a first processing result corresponding to the video identification and the video processing parameter; and under the condition that the video cache contains the video to be processed corresponding to the video identification and the video processing parameter, acquiring the video to be processed from the video cache.
Optionally, after the determining the video processing server corresponding to the video identifier, the method further includes:
the object storage server obtains an authorized address based on the storage position of the video to be processed, and forwards the authorized address of the video to be processed to the video processing server;
the step of obtaining the processing result or the video to be processed corresponding to the video identifier based on the video identifier comprises the following steps:
and the video processing server downloads the video to be processed from the authorized address under the condition that the video cache does not contain the video to be processed corresponding to the video identification and the video processing parameter.
Optionally, the downloading the video to be processed from the authorized address includes:
the video processing server side segments the video to be processed in the authorized address according to the video processing parameters to obtain a video segment address; downloading the video clip from the video clip address.
Optionally, after said downloading said video clip from said video clip address, said method further comprises:
the video processing server processes the video clips according to the video processing parameters to obtain a second processing result; and caching the second processing result into the result cache.
Optionally, when the result cache includes the first processing result corresponding to the video identifier and the video processing parameter, the video processing server obtains the first processing result from the result cache, including:
the video processing server obtains a cache key value according to the video processing parameter and the attribute information of the video to be processed under the condition that the result cache contains a first processing result corresponding to the video identifier and the video processing parameter; and acquiring the first processing result from the result cache according to the cache key value.
Optionally, the video processing parameter includes a video processing type; the video processing server obtains a first processing result from a result cache under the condition that the result cache contains the video identifier and the first processing result corresponding to the video processing parameter, and the method comprises the following steps:
the video processing server distributes the video processing request to a processing module corresponding to the video type; and under the condition that the result cache contains the first processing result corresponding to the video identification and the video processing parameter, acquiring the first processing result from the result cache through the processing module.
In a third aspect, an embodiment of the present invention further provides a video processing apparatus, where the apparatus is applied to a video processing system, where the video processing system includes an object storage server and a video processing server, where the object storage module includes a first receiving module, a determining module, and a first forwarding module, and where the video processing server includes a second receiving module and an obtaining module, and the apparatus includes:
the first receiving module is used for receiving a video processing request sent by a client; the video processing request comprises a video identifier of a video to be processed;
the determining module is used for determining a video processing server corresponding to the video identifier;
the first forwarding module is configured to forward the video processing request to the video processing server;
the second receiving module is used for receiving a video processing request sent by the object storage server;
the acquisition module is used for acquiring a processing result or a video to be processed corresponding to the video identification based on the video identification.
Optionally, the determining module is specifically configured to determine, according to the video identifier, a storage location of the video to be processed, and determine, as a video processing server corresponding to the video identifier, a video processing server with a distance between the storage locations in a preset range.
Optionally, the video processing request further includes video processing parameters; the acquisition module comprises:
the first obtaining sub-module is used for obtaining the first processing result from the result buffer under the condition that the result buffer contains the first processing result corresponding to the video identification and the video processing parameter.
Optionally, the acquiring module includes:
the second obtaining sub-module is used for judging whether the video cache contains the video to be processed corresponding to the video identification and the video processing parameters or not under the condition that the result cache does not contain the first processing result corresponding to the video identification and the video processing parameters; and under the condition that the video cache contains the video to be processed corresponding to the video identification and the video processing parameter, acquiring the video to be processed from the video cache.
Optionally, the object storage server further includes a second forwarding module, and the apparatus further includes:
the second forwarding module is configured to obtain an authorized address based on a storage location of the video to be processed after the video processing server corresponding to the video identifier is determined, and forward the authorized address of the video to be processed to the video processing server;
The acquisition module comprises:
and the downloading sub-module is used for downloading the video to be processed from the authorized address under the condition that the video cache does not contain the video to be processed corresponding to the video identification and the video processing parameter.
Optionally, the downloading sub-module is specifically configured to segment the video to be processed in the authorized address according to the video processing parameter to obtain a video segment address; downloading the video clip from the video clip address.
Optionally, the acquiring module further includes:
the buffer sub-module is used for processing the video clips according to the video processing parameters after the video clips are downloaded from the video clip addresses to obtain a second processing result; and caching the second processing result into the result cache.
Optionally, the first obtaining submodule is specifically configured to obtain, when the result cache includes a first processing result corresponding to the video identifier and the video processing parameter, a cache key value according to the video processing parameter and attribute information of the video to be processed; and acquiring the first processing result from the result cache according to the cache key value.
Optionally, the video processing parameter includes a video processing type; the first obtaining sub-module is specifically configured to distribute the video processing request to a processing module corresponding to the video type; and under the condition that the result cache contains the first processing result corresponding to the video identification and the video processing parameter, acquiring the first processing result from the result cache through the processing module.
In a fourth aspect, an embodiment of the present invention further provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
and a processor for implementing any of the above method steps when executing the program stored on the memory.
In a fifth aspect, embodiments of the present invention also provide a computer readable storage medium having stored therein a computer program which, when executed by a processor, implements any of the above method steps.
In a sixth aspect, embodiments of the present invention also provide a computer program product comprising instructions which, when run on a computer, cause the computer to perform any of the method steps described above.
In the technical scheme of the embodiment of the invention, the video processing system comprises: the system comprises a client, an object storage server and a video processing server; the client is used for sending a video processing request, wherein the video processing request comprises a video identifier of a video to be processed; the object storage server is used for receiving the video processing request; determining a video processing server corresponding to the video identifier; forwarding the video processing request to a video processing server; the video processing server is used for receiving the video processing request and acquiring a processing result or a video to be processed corresponding to the video identifier based on the video identifier. When the client sends a video processing request, the object storage server can forward the video processing request with the same video identifier to the same video processing server according to the video identifier of the video to be processed, the same video to be processed is processed by the same video processing server, the processing result corresponding to the unified video identifier or the video to be processed can be reused, and the time consumption caused by repeated downloading of the same video when the video to be processed is avoided, so that the video processing speed can be improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
Fig. 1 is a schematic diagram of a first configuration of a video processing system according to an embodiment of the present invention.
Fig. 2 is a flowchart of video processing steps performed by the object storage server in an embodiment of the present invention.
Fig. 3 is a flowchart of video processing steps performed by the video processing server according to an embodiment of the present invention.
Fig. 4 is a schematic diagram of a second configuration of the video processing system according to an embodiment of the present invention.
Fig. 5 is a flowchart of a video processing method according to an embodiment of the present invention.
Fig. 6 is a schematic structural diagram of a video processing apparatus according to an embodiment of the present invention.
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the accompanying drawings in the embodiments of the present invention.
When processing video, for each video processing request, the conventional method needs to download the complete video first, and then can perform various video processing operations on the video to obtain a video processing result. It can be understood that if the plurality of video processing requests are all directed against the same video to be processed, the conventional method is adopted to process the video, so that each video processing request needs to be downloaded once for each video processing request, that is, the situation of repeatedly downloading the same video to be processed occurs, which causes unnecessary time waste, further causes long time consumption in the video processing process and slow video processing speed.
In order to increase the video processing speed, as shown in fig. 1, an embodiment of the present invention provides a video processing system, including: a client 101, an object storage server 102, and a video processing server 103.
A client 101 for sending a video processing request;
wherein the video processing request includes a video identification of the video to be processed.
An object storage server 102, configured to receive a video processing request; determining a video processing server 103 corresponding to the video identifier; the video processing request is forwarded to the video processing server 103.
The video processing server 103 is configured to receive a video processing request, and obtain a processing result or a video to be processed corresponding to the video identifier based on the video identifier.
In the technical scheme of the embodiment of the invention, when the client sends the video processing request, the object storage server can forward the video processing request with the same video identifier to the same video processing server according to the video identifier of the video to be processed, and the same video processing server is utilized to process the same video, so that the processing result corresponding to the unified video identifier or the video to be processed can be reused, and the time consumption caused by repeated downloading of the same video when the video to be processed is avoided, thereby improving the video processing speed.
Meanwhile, the unified video processing server is utilized to process video processing requests of videos to be processed with the same video identification, so that the downloading times of the same videos can be reduced, the flow cost is further reduced, and the object storage server distributes a unified video processing server for various video processing requests with the same video identification, so that the processing interface can be better standardized, and the access difficulty of services is further reduced.
Referring to fig. 1, a video processing system provided in an embodiment of the present invention will be described in detail. The video processing system includes: a client 101, an object storage server 102, and a video processing server 103.
A client 101 for sending a video processing request;
wherein the video processing request includes a video identification of the video to be processed.
The Client, which may also be referred to as Client, may send a video processing request through hypertext transfer protocol (Hyper Text Transfer Protocol, HTTP), and in particular, may include a screenshot request, a display-back request, a GIF extraction request, and so on. The video identifier may include region information, and the region information (region information) in which the video is stored may be determined according to the received video processing request, and it may be understood that the region information may also refer to an address of the video to be processed, that is, a storage location (video address) of the video to be processed. For example, in the request
http://bj.oss.XXX.storage/{bucket}/xx.mp4x-oss-process=video/snapshot,t_1000_2000,f_jpg,w_800
In http:// bj.oss.XXX.storage/{ bucket }/xx.mp4, representing the video address of video xx.mp4, where { bucket } is the bucket name.
An object storage server 102, configured to receive a video processing request; determining a video processing server corresponding to the video identifier; and forwarding the video processing request to a video processing server.
The object storage server 102 can be an operation support system (Operation Support Systems, OSS), which is an integrated support system for telecommunication operators and information resource sharing, and mainly comprises parts of network management, system management, charging, business, accounting, customer service and the like, and the systems are organically integrated together through a unified information bus. The method has the characteristics of multi-service, whole-course, automatic, real-time, flexibility, manageability and the like, a large amount of videos produced by video services can be stored in an OSS, the OSS can record information such as actual addresses, areas, sizes and the like of the videos, and information support can be provided for subsequent video processing operations.
The object storage server 102 is further configured to authenticate the video processing request.
After receiving the video processing request sent by the client 101, it is necessary to authenticate the video processing request, and verify whether the user who initiates the video processing request using the client 101 has the right to initiate the video processing request. Specifically, it may be that for the video processing type in the video processing request sent by the client 101, it is verified whether the client 101 that initiated the request has the right to perform the video processing operation.
In one implementation, the request for the video screenshot may be initiated only by a user who satisfies a specific condition, where the specific condition may be that the user's login time is greater than a preset time, the user's age is greater than a preset value, and so on. When the preset condition is not met, the user receives the non-authority prompt information to prompt the user that the screenshot fails.
If the user authentication is not passed, the object storage server 102 may return an authentication failing prompt message to the client 101, prompting the request initiator that the right to perform the video processing operation is not obtained, and the request initiator may resume the operation after obtaining the right.
The video identifier includes area information, and in one implementation, in a certain video processing request, where the area information of the video to be processed points to the area 1, for example, beijing, the corresponding video processing server 103 may be the video processing server 103 of the area 1, that is, the Beijing video processing server.
In one implementation manner, the object storage server 102 is specifically configured to determine a storage location of a video to be processed according to a video identifier, and determine a video processing server 103 with a distance between the storage location and the storage location within a preset range as the video processing server 103 corresponding to the video identifier.
It may be appreciated that, according to the video identifier of the video to be processed, the storage location of the video to be processed may be determined, and then the video processing server 103 corresponding to the video identifier may be the video processing server 103 having a distance between the storage location of the video to be processed and the storage location of the video to be processed in a preset range, that is, the video processing server 103 having the same area information as the video. Meanwhile, the video processing server 103 can be regarded as a video processing server closest to video storage.
In practical application, the video processing request is not single, if multiple requests are made for one video resource, in order to avoid that the video processing request for the same video arrives at different servers, multiple unnecessary downloads are caused, which wastes resources and time. In one implementation, an nmginx proxy may be added in front of the video processing service.
Nginx (engine x) is a high-performance HTTP and reverse proxy web (internet) server with little memory and high concurrency.
After adding the Nginx agent, forwarding the video processing request of the same URL (Uniform resource positioning system), namely the same video, to the same server, namely the same video processing server by utilizing a URL_hash load balancing strategy. According to the video identification, the video processing requests with the same video identification are scheduled to the same video processing server, and the video processing requests for the same video are processed by the same video processing server, so that the flow cost can be reduced, and the downloading speed can be improved.
After determining the video processing server 103 corresponding to the video to be processed, the video processing request may be forwarded to the video processing server 103, so that the video processing server 103 performs a video processing procedure to obtain a processing result.
The video processing server 103 is configured to receive a video processing request, and obtain a processing result or a video to be processed corresponding to the video identifier based on the video identifier.
The video processing request may include video processing parameters such as, for example,
http://bj.oss.XXX.storage/{bucket}/xx.mp4x-oss-process=video/snapshot,t_1000_2000,f_jpg,w_800
where x-os-process=video/snapshot, t_1000_2000, f_jpg, w_800, represents the request parameters, corresponding to the request parameter format x-os-process=video/{ process }, extra_parameters }. { process } represents various types of processing, and { extra_parameters } is a processing parameter corresponding to each type of processing.
Based on this, x-oss-process=video/snapshot, t_1000_2000, f_jpg, w_800
It may be shown that the type of processing performed for a video at a time of 1000,2000 ms is snapshot (snapshot), i.e. the processing operation of the video screenshot, resulting in jpg (joint picture expert group) format, width 800.
In one implementation, the processing results may be obtained from a results cache.
The video processing server 103 obtains a first processing result from the result buffer when the result buffer contains the first processing result corresponding to the video identifier and the video processing parameter.
The result cache is used for caching the video processing result after the video is processed, and the result is generally smaller than that of unprocessed video, for example, the video information can be json (JavaScript Object Notation, JS object numbered musical notation), the screenshot can be a picture, the GIF extraction is a GIF composed of a plurality of pictures, and therefore the result cache can adopt a cloud storage mode to cache the smaller processing result in the cloud.
The result cache contains the first processing result corresponding to the video identifier and the video processing parameter, which indicates that the processing operation is completed before the video processing request is initiated, and the first processing result corresponding to the video identifier and the video processing parameter in the result cache is obtained after the same operation is performed previously and is cached in the result cache.
In an implementation manner, the video processing server 103 is specifically configured to distribute a video processing request to a processing module corresponding to a video type; under the condition that the result cache contains a first processing result corresponding to the video identification and the video processing parameter, the first processing result is obtained from the result cache through the processing module.
The video processing parameters include a video processing type, after the video processing server 103 receives the video processing request, determines a processing module corresponding to the video processing type according to the video processing parameters, for example, if the video processing type included in the received video processing request is a video screenshot, the video processing request is distributed to the video screenshot processing module, if the video processing type included in the received video processing request is a video anti-display, the video processing request is distributed to the video anti-display processing module, and so on, and the remaining processing modules corresponding to the video processing type are not excessively exemplified any more.
In one example, the result caches corresponding to the different processing modules may be different, and the processing modules may be determined before the first processing result is obtained, and then the first processing result may be obtained from the result caches.
In an implementation manner, the video processing server 103 is specifically configured to obtain, when the result cache includes a first processing result corresponding to the video identifier and the video processing parameter, a cache key value according to the video processing parameter and attribute information of the video to be processed, and obtain, according to the cache key value, the first processing result from the result cache.
The video identifier may include a name of a video to be processed, and the video processing parameter includes a video processing type and time information to be processed, where the video processing type may be a video screenshot, a display, a GIF extraction, etc., and the time information to be processed may be a time point or a time period. For example, the video processing type is a video screenshot, and the time information to be processed is 1000 milliseconds, that is, it means that the video at 1000 milliseconds is screenshot. The attribute information of the video to be processed may be inherent information of the video itself to be processed, such as a video name, a video size, storage information, version information, and the like.
According to the video processing parameters and the attribute information of the video to be processed, a buffer key value can be obtained, and a first processing result is obtained from a result buffer according to the buffer key value.
The cache key value, which may also be referred to as a cache key value, may include attribute information of the object storage server regarding the video to be processed, such as a bucket (bucket) name, a video object name, and an object version, and video processing parameters.
For example, the cache key value may be expressed as:
bucket_xx/object_yy/version_zz/snapshot_100_200_100_....jpg
the attribute information of the video to be processed comprises: the bucket name is bucket_xx, the video object name is object_yy, and the object version is version_zz. The video processing parameters include: the video processing operation type name snapshot (screenshot), the time information to be processed 100_200_100.
When the first processing result is obtained, the first processing result corresponding to the video name, namely the video identifier, in the buffer key value, the video processing operation type name and the time information to be processed, namely the video processing parameter, can be determined from the result buffer.
In one implementation manner, the video processing server 103 determines whether the video buffer contains the video to be processed corresponding to the video identifier and the video processing parameter when the result buffer does not contain the first processing result corresponding to the video identifier and the video processing parameter, and obtains the video to be processed from the video buffer when the video buffer contains the video to be processed corresponding to the video identifier and the video processing parameter.
The condition that the result cache does not contain the video to be processed corresponding to the video identification and the video processing parameters indicates that the video processing request with the same content as the video processing request is not executed, namely, the video processing server side does not execute the same video processing operation on the video to be processed before the video processing request is sent. For example, the content of the video processing request is a screenshot of the video to be processed at 2000 ms, and the video processing operation has not been performed before, so after the query result is cached, the first processing result corresponding to the video identifier and the video processing parameter cannot be obtained.
In this case, it may be determined whether the video buffer contains a video to be processed corresponding to the video identification and the video processing parameter.
The video cache is used for caching videos, and as the video processing types are various, although a certain video to be processed does not execute the video processing operation corresponding to the video processing request, other video processing operations corresponding to other video processing requests can be executed. Thus, the video to be processed may be cached in the video cache. For example, the current video processing request is a screenshot of 2000 ms of the video to be processed, and the previous video processing request is a screenshot of 1000 ms of the video to be processed, in which case, the first processing result corresponding to the current video processing request cannot be obtained from the result buffer, but the video to be processed corresponding to the current video processing request can be obtained from the video buffer.
The video buffering may employ a local buffering approach to buffering the video. It can be understood that when different video processing operations are performed on the same video to be processed, the video to be processed is directly obtained from the video cache, and the video to be processed can be a video clip instead of a complete video, so that the time consumed for obtaining the complete video in the video processing process can be saved, and the flow cost can be saved.
In one implementation manner, the video processing server 103 downloads the video to be processed from the authorized address when the video cache does not include the video identifier and the video to be processed corresponding to the video processing parameter.
The video processing server 103 downloads the video to be processed from the authorized address, which may specifically include slicing the video to be processed in the authorized address according to the video processing parameter, obtaining a video clip address, and downloading the video clip from the video clip address.
In this case, the object storage server 102 is further configured to obtain the authorized address based on the storage location of the video to be processed, and forward the authorized address of the video to be processed to the video processing server.
The step of forwarding, by the object storage server 102, the authorized address of the video to be processed to the video processing server 103 as shown in fig. 2 may include:
step S201, authentication is requested.
The object storage server first authenticates the video processing request sent by the client 101. And identifying whether the video processing request is legal or not, namely whether the client has authority to initiate the video processing request or not.
Step S202, a video storage address is acquired.
Taking the example of a screenshot request initiated by the client 101 via the HTTP protocol, in
http://bj.oss.XXX.storage/{bucket}/xx.mp4x-oss-process=video/snapshot,t_1000_2000,f_jpg,w_800
In the video processing request, http:// bj.oss.XXX.storage/{ socket }/xx.mp4 represents the video storage address of the video xx.mp4, and the video storage address can be obtained based on the video processing request.
Step S203, an authorized address is generated.
It will be appreciated that the number of video processing requests is large, and if these requests are all directly accessed to the storage address of the video, the security of the object storage server will be affected. Thus, in general, the video memory address is not externally accessible, i.e., there is no right for an external user to directly access the video memory address. The object storage service terminal therefore generates an authorized address of the video based on the storage address of the video for authorizing the external user so that the external user can access the video through the authorized address.
Specifically, an authorization parameter may be added after the storage address of the video to indicate that the video address is authorized, and the user may access the video.
Step S204, request forwarding.
And forwarding the video processing request and the obtained authorized address capable of accessing the video to be processed to the video processing server 103, wherein the video processing server 103 is a video processing server with a distance between the video processing server and a storage position of the video to be processed in a preset range.
In an actual application scenario, a situation that any video processing operation is never executed on the video to be processed, that is, a situation that a result cache does not contain a first processing result corresponding to a video identifier and a video processing parameter and a video cache does not contain the video to be processed corresponding to the video identifier and the video processing parameter, is generated, so that the video to be processed needs to be downloaded in this situation.
During downloading, a slice downloading mode can be adopted, only the segments corresponding to the video processing parameters of the video processing request in the video to be processed are downloaded according to actual needs, and compared with downloading of the complete video, the time required for downloading the video segments is shorter, so that the video processing speed can be improved.
The video processing server 103 is further configured to process the video clip according to the video processing parameter to obtain a second processing result, and cache the second processing result into a result cache.
Specifically, when downloading video clips, it is necessary to determine the video clip addresses by determining the video clips and the clip sizes according to the video processing request parameters. According to the attribute information of the video to be processed, the size of the complete video to be processed can be obtained, and when the video to be processed is segmented, one percent of the size of the video to be processed can be used as a preset segmentation size, for example, in an actual application scene, the segmentation size is 4MB at the minimum and 50MB at the maximum. Determining a segment section of the video to be processed according to time information to be processed in the video processing request, namely, the time information of the video segment to be processed, and taking an address of the segment section containing the video segment to be processed as a video segment address, wherein the video segment address can be obtained by adding corresponding target parameters in an authorized address, for example, taking the starting time and the ending time of the segment section as the target parameters.
The video to be processed is obtained in the mode, the video clips are downloaded instead of the complete video, the time consumed by downloading the unnecessary video clips in the complete video is saved, the video processing speed can be improved, the response speed of the service can be improved, and the flow cost is saved.
The video processing server 103 is further configured to process the video clip according to the video processing parameter to obtain a second processing result, and cache the second processing result into a result cache.
Specifically, according to the video processing type contained in the video processing request, the corresponding processing module is used for processing the video clip correspondingly, and the second processing result is cached according to the caching key value. It will be appreciated that the second processing result may be cached asynchronously according to the cache key value, i.e. the second processing result is cached in the result cache by the video object name, i.e. the video identifier, and the video processing operation type name and the time information to be processed, i.e. the video processing parameters.
It will be appreciated that the cached second processing result may be directly obtained after the next receipt of the same video processing request for the same video to be processed.
Aiming at the data cached in the result cache and the video cache, the video processing server 103 is specifically configured to obtain a first expiration data clearing time, and clear a processing result in the result cache exceeding the first expiration data clearing time; and acquiring second expiration data clearing time, and clearing the video data exceeding the second expiration data clearing time in the video cache.
The total amount of video is huge while the video is also time efficient, it being understood that the amount of video processing requests for a particular video may be different for different time periods. For example, during a holiday, a large number of video processing requests for video corresponding to the holiday may be received, while at other times there may be little initiated video processing requests for video corresponding to the holiday.
The first expiration data clearing time and the second expiration data clearing time can be set, so that the expiration data in the cache can be cleared regularly, and the cache space is released, so that the recycling of the cache resources is realized.
The first expiration data clearing time and the second expiration data clearing time can be the same or different, and can be set according to practical situations, and can be several hours, days or even months.
One implementation, as shown in fig. 3, after receiving a request forwarded by the object storage server 102, the video processing server 103 may perform steps that include:
step S301, a request key value is acquired.
After receiving the video processing request and the authorization address sent by the object storage server 102, according to the video processing parameter and the key (key) value of the video acquisition request to be processed, the key value is used for searching the corresponding first processing result in the result cache.
Step S302, the result cache is read.
Based on the request key value, the first processing result is obtained in the result cache 305, and based on the video identifier and the video processing parameter, whether the corresponding first processing result exists is searched in the result cache 305.
When the result cache 305 contains the first processing result, the first processing result is acquired; when the result buffer 305 does not contain the first processing result, step S303 is executed.
Step S303, acquiring a video.
Acquiring video may include acquiring video from video cache 306 and downloading video clips of the video to be processed from video store 307. Judging whether the video cache 306 contains a video to be processed, and directly acquiring the video to be processed from the video cache 306 when the video cache 306 contains the video to be processed; when the video to be processed is not contained in the video cache 306, a video clip to be processed is determined based on the authorized address and the video processing parameters, and the video clip is downloaded from the video storage 307.
Step S304, processing the video.
According to the video processing type, corresponding video processing operations, such as video screenshot, back display, GIF extraction, etc., are performed on the acquired video or video clip to be processed, and the processing results are cached in the result cache 305.
The technical scheme provided by the embodiment of the invention specifically illustrates three modes that the video processing service terminal obtains the processing result corresponding to the video identifier or the video to be processed based on the video identifier: directly obtaining a video processing result from the result cache; acquiring a video to be processed from a video cache; and obtaining the video clips to be processed in a fragment downloading mode. The video processing result is directly obtained from the result cache, so that the time for obtaining the video and processing the video is saved; the method saves the time for downloading the complete video by acquiring the video to be processed from the video cache and downloading the video fragments to be processed in a slicing way. The three modes can be considered to acquire the required video processing result or the video to be processed under the condition of not downloading the complete video, so that the time consumed in the video processing process is saved, the video processing speed can be improved, and the flow cost required by downloading the video is reduced.
In an alternative embodiment, as shown in fig. 4, the video processing system may perform a video processing process including:
the client 101 sends a video processing request to an OSS service (Operation Support Systems, operation support system) 401, the OSS service 401 is used as an object storage service, after receiving the video processing request, a storage position of a video to be processed is determined according to a video identifier, and a video processing service with a distance between the storage position and the storage position being in a preset range is determined, as shown in fig. 4, the video processing service corresponds to a processing center, wherein the processing center 1 is the video processing service determined based on the video processing request. After receiving the video processing request and the authorization address, the processing center 1 determines the type of the video processing 402, where the video processing 402 corresponds to a processing module, and different video processing types correspond to different video processing 402.
The video processing 402 first accesses the result buffer 305, obtains a processing result corresponding to the video processing request from the result buffer 305, accesses the video buffer 403 when the processing result corresponding to the video processing request is not obtained from the result buffer 305, judges whether the video buffer 403 contains a video to be processed, and if the video buffer 403 contains the video to be processed, directly obtains the video to be processed in the video buffer, and performs video processing operation. If the video to be processed is not contained in the video buffer 403, then the required video segment to be processed is downloaded from the video storage 307 through the video download 404, after the video segment to be processed completes the corresponding video processing operation, the video processing result is returned to the OSS service 401, and finally the OSS service 401 sends the video processing result to the client 101, so that the user who uses the client 101 to send the video processing request obtains the corresponding video processing result.
Accordingly, when the video processing server determined based on the video processing request points to the processing center 2 … … processing center n, the process of obtaining the video processing result is the same as when the video processing server determined based on the video processing request points to the processing center 1, and will not be described again here.
In an actual application scenario, since some upstream services, such as a video information acquisition service, a video screenshot service, and a video GIF extraction service, may belong to different departments, a corresponding video processing service needs to be deployed separately, so that video processing interfaces are increasing. According to the technical scheme provided by the embodiment of the invention, a unified video processing center is established, various video processing functions are aggregated, and the problem of non-unified specification caused by different video processing types can be avoided.
Specifically, the initiated video processing Request may be normalized by a Request specification (Request specification), and a processing parameter x-oss-process=video/{ process }, where { process } represents a video processing method, may be appended to the video address.
For example, x-oss-process=video/snapshot, t_1000, w_200_h_100, represents a screenshot of a video for 1000 milliseconds, with a picture size of 200x100.
The content format returned after the video processing can be normalized by the Response specification (Response specification). When the video processing reports errors, all video processing types correspond to the same error reporting return format. And normally responding, and returning the needed content according to the preset format corresponding to the video processing type.
It will be appreciated that the request related to authentication, request header, domain name, and the object storage server is also provided with a unified request specification, which is not illustrated here.
According to the technical scheme provided by the embodiment of the invention, the video processing result is cached in the result cache, and the video processing result is directly obtained after the same video processing request (the video processing request which is processed before) is received; caching the video to be processed in a video cache, and directly acquiring the cached video to be processed from the video cache when the video processing result is not acquired from the result cache; when the video to be processed is not obtained in the video cache, downloading the video based on the video storage address, and downloading the video clip of the video to be processed, namely downloading the video in a slicing way, the three ways avoid downloading the complete video, save the time consumed in the process of downloading the complete video, and improve the video processing speed.
In addition, the unified video processing service can avoid the service itself developing the corresponding processing service and better standardizes the processing interface, so that various video processing services can be conveniently accessed to the object storage service to process the video therein. Meanwhile, as different services are processed in one service, the access difficulty of the services and the response time of video processing are reduced. For different video processing types, the subsequent flow can be realized by only modifying parameters and processing return results.
By caching the processing result and the video resource, the same video does not need to be repeatedly downloaded, the same processing request does not need to be processed again, the flow cost can be reduced, and the resource utilization rate can be improved by setting regular clearing.
As shown in fig. 5, an embodiment of the present invention provides a video processing method, which is applied to a video processing system, where the video processing system includes an object storage server and a video processing server, and the video processing method may include:
step S501, an object storage server receives a video processing request sent by a client; the video processing request comprises a video identifier of the video to be processed; determining a video processing server corresponding to the video identifier; and forwarding the video processing request to a video processing server.
Step S502, the video processing server receives a video processing request sent by the object storage server, and obtains a processing result or a video to be processed corresponding to the video identifier based on the video identifier.
According to the technical scheme provided by the embodiment of the invention, the object storage server can forward the video processing request with the same video identifier to the same video processing server according to the video identifier of the video to be processed, and the same video is processed by the same video processing server, so that the time consumption caused by repeated downloading of the same video when the video to be processed is avoided, and the video processing speed can be improved.
Referring to fig. 5, a video processing method provided by an embodiment of the present invention will be described in detail.
Step S501, an object storage server receives a video processing request sent by a client; the video processing request comprises a video identifier of the video to be processed; determining a video processing server corresponding to the video identifier; and forwarding the video processing request to a video processing server.
The video identifier of the video to be processed may be area information of the video to be processed, for example, the area information of the video to be processed points to the area 1, and then it may be considered that the area information of the video processing server with a distance between the video to be processed and the storage location of the video to be processed in the preset range also points to the area 1, that is, the video to be processed and the video processing server corresponding to the video to be processed have the same area information.
In one implementation manner, the object storage server determines a storage position of a video to be processed according to a video identifier, and determines a video processing server with a distance between the storage position and the storage position within a preset range as the video processing server corresponding to the video identifier. I.e. the video processing server having the same area information as the video to be processed can be regarded as the video processing server closest to it.
The video processing request may further include video processing parameters of the video to be processed, which may include a video processing type, time information to be processed, and various parameters related to a video processing result corresponding to the video processing type. For example, the video processing type may be video screenshot, anti-display, GIF extraction, etc., and the time information to be processed may be a time point or a time period.
For example, in
http://bj.oss.XXX.storage/{bucket}/xx.mp4x-oss-process=video/snapshot,t_1000_2000,f_jpg,w_800
In the video processing request, http:// bj.oss.xxx.storage/{ socket }/xx.mp4 represents the video address of the video xx.mp4, and the video address can be considered as the video identifier of the video to be processed, x-oss-process=video/snapshot, t_1000_2000, f_jpg, w_800 represents the video processing parameters, and corresponds to the request parameter format x-oss-process=video/{ process }, { extra_parameters }, { process } is a processing parameter corresponding to a processing type.
Based on this, x-oss-process=video/snapshot, t_1000_2000, f_jpg, w_800 may represent a video at a time of 1000,2000 milliseconds, the type of processing performed is a processing operation of snapshot (screenshot), and as a result, the jpg format is adopted, and the width (w) is 800.
Step S502, the video processing server receives a video processing request sent by the object storage server, and obtains a processing result or a video to be processed corresponding to the video identifier based on the video identifier.
The manner in which the video processing server obtains the processing result corresponding to the video identifier or the video to be processed may include three manners: obtaining a video processing result from the result cache; acquiring a video to be processed from a video cache; downloading the video to be processed from the authorized address.
In one implementation manner, the video processing server obtains a first processing result from the result buffer when the result buffer contains the first processing result corresponding to the video identifier and the video processing parameter.
The result cache is used for caching video processing results. It can be understood that the number of video processing requests is huge, and the situation that the video processing requests for the same video will be repeated is caused, so that the result cache contains the first processing result corresponding to the video identifier and the video processing parameter, which indicates that the processing operation has been completed before the video processing request is initiated, and the first processing result corresponding to the video identifier and the video processing parameter in the result cache is the processing result obtained after the same operation is performed previously and is cached in the result cache.
In one implementation manner, the method for obtaining the first processing result may include:
the video processing server distributes the video processing request to a processing module corresponding to the video type; under the condition that the result cache contains a first processing result corresponding to the video identification and the video processing parameter, the first processing result is obtained from the result cache through the processing module.
The video processing parameters include a video processing type, and after the video processing server receives the video processing request, the video processing server determines a processing module corresponding to the video processing type according to the video processing parameters, for example, if the video processing type included in the received video processing request is a video screenshot, the video processing request is distributed to the video screenshot processing module, if the video processing type included in the received video processing request is a video anti-display, the video processing request is distributed to the video anti-display processing module, and so on.
The types of video processing are rich and various, so that the types of corresponding video processing results are different, for example, the types of the obtained processing results can be jpg type and GIF type respectively in two video processing modes of video screenshot and GIF extraction. Different processing modules may be allocated for different video processing types according to video processing parameters. The result caches corresponding to the different processing modules may be different, and before the first processing result is obtained, the processing module may be determined first, and then the first processing result may be obtained from the result caches.
In one implementation manner, the method for obtaining the first processing result may include:
the video processing server side obtains a buffer key value according to the video processing parameter and attribute information of the video to be processed under the condition that a result buffer contains a first processing result corresponding to the video identification and the video processing parameter; and acquiring a first processing result from the result cache according to the cache key value.
The cache key value, which may also be referred to as a cache key value, may include video information about the video to be processed by the object storage server, such as a bucket (bucket) name, a video object name, and an object version, as well as a video processing operation type name and time information to be processed.
The cache key value, which may also be referred to as a cache key value, may include attribute information of the object storage server regarding the video to be processed, such as a bucket (bucket) name, a video object name, and an object version, and video processing parameters.
For example, the cache key value may be expressed as:
bucket_xx/object_yy/version_zz/snapshot_100_200_100_....jpg
the attribute information of the video to be processed comprises: the bucket name is bucket_xx, the video object name is object_yy, and the object version is version_zz. The video processing parameters include: the video processing operation type name snapshot (screenshot), the time information to be processed 100_200_100.
The video identifier may include a video name, and when the first processing result is obtained, the first processing result corresponding to the video identifier may be determined from the result cache according to the video identifier, the video processing operation type name and the time information to be processed, that is, the video processing parameter.
The video processing results are stored by utilizing the result cache, and after the video processing server receives the same video processing request, the video processing results can be directly obtained from the result cache without downloading the video and executing the video processing request, so that the time consumed by video downloading and video processing can be saved, and the video processing speed can be improved.
Under the condition that the result cache does not contain a first processing result corresponding to the video identification and the video processing parameter, the video processing result is acquired by firstly acquiring the video to be processed and then processing the video to be processed to obtain the video processing result.
In one implementation manner, the method for the video processing server to acquire the video to be processed from the video cache may include:
and the video processing server judges whether the video cache contains the video to be processed corresponding to the video identification and the video processing parameters or not under the condition that the result cache does not contain the first processing result corresponding to the video identification and the video processing parameters, and acquires the video to be processed from the video cache under the condition that the video cache contains the video to be processed corresponding to the video identification and the video processing parameters.
The video identification may include a video name and the video processing parameters may include a video processing type. If the result cache does not contain the first processing result corresponding to the video identifier and the video processing parameter, it is stated that, for the video to be processed, the video processing request received at this time has not been executed previously, but it can be understood that, due to the huge number of video processing requests, the situation that the types of video processing executed for the same video are the same may occur.
For example, for the screenshot request of the same video to be processed, because the two video processing requests are different due to the difference of the waiting time included in the video processing parameters, the first processing result can be obtained in the result buffer when the video screenshot request of the screenshot of 1000 ms is executed, but the first processing result cannot be obtained in the result buffer when the video screenshot request of the screenshot of 2000 ms is not executed, but it can be understood that the video to be processed is already requested when the video screenshot request of the screenshot of 1000 ms is executed, therefore, the video to be processed is buffered in the video buffer, and the complete video is not required to be downloaded again when the video screenshot request of the screenshot of 2000 ms is executed, so that the video to be processed can be directly obtained from the video buffer.
Therefore, whether the video cache contains the video to be processed corresponding to the video identification and the video processing parameter can be judged, so that when the video cache contains the video to be processed corresponding to the video identification and the video processing parameter, the video to be processed is directly obtained from the video cache, and the complete video to be processed is not downloaded.
The video to be processed is directly obtained from the video cache, instead of downloading the complete video, so that the flow cost of downloading can be saved, and meanwhile, the video to be processed can be obtained more quickly, and the video processing speed is improved.
Correspondingly, when the video cache does not contain the video to be processed corresponding to the video identification and the video processing parameters, the video to be processed needs to be downloaded when the video to be processed is acquired.
In one implementation manner, the method for the video processing server to acquire the video to be processed may include:
and downloading the video to be processed from the authorized address under the condition that the video cache does not contain the video to be processed corresponding to the video identification and the video processing parameter.
The authorization address is determined by the object storage server based on the storage position of the video to be processed and is sent to the video processing server, taking a screenshot request initiated by the client through the HTTP protocol as an example, in the following cases
http://bj.oss.XXX.storage/{bucket}/xx.mp4x-oss-process=video/snapshot,t_1000_2000,f_jpg,w_800
In the video processing request, http:// bj.oss.XXX.storage/{ socket }/xx.mp4 represents the video storage address of the video xx.mp4, and the video storage address can be obtained based on the video processing request.
It will be appreciated that the number of video processing requests is large, and if these requests are all directly accessed to the storage address of the video, the security of the object storage server will be affected. Thus, in general, the video memory address is not externally accessible, i.e., there is no right for an external user to directly access the video memory address. The object storage service terminal therefore generates an authorized address of the video based on the storage address of the video for authorizing the external user so that the external user can access the video through the authorized address.
Specifically, an authorization parameter may be added after the storage address of the video to indicate that the video address is authorized, and the user may access the video.
In an implementation manner, a video processing server segments a video to be processed in an authorized address according to video processing parameters to obtain a video segment address; downloading the video clip from the video clip address.
When downloading, the method can download in a slice downloading mode, and the slice downloading mode can only download the segments corresponding to the video processing parameters of the video processing request in the video to be processed, so that compared with downloading the complete video, the method has the advantage that the time for downloading the video segments is shorter, and the video processing speed can be improved.
Specifically, when downloading a video clip, the video clip address needs to be determined first. Firstly, slicing is carried out on a video to be processed, one percent of the size of the video to be processed can be used as a preset slicing size, and in an actual application scene, the minimum slicing size is 4MB and the maximum slicing size is 50MB. According to the video processing parameters in the video processing request, the time information of the video segment to be processed can be obtained, then the segment interval of the video segment of the video to be processed is determined, finally the address of the segment interval containing the video segment to be processed is used as the video segment address, the video segment address can be obtained by adding the corresponding target parameters in the authorized address, for example, the starting time and the ending time of the segment interval are used as the target parameters.
In the case where the video processing operation is generally performed only on a part of the complete video, the video may be divided into two parts, i.e., a necessary video, i.e., a video clip to be processed, and an unnecessary video, and the video downloaded from the video clip address is the video clip to be processed, not the complete video, it will be understood that the time required for downloading the video clip is less than that required for downloading the complete video, and the time consumed for downloading the unnecessary part of the video to be processed is avoided.
After the video acquisition method provided by the embodiment acquires the video to be processed or the video fragment of the video to be processed, the corresponding video processing operation is executed based on the video processing request, so that the video processing result can be obtained.
Specifically, processing the video clips according to the video processing parameters to obtain a second processing result; and caching the second processing result into a result cache.
Specifically, the video clip can be processed correspondingly through the corresponding processing module according to the video processing type contained in the video processing request, the second processing result can be cached according to the caching key value, and when the second processing result is cached, the second processing result can be cached according to the caching key value, namely, the video object name, namely, the video identifier, the video processing operation type name and the time information to be processed, namely, the video processing parameter, in the result caching.
It will be appreciated that the second processing result is also a video processing result, and may be obtained as a processing result based on the video processing request.
Aiming at the data cached in the result cache and the video cache, the video processing server is specifically used for acquiring the first expiration data clearing time and clearing the processing result exceeding the first expiration data clearing time in the result cache; and acquiring second expiration data clearing time, and clearing the video data exceeding the second expiration data clearing time in the video cache.
The total amount of video is huge while the video is also time efficient, it being understood that the amount of video processing requests for a particular video may be different for different time periods. For example, during a holiday, a large number of video processing requests for video corresponding to the holiday may be received, while at other times there may be little initiated video processing requests for video corresponding to the holiday.
The first expiration data clearing time and the second expiration data clearing time can be the same or different, and can be set according to actual conditions, and can be hours, days or even months.
In an actual application scenario, since some upstream services, such as a video information acquisition service, a video screenshot service, and a video GIF extraction service, may belong to different departments, a corresponding video processing service needs to be deployed separately, so that video processing interfaces are increasing. According to the technical scheme provided by the embodiment of the invention, by establishing a unified video processing center, various video processing functions are aggregated, and the problem that the video processing is not unified and standardized due to different video processing types can be avoided.
Specifically, the initiated video processing Request may be normalized by a Request specification (Request specification), and a processing parameter x-oss-process=video/{ process }, where { process } represents a video processing method, may be appended to the video address.
For example, x-oss-process=video/snapshot, t_1000, w_200_h_100, represents a screenshot of a video for 1000 milliseconds, with a picture size of 200x100.
The content format returned after the video processing can be normalized by the Response specification (Response specification). When the video processing reports errors, all video processing types correspond to the same error reporting return format. And normally responding, and returning the needed content according to the preset format corresponding to the video processing type.
The technical scheme provided by the embodiment of the invention provides three methods for obtaining the video processing result, which can avoid downloading the complete video, save the time consumed by downloading the complete video in the video processing process, and accelerate the video processing process, so that the video processing speed can be improved.
As shown in fig. 6, an embodiment of the present invention provides a video processing apparatus, which is applied to a video processing service system, where the video processing service system includes an object storage service side and a video processing service side, the object storage module includes a first receiving module 601, a determining module 602, and a first forwarding module 603, the video processing service side includes a second receiving module 604 and an obtaining module 605, and the apparatus includes:
A first receiving module 601, configured to receive a video processing request sent by a client; the video processing request comprises a video identifier of the video to be processed;
a determining module 602, configured to determine a video processing server corresponding to the video identifier;
a first forwarding module 603, configured to forward the video processing request to a video processing server;
a second receiving module 604, configured to receive a video processing request sent by the object storage server;
the obtaining module 605 is configured to obtain a processing result or a video to be processed corresponding to the video identifier based on the video identifier.
Optionally, the determining module 602 is specifically configured to determine, according to the video identifier, a storage location of the video to be processed, and determine, as a video processing server corresponding to the video identifier, a video processing server with a distance between the storage location and the storage location within a preset range.
Optionally, the video processing request further includes video processing parameters; the acquisition module 605 includes:
the first obtaining sub-module is used for obtaining the first processing result from the result cache under the condition that the result cache contains the first processing result corresponding to the video identification and the video processing parameter.
Optionally, the acquiring module 605 includes:
the second acquisition sub-module is used for judging whether the video cache contains the video to be processed corresponding to the video identification and the video processing parameters or not under the condition that the result cache does not contain the first processing result corresponding to the video identification and the video processing parameters; under the condition that the video cache contains the video to be processed corresponding to the video identification and the video processing parameters, the video to be processed is obtained from the video cache.
Optionally, the object storage server further includes a second forwarding module, and the apparatus further includes:
the second forwarding module is used for obtaining an authorized address based on the storage position of the video to be processed after the video processing server corresponding to the video identifier is determined, and forwarding the authorized address of the video to be processed to the video processing server;
the acquisition module 605 includes:
and the downloading sub-module is used for downloading the video to be processed from the authorized address under the condition that the video cache does not contain the video to be processed corresponding to the video identification and the video processing parameter.
Optionally, the downloading sub-module is specifically configured to segment the video to be processed in the authorized address according to the video processing parameter to obtain a video segment address; downloading the video clip from the video clip address.
Optionally, the acquiring module 605 further includes:
the buffer sub-module is used for processing the video clips according to the video processing parameters after the video clips are downloaded from the video clip addresses to obtain a second processing result; and caching the second processing result into a result cache.
Optionally, the first obtaining sub-module is specifically configured to obtain, when the result cache includes a first processing result corresponding to the video identifier and the video processing parameter, a cache key value according to the video processing parameter and attribute information of the video to be processed; and acquiring a first processing result from the result cache according to the cache key value.
Optionally, the video processing parameter comprises a video processing type; the first acquisition sub-module is specifically used for distributing the video processing request to the processing module corresponding to the video type; under the condition that the result cache contains a first processing result corresponding to the video identification and the video processing parameter, the first processing result is obtained from the result cache through the processing module.
In the technical scheme provided by the embodiment of the invention, after the first receiving module receives the video processing request, the determining module determines the video processing server corresponding to the video identifier of the video to be processed, so that the first forwarding module can forward the video processing request of the same video to be processed to the same video processing server when forwarding the video processing request, and further, after the second receiving module receives the forwarded video processing request, the obtaining module does not need to repeatedly download the same video to be processed aiming at the video processing request of the same video to be processed, thereby avoiding the time consumed by downloading the same video, and improving the video processing speed.
The embodiment of the present invention further provides an electronic device, as shown in fig. 7, including a processor 701, a communication interface 702, a memory 703 and a communication bus 704, where the processor 701, the communication interface 702, and the memory 703 perform communication with each other through the communication bus 704,
A memory 703 for storing a computer program;
the processor 701 is configured to implement the method steps of the video processing method when executing the program stored in the memory 703.
The communication bus mentioned by the above terminal may be a peripheral component interconnect standard (Peripheral Component Interconnect, abbreviated as PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, abbreviated as EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the terminal and other devices.
The memory may include random access memory (Random Access Memory, RAM) or non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; but also digital signal processors (Digital Signal Processor, DSP for short), application specific integrated circuits (Application Specific Integrated Circuit, ASIC for short), field-programmable gate arrays (Field-Programmable Gate Array, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
In yet another embodiment of the present invention, there is also provided a computer readable storage medium having a computer program stored therein, which when executed by a processor, implements the video processing method of any of the above embodiments.
In yet another embodiment of the present invention, a computer program product comprising instructions which, when run on a computer, cause the computer to perform the video processing method of any of the above embodiments is also provided.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for the apparatus, electronic device, computer storage medium, and computer program product embodiments, the description is relatively simple, as it is substantially similar to the method embodiments, with reference to the description of the method embodiments in part.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims (21)

1. A video processing system, the system comprising: the system comprises a client, an object storage server and a video processing server;
the client is used for sending a video processing request, wherein the video processing request comprises a video identifier of a video to be processed;
the object storage server is used for receiving the video processing request; determining a video processing server corresponding to the video identifier; forwarding the video processing request to the video processing server;
the video processing server is used for receiving the video processing request and acquiring a processing result or a video to be processed corresponding to the video identifier based on the video identifier.
2. The system according to claim 1, wherein the object storage server is specifically configured to determine a storage location of the video to be processed according to the video identifier, and determine a video processing server with a distance between the storage locations in a preset range as the video processing server corresponding to the video identifier.
3. The system of claim 2, wherein the video processing request further comprises video processing parameters;
the video processing server is specifically configured to obtain, when a result cache includes a first processing result corresponding to the video identifier and the video processing parameter, the first processing result from the result cache.
4. The system of claim 3, wherein the video processing server is specifically configured to determine whether a video buffer contains a video to be processed corresponding to the video identifier and the video processing parameter when the result buffer does not contain the first processing result corresponding to the video identifier and the video processing parameter, and obtain the video to be processed from the video buffer when the video buffer contains the video to be processed corresponding to the video identifier and the video processing parameter.
5. The system of claim 4, wherein the object storage server is further configured to obtain an authorized address based on a storage location of the video to be processed, and forward the authorized address of the video to be processed to the video processing server;
The video processing server is specifically configured to download the video to be processed from the authorized address when the video cache does not include the video identifier and the video to be processed corresponding to the video processing parameter.
6. The system of claim 5, wherein the video processing server is specifically configured to segment the video to be processed in the authorized address according to the video processing parameter to obtain a video clip address, and download the video clip from the video clip address.
7. The system of claim 6, wherein the video processing server is further configured to process the video segment according to the video processing parameter to obtain a second processing result, and cache the second processing result in a result cache.
8. The system of claim 3, wherein the system further comprises a controller configured to control the controller,
the video processing server is specifically configured to obtain a buffer key value according to a video processing parameter and attribute information of the video to be processed when a result buffer contains a first processing result corresponding to the video identifier and the video processing parameter, and obtain the first processing result from the result buffer according to the buffer key value.
9. The system of claim 3, wherein the video processing parameters include a video processing type;
the video processing server is specifically configured to distribute the video processing request to a processing module corresponding to the video type; and under the condition that the result cache contains the first processing result corresponding to the video identification and the video processing parameter, acquiring the first processing result from the result cache through the processing module.
10. A video processing method, applied to a video processing system, the video processing system including an object storage server and a video processing server, the method comprising:
the object storage server receives a video processing request sent by a client; the video processing request comprises a video identifier of a video to be processed; determining a video processing server corresponding to the video identifier; forwarding the video processing request to the video processing server;
the video processing server receives a video processing request sent by the object storage server and acquires a processing result or a video to be processed corresponding to the video identifier based on the video identifier.
11. The method of claim 10, wherein the determining the video processing server corresponding to the video identifier comprises:
the object storage server determines the storage position of the video to be processed according to the video identification, and determines a video processing server with the distance between the storage position and the storage position in a preset range as the video processing server corresponding to the video identification.
12. The method of claim 11, wherein the video processing request further comprises video processing parameters;
the step of obtaining the processing result or the video to be processed corresponding to the video identifier based on the video identifier comprises the following steps:
and under the condition that the result cache contains the first processing result corresponding to the video identification and the video processing parameter, the video processing server acquires the first processing result from the result cache.
13. The method according to claim 12, wherein the obtaining, based on the video identifier, a processing result or a video to be processed corresponding to the video identifier includes:
the video processing server judges whether the video cache contains a video to be processed corresponding to the video identification and the video processing parameter under the condition that the result cache does not contain a first processing result corresponding to the video identification and the video processing parameter; and under the condition that the video cache contains the video to be processed corresponding to the video identification and the video processing parameter, acquiring the video to be processed from the video cache.
14. The method of claim 13, wherein after said determining the video processing server to which the video identifier corresponds, the method further comprises:
the object storage server obtains an authorized address based on the storage position of the video to be processed, and forwards the authorized address of the video to be processed to the video processing server;
the step of obtaining the processing result or the video to be processed corresponding to the video identifier based on the video identifier comprises the following steps:
and the video processing server downloads the video to be processed from the authorized address under the condition that the video cache does not contain the video to be processed corresponding to the video identification and the video processing parameter.
15. The method of claim 14, wherein said downloading the video to be processed from the authorized address comprises:
the video processing server side segments the video to be processed in the authorized address according to the video processing parameters to obtain a video segment address; downloading the video clip from the video clip address.
16. The method of claim 15, wherein after said downloading said video clip from said video clip address, said method further comprises:
The video processing server processes the video clips according to the video processing parameters to obtain a second processing result; and caching the second processing result into the result cache.
17. The method according to claim 12, wherein, when the video processing server side includes the first processing result corresponding to the video identifier and the video processing parameter in a result buffer, the obtaining the first processing result from the result buffer includes:
the video processing server obtains a cache key value according to the video processing parameter and the attribute information of the video to be processed under the condition that the result cache contains a first processing result corresponding to the video identifier and the video processing parameter; and acquiring the first processing result from the result cache according to the cache key value.
18. The method of claim 12, wherein the video processing parameters include a video processing type;
the video processing server obtains a first processing result from a result cache under the condition that the result cache contains the video identifier and the first processing result corresponding to the video processing parameter, and the method comprises the following steps:
The video processing server distributes the video processing request to a processing module corresponding to the video type; and under the condition that the result cache contains the first processing result corresponding to the video identification and the video processing parameter, acquiring the first processing result from the result cache through the processing module.
19. The utility model provides a video processing device, its characterized in that, the device is applied to video processing system, video processing system includes object storage service end and video processing service end, object storage service end includes first receiving module, determination module and first transfer module, video processing service end includes second receiving module and acquisition module, the device includes:
the first receiving module is used for receiving a video processing request sent by a client; the video processing request comprises a video identifier of a video to be processed;
the determining module is used for determining a video processing server corresponding to the video identifier;
the first forwarding module is configured to forward the video processing request to the video processing server;
the second receiving module is used for receiving a video processing request sent by the object storage server;
The acquisition module is used for acquiring a processing result or a video to be processed corresponding to the video identification based on the video identification.
20. The electronic equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
a processor for carrying out the method steps of any one of claims 10 to 18 when executing a program stored on a memory.
21. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored therein a computer program which, when executed by a processor, implements the method steps of any of claims 10-18.
CN202310011807.4A 2023-01-05 2023-01-05 Video processing system, method, device, electronic equipment and storage medium Active CN116033187B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310011807.4A CN116033187B (en) 2023-01-05 2023-01-05 Video processing system, method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310011807.4A CN116033187B (en) 2023-01-05 2023-01-05 Video processing system, method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN116033187A true CN116033187A (en) 2023-04-28
CN116033187B CN116033187B (en) 2024-08-30

Family

ID=86071900

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310011807.4A Active CN116033187B (en) 2023-01-05 2023-01-05 Video processing system, method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116033187B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104837050A (en) * 2015-03-23 2015-08-12 腾讯科技(北京)有限公司 Information processing method and terminal
WO2018228234A1 (en) * 2017-06-14 2018-12-20 中兴通讯股份有限公司 Video caching method and video caching device
CN110839074A (en) * 2019-11-07 2020-02-25 北京首钢自动化信息技术有限公司 Data request receiving and processing method and device
CN112486074A (en) * 2020-12-03 2021-03-12 上海哔哩哔哩科技有限公司 Data processing system, method and device
WO2021218035A1 (en) * 2020-04-30 2021-11-04 武汉旷视金智科技有限公司 Video obtaining method and apparatus, terminal device, and server

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104837050A (en) * 2015-03-23 2015-08-12 腾讯科技(北京)有限公司 Information processing method and terminal
WO2018228234A1 (en) * 2017-06-14 2018-12-20 中兴通讯股份有限公司 Video caching method and video caching device
CN110839074A (en) * 2019-11-07 2020-02-25 北京首钢自动化信息技术有限公司 Data request receiving and processing method and device
WO2021218035A1 (en) * 2020-04-30 2021-11-04 武汉旷视金智科技有限公司 Video obtaining method and apparatus, terminal device, and server
CN112486074A (en) * 2020-12-03 2021-03-12 上海哔哩哔哩科技有限公司 Data processing system, method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李俊东: "图片自动清洗标注平台的设计与实现", 《中国优秀硕士学位论文全文数据库》信息科技辑, no. 2021, 15 March 2021 (2021-03-15) *

Also Published As

Publication number Publication date
CN116033187B (en) 2024-08-30

Similar Documents

Publication Publication Date Title
US9888089B2 (en) Client side cache management
CN111970315A (en) Method, device and system for pushing message
US10771552B2 (en) Content management
CN109391673B (en) Method, system and terminal equipment for managing update file
US11463753B2 (en) Method and apparatus for downloading resources
WO2017167050A1 (en) Configuration information generation and transmission method, and resource loading method, apparatus and system
CN108683668B (en) Resource checking method, device, storage medium and equipment in content distribution network
US20150237113A1 (en) Method and system for file transmission
EP3170091B1 (en) Method and server of remote information query
CN109040263B (en) Service processing method and device based on distributed system
CN110460584B (en) Access request processing method and device, electronic equipment and computer readable medium
US20160004850A1 (en) Secure download from internet marketplace
CN113517985B (en) File data processing method and device, electronic equipment and computer readable medium
CN109873855A (en) A kind of resource acquiring method and system based on block chain network
CN111355986A (en) Message processing method and device in live broadcast room and storage medium
CN113645287A (en) Automobile message storage method and device and automobile message storage system
CN112035402A (en) File storage method and device and terminal equipment
CN115694699A (en) Time delay parameter acquisition method and device, electronic equipment and storage medium
CN112069386B (en) Request processing method, device, system, terminal and server
CN110741617A (en) Resource updating method and device, computer equipment and storage medium
CN115202800A (en) Edge cloud service data processing method and device, computer equipment and storage medium
CN116033187B (en) Video processing system, method, device, electronic equipment and storage medium
CN117082073A (en) File storage method, file downloading method, device, equipment and storage medium
CN113138943B (en) Method and device for processing request
US10798464B1 (en) Streaming delivery of client-executable code

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
GR01 Patent grant
GR01 Patent grant