CN117812360A - Method, apparatus, device and computer readable storage medium for video preloading - Google Patents

Method, apparatus, device and computer readable storage medium for video preloading Download PDF

Info

Publication number
CN117812360A
CN117812360A CN202410015859.3A CN202410015859A CN117812360A CN 117812360 A CN117812360 A CN 117812360A CN 202410015859 A CN202410015859 A CN 202410015859A CN 117812360 A CN117812360 A CN 117812360A
Authority
CN
China
Prior art keywords
video file
preloading
preloaded
rate
time length
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410015859.3A
Other languages
Chinese (zh)
Inventor
赵哲彬
张亚平
宋立森
胡冬梅
夏明钰
田维新
欧阳仁双
谢星辰
孙海友
梁祝圆
陈金华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hanhai Information Technology Shanghai Co Ltd
Original Assignee
Hanhai Information Technology Shanghai Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hanhai Information Technology Shanghai Co Ltd filed Critical Hanhai Information Technology Shanghai Co Ltd
Priority to CN202410015859.3A priority Critical patent/CN117812360A/en
Publication of CN117812360A publication Critical patent/CN117812360A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/433Content storage operation, e.g. storage operation in response to a pause request, caching operations
    • H04N21/4331Caching operations, e.g. of an advertisement for later insertion during playback
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/433Content storage operation, e.g. storage operation in response to a pause request, caching operations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • H04N21/440281Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by altering the temporal resolution, e.g. by frame skipping
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a video preloading method, device, equipment and a computer readable storage medium, and belongs to the technical field of computers. The method comprises the following steps: acquiring parameter information of a target video file, wherein the target video file comprises a plurality of frame images; determining a preloading time length of the target video file, and determining reference loading information based on the preloading time length, wherein the reference loading information comprises preloading frame images and the number of the preloading frame images; determining the size of the preloaded video file based on the reference loading information and the parameter information, and generating the preloaded information based on the size of the preloaded video file; the target video file is preloaded based on the preloading information. The method can obtain more accurate size of the preloaded video file, avoid unnecessary flow consumption caused by larger preloaded video file and influence on playing effect of the target video file due to smaller preloaded video file, and improve user experience of browsing video.

Description

