CN117241088A - Video playing method, device and equipment - Google Patents

Video playing method, device and equipment Download PDF

Info

Publication number
CN117241088A
CN117241088A CN202311232831.7A CN202311232831A CN117241088A CN 117241088 A CN117241088 A CN 117241088A CN 202311232831 A CN202311232831 A CN 202311232831A CN 117241088 A CN117241088 A CN 117241088A
Authority
CN
China
Prior art keywords
video
playing
target
video clip
clip
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
CN202311232831.7A
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.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN202311232831.7A priority Critical patent/CN117241088A/en
Publication of CN117241088A publication Critical patent/CN117241088A/en
Pending legal-status Critical Current

Links

Landscapes

  • Television Signal Processing For Recording (AREA)

Abstract

The invention provides a video playing method, a device and equipment, which are used for determining a target video clip to be played when playing the target video clip, and judging whether a target video clip object corresponding to the target video clip is stored in a preset cache queue or not And if so, calling and playing the video content corresponding to the video playing time point in the target video clip object from the preset cache queue. Because the invention directly plays the target video clip object, individual video clips are not required to be decoded into a frame image for rendering by a software decoding mode,therefore, resources occupied by video playing can be reduced, video playing waiting time is shortened, and user experience is improved. In addition, the time loss caused by creating the video object in the splicing playing process is reduced by caching the video segment object in the preset cache queue.

Description

