Multimedia file playing method, readable storage medium and device

CN119277149BActive Publication Date: 2026-05-29HUAWEI TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUAWEI TECH CO LTD
Filing Date
2023-07-04
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

When the device is playing multimedia files in a loop, the display screen may appear discontinuous, resulting in a degraded user experience. This is because the device needs to process the last frame of the video file before it can start playing the first frame, causing the display screen to have no image displayed during this period.

Method used

When the device is playing a multimedia file in a loop, it reads and processes the data of the next frame in advance, so that the output data of the last frame and the first frame are output continuously in adjacent cycles. By reading the data of the Kth frame in the Kth cycle, outputting the data of the Kth frame in the K+Q-1th cycle, and updating the synchronization reference time in the N+Q+1th cycle, the image and audio are synchronized.

Benefits of technology

It enables seamless looping playback of multimedia files, avoiding stuttering and black/white screens, thus improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119277149B_ABST
    Figure CN119277149B_ABST
Patent Text Reader

Abstract

The application relates to the multimedia technical field and discloses a multimedia file playing method, a readable storage medium and equipment. In the method, when a multimedia file is played in a loop, after the last frame data of the multimedia file is read, the first frame data of the multimedia file is continuously read. Then, before the first output period corresponding to the last frame data of the multimedia file ends, the first frame data of the multimedia file is processed to obtain the first output data corresponding to the first frame data. In this way, the equipment can output the first output data corresponding to the first frame data of the multimedia file in the next output period of the first output period. The last frame data and the first frame data of the multimedia file are continuously read, the output data corresponding to the last frame data and the output data corresponding to the first frame data are continuously output. In this way, seamless loop playing of the multimedia file can be realized, and user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of multimedia technology, and in particular to a multimedia file playback method, a readable storage medium, and a device. Background Technology

[0002] When a device plays a multimedia file, a single frame of data typically needs to undergo sequential processing, 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 it parses that frame into video and audio data; next, it decodes and renders the video and audio data respectively to obtain image and sound output data that can be output to the output device; finally, it synchronizes the image and sound output data before outputting the image data to the display device and the sound data to the playback device. In other words, for any given frame of data, the device needs to go through the aforementioned processes sequentially after reading it before outputting it to the corresponding output device, which takes time.

[0003] Normally, when a device loops multimedia files, such as video files, it typically displays the last frame of the video file before resuming playback. Because the first frame of the video file undergoes this processing before being output to the device's screen, there's no new image to display between the last frame and the first frame. This results in a choppy display when the video file loops, negatively impacting the user experience. Summary of the Invention

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

[0005] A first aspect provides a multimedia file playback method, the method comprising: when a device is playing 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 from 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, 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 the 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 the 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; 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 1st frame data of the multimedia file.

[0006] In this method, when the device is looping through a multimedia file, it reads the last frame and the first frame of the multimedia file in adjacent cycles (the Nth output cycle and the N+1th output cycle), and outputs the corresponding data for the last frame and the first frame in adjacent cycles (the N+Qth output cycle and the N+Q+1th output cycle). Based on this method, during the looping playback of the multimedia file, the output data for the last frame and the first frame are output consecutively in two adjacent output cycles. This avoids stuttering, white screens, or black screens during looping playback, achieving seamless looping playback of multimedia files.

[0007] In one possible implementation of the first aspect above, 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 outputting the output data corresponding to the Nth frame data of the multimedia file, the device updates the synchronization reference time, the synchronization reference time being 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 cycle.

[0008] In other words, after the device outputs the last frame of data (the Nth frame) 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 based on the updated synchronization reference time, avoiding asynchrony between the first image output data and the first audio output data.

[0009] In one possible implementation of the first aspect above, 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 message indicating the end of reading the multimedia file to the application playing the multimedia file.

[0010] It should be understood that the multimedia file read end message is used to instruct the device to stop processing subsequent data after processing the last frame of the multimedia file, thus ending the playback of the multimedia file. If the device does not report the multimedia file read end message to the application playing the multimedia file after reading the Nth frame of the multimedia file, the device can continue processing subsequent data (the first frame of the multimedia file), achieving seamless loop playback of the multimedia file.

[0011] In one possible implementation of the first aspect above, the method further includes: the device sequentially outputting the output data corresponding to the second frame of the multimedia file to the output data corresponding to the Nth frame of the multimedia file from the N+Q+2th output cycle to the N+Q+Nth output cycle.

[0012] In one possible implementation of the first aspect above, the method further includes: the device processes the first frame data of the multimedia file in the N+1th to N+Qth output cycles to obtain the output data corresponding to the first frame data.

[0013] In one possible implementation of the first aspect above, the device processes the first frame data of the multimedia file from the (N+1)th output cycle to the (N+Q)th output cycle, which includes at least: the device parses, decodes, and renders the first frame data from the (N+1)th output cycle to the (N+Q)th output cycle.

[0014] In one possible implementation of the first aspect above, the 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.

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

[0016] In one possible implementation of the first aspect described above, 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.

[0017] In other words, the instructions for the multimedia file playback method provided in this application can be embedded in the first application, so that the first application can play multimedia files using the method provided in this application.

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

[0019] In other words, the instructions for the multimedia file playback method provided in this application can be embedded in the first module (such as the reading and parsing module below), so that applications on the device that play multimedia files can play multimedia files using the method provided in this application through the first module.

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

[0021] The second aspect provides a readable storage medium including instructions that, when executed by a device, cause the device to implement the multimedia file playback method provided in the first aspect and any possible implementation of the first aspect.

[0022] A third aspect provides an apparatus comprising: a memory for storing instructions; and a processor for executing the instructions to enable the apparatus to implement the multimedia file playback method provided in the first aspect and any possible implementation of the first aspect.

[0023] The fourth aspect provides a program product that, when run 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.

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

[0025] 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. Attached Figure Description

[0026] Figure 1 According to some embodiments of this application, a schematic diagram of a scene in which a smart TV 10 plays video in a loop is shown;

[0027] Figure 2A According to some embodiments of this application, a timing diagram of a smart TV 10 looping video playback is shown;

[0028] Figure 2B According to some embodiments of this application, a schematic diagram of the display interface of a smart TV 10 when playing video in a loop is shown.

[0029] Figure 3A According to some embodiments of this application, a timing diagram of another smart TV 10 looping video playback is shown;

[0030] Figure 3B According to some embodiments of this application, a timing diagram of another smart TV 10 looping video playback is shown;

[0031] Figure 4 According to some embodiments of this application, a schematic diagram of the software architecture of a smart TV 10 is shown;

[0032] Figure 5 According to some embodiments of this application, a schematic diagram of another software architecture for a smart TV 10 is shown;

[0033] Figure 6 According to some embodiments of this application, a schematic diagram of a smart TV 10 playing video is shown;

[0034] Figure 7 According to some embodiments of this application, a schematic diagram of a smart TV 10 looping video playback is shown;

[0035] Figure 8 According to some embodiments of this application, a flowchart of a multimedia file playback method is shown;

[0036] Figure 9A According to some embodiments of this application, a schematic diagram is shown of a user triggering a loop playback multimedia command on a smart TV 10;

[0037] Figure 9B According to some embodiments of this application, a schematic diagram is shown of a user triggering a loop playback command for multimedia on a mobile phone 20;

[0038] Figure 10 According to some embodiments of this application, a schematic diagram of the structure of a smart TV 10 is shown. Detailed Implementation

[0039] The illustrative embodiments of this application include, but are not limited to, multimedia file playback methods, readable storage media, and devices.

[0040] It should be understood that the multimedia file playback method provided in this application can be applied to any device capable of playing 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, e-reader devices, smart home devices (such as smart TVs, large screens, projectors, etc.), etc., and this application does not limit the scope of the application. For ease of description, the following description uses a smart TV 10 as an example.

[0041] It should be understood that multimedia files can include, but are not limited to, video files, audio files, etc., and are not limited here. For ease of description, video files will be used as an example below.

[0042] It should be understood that the multimedia files played by the device in the embodiments of this application may be multimedia files stored locally on the device, or multimedia files obtained by the device from other devices in real time, and there is no limitation here.

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

[0044] Figure 1 According to some embodiments of this application, a schematic diagram of a scene in which a smart TV 10 plays video in a loop is shown.

[0045] like Figure 1 As shown, the smart TV 10 can respond to user input and switch to "frame mode" (or, the smart TV will automatically switch to "frame mode" if preset conditions are met), and the smart TV 10 will play the campfire video in a full-screen loop. In some implementations, "frame mode" refers to the function of the smart TV 10 playing a preset video file or a user-selected video file in a full-screen loop through a video playback application.

[0046] It should be understood that Figure 1 The scenario shown is just an example. The technical solution of this application is applicable to any scenario where multimedia files are played in a loop, such as scenarios where video applications, audio playback applications, social applications or other applications play multimedia files in a loop, etc., and is not limited here.

[0047] When a smart TV 10 loops a video, it typically replays the video file after outputting the last frame (e.g., after displaying the image corresponding to the last frame of the video file). The first frame of the video file, however, needs to undergo reading, parsing, decoding, and rendering before the corresponding image (hereinafter referred to as the first frame) can be obtained and output to the smart TV 10's display. Therefore, between the output of the last frame and the display of the first frame, the device's screen has no new image to display, resulting in an uncoordinated display on the smart TV 10.

[0048] For example, suppose Figure 1 The campfire video shown includes N frames of data, see reference. Figure 2A During the period from time T0 to time T1, the smart TV 10 sequentially reads, parses, decodes, and renders the Nth frame of data to obtain the Nth frame of output data (for example, the Nth frame of data corresponds to the Nth frame of image and the Nth segment of sound). During the period 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).

[0049] After the Nth frame of the image is displayed at time T2, Smart TV 10 triggers the replay of the campfire video. At time T3, Smart TV 10 completes the initialization of the video playback application. Between time T3 and T4, it sequentially reads, parses, decodes, and renders the first frame of the campfire video data to obtain the first frame output data (e.g., the first frame image and the first audio segment). Between time T4 and T5, Smart TV 10 displays the first frame image and plays the first audio segment (i.e., outputs the first frame output data).

[0050] In other words, from time T2 to time T4, the smart TV 10 has no images to display and no sounds to play, which will cause the images displayed or the sounds played by the smart TV 10 to be inconsistent, affecting the user experience.

[0051] For example, refer to Figure 2B If the smart TV 10 continues to display the Nth frame during time T2 to T4, and then displays the 1st frame during time T4 to T5, the smart TV 10 will display the same image during time T2 to T4, causing the smart TV 10 to freeze and stutter.

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

[0053] To avoid discontinuity issues during the looping playback of multimedia files, this application provides a multimedia file playback method. In this method, when the device loops a multimedia file, after reading the last frame of the multimedia file, it continues to read the first frame. Then, before the end of the output cycle corresponding to the last frame (hereinafter referred to as the first output cycle), the device processes the first frame to obtain the first output data. Thus, the device can output the first output data corresponding to the first frame in the next output cycle (hereinafter referred to as the second output cycle).

[0054] Because the device doesn't need to wait for the last frame of a multimedia file to finish outputting before starting to read the first frame, the last and first frames are read consecutively, and the output data corresponding to the last and first frames is output consecutively. This avoids discontinuities during looped playback, achieving seamless looping and improving the user experience.

[0055] It should be understood that the processing of multimedia files by the device is divided into multiple steps, each of which can occupy one output cycle, or multiple steps can occupy one output cycle. Assuming that the processing of one frame of data by the device occupies Q (Q≥1) output cycles, if the device reads a frame of data in the Kth output cycle, it will output the corresponding data in the K+Qth output cycle. For example, if the processing of one frame of data in a multimedia file is divided into four steps: reading, parsing, decoding, and rendering, with each step occupying one output cycle, then Q=4.

[0056] For example, Figure 3A According to some embodiments of this application, a timing diagram of another smart TV 10 looping video playback is shown.

[0057] Assumption Figure 1 In the scenario shown, the campfire video played by Smart TV 10 consists of N frames of data. Smart TV 10 processes each frame of data in four steps: reading, parsing, decoding, and rendering. Each step occupies one output cycle, i.e., Q=4. For example... Figure 3A As shown:

[0058] 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-3rd frame data, and outputs the output data corresponding to the N-4th frame data.

[0059] At time t1, the smart TV 10 detects that the last frame of the campfire video has been read and triggers replay of the video. In some embodiments, the smart TV 10 may detect that the last frame of the campfire video has been read when it reads the end marker of the campfire (e.g., end of segment (EOS) marker), and then continue reading the first frame of the campfire video. In other embodiments, the smart TV 10 may also detect that the last frame of the campfire video has been read in other ways, which are not limited here.

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

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

[0062] During the period from time t3 to time t4 (the P+3rd 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 the output data corresponding to the N-1th frame data.

[0063] During the period from time t4 to time 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.

[0064] At time t5, the Smart TV 10 detects that the last frame of the video data has been output and updates the synchronization reference time for the image and audio output data to synchronize the output image and audio. 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 from second 0, the synchronization reference time is 0 seconds; if it starts playing from second 5, the synchronization reference time is 5 seconds. The specific method by which the Smart TV 10 synchronizes the image and audio output data will be described below and will not be limited here.

[0065] During the period from time t5 to time 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.

[0066] It should be understood that when the Smart TV 10 outputs the output data corresponding to a certain frame, it can synchronize the image output data and the sound output data corresponding to that frame before outputting them.

[0067] Based on the above method, compared to Figure 2A The process shown involves the Smart TV 10 reading the first frame of the campfire video after reading the Nth frame (i.e., the Nth and first frames are read in adjacent input cycles), instead of waiting until the Nth frame is output before reading the first frame. This allows the Smart TV 10 to obtain the output data corresponding to the first frame before the output cycle for the Nth frame ends, enabling it to output the data corresponding to the Nth frame and the number of frames corresponding to the first frame in adjacent output cycles. Consequently, the Smart TV 10 can seamlessly loop the video without display stuttering or black / white screens, improving the user experience.

[0068] It should be understood that when outputting multimedia files, the device can output the multimedia files periodically, for example, outputting one frame of data from the multimedia file in one output cycle.

[0069] For example, for a video file, a frame of data may include a frame of image data and the corresponding audio data. The output period may be the reciprocal of the video file's frame rate, the reciprocal of the frame rate of the image synthesized by the device, or the reciprocal of the refresh rate of the image displayed by the device. For example, if the video file's frame rate is 60Hz (or other data, which is not limited here), or the device's frame rate of the image synthesized is 60Hz (or other data, which is not limited here), or the device's refresh rate of the image displayed is 60Hz (or other data, which is not limited here), then the output period may be 1 / 60 = 16.67ms.

[0070] For example, for an audio file, a frame of data may include at least one sampled data. The output period may be K times the reciprocal of the audio file's sampling rate (K≥1). For example, if the audio file's sampling rate is 44000Hz (or other data, which is not limited here), then the output period may be K×(1 / 44000) = K×0.0227ms.

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

[0072] It should be understood that when the device outputs the output data of the multimedia file, the multimedia file can be output through the output device of the device itself (such as the display screen, projection device, speaker, etc. of the device itself), or through other output devices connected to the device, which is not limited herein.

[0073] It should be understood that dividing the processing of the multimedia file by the device into four steps: reading, parsing, decoding, and rendering in the embodiments of the present application is only an example. In other embodiments, the processing of the multimedia file by the device can also be divided into more or fewer sequentially executed steps, or some steps can be merged, which is not limited herein.

[0074] It should be understood that the four steps of reading, parsing, decoding, and rendering a frame of data of the multimedia file in the above embodiments each occupying one output cycle is only an example. In other embodiments, each of the four steps can also only occupy a part of the duration of one output cycle; if the total processing duration of two or more steps is less than one output cycle, two or more steps can also be merged and executed in one output cycle, which is not limited herein.

[0075] For example, Figure 3B According to some embodiments of the present application, a timing schematic diagram of another intelligent TV 10 for loop-playing a video is shown.

[0076] Referring to Figure 3B , compared with Figure 3A the situation shown, the intelligent TV 10 combines the reading and parsing of a frame of data into one step, that is, divides the processing of a frame of data of the video file by the intelligent TV 10 into three steps: reading and parsing, decoding, and rendering. Each step occupies one output cycle, that is, the aforementioned Q = 3. As Figure 3B shown:

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

[0078] At time t8, the intelligent TV 10 detects that it has read the last frame of the video and triggers the re-playing of the video.

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

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

[0081] In t 10 Time to t 11 During the time period (the P+Qth output cycle (i.e. the first output cycle)), the smart TV 10 reads and 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.

[0082] In t 11 At that 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 audio data in order to synchronize the output image and sound.

[0083] 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.

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

[0085] Reading refers to retrieving data from a multimedia file frame by frame from the memory of the smart TV 10 or from other devices. For example, for a multimedia file stored locally on the smart TV 10, the smart TV 10 can read the data from the storage location of the multimedia file frame by frame. As another example, for a multimedia file acquired in real time from other devices, the smart TV 10 can read the data from the corresponding cache of the multimedia file frame by frame.

[0086] Parsing refers to the process of separating the data of a multimedia file into video elementary streams (ES) and / or audio ES. If the multimedia file includes video data but not audio data, then parsing the multimedia file will yield a video ES; if the multimedia file includes audio data but not video data, then parsing the multimedia file will yield a single-stream ES; if the multimedia file includes both video and audio data, then parsing the multimedia file will yield both video and audio ES.

[0087] Decoding refers to decoding multimedia video ES and / or audio ES into coded data that can be rendered. For example, video ES can be decoded to obtain YUV encoded data (a color encoding method, but other types of encoding methods are not limited here). Similarly, audio ES can be decoded to linear pulse code modulation (LPCM) data (an uncompressed audio digitization method, but other methods such as pulse code modulation are not limited here).

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

[0089] The following is combined with Figure 1 and Figure 3A , Figure 3B The technical solution of this application is described in the following description.

[0090] To make it easier to understand, we will first introduce the software architecture of Smart TV 10.

[0091] Figure 4 According to some embodiments of this application, a schematic diagram of the software architecture of a smart TV 10 is shown.

[0092] like Figure 4 As shown, the software architecture of the smart TV 10 includes the application layer 01, the framework layer 02, the hardware abstraction layer (HAL) 03, the kernel layer 04, etc.

[0093] Application layer 01 includes the applications in the smart TV 10.

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

[0095] The read and parse module 012 is used to read data from multimedia files and parse the read data. For example, in the case of a video file, the read and parse module 012 can read the media stream of the video file and parse the media stream to obtain the corresponding video ES and audio ES. Then, the video ES is sent to the video decoder 022 and the audio ES is sent to the audio decoder 023.

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

[0097] In some embodiments, when the first application 011 is playing a multimedia file in a loop, after the reading and parsing module 012 has finished reading the last frame data of the multimedia file in one output cycle, it can read the first frame data of the multimedia file in the next output cycle.

[0098] It should be understood that, in the absence of looping playback of multimedia files (e.g., when no looping playback instruction is detected), the reading and parsing module 012, after reading the last frame of data of the multimedia file, can report a message indicating the end of reading to the application playing the multimedia file (e.g., the first application 011). This message instructs the video decoder 022, audio decoder 023, graphics processing unit (GPU) HAL 032, hardware composer (HWC) HAL 034, and audio HAL 033 modules to cease processing subsequent data after processing the last frame of data in the multimedia file, thus ending playback of the multimedia file.

[0099] 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 configured at the same layer, for example, in each first application 011, in the playback subsystem and service 021, in the hardware abstraction layer 03, or in the kernel layer 04. Alternatively, the reading module and the parsing module can be configured at different layers; for example, the reading module can be configured in the first application 011, and the parsing module can be configured in the playback subsystem and service 021, etc. This application does not limit the location of the reading module and the parsing module in its embodiments.

[0100] User interface 013 is used to display the interface of the first application 011 on the smart TV 10.

[0101] Playback control 014 is used to control the playback of multimedia files based on user operations. For example, playback control 014 can perform actions such as pausing, fast forwarding, rewinding, adjusting the progress, or adjusting the playback mode (e.g., single playback, loop playback, etc.) based on user operations.

[0102] In some embodiments, the playback control 014 may send a loop playback command to the reading and parsing module 012 in response to a user's operation of adjusting the playback mode of a multimedia file to loop playback. The reading and parsing module 012 may, in response to the loop playback command, continue reading the first frame of the multimedia file after reading the last frame.

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

[0104] Framework layer 02 provides application programming interfaces (APIs) and programming frameworks for applications in application layer 01. Framework layer 02 includes some predefined functions. For example, the framework layer may include a playback subsystem and services 021, graphics rendering 027, audio rendering 028, and a system clock 029.

[0105] The playback subsystem and service 021 provide the application layer 01 with the ability to play multimedia files. In some embodiments, the playback subsystem and service 021 includes a video decoder 022, an audio decoder 023, a synchronization mechanism 024, a video output 025, and an audio output 026.

[0106] The video decoder 022 provides video decoding capabilities for application layer applications. For example, the video decoder 022 can, based on the video ES sent by the reading and parsing module 012, call the decoder HAL 031 and / or the graphics processor HAL 032 to decode the video ES, obtaining YUV encoded data. Exemplarily, 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.

[0107] Audio decoder 023 provides audio decoding capabilities for applications in application layer 01. For example, audio decoder 023 can call audio HAL 033 to decode the audio ES sent by reading and parsing module 012 to obtain LPCM encoded data. Exemplarily, 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).

[0108] Video Output 025 is used to call Video Output 043 in kernel layer 04 to output the image output data of multimedia files to the display screen.

[0109] Audio output 026 is used to call audio output 044 in kernel layer 04 to output the sound output data of multimedia files to the playback device (such as speakers, loudspeakers, etc.).

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

[0111] It should be understood that the synchronization reference time can be the start time of a multimedia file. For example, for a 10-second video file, if the smart TV 10 is playing data from second 0 to second 10 of the video file, the synchronization reference time is 0 seconds; if the smart TV 10 is playing data from second 5 to second 10 of the video file, the synchronization reference time is 5 seconds.

[0112] 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 played time t_p, i.e., t_t = t_ref + t_p. Synchronization 024 can update the synchronization reference time to t_ref and set t_p to 0 after outputting the last frame of the multimedia file. For example, assuming the synchronization reference time is 5 seconds, Synchronization 024 can update the synchronization reference time to 5 seconds and reset the played time to 0 seconds after outputting the last frame of the multimedia file.

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

[0114] 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, adjust the video output data based on the timestamp of the audio output data, or adjust both the video output data and audio output data simultaneously based on an external time.

[0115] 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.

[0116] It should be understood that in some other embodiments, the synchronization 024 may also synchronize the image output data and the sound output data not based on the timestamps of each frame of output data, but 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 to synchronize 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.

[0117] 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.

[0118] 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.

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

[0120] 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.

[0121] 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.

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

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

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

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

[0126] 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.

[0127] Kernel layer 04 is the layer between hardware and software. Kernel layer 04 can also be called the driver layer. Kernel layer 04 may include video driver 041, audio driver 042, video output 043, audio output 044, etc.

[0128] Video driver 041 is used to respond to calls from video decoder 022, image processor HAL 032, decoder HAL 031, and hardware hybrid renderer HAL 034 to parse, decode, and render video data.

[0129] Audio driver 042 is used to respond to calls from audio decoder 023 and audio HAL 033 to parse, decode, and render audio data.

[0130] Video Output 043 is used in response to the call of Video Output 025 to output the image output data of the multimedia file to the corresponding display device.

[0131] Audio Output 044 is used in response to the call of Audio Output 026 to output the audio output data of the multimedia file to the corresponding playback device.

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

[0133] It should be understood that Figure 4 The software architecture of the smart TV 10 shown is just an example. In other embodiments, the architecture of the mobile phone 10 may include more or fewer layers / modules, or some modules may be merged or split, or the position of some modules may be adjusted. This is not limited here.

[0134] For example, Figure 5 According to some embodiments of this application, a schematic diagram of another software architecture for a smart TV 10 is shown. For example... Figure 5 As shown, compared to Figure 4 In the software architecture shown, the reading and parsing module 012 is not embedded in the first application 011, but is located in the playback subsystem and service 021 of the framework layer 02. Thus, when the smart TV 10 is looping a multimedia file in any application, it can achieve seamless looping playback of the multimedia file based on the reading and parsing module 012.

[0135] It should be understood that in some other embodiments, the reading and parsing module 012 may also be located 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 are not limited here.

[0136] Below, in conjunction with Figure 4 The software architecture shown illustrates the technical solution of this application.

[0137] To make it easier to understand, let's first introduce the process of playing video files on a smart TV 10.

[0138] Figure 6 According to some embodiments of this application, a schematic diagram of a smart TV 10 playing video is shown.

[0139] like Figure 6 As shown, the process includes the following steps:

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

[0141] 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.

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

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

[0144] In some embodiments, when the current frame data is the last frame data of a multimedia file and the smart TV 10 is not looping the multimedia file, the reading and parsing module 012 can report a reading completion message to the application playing the multimedia file (e.g., the first application 011) after reading the current frame data. This reading completion message instructs 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, thus ending the playback of the multimedia file.

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

[0146] The reading and parsing module 012 parses the 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 audio decoder 023 respectively.

[0147] In some embodiments, if the smart TV 10 is playing an audio file, the reading and parsing module 012 can generate only the 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 and no sound, the reading and parsing module 012 can also generate only the video ES and send the video ES to the video decoder 022.

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

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

[0150] In some embodiments, when the smart TV 10 is playing a multimedia file in a loop, the previous frame data can be the last frame data of the multimedia file when the current frame data is the first frame data of the multimedia file.

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

[0152] Secondly, the video ES and audio ES are decoded.

[0153] For example, video decoder 022 decodes video ES to obtain corresponding YUV encoded data, and audio decoder 023 decodes audio ES to obtain LPCM encoded data.

[0154] In some embodiments, the video decoder 022 can read the video ES from the output buffer corresponding to the reading and parsing module 012, decode it, 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, decode it, and store the decoded LPCM encoded data in the output buffer corresponding to the audio decoder 023.

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

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

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

[0158] Next, the YUV encoded data and LPCM data are rendered.

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

[0160] In some embodiments, the graphics processor HAL 032 and / or the hardware hybrid 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.

[0161] In some embodiments, the graphics processor HAL 032 and / or the hardware hybrid renderer HAL 034 can 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. Similarly, the audio processor HAL 033 can store the audio output data of the current frame in the video output buffer after the audio output data corresponding to the previous frame data stored in the audio output buffer has been output.

[0162] Finally, after synchronizing the image output data and audio data by sync 024, the image output data and audio output data are output to the corresponding output devices by video output 025 and audio output 026 respectively.

[0163] 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 sound field of smart TV 10 or audio output devices connected to smart TV 10.

[0164] based on Figure 6 The illustrated embodiment, with reference to Figure 7 When the Smart TV 10 is playing a multimedia file that includes N frames of data in a loop (for example, when an instruction to play a multimedia file that includes N frames of data in a loop is detected), it can achieve seamless loop playback of the multimedia file through the following steps:

[0165] S1, after reading the Nth frame of data, the parsing module 012 continues to read the 1st frame of data.

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

[0167] In some embodiments, after reading the Nth frame of data, the reading and parsing module 012 does not report a message indicating the end of reading to the first application 011. Thus, after reading the first frame of data, the video decoder 022, audio decoder 023, graphics processor HAL 032, hardware hybrid renderer HAL 034, and audio HAL 033 modules will each continue processing the first frame of data after processing the Nth frame, obtaining the output data corresponding to the first frame. The specific processing procedure can be found in [reference needed]. Figure 6 The embodiments shown are not described in detail here.

[0168] S2, after outputting the Nth frame of the image, update the synchronization reference time.

[0169] After outputting the Nth frame image, Synchronization 024 updates the synchronization reference time to regenerate the timestamps of the output data for each frame. Thus, after the image output data (the first frame image) and audio output data (the first sound segment) corresponding to the first frame data are generated, Synchronization 024 can perform synchronization based on the timestamps of the first frame image and the first sound segment.

[0170] 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 played time t_p, i.e., t_t = t_ref + t_p. Synchronization 024 can update the synchronization reference time to t_ref and set t_p to 0 after outputting the last frame of data in the multimedia file. For example, assuming the synchronization reference time is 5s, Synchronization 024 can update the synchronization reference time to 5s and reset the played time to 0 seconds after outputting the last frame of data in the multimedia file.

[0171] S3, 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; Audio output 026 outputs the Nth sound segment in the first output cycle and then outputs the 1st sound segment in the second output cycle.

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

[0173] Based on the above method, the smart TV 10 can achieve seamless loop playback of multimedia files, avoiding discontinuous display of images or sound on the smart TV 10.

[0174] Below, in conjunction with Figure 1 , Figure 3A and Figure 3B The situation shown is as follows: Figure 4 The software architecture shown is Figure 6 and Figure 7 The process of playing a video file on the smart TV 10 shown illustrates the technical solution of this application.

[0175] Figure 8 According to some embodiments of this application, a flowchart illustrating a multimedia file playback method is shown. Figure 8 As shown, the method includes the following steps:

[0176] S801: An instruction to loop a multimedia file has been detected.

[0177] When the smart TV 10 detects an instruction to play a multimedia file in a loop, it triggers the multimedia file playback method provided in this application embodiment.

[0178] For example, when the smart TV 10 detects that the user has enabled the aforementioned "frame mode" operation, or when the smart TV 10 automatically switches to "frame mode", the smart TV 10 can detect the instruction to loop the playback of multimedia files.

[0179] For example, after a user selects the operation of looping video playback on the display interface of the first application 011 on the smart TV 10, the smart TV 10 can detect the instruction to loop the multimedia file. For example, refer to Figure 9A The smart TV 10 can display a video settings window in response to user operation, and the playback mode window will be displayed after the user selects the "playback mode" option 91. After detecting the user's selection of the "single loop" option 92, the smart TV 10 can detect the instruction to loop the multimedia file.

[0180] It should be understood that in other embodiments, the device may also detect instructions to loop multimedia files in other situations, which is not limited here.

[0181] For example, some applications automatically loop through multimedia files displayed on a specific part of the screen by default. When the user switches to that part of the application's screen, the device can detect the instruction to loop the multimedia file. (Reference) Figure 9B The social information of "User A" displayed on the social application screen of mobile phone 20 includes video playback control 93. When the user switches to this screen, smart TV 10 can detect the instruction to loop the multimedia file.

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

[0183] For example, the smart TV 10 can use the aforementioned reading and parsing module 012 to continue reading the first frame of the multimedia file after reading the last frame. In other words, the last frame and the first frame of the multimedia file are read consecutively.

[0184] For example, corresponding to Figure 3A As shown, the reading and parsing module 012 finishes reading the Nth frame of the multimedia file (i.e., the last frame) at time t1, and then continues to read the first frame of the multimedia file.

[0185] For example, corresponding to the situation shown in 3B, the reading and parsing module 012 finishes reading the Nth frame data (i.e. the last frame data) of the multimedia file at time t8, and continues to read the first frame data of the multimedia file.

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

[0187] In some embodiments, after reading the EOS tag of a multimedia file, the smart TV 10 can determine that it has finished reading the last frame of the multimedia file and continue reading the first frame of the multimedia file.

[0188] It should be understood that when a multimedia file is being played in a loop (e.g., when a loop playback command is detected), the reading and parsing module 012 does not report a message indicating the end of reading to the application playing the multimedia file after reading the last frame of data. 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, and audio HAL 033 modules will each continue processing the first frame of data after processing the last frame of data.

[0189] It should be understood that after reading the first frame of a multimedia file, the Smart TV 10 will continue to read, parse, decode, render, and output the remaining frames of the multimedia file sequentially. The processing procedure for each frame of data on the Smart TV 10 can be found by referring to... Figure 6 The embodiments shown are not intended to be limiting.

[0190] S803: Outputs the last frame of the multimedia file in the first output cycle, and processes the first frame of data before the end of the first output cycle to obtain the first output data corresponding to the first frame of data.

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

[0192] For example, after the smart TV 10 stores 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 using the reading and parsing module 012, it can process the first frame data to obtain the first output data corresponding to the first frame data in the following way:

[0193] For the video element (ES), the video decoder 022 reads the video ES from the output buffer corresponding to the reading and parsing module 012, decodes it, 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 the image output data corresponding to the multimedia file, and stores the image output data in the video output buffer.

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

[0195] In other words, if the multimedia file includes both video 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.

[0196] For example, for Figure 3A As shown, the smart TV 10 can output the Nth frame of data during the period from time t4 to time t5 (i.e., the first output cycle). During the period from time t1 to time t5, it sequentially reads, parses, decodes, and renders the first frame of the multimedia file to obtain the first output data corresponding to the first frame.

[0197] For example, regarding Figure 3B As shown, the smart TV 10 can... 10 Time to t 11 During the time period (i.e., the first output cycle), the Nth frame of data is output. And from time t8 to t... 11 During the time period, the first frame of the multimedia file is read, parsed, decoded, and rendered sequentially to obtain the output data corresponding to the first frame.

[0198] It should be understood that after the Smart TV 10 outputs the last frame of a multimedia file, it can also update the synchronization reference time so that Synchronization 024 can synchronize the first frame of the multimedia file with the correct reference time to the corresponding image and sound output data. For example, assuming the synchronization reference time is 5 seconds, Synchronization 024 can update the synchronization reference time to 5 seconds and reset the played time to 0 seconds after outputting the last frame of the multimedia file.

[0199] S804: Output the first output data in the second output cycle, where the second output cycle is the output cycle following the first output cycle.

[0200] The smart TV 10 outputs the first output data in the next output cycle after the first output cycle.

[0201] For example, for Figure 3A As shown, the smart TV 10 can output the output data (first output data) corresponding to the first frame data during the period from time t5 to time t6 (i.e., the second output cycle).

[0202] For example, regarding Figure 3B As shown, the smart TV 10 can... 11 Time to t 12 During the time period (i.e., the second output cycle), the output data corresponding to the first frame of data (the first output data) is output.

[0203] 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 the subsequent output cycles.

[0204] Using the method provided in this application, when the smart TV 10 is playing 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 the first output data corresponding to the first frame, and outputs the first output data in the second output cycle. In this way, seamless loop playback of multimedia files can be achieved.

[0205] further, Figure 10 According to some embodiments of this application, a schematic diagram of the structure of a smart TV 10 is shown.

[0206] like Figure 10 As shown, 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, etc.

[0207] Processor 110 may include one or more processing units. For example, 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.

[0208] In some embodiments, the processor 110 can be used to execute instructions for the multimedia file playback method provided in the foregoing embodiments. For example: when looping a multimedia file (e.g., when a looping multimedia file playback instruction is detected), instructions to continue reading the first frame of the multimedia file after reading the last frame of the multimedia file; instructions to render the first frame of the multimedia file to obtain the output data corresponding to the first frame of the multimedia file before the end of the output cycle of the last frame of the multimedia file; instructions to synchronize the image output data and sound output data of the multimedia file after the last frame of the multimedia file has been output, etc.

[0209] The memory 120 can be used to store data and instructions. For example, the memory can be used to store instructions for the multimedia file playback method provided in the foregoing embodiments, and to store multimedia files, etc.

[0210] 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.

[0211] 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 the media stream corresponding to a multimedia file from other devices, and to transmit the output data corresponding to a multimedia file to other devices.

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

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

[0214] The wireless communication module can provide solutions for wireless communication applications on the smart TV 10, 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), and infrared (IR) technologies. The wireless communication module can be one or more devices integrating at least one communication processing module. The wireless communication module receives electromagnetic waves via an antenna, modulates and filters the electromagnetic wave signals, and sends the processed signal to the processor. The wireless communication module can also receive signals to be transmitted from the processor 110, modulate and amplify them, and then convert them into electromagnetic waves for radiation via the antenna.

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

[0216] Input / output interface 160 includes interfaces for receiving data from or outputting data (e.g., audio, video, etc.) to other devices, including but not limited to High Definition Multimedia Interface (HDMI) and S / PDIF (Sony / Philips Digital Interconnect Format, manufactured by Sony). TM and Philips TMThe developed interfaces include digital audio interface protocols, local area network (LAN) interfaces, and universal serial bus (USB) interfaces.

[0217] In some embodiments, the smart TV 10 can output the output data (e.g., image output data and sound output data) corresponding to the multimedia file to other output devices (e.g., display devices, playback devices, etc. connected to the input / output interface 160) through the input / output interface 160.

[0218] 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 signals for output, and also to convert analog audio input into digital audio signals. The audio module 170 can also be used for encoding and decoding audio signals. For example, the audio module 170 may include a speaker, a microphone, etc. A speaker, also called a "loudspeaker," is used to convert audio electrical signals into sound signals. A microphone 170, also called a "microphone" or "voice transducer," is used to convert sound signals into electrical signals.

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

[0220] In some embodiments, the smart TV 10 may also be equipped with a remote control, so that users can control the smart TV 10 to loop multimedia files using the remote control.

[0221] The structure of the smart TV 10 shown in this application embodiment is only an example. In other embodiments, the smart TV 10 may include more or fewer modules, or some modules may be merged or split, which is not limited here.

[0222] This application also provides a program product that, when executed on a device, enables the device to implement the multimedia file playback methods provided in the foregoing embodiments.

[0223] This application also provides a readable storage medium storing instructions that, when executed by a device, enable the device to implement the multimedia file playback method provided in the foregoing embodiments.

[0224] This application also 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 foregoing embodiments.

[0225] In the accompanying drawings, some structural or methodological features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order may not be necessary. Rather, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the illustrative drawings. Furthermore, the inclusion of structural or methodological features in a particular figure does not imply that such features are required in all embodiments, and in some embodiments, these features may be omitted or may be combined with other features.

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

Claims

1. A method for playing multimedia files, characterized in that, include: When the device plays a multimedia file in a loop, the device reads the Kth frame data of the multimedia file in the Kth output cycle. From the Kth output cycle to the K+Q-1th output cycle, the device sequentially performs parsing, decoding and rendering processing on the read Kth frame data. In the K+Qth output cycle, the device outputs the output data corresponding to the Kth frame data, where 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. After reading the Nth frame data of the multimedia file, the device does not report the end of reading of the multimedia file to the application playing the multimedia file. The device reads the first frame data of the multimedia file in the N+1th output cycle and outputs the output data corresponding to the N-Q+1th frame data of the multimedia file. The device reads the Q-th frame data of the multimedia file in the N+Q-th output cycle and outputs the output data corresponding to the N-th 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 the output data corresponding to the 1st frame data of the multimedia file. The output data corresponding to the 1st frame data is obtained by the device sequentially parsing, decoding and rendering the read 1st frame data in the N+1th to N+Qth output cycles.

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+1)th frame data of the multimedia file in the (N+Q+1)th 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 of the multimedia file, it updates the synchronization reference time, which 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 cycle.

3. The method according to claim 1 or 2, characterized in that, The method further includes: The device sequentially outputs the output data corresponding to the second frame of the multimedia file to the output data corresponding to the Nth frame of the multimedia file from the N+Q+2th output cycle to the N+Q+Nth output cycle.

4. The method according to claim 1, characterized in that, The method further includes: The device processes the first frame data of the multimedia file during the (N+1)th to (N+Q)th output cycles to obtain the output data corresponding to the first frame data.

5. The method according to claim 4, characterized in that, The device processes the first frame data of the multimedia file during the (N+1)th output cycle to the (N+Q)th output cycle, including at least: The device reads the data of the first frame in the (N+1)th output cycle and performs parsing, decoding and rendering in the (N+Q)th output cycle.

6. The method according to any one of claims 1 to 2 or 4 to 5, 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 during the Nth output cycle.

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

8. A readable storage medium, characterized in that, The readable storage medium includes instructions that, when executed by the device, cause the device to implement the multimedia file playback method according to any one of claims 1 to 7.

9. An electronic device, characterized in that, include: Memory, used to store instructions; A processor for executing the instructions to cause the electronic device to implement the multimedia file playback method according to any one of claims 1 to 7.