Method for playing back multimedia file, readable storage medium, and device

When playing the multimedia file loop, the device continues to read and process the first frame of data after reading the last frame of data, and outputs two frames of data in adjacent output cycles, solving the problem of discontinuity in loop playback. , realizes seamless loop playback and improves user experience.

WO2025007785A1PCT designated stage expired Publication Date: 2025-01-09HUAWEI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/101650
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-07-04
Filing Date
2024-06-26
Publication Date
2025-01-09

AI Technical Summary

Technical Problem

When playing multimedia files loop, the device needs to read, parse, decode and render each frame of data in turn, resulting in no new images to be displayed during the display screen after the last frame of image is displayed until the first frame of image is displayed, resulting in no new images to be displayed on the display screen, resulting in no picture. Continuous, affecting the user experience.

Method used

When playing the multimedia file loop, the device continues to read the first frame of data after reading the last frame of data, and processes and outputs two frames of data in adjacent output cycles to avoid waiting for the last frame of data to complete before starting Read the first frame of data, thereby realizing continuous reading and output of data.

Benefits of technology

Through this method, the lag and white or black screens during loop playback of multimedia files are avoided, and seamless loop playback of multimedia files is achieved, improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024101650_09012025_PF_FP_ABST
    Figure CN2024101650_09012025_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of multimedia, and discloses a method for playing back a multimedia file, a readable storage medium, and a device. In the method, during cyclic playback of a multimedia file, a device, after reading a last frame of data of the multimedia file, continues to read a first frame of data of the multimedia file. Then, before a first output cycle corresponding to the last frame of data of the multimedia file ends, the device processes the first frame of data of the multimedia file, and obtains first output data corresponding to the first frame of data. Therefore, the device may, in the next output cycle after the first output cycle, output the first output data corresponding to the first frame of data of the multimedia file. The last frame of data and the first frame of data of the multimedia file are read continuously, and output data corresponding to the last frame of data and output data corresponding to the first frame of data are outputted continuously. Therefore, seamless cyclic playback of a multimedia file can be implemented, so that the user experience can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Multimedia file playing method, readable storage medium and device

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on July 4, 2023, with application number 202310816753.9 and application name “Multimedia file playback method, readable storage medium and device”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of multimedia technology, and in particular to a multimedia file playing method, a readable storage medium and a device. Background Art

[0003] When a device plays a multimedia file, a frame of data generally needs to undergo a series of processes, including reading, parsing, decoding, and rendering, before it can be output. For example, for a video file, the device first reads a frame of data; then parses the frame into video data and audio data; then decodes and renders the video data and audio data, respectively, to produce image output data and sound output data that can be output to an output device; finally, after synchronizing the image output data and sound output data, the image output data is output to a display device, and the sound output data is output to a playback device. In other words, for any frame of data, after the device reads it, it must undergo the aforementioned processing before it can be output to the corresponding output device, which takes time.

[0004] Typically, when a device loops multimedia files, such as a video file, it typically restarts after displaying the last frame. Because the first frame of a video file undergoes the aforementioned processing before being output to the device's display, the device's display has no new images to display between the last frame and the first. Consequently, the display may display inconsistent images while the device loops the video file, impacting the user experience.

[0005] Summary of the Invention

[0006] In view of this, the present application provides a multimedia file playback method, a readable storage medium and a device, which can achieve seamless loop playback of multimedia files.

[0007] A first aspect provides a multimedia file playback method, which includes: when a device plays a multimedia file in a loop, the device reads the Kth frame data of the multimedia file in the Kth output cycle, processes the read Kth frame data in the Kth output cycle to the K+Q-1th output cycle, and outputs output data corresponding to the Kth frame data in the K+Qth output cycle, wherein Q is an integer greater than 0, K is an integer greater than 0 and less than N, and N is the number of frames of data included in the multimedia file; the device reads the Nth frame data of the multimedia file in the Nth output cycle, and outputs output data corresponding to the NQth frame data of the multimedia file; the device reads the 1st frame data of the multimedia file in the N+1th output cycle, and outputs output data corresponding to the N-Q+1th frame data of the multimedia file; the device reads the Qth frame data of the multimedia file in the N+Qth output cycle, and outputs output data corresponding to the Nth frame data of the multimedia file; the device reads the Q+1th frame data of the multimedia file in the N+Q+1th output cycle, and outputs output data corresponding to the 1st frame data of the multimedia file.

[0008] In this method, when the device plays a multimedia file in a loop, it reads the last frame data and the first frame data of the multimedia file in adjacent cycles (the Nth output cycle and the N+1th output cycle), and outputs the output data corresponding to the last frame data of the multimedia file and the output data corresponding to the first frame data in adjacent cycles (the N+Qth output cycle and the N+Q+1th output cycle). Based on the above method, when the device plays a multimedia file in a loop, the output data corresponding to the last frame data and the output data corresponding to the first frame data are output continuously in two adjacent output cycles. In this way, freezes, white screens or black screens are avoided when playing multimedia files in a loop, and seamless loop playback of multimedia files is achieved.

[0009] In a possible implementation of the above-mentioned first aspect, the above-mentioned multimedia file is a video file, and the output data corresponding to the first frame data includes first image output data and first audio output data; and the device reads the Q+1th frame data of the multimedia file in the N+Q+1th output cycle, and outputs the output data corresponding to the first frame data of the multimedia file, including: after the device outputs the output data corresponding to the Nth frame data of the multimedia file, the synchronization reference time is updated, and the synchronization reference time is used to indicate the starting playback time of the multimedia file; the device synchronizes the first image data and the first audio data based on the synchronization reference time, and outputs the first image output data and the first audio output data in the N+Q+1th output cycle.

[0010] That is, after the device outputs the output data corresponding to the last frame data (Nth frame data) of the multimedia file, it can update the synchronization reference time. In this way, the device can synchronize the first image output data and the first audio output data corresponding to the first frame data based on the updated synchronization reference time, thereby avoiding the first image output data and the first audio output data from being out of synchronization.

[0011] In a possible implementation of the first aspect above, the above-mentioned device reads the Nth frame data of the multimedia file in the Nth output cycle, including: after reading the Nth frame data of the multimedia file, the device does not report the reading end message of the multimedia file to the application that plays the multimedia file.

[0012] It should be understood that the multimedia file read completion message is used to instruct the device to stop processing subsequent data after processing the last frame of multimedia file data and end playback of the multimedia file. After reading the Nth frame of multimedia file data, the device does not report the multimedia file read completion message to the application that plays the multimedia file. This allows the device to continue processing subsequent data (the first frame of multimedia file data), achieving seamless loop playback of the multimedia file.

[0013] In a possible implementation of the first aspect above, the method further includes: the device outputs the output data corresponding to the second frame data of the multimedia file to the output data corresponding to the Nth frame data of the multimedia file in sequence from the N+Q+2th output cycle to the N+Q+Nth output cycle.

[0014] In a possible implementation of the first aspect above, the method further includes: the device processes the first frame data of the multimedia file from the N+1th output cycle to the N+Qth output cycle to obtain output data corresponding to the first frame data.

[0015] In a possible implementation of the first aspect above, the above-mentioned device processes the first frame data of the multimedia file from the N+1th output cycle to the N+Qth output cycle, at least including: the device reads the first frame data from the N+1th output cycle to the N+Qth output cycle, parses, decodes and renders the first frame data.

[0016] In a possible implementation of the first aspect above, the above-mentioned device plays a multimedia file through a first application; and the device reads the Nth frame data of the multimedia file in the Nth output cycle, including: the first application reads the Nth frame data of the multimedia file in the Nth output cycle.

[0017] It should be understood that in some implementations, the output data corresponding to each frame of data of the multimedia file may also be output by the first application.

[0018] In a possible implementation of the first aspect, the device reads the first frame data of the multimedia file in the N+1th output cycle, including: the first application reads the first frame data of the multimedia file in the N+1th output cycle.

[0019] That is to say, the instructions of the multimedia file playing method provided in this application can be embedded in the first application, so that the first application can play the multimedia file through the method provided in this application.

[0020] In a possible implementation of the first aspect above, the operating system of the above-mentioned device includes a framework layer, and the framework layer includes a first module; and the device reads the Nth frame data of the multimedia file in the Nth output cycle, including: the first module reads the Nth frame data of the multimedia file in the Nth output cycle.

[0021] That is to say, the instructions of the multimedia file playing method provided in this application can be embedded in the first module (such as the reading and parsing module below), so that the application program that plays multimedia files on the device can play multimedia files through the method provided in this application through the first module.

[0022] In a possible implementation of the first aspect, the device reads the first frame data of the multimedia file in the N+1th output cycle, including: a first module reads the first frame data of the multimedia file in the N+1th output cycle.

[0023] A second aspect provides a readable storage medium, which includes instructions. When the instructions are executed by a device, the device implements the multimedia file playback method provided by the first aspect and any possible implementation of the first aspect.

[0024] The third aspect provides a device, which includes: a memory for storing instructions; a processor for executing instructions to enable the device to implement the multimedia file playback method provided by the first aspect and any possible implementation of the first aspect.

[0025] A fourth aspect provides a program product, which, when running on a device, enables the device to implement the multimedia file playback method provided in the first aspect and any possible implementation of the first aspect.

[0026] The fifth aspect provides a chip or chip system, including a processing module and a communication interface, wherein the processing module is used to execute the multimedia file playback method provided in the first aspect and any possible implementation of the first aspect.

[0027] It should be understood that the beneficial effects of the second to fifth aspects mentioned above can be referred to the description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] FIG1 shows a schematic diagram of a scenario in which a smart TV 10 plays a video in a loop according to some embodiments of the present application;

[0029] FIG2A shows a timing diagram of a smart TV 10 playing a video in a loop according to some embodiments of the present application;

[0030] FIG2B shows a schematic diagram of a display interface of a smart TV 10 when looping video playback according to some embodiments of the present application;

[0031] FIG3A shows another timing diagram of a smart TV 10 playing a video in a loop according to some embodiments of the present application;

[0032] FIG3B shows a timing diagram of another smart TV 10 playing a video in a loop according to some embodiments of the present application;

[0033] FIG4 shows a schematic diagram of a software architecture of a smart TV 10 according to some embodiments of the present application;

[0034] FIG5 shows a schematic diagram of the software architecture of another smart TV 10 according to some embodiments of the present application;

[0035] FIG6 shows a schematic diagram of a process of playing a video on a smart TV 10 according to some embodiments of the present application;

[0036] FIG7 shows a schematic diagram of a process of looping video playback on a smart TV 10 according to some embodiments of the present application;

[0037] FIG8 is a schematic diagram showing a flow chart of a method for playing multimedia files according to some embodiments of the present application;

[0038] FIG9A is a schematic diagram showing a user triggering a multimedia loop playback instruction on a smart TV 10 according to some embodiments of the present application;

[0039] FIG9B shows a schematic diagram of a user triggering a multimedia instruction to play in a loop on a mobile phone 20 according to some embodiments of the present application;

[0040] FIG10 shows a schematic structural diagram of a smart TV 10 according to some embodiments of the present application. DETAILED DESCRIPTION

[0041] Illustrative embodiments of the present application include, but are not limited to, methods, readable storage media, and devices for playing multimedia files.

[0042] It should be understood that the multimedia file playback method provided in the embodiments of the present application can be applied to any device that can play multimedia files, including but not limited to desktop computers, laptops, mobile phones, tablet computers, wearable devices, mobile email devices, portable game consoles, portable music players, AR devices, VR devices, head-mounted display devices, reader devices, smart home devices (such as smart TVs, large screens, projectors, etc.), etc., and the embodiments of the present application are not limited. For ease of description, the following introduction takes the smart TV 10 as an example.

[0043] It should be understood that multimedia files may include but are not limited to video files, audio files, etc., which are not limited here. For ease of description, the following is an introduction using video files as an example.

[0044] It should be understood that the multimedia files played by the device in the embodiment of the present application may be multimedia files stored locally on the device, or may be multimedia files obtained by the device from other devices in real time, which is not limited here.

[0045] The technical solution of this application is introduced below with reference to the accompanying drawings.

[0046] FIG1 is a schematic diagram showing a scenario in which a smart TV 10 plays a video in a loop according to some embodiments of the present application.

[0047] As shown in FIG1 , the smart TV 10 can switch to "picture frame mode" in response to a user operation (or automatically switch to "picture frame mode" when the smart TV determines that a preset condition is met), and the smart TV 10 plays the campfire video in a full-screen loop. In some implementations, "picture frame mode" refers to a function in which the smart TV 10 plays a preset video file or a user-selected video file in a full-screen loop through a video playback application.

[0048] It should be understood that the scenario shown in Figure 1 is only an example. The technical solution of the present application is applicable to any scenario of looping multimedia files, such as scenarios in which video applications, audio playback applications, social applications or other applications play multimedia files in a loop, etc., and is not limited here.

[0049] When the smart TV 10 plays a video in a loop, it typically restarts after outputting the last frame of the video file (e.g., after displaying the image corresponding to the last frame of the video file (hereinafter referred to as the last frame image)). However, the first frame of the video file must be read, parsed, decoded, rendered, and processed before the image corresponding to the first frame of the data (hereinafter referred to as the first frame image) is obtained and output to the display screen of the smart TV 10. Therefore, between the output of the last frame and the display of the first frame, the device's display screen has no new images to display, resulting in a discontinuous image displayed by the smart TV 10.

[0050] For example, assuming the campfire video shown in FIG1 includes N frames of data, referring to FIG2A , the smart TV 10 sequentially reads, parses, decodes, and renders the Nth frame of data from time T0 to time T1, obtaining the Nth frame of output data corresponding to the Nth frame of data (e.g., the Nth frame of data corresponds to the Nth frame of image and the Nth segment of sound). From time T1 to time T2, the smart TV 10 displays the Nth frame of image and plays the Nth segment of sound (i.e., outputs the Nth frame of output data).

[0051] After the smart TV 10 detects that the Nth frame of image has been displayed at time T2, it triggers the replay of the campfire video. The smart TV 10 completes the initialization of the video playback application at time T3, and from time T3 to time T4, it sequentially reads, parses, decodes, and renders the first frame of data of the campfire video, obtaining the first frame of output data corresponding to the first frame of data (for example, the first frame of image and the first audio segment corresponding to the first frame of data). The smart TV 10 displays the first frame of image and plays the first audio segment (i.e., outputs the first frame of output data) from time T4 to time T5.

[0052] That is, from time T2 to time T4, the smart TV 10 has no images to display and no sounds to play, which may cause the images displayed or the sounds played by the smart TV 10 to be discontinuous, affecting the user experience.

[0053] For example, referring to FIG2B , if the smart TV 10 continues to display the Nth frame of image from time T2 to time T4, and displays the first frame of image from time T4 to time T5, the image displayed by the smart TV 10 during the period from time T2 to time T4 is the same, causing the smart TV 10 to stagnate and freeze.

[0054] For another example, if the smart TV 10 displays a background (e.g., white or black) from time T2 to time T4 and displays the first frame of image from time T4 to time T5, the smart TV 10 will display a blank or black screen from time T2 to time T4.

[0055] In order to avoid the problem of discontinuity when the device plays a multimedia file in a loop, an embodiment of the present application provides a method for playing multimedia files. In this method, when the device plays a multimedia file in a loop, after reading the last frame data of the multimedia file, it continues to read the first frame data of the multimedia file. Then, before the end of the output cycle corresponding to the last frame data of the multimedia file (hereinafter referred to as the first output cycle), the device processes the first frame data of the multimedia file to obtain the first output data corresponding to the first frame data. In this way, the device can output the first output data corresponding to the first frame data of the multimedia file in the output cycle after the first output cycle (hereinafter referred to as the second output cycle).