Method, apparatus, device and computer readable storage medium for video preloading
Technical Field
Embodiments of the present disclosure relate to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a computer readable storage medium for preloading video.
Background
With the rapid development of computer technology, more and more users acquire interesting information through video files. Before a user plays a video file through a webpage or an application program, the webpage or the application program usually performs preloading processing on the video file, and when the user clicks the video file to play, the video file can be quickly played through preloading.
Disclosure of Invention
Embodiments of the present application provide a method, apparatus, device, and computer readable storage medium for video preloading. The technical scheme is as follows:
in one aspect, an embodiment of the present application provides a method for preloading video, the method including: acquiring parameter information of a target video file, wherein the target video file comprises a plurality of frame images; determining a preloading time length of the target video file, and determining reference loading information based on the preloading time length, wherein the reference loading information comprises preloading frame images and the number of the preloading frame images; determining a size of a preloaded video file based on the reference loading information and the parameter information, and generating preloaded information based on the size of the preloaded video file; and preloading the target video file based on the preloading information.
In one possible implementation, the parameter information includes media data information and a size of a frame image, and the determining the size of the preloaded video file based on the reference loading information and the parameter information includes: determining a size of each preloaded frame image based on the preloaded frame image and the size of the frame image; calculating the size of the preloaded frame file based on the size of the preloaded frame image; and determining the size of the preloaded video file by utilizing the media data information and the size of the preloaded frame file.
In one possible implementation, the parameter information includes media data information and offset information, and the determining the size of the preloaded video file based on the reference loading information and the parameter information includes: determining a reference frame image in the target video file based on the number of preloaded frame images, wherein the reference frame image is the next frame image of the preloaded frame images; acquiring the offset of the reference frame image based on the offset information of the target video file, wherein the offset is used for representing the position of the reference frame image in the target video file; the size of the preloaded video file is determined based on the offset of the reference frame image and the media data information.
In one possible implementation manner, the determining the preloading duration of the target video file includes: the method comprises the steps of obtaining a preloading index and a reference loading time length of a target video file, wherein the preloading index comprises at least one of a standard playing rate or a standard cartoon rate, and the reference loading time length is used for representing the time length of the first preloading reference video file; preloading a plurality of reference video files based on the reference loading time length to obtain a test result, wherein the test result comprises at least one of a playing state or a clamping state of the reference video files; and adjusting the reference loading time length based on the test result and the preloading index, and determining the preloading time length based on the adjusted reference loading time length.
In a possible implementation manner, the preloading index includes the standard play rate and the standard click-through rate, the adjusting the reference loading duration based on the test result and the preloading index, and determining the preloading duration based on the adjusted reference loading duration includes: determining reference playing rates of a plurality of reference video files based on the playing states of the reference video files, and adjusting the reference loading time length based on the reference playing rates and the standard playing rates to obtain a first time length; determining reference click-through rates of a plurality of reference video files based on the click-through states of the reference video files, and adjusting the reference loading time length based on the reference click-through rates and the standard click-through rates to obtain a second time length; the preload duration is determined based on the first duration and the second duration.
In one possible implementation manner, the adjusting the reference loading duration based on the reference play-out rate and the standard play-out rate to obtain a first duration includes: sequentially increasing a first adjustment time length on the reference loading time length in response to the reference starting rate being smaller than the standard starting rate until the reference starting rate is not smaller than the standard starting rate, and taking the current adjustment time length as the first time length; and in response to the reference play-out rate being greater than the standard play-out rate, sequentially reducing the first adjustment time length on the reference loading time length until the reference play-out rate is not greater than the standard play-out rate, and taking the current adjustment time length as the first time length.
In one possible implementation manner, the adjusting the reference loading duration based on the reference click-through rate and the standard click-through rate to obtain a second duration includes: in response to the reference click-through rate being smaller than the standard click-through rate, sequentially reducing a second adjustment duration on the reference loading duration until the reference click-through rate is not smaller than the standard click-through rate, and taking the currently adjusted duration as the second duration; and in response to the reference click-through rate being greater than the standard click-through rate, sequentially increasing the second adjustment duration on the reference loading duration until the reference click-through rate is not greater than the standard click-through rate, and taking the currently adjusted duration as the second duration.
In one possible implementation manner, before the preloading the video file based on the preloading information, the method further includes: acquiring the target video file preloading request, wherein the target video file preloading request comprises file identification information and resolution information; and acquiring the corresponding preloading information based on the file identification information and the resolution information.
In one possible implementation manner, before the obtaining the parameter information of the target video file, the method further includes: acquiring format information of an initial video file; transcoding the initial video file based on the format information to obtain a compressed file; and decompressing the compressed file to obtain the target video file with at least one resolution.
In one possible implementation manner, the transcoding the initial video file based on the format information to obtain a compressed file includes: responding to the format information of the initial video file as reference format information, and compressing the initial video file to obtain the compressed file; and responding to the format information of the initial video file as non-reference format information, converting the format of the initial video file into a reference format, and compressing the format-converted initial video file to obtain the compressed file.
In another aspect, an embodiment of the present application provides an apparatus for preloading video, where the apparatus includes: the acquisition module is used for acquiring parameter information of a target video file, wherein the target video file comprises a plurality of frame images; the determining module is used for determining the preloading time length of the target video file, and determining reference loading information based on the preloading time length, wherein the reference loading information comprises preloading frame images and the number of the preloading frame images; the generation module is used for determining the size of the preloaded video file based on the reference loading information and the parameter information and generating preloaded information based on the size of the preloaded video file; and the preloading module is used for preloading the target video file based on the preloading information.
In a possible implementation manner, the parameter information includes media data information and a size of a frame image, and the generating module is configured to determine a size of each preloaded frame image based on the preloaded frame image and the size of the frame image; calculating the size of the preloaded frame file based on the size of the preloaded frame image; and determining the size of the preloaded video file by utilizing the media data information and the size of the preloaded frame file.
In a possible implementation manner, the parameter information includes media data information and offset information, and the generating module is configured to determine a reference frame image in the target video file based on the number of preloaded frame images, where the reference frame image is a frame image next to the preloaded frame image; acquiring the offset of the reference frame image based on the offset information of the target video file, wherein the offset is used for representing the position of the reference frame image in the target video file; the size of the preloaded video file is determined based on the offset of the reference frame image and the media data information.
In a possible implementation manner, the determining module is configured to obtain a preload indicator and a reference load duration of the target video file, where the preload indicator includes at least one of a standard play-out rate or a standard click-through rate, and the reference load duration is used to characterize a duration of the first preloading of the reference video file; preloading a plurality of reference video files based on the reference loading time length to obtain a test result, wherein the test result comprises at least one of a playing state or a clamping state of the reference video files; and adjusting the reference loading time length based on the test result and the preloading index, and determining the preloading time length based on the adjusted reference loading time length.
In a possible implementation manner, the preloading index includes the standard playing rate and the standard katon rate, the determining module is configured to determine a reference playing rate of the plurality of reference video files based on a playing state of the reference video files, and adjust the reference loading duration based on the reference playing rate and the standard playing rate to obtain a first duration; determining reference click-through rates of a plurality of reference video files based on the click-through states of the reference video files, and adjusting the reference loading time length based on the reference click-through rates and the standard click-through rates to obtain a second time length; the preload duration is determined based on the first duration and the second duration.
In a possible implementation manner, the determining module is configured to sequentially increase a first adjustment duration on the reference loading duration in response to the reference play starting rate being less than the standard play starting rate until the reference play starting rate is not less than the standard play starting rate, and take a currently adjusted duration as the first duration; and in response to the reference play-out rate being greater than the standard play-out rate, sequentially reducing the first adjustment time length on the reference loading time length until the reference play-out rate is not greater than the standard play-out rate, and taking the current adjustment time length as the first time length.
In a possible implementation manner, the determining module is configured to sequentially reduce a second adjustment duration on the reference loading duration in response to the reference click-through rate being less than the standard click-through rate until the reference click-through rate is not less than the standard click-through rate, and take a currently adjusted duration as the second duration; and in response to the reference click-through rate being greater than the standard click-through rate, sequentially increasing the second adjustment duration on the reference loading duration until the reference click-through rate is not greater than the standard click-through rate, and taking the currently adjusted duration as the second duration.
In a possible implementation manner, the preloading module is further configured to obtain the target video file preloading request, where the target video file preloading request includes file identification information and resolution information; and acquiring the corresponding preloading information based on the file identification information and the resolution information.
In one possible implementation manner, the obtaining module is further configured to obtain format information of the initial video file; transcoding the initial video file based on the format information to obtain a compressed file; and decompressing the compressed file to obtain the target video file with at least one resolution.
In one possible implementation manner, the obtaining module is configured to respond to the format information of the initial video file as reference format information, and compress the initial video file to obtain the compressed file; and responding to the format information of the initial video file as non-reference format information, converting the format of the initial video file into a reference format, and compressing the format-converted initial video file to obtain the compressed file.
In another aspect, embodiments of the present application provide a computer device, where the computer device includes a processor and a memory, where the memory stores at least one program code, and the at least one program code is loaded and executed by the processor, so that the computer device implements a method for preloading video described in any of the foregoing.
In another aspect, there is provided a computer readable storage medium having stored therein at least one program code loaded and executed by a processor to cause a computer to implement a method of video preloading as described in any of the above.
In another aspect, there is provided a computer program or computer program product having stored therein at least one computer instruction that is loaded and executed by a processor to cause the computer to implement a method of video preloading of any of the above.
The technical scheme provided by the embodiment of the application at least brings the following beneficial effects:
according to the technical scheme provided by the embodiment of the invention, the reference loading information is determined through the preloading time length of the target video file, wherein the reference loading information comprises the number of the preloading frame images and the size of the preloading frame images, the size of the preloading video file is determined more accurately by utilizing the reference loading information and the parameter information, and unnecessary flow consumption caused by the fact that the preloading video file is bigger and the playing effect of the target video file is affected by the fact that the preloading video file is smaller are avoided. The size of the preloaded video file is utilized to generate preloaded information, and the target video file is preloaded based on the preloaded information, so that the experience of browsing videos by users can be improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of an implementation environment of a method for video preloading according to an embodiment of the present application;
FIG. 2 is a flow chart of a method for video preloading provided in an embodiment of the present application;
FIG. 3 is a flowchart for determining a preload duration of a video file according to an embodiment of the present application;
FIG. 4 is a flow chart of determining the size of a preloaded video file provided by an embodiment of the present application;
FIG. 5 is a flow chart of another method for determining the size of a preloaded video file provided by an embodiment of the present application;
fig. 6 is a schematic structural diagram of a video preloading device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a terminal device provided in an embodiment of the present application;
fig. 8 is a schematic structural diagram of a server according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like herein are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present application as detailed in the accompanying claims.
Before a user plays a video file through a webpage or an application program, the user needs to acquire the preloading information of the video file from a CDN (Content Delivery Network, content distribution network), the video file is preloaded by using the preloading information, and when the user clicks the video file to play, the user can play quickly by using the video data preloaded in advance. In a related embodiment, there are different ways to calculate the size of the preloaded video file.
Illustratively, the preloaded video file size is a fixed value, e.g., the preloaded video file size may be 512K. Different video files may have larger differences in resolution, code rate, coding algorithm and the like, and the size of the video file with fixed preloading cannot meet the loading requirements of all video files. If the fixed value is set larger, although the playing requirements of most video files can be met, additional CDN bandwidth cost can be increased; if the fixed value is set smaller, the preloaded size of part of video files cannot meet the playing condition, and the playing time of the video files is longer.
Illustratively, a preloaded video file size corresponding to the preloaded time period is estimated using a total size and a total time period of the video file, wherein the preloaded video file size is a product of a ratio of the total size of the video file to the total time period of the video file and the preloaded time period. But the resolution or compression mode of different video files is different, and the obtained preloaded video file size has larger deviation compared with the video file size which needs to be preloaded when meeting the playing conditions.
Illustratively, the preloaded video file size is determined using the media data size of the video file, the average code rate of the video, and the preloaded time period, wherein the preloaded video file size is the sum of the product of the average code rate of the video and the preloaded time period and the media data size. However, the video code rate is different due to the change of video scene, video clip and video editing operation in the video file, so that the code rate in the same video file is different. For example, when a video file starts, scene changes in the video are large, and in order to maintain definition and smoothness of the video, a higher code rate is adopted to transmit and store the video; or when the video file starts, the scene change in the video is smaller, and the video is transmitted and stored by adopting a lower code rate. The average code rate is used for calculating the size of the preloaded video file, and the preloaded video file has larger deviation compared with the size of the video file which needs to be preloaded when the playing condition is met.
For the preloaded video file, if the preloaded video file is larger, unnecessary flow consumption can be generated, and the bandwidth cost is increased; if the preloaded video file is smaller, the effect of fast playing of the video file is affected, and the experience of watching the video by a user is further affected. Therefore, how to determine the size of the preloaded video file is a problem to be solved.
Fig. 1 is a schematic diagram of an implementation environment of a method for video preloading according to an embodiment of the present application, as shown in fig. 1, where the implementation environment includes: a terminal device 101 and a server 102.
The method for preloading video provided in the embodiment of the present application may be performed by the terminal device 101, may be performed by the server 102, or may be performed by both the terminal device 101 and the server 102, which is not limited in the embodiment of the present application. For the case where the method for video preloading provided in the embodiment of the present application is performed jointly by the terminal device 101 and the server 102, the server 102 takes on primary computing work, and the terminal device 101 takes on secondary computing work; alternatively, the server 102 carries the secondary computing job and the terminal device 101 carries the primary computing job; alternatively, a distributed computing architecture is used for collaborative computing between the server 102 and the terminal device 101.
Alternatively, the terminal device 101 may be any electronic product that can perform man-machine interaction with a user through one or more modes of a keyboard, a touchpad, a touch screen, a remote controller, a voice interaction or a handwriting device, etc. Terminal devices 101 include, but are not limited to, cell phones, computers, intelligent voice interaction devices, vehicle terminals, aircraft, and the like. The server 102 is a server, or a server cluster formed by a plurality of servers, or any one of a cloud computing platform and a virtualization center, which is not limited in this embodiment of the present application. The server 102 is in communication connection with the terminal device 101 via a wired network or a wireless network. The server 102 has a data receiving function, a data processing function, and a data transmitting function. Of course, the server 102 may also have other functions, which are not limited in this embodiment of the present application.
It will be appreciated by those skilled in the art that the above-described terminal device 101 and server 102 are merely illustrative, and that other terminal devices or servers, now existing or hereafter may be present, as may be appropriate for use in the present application, are intended to be within the scope of the present application and are incorporated herein by reference.
The embodiment of the present application provides a method for video preloading, which may be applied to the implementation environment shown in fig. 1, and takes a flowchart of a method for video preloading provided in the embodiment of the present application shown in fig. 2 as an example, where the method may be performed by the terminal device 101 in fig. 1, or may be performed interactively by the terminal device 101 and the server 102. Taking the terminal device 101 to perform the method as shown in fig. 2, the method includes the following steps 210 to 240.
In step 210, parameter information of a target video file including a plurality of frame images is acquired.
In an exemplary embodiment of the present application, the target video file may be a video file obtained by processing a video uploaded by a user. The target video file is a video file to be preloaded, for example, a plurality of video files displayed on an interface of the user terminal or a video file about to appear on the interface of the user terminal in the process of browsing the video by the user can be determined as the target video file.
In an exemplary embodiment of the present application, before obtaining the parameter information of the target video file, the initial video file needs to be processed to obtain the target video file, where the process of processing the initial video file to obtain the target video file may include: acquiring format information of an initial video file; transcoding the initial video file based on the format information to obtain a compressed file; and decompressing the compressed file to obtain the target video file with at least one resolution.
Illustratively, the user may obtain an initial Video file in a different format during the Video production process, for example, the format of the initial Video file may include, but is not limited to, MP4 (Moving Picture Experts Group Audio Layer IV, dynamic image expert compression standard audio plane 4), FLV (Flash Video), AVI (Audio Video Interleaved, audio Video interleave format), and ASF (Advanced Systems Format, advanced system format). After the user uploads the initial video file, the server or the user's terminal may acquire format information of the initial video file through a suffix of the initial video file or using video analysis software.
After the format information of the initial video file is obtained, transcoding the initial video file based on the format information of the initial video file to obtain a compressed file. Illustratively, the format information of the initial video file is compared with reference format information, wherein the reference format may be a format that is later used to calculate the size of the preloaded video file, for example, the reference format may be an MP4 format. Responding to the format information of the initial video file to be the same as the reference format information, and compressing the initial video file to obtain a compressed file; and converting the format of the initial video file into a reference format in response to the format information of the initial video file being non-reference format information, namely the format information of the initial video file being different from the reference format information, wherein the reference format can be MP4 format, and then compressing the format-converted initial video file to obtain a compressed file.
In an exemplary embodiment of the present application, after obtaining the compressed file, the user terminal may upload the compressed file to the server, for example, the user may upload the compressed file to a video website, social media, web page, cloud storage platform, and the like of the server, where the location of uploading the compressed file is not limited in the present application. Taking the example that the user terminal uploads the compressed file to the server, after the compressed file is uploaded, the server sends a notification to the user terminal in an asynchronous mode to inform the user terminal that the compressed file is uploaded.
After obtaining the compressed file, the server may decompress the compressed file to obtain a target video file with at least one resolution. For example, the compressed file is decompressed by video processing software, and is converted into target video files with different resolutions, such as 480p, 720p, 1080p, and 4k, in the decompression process. It should be noted that, the resolution of the target video file is illustrated as an example, and the target video file with other resolutions may be obtained by using the video processing software, which is not limited in this application.
In the exemplary embodiment of the application, after the target video file is obtained, the video processing library or the video processing tool may be further used to analyze the target video file to obtain parameter information of the target video file. The video processing library may be OpenCV (Open Source Computer Vision Library ), and the video processing tool may be FFmpeg (Fast Forward Moving Picture Experts Group, fast moving picture experts group).
Illustratively, when the target video file is analyzed by FFmpeg, a corresponding command is input in FFmpeg and is executed, resulting in parameter information of the target video file, which may include at least one of media data information (moov), a frame rate, a resolution, an offset, or a size of a frame image, wherein different parameter information may be obtained based on different commands.
For example, when analyzing a target video file using OpenCV, an OpenCV tool is integrated into a server, parameter information of the target video file is determined using an output result of the function by calling different functions in the OpenCV, and the parameter information may include at least one of media data information (moov), a frame rate, a resolution, an offset, or a size of a frame image. By integrating the OpenCV into the server, the parameter information of the target video file can be obtained without being independently installed in the running environment of the server, and the stateless property of obtaining the parameter information of the target video file can be ensured.
In step 220, a preload duration of the target video file is determined, and reference load information is determined based on the preload duration, the reference load information including the preload frame images and the number of preload frame images.
In an exemplary embodiment of the present application, fig. 3 is a flowchart for determining a duration of preloading a video file provided in an embodiment of the present application. As shown in fig. 3, determining the preload duration of the video file may include steps 221 through 223.
In step 221, a preload indicator of the target video file is obtained, the preload indicator including at least one of a standard play-out rate or a standard click-through rate, and a reference load duration for characterizing a duration of the first preloading of the reference video file.
Illustratively, a preload indicator of the video file is determined, the preload indicator being used to characterize a standard that needs to be reached during the playing of the video file after the video file has been preloaded, the preload indicator may include at least one of a standard play-out rate or a standard click-through rate. The standard playing time is a standard which needs to be reached when a user clicks the video file until the video file starts to be played; the standard jamming rate is the ratio to be reached by the ratio of the number of video files with jamming in the video playing process to the total number of video files, wherein if the playing time interval between two adjacent frame images exceeds the jamming time threshold, the jamming in the video playing process is considered to occur, and whether the jamming occurs in the video playing process can be determined by counting the playing interval between the adjacent frame images. It should be noted that, the content included in the preload index in the present application is an exemplary illustration, and the preload index may be set based on actual situations, which is not limited in this application.
For example, after determining the preload index of the target video file, a reference load duration of the target video file needs to be determined, where the reference load duration is used to characterize a duration of the first preloaded part of the reference video file, and the part of the reference video file may be the initial preloaded video file. In one possible implementation, the reference load duration may be determined using a related implementation, e.g., the duration required to load a 512K target video file may be taken as the reference load duration. It should be noted that the reference loading duration may also be customized, for example, the reference loading duration may be set to 3s. The method for determining the reference loading time length is not limited.
In step 222, a preloading test is performed on the plurality of reference video files based on the reference loading time period to obtain a test result, where the test result includes at least one of a playing state or a clamping state of the reference video files.
For example, after determining the reference load duration, the plurality of reference files may also be preloaded with the reference load duration. And after the reference video file is preloaded based on the reference loading time, carrying out a preloading test, wherein the content of the test can comprise at least one of a play rate test and a click-through rate test, and obtaining a corresponding test result after the preloading test is completed, wherein the test result comprises at least one of a play state and a click-through state of the target video file.
Taking the reference loading time length of 3s as an example, after loading the reference video file for 3s, clicking the reference video file to play, and obtaining the play state of the reference video file by judging whether the reference file plays within the standard play time length, wherein the standard play time length can be determined based on the preloading index, namely, the reference video file needs to start playing within the standard play time length; the longer the reference loading time of the reference video file is, the easier the reference loading time is to meet the requirement of the standard playing time, and the easier the reference loading time is to meet the requirement of the standard playing rate. In the reference video file testing process, determining whether the reference video file is stuck in the playing process, and obtaining the stuck state of the reference video file. The longer the reference video file preloading time is, the smaller the probability of the reference video file jamming is, and the easier the reference video file is to meet the requirement of the standard jamming rate.
In step 223, a reference load duration is adjusted based on the test result and the preload index, and a preload duration is determined based on the adjusted reference load duration.
In the exemplary embodiment of the present application, taking an example that the pre-load index includes a standard play-out rate and a standard click-through rate, that is, the test result includes a play state and a click-through state of the reference video file. For example, a reference play-out rate and a reference click-through rate of the reference video file may be determined based on the test results, then a reference loading duration may be adjusted using the reference play-out rate and the reference click-through rate of the reference video file, and a preload duration may be determined using the adjusted reference loading duration.
Illustratively, adjusting the reference load duration based on the test result and the preload index, and determining the preload duration based on the adjusted reference load duration includes: determining reference playing rates of a plurality of reference video files based on playing states of the reference video files, and adjusting reference loading time length based on the reference playing rates and the standard playing rates to obtain a first time length; determining reference jamming rates of a plurality of reference video files based on the jamming states of the reference video files, and adjusting the reference loading time length based on the reference jamming rates and the standard jamming rates to obtain a second time length; a preload duration is determined based on the first duration and the second duration.
Illustratively, the adjusting the reference loading duration based on the reference play-out rate and the standard play-out rate, the obtaining the first duration may include: sequentially increasing a first adjustment time length on the reference loading time length in response to the reference play starting rate being smaller than the standard play starting rate until the reference play starting rate is not smaller than the standard play starting rate, and taking the current adjustment time length as the first time length; and in response to the reference play starting rate being greater than the standard play starting rate, sequentially reducing the first adjustment time length on the reference loading time length until the reference play starting rate is not greater than the standard play starting rate, and taking the current adjustment time length as the first time length.
In the exemplary embodiment of the present application, during the playing test of the reference video file, in response to the ratio of the number of video files that are not started to be played by the reference video file to the total number of reference video files being smaller than the standard playing rate in the standard playing time period, that is, the reference playing rate is smaller than the standard playing rate, it is indicated that the reference loading time period setting may be smaller, and the preloading time period of the reference video file should be increased. For example, a first adjustment time length is set, the first adjustment time length is added to the reference loading time length, the reference video file is preloaded based on the adjusted reference loading time length, the reference play starting rate of the reference video file in the standard play starting time length is determined, and the like until the reference play starting rate is not smaller than the standard play starting rate, and the current adjustment time length is used as the first time length, for example, the reference play starting rate corresponding to the current adjustment time length is equal to the standard play starting rate or slightly larger than the standard play starting rate.
In the exemplary embodiment of the present application, during the playing test of the reference video file, in response to the ratio of the number of video files that are not started to be played by the reference video file to the total number of reference videos being greater than the standard playing rate, that is, the reference playing rate is greater than the standard playing rate, in the standard playing period, it is stated that the reference loading period setting may be larger, and the preloading period of the reference video file should be reduced. For example, a first adjustment time length is set, the first adjustment time length is reduced on the reference loading time length, the reference video file is preloaded based on the adjusted reference loading time length, the reference play starting rate of the reference video file in the standard play starting time length is determined, and the like until the reference play starting rate is not more than the standard play starting rate, and the current adjustment time length is used as the first time length, for example, the reference play starting rate corresponding to the current adjustment time length is equal to the standard play starting rate or slightly less than the standard play starting rate.
It should be noted that, the last adjustment time of the current adjustment time may also be used as the first time, and the first adjustment time may be specifically set based on the case of the reference video file, which is not limited in this application.
Illustratively, adjusting the reference loading duration based on the reference click through rate and the standard click through rate, the process of obtaining the second duration may include: sequentially reducing the second adjustment time length on the reference loading time length until the reference click-through rate is not less than the standard click-through rate in response to the reference click-through rate being less than the standard click-through rate, and taking the current adjustment time length as the second time length; and in response to the reference click-through rate being greater than the standard click-through rate, sequentially increasing a second adjustment time length on the reference loading time length until the reference click-through rate is not greater than the standard click-through rate, and taking the current adjustment time length as the second time length.
In the exemplary embodiment of the present application, during the playing test of the reference video file, in response to the ratio of the number of video files in which the reference video file is jammed to the total number of reference video files being smaller than the standard jamming rate in the standard playing time period, that is, the reference jamming rate is smaller than the standard jamming rate, it is stated that the reference loading time period setting may be larger, and the preloading time period of the reference video file should be reduced. For example, a second adjustment time length is set, the second adjustment time length is reduced on the reference loading time length, the reference video file is preloaded based on the adjusted reference loading time length, the reference click-through rate of the reference video file in the standard playing time length is determined, and the like until the reference click-through rate is not smaller than the standard click-through rate, and the current adjustment time length is taken as the second time length, for example, the reference click-through rate corresponding to the current adjustment time length is equal to the standard playing rate or slightly larger than the standard click-through rate.
In the exemplary embodiment of the present application, during the playing test of the reference video file, in response to the ratio of the number of video files in which the reference video file is jammed to the total number of reference video files being greater than the standard click-through rate within the standard playing time period, that is, the reference click-through rate is greater than the standard click-through rate, it is indicated that the reference loading time period setting may be smaller, and the preloading time period of the reference video file should be increased. For example, a second adjustment time length is set, the second adjustment time length is added to the reference loading time length, the reference video file is preloaded based on the adjusted reference loading time length, the reference click-through rate of the reference video file in the standard playing time length is determined, and the like until the reference click-through rate is not more than the standard click-through rate, and the current adjustment time length is used as the second time length, for example, the reference click-through rate corresponding to the current adjustment time length is equal to the standard playing rate or slightly less than the standard click-through rate.
For example, after the first time period and the second time period are obtained, the preload time period may be determined based on the first time period and the second time period. For example, the first duration and the second duration are compared, the larger duration of the first duration and the second duration is used as the preloading duration, and at this time, the video file is preloaded based on the preloading duration, so that the requirements of the standard playing rate and the standard click-through rate can be met at the same time.
The playing rate and the click-through rate in the preloading index are tested by utilizing a plurality of reference video files and the reference loading time length, the reference loading time length is continuously adjusted according to the test result, the more accurate preloading time length is further obtained, and the size of the video file calculated by utilizing the preloading time length in the subsequent process can meet the preloading index.
In an exemplary embodiment of the present application, after the preload time period is obtained, reference load information is determined based on the preload time period, wherein the reference load information includes a preload frame image and a number of preload frame images, and the number of preload frame images is a product of a frame rate of the video file and the preload time period. For example, the frame rate of the video file is 30fps, the preloading time length is 2s, the number of preloaded images is 60 frames, and the preloaded frame images are the first 60 frame images of the target video file.
In step 230, the size of the preloaded video file is determined based on the reference loading information and the parameter information, and the preloaded information is generated based on the size of the preloaded video file.
In an exemplary embodiment of the present application, the target video file is in MP4 format. The MP4 video file stores the video file in a container (box), and the video file mainly includes a file type container (ftyp box), a media information container (moov box), and a media data container (mdat box), wherein the ftyp box is used for storing file type information, the moov box is used for storing media data information, and the mdat box is mainly used for storing media data and other auxiliary information.
In an exemplary embodiment of the present application, the size of the preloaded frame file is determined based on the number of preloaded frame images and the size of the preloaded frame images, and the size of the preloaded frame file and the size of the media data are used to obtain the size of the preloaded video file, wherein the size of the preloaded frame file may also be referred to as the play-out watermark file size. Fig. 4 is a flowchart of determining a size of a preloaded video file according to an embodiment of the present application. As shown in fig. 4, determining the size of the preloaded video file may include step 231, step 233, and step 235.
In step 231, the size of each preloaded frame image is determined based on the number of preloaded frame images and the size of the frame image.
For example, the preloaded frame image is the first 60 frame images of the target video file, and the size of each frame of the first 60 frame images of the target video file is determined by using the size of the frame image in the parameter information of the target video file.
In step 233, the size of the preloaded frame file is calculated based on the size of the preloaded frame image.
Illustratively, after the size of each frame of preloaded frame image is obtained, the size of the preloaded frame file may also be calculated based on the size of the preloaded frame image and the number of preloaded frame images, wherein the size of the preloaded frame file is the sum of the sizes of the preloaded frame images. For example, if the preloaded frame image is the first 60 frame images of the target video file, the size of the corresponding preloaded frame file is size (f 1) +size (f 2) … +size (f 60), where f1 is the 1 st frame preloaded frame image of the target video file, f2 is the 2 nd frame preloaded frame image of the target video file, …, f60 is the 60 th frame preloaded frame image of the target video file, and size is the size of the preloaded frame image.
In step 235, the size of the preloaded video file is calculated using the media data information and the size of the preloaded frame file.
Illustratively, the size (moov) of the media data of the target video file may be determined by the media data information of the target video file. After the size of the media data and the size of the preloaded frame file are obtained, the size of the preloaded video file is calculated by using the size of the media data and the size of the preloaded frame file, wherein the size of the preloaded video file is the sum of the size of the media data and the size of the preloaded frame file. For example, the size of the preloaded video file is size (moov) +size (f 1) +size (f 2) … +size (f 60), where size (moov) is the size of the media data.
The method and the device determine the number of the preloaded frame images through the preloaded time length and the frame rate of the target video file, calculate the size of the preloaded frame files based on the size of the preloaded frame images and the number of the preloaded frame images, and further determine the size of the preloaded video files. The size of the preloaded video file is determined by using the size of each frame of preloaded image, so that deviation in calculating the size of the preloaded video file caused by the change of parameter information corresponding to different time periods in the same video can be avoided.
In another exemplary embodiment of the present application, the parameter information of the target video file includes media data information and offset information, and the offset of the reference frame image may be determined based on the number of preloaded frame images and the parameter information of the video file, and the size of the preloaded video file may be obtained using the offset of the reference frame image and the size of the media data. FIG. 5 is a flow chart of another method for determining the size of a preloaded video file provided by an embodiment of the present application. As shown in fig. 5, determining the size of the preloaded video file may include step 232, step 234, and step 236.
In step 232, a reference frame image is determined in the target video file based on the number of preloaded frame images, the reference frame image being the next frame image to the preloaded frame image.
For example, after determining the number of preloaded frame images, a reference frame image may also be determined in the target video file based on the number of preloaded frame images, wherein the reference frame image is a next frame image of the preloaded frame images. For example, if the number of preloaded frame images is 60 frames, the reference frame image is the 61 th frame image of the target video file.
In step 234, an offset of the reference frame image is obtained based on the offset information of the target video file, the offset being used to represent the position of the reference frame image in the target video file.
For example, the index address of the reference frame image may be determined using the parameter information of the target video file, and the offset of the reference frame image may be determined using the index address of the reference frame image.
In step 236, the size of the preloaded video file is determined based on the offset of the reference frame image and the media data information.
In an exemplary embodiment of the present application, after obtaining the offset of the reference frame image, the media data size is determined using the media data information, and the size of the preloaded video file is calculated based on the offset of the reference frame image and the size of the media data, wherein the size of the preloaded video file is the sum of the size of the media data and the size of the offset of the reference frame image. For example, the number of preloaded frame images is 60 frames, the size of the preloaded video file is size (moov) +offset (f 61), where size (moov) is the size of media data, offset (f 61) is the offset of the reference frame image in the target video file, and the reference frame image is the 61 st frame image in the target video file.
The method comprises the steps of determining the number of preloaded frame images through the preloaded time length and the frame rate of a target video file, determining reference frame images based on the number of preloaded frame images, obtaining the offset of the reference frame images, and determining the size of the preloaded video file based on the offset of the reference frame images. The size of the preloaded video file is determined by using the offset of the reference frame image, so that deviation of the calculated size of the preloaded video file caused by the change of parameter information corresponding to different time periods in the same video can be avoided.
In the exemplary embodiment of the present application, after the size of the preloaded video file is obtained, the preloaded information may also be generated based on the size of the preloaded video file, where the preloaded information may include file identification information, resolution information, and the size of the preloaded file, and optionally, the preloaded information is used for preloading the video file before playing the video file.
In step 240, the target video file is preloaded based on the preloading information.
In an exemplary embodiment of the present application, the process of preloading the target video files based on the preloading information may include: acquiring a target video file preloading request, wherein the target video file preloading request comprises file identification information and resolution information; and acquiring corresponding preloading information based on the file identification information and the resolution information.
For example, when a user of the terminal browses video files, the terminal may determine a target video file using an interface displayed by the terminal, and obtain identification information and resolution information of the target video file, wherein the identification information of each video file is unique, and the resolution information may be obtained based on parameter information of the video file. And generating a file preloading request based on the identification information and the resolution information of the video file, and sending the preloading request to a corresponding server. When the server obtains a preloading request of the terminal, the preloading target video file can be determined based on file identification information and resolution information in the preloading request, the preloading information is determined according to the target video file, the preloading information of the target video file is sent to the corresponding terminal by the server through the CDN, and after the preloading information of the target video file is received by the terminal, the preloading is carried out on the target video file based on the preloading information, wherein the preloading information can comprise the identification information, the resolution information and the size of the preloading file of the target video file. Optionally, after receiving the preloading information of the target video file, the terminal preloads the target video file based on the preloading information before playing the target video file.
According to the video preloading method, the size of the video preloading file can be more accurate, the target video is preloaded based on the preloading information, and unnecessary flow consumption caused by the fact that the video preloading file is bigger and playing effects of the target video file are prevented from being influenced by the fact that the video preloading file is smaller. When the target video file plays, the target video is preloaded based on the preloading information, so that the waiting time and the blocking times of the video playing stage can be reduced, and the experience of a user for browsing the video is improved.
The application also provides a video preloading device. Fig. 6 is a schematic structural diagram of an apparatus for video preloading according to an embodiment of the present application, as shown in fig. 6, where the apparatus includes:
an obtaining module 310, configured to obtain parameter information of a target video file, where the target video file includes a plurality of frame images;
a determining module 320, configured to determine a preloading duration of the target video file, and determine reference loading information based on the preloading duration, where the reference loading information includes a preloading frame image and a number of preloading frame images;
a generation module 330 for determining the size of the preloaded video file based on the reference loading information and the parameter information, and generating the preloaded information based on the size of the preloaded video file;
The preloading module 340 is configured to preload the target video file based on the preloading information.
In one possible implementation, the parameter information includes media data information and a size of the frame image, and the generating module 330 is configured to determine a size of each preloaded frame image based on the preloaded frame image and the size of the frame image; calculating the size of the preloaded frame file based on the size of the preloaded frame image; the size of the preloaded video file is determined using the media data information and the size of the preloaded frame file.
In one possible implementation, the parameter information includes media data information and offset information, and the generating module 330 is configured to determine a reference frame image in the target video file based on the number of preloaded frame images, where the reference frame image is a frame image next to the preloaded frame image; acquiring the offset of the reference frame image based on the offset information of the target video file, wherein the offset is used for representing the position of the reference frame image in the target video file; the size of the preloaded video file is determined based on the offset of the reference frame image and the media data information.
In one possible implementation, the determining module 320 is configured to obtain a preload indicator of the target video file and a reference loading duration, where the preload indicator includes at least one of a standard play rate or a standard katon rate, and the reference loading duration is used to characterize a duration of the first preloading of the reference video file; preloading a plurality of reference video files based on the reference loading time length to obtain a test result, wherein the test result comprises at least one of a playing state or a clamping state of the reference video files; and adjusting the reference loading time length based on the test result and the preloading index, and determining the preloading time length based on the adjusted reference loading time length.
In one possible implementation, the preloading index includes a standard play-out rate and a standard click-through rate, and the determining module 320 is configured to determine a reference play-out rate of the plurality of reference video files based on a play state of the reference video files, and adjust a reference loading duration based on the reference play-out rate and the standard play-out rate to obtain a first duration; determining reference jamming rates of a plurality of reference video files based on the jamming states of the reference video files, and adjusting the reference loading time length based on the reference jamming rates and the standard jamming rates to obtain a second time length; a preload duration is determined based on the first duration and the second duration.
In one possible implementation manner, the determining module 320 is configured to sequentially increase the first adjustment duration over the reference loading duration in response to the reference play starting rate being less than the standard play starting rate until the reference play starting rate is not less than the standard play starting rate, and take the current adjusted duration as the first duration; and in response to the reference play starting rate being greater than the standard play starting rate, sequentially reducing the first adjustment time length on the reference loading time length until the reference play starting rate is not greater than the standard play starting rate, and taking the current adjustment time length as the first time length.
In one possible implementation manner, the determining module 320 is configured to sequentially reduce the second adjustment duration over the reference loading duration until the reference click-through rate is not less than the standard click-through rate, and take the currently adjusted duration as the second duration in response to the reference click-through rate being less than the standard click-through rate; and in response to the reference click-through rate being greater than the standard click-through rate, sequentially increasing a second adjustment time length on the reference loading time length until the reference click-through rate is not greater than the standard click-through rate, and taking the current adjustment time length as the second time length.
In one possible implementation, the preloading module 340 is further configured to obtain a target video file preloading request, where the target video file preloading request includes file identification information and resolution information; and acquiring corresponding preloading information based on the file identification information and the resolution information.
In one possible implementation, the obtaining module 310 is further configured to obtain format information of the initial video file; transcoding the initial video file based on the format information to obtain a compressed file; and decompressing the compressed file to obtain the target video file with at least one resolution.
In one possible implementation manner, the obtaining module 310 is configured to perform compression processing on the initial video file to obtain a compressed file in response to the format information of the initial video file being the reference format information; and converting the format of the initial video file into a reference format in response to the format information of the initial video file being non-reference format information, and compressing the format-converted initial video file to obtain a compressed file.
According to the video preloading method, the size of the video preloading file can be more accurate, the target video is preloaded based on the preloading information, and unnecessary flow consumption caused by the fact that the video preloading file is bigger and playing effects of the target video file are prevented from being influenced by the fact that the video preloading file is smaller. When the target video file plays, the target video is preloaded based on the preloading information, so that the waiting time and the blocking times of the video playing stage can be reduced, and the experience of a user for browsing the video is improved.
It should be understood that, in implementing the functions of the apparatus provided above, only the division of the above functional modules is illustrated, and in practical application, the above functional allocation may be implemented by different functional modules, that is, the internal structure of the device is divided into different functional modules, so as to implement all or part of the functions described above. In addition, the apparatus and the method embodiments provided in the foregoing embodiments belong to the same concept, and specific implementation processes of the apparatus and the method embodiments are detailed in the method embodiments and are not repeated herein.
Fig. 7 shows a block diagram of a terminal device 1100 according to an exemplary embodiment of the present application. The terminal device 1100 may be any electronic device product that can interact with a user by one or more means, such as a keyboard, touchpad, remote control, voice interaction, or handwriting device. For example, a PC (Personal Computer ), a mobile phone, a smart phone, a PDA (Personal Digital Assistant ), a wearable device, a PPC (Pocket PC, palm computer), a tablet computer, a smart car machine, a smart television, a smart sound box, a smart watch, and the like.
In general, the terminal apparatus 1100 includes: a processor 1101 and a memory 1102.
The processor 1101 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 1101 may be implemented in at least one hardware form of DSP (Digital Signal Processing ), FPGA (Field-Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array ). The processor 1101 may also include a main processor, which is a processor for processing data in an awake state, also called a CPU (Central Processing Unit ), and a coprocessor; a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 1101 may be integrated with a GPU (Graphics Processing Unit, image processor) for taking care of rendering and rendering of content that the display screen is required to display. In some embodiments, the processor 1101 may also include an AI (Artificial Intelligence ) processor for processing computing operations related to machine learning.
Memory 1102 may include one or more computer-readable storage media, which may be non-transitory. Memory 1102 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 1102 is used to store at least one instruction for execution by processor 1101 to implement the method of video preloading provided by the method embodiments herein.
In some embodiments, the terminal device 1100 may further optionally include: a peripheral interface 1103 and at least one peripheral. The processor 1101, memory 1102, and peripheral interface 1103 may be connected by a bus or signal lines. The individual peripheral devices may be connected to the peripheral device interface 1103 by buses, signal lines or circuit boards. Specifically, the peripheral device includes: at least one of radio frequency circuitry 1104, a display screen 1105, a camera assembly 1106, audio circuitry 1107, and a power supply 1108.
A peripheral interface 1103 may be used to connect I/O (Input/Output) related at least one peripheral device to the processor 1101 and memory 1102. In some embodiments, the processor 1101, memory 1102, and peripheral interface 1103 are integrated on the same chip or circuit board; in some other embodiments, any one or both of the processor 1101, memory 1102, and peripheral interface 1103 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
The Radio Frequency circuit 1104 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 1104 communicates with a communication network and other communication devices via electromagnetic signals. The radio frequency circuit 1104 converts an electrical signal into an electromagnetic signal for transmission, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 1104 includes: antenna systems, RF transceivers, one or more amplifiers, tuners, oscillators, digital signal processors, codec chipsets, subscriber identity module cards, and so forth. The radio frequency circuitry 1104 may communicate with other terminal devices via at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: the world wide web, metropolitan area networks, intranets, generation mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and/or WiFi (Wireless Fidelity ) networks. In some embodiments, the radio frequency circuitry 1104 may also include NFC (Near Field Communication, short range wireless communication) related circuitry, which is not limited in this application.
The display screen 1105 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display 1105 is a touch display, the display 1105 also has the ability to collect touch signals at or above the surface of the display 1105. The touch signal may be input to the processor 1101 as a control signal for processing. At this time, the display screen 1105 may also be used to provide virtual buttons and/or virtual keyboards, also referred to as soft buttons and/or soft keyboards. In some embodiments, the display 1105 may be one and disposed on the front panel of the terminal device 1100; in other embodiments, the display 1105 may be at least two, and disposed on different surfaces of the terminal device 1100 or in a folded design; in other embodiments, the display 1105 may be a flexible display disposed on a curved surface or a folded surface of the terminal device 1100. Even more, the display 1105 may be arranged in a non-rectangular irregular pattern, i.e., a shaped screen. The display 1105 may be made of LCD (Liquid Crystal Display ), OLED (Organic Light-Emitting Diode) or other materials.
The camera assembly 1106 is used to capture images or video. Optionally, the camera assembly 1106 includes a front camera and a rear camera. In general, a front camera is provided at a front panel of the terminal apparatus 1100, and a rear camera is provided at a rear surface of the terminal apparatus 1100. In some embodiments, the at least two rear cameras are any one of a main camera, a depth camera, a wide-angle camera and a tele camera, so as to realize that the main camera and the depth camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize a panoramic shooting and Virtual Reality (VR) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 1106 may also include a flash. The flash lamp can be a single-color temperature flash lamp or a double-color temperature flash lamp. The dual-color temperature flash lamp refers to a combination of a warm light flash lamp and a cold light flash lamp, and can be used for light compensation under different color temperatures.
The audio circuit 1107 may include a microphone and a speaker. The microphone is used for collecting sound waves of users and environments, converting the sound waves into electric signals, and inputting the electric signals to the processor 1101 for processing, or inputting the electric signals to the radio frequency circuit 1104 for voice communication. For the purpose of stereo acquisition or noise reduction, a plurality of microphones may be provided at different portions of the terminal device 1100, respectively. The microphone may also be an array microphone or an omni-directional pickup microphone. The speaker is used to convert electrical signals from the processor 1101 or the radio frequency circuit 1104 into sound waves. The speaker may be a conventional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, not only the electric signal can be converted into a sound wave audible to humans, but also the electric signal can be converted into a sound wave inaudible to humans for ranging and other purposes. In some embodiments, the audio circuit 1107 may also include a headphone jack.
A power supply 1108 is used to power the various components in terminal device 1100. The power supply 1108 may be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power source 1108 comprises a rechargeable battery, the rechargeable battery may be a wired rechargeable battery or a wireless rechargeable battery. The wired rechargeable battery is a battery charged through a wired line, and the wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, terminal device 1100 also includes one or more sensors 1110. The one or more sensors 1110 include, but are not limited to: acceleration sensor 1111, gyroscope sensor 1112, pressure sensor 1113, optical sensor 1114, and proximity sensor 1115.
The acceleration sensor 1111 can detect the magnitudes of accelerations on three coordinate axes of the coordinate system established in the terminal apparatus 1100. For example, the acceleration sensor 1111 may be configured to detect components of gravitational acceleration in three coordinate axes. The processor 1101 may control the display screen 1105 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal acquired by the acceleration sensor 1111. Acceleration sensor 1111 may also be used for the acquisition of motion data of a game or a user.
The gyro sensor 1112 may detect a body direction and a rotation angle of the terminal device 1100, and the gyro sensor 1112 may collect a 3D motion of the user on the terminal device 1100 in cooperation with the acceleration sensor 1111. The processor 1101 may implement the following functions based on the data collected by the gyro sensor 1112: motion sensing (e.g., changing UI according to a tilting operation by a user), image stabilization at shooting, game control, and inertial navigation.
The pressure sensor 1113 may be disposed at a side frame of the terminal device 1100 and/or at a lower layer of the display screen 1105. When the pressure sensor 1113 is provided at a side frame of the terminal apparatus 1100, a grip signal of the terminal apparatus 1100 by a user can be detected, and the processor 1101 performs left-right hand recognition or quick operation based on the grip signal collected by the pressure sensor 1113. When the pressure sensor 1113 is disposed at the lower layer of the display screen 1105, the processor 1101 realizes control of the operability control on the UI interface according to the pressure operation of the user on the display screen 1105. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
The optical sensor 1114 is used to collect the ambient light intensity. In one embodiment, the processor 1101 may control the display brightness of the display screen 1105 based on the intensity of ambient light collected by the optical sensor 1114. Specifically, when the intensity of the ambient light is high, the display luminance of the display screen 1105 is turned up; when the ambient light intensity is low, the display luminance of the display screen 1105 is turned down. In another embodiment, the processor 1101 may also dynamically adjust the shooting parameters of the camera assembly 1106 based on the intensity of ambient light collected by the optical sensor 1114.
A proximity sensor 1115, also referred to as a distance sensor, is typically provided on the front panel of the terminal device 1100. The proximity sensor 1115 is used to collect the distance between the user and the front surface of the terminal device 1100. In one embodiment, when the proximity sensor 1115 detects that the distance between the user and the front surface of the terminal device 1100 gradually decreases, the processor 1101 controls the display 1105 to switch from the bright screen state to the off screen state; when the proximity sensor 1115 detects that the distance between the user and the front surface of the terminal apparatus 1100 gradually increases, the processor 1101 controls the display screen 1105 to switch from the off-screen state to the on-screen state.
It will be appreciated by those skilled in the art that the structure shown in fig. 7 is not limiting and that terminal device 1100 may include more or fewer components than shown, or may combine certain components, or may employ a different arrangement of components.
Fig. 8 is a schematic structural diagram of a server provided in the embodiments of the present application, where the server 1200 may include one or more processors 1201 and one or more memories 1202, where the one or more memories 1202 store at least one program code that is loaded and executed by the one or more processors 1201 to implement the video preloading method provided in the embodiments of the methods described above. Of course, the server 1200 may also have a wired or wireless network interface, a keyboard, an input/output interface, etc. for performing input/output, and the server 1200 may also include other components for implementing device functions, which are not described herein.
In an exemplary embodiment, there is also provided a computer-readable storage medium having stored therein at least one program code loaded and executed by a processor to cause a computer to implement a method of video preloading of any of the above.
Alternatively, the above-mentioned computer readable storage medium may be a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a Read-Only optical disk (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer program or computer program product is also provided, having stored therein at least one computer instruction that is loaded and executed by a processor to cause the computer to implement a method of video preloading of any of the above.
It should be noted that, information (including but not limited to user equipment information, user personal information, etc.), data (including but not limited to data for analysis, stored data, presented data, etc.), and signals referred to in this application are all authorized by the user or are fully authorized by the parties, and the collection, use, and processing of relevant data is required to comply with relevant laws and regulations and standards of relevant countries and regions. For example, reference to parameter information, reference loading information, pre-loading information, etc. in this application is all acquired with sufficient authorization.
It should be understood that references herein to "a plurality" are to two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a exists alone, A and B exist together, and B exists alone. The character "/" generally indicates that the context-dependent object is an "or" relationship.
The foregoing description of the exemplary embodiments of the present application is not intended to limit the invention to the particular embodiments of the present application, but to limit the scope of the invention to any modification, equivalents, or improvements made within the principles of the present application.

Claims (10)

1. A method of video preloading, the method comprising:
acquiring parameter information of a target video file, wherein the target video file comprises a plurality of frame images;
determining a preloading time length of the target video file, and determining reference loading information based on the preloading time length, wherein the reference loading information comprises preloading frame images and the number of the preloading frame images;
determining a size of a preloaded video file based on the reference loading information and the parameter information, and generating preloaded information based on the size of the preloaded video file;
And preloading the target video file based on the preloading information.
2. The method of claim 1, wherein the parameter information includes media data information and a size of a frame image, and wherein the determining the size of the preloaded video file based on the reference loading information and the parameter information comprises:
determining a size of each preloaded frame image based on the preloaded frame image and the size of the frame image;
calculating the size of the preloaded frame file based on the size of the preloaded frame image;
and determining the size of the preloaded video file by utilizing the media data information and the size of the preloaded frame file.
3. The method of claim 1, wherein the parameter information includes media data information and offset information, and wherein the determining the size of the preloaded video file based on the reference loading information and the parameter information comprises:
determining a reference frame image in the target video file based on the number of preloaded frame images, wherein the reference frame image is the next frame image of the preloaded frame images;
acquiring the offset of the reference frame image based on the offset information of the target video file, wherein the offset is used for representing the position of the reference frame image in the target video file;
The size of the preloaded video file is determined based on the offset of the reference frame image and the media data information.
4. The method of claim 1, wherein the determining the preload duration of the target video file comprises:
the method comprises the steps of obtaining a preloading index and a reference loading time length of a target video file, wherein the preloading index comprises at least one of a standard playing rate or a standard cartoon rate, and the reference loading time length is used for representing the time length of the first preloading reference video file;
preloading a plurality of reference video files based on the reference loading time length to obtain a test result, wherein the test result comprises at least one of a playing state or a clamping state of the reference video files;
and adjusting the reference loading time length based on the test result and the preloading index, and determining the preloading time length based on the adjusted reference loading time length.
5. The method of claim 4, wherein the preload indicator comprises the standard play rate and the standard click-through rate, wherein the adjusting the reference load duration based on the test result and the preload indicator, and wherein the determining the preload duration based on the adjusted reference load duration comprises:
Determining reference playing rates of a plurality of reference video files based on the playing states of the reference video files, and adjusting the reference loading time length based on the reference playing rates and the standard playing rates to obtain a first time length;
determining reference click-through rates of a plurality of reference video files based on the click-through states of the reference video files, and adjusting the reference loading time length based on the reference click-through rates and the standard click-through rates to obtain a second time length;
the preload duration is determined based on the first duration and the second duration.
6. The method of claim 5, wherein the adjusting the reference loading duration based on the reference play-out rate and the standard play-out rate to obtain a first duration comprises:
sequentially increasing a first adjustment time length on the reference loading time length in response to the reference starting rate being smaller than the standard starting rate until the reference starting rate is not smaller than the standard starting rate, and taking the current adjustment time length as the first time length;
and in response to the reference play-out rate being greater than the standard play-out rate, sequentially reducing the first adjustment time length on the reference loading time length until the reference play-out rate is not greater than the standard play-out rate, and taking the current adjustment time length as the first time length.
7. The method of claim 5, wherein the adjusting the reference loading duration based on the reference click through rate and the standard click through rate to obtain a second duration comprises:
in response to the reference click-through rate being smaller than the standard click-through rate, sequentially reducing a second adjustment duration on the reference loading duration until the reference click-through rate is not smaller than the standard click-through rate, and taking the currently adjusted duration as the second duration;
and in response to the reference click-through rate being greater than the standard click-through rate, sequentially increasing the second adjustment duration on the reference loading duration until the reference click-through rate is not greater than the standard click-through rate, and taking the currently adjusted duration as the second duration.
8. An apparatus for video preloading, the apparatus comprising:
the acquisition module is used for acquiring parameter information of a target video file, wherein the target video file comprises a plurality of frame images;
the determining module is used for determining the preloading time length of the target video file, and determining reference loading information based on the preloading time length, wherein the reference loading information comprises preloading frame images and the number of the preloading frame images;
The generation module is used for determining the size of the preloaded video file based on the reference loading information and the parameter information and generating preloaded information based on the size of the preloaded video file;
and the preloading module is used for preloading the target video file based on the preloading information.
9. A computer device comprising a processor and a memory, the memory having stored therein at least one program code, the at least one program code being loaded and executed by the processor to cause the computer device to implement the method of video preloading of any of claims 1 to 7.
10. A computer readable storage medium having stored therein at least one program code, the at least one program code being loaded and executed by a processor to cause a computer to implement the method of video preloading of any of claims 1 to 7.
CN202410015859.3A 2024-01-04 2024-01-04 Method, apparatus, device and computer readable storage medium for video preloading Pending CN117812360A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410015859.3A CN117812360A (en) 2024-01-04 2024-01-04 Method, apparatus, device and computer readable storage medium for video preloading

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410015859.3A CN117812360A (en) 2024-01-04 2024-01-04 Method, apparatus, device and computer readable storage medium for video preloading

Publications (1)

Publication Number Publication Date
CN117812360A true CN117812360A (en) 2024-04-02

Family

ID=90420035

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410015859.3A Pending CN117812360A (en) 2024-01-04 2024-01-04 Method, apparatus, device and computer readable storage medium for video preloading

Country Status (1)

Country Link
CN (1) CN117812360A (en)

Similar Documents

Publication Publication Date Title
CN110446097B (en) Screen recording method and mobile terminal
CN109191549B (en) Method and device for displaying animation
CN108966008B (en) Live video playback method and device
CN110368689B (en) Game interface display method, system, electronic equipment and storage medium
US20200382781A1 (en) Video encoding method and apparatus, storage medium, and device
CN110297917B (en) Live broadcast method and device, electronic equipment and storage medium
CN110856019B (en) Code rate allocation method, device, terminal and storage medium
CN111586431B (en) Method, device and equipment for live broadcast processing and storage medium
CN110213485B (en) Image processing method and terminal
JP7467667B2 (en) Detection result output method, electronic device and medium
CN113038165B (en) Method, apparatus and storage medium for determining encoding parameter set
CN108881721B (en) Display method and terminal
CN111010588B (en) Live broadcast processing method and device, storage medium and equipment
CN111416996A (en) Multimedia file detection method, multimedia file playing device, multimedia file equipment and storage medium
CN110807769A (en) Image display control method and device
CN107888975B (en) Video playing method, device and storage medium
CN111459410B (en) Memory space allocation method and device, electronic equipment and storage medium
CN109714628B (en) Method, device, equipment, storage medium and system for playing audio and video
CN111478915A (en) Live broadcast data stream pushing method and device, terminal and storage medium
CN110971840A (en) Video mapping method and device, computer equipment and storage medium
CN115798418A (en) Image display method, device, terminal and storage medium
CN111698262B (en) Bandwidth determination method, device, terminal and storage medium
CN117812360A (en) Method, apparatus, device and computer readable storage medium for video preloading
CN110996115B (en) Live video playing method, device, equipment, storage medium and program product
CN111464829A (en) Method, device and equipment for switching media data and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination