Video transcoding method, device, electronic device and storage medium
By obtaining the video playback progress drag request and determining the transcoding information, the problem of the user waiting time for too long when dragging the progress bar to view untranscoding videos is solved, real-time video transcoding is achieved, and the user experience is improved.
Patent Information
- Application Number
- CN202111539518.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-15
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2041-12-15
AI Technical Summary
In the prior art, when playing videos, users need to wait when dragging the progress bar to view untranscoded videos, especially when the video is long and the drag position is backward, the waiting time is longer, resulting in poor user experience.
By obtaining the video's playback progress drag request, the playback position corresponding to the transcoding information and the drag request is determined, and the video is transcoded when the preset transcoding conditions are met, thereby reducing the user's waiting time.
It realizes video transcoding according to the playback position corresponding to the user drag request, reducing user waiting time and improving user experience.
Smart Images

Figure CN114245175B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to the field of multimedia technology. Background Art
[0002] Video transcoding technology refers to changing the encoding method of existing video data, re-encoding and packaging the video, using the same interface protocol, and transmitting and sharing it in a streaming manner between different video products. In today's Internet informatization process, people's social entertainment is not only satisfied with text and images, but also has an increasing demand for video. However, there are many video encoding and packaging formats, and the amount of data carried is large. When playing videos on the Internet, video transcoding technology is generally used to transcode the video and provide a unified encoding and packaging format for users to play.
[0003] In the prior art, when a user plays a transcoded video, if he drags the video progress bar to view the untranscoded video, he needs to wait. When the video is long and the dragging position is far back, the user needs to wait a long time before watching the video, resulting in a poor user experience. Summary of the invention
[0004] The present disclosure provides a video transcoding method, device, electronic device and storage medium.
[0005] According to one aspect of the present disclosure, a video transcoding method is provided, comprising:
[0006] Obtain a drag request for the playback progress of the video, and determine the playback position corresponding to the transcoding information and the drag request;
[0007] When it is determined that the drag request and the playback position meet the preset transcoding condition, the video is transcoded according to the playback position and the transcoding information.
[0008] According to another aspect of the present disclosure, a video transcoding device is provided, comprising:
[0009] An acquisition module, used to acquire a drag request for the playback progress of a video, and determine the playback position corresponding to the transcoding information and the drag request;
[0010] The transcoding module is used to transcode the video according to the playback position and the transcoding information when it is determined that the drag request and the playback position meet the preset transcoding conditions.
[0011] According to another aspect of the present disclosure, there is provided an electronic device, comprising:
[0012] at least one processor; and
[0013] a memory communicatively connected to the at least one processor; wherein,
[0014] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method in any embodiment of the present disclosure.
[0015] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided. The computer instructions are used to enable a computer to execute the method in any embodiment of the present disclosure.
[0016] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the method in any embodiment of the present disclosure is implemented.
[0017] The present disclosure provides a video transcoding method, device, electronic device and storage medium, which obtains a drag request for the playback progress of a video, determines the transcoding information and the playback position corresponding to the drag request; and transcodes the video according to the playback position and the transcoding information when it is determined that the drag request and the playback position meet the preset transcoding conditions. In the technical solution of the present disclosure, transcoding can be performed according to the playback position corresponding to the user's drag request, thereby reducing the user's waiting time and improving the user experience.
[0018] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0020] Figure 1 is a flowchart of a video transcoding method in one embodiment of the present disclosure;
[0021] Figure 2 is a flowchart of a video transcoding method in one embodiment of the present disclosure;
[0022] Figure 3 is a schematic diagram of a video transcoding system in an embodiment of the present disclosure;
[0023] Figure 4 is an interaction timing diagram of each layer in a video transcoding system in an embodiment of the present disclosure;
[0024] Figure 5 It is a schematic diagram of the processing process of each layer in the video transcoding system in one embodiment of the present disclosure;
[0025] Figure 6 is a schematic diagram of a video transcoding device in one embodiment of the present disclosure;
[0026] Figure 7 It is a block diagram of an electronic device used to implement the video transcoding method of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0027] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0028] The present invention provides a video transcoding method. Figure 1 1 is a flowchart of a video transcoding method according to an embodiment of the present disclosure. The method can be applied to a video transcoding device. For example, when the device is deployed on a server or other processing device, the device can perform video transcoding. In some possible implementations, the method can also be implemented by a processor calling a computer-readable instruction stored in a memory. Figure 1 As shown, the video transcoding method provided by the present disclosure includes:
[0029] Step S101, obtaining a drag request for the playback progress of a video, and determining the playback position corresponding to the transcoding information and the drag request;
[0030] The execution subject of the embodiment of the present disclosure may be a server, which may be a single server or a server cluster composed of multiple servers. When watching a video, the user may adjust the video playback progress through the playback progress bar. The user device generates a drag request according to the user's drag operation and sends it to the server. The drag request carries user device information, video definition information, and the playback position corresponding to the drag request, etc., wherein the playback position corresponding to the drag request may be the playback position at the playback time point corresponding to the drag request.
[0031] There are two ways to determine the transcoding information:
[0032] In one case, before obtaining a request to drag the playback progress of a video, a user's request to play the video has been obtained, and the transcoding information required for transcoding the video can be determined and stored according to the playback request. When obtaining a request to drag the playback progress of the video, the pre-stored transcoding information is read.
[0033] In another case, before obtaining the drag request for the video playback progress, the user's request for video playback is not obtained, and the transcoding information can be determined according to the user device information and video definition information carried in the drag request.
[0034] Step S102: When it is determined that the drag request and the playback position meet a preset transcoding condition, the video is transcoded according to the playback position and the transcoding information.
[0035] Determine whether the drag request and the play position meet the preset transcoding condition, wherein the preset transcoding condition can be a condition for transcoding configured according to specific needs. If the drag request and the play position meet the preset transcoding condition, transcoding starts from the video frame corresponding to the play position, so as to shorten the waiting time of the user.
[0036] In the related art, the video is transcoded in advance by pre-transcoding. After the user uploads the video, the video is transcoded in advance, and the subsequent user can directly watch the transcoded video data when playing. However, the number of videos uploaded by users is huge, and a large part of these videos are not played. Pre-transcoding all videos wastes computing resources, resulting in excessive costs. In addition, if transcoding is triggered by user playback, that is, the user does not transcode the video after uploading it, only when a user plays the video, the video is transcoded from the beginning of the video, and the transcoded video data is sent to the user, and the user plays the transcoded video while transcoding. In this case, if the user drags the progress bar while playing the video, the video at the untranscoded position cannot be played. It can only be watched after the video at the playback position is transcoded, and the user needs to wait. When the video is long and the drag position is backward, the user has to wait for a long time, resulting in a poor user experience.
[0037] The video transcoding method provided by the embodiment of the present disclosure can save computing resources on the one hand, and can perform transcoding according to the playback position corresponding to the user's dragging request on the other hand, thereby reducing the user's waiting time and improving the user experience.
[0038] In a possible implementation, transcoding the video according to the playback position and the transcoding information includes:
[0039] Determine the key frame of the video closest to the playback position, start decoding from the key frame, and obtain decoded data;
[0040] The decoded data is encoded according to the transcoding information.
[0041] In actual applications, after the server determines the playback position corresponding to the drag request, it determines the video frame closest to the playback position. If the video frame is a key frame, it decodes from the key frame according to the transcoding information. Since the video is compressed data, the video is decoded into data before compression at this time. The decoded data is then re-encoded according to the transcoding information. If the video frame closest to the playback position is not a key frame but an ordinary frame, the key frame closest to the ordinary frame is determined, and decoding is started from the key frame. The video is decoded into data before compression, and then the decoded data is re-encoded according to the transcoding information. Among them, the transcoding information may include but is not limited to the transcoding format and the fragment size. The transcoded data is stored in fragments. For example, a fragment can represent 1s or 2s of video data.
[0042] In the disclosed embodiment, transcoding is started according to the playback position corresponding to the drag request, which can reduce the user's waiting time and improve the user experience; re-encoding is performed according to the transcoding information, and the transcoding information is determined according to the drag request, so that the encoded video data that meets the user's needs can be obtained.
[0043] In a possible implementation, obtaining a drag request for the playback progress of a video and determining the playback position corresponding to the transcoding information and the drag request include:
[0044] Obtain a drag request for the video playback progress, parse the drag request, and obtain user device information, video definition information, and playback position;
[0045] Determine transcoding information based on user device information and video definition information, where the transcoding information includes transcoding format and segment size.
[0046] In actual applications, the server obtains a drag request for the playback progress of the video and parses the drag request to obtain user device information, video definition information, and playback position. The user device information may be device-related information such as the user device model. The video definition information may be the definition information (high definition, ordinary, etc.) pre-selected by the user determined based on the analysis result obtained by parsing the drag request, or the definition information determined based on the user's identity level (VIP user, ordinary user, etc.). The transcoding format and fragment size supported by the user device are determined in combination with the user device information and the video definition information.
[0047] In the disclosed embodiment, by parsing the drag request, the transcoding information and playback position required for transcoding can be obtained, which serve as the data basis for subsequent transcoding.
[0048] In a possible implementation, transcoding the video according to the playback position and the transcoding information includes:
[0049] The video is divided into multiple video segments. When there are multiple drag requests, if the same video segment includes playback positions corresponding to multiple drag requests, the video is transcoded according to one playback position among the multiple playback positions and the transcoding information.
[0050] In actual applications, multiple drag requests for playback positions that are close to each other may be obtained within the same time range, which will cause too many transcoding processes in a short period of time and high resource pressure. In order to solve this problem, the embodiment of the present disclosure segments the video by time, and each video segment corresponds to a time range. For all drag requests that fall into the same video segment within the preset time range, one of the multiple playback positions in this video segment can be used as the transcoding start position. For example, transcoding is performed according to the playback position corresponding to the first drag request in this video segment as the transcoding start position. It is understandable that other playback positions in this video segment can also be used as the transcoding start position, and the present disclosure does not limit this.
[0051] In the embodiment of the present disclosure, when multiple drag requests with similar distances are obtained within a short time range, transcoding is started according to the playback position corresponding to one of the drag requests instead of initiating multiple transcoding tasks. The purpose is to reduce resource pressure and improve the stability of video transcoding.
[0052] In a possible implementation, the video transcoding method of the embodiment of the present disclosure further includes:
[0053] For each drag request, a virtual download address is obtained, and the virtual download address is sent to the user device, so that the user device obtains the transcoded video according to the virtual download address for playback.
[0054] In actual applications, when there are multiple drag requests, although only one transcoding task is initiated, for each drag request among the multiple drag requests, the server obtains the virtual download address and sends it to the user device. The user device can request the interface according to the virtual download address to obtain the transcoded video.
[0055] In the disclosed embodiment, the server obtains a virtual download address for each drag request and sends it to the user device, which can avoid problems such as packet loss and timeout caused by network communication problems and improve the accuracy and robustness of video transcoding.
[0056] In a possible implementation, after determining the transcoding information and the playback position corresponding to the drag request, the method further includes:
[0057] In the case where there are multiple drag requests, if the number of times corresponding to the current drag request is less than the preset number threshold within the preset time range, and the video frame corresponding to the playback position corresponding to the current drag request has not been transcoded, it is determined that the current drag request and the corresponding playback position meet the preset transcoding conditions.
[0058] In actual applications, whether the preset transcoding conditions are met can be determined by the number of drag requests within the preset time range and whether the video frame corresponding to the playback position of the drag request has been transcoded. If the number of drags within the preset time range exceeds the preset threshold, a fuse mechanism is adopted to wait for the previous transcoding task and no new transcoding task is initiated to avoid the problem of high resource pressure caused by too many transcoding tasks in a short period of time. In addition, whether to initiate a new transcoding task for transcoding also depends on whether the video frame corresponding to the playback position has not been transcoded. If it has been transcoded, there is no need to repeat the transcoding.
[0059] In the disclosed embodiment, whether the preset transcoding conditions are met is determined by judging whether the number of times corresponding to the current drag request is less than a preset number threshold within a preset time range, and whether the video frame corresponding to the playback position corresponding to the current drag request has been transcoded. This can avoid the problem of high resource pressure caused by too many transcoding tasks in a short period of time, and can also avoid the problem of waste of computing resources due to repeated transcoding.
[0060] In a possible implementation, after determining the transcoding information and the playback position corresponding to the drag request, the method further includes:
[0061] If the time between the current drag request and the previous drag request is greater than a preset time threshold, and the video frame corresponding to the playback position corresponding to the current drag request has not been transcoded, it is determined that the current drag request and the corresponding playback position meet the preset transcoding condition.
[0062] In actual applications, if the time between the current drag request and the previous drag request is short, that is, the playback position corresponding to the current drag request is close to the playback position corresponding to the previous drag request, then the transcoding task starting from the playback position corresponding to the previous drag request will soon be transcoded to the transcoding position corresponding to the current drag request. In order to save computing resources, no new transcoding task is initiated. In addition, whether to initiate a new transcoding task for transcoding also depends on whether the video frame corresponding to the playback position has not been transcoded. If it has been transcoded, there is no need to repeat the transcoding. Therefore, if the time between the current drag request and the previous drag request is greater than the preset time threshold, and the video frame corresponding to the playback position corresponding to the current drag request has not been transcoded, the preset transcoding condition is met, and a new transcoding task is initiated for transcoding.
[0063] In the disclosed embodiment, by judging whether the time from the current drag request to the previous drag request is greater than a preset time threshold and the video frame corresponding to the playback position corresponding to the current drag request has not been transcoded, it is determined whether the preset transcoding condition is met, thereby saving computing resources and avoiding the problem of computing resource waste due to repeated transcoding.
[0064] In a possible implementation, the video transcoding method of the embodiment of the present disclosure further includes:
[0065] The transcoded video is stored in the preset distributed cache space according to the segment size in the transcoding information, and is saved according to the preset saving time.
[0066] In actual applications, the transcoded video is stored in a preset distributed cache space according to the segment size in the transcoding information, and the saving time is preconfigured and saved according to the preconfigured saving time.
[0067] In the disclosed embodiment, the transcoded video data is stored in a distributed cache space. The distributed cache can read data with high performance, dynamically expand cache nodes, automatically discover and switch faulty nodes, automatically balance data partitions, and provide users with a graphical management interface for easy deployment and maintenance.
[0068] In a possible implementation, the video transcoding method of the embodiment of the present disclosure further includes:
[0069] Before obtaining a drag request for the playback progress of the video, obtaining a playback request for the video, and transcoding the video from the start time of the video playback;
[0070] After the playback position is obtained, if the transcoding performed from the start time reaches the playback position, the transcoding is stopped.
[0071] In actual applications, if a play request for a video is obtained before a drag request for the video's play progress is obtained, for example, the server first obtains a play request from a user clicking to play the video, transcodes from the start of the video, and then obtains a drag request from a user dragging the play progress bar, and transcodes from the play position corresponding to the drag request. The video is transcoded from the start of the video's play as a transcoding task, and then another transcoding task is initiated based on the play position corresponding to the drag request. The two tasks can be performed synchronously. When the first transcoding task transcodes to the play position corresponding to the second transcoding task, the first transcoding task stops transcoding, thereby avoiding repeated transcoding.
[0072] In the disclosed embodiment, before the drag request is obtained, a play request for the video has been obtained. When transcoding to the play position corresponding to the drag request is performed according to the play request, transcoding is stopped, thereby avoiding the waste of computing resources caused by repeated transcoding.
[0073] Figure 2 FIG. 1 is a flow chart of a video transcoding method in one embodiment of the present disclosure. Figure 2 As shown, the video transcoding method may include:
[0074] Step S201, obtaining a drag request for the playback progress of a video, parsing the drag request, and obtaining user device information, video definition information, and playback position.
[0075] Step S202: Determine transcoding information according to the user device information and the video definition information, where the transcoding information includes the transcoding format and the segment size.
[0076] Step S203, when there are multiple drag requests, if the number of times corresponding to the current drag request is less than the preset number threshold within the preset time range, and the video frame corresponding to the playback position corresponding to the current drag request has not been transcoded, it is determined that the current drag request and the corresponding playback position meet the preset transcoding conditions.
[0077] Step S204, when it is determined that the current drag request and the corresponding playback position meet the preset transcoding condition, determine the key frame of the video closest to the playback position, start decoding from the key frame, and obtain decoded data.
[0078] Step S205: encode the decoded data according to the transcoding information.
[0079] Step S206: Store the transcoded video in a preset distributed cache space according to the segment size in the transcoding information, and save it according to a preset saving time.
[0080] The video transcoding method provided by the embodiment of the present disclosure can save computing resources on the one hand, and can perform transcoding according to the playback position corresponding to the user's dragging request on the other hand, thereby reducing the user's waiting time and improving the user experience.
[0081] Figure 3 FIG. 1 is a schematic diagram of a video transcoding system in an embodiment of the present disclosure. The video transcoding system in this embodiment includes a scheduling layer server, a control layer server, a transcoding work layer server, and a distributed cache. Figure 3As shown, the scheduling layer server receives the drag request sent by the user device, and parses the drag request to obtain the transcoding information and playback position. The transcoding task count in the distributed cache is used to determine whether the current number of tasks exceeds the threshold. If it does not exceed the threshold, and the drag request and the corresponding playback position meet the preset transcoding conditions, the scheduling layer server initiates the transcoding task. The control layer server maintains the task status. If a new transcoding task is added, the task count in the distributed cache is updated, and the transcoding work layer server is waited for to pull the transcoding task. The transcoding work layer server obtains the video from the cloud video source, pulls the task from the control layer server to transcode the video, and uploads the transcoded segmented data to the distributed cache for storage.
[0082] Figure 4 FIG. 1 is a timing diagram of the interaction between the layers in the video transcoding system in one embodiment of the present disclosure. The video transcoding system in this embodiment includes an access scheduling layer, a transcoding control layer, a transcoding work layer, and a distributed cache. Figure 4 As shown, the user terminal sends a drag request to the access scheduling layer, and the access scheduling layer parses the drag request to obtain transcoding information and playback position. The current number of tasks is determined by counting the transcoding tasks in the distributed cache to determine whether it exceeds the threshold, and combined with the transcoding information and playback position data corresponding to the previous drag request stored in the distributed cache, it is determined whether the current drag request and the corresponding playback position meet the preset transcoding conditions (as shown in the "Drag transcoding related information judgment" in the figure). If the task does not exceed the threshold and meets the preset transcoding conditions, the access scheduling layer sends the transcoding task to the transcoding control layer, and the transcoding control layer returns the response information to the access scheduling layer (as shown in the "return" in the figure), and the transcoding control layer sends the transcoding information and playback position and other information (as shown in the "Cache drag transcoding related information") to the distributed cache for storage. The transcoding work layer pulls the transcoding task from the transcoding control layer, and starts video transcoding from the playback position corresponding to the dragging operation (as shown in the "Transcoding the dragging time point" in the figure), and uploads the transcoded data to the distributed cache. The transcoding work layer notifies the transcoding control layer of the processing status of the current task (as shown in the "Callback transcoding task status" in the figure). When the video transcoding is completed, the transcoded video is obtained from the distributed cache and sent to the user end for playback (as shown in the "Pull transcoded audio and video data" in the figure).
[0083] Figure 5 FIG. 1 is a schematic diagram of the processing process of each layer in a video transcoding system in an embodiment of the present disclosure. The video transcoding system in this embodiment includes an access scheduling layer, a transcoding control layer, and a transcoding work layer. Figure 5As shown, multiple user terminals communicate with the access scheduling layer through the gateway. The access scheduling layer determines that the number of transcoding tasks currently being processed does not exceed the preset threshold, and the drag transcoding condition is met. The drag request is parsed to determine the playback position corresponding to the drag request (as shown in the "Determine the drag time point and segment position"), and the user device type is analyzed to determine the transcoding encoding type supported by the user device, and a virtual download address is returned to the user terminal (as shown in the "Transcoding data download address"), and the transcoding task is sent to the transcoding control layer. The transcoding control layer maintains the drag transcoding task status, waits for the transcoding work layer to pull the transcoding task, interacts with the transcoding work, and processes the drag transcoding callback notification. The transcoding work layer determines the key frame closest to the playback position (as shown in the "seek video transcoding time point"), transcodes from the time point corresponding to the closest key frame, and stores the transcoded data in the distributed cache according to the segment size.
[0084] Figure 6 FIG. 1 is a schematic diagram of a video transcoding device in an embodiment of the present disclosure. Figure 6 As shown, the video transcoding device may include:
[0085] The acquisition module 601 is used to acquire a drag request for the playback progress of the video and determine the playback position corresponding to the transcoding information and the drag request;
[0086] The transcoding module 602 is used to transcode the video according to the playback position and the transcoding information when it is determined that the drag request and the playback position meet the preset transcoding condition.
[0087] The video transcoding device provided by the embodiment of the present disclosure obtains a drag request for the playback progress of a video, determines the transcoding information and the playback position corresponding to the drag request; and transcodes the video according to the playback position and the transcoding information when it is determined that the drag request and the playback position meet the preset transcoding conditions. In the technical solution of the present disclosure, transcoding can be performed according to the playback position corresponding to the user's drag request, thereby reducing the user's waiting time and improving the user experience.
[0088] In a possible implementation, the transcoding module 602 is configured to:
[0089] Determine the key frame of the video closest to the playback position, start decoding from the key frame, and obtain decoded data;
[0090] The decoded data is encoded according to the transcoding information.
[0091] In a possible implementation, the acquisition module 601 is used to:
[0092] Obtain a drag request for the video playback progress, parse the drag request, and obtain user device information, video definition information, and playback position;
[0093] Determine transcoding information based on user device information and video definition information, where the transcoding information includes transcoding format and segment size.
[0094] In a possible implementation, the transcoding module 602 is configured to:
[0095] The video is divided into multiple video segments. When there are multiple drag requests, if the same video segment includes playback positions corresponding to multiple drag requests, the video is transcoded according to one playback position among the multiple playback positions and the transcoding information.
[0096] In a possible implementation, the device further includes a sending module, configured to:
[0097] For each drag request, a virtual download address is obtained, and the virtual download address is sent to the user device, so that the user device obtains the transcoded video according to the virtual download address for playback.
[0098] In a possible implementation manner, the method further includes a first determining module, configured to:
[0099] In the case where there are multiple drag requests, if the number of times corresponding to the current drag request is less than the preset number threshold within the preset time range, and the video frame corresponding to the playback position corresponding to the current drag request has not been transcoded, it is determined that the current drag request and the corresponding playback position meet the preset transcoding conditions.
[0100] In a possible implementation manner, the method further includes a second determining module, configured to:
[0101] If the time between the current drag request and the previous drag request is greater than a preset time threshold, and the video frame corresponding to the playback position corresponding to the current drag request has not been transcoded, it is determined that the current drag request and the corresponding playback position meet the preset transcoding condition.
[0102] In a possible implementation, the device further includes a storage module, which is used to:
[0103] The transcoded video is stored in the preset distributed cache space according to the segment size in the transcoding information, and is saved according to the preset saving time.
[0104] In a possible implementation, a transcoding control module is further included, which is used to:
[0105] Before obtaining a drag request for the playback progress of the video, obtaining a playback request for the video, and transcoding the video from the start time of the video playback;
[0106] After the playback position is obtained, if the transcoding performed from the start time reaches the playback position, the transcoding is stopped.
[0107] The functions of each unit, module or sub-module in each device of the embodiments of the present disclosure can be found in the corresponding description in the above method embodiments, and will not be repeated here.
[0108] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0109] According to another aspect of the present disclosure, there is provided an electronic device, comprising:
[0110] at least one processor; and
[0111] a memory communicatively connected to the at least one processor; wherein,
[0112] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method in any embodiment of the present disclosure.
[0113] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided. The computer instructions are used to enable a computer to execute the method in any embodiment of the present disclosure.
[0114] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the method in any embodiment of the present disclosure is implemented.
[0115] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0116] like Figure 7As shown, the device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0117] A number of components in the device 700 are connected to the I / O interface 705, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a disk, an optical disk, etc.; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0118] The computing unit 701 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 701 performs the various methods and processes described above, such as a video transcoding method. For example, in some embodiments, the video transcoding method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 700 via ROM 702 and / or communication unit 709. When the computer program is loaded into RAM 703 and executed by the computing unit 701, one or more steps of the video transcoding method described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to perform the video transcoding method in any other appropriate manner (e.g., by means of firmware).
[0119] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0120] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0121] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0122] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0123] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0124] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0125] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0126] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A video transcoding method, the method comprising: Obtain a drag request for the playback progress of the video, and determine the transcoding information and the playback position corresponding to the drag request; In the case where there are multiple drag requests, if the number of drag requests within a preset time range is less than a preset number threshold, and the video frame corresponding to the playback position corresponding to the drag request is not transcoded, it is determined that the drag request and the corresponding playback position meet the preset transcoding condition; In the case where it is determined that the drag request and the playback position meet the preset transcoding condition, the video is divided into multiple video segments, and if the same video segment includes playback positions corresponding to multiple drag requests, one of the playback positions corresponding to the multiple drag requests is used as the transcoding start position corresponding to the multiple drag requests, and the video is transcoded according to the transcoding start position and the transcoding information; For each of the dragging requests, a virtual download address is obtained, and the virtual download address is sent to the user device, so that the user device obtains the transcoded video according to the virtual download address for playback.
2. The method according to claim 1, wherein: The obtaining of a drag request for the playback progress of the video and determining the transcoding information and the playback position corresponding to the drag request include: Obtaining a drag request for the playback progress of the video, parsing the drag request, and obtaining user device information, video definition information, and the playback position; The transcoding information is determined according to the user device information and the video definition information, where the transcoding information includes a transcoding format and a segment size.
3. The method according to claim 1, wherein: After determining the transcoding information and the playback position corresponding to the drag request, the method further includes: If the time between the drag request and the previous drag request is greater than a preset time threshold, and the video frame corresponding to the playback position corresponding to the drag request has not been transcoded, it is determined that the drag request and the corresponding playback position meet the preset transcoding condition.
4. The method according to claim 1 or 2, further comprising: The transcoded video is stored in a preset distributed cache space according to the segment size in the transcoding information, and is saved according to a preset saving time.
5. The method according to claim 1, further comprising: Before obtaining a request for dragging the playback progress of a video, obtaining a playback request for the video, and transcoding the video from the playback start time of the video; After the playback position is obtained, if the transcoding performed from the start time reaches the playback position, the transcoding is stopped.
6. A video transcoding device, the device comprising: An acquisition module, used to acquire a drag request for the playback progress of a video, and determine transcoding information and a playback position corresponding to the drag request; A first determination module is used to determine, when there are multiple drag requests, that the drag request and the corresponding playback position meet a preset transcoding condition if the number of drag requests within a preset time range is less than a preset number threshold and the video frame corresponding to the playback position corresponding to the drag request has not been transcoded; a transcoding module, configured to divide the video into a plurality of video segments when it is determined that the drag request and the playback position meet a preset transcoding condition; if the same video segment includes playback positions corresponding to a plurality of drag requests, use one of the playback positions corresponding to the plurality of drag requests as a transcoding start position corresponding to the plurality of drag requests; and transcode the video according to the transcoding start position and the transcoding information; The sending module is used to obtain a virtual download address for each drag request, and send the virtual download address to the user equipment, so that the user equipment obtains the transcoded video according to the virtual download address for playback.
7. The device according to claim 6, wherein: The acquisition module is used to: Obtaining a drag request for the playback progress of the video, parsing the drag request, and obtaining user device information, video definition information, and the playback position; The transcoding information is determined according to the user device information and the video definition information, where the transcoding information includes a transcoding format and a segment size.
8. The apparatus according to claim 6, further comprising a second determining module, configured to: If the time between the current drag request and the previous drag request is greater than a preset time threshold, and the video frame corresponding to the playback position corresponding to the current drag request has not been transcoded, it is determined that the current drag request and the corresponding playback position meet the preset transcoding condition.
9. The device according to claim 6, further comprising a storage module, configured to: The transcoded video is stored in a preset distributed cache space according to the segment size in the transcoding information, and is saved according to a preset saving time.
10. The apparatus according to claim 6, further comprising a transcoding control module, configured to: Before obtaining a request for dragging the playback progress of a video, obtaining a playback request for the video, and transcoding the video from the playback start time of the video; After the playback position is obtained, if the transcoding performed from the start time reaches the playback position, the transcoding is stopped.
11. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 5.
12. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 5.
13. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Video processing method and device, electronic equipment and storage medium
CN111526387A