[0056] Because the device does not need to wait until the last frame of the multimedia file is output before starting to read the first frame of the multimedia file, the last and first frames of the multimedia file are read continuously, and the output data corresponding to the last and first frames are output continuously. This avoids discontinuities when the multimedia file is looped, achieving seamless loop playback of the multimedia file and improving the user experience.

[0057] It should be understood that the device's processing of multimedia files is divided into multiple steps, each step can take up one output cycle, or multiple steps can take up one output cycle. Assume that the device's processing of a frame of data takes up Q (Q ≥ 1) output cycles, and the device reads a frame of data in the Kth output cycle, and the device outputs the output data corresponding to the frame of data in the K+Qth output cycle. For example, assume that the device's processing of a frame of multimedia file data is divided into four steps: reading, parsing, decoding, and rendering, and each step takes up one output cycle, then Q = 4.

[0058] Exemplarily, FIG3A shows a timing diagram of another smart TV 10 playing a video in a loop according to some embodiments of the present application.

[0059] Assume that in the scenario shown in Figure 1, the campfire video played by the smart TV 10 includes N frames of data. The processing of each frame of data by the smart TV 10 includes four steps: reading, parsing, decoding, and rendering. Each step takes one output cycle, that is, Q = 4. As shown in Figure 3A:

[0060] During the period from time t0 to time t1 (the Pth output cycle), the smart TV 10 reads the Nth frame data, parses the N-1th frame data, decodes the N-2th frame data, renders the N-3th frame data, and outputs the output data corresponding to the N-4th frame data.

[0061] At time t1, the smart TV 10 detects that the last frame of the bonfire video has been read, triggering the video to be played again. In some embodiments, the smart TV 10 can detect that the last frame of the bonfire video has been read when the end marker of the bonfire (e.g., the end of segment (EOS) marker) is read, and then continue to read the first frame of the bonfire video. In other embodiments, the smart TV 10 can also detect that the last frame of the bonfire video has been read by other means, which are not limited here.

[0062] During the period from time t1 to time t2 (the P+1th output cycle), the smart TV 10 continues to read the 1st frame data, parse the Nth frame data, decode the N-1th frame data, render the N-2th frame data, and output the output data corresponding to the N-3th frame data.

[0063] During the period from time t2 to time t3 (the P+2th output cycle), the smart TV 10 reads the second frame data, parses the first frame data, decodes the Nth frame data, renders the N-1th frame data, and outputs the output data corresponding to the N-2th frame data.

[0064] During the period from time t3 to time t4 (the P+3th output cycle), the smart TV 10 reads the 3rd frame data, parses the 2nd frame data, decodes the 1st frame data, renders the Nth frame data, and outputs output data corresponding to the N-1th frame data.

[0065] During the period from t4 to t5 (the P+Qth output cycle (i.e., the first output cycle)), the smart TV 10 reads the 4th frame data, parses the 3rd frame data, decodes the 2nd frame data, renders the 1st frame data, and outputs the output data corresponding to the Nth frame data.

[0066] At time t5, the Smart TV 10 detects that the last frame of video data has been output and updates the synchronization reference time for the image output data and audio data to synchronize the output images. It should be understood that the synchronization reference time refers to the start time of the video file playback. If the video file starts playing at the 0th second, the synchronization reference time is 0 seconds; if the video file starts playing at the 5th second, the synchronization reference time is 5 seconds. The specific method by which the Smart TV 10 synchronizes the image output data and audio output data will be described below and is not limited here.

[0067] During the period from t5 to t6 (the P+Q+1th output cycle (i.e., the second output cycle)), the smart TV 10 reads the 5th frame data, parses the 4th frame data, decodes the 3rd frame data, renders the 2nd frame data, and outputs the output data corresponding to the 1st frame data.

[0068] It should be understood that when the smart TV 10 outputs the output data corresponding to a certain frame of data, it can synchronize the image output data and the sound output data corresponding to the frame of data and then output them.

[0069] Based on the above method, compared with the process shown in FIG. 2A, since the smart TV 10 continues to read the first frame of the bonfire video after reading the Nth frame of the bonfire video data (that is, the Nth frame data and the first frame data of the bonfire video are read in two adjacent input cycles), rather than waiting until the output of the Nth frame data is completed and then reading the first frame data of the bonfire video. The smart TV 10 can obtain the output data corresponding to the first frame data of the bonfire video before the end of the output cycle corresponding to the Nth frame data, so that the smart TV 10 can output the output data corresponding to the Nth frame data and the output data corresponding to the first frame data in two adjacent output cycles respectively. In this way, the smart TV 10 can play the video seamlessly in a loop, and there will be no display freeze or black / white screen during the period, which is beneficial to improving the user experience.

[0070] It should be understood that when the device outputs a multimedia file, it can output the multimedia file periodically. For example, one frame of data of the multimedia file is output in one output cycle.

[0071] Exemplarily, for a video file, one frame of data may include one frame of image data and the audio data corresponding to the frame of image. The output cycle may be the reciprocal of the frame rate of the video file, or the reciprocal of the frame rate of the device for synthesizing images, or the reciprocal of the refresh rate of the device for displaying images. For example, if the frame rate of the video file is 60 Hz (it can also be other data, which is not limited here), or the frame rate of the device for synthesizing images is 60 Hz (it can also be other data, which is not limited here), or the refresh rate of the device for displaying images is 60 Hz (it can also be other data, which is not limited here), then the output cycle may be 1 / 60 = 16.67 ms.

[0072] Exemplarily, for an audio file, one frame of data may include at least one sampling data. The output cycle may be K times (K≥1) the reciprocal of the sampling rate of the audio file. For example, if the sampling rate of the audio file is 44000 Hz (it can also be other data, which is not limited here), then the output cycle may be K×(1 / 44000) = K×0.0227 ms.

[0073] It should be understood that after the device reads the Mth (1≤M<N, N is the number of frames included in the multimedia file) frame data of the multimedia file, if the device does not detect an instruction to pause or stop playing, it can continue to read the (M + 1)th frame data of the media file. Then, the device can parse, decode, and render the (M + 1)th frame data in sequence, so that the device can continuously output the output data corresponding to the Mth frame data and the output data of the (M + 1)th frame of the multimedia file.

[0074] It should be understood that when the device outputs the output data of a multimedia file, it can output the multimedia file through the device's own output device (such as the device's own display screen, projection device, speaker, etc.), or through other output devices connected to the device, without limitation here.

[0075] It should be understood that the embodiments of the present application divide the processing of multimedia files by the device into four steps: reading, parsing, decoding, and rendering. This is only an example. In other embodiments, the processing of multimedia files by the device can also be divided into more or fewer sequentially executed steps, or some steps can be combined, which is not limited here.

[0076] It should be understood that the four steps of reading, parsing, decoding, and rendering a frame of multimedia file data in the above embodiment each taking up one output cycle is merely an example. In other embodiments, each of the four steps may only take up a portion of one output cycle; if the total processing time of two or more steps is less than one output cycle, the two or more steps may be combined and executed in one output cycle, without limitation herein.

[0077] For example, FIG3B shows another timing diagram of a smart TV 10 playing a video in a loop according to some embodiments of the present application.

[0078] Referring to FIG3B , compared to the scenario shown in FIG3A , the smart TV 10 combines the reading and parsing of a frame of data into one step. That is, the processing of a frame of video file data by the smart TV 10 is divided into three steps: reading and parsing, decoding, and rendering. Each step takes one output cycle, i.e., Q=3 as mentioned above. As shown in FIG3B :

[0079] During the period from time t7 to time t8 (the Pth output cycle), the smart TV 10 reads and parses the Nth frame data, decodes the N-1th frame data, renders the N-2th frame data, and outputs the output data corresponding to the N-3th frame data.

[0080] At time t8, the smart TV 10 detects that the last frame of the video has been read, and triggers the video to be played again.

[0081] During the period from time t8 to time t9 (the P+1th output cycle), the smart TV 10 reads and parses the 1st frame data, decodes the Nth frame data, renders the N-1th frame data, and outputs the output data corresponding to the N-2th frame data.

[0082] From t9 to t 10During the time period (the P+2th output cycle), the smart TV 10 reads and parses the second frame data, decodes the first frame data, renders the Nth frame data, and outputs the output data corresponding to the N-1th frame data.

[0083] In t 10 Time to t 11 During the time period (the P+Qth output cycle (ie, the first output cycle)), the smart TV 10 reads and parses the third frame data, decodes the second frame data, renders the first frame data, and outputs the output data corresponding to the Nth frame data.

[0084] In t 11 At this moment, the smart TV 10 detects that the last frame of video data has been output, and updates the synchronization reference time of the image output data and the audio data, so as to synchronize the output image and sound.

[0085] In t 11 Time to t 12 During the time period (the P+Q+1th output cycle (i.e., the second output cycle)), the smart TV 10 reads and parses the 4th frame data, decodes the 3rd frame data, renders the 2nd frame data, and outputs the output data corresponding to the 1st frame data.

[0086] It should be understood that, in some embodiments, in the processing of multimedia files:

[0087] Reading refers to reading multimedia file data frame by frame from the memory of the smart TV 10 or from another device. For example, for a multimedia file stored locally on the smart TV 10, the smart TV 10 can read the multimedia file data frame by frame from the location where the multimedia file is stored. For another example, for a multimedia file obtained in real time from another device, the smart TV 10 can read the multimedia file data frame by frame from the cache corresponding to the multimedia file.

[0088] Parsing refers to parsing multimedia file data into video elementary streams (ES) and / or audio ES. If the multimedia file contains video data but not audio data, parsing the multimedia file yields a video ES. If the multimedia file contains audio data but not video data, parsing the multimedia file yields a single-band ES. If the multimedia file contains both video and audio data, parsing the multimedia file yields both the video ES and the audio ES.

[0089] Decoding refers to decoding multimedia video ES and / or audio ES into encoded data that can be rendered. For example, for video ES, it can be decoded to obtain YUV-encoded (a color encoding method, or other types of encoding methods, which are not limited here) data. For another example, for audio ES, it can be decoded into linear pulse code modulation (LPCM) (a non-compressed audio digitization method, or other methods, such as pulse code modulation, which are not limited here) data.

[0090] Rendering refers to processing the decoded YUV encoded data and LPCM data to obtain output data that can be output to the output device.

[0091] The technical solution of the present application is described below in conjunction with the situations shown in FIG. 1 and FIG. 3A and FIG. 3B .

[0092] To facilitate understanding, the software architecture of the smart TV 10 is first introduced.

[0093] FIG4 shows a schematic diagram of a software architecture of a smart TV 10 according to some embodiments of the present application.

[0094] As shown in FIG4 , the software architecture of the smart TV 10 includes an application layer 01 , a framework layer 02 , a hardware abstraction layer (HAL) 03 , a kernel layer 04 , and the like.

[0095] The application layer 01 includes application programs in the smart TV 10 .

[0096] For example, the application layer 01 may include a first application 011. The first application 011 may be an application program capable of playing multimedia files. The first application 011 includes a reading and parsing module 012, a user interface 013, and a play control 014.

[0097] The reading and parsing module 012 is used to read the data of the multimedia file and parse the read data. For example, if the multimedia file is a video file, the reading and parsing module 012 can be used to read the media stream of the video file and parse the media stream to obtain the video ES and audio ES corresponding to the media stream. The video ES is then sent to the video decoder 022, and the audio ES is sent to the audio decoder 023.

[0098] In some embodiments, when the first application 011 plays a multimedia file, the reading and parsing module 012 may sequentially read and parse the first frame to the last frame of the multimedia file. For example, the reading and parsing module 012 may read and parse one frame of the multimedia file in one output cycle and send the parsed data to the video decoder 022 and / or the audio decoder 023.

[0099] In some embodiments, when the first application 011 plays a multimedia file in a loop, the reading and parsing module 012 can read the first frame of the multimedia file in the next output cycle after reading the last frame of the multimedia file in one output cycle.

[0100] It should be understood that, when the multimedia file is not played in a loop (e.g., when the instruction to play the multimedia file in a loop is not detected), the reading and parsing module 012 may report a reading completion message to the application program (e.g., the first application 011) that plays the multimedia file after reading the last frame of data of the multimedia file. The reading completion message is used to instruct the video decoder 022, the audio decoder 023, the graphics processing unit (GPU) HAL 032, the hardware composer (HWC) HAL 034, the audio HAL 033, and other modules to stop processing subsequent data after processing the last frame of data of the multimedia file and to end playback of the multimedia file.

[0101] In other embodiments, the reading and parsing module 012 can also be split into a reading module and a parsing module. The reading module and the parsing module can be set at the same layer, for example, in each first application 011, in the playback subsystem and services 021, in the hardware abstraction layer 03, or in the kernel layer 04. The reading module and the parsing module can also be set at different layers, for example, the reading module can be set in the first application 011, and the parsing module can be set in the playback subsystem and services 021, etc. The embodiment of the present application does not limit the location of the reading module and the parsing module.

[0102] The user interface 013 is used to display the interface of the first application 011 on the smart TV 10 .

[0103] The playback control 014 is used to control the playback of multimedia files according to user operations. For example, the playback control 014 can execute pause, fast forward, fast rewind, adjust the progress or adjust the playback mode (such as single play, loop play, etc.) according to user operations.

[0104] In some embodiments, in response to a user setting the playback mode of the multimedia file to loop playback, the playback control 014 may send a loop playback instruction to the reading and parsing module 012. In response to the loop playback instruction, the reading and parsing module 012 may continue to read the first frame of the multimedia file after reading the last frame of the multimedia file.

[0105] It should be understood that in other embodiments, the application layer 01 may include more application programs, which is not limited here.

[0106] The framework layer 02 provides an application programming interface (API) and programming framework for applications in the application layer 01. The framework layer 02 includes some predefined functions. For example, the framework layer may include a playback subsystem and service 021, graphics rendering 027, audio rendering 028, and a system clock 029.

[0107] The playback subsystem and services 021 are used to provide the application of the application layer 01 with the ability to play multimedia files. In some embodiments, the playback subsystem and services 021 include a video decoder 022, an audio decoder 023, synchronization 024, a video output 025 and an audio output 026.

[0108] The video decoder 022 is used to provide video decoding capabilities for application layer applications. For example, the video decoder 022 can read the video ES sent by the parsing module 012 and call the decoder HAL 031 and / or the graphics processor HAL 032 to decode the video ES to obtain YUV-encoded data. For example, the video decoder 022 can be used to decode video data in formats such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, Audio Video Interleaved (AVI), H.264, and H.265.

[0109] The audio decoder 023 is used to provide audio decoding capabilities for applications in the application layer 01. For example, the audio decoder 023 can read the audio ES sent by the parsing module 012 and call the audio HAL 033 to decode the audio ES to obtain LPCM-encoded data. For example, the audio decoder 023 can be used to decode audio data in formats such as MPEG, MP3, adaptive multi-rate (AMR), and advanced audio coding (ACC).

[0110] The video output 025 is used to call the video output 043 in the kernel layer 04 to output the image output data of the multimedia file to the display screen.

[0111] The audio output 026 is used to call the audio output 044 of the kernel layer 04 to output the sound output data of the multimedia file to a sound playback device (such as a sound box, a loudspeaker, etc.).

[0112] Synchronization 024 is used to synchronize the sound output data and image output data of the multimedia file to ensure synchronization of the image output data and the sound output data of the output multimedia file. In some embodiments, synchronization 024 is also used to update the synchronization reference time of the image output data and the sound output data after the last frame data of the multimedia is output.

[0113] It should be understood that the synchronization reference time can be the time when the multimedia file starts playing. For example, for a video file with a duration of 10 seconds, if the smart TV 10 plays the data from the 0th second to the 10th second of the video file, the synchronization reference time is 0 seconds; if the smart TV 10 plays the data from the 5th second to the 10th second of the video file, the synchronization reference time is 5 seconds.

[0114] For any frame of data in a multimedia file, its timestamp t_t is the sum of the synchronization reference time t_ref and the elapsed playback time t_p, i.e., t_t = t_ref + t_p. After outputting the last frame of data in the multimedia file, Sync 024 can update the synchronization reference time to t_ref and reset t_p to 0. For example, assuming the synchronization reference time is 5 seconds, Sync 024 can update the synchronization reference time to 5 seconds and reset the elapsed playback time to 0 seconds after outputting the last frame of data in the multimedia file.

[0115] It should be understood that for the image output data and audio output data of a frame of data, the corresponding timestamps are the same. When synchronizing the image output data and the audio output data, synchronization 024 outputs the image output data and the audio output data with the same timestamp simultaneously, or controls the time difference between the output of the image output data and the audio output data with the same timestamp to be less than a preset time difference.

[0116] In some embodiments, when synchronizing video output data and audio output data, synchronization 024 can adjust the audio output data based on the timestamp of the video output data, or adjust the video output data based on the timestamp of the audio output data, or adjust the video output data and audio output data at the same time based on external time.

[0117] For example, assume that based on the timestamp of the audio output data, the timestamp of the current audio output data of the smart TV 10 is t_t1, and the timestamp of the video output data is t_t2. When t_t2 > t_t1, the output of the video output data can be delayed. For example, when the audio output data with the timestamp t_t2 is output, the video output data with the timestamp t_t2 is output. When t_t2 < t_t1, the output of the video output data with the timestamp t_t2 can be skipped, and the video output data with the timestamp t_t1 is output.

[0118] It should be understood that in some other embodiments, the synchronization 024 may also not synchronize the image output data and the sound output data based on the timestamps of each frame of output data, but synchronize based on other data that can identify the video output data and the audio output data. The embodiments of the present application do not limit the data on which the synchronization 024 depends for synchronizing the image output data and the sound output data. For example, the image output data and the sound output data corresponding to the same frame of data may have the same frame identifier (such as a serial number), so that the synchronization 024 can be synchronized based on the frame identifiers of the image output data and the sound output data.

[0119] The image rendering 027 is used to render the YUV-encoded data into an image. For example, the image rendering 027 can call the graphics processor HAL 032 and / or the hardware mixing renderer HAL 034 to render the YUV-encoded data and obtain the image output data of the multimedia file.

[0120] The audio rendering 028 is used to render the LPCM-encoded data into sound output data. For example, the audio rendering 028 can call the audio HAL 033 to render the LPCM-encoded data and obtain the sound output data of the multimedia file.

[0121] The system clock 029 is used to provide a clock reference for each module of the smart TV 10.

[0122] It should be understood that in some other embodiments, the framework layer 02 may also include more or fewer modules, which are not limited herein.

[0123] The hardware abstraction layer 03 is an interface layer located between the operating system kernel layer and other layers of the electronic device, and its purpose is to abstract the hardware and provide a virtual hardware platform for the operating system. For example, the hardware abstraction layer 02 may include a decoder HAL 031, a graphics processor HAL 032, an audio HAL 033, and a hardware mixing renderer HAL 034.

[0124] The decoder HAL 031 is used to provide a call interface for video decoding for application programs or modules in the application layer 01 and the framework layer 02.

[0125] The graphics processor HAL 032 is used to provide a graphics processor calling interface for application programs or modules in the application layer 01 and the framework layer 02.

[0126] The audio HAL 033 is used to provide calling interfaces for audio encoding, audio decoding, audio rendering, etc. for the application programs or modules in the application layer 01 and the framework layer 02.

[0127] The hardware hybrid renderer HAL 034 is used to provide an image synthesis and rendering calling interface for the application programs or modules in the application layer 01 and the framework layer 02.

[0128] It should be understood that in other embodiments, the hardware abstraction layer 03 may also include more or fewer modules, which is not limited here.

[0129] The kernel layer 04 is a layer between hardware and software. The kernel layer 04 can also be called a driver layer. The kernel layer 04 can include a video driver 041, an audio driver 042, a video output 043, an audio output 044, etc.

[0130] The video driver 041 is used to respond to the calls of the video decoder 022, the image processor HAL 032, the decoder HAL 031, and the hardware hybrid renderer HAL 034 to implement parsing, decoding, and rendering of video data.

[0131] The audio driver 042 is used to implement parsing, decoding and rendering of audio data in response to calls from the audio decoder 023 and the audio HAL 033.

[0132] Video output 043 is used to respond to the call of video output 025 and output the image output data of the multimedia file to the corresponding display device.

[0133] Audio output 044 is used to respond to the call of audio output 026 and output the audio output data of the multimedia file to the corresponding playback device.

[0134] It should be understood that in other embodiments, the kernel layer 04 may also include more or fewer modules, which is not limited here.

[0135] It should be understood that the software architecture of the smart TV 10 shown in Figure 4 is only an example. In other embodiments, the architecture of the mobile phone 10 may include more or fewer layers / modules, some modules may be merged or split, and the positions of some modules may be adjusted, which is not limited here.

[0136] For example, Figure 5 illustrates another software architecture diagram for a smart TV 10, according to some embodiments of the present application. As shown in Figure 5, compared to the software architecture shown in Figure 4, the reading and parsing module 012 is not embedded in the first application 011, but is instead located within the playback subsystem and services 021 of the framework layer 02. This allows the smart TV 10 to achieve seamless loop playback of multimedia files when any application plays them in a loop, based on the reading and parsing module 012.

[0137] It should be understood that in other embodiments, the reading and parsing module 012 can also be set in other layers of the software architecture of the smart TV 10, such as the hardware abstraction layer 03, the kernel layer 04, etc., which is not limited here.

[0138] The following describes the technical solution of the present application in conjunction with the software architecture shown in FIG4 .

[0139] For ease of understanding, the process of playing video files on the smart TV 10 is first introduced.

[0140] FIG6 is a schematic diagram showing a process of playing a video on a smart TV 10 according to some embodiments of the present application.

[0141] As shown in Figure 6, the process includes the following steps:

[0142] First, the reading and parsing module 012 reads the current frame data of the video file.

[0143] In some embodiments, the data read by the reading and parsing module 012 may be local data stored in the smart TV 10 or network data obtained from other devices.

[0144] In some embodiments, the reading and parsing module 012 may store the read current frame data into an input buffer corresponding to the reading and parsing module 012 .

[0145] It should be understood that the current frame data can be any frame data in the video file.

[0146] In some embodiments, when the current frame data is the last frame data of the multimedia file and the smart TV 10 is not playing the multimedia file in a loop, the reading and parsing module 012 can report a reading completion message to the application (e.g., the first application 011) that plays the multimedia file after reading the current frame data. The reading completion message is used to instruct the video decoder 022, audio decoder 023, graphics processor HAL 032, hardware hybrid renderer HAL 034, audio HAL 033 and other modules to stop processing subsequent data after processing the last frame data of the multimedia file and end playback of the multimedia file.

[0147] Then, the reading and parsing module 012 parses the current frame data of the read video file.

[0148] The reading and parsing module 012 parses the read current frame data to obtain the video ES and audio ES corresponding to the current frame data, and sends the video ES and audio ES to the video decoder 022 and the audio decoder 023 respectively.

[0149] In some embodiments, if the smart TV 10 plays an audio file, the reading and parsing module 012 may generate only an audio ES and send the audio ES to the audio decoder 023. If the multimedia file played by the smart TV 10 only has images but no sound, the reading and parsing module 012 may generate only a video ES and send the video ES to the video decoder 022.

[0150] In some embodiments, the reading and parsing module 012 may send the video ES and the audio ES to the video decoder 022 and the audio decoder 023 respectively by storing the video ES and the audio ES in an output buffer corresponding to the reading and parsing module 012 .

[0151] In some embodiments, the reading and parsing module 012 can store the video ES and audio ES corresponding to the current frame data in the output cache corresponding to the stream parsing module 012 after the video ES and audio ES corresponding to the previous frame data stored in the reading and parsing module 012 have been processed by the video decoder 022 and the audio decoder 023.

[0152] In some embodiments, the smart TV 10 plays a multimedia file in a loop. When the current frame data is the first frame data of the multimedia file, the previous frame data may be the last frame data of the multimedia file.

[0153] It should be understood that when the smart TV 10 is not playing a multimedia file in a loop, when the current frame data is the first frame data of the multimedia file, the data in the output cache corresponding to the parsing module 012, the output cache corresponding to the video decoder 022, the output cache corresponding to the audio decoder 023, the image output cache, the audio output cache, and the output cache of the module are empty.

[0154] Next, the video ES and audio ES are decoded.

[0155] Exemplarily, the video decoder 022 decodes the video ES to obtain corresponding YUV encoded data, and the audio decoder 023 decodes the audio ES to obtain LPCM encoded data.

[0156] In some embodiments, the video decoder 022 can read the video ES from the output buffer corresponding to the reading and parsing module 012 for decoding, and store the decoded YUV encoded data in the output buffer corresponding to the video decoder 022. The audio decoder 023 can read the audio ES from the output buffer corresponding to the reading and parsing module 012 for decoding, and store the decoded LPCM encoded data in the output buffer corresponding to the audio decoder 023.

[0157] In some embodiments, the video decoder 022 may store the YUV encoded data corresponding to the current frame data to the output buffer corresponding to the video decoder 022 after the graphics processor HAL 032 and / or the hardware hybrid shader HAL 034 have completed rendering the YUV encoded data corresponding to the previous frame data. The audio decoder 023 may store the LPCM encoded data corresponding to the current frame data to the output buffer corresponding to the audio decoder 023 after the audio HAL 033 has completed rendering the LPCM encoded data corresponding to the previous frame data.

[0158] In other embodiments, the video decoder 022 may decode the video ES to obtain data encoded in other forms, which is not limited here.

[0159] In other embodiments, the audio decoder 023 may decode the audio ES to obtain data encoded in other forms, which is not limited here.

[0160] Again, render the YUV encoded data and LPCM data.

[0161] Exemplarily, the graphics processor HAL 032 and / or the hardware hybrid renderer HAL 034 renders the YUV encoded data to obtain image output data, and the audio HAL 033 renders the LPCM encoded data to obtain sound output data.

[0162] In some embodiments, the graphics processor HAL 032 and / or the hardware blending renderer HAL 034 can read YUV-encoded data from the output buffer of the video decoder 022, render the YUV-encoded data, and then store the image output data in the video output buffer. The audio HAL 033 can read LPCM-encoded data from the output buffer corresponding to the audio decoder 023, render the LPCM-encoded data, and then store the sound output data in the audio output buffer.

[0163] In some embodiments, the graphics processor HAL 032 and / or the hardware blending renderer HAL 034 may store the image output data of the current frame in the video output buffer after the image output data corresponding to the previous frame data stored in the video output buffer has been output. The audio HAL 033 may store the sound output data of the current frame in the video output buffer after the sound output data corresponding to the previous frame data stored in the audio output buffer has been output.

[0164] Finally, after synchronization 024 synchronizes the image output data and the audio data, the image output data and the audio output data are output to corresponding output devices by video output 025 and audio output 026 respectively.

[0165] For example, video output 025 can call video driver 041 and video output 043 to output image output data to the display screen of smart TV 10 or other image output devices connected to smart TV 10. Audio output 026 can call audio driver 042 and audio output 044 to output sound output data to the speaker of smart TV 10 or audio output devices connected to smart TV 10.

[0166] Based on the embodiment shown in FIG6 , with reference to FIG7 , when the smart TV 10 loop-plays a multimedia file including N frames of data (e.g., when an instruction to loop-play a multimedia file including N frames of data is detected), the smart TV 10 can implement seamless loop-play of the multimedia file by the following steps:

[0167] S1, the reading and parsing module 012 continues to read the first frame of data after finishing reading the Nth frame of data.

[0168] When the reading and parsing module 012 plays the multimedia file in a loop (for example, when an instruction to play the multimedia file including N frames of data in a loop is detected), the reading and parsing module 012 continues to read the first frame of data after reading the Nth frame of data.

[0169] In some embodiments, after reading the Nth frame of data, the reading and parsing module 012 does not report a reading completion message to the first application 011. Thus, after the reading and parsing module 012 finishes reading the first frame of data, the video decoder 022, audio decoder 023, graphics processor HAL 032, hardware hybrid renderer HAL 034, audio HAL 033, and other modules will continue to process the first frame of data after processing the Nth frame of data, thereby obtaining output data corresponding to the first frame of data. For a detailed description of the processing process, please refer to the embodiment shown in FIG6 and will not be described in detail here.

[0170] S2, after synchronization 024 outputs the Nth frame image, the synchronization reference time is updated.

[0171] After outputting the Nth frame of image, Synchronize 024 updates the synchronization reference time to regenerate the timestamps of the output data for each frame of data. Thus, after Synchronize 024 generates the image output data (the first image frame) and audio output data (the first sound segment) corresponding to the first frame of data, it can synchronize based on the timestamps of the first image frame and the first sound segment.

[0172] It should be understood that the synchronization reference time can be the time when the multimedia file starts playing. In some embodiments, the timestamp t_t of any frame of data in the multimedia file is the sum of the synchronization reference time t_ref and the elapsed playback time t_p, that is, t_t = t_ref + t_p. After outputting the last frame of data in the multimedia file, Sync 024 can update the synchronization reference time to t_ref and set t_p to 0. For example, assuming the synchronization reference time is 5 seconds, Sync 024 can update the synchronization reference time to 5 seconds and reset the elapsed playback time to 0 seconds after outputting the last frame of data in the multimedia file.

[0173] S3, the video output 025 outputs the Nth frame image in the first output cycle, and then outputs the 1st frame image in the second output cycle; the audio output 026 outputs the Nth sound in the first output cycle, and then outputs the 1st sound in the second output cycle.

[0174] After synchronization 024 updates the synchronization reference time, video output 025 and audio output 026 can respectively call video output 043 and audio output 044 in the second output cycle, outputting the first frame image to the display screen of smart TV 10 and the first sound to the speaker of smart TV 10 respectively.

[0175] Based on the above method, the smart TV 10 can achieve seamless loop playback of multimedia files, avoiding discontinuity in the images displayed or the sounds played by the smart TV 10.

[0176] Below, the technical solution of the present application is introduced in combination with the situations shown in Figures 1, 3A and 3B, the software architecture shown in Figure 4, and the process of playing video files on the smart TV 10 shown in Figures 6 and 7.

[0177] FIG8 is a flow chart showing a method for playing multimedia files according to some embodiments of the present application. As shown in FIG8 , the method includes the following steps:

[0178] S801: An instruction to play a multimedia file in a loop is detected.

[0179] When the smart TV 10 detects an instruction to play a multimedia file in a loop, it triggers the multimedia file playing method provided in the embodiment of the present application.

[0180] For example, when the smart TV 10 detects that the user turns on the aforementioned “picture frame mode”, or when the smart TV 10 automatically switches to the “picture frame mode”, the smart TV 10 may detect an instruction to loop play multimedia files.

