Video downloading method and device, electronic equipment and readable storage medium
By acquiring the client's download progress and video frame identification information, the set of video segments to be downloaded is determined and mapped to time points for matching. This solves the problem of download interruption caused by video transcoding, achieves efficient video playback, saves time and resources, and improves the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING QIYI CENTURY SCI & TECH CO LTD
- Filing Date
- 2026-02-02
- Publication Date
- 2026-05-26
AI Technical Summary
When users download long videos with high bitrates, the download is interrupted due to video transcoding, requiring them to download the entire video again, which wastes time and bandwidth resources, affects user experience, and increases operating costs.
By obtaining the progress of the downloaded video on the client and the identification information of the last video frame, the set of video segments to be downloaded is determined. Then, the video frame content is matched in the video generated after transcoding on the server to find the mapping time point, thereby achieving seamless playback.
It saves download time and resources, ensures a continuous user experience, and reduces server bandwidth utilization and operating costs.
Smart Images

Figure CN122093592A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information processing technology, and in particular to a video downloading method, apparatus, electronic device, and readable storage medium. Background Technology
[0002] With the booming development of the internet video industry, downloading videos has become a daily activity for users, and the demand for video downloads is increasing day by day. Especially for high-definition long videos, users hope to have access to high-quality content at any time and enjoy an immersive viewing experience.
[0003] However, to achieve commercial functions and content optimization, video websites often re-produce or transcode videos, such as inserting advertisements into the original version, repairing the original version, or adjusting the resolution of the original version. After these operations are completed, the original version video in the downloading state is deleted to make way for the updated version. Because the original version video is invalid, it cannot be downloaded further, and only the complete updated version video can be downloaded again.
[0004] Therefore, in this situation, it is necessary to repeatedly download videos that have already been downloaded, which not only wastes a lot of time for users, but also wastes a lot of server bandwidth resources. Summary of the Invention
[0005] The purpose of this invention is to provide a video downloading method, apparatus, electronic device, and readable storage medium that can save downloading time and resources. The specific technical solution is as follows: In a first aspect of this invention, a video downloading method is provided, comprising: In response to the detection that the first video downloaded by the client is interrupted due to transcoding on the server side, the download progress of the first video already downloaded by the client is obtained; the download progress is used to indicate the amount of data downloaded and is associated with the identification information of the last downloaded video frame; Based on the download progress, determine the set of video segments to be downloaded from the second video generated after transcoding the first video, and download the set of video segments. Match the last downloaded video frame of the first video with the video frame content of the second video to determine the corresponding mapping time point of the last video frame in the second video. In response to the last frame of the first video being played, the second video is resumed from the mapped time point.
[0006] In a second aspect of the invention, a video downloading apparatus is also provided, comprising: The acquisition module is used to acquire the download progress of the first video that has been downloaded by the client in response to the detection that the download of the first video by the client is interrupted due to transcoding on the server side; the download progress is used to indicate the amount of data downloaded and is associated with the identification information of the last video frame downloaded; The determination module is used to determine the set of video segments to be downloaded from the second video generated after transcoding the first video based on the download progress, and then download the set of video segments. The matching module is used to match the last downloaded video frame of the first video with the video frame content of the second video to determine the mapping time point of the last video frame in the second video. The playback module is used to resume playback of the second video from the mapped time point in response to the last video frame played on the first video.
[0007] In another aspect of the present invention, a computer-readable storage medium is also provided, wherein instructions are stored therein, which, when executed on a computer, cause the computer to perform any of the data forwarding methods described above.
[0008] In another aspect of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform any of the video download methods described above.
[0009] In this embodiment of the invention, in response to the detection that the download of the first video by the client is interrupted due to transcoding on the server side, the download progress of the first video already downloaded by the client is obtained. The download progress is used to indicate the amount of data downloaded and is associated with the identification information of the last downloaded video frame. This accurately captures the specific fault state of download interruption caused by transcoding and the content boundary at the time of occurrence, providing accurate input conditions for subsequent targeted operations. Based on the download progress, the set of segmented videos to be downloaded is determined from the second video generated after transcoding the first video, and the set of segmented videos is downloaded. This avoids the complete invalidation of downloaded data due to the replacement of the entire video file, reducing the amount of data to be re-downloaded from the entire second video file to the set of segmented videos, thus saving download time and resources. The last downloaded video frame of the first video is matched with the video frame content of the second video to determine the corresponding mapping time point of the last video frame in the second video. Through pixel-level content positioning, the mapping time point can be determined with high precision. In response to playing the last video frame of the first video, the second video is resumed from the mapping time point, ensuring a continuous viewing experience for the user. Attached Figure Description
[0010] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.
[0011] Figure 1 This is a flowchart of a video downloading method provided in an embodiment of this application; Figure 2 This is a schematic diagram of a video downloading method provided in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of a video downloading device provided in an embodiment of this application; Figure 4 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0012] The technical solutions of the present invention will now be described with reference to the accompanying drawings in the embodiments of the present invention.
[0013] The video downloading method provided in this application embodiment can be applied to at least the following application scenarios, which will be described below.
[0014] In the technical architecture of video websites, the process from video upload to user presentation involves a series of complex processing steps. After video upload, to meet different business needs and user experience, it sometimes needs to be re-produced or transcoded. For example, mid-roll ads may be added to the video; color grading may be performed to improve visual effects; and parameters such as video resolution and bitrate may be adjusted to adapt to different devices and network environments. During this process, once the video has been re-produced or transcoded, the original version of the video and the segmented storage based on the original version are deleted to free up storage resources and ensure that users receive the latest processed video content.
[0015] When users download videos, they typically use segmented download technology, which divides the entire video file into multiple smaller segments, downloads them sequentially, and then merges them locally. During the download process, the user's client establishes a connection with the server and downloads each segment according to the video's segmentation information. However, when the video is re-produced or transcoded on the server side, the original version of the video and its segments are deleted, and the video-related information stored on the server changes. This causes the original data upon which the connection between the client downloading the video and the server depends to be lost, thus preventing the download from continuing.
[0016] Especially for high-bitrate and long videos, these video files are huge, and the download process consumes a lot of time and network bandwidth. Users may have already downloaded most of the content during the download process, but due to video re-production or transcoding, the previously downloaded content, based on the original video segments, cannot match the updated video and must be deleted and downloaded again.
[0017] For users downloading long, high-bitrate videos, the download process is time-consuming and laborious. For example, when the original version of a video is about 90% downloaded, it may become unavailable due to video transcoding, forcing the download to restart. This represents a significant waste of time and severely impacts the user experience. Users may become dissatisfied with the video website and even choose a competitor's service.
[0018] From the server's perspective, users re-downloading videos consumes significant bandwidth. Since 90% of the data has already been transferred, the entire updated video needs to be re-transmitted, leading to reduced server bandwidth utilization and increased operating costs. Simultaneously, the user's download process also consumes more network traffic and device resources.
[0019] In existing technologies, the original version of the video is deleted only according to a preset cleaning strategy, without taking into account whether a user is downloading the original version of the video, which could cause the download process to be interrupted.
[0020] Based on the above application scenarios, the video downloading method provided in the embodiments of this application will be described below.
[0021] Figure 1 This is a flowchart illustrating a video downloading method provided in an embodiment of this application.
[0022] like Figure 1 As shown, the video downloading method may include steps 110-140. This method is applied to a video downloading device, as detailed below: Step 110: In response to the detection that the first video downloaded by the client was interrupted due to transcoding on the server side, the download progress of the first video already downloaded by the client is obtained; the download progress is used to indicate the amount of data downloaded and is associated with the identification information of the last downloaded video frame; Step 120: Based on the download progress, determine the set of video segments to be downloaded from the second video generated after transcoding the first video, and download the set of video segments. Step 130: Match the last downloaded video frame of the first video with the video frame content of the second video to determine the mapping time point of the last video frame in the second video. Step 140: In response to the last video frame of the first video being played, resume playback of the second video starting from the mapped time point.
[0023] The first video is the original video file that the user initially downloaded; it's the version before the server re-produced or transcoded the video. The second video is an updated version of the first video after the server has re-produced or transcoded it. This may involve adding advertisements, enhancing the picture quality, or changing the format to adapt to different devices.
[0024] Server-side transcoding refers to the re-encoding of the original video file by the video service provider on the server. This may be used to adjust the encoding format, bitrate, resolution, or to insert advertisements, perform color correction, etc. After processing, a second video with related but not identical content is generated and replaces the original file in storage. Download progress is a comprehensive status parameter used to indicate the amount of data successfully transferred from the server to the client's local machine. This amount of data can be expressed as the number of bytes downloaded, the duration, or a percentage relative to the total file size. At the same time, this progress is associated with the identification information of the last video frame corresponding to the downloaded data, such as the timestamp or frame number of the last video frame in the video stream. Mapped time point refers to the specific playback time corresponding to the frame found in the second video through specific image matching technology that matches the visual content of the last downloaded frame of the first video.
[0025] In step 110, when the server deletes the source file of the first video due to a transcoding task, the client's download request will be interrupted due to resource loss. At this time, the locally cached data information is extracted as the download progress, accurately recording the content boundary at the time of download interruption. For example, if a user downloads a first video with a total duration of 120 minutes and encounters a transcoding interruption at the 80-minute mark, the recorded download progress may be shown as: downloaded duration: 80 minutes or downloaded data volume: approximately 66.7% of the total, while simultaneously recording the timestamp 01:20:00 of the video frame at the end of the 80-minute mark. The download progress can specifically include: the absolute length of time downloaded, or the percentage of the original video file size to which the downloaded data is located. The identification information of the last video frame can be specifically represented as the timecode of that frame on the standard playback timeline, or its frame number arranged in the decoding order in the video encoding stream.
[0026] In step 120, based on the progress information representing the amount of downloaded content obtained in step 110, the duration of successful download in the first video is calculated. Based on the total duration of the first and second videos, through linear proportional mapping or more complex calculations combining transcoding metadata, the possible time interval corresponding to the downloaded content in the second video is estimated. According to preset video segmentation rules or those obtained from the server, which video segments in the second video fall within or after this time interval are determined; these video segments constitute the set of video segments to be downloaded.
[0027] This allows for precise location of the segments in the second video that need additional downloads, avoiding the need to re-download the entire file. For example, the first video is 90 minutes long, and the user has already downloaded 50 minutes. The second video, due to the addition of an intro advertisement, is now 95 minutes long. A simple calculation shows that 50 minutes represents approximately 55.6% of the original video, corresponding to a theoretical time point of approximately 52.8 minutes in the second video. Assuming each video segment is 5 minutes long, the 11th segment and all subsequent segments are identified as the set to be downloaded. Determining the set of segments to be downloaded based on the download progress can include: linearly mapping the downloaded time to the total duration of the second video to obtain a reference time point, and then downloading the segment containing that reference time point and all subsequent segments; or, directly calculating the list of segments corresponding to the range of bytes that need to be downloaded in the second video file based on the byte offset of the downloaded data in the original video file, combined with the index structure of the old and new files.
[0028] In step 130, to ensure the continuity of the resumed playback, it is necessary to find the exact frame in the second video corresponding to the last downloaded frame of the first video. Specifically, image content matching technology can be used, taking the last frame as the reference frame and comparing its visual features with those of the second video within the time window corresponding to the set of video segments to be downloaded determined in step 120. The matching process is typically performed within a search window around a scale mapping point to balance search accuracy and computational overhead. Specific algorithms for video frame content matching can include: a perceptual hashing algorithm, which quickly determines similarity by generating a fingerprint string of the image and calculating Hamming distance; or a scale-invariant feature transform algorithm, which describes the image content by extracting and matching key point features in the image.
[0029] In step 140, when the user plays the locally downloaded first video segment to the end, the player client triggers switching logic. Using the mapped time point determined in step 130 as a command parameter, the player immediately switches the video source from the local first video file to the second video file stream that is downloading or has been partially downloaded after rendering the last frame, and begins decoding and rendering from the mapped time point. This achieves a seamless viewing experience. Specific control methods for resuming playback from the mapped time point can include: sending a jump command containing the second video link and the mapped time point parameter to the player, which then internally performs the source switching and positioning; or, through a local proxy server, dynamically redirecting subsequent requests to the video segment address corresponding to the mapped time point of the second video at the end of the first video playback.
[0030] In one possible embodiment, step 120 specifically includes the following steps: The second video is divided into multiple sequentially arranged reference video segments based on the preset segment duration. The downloaded content duration corresponding to the download progress, along with the total duration of the second video, is used to determine the mapping time reference point in the second video corresponding to the downloaded content duration. Based on the mapping time reference point and the preset segment duration, the reference video segment to which the mapping time reference point belongs is calculated, and this segment is determined as the starting reference video segment to be downloaded. The starting reference video segment and all subsequent consecutive reference video segments are determined as the set of segmented videos to be downloaded.
[0031] The preset segment duration refers to the duration of each video segment defined in advance or obtained from the server. It serves as the basis for regularly dividing the continuous video stream on the timeline. The baseline video segment refers to the independent video data units that are continuous in playback time and do not overlap, generated after dividing the second video according to the preset segment duration. These units are arranged in chronological order for easy independent download and management. The mapped time reference point is the theoretical time position calculated on the second video timeline based on the duration of the downloaded content. It is used to guide the subsequent determination of which video segments need to be downloaded. The starting baseline video segment refers to the first baseline video segment in the second video that needs to be downloaded, determined according to the mapped time reference point. This segment and the subsequent segments together constitute the data range to be downloaded.
[0032] To accommodate streaming and efficient downloading, the second video is divided into multiple sequentially arranged baseline video segments based on preset segment durations. This establishes a mapping between the video content timeline and specific storage units, enabling precise data location and retrieval at the segment level. For example, with a preset segment duration of five seconds, a one-minute second video will be divided into twelve consecutive baseline video segments. The first segment corresponds to time points 0 to 5 seconds, the second segment to 5 to 10 seconds, and so on. Specifically, this can include using segmentation rules with fixed durations; or it can include adaptively determining segment boundaries based on the keyframe intervals of the video encoding to ensure that each segment can be decoded independently.
[0033] The amount of content a user has already watched or downloaded in the first video should account for the same proportion of the total content in the second video. The time point calculated using this linear proportion provides a reliable initial search center for finding content continuations in the new video. The specific calculation method for the mapped time reference point in the second video corresponding to the duration of downloaded content can include linear proportioning; alternatively, it can involve superimposing a fixed offset based on transcoding metadata, such as the known duration of ad insertions, for calibration.
[0034] The calculated time point coordinates are mapped to the previously defined discrete segment set, thus transforming the continuous time-series localization problem into a problem of finding specific segment units. For example, if the mapped time reference point is 105 seconds and the preset segment duration is 5 seconds, dividing 105 by 5 seconds reveals that this time point falls within the time range of the 21st segment, thus determining this segment as the starting reference video segment. The specific calculation rule for determining the reference video segment to which the mapped time reference point belongs can be either dividing the time value of the mapped time reference point by the preset segment duration and rounding the result up to determine the segment number, or dividing the time value by the preset segment duration, rounding the result down, and then adding one, depending on the initial definition of the segment number.
[0035] To ensure users can watch all subsequent videos without interruption from the content continuation point, it's necessary to download the remaining content of the second video starting from the initial point. By determining a starting segment and downloading all consecutive segments from that segment to the end of the video, all subsequent data not yet available to the user can be fully covered. The starting baseline video segment and all subsequent consecutive baseline video segments are defined as the set of video segments to be downloaded. This set can be constructed by generating a list containing the sequence numbers from the starting segment to the final segment; or by sending an instruction to the download engine to download all subsequent content starting from the specified segment, based on the information from the starting segment.
[0036] like Figure 2 As shown, compared to the first video, the second video adds an advertisement segment in the second baseline video segment. The second video is divided into 10 sequentially arranged baseline video segments based on a preset segment duration. Since the preset segment duration is fixed, the video content contained in the second baseline video segment of the first video and the second baseline video segment of the second video are different, therefore, it is necessary to calculate the mapping time reference point.
[0037] The mapping time reference point calculated based on the download progress falls within the time range of the 7th reference video segment. Therefore, the 7th reference video segment is determined as the starting reference video segment to be downloaded. Ultimately, the set of video segments to be downloaded includes the 7th to 10th reference video segments in the second video.
[0038] By dividing the second video rule into baseline segments, a clear data index structure was established. Mapping time reference points were calculated based on the proportion of downloaded content duration, and these reference points were mapped to specific starting baseline video segments, thus converting theoretical time into directly operable data unit identifiers. Downloading all subsequent consecutive segments starting from the starting segment ensured the integrity of the data required for subsequent playback. After a video file was replaced, only the necessary new data was downloaded, saving network bandwidth resources and user waiting time.
[0039] In one possible embodiment, at least one reference video segment preceding the initial reference video segment is added as a buffer video segment to the set of segmented videos to be downloaded; wherein the buffer video segment is used to provide data buffering during playback.
[0040] Buffer video segments refer to one or more reference video segments that are located before the starting reference video segment on the playback timeline. Buffer video segments are pre-downloaded to the client to provide additional data caching for the player, in order to cope with possible network fluctuations or decoding initialization delays and ensure the immediacy and smoothness of playback.
[0041] To continuously decode and render video, a media player needs to pre-load a certain amount of video data into its memory. If downloading only from a precisely calculated starting point video segment, playback may stutter or even briefly interrupt during poor network conditions or player initialization due to delayed data arrival. By proactively including several segments before the starting point in the download range, a data reserve area is established for the player. When the player begins processing the second video segment, these pre-loaded buffered video segments quickly fill its decoding buffer, ensuring that the player has a stable and sufficient data stream when it reaches the actual continuation playback start point, thus achieving a seamless playback transition.
[0042] For example, if the 21st reference video segment is determined as the starting reference video segment, and the preset buffer depth is 2 segments, then the 19th and 20th reference video segments will also be added to the download set. Thus, during download, the client will successively obtain segments 19, 20, 21, and all subsequent segments. Specific implementations of using at least one reference video segment before the starting reference video segment as a buffer video segment can include: using a fixed number of segments as the buffer depth, such as always downloading 1 or 2 segments before the starting point; or, dynamically calculating the buffer depth based on the client's current average download speed, such as automatically adding 1 buffer segment when the network speed is slow.
[0043] By downloading a small number of additional buffer video segments before the precisely calculated necessary download range, the risks caused by unavoidable jitter or delay in network transmission are offset. This allows the player to seamlessly transition from the end of the first video to the mapped time point of the second video and resume playback. This reduces the probability of playback interruptions due to insufficient data readiness, thus ensuring the immediacy and continuity of playback in complex network environments.
[0044] In one possible embodiment, step 130 specifically includes the following steps: Based on the download progress and the total duration of the first video, calculate the first time point of the last video frame in the first video; based on the first time point and the relationship between the total duration of the first video and the second video, determine the search window for frame matching in the second video; the search window includes the first time point; within the search window, locate the target video frame that matches the content of the last video frame; determine the time point of the target video frame in the second video as the mapping time point.
[0045] The first time point refers to the absolute position of the last video frame on the playback timeline of the first video, expressed in seconds or timecode from the start of the video; the search window refers to a continuous time interval defined on the playback timeline of the second video, the range of which is specifically set to cover the area where video frames corresponding to the content of the first time point may appear, and is a limited search range for efficient image matching; the target video frame refers to a video frame found by the image content matching algorithm within the search window of the second video that is visually identical or highly similar to the last video frame from the first video.
[0046] The amount of data downloaded, as indicated by the download progress, needs to be converted into a precise position on the timeline to provide accurate reference coordinates for subsequent cross-video matching. Based on the video file's encoding parameters and structure, the number of bytes downloaded or the download percentage is mapped to the corresponding playback time. For example, if the first video has a total duration of 200 seconds, and the download progress indicates that the first 50% of the file has been successfully downloaded, then calculations can determine that the downloaded portion corresponds to the 100th second of the video, and this 100th second is calculated as the first time point.
[0047] To calculate the first time point of the last video frame in the first video, specific conversion methods can include: dividing the number of downloaded bytes by the total number of bytes in the video to obtain a percentage, and then multiplying by the total video duration to obtain the time point; or, recording the time range corresponding to each data segment during the download process, and directly determining the first time point based on the end time of the last successfully downloaded segment.
[0048] Because transcoding can cause non-linear changes in content duration and timing, a reasonable tolerance range is extended forward and backward along the timeline, centered on the theoretical position of the first time point mapped proportionally in the second video, thus forming a finite search window. This transforms a global search into an efficient local search, significantly reducing computational overhead. For example: the first video has a total duration of 200 seconds, and the first time point is 100 seconds. The second video has a total duration of 210 seconds. Based on proportional mapping, the theoretical position of this time point in the second video is 105 seconds. With a preset tolerance range of ±2 seconds, the determined search window is 103 to 107 seconds.
[0049] The search window for frame matching in the second video can be determined by means of: taking the theoretical time point of the proportional mapping as the center and extending it forward and backward by a fixed duration, such as 3 seconds, to form a search window; or, dynamically calculating the fault tolerance range according to the proportion of the duration difference between the first video and the second video, with the preset search window being expanded accordingly as the duration difference is greater.
[0050] Within a defined search window, image processing algorithms are used to compare the last frame of the first video as a template with the decoded video frame sequence in the second video search window, performing frame-by-frame or skip-by-skip visual similarity comparisons. A similarity score is calculated, and the frame with the highest score is selected as the matching result. For example, within the search window from 103 seconds to 107 seconds of the second video, video frames are extracted at 10-millisecond intervals and compared with the frame at 100 seconds of the first video. The frame at 104.5 seconds is found to have the highest similarity to the template and is therefore identified as the target video frame.
[0051] The specific matching methods for locating the target video frame that matches the content of the last video frame can include: using a perceptual hashing algorithm to quickly calculate the Hamming distance between the inter-frame hash values; or using a scale-invariant feature transformation algorithm to extract and match key point features.
[0052] After completing precise image content matching, the matched results need to be converted into a timing instruction that the player can use to perform a jump operation. The time point of the target video frame represents the precise continuation position of the content at the point of interruption in the first video in the second video. The standard timestamp of the target video frame on the second video timeline is read and used as the final mapped time point. For example, if the target video frame determined by matching is located at 104.5 seconds in the second video, then 104.5 seconds is recorded as the final mapped time point.
[0053] The time point of the target video frame in the second video is determined as the mapping time point. The specific determination method can be to directly read the timestamp information in the metadata of the video frame; or to calculate the precise time based on the start time of the video segment in which the frame is located and the frame offset.
[0054] By converting download progress into a first-time point, an original reference is provided for matching. Dynamically generating a search window based on duration relationships limits the matching range to high-probability intervals, balancing comprehensiveness and computational efficiency. Performing image content matching within the search window fundamentally ensures the visual continuity of the found playback positions, overcoming the non-linear timeline offset problem caused by transcoding. Determining the matched image positions as mapped time points provides precise command parameters for seamless player transitions, ensuring accurate playback continuation and natural content transitions.
[0055] In one possible embodiment, the step of locating the target video frame that matches the content of the last video frame within the search window specifically includes the following steps: Calculate the hash value of each candidate video frame in the search window; filter out candidate video frames whose hash value is less than a preset threshold with respect to the reference video frame, forming a subset of candidate video frames; for each candidate video frame in the subset of candidate video frames, calculate the sum of absolute pixel differences between the candidate video frame and the reference video frame; select the candidate video frame with the smallest sum of absolute pixel differences as the target video frame.
[0056] A hash value is a fixed-length string generated by a specific hash algorithm from information such as video frames. Identical data will generate the same hash value, while slight changes in the data will result in different hash values. It can be used to quickly determine the similarity between data.
[0057] Hamming distance is a metric used to measure the difference between two strings of equal length. In video frame matching, it refers to the number of different characters at corresponding positions in the hash values of two video frames. The smaller the Hamming distance, the more similar the visual features of the two video frames; conversely, the larger the distance, the greater the difference.
[0058] The preset threshold is a pre-defined standard value for Hamming distance. When the Hamming distance between the hash values of two video frames is less than this threshold, the two video frames are considered to have a high degree of similarity in image features, and the corresponding video frames can be included in the candidate range.
[0059] A candidate video frame subset refers to a smaller set of video frames with a higher probability of matching that are retained after a fast initial screening based on hash values from all candidate video frames in the search window.
[0060] Sum of absolute pixel differences: For corresponding pixels in two video frames, calculate the difference in pixel values, take the absolute value, and sum the differences of all pixels. The sum of absolute pixel differences reflects the degree of difference between two video frames at the pixel level. The sum of absolute pixel differences is inversely proportional to the similarity between two video frames at the pixel level; that is, the smaller the sum of absolute pixel differences, the more similar the video frames are.
[0061] The reference video frame refers to the last downloaded video frame extracted from the first video, used as a template for image matching. The probability that a video frame in the search window contains the target video frame is higher than the probability that a video frame outside the search window contains the target video frame.
[0062] Image hashing algorithms are used to transform the rich pixel information of each frame into a comparable digital fingerprint. This dimensionality reduction of high-dimensional image data allows subsequent similarity comparisons to be performed between computationally efficient strings or number sequences, avoiding the overhead of directly processing large amounts of pixel data. For example, candidate frames are extracted from the search window of a second video at a density of 30 frames per second, and a difference hashing algorithm is applied to each frame to generate a 64-bit binary hash value sequence. Specific algorithms for calculating the hash value can include perceptual hashing, which generates fingerprints by obtaining low-frequency components of the image through discrete cosine transform; or difference hashing, which generates fingerprints by comparing the grayscale values of adjacent pixels in the image.
[0063] By calculating the Hamming distance between the hash values of candidate frames and the reference frame, video frames that are significantly dissimilar to the target in overall visual structure can be quickly eliminated. Only video frames with a distance less than a preset threshold are retained for a more precise next round of comparison, narrowing down the range requiring accurate calculation. For example, the hash value of the reference video frame is 10110011, and the preset threshold is set to 5. Candidate frame A has a hash value of 10110111 and a Hamming distance of 1, which is less than the preset threshold, so it is retained. Candidate frame B has a hash value of 00101100 and a Hamming distance of 6, which is greater than the preset threshold, so it is eliminated.
[0064] The specific filtering strategy for selecting candidate video frames whose hash value is less than a preset threshold can include using a fixed threshold set based on experience, such as 10; or it can include dynamically adjusting the threshold according to the size of the search window. The more candidate frames there are in the window, the more stringent the initial screening threshold should be, in order to control the size of the subset.
[0065] Within the smaller set after initial hash screening, direct pixel-level comparison yields the most accurate similarity assessment. The absolute pixel difference sum directly reflects the cumulative difference between two images at each pixel, providing a precise metric capable of distinguishing images with similar hash values but subtle differences in pixel content, thus finding the best match. For example, if a candidate video frame subset contains three frames, each is aligned with a reference video frame, and the absolute difference between corresponding pixel values is calculated for each channel in the RGB color space. Finally, all differences are summed to obtain three distinct absolute pixel difference sums.
[0066] The specific calculation method for calculating the absolute pixel difference between a candidate video frame and a reference video frame may include calculating the sum of the absolute pixel differences between the two grayscale images; or it may include calculating the sum of the absolute pixel differences of the three color channels R, G, and B respectively, and then summing them together.
[0067] The final decision is made based on the most accurate pixel-level comparison results. Within the subset of candidate video frames, the frame with the smallest sum of absolute pixel differences means it has the smallest pixel-level difference from the reference video frame, and therefore is the closest in content and most likely to be the same scene. By comparing this metric, the best match can be uniquely determined. For example, if the calculated sums of absolute pixel differences for three candidate frames in the subset are 1500, 3200, and 850, then the candidate frame with a sum of differences of 850 is determined to be the best match for the reference video frame and is identified as the target video frame.
[0068] For example, when a user downloads a 120-minute 4K movie "Sci-Fi Blockbuster", the server inserts a 3-minute advertisement into the video when the user downloads to the 90-minute mark, generating a second video of 123 minutes with a mapped time point of 92.25 minutes. The target video segment is the 19th segment (90-95 minutes), and the search window is determined to be 92 minutes to 92 minutes and 30 seconds.
[0069] The hash values of 60 candidate video frames are calculated using the adjacent pixel difference hashing method. For example, the hash value calculated for the first frame is abcdef123456, and for the second frame it is ghijkl7890mn, etc. Each video frame generates a unique hash value to characterize the image features.
[0070] The hash values of each candidate video frame are compared with the hash value of the reference video frame using Hamming distance calculation. Assuming the reference video frame hash value is abcdef987654, the calculated Hamming distances for frames 10, 25, and 40 are 4, 3, and 2 respectively, all less than the preset threshold of 5. The Hamming distances of other frames are greater than 5. Therefore, frames 10, 25, and 40 are selected as a subset of candidate video frames. For each of the three candidate video frames, the sum of absolute pixel differences with the reference video frame is calculated. The sum of absolute pixel differences for frame 10 is 200, for frame 25 it is 150, and for frame 40 it is 120. Because frame 40 has the smallest sum of absolute pixel differences, it is selected as the target video frame.
[0071] Through multiple processing methods, including adjacent pixel difference hashing, Hamming distance filtering, and calculation of pixel absolute differences, high-precision matching of video frames is achieved. Even if there are minor adjustments to the image color or slight shifts in object position after transcoding, the target video frame that is most similar to the reference video frame can be accurately found, ensuring seamless playback and eliminating visual jumps.
[0072] The adjacent pixel difference hashing method quickly generates video frame hash values. Combined with Hamming distance filtering, it can rapidly eliminate irrelevant video frames from a large number of candidate video frames. As in the example above, it quickly selects 3 frames from 60 frames to proceed to the next round of calculation, greatly reducing the computational load of subsequent pixel absolute difference sums, improving overall matching efficiency, and shortening video playback preparation time. The calculation of pixel absolute difference sums performs precise comparisons at the pixel level, avoiding potential misjudgments that might occur when relying solely on hash values and Hamming distances. Through this multi-dimensional, multi-level filtering mechanism, the probability of incorrectly matching target video frames is effectively reduced, ensuring the continuity and accuracy of video playback and providing users with a smooth and stable viewing experience.
[0073] By using hash-based fast calculation and Hamming distance comparison, a highly efficient coarse screening of massive candidate frames is achieved, quickly narrowing the search range to a very small set of possibilities. This avoids the huge computational burden of pixel-level comparison across the entire window. On the narrowed candidate subset, the accuracy of the final matching result is ensured by calculating the absolute pixel difference and performing precise pixel-level identification.
[0074] In one possible embodiment, step 140 specifically includes the following steps: In response to the last video frame of the first video being played, the actual start point for continued playback is determined based on the content characteristics of the second video within a preset time window before the mapped time point; the playback jumps to the actual start point for continued playback to play the second video.
[0075] The preset time window refers to a fixed or variable duration interval defined on the second video timeline, starting from the mapped time point, and is used to analyze the attributes of the video content within this interval. Content features refer to the quantitative or qualitative descriptions obtained from the analysis of video data within the preset time window, used to distinguish the main content from other inserted content. These features can be based on metadata, visual characteristics, or audio characteristics. The actual playback start point refers to the specific position on the second video timeline where playback begins, which is ultimately determined. The actual playback start point can be the same as the previously calculated mapped time point, or it can be adjusted based on the content feature recognition results.
[0076] The mapped time point is the content alignment point found through image matching, but playing immediately from the mapped time point may not provide the optimal user experience. For example, if the mapped time point immediately follows a newly inserted advertisement, playing from that point will cause users to miss the beginning of the main feature after the advertisement. Therefore, validation is required before playback: analyze the video data within a short preset window before the mapped time point to identify any non-main feature content features, and determine whether the resume playback start position needs to be adjusted forward to a more reasonable segment start, thus ensuring that users see a continuous and complete main feature content. For example: the mapped time point is determined to be the 300th second of the second video, and the preset time window is 60 seconds forward. Analyzing the window from 240 to 300 seconds reveals that the 240th to 285th seconds are an advertisement, while the main feature begins after the 285th second. Based on this content feature, the actual resume playback start point may be determined to be the 285th second, that is, the moment the advertisement ends and the main feature begins.
[0077] Determining the actual resume playback start point based on content characteristics can specifically include: if an advertisement segment is identified within a preset time window, the actual resume playback start point is set to the end time of that advertisement segment; or, if a black screen or silent segment is identified within a preset time window, the actual resume playback start point is set to the end time of that non-content segment.
[0078] After determining the precise starting position, the player needs to interrupt the current playback of the first local video file and seamlessly switch the video source to the online or local cached stream of the second video, then begin decoding and rendering from the actual resume playback start point. The jump action is a comprehensive playback control command, the core of which is the switching of the video source and the positioning of the time point. For example, after the player renders the last frame of the first video, it receives a command containing the stream address of the second video and the actual resume playback start point parameters. The player then loads the second video stream and starts playback at second 285.
[0079] The specific implementation methods for jumping to the actual resume playback start point can include: sending a jump instruction containing time parameters through the player's application programming interface, with the player internally performing source switching and positioning; or, dynamically redirecting the player's data requests to the segmented video in the second video stream corresponding to the actual resume playback start point by setting up a proxy at the local network layer.
[0080] By analyzing content features based on a preset time window to determine the actual resume playback start point, the system can proactively avoid non-content segments that may be added after transcoding and that users do not want to watch, thus optimizing the resume playback start logic. Precise playback control ensures that the transition from the first video to the second video is instantaneous and accurate.
[0081] In one possible embodiment, the step of determining the actual playback start point based on the content characteristics of the second video within a preset time window before the mapping time point may specifically include the following steps: Identify non-content segments that are not continuous with the downloaded content of the first video before the mapped time point; if a non-content segment exists, determine the time point of the target video frame that is located after the non-content segment and matches the content of the last video frame as the actual start point for replay; if no non-content segment exists, determine the mapped time point as the actual start point for replay.
[0082] Non-content segments refer to video segments contained in the second video before the mapped time point that do not have logical continuity with the downloaded portion of the first video in terms of visual or audio content. These segments are usually independent units added after transcoding, such as advertisements, black screen transitions, opening logos, or technical silence intervals. Content continuity means that the two video segments are directly connected in terms of scene, action, dialogue, or narrative, without interruption in theme or plot. The time point of the target video frame is the accurate playback time corresponding to the video frame that matches the last frame of the first video, located in the time region after the end of the non-content segment by re-executing or using the image matching process in step 130.
[0083] Using the mapped time point as a baseline, a preset time window is scanned forward. By analyzing the characteristic changes in the video and audio tracks, it is determined whether there is a clear interval that is distinct from the preceding and following main content in terms of features. This distinction manifests as abrupt changes in the visual scene, a sharp drop and rebound in audio energy, or the presence of specific advertising marker metadata. The goal of identification is to accurately pinpoint inserted sections introduced during transcoding that are independent of the original narrative flow. For example, if the mapped time point is 300 seconds, analyzing the window from 250 seconds to 300 seconds reveals that during the period from 250 seconds to 285 seconds, the video scene, background music, and preceding and following plot are completely unrelated, and the audio track exhibits standardized advertising loudness characteristics. Therefore, a non-content segment of 35 seconds in length is identified.
[0084] Specific methods for identifying non-content segments may include: parsing the metadata tags carried by the video file, which clearly identify the start and end times of the advertisement segment; or, using computer vision and audio analysis algorithms to detect sudden scene changes and audio silence zones, and combining them with duration thresholds to determine whether they are structured non-content segments.
[0085] When irrelevant inserted content is confirmed, to prevent users from watching this content, the optimal resume playback point should be the first main video frame after the inserted content ends, ensuring a smooth transition to the previously viewed content. Therefore, a new round of image matching needs to be performed in the area after the non-content segment ends to find a frame that matches the last frame of the first video. The time point of this frame is the precise resume playback position after skipping the interference. For example, if the non-content segment is identified as being from 250 seconds to 285 seconds, then in the area after 285 seconds, such as from 285 seconds to 295 seconds, the last frame of the first video is again matched with the frames in that area of the second video. If the best matching frame is found at 288 seconds, then the actual resume playback starting point is determined to be 288 seconds.
[0086] The specific implementation of determining the time point of the target video frame that is located after the non-content segment and matches the content of the last video frame as the actual start point of playback may include: re-executing the matching algorithm within a fixed small window after the end time point of the non-content segment; or, using the end point of the non-content segment as the new search center and matching again with the same search radius as in step 130.
[0087] When analysis shows that the content before the mapped time point is continuous with the downloaded portion of the first video and there is no structurally inserted content, it means that playing from this mapped time point will naturally continue the previous content without any additional adjustments. In this case, the mapped time point calculated in step 130 is itself the optimal start position for resuming playback. For example: analysis shows that within the 60-second window before the 300-second mapped time point, both the video scene and audio change smoothly, with no advertising markers or abrupt feature changes. Therefore, it is determined that there are no non-content segments, and the actual start point for resuming playback is directly set to the 300-second mark.
[0088] By proactively identifying and skipping non-content segments that may be added after transcoding, the core continuity of the user viewing experience is ensured, avoiding users being forced to watch irrelevant advertisements or experiencing content interruptions. Simultaneously, by executing the logic of skipping and re-matching when non-content segments are present, it ensures that even after skipping a section of content, the starting point for resuming playback remains precisely aligned with the content, maintaining the coherence of the narrative itself. When there are no non-content segments, an efficient direct mapping strategy is employed, reducing unnecessary computation. Based on intelligent analysis of video content characteristics, the most appropriate resuming playback strategy is dynamically selected, thus consistently providing end users with a seamless, direct, and content-coherent resuming playback experience in complex and ever-changing transcoding scenarios.
[0089] In this embodiment of the invention, in response to the detection that the download of the first video by the client is interrupted due to transcoding on the server side, the download progress of the first video already downloaded by the client is obtained. The download progress is used to indicate the amount of data downloaded and is associated with the identification information of the last downloaded video frame. This accurately captures the specific fault state of download interruption caused by transcoding and the content boundary at the time of occurrence, providing accurate input conditions for subsequent targeted operations. Based on the download progress, the set of segmented videos to be downloaded is determined from the second video generated after transcoding the first video, and the set of segmented videos is downloaded. This avoids the complete invalidation of downloaded data due to the replacement of the entire video file, reducing the amount of data to be re-downloaded from the entire second video file to the set of segmented videos, thus saving download time and resources. The last downloaded video frame of the first video is matched with the video frame content of the second video to determine the corresponding mapping time point of the last video frame in the second video. Through pixel-level content positioning, the mapping time point can be determined with high precision. In response to playing the last video frame of the first video, the second video is resumed from the mapping time point, ensuring a continuous viewing experience for the user.
[0090] Based on the above Figure 1 The video downloading method shown in this application also provides a video downloading device, such as... Figure 3 As shown, the video downloading device 300 may include: The acquisition module 310 is used to acquire the download progress of the first video that has been downloaded by the client in response to the detection that the download of the first video by the client is interrupted due to transcoding on the server side; the download progress is used to indicate the amount of data that has been downloaded and is associated with the identification information of the last video frame that has been downloaded; The determination module 320 is used to determine the set of video segments to be downloaded from the second video generated after transcoding the first video based on the download progress, and download the set of video segments. Matching module 330 is used to match the last downloaded video frame of the first video with the video frame content of the second video to determine the mapping time point corresponding to the last video frame in the second video. The playback module 340 is used to continue playing the second video from the mapped time point in response to the last video frame of the first video.
[0091] In one possible embodiment, the determining module 320 is specifically used for: The second video is divided according to the preset segment duration to obtain multiple sequentially arranged baseline video segments; Based on the duration of the downloaded content corresponding to the download progress and the total duration of the second video, determine the mapping time reference point in the second video corresponding to the duration of the downloaded content; Based on the mapped time reference point and the preset segment duration, calculate the reference video segment to which the mapped time reference point belongs, and determine the reference video segment to which the mapped time reference point belongs as the starting reference video segment to be downloaded; The initial reference video segment and all subsequent consecutive reference video segments are identified as the set of segmented videos to be downloaded.
[0092] In one possible embodiment, the determining module 320 is further configured to add at least one reference video segment prior to the starting reference video segment as a buffer video segment to the set of segmented videos to be downloaded. Among them, the buffer video segmentation is used to provide data buffering during playback.
[0093] In one possible embodiment, the playback module 340 is specifically used for: In response to the last video frame of the first video being played, the actual start point for continued playback is determined based on the content characteristics of the second video within a preset time window before the mapped time point. Jump to the actual start point of the resumed playback to play the second video.
[0094] In one possible embodiment, the playback module 340 is specifically used for: Identify non-content segments that occur before the mapped time point and are not contiguous with the downloaded content of the first video; If there is a non-content segment, the time point of the target video frame that is located after the non-content segment and matches the content of the last video frame will be determined as the actual start point of playback. If no non-content segments exist, the mapped time point will be determined as the actual start point for replay.
[0095] In one possible embodiment, the matching module 330 is specifically used for: Based on the download progress and the total duration of the first video, calculate the first time point of the last video frame in the first video; Based on the first time point and the total duration of the first and second videos, a search window for frame matching in the second video is determined; the search window includes the first time point. Within the search window, locate the target video frame that matches the content of the last video frame; The time point of the target video frame in the second video is determined as the mapping time point.
[0096] In one possible embodiment, the matching module 330 is specifically used for: Calculate the hash value of each candidate video frame within the search window; Candidate video frames whose hash value is less than a preset threshold are selected to form a subset of candidate video frames; For each candidate video frame in the candidate video frame subset, calculate the sum of absolute pixel differences between the candidate video frame and the reference video frame; The candidate video frame with the smallest sum of absolute pixel differences is selected as the target video frame.
[0097] In this embodiment of the invention, in response to the detection that the download of the first video by the client is interrupted due to transcoding on the server side, the download progress of the first video already downloaded by the client is obtained. The download progress is used to indicate the amount of data downloaded and is associated with the identification information of the last downloaded video frame. This accurately captures the specific fault state of download interruption caused by transcoding and the content boundary at the time of occurrence, providing accurate input conditions for subsequent targeted operations. Based on the download progress, the set of segmented videos to be downloaded is determined from the second video generated after transcoding the first video, and the set of segmented videos is downloaded. This avoids the complete invalidation of downloaded data due to the replacement of the entire video file, reducing the amount of data to be re-downloaded from the entire second video file to the set of segmented videos, thus saving download time and resources. The last downloaded video frame of the first video is matched with the video frame content of the second video to determine the corresponding mapping time point of the last video frame in the second video. Through pixel-level content positioning, the mapping time point can be determined with high precision. In response to playing the last video frame of the first video, the second video is resumed from the mapping time point, ensuring a continuous viewing experience for the user.
[0098] This invention also provides an electronic device, such as... Figure 4 As shown, it includes a processor 701, a communication interface 702, a memory 703, and a communication bus 704, wherein the processor 701, the communication interface 702, and the memory 703 communicate with each other through the communication bus 704. Memory 703 is used to store computer programs; When processor 701 executes a program stored in memory 703, it performs the following steps: In response to the detection that the first video downloaded by the client is interrupted due to transcoding on the server side, the download progress of the first video already downloaded by the client is obtained; the download progress is used to indicate the amount of data downloaded and is associated with the identification information of the last downloaded video frame; Based on the download progress, determine the set of video segments to be downloaded from the second video generated after transcoding the first video, and download the set of video segments. Match the last downloaded video frame of the first video with the video frame content of the second video to determine the corresponding mapping time point of the last video frame in the second video. In response to the last frame of the first video being played, the second video is resumed from the mapped time point.
[0099] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0100] The communication interface is used for communication between the aforementioned terminal and other devices.
[0101] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0102] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0103] In another embodiment of the present invention, a computer-readable storage medium is also provided, which stores instructions that, when executed on a computer, cause the computer to perform any of the video download methods described in the above embodiments.
[0104] In another embodiment of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform any of the video download methods described in the above embodiments.
[0105] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can 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)).
[0106] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0107] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0108] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. A video downloading method, characterized in that, The method includes: In response to the detection that the download of the first video by the client is interrupted due to transcoding on the server side, the download progress of the first video already downloaded by the client is obtained; the download progress is used to indicate the amount of data downloaded and is associated with the identification information of the last downloaded video frame; Based on the download progress, a set of segmented videos to be downloaded is determined from the second video generated after transcoding the first video, and the set of segmented videos is downloaded. The last downloaded video frame of the first video is matched with the video frame content of the second video to determine the mapping time point corresponding to the last video frame in the second video. In response to the last video frame played up to the first video, the second video is resumed from the mapped time point.
2. The method according to claim 1, characterized in that, The step of determining the set of segmented videos to be downloaded from the second video generated after transcoding the first video, based on the downloaded content corresponding to the download progress, includes: The second video is divided according to the preset segment duration to obtain multiple sequentially arranged baseline video segments; Based on the duration of the downloaded content corresponding to the download progress and the total duration of the second video, determine the mapping time reference point in the second video corresponding to the duration of the downloaded content; Based on the mapped time reference point and the preset segment duration, calculate the reference video segment to which the mapped time reference point belongs, and determine the reference video segment to which the mapped time reference point belongs as the starting reference video segment to be downloaded; The initial reference video segment and all subsequent consecutive reference video segments are determined as the set of segmented videos to be downloaded.
3. The method according to claim 2, characterized in that, The method further includes: At least one reference video segment prior to the starting reference video segment is used as a buffer video segment and added to the set of segmented videos to be downloaded; The buffer video segments are used to provide data buffering during playback.
4. The method according to claim 1, characterized in that, The step of resuming playback of the second video from the mapped time point in response to the last video frame played up to the first video includes: In response to the last video frame played to the first video, the actual playback start point is determined based on the content characteristics of the second video within a preset time window before the mapped time point; Jump to the actual resume playback starting point to play the second video.
5. The method according to claim 4, characterized in that, The step of determining the actual playback start point based on the content characteristics of the second video within a preset time window prior to the mapped time point includes: Identify non-content segments that occur before the mapped time point and are not contiguous with the downloaded content of the first video; If there is a non-content segment, the time point of the target video frame that is located after the non-content segment and matches the content of the last video frame is determined as the actual playback start point. If no non-content segment exists, the mapped time point is determined as the actual replay start point.
6. The method according to claim 1, characterized in that, The step of matching the last downloaded video frame of the first video with the video frame content of the second video to determine the corresponding mapping time point of the last video frame in the second video includes: Based on the download progress and the total duration of the first video, calculate the first time point of the last video frame in the first video; Based on the first time point and the relationship between the total duration of the first video and the second video, a search window for frame matching in the second video is determined; the search window includes the first time point. Within the search window, locate the target video frame that matches the content of the last video frame; The time point of the target video frame in the second video is determined as the mapping time point.
7. The method according to claim 6, characterized in that, Locating the target video frame that matches the content of the last video frame within the search window includes: Calculate the hash value of each candidate video frame within the search window; Candidate video frames whose hash value is less than a preset threshold are selected to form a subset of candidate video frames; For each candidate video frame in the subset of candidate video frames, calculate the sum of absolute pixel differences between the candidate video frame and the reference video frame; The candidate video frame with the smallest sum of absolute pixel differences is selected as the target video frame.
8. A video downloading device, characterized in that, The device includes: The acquisition module is used to acquire the download progress of the first video already downloaded by the client in response to the detection that the download of the first video by the client is interrupted due to transcoding on the server side; the download progress is used to indicate the amount of data downloaded and is associated with the identification information of the last downloaded video frame; The determination module is used to determine, based on the download progress, a set of segmented videos to be downloaded from the second video generated after transcoding the first video, and download the set of segmented videos; The matching module is used to match the last downloaded video frame of the first video with the second video to determine the mapping time point corresponding to the last video frame in the second video. A playback module is configured to, in response to the last video frame played to the first video, resume playback of the second video from the mapped time point.
9. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the steps of the method described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-7.