Video file playing method and system and storage medium

By splicing multiple initial text files of the video to be played into recombinant files and playing them using preset positioning jump method, the fluency problem during video switching during streaming media playback is solved, and fast switching and efficient decoding are achieved, improving the efficiency of improving The user's movie viewing experience.

CN119211638APending Publication Date: 2024-12-27SHENZHEN COOCAA NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411081205.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-07
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

The existing streaming media playback technology needs to exit playback and initialize hardware decoding when switching videos, resulting in low playback fluency and affecting the user's viewing experience.

Method used

By obtaining multiple initial text files of the video to be played, stitching to form a recombinant file, and playing the video clips corresponding to each initial text file in the recombinant file in sequence based on the preset positioning jump method, avoiding re-exiting playback and initializing hardware decoding operations .

Benefits of technology

It improves video switching speed and playback fluency, provides a good viewing experience, and reduces the buffering time and playback delay during video switching.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119211638A_ABST
    Figure CN119211638A_ABST
Patent Text Reader

Abstract

The invention discloses a video file playing method and system and a storage medium. The method comprises the following steps: acquiring a plurality of initial text files of a to-be-played video; splicing the plurality of initial text files to obtain a recombined file; and playing the video clips corresponding to the initial text files in the recombined file in sequence based on a preset positioning jump mode. Through the method, the video switching speed and the playing fluency can be improved, so that good film watching experience is provided for a user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of video processing technology, and in particular to a method, system and storage medium for playing video files. Background Art

[0002] With the development of network technology, audio and video communication technology has gradually evolved from early analog broadcast transmission to current streaming media technology. Since streaming media technology has many advantages such as instant playback and low cost, it is widely used in video on demand, live broadcast, online education and other fields.

[0003] However, current streaming media players mostly use preloading technology. During video playback, each time a video is switched, it is necessary to exit playback and initialize hardware decoding, resulting in low playback fluency and affecting the user's viewing experience. Summary of the invention

[0004] The present application provides a method, system and storage medium for playing video files, which can improve the speed of video switching and the smoothness of playback, thereby providing users with a good viewing experience.

[0005] In a first aspect, the present application provides a method for playing a video file, the method comprising:

[0006] Obtain multiple initial text files of the videos to be played;

[0007] Splice multiple initial text files to obtain a reorganized file;

[0008] The video clips corresponding to each initial text file in the reorganized file are played in sequence based on a preset positioning jump method.

[0009] A further technical solution is to play the video clips corresponding to each initial text file in the reorganized file in sequence based on a preset positioning jump method, including:

[0010] Marking each initial text file in the reorganized file to obtain a play order identifier corresponding to each initial text file;

[0011] When playing the reorganized file, according to the play sequence mark, a preset positioning jump method is used to sequentially locate the position of the next initial text file to be played in the reorganized file for switching to play.

[0012] A further technical solution is that after splicing multiple initial text files to obtain a reorganized file, the method further includes:

[0013] Obtaining the original link to the video clip included in each initial text file in the reassembled file;

[0014] Based on the original link, the initial video segments of the preset initial text files are cached to the local address.

[0015] A further technical solution is that after caching the initial video clips of the preset text files to the local address, the method further includes:

[0016] Change the original link of the initial text file that was cached in the reorganized file to a local link.

[0017] A further technical solution is that when playing the reorganized file, the method further includes:

[0018] Update reorganization files in real time.

[0019] A further technical solution is to update the reorganization file in real time, including:

[0020] Obtaining the extended text file of the video to be played in real time;

[0021] Adds the augmented text file to the list of reorganized files.

[0022] Its further technical solution is to update the reorganization file in real time, and also includes:

[0023] Delete the played video segments in the reorganized file.

[0024] A further technical solution is that before sequentially playing the video clips corresponding to the initial text files in the reorganized file based on a preset positioning jump mode, the method further includes:

[0025] Determine the video segment to be played at the current moment and the video segment to be played at the next moment in the reorganized file;