[0181] For example, after the user selects the loop playback operation in the display interface of the first application 011 on the smart TV 10, the smart TV 10 may detect the instruction to loop the multimedia file. For example, referring to FIG9A , the smart TV 10 may display the video settings window in response to the user operation, and then display the play mode window after the user selects the "play mode" option 91. After detecting the user's selection of the "single loop" option 92, the smart TV 10 may detect the instruction to loop the multimedia file.

[0182] It should be understood that in other embodiments, the device may also detect an instruction to loop-play a multimedia file in other situations, which is not limited here.

[0183] For example, in some applications, when a certain interface is displayed, the default setting is to automatically loop the multimedia files in that interface. When the user switches to that interface of the application, the device can detect the instruction to loop the multimedia files. Referring to Figure 9B, the display interface of the social application on the mobile phone 20 displays the social information of "User A" including a video playback control 93. When the user switches to this display interface, the smart TV 10 can detect the instruction to loop the multimedia files.

[0184] S802: After reading the last frame of data of the multimedia file, continue reading the first frame of data of the multimedia file.

[0185] For example, the smart TV 10 can utilize the aforementioned reading and parsing module 012 to read the last frame of the multimedia file and then continue to read the first frame of the multimedia file. In other words, the last frame of the multimedia file and the first frame of the multimedia file are read continuously.

[0186] For example, corresponding to the situation shown in FIG. 3A , the reading and parsing module 012 finishes reading the Nth frame data (ie, the last frame data) of the multimedia file at time t1 and continues to read the first frame data of the multimedia file.

[0187] For another example, corresponding to the situation shown in FIG3B , the reading and parsing module 012 finishes reading the Nth frame data (ie, the last frame data) of the multimedia file at time t8 and continues to read the first frame data of the multimedia file.

[0188] In some embodiments, after the smart TV 10 uses the aforementioned reading and parsing module 012 to read the first frame data of the multimedia file, it can store the video ES and audio ES corresponding to the first frame data in the output buffer corresponding to the reading and parsing module 012.

[0189] In some embodiments, after reading the EOS mark of the multimedia file, the smart TV 10 may determine that the last frame of data of the multimedia file has been read and continue to read the first frame of data of the multimedia file.

[0190] It should be understood that when a multimedia file is played in a loop (e.g., when a loop playback instruction is detected), the reading and parsing module 012 does not report a reading completion message to the application program that plays the multimedia file after reading the last frame of data of the multimedia file. After the reading and parsing module 012 has read the first frame of data of the multimedia file, the video decoder 022, the audio decoder 023, the graphics processor HAL 032, the hardware hybrid renderer HAL 034, and the audio HAL 033 modules will continue to process the first frame of data of the multimedia file after processing the last frame of data of the multimedia file.

[0191] It should be understood that after reading the first frame of the multimedia file, the smart TV 10 will continue to read, parse, decode, render, and output the remaining frames of the multimedia file. The processing process of each frame of data by the smart TV 10 can refer to the embodiment shown in Figure 6 and is not limited here.

[0192] S803: Output the last frame of multimedia file data in a first output cycle, and process the first frame of data before the end of the first output cycle to obtain first output data corresponding to the first frame of data.

[0193] The smart TV 10 outputs the output data corresponding to the last frame data of the multimedia file in the first output cycle, and decodes and renders the first frame data before the end of the first output cycle to obtain first output data corresponding to the first frame data.

[0194] For example, after the smart TV 10 uses the reading and parsing module 012 to store the video ES and audio ES of the first frame data of the multimedia file into the output buffer corresponding to the reading and parsing module 012, the smart TV 10 can process the first frame data in the following manner to obtain first output data corresponding to the first frame data:

[0195] For the video ES, the video decoder 022 reads the video ES from the output buffer corresponding to the read parsing module 012 for decoding, and stores the decoded YUV encoded data in the output buffer corresponding to the video decoder 022. The graphics processor HAL 032 and / or the hardware hybrid renderer HAL 034 reads the YUV encoded data from the output buffer of the video decoder 022, renders the YUV encoded data to obtain image output data corresponding to the multimedia file, and stores the image output data in the video output buffer.

[0196] For audio ES, the audio decoder 023 reads and decodes the audio ES from the output buffer corresponding to the reading and parsing module 012, and stores the decoded LPCM encoded data in the output buffer corresponding to the audio decoder 023. The audio HAL 033 reads the LPCM encoded data from the output buffer corresponding to the audio decoder 023, renders the LPCM encoded data to obtain sound output data, and stores the sound output data in the audio output buffer.

[0197] That is, if the multimedia file includes video data and audio data, the first output data includes image output data stored in the video output buffer and sound output data stored in the audio output buffer. If the multimedia file includes video data but not audio data, the first output data includes image output data stored in the video output buffer. If the multimedia file includes audio data but not video data, the first output data includes sound output data stored in the audio output buffer.

[0198] For example, in the scenario shown in FIG3A , the smart TV 10 may output the Nth frame of data during the period from time t4 to time t5 (i.e., the first output period). Furthermore, during the period from time t1 to time t5, the smart TV 10 may sequentially read, parse, decode, and render the first frame of data of the multimedia file to obtain first output data corresponding to the first frame of data.

[0199] For another example, in the situation shown in FIG3B , the smart TV 10 may 10 Time to t 11 During the time period (i.e. the first output cycle), the Nth frame data is output. 11 During the time period, the first frame data of the multimedia file is read, parsed, decoded and rendered in sequence to obtain output data corresponding to the first frame data.

[0200] It should be understood that after outputting the last frame of the multimedia file, the smart TV 10 may also update the synchronization reference time so that the synchronization 024 can synchronize the image output data and the sound output data corresponding to the first frame of the multimedia file with the correct reference time. For example, assuming the synchronization reference time is 5 seconds, the synchronization 024 may update the synchronization reference time to 5 seconds and reset the elapsed playback time to 0 seconds after outputting the last frame of the multimedia file.

[0201] S804: Output the first output data in a second output cycle, wherein the second output cycle is an output cycle subsequent to the first output cycle.

[0202] The smart TV 10 outputs the first output data in an output cycle subsequent to the first output cycle.

[0203] For example, in the scenario shown in FIG. 3A , the smart TV 10 may output the output data (first output data) corresponding to the first frame data during the period from time t5 to time t6 (ie, the second output period).

[0204] For another example, in the situation shown in FIG3B , the smart TV 10 may 11 Time to t 12 During the time period (ie, the second output period), the output data corresponding to the first frame data (first output data) is output.

[0205] It should be understood that after the smart TV 10 outputs the first output data in the second output cycle, it can also output other frame data of the multimedia file in sequence in the following output cycle.

[0206] By implementing the method provided in this application, when the smart TV 10 plays a video in a loop, after reading the last frame of the multimedia file, it continues to read the first frame of the multimedia file. Then, before the end of the first output cycle, the smart TV 10 processes the first frame of the multimedia file to obtain first output data corresponding to the first frame of the multimedia file, and outputs the first output data in the second output cycle. In this way, seamless loop playback of multimedia files can be achieved.

[0207] Furthermore, FIG10 shows a schematic structural diagram of a smart TV 10 according to some embodiments of the present application.

[0208] As shown in FIG10 , the smart TV 10 may include a processor 110 , a memory 120 , a display screen 130 , a communication module 140 , a power switch 150 , an input / output interface 160 , an audio module 170 , and the like.

[0209] The processor 110 may include one or more processing units. For example, the processor 110 may include a central processing unit (CPU), an application processor (AP), a modem processor, a GPU, an image signal processor (ISP), a microcontroller unit (MCU), a video codec, a digital signal processor (DSP), a baseband processor, a neural network processing unit (NPU), a field programmable gate array (FPGA), etc. In some embodiments, different processing units may be independent devices or integrated into one or more processors.