Video playing method, device and equipment
Technical Field
The present invention relates to the field of video playing, and in particular, to a video playing method, apparatus and device for a multi-video splicing playing method.
Background
In an online video clip scenario, live preview of multiple clips is one of the main functions.
The multiple video clips are typically decoded in sequence by software decoding and rendered in real-time in the player. The decoded image of each video clip is added to the final stitched video frame by frame to preview the final effect in real time. The method can immediately check the spliced video effect, but can occupy more computing resources, such as CPU (CentralProcessing Unit ) computing resources and the like, and needs longer loading time, so that the user experience is reduced.
Disclosure of Invention
In view of this, the invention provides a video playing method, device and equipment, so as to solve the problems that when a plurality of videos are spliced and played, more computing resources are occupied, the video loading time is longer, and the user experience is reduced.
In order to solve the technical problems, the invention adopts the following technical scheme:
a video playing method, comprising:
under the condition of receiving a video playing instruction, acquiring a video playing time point in the video playing instruction; the video playing time point is a time point on a main time axis corresponding to the video queue; the video queue comprises a plurality of video clips which need to be spliced and played; the main time axis consists of time axes corresponding to the video clips;
Determining a target video clip corresponding to the video playing time point from the plurality of video clips, and judging whether a target video clip object corresponding to the target video clip is stored in a preset cache queue or not; the target video clip object is a video player instance created for the target video clip;
and if so, calling and playing the video content corresponding to the video playing time point in the target video clip object from the preset cache queue.
Optionally, determining, from the plurality of video clips, a target video clip corresponding to the video playing time point includes:
acquiring the arrangement sequence and the video duration of each video clip; the arrangement sequence is obtained based on user setting;
and calculating the position of the video playing time point in the video duration of each video segment based on the video duration of each video segment, and searching the target video segment corresponding to the position according to the sequence of each video segment.
Optionally, invoking and playing the video content corresponding to the video playing time point from the preset cache queue, where the invoking and playing the video content includes:
Determining a target video segment object corresponding to the identification information from the preset cache queue based on the identification information of the target video segment object; the identification information is a parameter for identifying the target video clip object;
determining the video fragments corresponding to the video playing time points from a plurality of video fragments forming the target video fragment object;
playing the video content corresponding to the video playing time point in the determined video fragments; and when the video content corresponding to the video playing time point is played, calling a hardware decoding function of the browser to perform decoding operation.
Optionally, the method further comprises:
if the fact that the target video segment object corresponding to the target video segment is not stored in the preset cache queue is judged, creating a video player instance for the target video segment by using an API provided by a video play library, and obtaining the target video segment object;
and playing the video content corresponding to the video playing time point in the target video clip object, and storing the target video clip object into the preset cache queue.
Optionally, the method further comprises:
Carrying out instantiation operation on video clips adjacent to the target video clip to obtain an associated video clip object;
and storing the associated video segment object into the preset cache queue, and calling and playing the associated video segment object corresponding to the adjacent video segment from the preset cache queue when the adjacent video segment is determined to be required to be played.
Optionally, in the process of calling and playing the target video clip object from the preset buffer queue, the video playing time point corresponds to the video content, the method further includes:
judging whether all video clips included in the target video clip object are loaded through a network request;
if the loading is completed, carrying out preloading operation on the appointed video clip object; the specified video clip object is a video clip object corresponding to a next video clip located after the target video clip.
Optionally, the method further comprises:
judging the total number of all video clip objects stored in the preset cache queue;
and deleting the video fragment objects stored in the preset cache queue first under the condition that the total number is larger than the preset number.
A video playback device comprising:
the time point acquisition module is used for acquiring a video playing time point in the video playing instruction under the condition of receiving the video playing instruction; the video playing time point is a time point on a main time axis corresponding to the video queue; the video queue comprises a plurality of video clips which need to be spliced and played; the main time axis consists of time axes corresponding to the video clips;
the judging module is used for determining a target video clip corresponding to the video playing time point from the plurality of video clips and judging whether a target video clip object corresponding to the target video clip is stored in a preset cache queue or not; the target video clip object is a video player instance created for the target video clip;
and the video playing module is used for calling and playing the video content corresponding to the video playing time point in the target video clip object from the preset cache queue if the video playing module exists.
Optionally, the judging module includes:
the data acquisition sub-module is used for acquiring the arrangement sequence and the video duration of each video clip; the arrangement sequence is obtained based on user setting;
The segment determining sub-module is used for calculating the positions of the video playing time points in the video duration of the video segments based on the video duration of each video segment, and searching target video segments corresponding to the positions according to the sequence of each video segment.
A video playback device comprising a controller for performing the video playback method described above.
A video playback device comprising a controller for performing the video playback method described above.
Compared with the prior art, the invention has the following beneficial effects:
the invention provides a video playing method, a device and equipment, which are used for determining a target video clip to be played when playing the target video clip, and judging whether a target video clip object corresponding to the target video clip is stored in a preset cache queue or not And if so, calling and playing the video content corresponding to the video playing time point in the target video clip object from the preset cache queue. In the invention, the target video clip object is directly played, and each video clip is not required to be decoded into a frame image for rendering in a software decoding mode, so that the resources occupied by video playing can be reduced, the waiting time of video playing is shortened, and the user experience is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present invention, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
Fig. 1 is a method flowchart of a video playing method according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for playing video content according to an embodiment of the present invention;
fig. 3 is a flowchart of another video playing method according to an embodiment of the present invention;
fig. 4 is a flowchart of a method for playing video according to another embodiment of the present invention;
fig. 5 is a schematic view of a video playing method according to an embodiment of the present invention;
fig. 6 is a flowchart of a method for playing video according to another embodiment of the present invention;
fig. 7 is a schematic structural diagram of a video playing device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In an online video clip scenario, live preview of multiple clips is one of the main functions.
The multiple video clips are typically decoded in sequence by software decoding and rendered in real-time in the player. The software decoding may be implemented by a software decoding program, which may be a separately configured program that is called for software decoding when decoding is performed. In addition, the software decoding program may be combined with the running program of the online video editing tool.
The decoded image of each video clip is added to the final stitched video frame by frame to preview the final effect in real time. This approach allows for immediate viewing of the spliced video effects, but may take up more computing resources. Specifically, the software decoding program can be configured at the client and also can be configured at the server, for long video played by splicing, the software decoding consumes more resources (such as CPU (Central ProcessingUnit, central processing unit) computing resources and the like) and requires longer loading time, which is time-consuming, and when the client is in a client, performance bottlenecks exist, and the situation that video cannot be played by splicing due to insufficient resources exists, so that user experience is reduced.
Therefore, the inventor finds that if the corresponding video clips can be directly played, and decoding each video clip into a frame image for rendering by a software decoding mode is not needed, the problems of calculation resource waste and time consumption caused by decoding into the frame image can be reduced.
Specifically, the invention provides a video playing method, a device and equipment, when playing a target video clip, determining the target video clip to be played, and judging whether a target video clip object corresponding to the target video clip is stored in a preset cache queue And if so, calling and playing the video content corresponding to the video playing time point in the target video clip object from the preset cache queue. In the invention, the target video clip object is directly played, and each video clip is not required to be decoded into a frame image for rendering in a software decoding mode, so that the resources occupied by video playing can be reduced, the waiting time of video playing is shortened, and the user experience is improved.
In addition, in the invention, the online video editing tool is generally a Web (world Wide Web) tool and runs on a browser, and the browser has hardware decoding capability, and can call the hardware at the bottom layer of the terminal to carry out decoding operation when the video clip object is played. Compared with the software decoding, the hardware decoding mainly relies on CPU resources, the hardware decoder is integrated to the hardware bottom layer, and the hardware decoder mainly relies on GPU (Graphics Processing Unit, graphics processor), so that the CPU can be greatly liberated, the occupation of resources such as CPU computing resources can be reduced, namely, compared with the software decoding, the hardware decoding uses fewer resources, and the problems that video cannot be spliced and played due to insufficient resources and user experience is reduced can be avoided. In addition, hardware decoding is more efficient than software decoding, and time consumption can be reduced.
However, when the hardware decoding is used, only the hardware decoding of a single video is supported, and the scene aimed by the method is the situation that a plurality of videos are spliced and played, namely, the plurality of videos need to be decoded by hardware, and at the moment, each video can be sequentially called to be decoded and played, so that the problem of multi-video hardware decoding is solved.
In addition, in order to reduce time consumption, the video to be decoded can be instantiated in advance to obtain a video clip object and stored in a preset cache queue, and when the video clip object needs to be played, the video clip object is directly called to be decoded and played, so that the time consumption required for creating the video clip object is reduced, and the playing waiting time is reduced.
In an embodiment of the present invention, a video playing method is provided, which is applied to a terminal with a browser function, such as a mobile phone, a computer, etc. The terminal is configured with an online video editing tool, such as a cloud editing tool, through which video editing of movies, television shows, sports, etc. is performed. The tool carries out online video editing through a Web page of a browser, and scenes such as secondary creation video editing all have use scenes of the online editing. In this scenario, if a plurality of video clips need to be played, the video playing method in this embodiment may be used.
It should be noted that, the execution body of the video playing method may be an operation program of an online video editing tool in the terminal, and specifically may be an independent scheduler program and timer program in the operation program, or a total program formed by combining the scheduler program and the timer program. Wherein the scheduler program is used for scheduling the specific video clip to play according to the whole main time axis.
Referring to fig. 1, the video playing method may include:
s11, under the condition that a video playing instruction is received, acquiring a video playing time point in the video playing instruction.
The video playing time point is a time point on a main time axis corresponding to a video queue, the video queue comprises a plurality of video clips to be spliced and played, and the main time axis consists of time axes corresponding to the video clips.
In detail, if the user uses the online video editing tool, the user may drag and adjust the sequence of the plurality of video clips and adjust the length of a certain video clip, which generally needs to clip or sequentially arrange the plurality of clipped video clips under the Web interface.
The plurality of video clips arranged in the order set by the user may form a video queue, that is, the video queue is a queue composed of all video clips arranged on the track during the clip process.
Each of these video clips in the video queue has a corresponding video duration, such as 1 minute, 30 seconds, etc. The video queues formed by the video clips arranged in sequence correspond to a main time axis, and the main time axis is a time axis corresponding to the total duration of the video clips spliced in sequence in the clipping process. For example, if there are 3 video clips of 1 minute, each video clip corresponds to a time axis of 1 minute, and the length of the main time axis is the sum of the durations of the three video clips of 1 minute, that is, 3 minutes.
It should be noted that, since the user may adjust the video duration in real time, delete or add a video clip during video editing, the length of the main time axis in this embodiment is continuously changed. Then the current video queue needs to be maintained in real time according to user operations (e.g., deletion, addition, adjustment of video clip order, etc.) on the track during the editing process, and the length of the main timeline is calculated accordingly.
When the user wants to preview the video clip, the user clicks a position point on the main time axis according to the video clip that the user wants to play, for example, the 30 th second is a video playing time point in the embodiment, that is, the video playing time point is a time point set by the user when the video starts playing, where the time point is a time point on the main time axis that needs to be played currently. After receiving the playing operation of the user, the user considers that a video playing instruction in a Web interface where the specified browser page, namely the online video editing tool is located is received, and a video playing time point in the video playing instruction is obtained.
S12, determining a target video clip corresponding to the video playing time point from the plurality of video clips.
Specifically, after determining the video playing time point, it is further required to determine which video clip corresponds to the video playing time point, that is, which video clip needs to be played.
In practical applications, step S12 may specifically include:
1) And acquiring the arrangement sequence and the video duration of each video clip.
Wherein the arrangement order is obtained based on user settings, and the specific setting process refers to the corresponding parts. The arrangement sequence of each video clip is the arrangement sequence of all video clips on the track, such as video clips 1, 2, 3, 4 and 5 are arranged according to the sequence of 1, 3, 2, 4 and 5.
The video duration refers to the time length of the video segments, for example, 1 minute, 30 seconds, etc., and the video duration of each video segment may be the same or different, which is not limited in this embodiment.
2) And calculating the position of the video playing time point in the video duration of each video segment based on the video duration of each video segment, and searching the target video segment corresponding to the position according to the sequence of each video segment.
Specifically, knowing the video duration of each video clip and the video play time point to be played, first determining the position of the video play time point in the video duration of the video clip.
For example, assuming that the video playing time point is 2 minutes and 10 seconds, and there are 1, 2, 3, 4 and 5 video clips, and the video durations are all 1 minute, the video duration corresponding to 2 minutes and 10 seconds is 10 seconds of the third video.
Then, according to the sequence of each video segment, searching which video is the third video, and taking the third video as a target video segment.
The steps S11 and S12 may be calculated by a timer program.
S13, judging whether a target video clip object corresponding to the target video clip is stored in a preset cache queue; if yes, go to step S14.
Wherein the target video clip object is a video player instance created for the target video clip by using an API provided by a video play library.
Specifically, in order to use the hardware decoding mode, a function of creating a Video object by using a browser is required, in this embodiment, an object of a Video clip needs to be created through an instantiation operation to obtain a Video clip object, and then the Video object can be decoded in hardware. Instantiation in this step refers specifically to one video player instance created for a video clip by using the API (Application Programming Interface, application program interface) provided by the video player library.
In order to save the time of creating the video object, in this embodiment, the video clip object may be created in advance through an instantiation operation and stored in a preset buffer queue. Video fragment objects of a preset cache queue are arranged according to the sequence of the creation time.
In order to avoid the problem of more occupied memory resources caused by more video clip objects stored in the preset buffer queue, in this embodiment, the number of video clip objects in the preset buffer queue is limited.
In practical application, a preset number is set, specifically, a technician configures according to practical situations, then determines the total number of video clip objects stored in a preset cache queue, and deletes the video clip object stored in the preset cache queue first when the total number is greater than the preset number.
The video clip object stored in the preset cache queue first is deleted, and because the video clip object has a larger probability of being played compared with the video clip object which enters later, and has a smaller probability of being played later, the meaning stored in the preset cache queue is not great, so that the video clip object needs to be deleted. After deletion, if the play requirement is still met, the video clip object can be restored through the restoration function.
On the basis of the preset cache queue, whether a target video clip object corresponding to a target video clip to be played is stored in the preset cache queue is further judged. If yes, the method is directly called.
When judging whether the target video segment object is stored in the preset cache queue, determining based on the identification information of the target video segment, where the identification information is a parameter for identifying the target video segment object, if the identification information of the target video segment is 1, the identification information of the corresponding target video segment object may also be the same as the identification information of the target video segment, if the identification information is 1. Regardless of how the identification information of the target video clip object is configured, a correspondence of the identification information of the target video clip and the identification information of the target video clip object should be established.
S14, calling and playing the video content corresponding to the video playing time point in the target video clip object from the preset cache queue.
Specifically, when the target video clip object is called, the identification information of the target video clip object is also based.
In detail, referring to fig. 2, step S14 may include:
S21, determining the target video segment object corresponding to the identification information from the preset cache queue based on the identification information of the target video segment object.
The identification information is a parameter for identifying the target video clip object, and the configuration process of the specific identification information is referred to the corresponding description above.
Taking the identification information of the target video segment object as 1 as an example, finding out the target video segment object with the identification of 1 from a preset cache queue.
In order to improve the searching efficiency, the video clip objects in the preset cache queue may be arranged sequentially according to the identification information, for example, the video clip objects 1, 3, 4, 5 are arranged in order from small to large. When searching the video clip object based on the identification information, searching is performed according to the sequence, and searching in a full traversal mode is not needed.
S22, determining the video fragment corresponding to the video playing time point from a plurality of video fragments forming the target video fragment object.
Specifically, each video clip object is composed of a plurality of video clips, and the video clips adopt a format of TS (Transport Stream), which is based on the M318 protocol.
In the case of splitting video clips, a video at a specified time may be taken as one video clip, for example, 3 seconds of video may be taken as one video clip.
When the video playing time point is known, the video slicing can be determined through data calculation, for example, the 4 th video slicing is 10 seconds.
S23, playing the video content corresponding to the video playing time point in the determined video fragments.
And when the video content corresponding to the video playing time point is played, calling a hardware decoding function of the browser to perform decoding operation.
Specifically, when playing the video clips, it is required to determine which content of the video clip is to be played, and specifically, the content is also obtained by calculation according to data, for example, 10 seconds is the 2 nd second content in the 4 th video clip, and then playing starts from the 2 nd second content in the 4 th video clip.
When playing, firstly, the hardware decoding function of the browser is called to perform decoding operation, namely, the hardware of the bottom layer of the terminal is adopted to perform decoding operation, after decoding, video rendering operation is performed on the video obtained through decoding, and when playing, video playing is performed at the video preview position of the Web page, such as in a player.
In the playing process, the user can adjust the playing time point of the video at any time, such as jumping to a certain video clip for playing. In addition, the order of the two video clips can be adjusted, or the playing can be paused.
If the user jumps to a certain video clip for playing, the steps S11-S14 are re-executed. If the user adjusts the order of the two video clips, the order of the two video clips in the video queue needs to be adjusted. If the user pauses the playing, the playing of the video is paused.
The steps S13 to S14 are performed by the scheduler program. In addition, the steps S11 to S14 may be performed by a total program obtained by combining the scheduler program and the timer program.
In this embodiment, when playing a target video clip, determining a target video clip to be played, and determining whether a target video clip object corresponding to the target video clip is stored in a preset buffer queue And if so, calling and playing the video content corresponding to the video playing time point in the target video clip object from the preset cache queue. In the invention, the target video clip object is directly played, and each video clip is not required to be decoded into a frame image for rendering in a software decoding mode, so that the resources occupied by video playing can be reduced, the waiting time of video playing is shortened, and the user experience is improved.
In addition, the embodiment decodes and splices and plays a plurality of videos through the original hard decoding capability of the browser, replaces a mode of synthesizing the plurality of videos into one video for playing through software decoding, reduces the time consumption of decoding, and avoids performance problems caused by software decoding.
In addition, the time loss caused by creating the video object in the splicing playing process is reduced by caching the video segment object in the preset cache queue.
On the basis of the above, referring to fig. 3, if it is determined that the target video clip object corresponding to the target video clip is not stored in the preset buffer queue, step S35 is performed. The specific implementation process of steps S31-S34 is described above.
S35, creating a video player instance for the target video clip by using an API provided by a video play library, and obtaining a target video clip object.
In practical application, if the Video clip object of the Video clip played by the user is stored in the preset buffer queue, the Video clip object can be directly called to play, if the user jumps to a certain Video clip to play in the playing process, or if the user plays the Video clip for the first time, there is a situation that the target Video clip object corresponding to the target Video clip is not stored in the preset buffer queue, at this time, the function of creating the Video object by calling the browser is called to perform the instantiation operation, specifically, a Video player instance is created for the target Video clip by using the API provided by the Video player library, so as to obtain the target Video clip object.
S36, playing the video content corresponding to the video playing time point in the target video clip object, and storing the target video clip object into the preset cache queue.
After the target video clip object is created, playing is directly invoked, and the specific playing process is described in the above embodiments.
After the instantiation operation is performed on the target video segment to obtain the target video segment object, the target video segment object may also be stored in a preset buffer queue.
In practical application, there may be a case that a user plays a certain video clip in a loop in order to view the video clip effect, so in order to avoid the need of an instantiation operation when playing the same video clip again, the embodiment stores the target video clip object in a preset buffer queue for the next call.
In addition, after the target video clip object has been stored in the preset cache queue, it is determined whether the video clip object of the video clip adjacent to the target video clip is stored in the preset cache queue.
Specifically, when a user previews a video clip, when playing a certain video clip, the probability of jumping to the next video clip or the previous video clip is extremely high, in order to be suitable for such a scene, if an adjacent video clip object is not stored, an instantiation operation can be performed on a video clip adjacent to a target video clip to obtain an associated video clip object, and the associated video clip object is stored in a preset cache queue, so that when it is determined that the adjacent video clip needs to be played, the associated video clip object corresponding to the adjacent video clip is called from the preset cache queue and played.
It should be noted that if the video clip played by the user is located at the first or last position of the video queue, only one adjacent video clip object may be cached. If the video clip played by the user is not located at the first or last position of the video queue, two adjacent video clip objects can be cached.
If the associated video clip is played later, the associated video clip object can be directly called from the preset cache queue to play, so that the problem of play delay caused by instantiation operation is avoided, and the user experience is improved.
In addition, if the associated video clip object is already stored in the preset cache queue, secondary cache is not performed.
In this embodiment, during the playing process, the video clip currently being played and the video clips before and after the video clip are instantiated and stored in the preset buffer queue, and during the subsequent playing process, whether the video clip to be played exists or not is first seen from the preset buffer queue, so that the time of the instantiation operation is reduced, the video playing waiting time is reduced, and the user experience is improved.
The embodiment reduces the video playing waiting time by performing the instantiation operation in advance, and in addition, the video playing waiting time can be reduced by performing the preloading operation. Specifically, referring to fig. 4, after calling and playing the video content corresponding to the video playing time point from the preset buffer queue, the method further includes:
S45, judging whether the loading of the target video clip object is completed or not; if yes, go to step S46.
Specifically, whether all video clips included in the target video clip object are loaded through a network request is judged.
In the playing process of the target video clip object, the video clips to be played in the target video clip object are sequentially played, and when the current video clip is played, the next clip or a plurality of subsequent video clips are loaded until the last video clip is loaded, and at the moment, the loading of the target video clip object is considered to be completed.
S46, preloading the appointed video segment object.
Specifically, the specified video clip object is a video clip object corresponding to a next video clip located after the target video clip.
That is, after loading the target video clip object, the video clip object corresponding to the next video clip located after the target video clip is preloaded in advance, and when the preloading is performed, a set number of video clips, for example, 3 to 5 video clips, may be preloaded.
In this embodiment, when the preloading operation is performed during the next video clip object to be played, the jump at the video connection position can avoid the condition of blocking, reduce the waiting time of the user during the next video clip playing, and improve the user experience.
It should be noted that, the preloading may be performed during the idle time of playing the video clip object, so as to avoid affecting the clip during playing. In addition, the specific implementation process of steps S41-S44 is described above.
In order that the specific implementation of the present invention may be more clearly understood by those skilled in the art, the description will now be made with reference to steps S51-S510 of fig. 5 and 6.
The timer program detects the video playing time point on the main time axis in real time and transmits the video playing time point to the scheduler program, if the scheduler program determines the target video clip and judges that the video clip object corresponding to the target video clip to be played is stored in the preset cache queue, the video clip object is called from the preset cache queue and played. If not, carrying out instantiation operation on the target video clip in the video queue to obtain a target video clip object, calling and playing, and storing the video clip object in a preset cache queue.
And judging whether the related video segment object is stored in a preset cache queue, if not, creating and storing, if yes, judging whether the loading of the target video segment object is completed, if not, continuing to load, and if so, preloading the next video segment.
For example, five video clips, numbered 1-5, are all on the main timeline, each video clip being ten minutes in length, that total timeline length being 50 minutes. At present, there are 1,2 and 3 video clip objects in the cache queue, and the preset number of the cache queues is 4.
If the main time axis of the user operation is positioned to the 39 minutes time point, the 4 th video clip is played through calculation, and the 4 th video clip object is not in the preset cache queue, the video clip object needs to be created, namely, instantiated, and placed in the preset cache queue, and the length of the cache queue is 4. Then judging whether the two video fragment objects before and after the video fragment object are in a preset cache queue, and finding that 3 is in and 5 is not in. An object needs to be created for the 5 th video clip and put into a cache, at this time, the length of the cache queue reaches 5, and exceeds the preset number 4, and the preset cache queue needs to be removed from the video clip object 1 which enters the preset cache queue for the first time. When the 4 th video segment object is played, if all video segments of the 4 th video segment object are loaded, the preloading operation is carried out on the first video segments in the 5 th video segment object.
On the basis of the above embodiment, another embodiment of the present invention provides a video playing device, referring to fig. 6, may include:
a time point obtaining module 11, configured to obtain a video playing time point in a video playing instruction when receiving the video playing instruction; the video playing time point is a time point on a main time axis corresponding to the video queue; the video queue comprises a plurality of video clips which need to be spliced and played; the main time axis consists of time axes corresponding to the video clips;
the judging module 12 is configured to determine a target video clip corresponding to the video playing time point from the plurality of video clips, and judge whether a target video clip object corresponding to the target video clip is stored in a preset cache queue; the target video clip object is a video player instance created for the target video clip by using an API provided by a video play library;
and the video playing module 13 is configured to call and play the video content corresponding to the video playing time point from the preset buffer queue if the video content exists in the target video clip object.
Wherein, the judging module 12 includes:
the data acquisition sub-module is used for acquiring the arrangement sequence and the video duration of each video clip; the arrangement sequence is obtained based on user setting;
the segment determining sub-module is used for calculating the positions of the video playing time points in the video duration of the video segments based on the video duration of each video segment, and searching target video segments corresponding to the positions according to the sequence of each video segment.
The video playing module 13 is specifically configured to:
determining a target video segment object corresponding to the identification information from the preset cache queue based on the identification information of the target video segment object; the identification information is a parameter for identifying the target video clip object;
determining the video fragments corresponding to the video playing time points from a plurality of video fragments forming the target video fragment object;
playing the video content corresponding to the video playing time point in the determined video fragments; and when the video content corresponding to the video playing time point is played, calling a hardware decoding function of the browser to perform decoding operation.
Further, the method further comprises the following steps:
the instantiation module is configured to create a video player instance for the target video clip by using an API provided by the video play library if it is determined that the target video clip object corresponding to the target video clip is not stored in the preset cache queue, play the video content corresponding to the video play time point in the target video clip object, and store the target video clip object in the preset cache queue.
Further, the video processing module is used for carrying out instantiation operation on video clips adjacent to the target video clip to obtain an associated video clip object, and storing the associated video clip object into the preset cache queue so as to call and play the associated video clip object corresponding to the adjacent video clip from the preset cache queue when the adjacent video clip is determined to be played.
Further, the video processing device also comprises a loading module, which is used for judging whether all video clips included in the target video clip object are loaded through a network request, and if so, carrying out preloading operation on the appointed video clip object; the specified video clip object is a video clip object corresponding to a next video clip located after the target video clip.
And the system further comprises a cache control module which is used for judging the total number of all video fragment objects stored in the preset cache queue, and deleting the video fragment object stored in the preset cache queue first under the condition that the total number is larger than the preset number.
In this embodiment, in the playing targetWhen video clips are displayed, determining target video clips to be played, and judging whether target video clip objects corresponding to the target video clips are stored in a preset cache queue or not And if so, calling and playing the video content corresponding to the video playing time point in the target video clip object from the preset cache queue. In the invention, the target video clip object is directly played, and each video clip is not required to be decoded into a frame image for rendering in a software decoding mode, so that the resources occupied by video playing can be reduced, the waiting time of video playing is shortened, and the user experience is improved.
It should be noted that, in the working process of each module in this embodiment, please refer to the corresponding description in the above embodiment, and no further description is given here.
On the basis of the above embodiments, another embodiment of the present invention provides a video playing device, such as the above terminal configured with an online video editing tool. The terminal comprises a controller for executing the video playing method, and the specific implementation process of the controller is described with reference to the corresponding description.
In this embodiment, when playing a target video clip, determining a target video clip to be played, and determining whether a target video clip object corresponding to the target video clip is stored in a preset buffer queue And if so, calling and playing the video content corresponding to the video playing time point in the target video clip object from the preset cache queue. In the invention, the target video clip object is directly played, and each video clip is not required to be decoded into a frame image for rendering in a software decoding mode, so that the resources occupied by video playing can be reduced, the waiting time of video playing is shortened, and the user experience is improved.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A video playing method, comprising:
under the condition of receiving a video playing instruction, acquiring a video playing time point in the video playing instruction; the video playing time point is a time point on a main time axis corresponding to the video queue; the video queue comprises a plurality of video clips which need to be spliced and played; the main time axis consists of time axes corresponding to the video clips;
determining a target video clip corresponding to the video playing time point from the plurality of video clips, and judging whether a target video clip object corresponding to the target video clip is stored in a preset cache queue or not; the target video clip object is a video player instance created for the target video clip;
and if so, calling and playing the video content corresponding to the video playing time point in the target video clip object from the preset cache queue.
2. The video playing method according to claim 1, wherein determining a target video clip corresponding to the video playing time point from the plurality of video clips includes:
acquiring the arrangement sequence and the video duration of each video clip; the arrangement sequence is obtained based on user setting;
And calculating the position of the video playing time point in the video duration of each video segment based on the video duration of each video segment, and searching the target video segment corresponding to the position according to the sequence of each video segment.
3. The video playing method according to claim 1, wherein the video content corresponding to the video playing time point in the target video clip object is called and played from the preset buffer queue, and the method comprises:
determining a target video segment object corresponding to the identification information from the preset cache queue based on the identification information of the target video segment object; the identification information is a parameter for identifying the target video clip object;
determining the video fragments corresponding to the video playing time points from a plurality of video fragments forming the target video fragment object;
playing the video content corresponding to the video playing time point in the determined video fragments; and when the video content corresponding to the video playing time point is played, calling a hardware decoding function of the browser to perform decoding operation.
4. The video playing method according to claim 1, further comprising:
If the fact that the target video segment object corresponding to the target video segment is not stored in the preset cache queue is judged, creating a video player instance for the target video segment by using an API provided by a video play library, and obtaining the target video segment object;
and playing the video content corresponding to the video playing time point in the target video clip object, and storing the target video clip object into the preset cache queue.
5. The video playing method according to claim 1, further comprising:
carrying out instantiation operation on video clips adjacent to the target video clip to obtain an associated video clip object;
and storing the associated video segment object into the preset cache queue, and calling and playing the associated video segment object corresponding to the adjacent video segment from the preset cache queue when the adjacent video segment is determined to be required to be played.
6. The video playing method according to claim 1, wherein in the process of calling and playing the video content corresponding to the video playing time point from the preset buffer queue, the method further comprises:
Judging whether all video clips included in the target video clip object are loaded through a network request;
if the loading is completed, carrying out preloading operation on the appointed video clip object; the specified video clip object is a video clip object corresponding to a next video clip located after the target video clip.
7. The video playing method according to claim 1, further comprising:
judging the total number of all video clip objects stored in the preset cache queue;
and deleting the video fragment objects stored in the preset cache queue first under the condition that the total number is larger than the preset number.
8. A video playback device, comprising:
the time point acquisition module is used for acquiring a video playing time point in the video playing instruction under the condition of receiving the video playing instruction; the video playing time point is a time point on a main time axis corresponding to the video queue; the video queue comprises a plurality of video clips which need to be spliced and played; the main time axis consists of time axes corresponding to the video clips;
the judging module is used for determining a target video clip corresponding to the video playing time point from the plurality of video clips and judging whether a target video clip object corresponding to the target video clip is stored in a preset cache queue or not; the target video clip object is a video player instance created for the target video clip;
And the video playing module is used for calling and playing the video content corresponding to the video playing time point in the target video clip object from the preset cache queue if the video playing module exists.
9. The video playback device of claim 8, wherein the determination module comprises:
the data acquisition sub-module is used for acquiring the arrangement sequence and the video duration of each video clip; the arrangement sequence is obtained based on user setting;
the segment determining sub-module is used for calculating the positions of the video playing time points in the video duration of the video segments based on the video duration of each video segment, and searching target video segments corresponding to the positions according to the sequence of each video segment.
10. A video playback device comprising a controller for performing the video playback method as claimed in any one of claims 1 to 7.
CN202311232831.7A 2023-09-22 2023-09-22 Video playing method, device and equipment Pending CN117241088A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311232831.7A CN117241088A (en) 2023-09-22 2023-09-22 Video playing method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311232831.7A CN117241088A (en) 2023-09-22 2023-09-22 Video playing method, device and equipment