[0026] The video segment to be played at the current moment and the video segment to be played at the next moment are decoded in parallel.

[0027] In a second aspect, the present application provides a video file playback system, the video file playback system includes a memory and a processor, the memory is used to store program data, and the processor is used to execute the program data to implement the steps of any of the above methods.

[0028] In a third aspect, the present application provides a computer-readable storage medium, which is used to store a computer program. When the computer program is executed by a processor, it is used to implement the steps of any of the above methods.

[0029] The beneficial effect of the present application is as follows: different from the prior art, the present application obtains a recombined file by splicing multiple initial text files of the video to be played. Since the recombined files obtained after splicing have the same uniform resource locator, the recombined files obtained after splicing can use a preset positioning jump method to play the video clips corresponding to each initial text file in the recombined file in sequence, that is, the video switching in each initial text file during the playback process can be converted into the positioning switching playback of different video clips in the recombined file, without the need to re-exit the playback and initialize hardware decoding and other operations, thereby improving the speed of video switching and the smoothness of playback, thereby providing users with a good viewing experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:

[0031] Figure 1 It is a flowchart of a first embodiment of a method for playing a video file provided by the present application;

[0032] Figure 2 It is a flowchart of a second embodiment of the method for playing a video file provided by the present application;

[0033] Figure 3 It is a flowchart of a third embodiment of the method for playing a video file provided by the present application;

[0034] Figure 4 It is a structural schematic diagram of an embodiment of a computer-readable storage medium provided by the present application. DETAILED DESCRIPTION

[0035] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It will be understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for ease of description, only some but not all structures related to the present application are shown in the drawings. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0036] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0037] With the development of network technology, audio and video communication technology has gradually evolved from early analog broadcast transmission to current streaming media technology. Since streaming media technology has many advantages such as instant playback and low cost, it is widely used in video on demand, live broadcast, online education and other fields.

[0038] However, current streaming media players mostly use preloading technology. During video playback, each time a video is switched, it is necessary to exit playback and initialize hardware decoding, resulting in low playback fluency and affecting the user's viewing experience.

[0039] Therefore, in order to solve the technical problem in the prior art that each time a video is switched, operations such as re-exiting playback and initializing hardware decoding are required, resulting in low playback fluency and affecting the user's viewing experience, the present application provides a method for playing a video file. Please refer to the following embodiments for details.

[0040] See also Figure 1 , Figure 1 1 is a flow chart of a first embodiment of a method for playing a video file provided by the present application. The method comprises:

[0041] Step 110: Obtain multiple initial text files of the videos to be played.

[0042] The initial text file may be a list of audio files, used to list video files, such as an m3u8 file, or may be other types of playlist files.

[0043] The initial text file can be used to describe the playlist of the video stream, which contains the URL of the video segment and other related information. The player can organize and play the video content according to the information in these files.

[0044] Step 120: Connect multiple initial text files to obtain a reorganized file.

[0045] Herein, a new file may be created, and then a plurality of initial text files may be concatenated and merged into the new file to obtain a reorganized file.

[0046] Step 130: Play the video clips corresponding to the initial text files in the reorganized file in sequence based on a preset positioning jump method.

[0047] The preset positioning jump mode may be a video seek mode or the like.

[0048] Each initial text file in the reorganized file has corresponding time information. Therefore, in some embodiments, the playback order of each video clip in the list of the reorganized file can be determined first. When a certain video clip ends, a preset positioning jump method can be used to automatically jump to the next video clip according to the timestamp of the video clip.

[0049] In other implementations, the player may also jump to a specific video segment based on the user's selection.

[0050] A recombined file is obtained by splicing multiple initial text files of the video to be played. Since the recombined files after splicing have the same uniform resource locator, the recombined file after splicing can use a preset positioning jump method to play the video clips corresponding to each initial text file in the recombined file in sequence. That is, the video switching in each initial text file during the playback process can be converted into the positioning switching playback of different video clips in the recombined file, without the need to re-exit the playback and initialize hardware decoding and other operations, thereby improving the speed of video switching and the smoothness of playback, thereby providing users with a good viewing experience.

[0051] See also Figure 2 , Figure 2 1 is a flow chart of a second embodiment of a method for playing a video file provided by the present application. The method comprises:

[0052] Step 210: Obtain multiple initial text files of the videos to be played.

[0053] Step 220: concatenate multiple initial text files to obtain a reorganized file.

[0054] Step 230: Mark each initial text file in the reorganized file to obtain a play order identifier corresponding to each initial text file.

[0055] Wherein, step 230 may specifically adopt the following process:

[0056] 1) Extract the time information corresponding to each initial text file from the reorganized file.

[0057] Generally speaking, each initial text file in the reorganized file has corresponding time information. In some implementations, the time information can be included in the #EXT I NF tag, such as #EXT I NF:10.000.

[0058] 2) Add a special mark to each initial text file to distinguish different initial text files.

[0059] The special identifier may be a specific string or symbol, such as #SPECIAL-START and #SPECIAL-END. The special identifier may be inserted at the beginning and end of each initial text file to clearly identify the scope of each initial text file.

[0060] Step 240: When playing the reorganized file, according to the play order identifier, a preset positioning jump method is used to sequentially locate the position of the next initial text file to be played in the reorganized file for switching to play.

[0061] When playing the reassembled file, the player first identifies the special identifier in the reassembled file to determine the start and end position of each video segment. For example, each video segment can be located by looking for #SPECIAL-START and #SPECIAL-END.

[0062] By marking each initial text file with a special identifier in advance, when playing the reorganized file, the player can quickly locate and jump to the position of the next initial text file to be played in the reorganized file according to the playback order identifier, thereby improving the speed of video switching and the smoothness of playback, thereby providing users with a good viewing experience.

[0063] See also Figure 3 , Figure 3 1 is a flow chart of a third embodiment of a method for playing a video file provided by the present application. The method comprises:

[0064] Step 310: Obtain multiple initial text files of the videos to be played.

[0065] Step 320: concatenate multiple initial text files to obtain a reorganized file.

[0066] Among them, step 310 and step 320 have the same or similar technical solutions as the above embodiment, and are not described in detail here.

[0067] Step 330: Obtain the original link pointing to the video clip included in each initial text file in the reorganized file.

[0068] Step 340: Based on the original link, cache the initial video segments of the preset initial text files to a local address.

[0069] The preset ones may be several of the reorganized file list, such as several files with the leading timestamps; or the preset ones may be all the initial text files in the reorganized file list.

[0070] By caching the initial video clips of the preset initial text files to the local address in advance, when the player switches the video, it can start playing quickly, thereby improving the speed of video switching and the smoothness of playback, thereby providing users with a good viewing experience.

[0071] In some implementations, after the initial video segments of the preset text files are cached to the local address, the original link of the cached initial text file in the reorganized file may be changed to a local link.

[0072] By changing the original link of the cached initial text file in the reorganized file to a local link, the player can directly obtain the cached initial text file from the local link, avoiding the player from reloading the video from the original link, thereby more effectively utilizing bandwidth and server resources and reducing unnecessary data loading, thereby improving the speed of video switching and the smoothness of playback.

[0073] Step 350: Play the video clips corresponding to the local addresses cached in the reorganized file in sequence based on a preset positioning jump method.

[0074] In some implementations, while playing the reassembled file, the player may update the reassembled file in real time.

[0075] For example, an extended text file of the video to be played may be obtained in real time; and the extended text file may be added to the list of reorganized files.

[0076] The extended text file can be understood as an initial text file added during the video playback process, such as a newly added m3u8 file.

[0077] Exemplarily, you can first obtain 10 initial text files of the video to be played, such as 10 m3u8 files, and then splice these 10 m3u8 files to obtain a reorganized file. During the video playback process, you can add 2 new m3u8 files, that is, 2 extended text files, and add the 2 added new m3u8 files to the list of reorganized files. At this time, the list of reorganized files is changed from the original 10 m3u8 files (that is, 10 initial text files) to 12 m3u8 files (that is, 10 initial text files plus 2 extended text files).

[0078] By acquiring the extended text file of the video to be played in real time, the list of the reorganized files can be dynamically expanded and changed, and then the reorganized files can be updated in real time by the player to keep the latest play list.

[0079] In other implementations, the played text files in the list of reorganized files may also be deleted.

[0080] In addition, in order to release the memory and resources occupied by the played video in time and avoid memory leakage and resource waste, the played video clips in the reorganized file can also be deleted.

[0081] In some implementations, before sequentially playing the video clips corresponding to the initial text files in the reorganized file based on a preset positioning jump method, the method further includes the following steps:

[0082] Step 410: Determine the video segment to be played at the current moment and the video segment to be played at the next moment in the reorganized file.

[0083] Step 420: Parallel decoding of the video segment to be played at the current moment and the video segment to be played at the next moment.

[0084] By processing the decoding tasks of the current video and the next video in parallel, resource utilization can be improved, and the overall decoding time can be reduced, thereby improving decoding efficiency.

[0085] In addition, since the video clip to be played at the next moment is decoded in advance, the buffering time and playback delay of the player when switching video clips can be reduced, thereby improving the speed of video switching and the smoothness of playback, thereby providing users with a good viewing experience.

[0086] In other implementations, multi-threading and multi-hardware parallel processing may be used to cache videos and update playlists in parallel during hardware decoding.

[0087] For example, decoding is implemented through hardware, and the background thread is used to process the pre-loading of the video, such as downloading the video data that has not been played in the reorganized file first, etc., thereby avoiding blocking the main thread and improving the response speed of the video playback interface.

[0088] In some implementations, the user's playback behavior can be fed back to the background in real time, so that the background will update the playlist according to the user's preference for the video, thereby improving the user's viewing efficiency.

[0089] For example, during video playback, user preferences can be understood by counting information such as playback length and playback times, and the user preferences can be fed back to the background. At the same time, the subsequent unplayed text files in the reorganized file can be cleaned up in time to update the play list of the reorganized file.

[0090] In some implementations, adaptive bitrate streaming media technology may be used, that is, the video bitrate is dynamically adjusted according to the user's network conditions to achieve optimal image effects while ensuring smooth playback, thereby providing users with the best viewing experience.

[0091] In some implementations, the user interaction interface can also be optimized, such as simplifying the user interface for video switching and reducing the refresh of the user interface, or adding motion effects to the user interface according to actual needs to enhance the user's sensory experience.

[0092] Since the mainstream transmission standard for streaming media is the HLS protocol, and because the HLS protocol has the characteristics of HTTP-based transmission, adaptive bit rate support, wide device compatibility and low latency, the HLS protocol occupies an important position in the field of video on demand and live broadcast, and is also one of the most important transmission standards for domestic TV network content providers.

[0093] The above-mentioned embodiments provided in the present application can realize fast switching of streaming media playback based on the HLS protocol. When the user is watching a movie, the player can quickly switch to the next video according to the user's needs without waiting for a long time for buffering and loading, thereby realizing seamless screen switching, helping to reduce the occurrence of black screens or screen flickering, and thus improving the user's viewing experience.

[0094] In addition, the video file playback method provided by this application can be applied to short video playback, drama simulcast, automatic clarity switching and other scenarios.

[0095] Specifically, it can be used in consumer terminals such as smart screens, mobile phones, TOPs, set-top boxes, smart projectors, advertising machines, PADs, etc.

[0096] Corresponding to the video file playback method of the above embodiment, the present application also provides a video file playback device, which includes an acquisition unit, a splicing unit and a playback unit.

[0097] The acquisition unit is used to acquire multiple initial text files of the video to be played;

[0098] The splicing unit is used to splice multiple initial text files to obtain a recombined file;