[0210] In some embodiments, the processor 110 may be configured to execute instructions of the multimedia file playback method provided in the aforementioned embodiments. For example, when looping a multimedia file (e.g., when a looping multimedia file playback instruction is detected), instructions may be provided to continue reading the first frame of the multimedia file after reading the last frame of the multimedia file, instructions may be provided to render the first frame of the multimedia file before the end of the output cycle of the last frame of the multimedia file to obtain output data corresponding to the first frame of the multimedia file, instructions may be provided to synchronize the image output data and the sound output data of the multimedia file after the last frame of the multimedia file is output, and the like.

[0211] The memory 120 can be used to store data and instructions. For example, the memory can be used to store instructions of the multimedia file playing method provided in the above embodiments, store multimedia files, etc.

[0212] The display screen 130 is used to display images, videos, etc. The display screen 130 includes a display panel. In some embodiments, the display screen 130 can be used to output image output data of a multimedia file, such as displaying an image corresponding to the multimedia file.

[0213] The communication module 140 is used to enable communication between the smart TV 10 and other devices. For example, the communication module 140 can be used to obtain a media stream corresponding to a multimedia file from another device, transmit output data corresponding to the multimedia file to another device, and so on.

[0214] In some embodiments, the communication module may include a mobile communication module and a wireless communication module.

[0215] The mobile communication module can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the smart TV 10. The mobile communication module may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module can receive electromagnetic waves from the antenna, filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module can also amplify the signal modulated by the modulation and demodulation processor and convert it into electromagnetic waves for radiation through the antenna. In some embodiments, at least some functional modules of the mobile communication module may be set in the processor 110. In some embodiments, at least some functional modules of the mobile communication module may be set in the same device as at least some modules of the processor 110.

[0216] The wireless communication module can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc., which are applied to the smart TV 10. The wireless communication module can be one or more devices that integrate at least one communication processing module. The wireless communication module receives electromagnetic waves via an antenna, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor. The wireless communication module can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna.

[0217] The power switch 150 is used to turn the smart TV 10 on or off.

[0218] The input and output interface 160 includes interfaces for receiving data from other devices or outputting data (such as audio, video, etc.) to other devices, including but not limited to high definition multimedia interface (HDMI), S / PDIF (Sony / Philips digital interconnect format, Sony TM and Philips TMdigital audio interface protocol developed by the manufacturer), local area network (LAN) interface, universal serial bus (USB) interface, etc.

[0219] In some embodiments, the smart TV 10 can output the output data (such as image output data and sound output data) corresponding to the multimedia file to other output devices connected to the input and output interface 160 (such as a display device, a sound player, etc. connected to the input and output interface) through the input and output interface 160.

[0220] The audio module 170 is used to implement the audio functions of the smart TV 10. The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. For example, the audio module 170 may include a speaker, a microphone, etc. A speaker, also known as a "speaker," is used to convert audio electrical signals into sound signals. The microphone 170, also known as a "microphone," is used to convert sound signals into electrical signals.

[0221] In some embodiments, the smart TV 10 may output the sound output data of the multimedia file through the audio module 170 , for example, playing the sound corresponding to the multimedia file through a speaker.

[0222] In some embodiments, the smart TV 10 may also be configured with a remote control so that the user can control the smart TV 10 to play multimedia files in a loop through the remote control.

[0223] The structure of the smart TV 10 shown in the embodiment of the present application is only an example. In other embodiments, the smart TV 10 may include more or fewer modules, and may also merge or split some modules, which is not limited here.

[0224] An embodiment of the present application also provides a program product, which, when executed on a device, can enable the device to implement the multimedia file playback method provided in the aforementioned embodiments.

[0225] An embodiment of the present application further provides a readable storage medium, which stores instructions. When the instructions are executed by a device, the device implements the multimedia file playback method provided by the aforementioned embodiments.

[0226] An embodiment of the present application further provides a chip or chip system, including a processing module and a communication interface, wherein the processing module is used to implement the multimedia file playback method provided in the aforementioned embodiments.

[0227] In the accompanying drawings, some structural or method features may be shown in a particular arrangement and / or order. However, it should be understood that such a particular arrangement and / or order may not be required. Rather, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the illustrative drawings. In addition, the inclusion of a structural or method feature in a particular figure does not imply that such feature is required in all embodiments, and in some embodiments, such features may not be included or may be combined with other features.

[0228] It should be noted that in the examples and description of this patent, relational terms such as first and second, etc. are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprises" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article, or apparatus that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a" does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.

Claims

1. A multimedia file playing method, characterized in that: include: When the device plays the multimedia file in a loop, the device reads the Kth frame data of the multimedia file in the Kth output cycle, processes the read Kth frame data in the Kth output cycle to the K+Q-1th output cycle, and outputs the output data corresponding to the Kth frame data in the K+Qth output cycle, wherein Q is an integer greater than 0, the multimedia file includes N frames of data, and K is an integer greater than 0 and less than N; The device reads the Nth frame data of the multimedia file in the Nth output cycle, and outputs the output data corresponding to the NQth frame data of the multimedia file; The device reads the first frame data of the multimedia file in the N+1th output cycle, and outputs output data corresponding to the N-Q+1th frame data of the multimedia file; The device reads the Qth frame data of the multimedia file in the N+Qth output cycle, and outputs the output data corresponding to the Nth frame data of the multimedia file; The device reads the Q+1th frame data of the multimedia file in the N+Q+1th output cycle, and outputs output data corresponding to the 1st frame data of the multimedia file.

2. The method according to claim 1, characterized in that The multimedia file is a video file, and the output data corresponding to the first frame data includes first image output data and first audio output data; and The device reads the Q+1th frame data of the multimedia file in the N+Q+1th output cycle, and outputs the output data corresponding to the first frame data of the multimedia file, including: After the device outputs the output data corresponding to the Nth frame data of the multimedia file, the device updates the synchronization reference time, where the synchronization reference time is used to indicate the start playback time of the multimedia file; The device synchronizes the first image data and the first audio data based on the synchronization reference time, and outputs the first image output data and the first audio output data in the N+Q+1th output period.

3. The method according to claim 1 or 2, characterized in that: The device reads the Nth frame data of the multimedia file in the Nth output cycle, including: After reading the Nth frame data of the multimedia file, the device does not report a reading completion message of the multimedia file to the application program that plays the multimedia file.

4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: The device sequentially outputs output data corresponding to the second frame data of the multimedia file to output data corresponding to the Nth frame data of the multimedia file in the N+Q+2th output cycle to the N+Q+Nth output cycle.

5. The method according to claim 1, characterized in that The method further comprises: The device processes the first frame data of the multimedia file from the N+1th output cycle to the N+Qth output cycle to obtain output data corresponding to the first frame data.

6. The method according to claim 5, characterized in that The device processes the first frame data of the multimedia file from the N+1th output cycle to the N+Qth output cycle, at least comprising: The device parses, decodes and renders the first frame data during the N+1th output cycle to the N+Qth output cycle.

7. The method according to any one of claims 1 to 6, characterized in that The device plays the multimedia file through a first application; and the device reads the Nth frame data of the multimedia file in the Nth output cycle, including: The first application reads the Nth frame data of the multimedia file in the Nth output cycle.

8. The method according to claim 7, characterized in that The device reads the first frame data of the multimedia file in the N+1th output cycle, including: The first application reads the first frame data of the multimedia file in the N+1th output cycle.

9. A readable storage medium, characterized in that: The readable storage medium includes instructions, and when the instructions are executed by the device, the device implements the multimedia file playing method according to any one of claims 1 to 8.

10. A device, characterized in that: include: A memory for storing instructions; A processor, configured to execute the instruction so that the device implements the multimedia file playing method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Seamless playing method of multimedia file, terminal device and storage medium

    CN108377409A

  • Media file processing method and device, equipment, readable storage medium and product

    CN113507637A

  • Media file playing method and device, computing equipment and readable storage medium

    CN114157918A

  • Video loop playing processing method and device

    CN115209208A

  • Systems and methods for seamless media creation

    US20160322054A1