Publications (1)

Publication Number Publication Date
CN117241088A true CN117241088A (en) 2023-12-15

Family

ID=89090759

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311232831.7A Pending CN117241088A (en) 2023-09-22 2023-09-22 Video playing method, device and equipment

Country Status (1)

Country Link
CN (1) CN117241088A (en)

Similar Documents

Publication Publication Date Title
US10225613B2 (en) Method and apparatus for video playing processing and television
US20210160577A1 (en) Method for playing video, electronic device and storage medium
WO2021159770A1 (en) Video playback method, device, apparatus, and storage medium
CN106534952B (en) Source switching back-film source continuous playing method and smart television
US7733962B2 (en) Reconstructed frame caching
US11722555B2 (en) Application control method and apparatus, electronic device, and storage medium
CN113424553B (en) Method and system for playback of media items
CN111447455A (en) Live video stream playback processing method and device and computing equipment
US20230079785A1 (en) Video clipping method and apparatus, computer device, and storage medium
CN107333163A (en) A kind of method for processing video frequency and device, a kind of terminal and storage medium
CN106470353B (en) Multimedia data processing method and device and electronic equipment
CN110858910B (en) Live video display method, device, equipment and storage medium
CN112601127A (en) Video display method and device, electronic equipment and computer readable storage medium
CN112929728A (en) Video rendering method, device and system, electronic equipment and storage medium
EP3125541A1 (en) Data acquisition and interaction method, set top box, server and multimedia system
CN112770168A (en) Video playing method and related device and equipment
CN111385660B (en) Video on demand method, device, equipment and storage medium
CN114268830A (en) Cloud director synchronization method, device, equipment and storage medium
CN114040245A (en) Video playing method and device, computer storage medium and electronic equipment
CN105025343A (en) Caching method and device of TS video
CN117241088A (en) Video playing method, device and equipment
US20220191558A1 (en) Method and system for playing back streaming content using local streaming server
CN114666627A (en) Method and device for preloading streaming media video, electronic equipment and storage medium
CN110691256B (en) Video associated information processing method and device, server and storage medium
CN112423099A (en) Video loading method and device and electronic equipment

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