[0099] The playing unit is used to play the video clips corresponding to each initial text file in the reorganized file in sequence based on a preset positioning jump method.

[0100] It can be understood that the video file playback device may further include other units to implement the technical solution of any embodiment of the present application.

[0101] The present application also provides a video file playback system, the video file playback system includes a memory and a processor, wherein the memory stores a computer program; the processor is used to implement the following method steps when executing the computer program:

[0102] Obtain multiple initial text files of the videos to be played;

[0103] Splice multiple initial text files to obtain a reorganized file;

[0104] The video clips corresponding to each initial text file in the reorganized file are played in sequence based on a preset positioning jump method.

[0105] It can be understood that when the processor is used to execute a computer program, it is also used to implement the technical solution of any embodiment in the present application.

[0106] See also Figure 4 , Figure 4 The structure of an embodiment of a computer-readable storage medium provided by the present application is shown in FIG. 7 . The computer-readable storage medium 70 is used to store a computer program 71. When the computer program 71 is executed by a processor, it is used to implement the following method steps:

[0107] Obtain multiple initial text files of the videos to be played;

[0108] Splice multiple initial text files to obtain a reorganized file;

[0109] The video clips corresponding to each initial text file in the reorganized file are played in sequence based on a preset positioning jump method.

[0110] It can be understood that when the computer program 71 is executed by the processor, it is also used to implement the technical solution of any embodiment of the present application.

[0111] In the several embodiments provided in this application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only illustrative, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as two units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0112] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on two network units. Some or all of the units may be selected according to actual needs to achieve the purpose of this embodiment.

[0113] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0114] If the integrated units in the above other embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-On lyMemory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.

[0115] The above are only implementation methods of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A method for playing a video file, characterized in that: The method comprises: Obtain multiple initial text files of the videos to be played; splicing the multiple initial text files to obtain a reorganized file; The video clips corresponding to each of the initial text files in the reorganized file are played in sequence based on a preset positioning jump method.

2. The method for playing a video file according to claim 1, characterized in that: The method of sequentially playing the video clips corresponding to the initial text files in the reorganized file based on the preset positioning jump method includes: Marking each of the initial text files in the reorganized file to obtain a playback sequence identifier corresponding to each of the initial text files; When playing the reorganized file, according to the play sequence identifier, the preset positioning jump mode is used to sequentially locate the position of the next initial text file to be played in the reorganized file for switching to play.

3. The method for playing a video file according to claim 1, characterized in that: After the plurality of the initial text files are spliced ​​together to obtain a reorganized file, the method further comprises: Obtaining the original link pointing to the video clip included in each of the initial text files in the reorganized file; Based on the original link, the initial video segments of the preset initial text files are cached to a local address.

4. The method for playing a video file according to claim 3, characterized in that: After caching the preset initial video clips of the text file to the local address, the method further includes: The original link of the initial text file that has been cached in the reorganized file is changed to a local link.

5. The method for playing a video file according to claim 2, characterized in that: When playing the reorganized file, the method further includes: The reorganization file is updated in real time.

6. The method for playing a video file according to claim 5, characterized in that: The real-time updating of the reorganization file comprises: Acquire the extended text file of the video to be played in real time; The expanded text file is added to the list of reorganized files.

7. The method for playing a video file according to claim 5, characterized in that: The real-time updating of the reorganization file further includes: The played video segments in the reorganized file are deleted.

8. The method for playing a video file according to claim 1, characterized in that: Before sequentially playing the video clips corresponding to the initial text files in the reorganized file based on the preset positioning jump mode, the method further includes: Determine the video segment to be played at the current moment and the video segment to be played at the next moment in the reorganized file; The video segment to be played at the current moment and the video segment to be played at the next moment are decoded in parallel.

9. A video file playback system, characterized in that: The video file playback system comprises a memory and a processor, wherein the memory is used to store program data, and the processor is used to execute the program data to implement the video file playback method according to any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program data, and when the program data is executed by a processor, it is used to implement the video file playback method according to any one of claims 1 to 8.