CN117914834A - Multimedia file playing method and device and electronic equipment - Google Patents

Multimedia file playing method and device and electronic equipment Download PDF

Info

Publication number
CN117914834A
CN117914834A CN202311676880.XA CN202311676880A CN117914834A CN 117914834 A CN117914834 A CN 117914834A CN 202311676880 A CN202311676880 A CN 202311676880A CN 117914834 A CN117914834 A CN 117914834A
Authority
CN
China
Prior art keywords
sub
thread
target data
target
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311676880.XA
Other languages
Chinese (zh)
Inventor
朱宗花
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hisense Visual Technology Co Ltd
Original Assignee
Hisense Visual Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hisense Visual Technology Co Ltd filed Critical Hisense Visual Technology Co Ltd
Priority to CN202311676880.XA priority Critical patent/CN117914834A/en
Publication of CN117914834A publication Critical patent/CN117914834A/en
Pending legal-status Critical Current

Links

Landscapes

  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The disclosure relates to the technical field of multimedia playing, in particular to a method, a device and electronic equipment for playing a multimedia file, which are used for solving the problem of how to reduce the playing time of video in an ISOBMFF format. The method comprises the following steps: responding to the selection operation of playing the multimedia file with the video format being the international standardization organization basic media file format, and acquiring the multimedia data of the multimedia file through a first sub-thread; controlling a first sub-thread to analyze the multimedia data, and downloading at least one piece of audio stream information and at least one piece of video stream information in the first target data through the first sub-thread when the first sub-thread is positioned to the position information of the first target data for storing the media information; a target operation is performed on each video stream information and each audio stream information.

Description

Multimedia file playing method and device and electronic equipment
Technical Field
The disclosure relates to the technical field of multimedia playing, and in particular relates to a method and a device for playing a multimedia file and electronic equipment.
Background
Currently, the international organization for standardization basic media file format (International Organization for Standardization Base MEDIA FILE format, ISOBMFF)) format video, all data stored in the box. The box types include stts, ctts, stco/co64, stsc, stsz, moov and the like. When the electronic device plays the video in the ISOBMFF format, a display time stamp (Presentation TIME STAMP, PTS) and a Decoding time stamp (Decoding TIME STAMP, DTS) of each frame can be obtained based on the box of the type stts and the box of the type ctts; based on the box of type stco/co64, the box of type stsc, the box of type stsz, an offset of each frame (representing the offset of the frame in the multimedia file, based on which the frame can be found) can be obtained. After that, the electronic device stores information such as PTS, DTS, and offset in the frame index table.
In this process, the electronic device needs to create a large number of frame index tables, and download corresponding video data and audio data to the media server based on the frame index tables, for example: 2.5 hours of video in ISOBMFF format, if the video has a video frame rate of 25fps, an audio sampling rate of 48khz, and an audio coding format of advanced audio coding (Advanced Audio Coding, AAC) (each frame contains 1024 samples), the total number of audio frames and video frames to be parsed is:
It can be seen that, when the electronic device plays the video in the ISOBMFF format, 646875 frame index tables need to be constructed, and as the duration of the video increases, the frame index table that the electronic device needs to create also increases greatly, so that the time for constructing the frame index table also increases greatly, and the time for playing when the electronic device plays the video in the ISOBMFF format also increases.
Therefore, how to reduce the play-up time of video in the ISOBMFF format is a urgent problem to be solved.
Disclosure of Invention
In order to solve the technical problems, the present disclosure provides a method, an apparatus and an electronic device for playing a multimedia file.
The technical scheme of the present disclosure is as follows:
In a first aspect, the present disclosure provides a display apparatus comprising: a processor configured to control the communicator to acquire multimedia data of the multimedia file through the first sub-thread in response to a selection operation of playing the multimedia file in a video format that is an international organization for standardization basic media file format; the first sub-thread is a sub-thread for decapsulating the multimedia data; the processor is further configured to control the first sub-thread to analyze the multimedia data acquired by the communicator, and when the first sub-thread is positioned to the position information of the first target data for storing the media information, at least one piece of audio stream information and at least one piece of video stream information in the first target data are downloaded through the first sub-thread; the processor is further configured to perform a target operation for each video stream information and each audio stream information: the target operation comprises the steps of controlling a first sub-thread to analyze target information, and creating a second sub-thread when analyzing second target data containing a sample sequence number, time or file position mapping; controlling a second sub-thread to analyze second target data, and establishing a frame index table corresponding to target information based on the analyzed second target data; or when the first sub-thread analyzes to the first second target data, recording the starting position and the ending position of the second target data, creating the second sub-thread and continuously downloading other target data; the second sub-thread is controlled to download second target data according to the starting position and the ending position, the second sub-thread is controlled to analyze all the second target data, and a frame index table corresponding to target information is established based on the analyzed second target data; the target information comprises any one of video stream information and audio stream information, and different video stream information and different audio stream information correspond to different second sub-threads; the processor is further configured to control the first sub-thread to read video frames and audio frames based on the frame index table and play the video frames and the audio frames.
In a second aspect, the present disclosure provides a method for playing a multimedia file, including: responding to the selection operation of playing the multimedia file with the video format being the international standardization organization basic media file format, and acquiring the multimedia data of the multimedia file through a first sub-thread; the first sub-thread is a sub-thread for decapsulating the multimedia data; controlling a first sub-thread to analyze the multimedia data, and downloading at least one piece of audio stream information and at least one piece of video stream information in the first target data through the first sub-thread when the first sub-thread is positioned to the position information of the first target data for storing the media information; performing a target operation on each video stream information and each audio stream information: the target operation comprises the steps of controlling a first sub-thread to analyze target information, and creating a second sub-thread when analyzing second target data containing a sample sequence number, time or file position mapping; controlling a second sub-thread to analyze second target data, and establishing a frame index table corresponding to target information based on the analyzed second target data; or when the first sub-thread analyzes to the first second target data, recording the starting position and the ending position of the second target data, creating the second sub-thread and continuously downloading other target data; the second sub-thread is controlled to download second target data according to the starting position and the ending position, the second sub-thread is controlled to analyze all the second target data, and a frame index table corresponding to target information is established based on the analyzed second target data; the target information comprises any one of video stream information and audio stream information, and different video stream information and different audio stream information correspond to different second sub-threads; and controlling the first sub-thread to read the video frames and the audio frames based on the frame index table, and playing.
In a third aspect, the present disclosure provides an electronic device comprising: a memory and a processor, the memory for storing a computer program; the processor is configured to cause the electronic device, when executing the computer program, to implement a method of playing a multimedia file as any one of the second aspects provides.
In a fourth aspect, the present invention provides a computer-readable storage medium comprising: a computer-readable storage medium has stored thereon a computer program for execution by a processor of a method of playing a multimedia file as any one of the second aspects provides.
In a fifth aspect, the present invention provides a computer program product which, when run on a computer, causes the computer to perform the method of playing a multimedia file as any one of the second aspects provides.
It should be noted that the above-mentioned computer instructions may be stored in whole or in part on the first computer readable storage medium. The first computer readable storage medium may be packaged together with the processor of the electronic device or may be packaged separately from the processor of the electronic device, which is not limited in this disclosure.
The descriptions of the second, third, fourth, and fifth aspects of the present disclosure may be referred to the detailed description of the first aspect; further, the advantageous effects described in the second aspect, the third aspect, the fourth aspect, and the fifth aspect may refer to the advantageous effect analysis of the first aspect, and are not described herein.
In the present disclosure, the names of the above-mentioned electronic devices do not constitute limitations on the devices or functional modules themselves, which may appear under other names in an actual implementation. Insofar as the function of each device or function module is similar to the present disclosure, it is within the scope of the claims of the present disclosure and the equivalents thereof.
These and other aspects of the disclosure will be more readily apparent from the following description.
Compared with the prior art, the technical scheme provided by the disclosure has the following advantages:
The display device provided by the disclosure obtains multimedia data of a multimedia file through a first sub-thread when playing the multimedia file with a video format of ISOBMFF. And then, the first sub-thread analyzes the multimedia data, and when the first sub-thread is positioned to the position information of the first target data for storing the media information, at least one piece of audio stream information and at least one piece of video stream information in the first target data are downloaded through the first sub-thread. Thereafter, a target operation is performed for each video stream information and each audio stream information: the target operation comprises the steps of controlling a first sub-thread to analyze target information, and creating a second sub-thread when analyzing second target data containing a sample sequence number, time or file position mapping; controlling a second sub-thread to analyze second target data, and establishing a frame index table corresponding to target information based on the analyzed second target data; or when the first sub-thread analyzes to the first second target data, recording the starting position and the ending position of the second target data, creating the second sub-thread and continuously downloading other target data; the second sub-thread is controlled to download second target data according to the starting position and the ending position, the second sub-thread is controlled to analyze all the second target data, and a frame index table corresponding to target information is established based on the analyzed second target data; the target information comprises any one of video stream information and audio stream information, and different video stream information and different audio stream information correspond to different second sub-threads. Thus, the frame index table can be built through the first sub-thread and the second sub-thread which are independent of each other, and the downloading, resolving and building of the second target data are completed through the first sub-thread and the second sub-thread which are independent of each other, so that the time occupied by the downloading, resolving and building of the second target data can be shortened, namely the frame index table can be built more quickly. Because the construction time of the frame index table is shorter, the playing time can be shortened, and then the playing speed of playing the multimedia file with the video format of ISOBMFF can be improved, and the problem of how to reduce the playing time of the video with the format of ISOBMFF is solved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments of the present disclosure or the solutions in the prior art, the drawings that are required for the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a schematic diagram of a prior art MP4 package format;
Fig. 2 is a schematic structural diagram of a display device according to an embodiment of the present application;
FIG. 3 is a second schematic diagram of a display device according to an embodiment of the present application;
fig. 4 is a flowchart of a method for playing a multimedia file according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a sample box according to an embodiment of the present application;
fig. 6 is a schematic diagram of a process for constructing a frame index table according to an embodiment of the present application;
FIG. 7 is a third flowchart illustrating a method for playing a multimedia file according to an embodiment of the present application;
FIG. 8 is a flowchart illustrating a method for playing a multimedia file according to an embodiment of the present application;
FIG. 9 is a flowchart of a method for playing a multimedia file according to an embodiment of the present application;
FIG. 10 is a flowchart illustrating a method for playing a multimedia file according to an embodiment of the present application;
Fig. 11 is a flowchart of a method for playing a multimedia file according to an embodiment of the present application.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, a further description of aspects of the present disclosure will be provided below. It should be noted that, without conflict, the embodiments of the present disclosure and features in the embodiments may be combined with each other.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced otherwise than as described herein; it will be apparent that the embodiments in the specification are only some, but not all, embodiments of the disclosure.
The display device provided by the embodiment of the application can have various implementation forms, and can be a television, an intelligent television, a laser projection device, a display (monitor), an electronic whiteboard (electronicbulletinboard), an electronic desktop (electronictable) and the like. Fig. 1 and 3 are specific embodiments of a display device of the present application.
It should be noted that in this document, relational terms such as "first" and "second" and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
ISOBMFF or MPEG-4part 14 (MPEG-4 part 14) is a standard digital multimedia container format. Mainly digital audio and digital video are stored, but subtitles and still images may also be stored. All data of the ISOBMFF is stored in a box, which can nest sub-boxes, the package format of which is shown in fig. 1.
The box name is in fourcc form, i.e. is represented by 4 letters, and a common first layer box includes ftyp (file type) boxes for identifying the ISOBMFF format; moov box for storing parameter information of audio and video files, such as resolution of video, number of channels of audio, sampling rate, etc.; the mdat box is used for storing actual audio and video coding data, the audio and video are stored in a chunk interleaving mode, and each chunk contains one or more frames of video or audio data; the moov box mainly comprises a trak box, different tracks correspond to different trak boxes, the trak box comprises three-level sub boxes such as mdia box, the mdia box further comprises four-level boxes such as minf box, hdlr box, the minf box comprises stbl (sample table) box, the stbl box comprises a stsd (sampledescription) box for describing audio or video format information, encoding and decoding parameter information, etc., stts (time to sample) box for describing audio or video, decoding time stamp (decoding TIME STAMP, dts) information for describing audio or video, if the video display time stamp is different from the decoding time stamp, ctts box is included for describing the difference between the display time stamp (presentation TIME STAMP, pts) and dts, the sample to sample box for describing corresponding to each frame, the sample to sample serial number (sample to sample) for describing each frame, and the sample to be used in the absolute box for describing each frame, and the absolute position of the sample to be used in the sample to describe each frame is 64.
Based on stts and ctts (or not) two boxes, pts and dts information of each frame can be obtained; based on stco/co64, stsc, stsz, offset information of each frame can be obtained, and these information are stored in the ISOBMFF frame index table when they are parsed, but for a film source with a long duration, for example, a 2.5 hour film source, if the video frame rate is 25fps, the audio sampling rate is 48kHz, the audio coding format is aac (each frame contains 1024 samples), the number of audio and video frames needs to be parsed: 2.5x60×60× (25+48000/1024) = 646875, it takes about 1s to construct only 60 ten thousand frame index tables on the mobile platform, the space occupied by these sample table related moov boxes is about 4m+, if the video adopts network transmission, such as http/samba/nfs, the bandwidth downloading of 100Mbps takes about 300ms, and if the video is weak, the whole video playing can be up to more than 4s.
Therefore, according to the method for playing the multimedia file provided by the embodiment of the disclosure, the construction process of the frame index table is optimized, the additional memory is added to store different 'frame data information' of audio and video respectively, independent audio and video analysis sub-threads are added, the frame index table of each frame is constructed based on the 'frame data information', the frame index tables are arranged according to the decoding sequence, the construction time of the frame index table can be shortened from the beginning, and the playing speed of the multimedia file is improved, and the method comprises the following specific implementation processes:
FFmpeg in the presently disclosed embodiments is a set of open source computer programs that can be used to record, convert digital audio, video, and convert it to streams.
Fig. 2 is a schematic view of an operation scene between a home appliance and a control device according to one or more embodiments of the present application, and as shown in fig. 2, a user may operate the display device 200 through the mobile terminal 300 and/or the control device 100. The control apparatus 100 may be a remote control, and the communication between the remote control and the display device includes infrared protocol communication, bluetooth protocol communication, and wireless or other wired manner to control the display device 200. The user may control the display device 200 by inputting user instructions through keys on a remote control, voice input, control panel input, etc. In some embodiments, mobile terminals, tablet computers, notebook computers, and other smart devices may also be used to control the display device 200.
In some embodiments, the electronic device provided in the embodiments of the present application may be the display device 200 described above. Wherein a user can play multimedia files during use of the display device 200. If the video format of the multimedia file to be played is ISOBMFF when the multimedia file is played by the first application installed on the display device 200 and having the function of playing the multimedia file, at this time, the first application of the display device 200 responds to the selection operation of playing the multimedia file with the video format of ISOBMFF to obtain the multimedia data of the multimedia file by the first sub-thread. Then, the first application of the display device 200 controls the first sub-thread to parse the multimedia data, and downloads at least one audio stream information and at least one video stream information in the first target data through the first sub-thread when the first sub-thread is positioned to the position information of the first target data for storing the media information. Thereafter, the first application of the display apparatus 200 performs a target operation on each video stream information and each audio stream information: the target operation comprises the steps of controlling a first sub-thread to analyze target information, and creating a second sub-thread when analyzing second target data containing a sample sequence number, time or file position mapping; and controlling the second sub-thread to analyze the second target data, and establishing a frame index table corresponding to the target information based on the analyzed second target data. Therefore, when the multimedia file with the video format of ISOBMFF is played, the second target data is downloaded through the first sub-thread, and the second target data is analyzed and constructed through the second sub-thread, so that the downloading, analysis and construction of the second target data can be completed in parallel, and the time for completing the downloading, analysis and construction of the second target data is reduced. Or when the network parameters of the network are poor (one or more of the downloading rate is smaller than the preset rate, the uploading rate is smaller than the target rate, and the data delay is larger than the delay threshold), at this time, when the first application of the display device 200 parses the first second target data through the first sub-thread, recording the starting position and the ending position of the second target data, creating the second sub-thread, and continuing downloading other target data; the second sub-thread is controlled to download second target data according to the starting position and the ending position, the second sub-thread is controlled to analyze all the second target data, and a frame index table corresponding to target information is established based on the analyzed second target data; thus, the first sub-thread and the second sub-thread can finish downloading the first second target data and the second target data except the first second target data in parallel, meanwhile, the second sub-thread can analyze all the second target data, and a frame index table corresponding to the target information is built based on the analyzed second target data, so that the time for finishing downloading, analyzing and constructing the second target data is reduced. Thereafter, the first application of the display device 200 controls the first sub-thread to read the video frame and the audio frame based on the frame index table and play the video frame and the audio frame.
As can be seen from the above, with the method for playing a multimedia file according to the embodiment of the present disclosure, the time taken to complete downloading, parsing and constructing the second target data is shorter, so that the time for creating the frame index table is shorter. Because the time for establishing the frame index table is shorter, the playing speed of the multimedia file with the video format of ISOBMFF can be improved, and the user experience is improved.
Fig. 3 shows a hardware configuration block diagram of the display device 200 in accordance with an exemplary embodiment. The display apparatus 200 shown in fig. 3 includes at least one of a modem 210, a communicator 220, a detector 230, an external device interface 240, a controller 250, a display 260, an audio output interface 270, a memory, a power supply, and a user interface 280. The controller includes a central processor, a video processor, an audio processor, a graphic processor, a RAM, a ROM, and first to nth interfaces for input/output. The display 260 may be a display having a touch function, such as a touch display. The detector 230 is used to collect signals of the external environment or interaction with the outside.
In some embodiments, the controller 250 controls the operation of the display device and responds to user operations through various software control programs stored on the memory. The controller 250 controls the overall operation of the display apparatus 200.
In some examples, taking the display device 200 of one or more embodiments as the television 1 and the operating system of the television 1 as the android system as an example, as shown in fig. 4, the television 1 may be logically divided into an application layer (applications layer) 21, an application framework layer (Application Framework layer) 22, an android runtime layer (Android runtime) and a system library layer (system runtime layer) 23, and a kernel layer 24.
Wherein the application layer 21 comprises one or more applications. The application may be a system application or a third party application. For example, the application layer 21 includes a first application that can provide a play function of a multimedia file. Framework layer 22 provides an application programming interface (application programming interface, API) and programming framework for the application programs of application layer 21. The system runtime layer 23 provides support for the upper layer, framework layer 22, and when framework layer 22 is in use, the android operating system will run the C/C++ libraries contained in system runtime layer 23 to implement the functions to be implemented by framework layer 22. The kernel layer 24 acts as software middleware between the hardware layer and the application layer 21 for managing and controlling hardware and software resources.
In some examples, the first application is started after the television 1 is turned on. In the process of using the television 1, a user can open a first application on the television 1, so that multimedia files needing to be played can be played through the first application. During this period, if the video format of the multimedia file to be played is ISOBMFF, the download module 210 of the television 1 obtains the multimedia data of the multimedia file through the first sub-thread in response to the selection operation of playing the multimedia file with the video format of ISOBMFF. Then, the video decapsulation parsing module 211 controls the first sub-thread to parse the multimedia data acquired by the downloading module 210, and downloads at least one audio stream information and at least one video stream information in the first target data through the first sub-thread when the first sub-thread locates the position information of the first target data for storing the media information. Thereafter, the video decapsulation parsing module 211 performs a target operation on each video stream information and each audio stream information: the target operation includes the processing unit 201 controlling the first sub-thread to parse the target information, and creating a second sub-thread when parsing to the second target data containing the sample number, time or file location map; the video decapsulation parsing module 211 controls the second sub-thread to parse the second target data, and establishes a frame index table corresponding to the target information based on the parsed second target data. Or the video decapsulation parsing module 211 records the starting position and the ending position of the second target data when parsing the first second target data through the first sub-thread, creates the second sub-thread and continues to download other target data; the video decapsulation parsing module 211 controls the second sub-thread to download the second target data according to the start position and the end position, controls the second sub-thread to parse all the second target data, and establishes a frame index table corresponding to the target information based on the parsed second target data. Thereafter, the video decapsulation parsing module 211 controls the first sub-thread to read the video frames and the audio frames based on the frame index table. The ES buffer module 212 is configured to buffer the video frames and the audio frames output by the ES buffer module 212. The video decoding module 213 decodes the video frame output from the ES buffer module 212, and outputs YUV data. The audio decoding module 214 is configured to decode the audio frame output from the ES buffer module 212 and output pulse code modulation (Pulse Code Modulation, PCM) data. The video synchronous rendering module 215 synchronously renders the YUV data output from the video decoding module 213 based on the master clock; the audio synchronous rendering module 216 performs synchronous rendering based on PCM data output from the audio decoding module 214. Where typically the audio device provides a master clock. In this way, the playing of the multimedia file in video format ISOBMFF is completed.
Specifically, when the main execution body for executing the method for playing the multimedia file provided in the embodiment of the present disclosure is the television 1, the storage module 217 of the television 1 is used for storing data such as program codes of the method for playing the multimedia file provided in the embodiment of the present disclosure.
In the following embodiments, the method according to the embodiments of the present application will be described by taking the main body of execution of the method for playing a multimedia file provided by the embodiments of the present disclosure as the example of the television 1.
The embodiment of the application provides a method for playing a multimedia file, which is applied to a television 1, as shown in fig. 5, and the method for playing the multimedia file may include S11-S14.
S11, responding to the selection operation of playing the multimedia file with the video format being the international standardization organization basic media file format, and acquiring the multimedia data of the multimedia file through the first sub-thread.
In some examples, when the frame index table is created by the multimedia file with the video format of ISOBMFF, as the playing duration of the multimedia file with the video format of ISOBMFF increases, the corresponding frame index table also increases greatly, and when the multimedia file with the video format of ISOBMFF is played by adopting the existing method, a large amount of time is required to be occupied in the process of creating the frame index table, so that the playing duration of playing the multimedia file with the video format of ISOBMFF is longer, and the user experience is poor. Therefore, in the method for playing a multimedia file according to the embodiment of the present disclosure, when the multimedia file with the video format of ISOBMFF is played, multimedia data of the multimedia file is obtained through the first sub-thread. And then, the first sub-thread analyzes the multimedia data, and when the first sub-thread is positioned to the position information of the first target data for storing the media information, at least one piece of audio stream information and at least one piece of video stream information in the first target data are downloaded through the first sub-thread. Thereafter, a target operation is performed for each video stream information and each audio stream information: the target operation comprises the steps of controlling a first sub-thread to analyze target information, and creating a second sub-thread when analyzing second target data containing a sample sequence number, time or file position mapping; controlling a second sub-thread to analyze second target data, and establishing a frame index table corresponding to target information based on the analyzed second target data; or when the first sub-thread analyzes to the first second target data, recording the starting position and the ending position of the second target data, creating the second sub-thread and continuously downloading other target data; the second sub-thread is controlled to download second target data according to the starting position and the ending position, the second sub-thread is controlled to analyze all the second target data, and a frame index table corresponding to target information is established based on the analyzed second target data; the target information comprises any one of video stream information and audio stream information, and different video stream information and different audio stream information correspond to different second sub-threads. Thus, the frame index table can be built through the first sub-thread and the second sub-thread which are independent of each other, and the downloading, resolving and building of the second target data are completed through the first sub-thread and the second sub-thread which are independent of each other, so that the time occupied by the downloading, resolving and building of the second target data can be shortened, namely the frame index table can be built more quickly. Because the construction time of the frame index table is shorter, the playing time can be shortened, and the playing speed when the multimedia file with the video format of ISOBMFF is played can be further improved.
In some examples, the first sub-thread is the sub-thread that created the video decapsulation parsing module 211.
And S12, controlling the first sub-thread to analyze the multimedia data, and downloading at least one piece of audio stream information and at least one piece of video stream information in the first target data through the first sub-thread when the first sub-thread is positioned to the position information of the first target data for storing the media information.
In some examples, the first target data may be moov box.
S13, performing a target operation on each video stream information and each audio stream information: the target operation comprises the steps of controlling a first sub-thread to analyze target information, and creating a second sub-thread when analyzing second target data containing a sample sequence number, time or file position mapping; controlling a second sub-thread to analyze second target data, and establishing a frame index table corresponding to target information based on the analyzed second target data; or when the first sub-thread analyzes to the first second target data, recording the starting position and the ending position of the second target data, creating the second sub-thread and continuously downloading other target data; the second sub-thread is controlled to download second target data according to the starting position and the ending position, the second sub-thread is controlled to analyze all the second target data, and a frame index table corresponding to target information is established based on the analyzed second target data; the target information comprises any one of video stream information and audio stream information, and different video stream information and different audio stream information correspond to different second sub-threads.
In some examples, the nth trak box processed by the first sub-thread corresponds to the nth sub-thread. Where N ε [1, N ], N and N are integers, N represents the total number of trak boxes contained in the moov box.
In some examples, the frame index table of the ISOBMFF contains dts, offset, whether key frame information, etc. for the frame. The above information can be obtained based on each sub box (including stsd box, stts box, stsc box, stsz box, stco box, etc.) in the stbl box (sample table box) described in fig. 1. Wherein stss (sample table SYNC SAMPLE) box is used to determine whether the frame is a key frame, such as: the audio frames are all key frames, and no judgment is needed, if the frame number (from 1) of the video frame is stssbox, the video frame is the key frame, otherwise, the video frame is not the key frame. The stts box is used for obtaining dts information of each frame, the stts box comprises a plurality of entries, each entry comprises the number of frames with the same duration and the duration information of the frames, if the duration of each frame is the same, the stts box only comprises one entry, and the duration of the stts box is relative to the time base (the time base is a time scale, for example, the time base is 600, and 1s is divided into 600 parts). stsz, stsc, stco/co64 is used to acquire the offset of each frame, and the specific acquisition mode is shown in fig. 6: since the offset of the data uniquely determines the position of the data in the multimedia file, and the frame index table of the ISOBMFF and the actual encoded data are stored in different areas of the file, it is not possible to simply process the index table and the encoded data separately using multithreading. Open source frameworks like FFmpeg are all processed in one thread, processing moov box first, and then mdat box. However, considering that the moov box of the multimedia file with more audio frames and video formats of ISOBMFF is mainly that the data analysis and construction of each sub box in the stbl box are slower, a playing method of the multimedia file is proposed herein, the data downloading and analysis of each sub box in the stbl box in both audio stream information and video stream information in the original first sub thread are performed, and the construction of the frame index table is changed to the first sub thread to only process the data downloading of each sub box in the stbl box in both audio stream information and video stream information, and the data analysis and the construction of the frame index table of each sub box in the stbl box are performed in the second sub thread, if each sub box in the stbl box is regarded as an integral, the stbl box is the last processed box in the trak box, so that the method does not affect the downloading flow of the original data. Meanwhile, when the multimedia file with the video format of ISOBMFF is played, the second target data is downloaded through the first sub-thread, and the second target data is analyzed and constructed through the second sub-thread, so that the downloading, analysis and construction of the second target data can be completed in parallel, and the time for completing the downloading, analysis and construction of the second target data is reduced.
Taking the first target data as moov box and the second target data as stbl box as an example, the process of playing the multimedia file with the video format of ISOBMFF by the television 1 is as follows:
The television 1 obtains multimedia data of a multimedia file through a first sub-thread 1 in response to a selection operation of playing the multimedia file in a video format which is an international organization for standardization basic media file format. When the first sub-thread 1 analyzes the multimedia data and the first sub-thread 1 locates the position information of the moov box, at least one piece of audio stream information and at least one piece of video stream information in the moov box are downloaded through the first sub-thread 1. Thereafter, the first sub-thread 1 performs a target operation on the video stream information and the audio stream information: the first sub-thread 1 analyzes the target information to obtain a trak box (for example, trak box1 when the target information is video stream information, trak box1 represents video information, and trak box1 represents audio information when the target information is audio stream information). Then, the first sub-thread 1 analyzes the trak box1 to obtain an mdia box. Then, the first sub thread 1 analyzes the mdia box to obtain a minf box and an hdlr box. Then, the first sub-thread 1 analyzes the minf box and the hdlr box, for example: when the first sub thread 1 analyzes the minf box, the stbl box is obtained. At this time, the first sub-thread 1 determines to parse the stbl box, creates a second sub-thread 2 for parsing the stbl box in the trak box1, and creates a frame index table corresponding to the trak box1 based on the parsed stbl box. Similarly, the first sub-thread 1 continues to download and parse other trak boxes (e.g. trakbox b) in the moov box until the stbl box in the trak box2 is parsed, and then re-creates a third sub-thread 3 for parsing the stbl box in the trak box2, and building trakbox b corresponding frame index table based on the parsed stbl box. And circulating until the first sub-thread 1 finishes downloading and analyzing all trak boxes in the moov box, and finishing analyzing all stbl boxes of the trak boxes by other sub-threads (such as second sub-threads 2, …, nth sub-threads N, N E [1, N ], N and N are integers, N represents the total number of the trak boxes contained in the moov box) except the first sub-thread 1, and establishing a frame index table corresponding to the trak boxes based on the analyzed stbl boxes. The television 1 reads video frames and audio frames based on the frame index table and plays them. In this way, the playing of the multimedia file in the video format ISOBMFF is completed.
In some examples, for a scene with poor network parameters of a network, in order to promote playing of a multimedia file with a video format of ISOBMFF, when a first sub-thread 1 parses a stbl box of a first trak box1, a start position and an end position of the stbl box are recorded, and a second sub-thread 2 is created. Then, the second sub thread 2 creates a new file descriptor, and performs data download of the stbl box of the trak box1 and each sub box in the stbl box by locating to the start position of the stbl box; the first sub-thread 1 ignores the downloading of the stbl box of trakbox1, and continues to download other trak boxes (e.g., trak box2 and trak box 3). For the trak box except the first trak box1, the first sub-thread performs the following operation for each trak box: the first sub thread 1 analyzes the trak box2 to obtain an mdia box. Then, the first sub thread 1 analyzes the mdia box to obtain a minf box and an hdlr box. Then, the first sub-thread 1 analyzes the minf box and the hdlr box, for example: when the first sub thread 1 analyzes the minf box, the stbl box is obtained. At this time, the first sub-thread determines to parse the stbl box, creates a second sub-thread 2 for parsing the stbl box in the trak box2, and creates a frame index table corresponding to the trak box2 based on the parsed stbl box. Similarly, the first sub-thread continues to download and parse other trak boxes (such as trak box 3) in the moov box until the stbl box in the trak box3 is parsed, and then re-creates a third sub-thread 3 for parsing the stbl box in the trak box3, and builds a frame index table corresponding to the trak box3 based on the parsed stbl box. And circulating until the first sub-thread 1 finishes downloading and analyzing all trak boxes in the moov box, and simultaneously, the second sub-thread finishes analyzing all stbl boxes of the trak boxes, and building a frame index table corresponding to the trak boxes based on the analyzed stbl boxes. The television 1 reads video frames and audio frames based on the frame index table and plays them. In this way, the playing of the multimedia file in the video format ISOBMFF is completed.
Taking the first target data as a moov box, where the moov box includes a trak box1, a trak box2 and a trak box3, and the second target data is a stbl box as an example, the process of playing a multimedia file with a video format of ISOBMFF by the television 1 is as follows:
The television 1 obtains multimedia data of a multimedia file through a first sub-thread in response to a selection operation of playing the multimedia file in a video format which is an international organization for standardization basic media file format. When the first sub-thread analyzes the multimedia data and the first sub-thread locates the position information of the moov box, at least one piece of audio stream information and at least one piece of video stream information in the moov box are downloaded through the first sub-thread. Thereafter, the first sub-thread performs a target operation on the video stream information and the audio stream information: when the first sub-thread analyzes the target information to obtain a first trak box (any one of trak box1, trak box2 and trak box3 is described here by taking the first trak box as the trak box1 as an example), the first sub-thread records the start position and the end position of the trak box1, and creates a second sub-thread 1 for downloading and analyzing the trak box 1. The second sub-thread 1 analyzes the trak box1 to obtain an mdia box. Then, the second sub thread 1 analyzes the mdia box to obtain a minf box and an hdlr box. Then, the second sub-thread 1 analyzes the minf box and the hdlr box respectively, for example: when the second sub thread 1 analyzes the minf box, the stbl box is obtained. The second sub-thread 1 analyzes the stbl box in the trak box1, and establishes a frame index table corresponding to the trak box1 based on the analyzed stbl box. At the same time, the first sub-thread continues to download the trak box2 data. Then, the first sub-thread analyzes the trak box2 to obtain an mdia box. Then, the first sub-thread continues to download and analyze other trak boxes (such as trak box 2) in the moov box until the stbl box of the trak box2 is analyzed, creates a second sub-thread 2 for analyzing the stbl box in the trak box2, and creates a frame index table corresponding to the trak box2 based on the analyzed stbl box. Similarly, the first sub-thread continues to download and parse other trak boxes (such as trak box 1) in the moov box until the stbl box in the trak box3 is parsed, and then re-creates a second sub-thread 3 for parsing the stbl box in the trak box3, and builds a frame index table corresponding to the trak box1 based on the parsed stbl box. And circulating until the first sub-thread finishes downloading and analyzing all trak boxes in the moov box, and simultaneously finishing analyzing all stbl boxes of the trak boxes by other sub-threads (such as second sub-thread 2, …, nth sub-thread N, N E [1, N ], N and N are integers, N represents the total number of the trak boxes contained in the moov box) except the first sub-thread 1, and establishing a frame index table corresponding to the trak boxes based on the analyzed stbl boxes. The television 1 reads video frames and audio frames based on the frame index table and plays them. In this way, the playing of the multimedia file in the video format ISOBMFF is completed.
S14, controlling the first sub-thread to read video frames and audio frames based on the frame index table, and playing.
As can be seen from the above, with the method for playing a multimedia file according to the embodiment of the present disclosure, the time taken to complete downloading, parsing and constructing the second target data is shorter, so that the time for creating the frame index table is shorter. Because the time for establishing the frame index table is shorter, the playing speed of the multimedia file with the video format of ISOBMFF can be improved, and the user experience is improved.
In some practical examples, referring to fig. 5, as shown in fig. 7, the method for playing a multimedia digital file according to the embodiment of the disclosure further includes: S15-S18.
S15, acquiring a first total number of the currently established frame index table and a second total number of the currently read video frames and the audio frames.
S16, under the condition that the multimedia file is not received to be withdrawn from playing, if the first sub-thread determines that the first total number is smaller than or equal to the second total number, the first sub-thread stops downloading the first target data.
And S17, controlling the second sub-thread to send first information to the first sub-thread if the second sub-thread determines that the first sub-thread stops downloading the first target data and the first total number is larger than the second total number and both the first total number and the second total number are larger than or equal to 0.
S18, controlling the first sub-thread to continuously download the first target data after receiving the first information sent by the second sub-thread.
In some examples, since the frame index table is built in the second sub-thread, and the first sub-thread needs to read frame data (video frames and audio frames) based on the frame data information in the frame index table, a variable needs to be added to identify the progress of the current build when the second sub-thread is built.
In some examples, in recording the first total and the second total, different frame index numbers may be created, such as: creating a current_sample_idx to represent a currently read frame index number (i.e., a first total number), and when the audio frames or video frames of each path are increased, the first total number is also increased (initial 0); creating a current_build_sample_idx to represent a frame index number (i.e., a second total number) already built in the frame index table, if the current_sample_idx is greater than or equal to 0 when the second sub-thread is building the frame index table, determining that the current_build_sample_idx is greater than or equal to the current_sample_idx, and the first sub-thread is waiting (i.e., the first sub-thread stops downloading the first target data), sending the first information by the second sub-thread to inform the first sub-thread to continue downloading the first target data; if the current_sample_idx is less than the current_build_sample_idx in the first sub-thread, the is_wait is set to true (i.e. the first sub-thread stops downloading the first target data), and the first target data is continuously downloaded when the first information sent by the second sub-thread is received.
In some practical examples, referring to fig. 7, as shown in fig. 8, the method for playing a multimedia data file according to the embodiment of the disclosure further includes: s19, performing operation.
And S19, under the condition that the user operation of exiting to play the multimedia file is not received, if the first sub-thread determines that the first total number is greater than the second total number, the first sub-thread continuously downloads the first target data.
In some examples, during playing a multimedia file in the video format ISOBMFF, if the user does not need to continue playing the multimedia file, the user may execute a user operation for exiting playing the multimedia file, and the television 1 stops playing the multimedia file in response to the user operation for exiting playing the multimedia file.
In some examples, the television set 1, in the event that no user operation is received to exit playing the multimedia file, if the first sub-thread determines that the first total is greater than the second total, it indicates that the constructed frame index table is greater than the total of both video frames and audio frames that are currently being read, so the first sub-thread continues to download the first target data.
When the first total number is less than or equal to the second total number, it is indicated that the constructed frame index table is less than or equal to the total number of both the video frames and the audio frames that are currently read, and the first sub-thread needs to wait because the first sub-thread needs to read frame data (video frames and audio frames) based on the frame data information in the frame index table constructed by the second sub-thread, such as: the first sub-thread stops downloading the first target data. And under the condition that the second sub-thread determines that the first sub-thread stops downloading the first target data, if the first total number is larger than the second total number and both the first total number and the second total number are larger than or equal to 0, controlling the second sub-thread to send first information to the first sub-thread. And after the first information sent by the second sub-thread is received, the first sub-thread is controlled to continuously download the first target data, so that the normal playing of the multimedia data is ensured.
In some practical examples, referring to fig. 7, as shown in fig. 9, the method for playing a multimedia data file according to the embodiment of the present disclosure further includes: S20-S22.
And S20, in the process of playing the multimedia file, if the user operation for adjusting the current playing time to the target playing time is received, the frame index table is not constructed, and the first sub-thread is controlled to set the second total number to a preset value and stop downloading the first target data when the first sub-thread determines that the timestamp corresponding to the target playing time is greater than the maximum timestamp in the frame index table.
And S21, under the condition that the second sub-thread determines that the first sub-thread sets the second total number as a preset value and stops downloading the first target data, if the second sub-thread analyzes the key frame of which the difference value of the time stamp corresponding to the target playing time is smaller than the preset difference value, the second sub-thread is controlled to send second information to the first sub-thread.
S22, after the first sub-thread is controlled to receive the second information sent by the second sub-thread, setting the second total number as the total number of the accumulated video frames and the accumulated audio frames when the second total number is read to the key frames, and continuing to download the first target data.
In some examples, since the second sub-thread is used to construct the frame index table, the playing of the multimedia file is advanced, when the user performs a seek skip operation (such as a user operation that adjusts the current playing time to the target playing time, the user operation may be referred to as a fast forward skip operation when the timestamp corresponding to the target playing time is greater than the timestamp of the current playing time, or the user operation may be referred to as a fast backward skip operation when the timestamp corresponding to the target playing time is less than the timestamp of the current playing time), it is possible that the frame index table at the target playing time is still not constructed. Therefore, in the method for playing multimedia data according to the embodiment of the present disclosure, when a seek skip operation is received, if the frame index table is already constructed, or if the corresponding timestamp of the target playing time of the seek skip operation is less than or equal to the maximum timestamp in the currently constructed frame index table, the closest keyframe position is searched (for example, the second sub-thread uses the keyframe whose difference value of the timestamps corresponding to the target playing time is less than the preset difference value as the closest keyframe). If the corresponding time stamp of the target playing time of the seek skip operation is larger than the maximum time stamp in the current video index table, resetting the current read frame index number current_sample_index to a preset value (for example, -1), setting the is_wait to true by the first sub-thread, and waiting for the second sub-thread to send the second information. In the process of constructing the frame index table, if the second sub-thread judges that the is_wait is true and the current current_sample_index is-1, when the key frame closest to the corresponding time stamp of the target playing time of the seek skip operation is analyzed, sending second information to the first sub-thread, and informing the first sub-thread to continuously download the first target data. The first sub-thread sets the corresponding sequence number (i.e. the total number of the accumulated video frames and audio frames) of the acquired nearest key frame in the frame index table to the current_sample_index, and continues to download the first target data.
In some practical examples, referring to fig. 9, as shown in fig. 10, the method for playing a multimedia data file according to the embodiment of the present disclosure further includes: s23, performing S23.
S23, in the process of playing the multimedia file, if the user operation for adjusting the current playing time to the target playing time is received and the frame index table is constructed, jumping to the target playing time for playing.
In some practical examples, referring to fig. 9, as shown in fig. 11, the method for playing a multimedia data file according to the embodiment of the present disclosure further includes: s24, performing S24.
And S24, in the process of playing the multimedia file, if the user operation for adjusting the current playing time to the target playing time is received, the frame index table is not constructed, and the first sub-thread jumps to the target playing time for playing when determining that the timestamp corresponding to the target playing time is smaller than or equal to the maximum timestamp in the frame index table.
The foregoing description of the solution provided by the embodiments of the present application has been mainly presented in terms of a method. To achieve the above functions, it includes corresponding hardware structures and/or software modules that perform the respective functions. Those of skill in the art will readily appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The embodiment of the application can divide the functional modules of the display device according to the method example, for example, each functional module can be divided corresponding to each function, or two or more functions can be integrated in one processing unit. The integrated modules may be implemented in hardware or in software functional modules. It should be noted that, in the embodiment of the present application, the division of the modules is schematic, which is merely a logic function division, and other division manners may be implemented in actual implementation.
Embodiments of the present application provide a schematic structural diagram of a display device 200. Including a processor 101, a communicator 102 and a display 103.
A processor 101 configured to control the communicator 102 to acquire multimedia data of a multimedia file through a first sub-thread in response to a selection operation of playing the multimedia file in a video format that is an international organization for standardization basic media file format; the processor 101 is further configured to control the first sub-thread to parse the multimedia data acquired by the communicator 102, and when the first sub-thread locates to the position information of the first target data for storing the media information, download at least one audio stream information and at least one video stream information in the first target data through the first sub-thread; the processor 101 is further configured to perform a target operation for each video stream information and each audio stream information: the target operation comprises the steps of controlling a first sub-thread to analyze target information, and creating a second sub-thread when analyzing second target data containing a sample sequence number, time or file position mapping; controlling a second sub-thread to analyze second target data, and establishing a frame index table corresponding to target information based on the analyzed second target data; or when the first sub-thread analyzes to the first second target data, recording the starting position and the ending position of the second target data, creating the second sub-thread and continuously downloading other target data; the second sub-thread is controlled to download second target data according to the starting position and the ending position, the second sub-thread is controlled to analyze all the second target data, and a frame index table corresponding to target information is established based on the analyzed second target data; the target information comprises any one of video stream information and audio stream information, and different video stream information and different audio stream information correspond to different second sub-threads; the processor 101 is further configured to control the first sub-thread to read video frames and audio frames based on the frame index table and play back.
In some implementable examples, the communicator 102 is further configured to obtain a first total number of currently established frame index tables, and a second total number of both currently read video frames and audio frames; the processor 101 is further configured to stop downloading the first target data by the first sub-thread if the first sub-thread determines that the first total number acquired by the communicator 102 is less than or equal to the second total number acquired by the communicator 102, in the case that the exit from playing the multimedia file is not received; the processor 101 is further configured to, if the second sub-thread determines that the first sub-thread stops downloading the first target data, control the second sub-thread to send the first information to the first sub-thread through the communicator 102 if the first total number acquired by the communicator 102 is greater than the second total number acquired by the communicator 102 and both the first total number acquired by the communicator 102 and the second total number acquired by the communicator 102 are greater than or equal to 0; the processor 101 is further configured to control the first sub-thread to continue downloading the first target data after receiving the first information sent by the second sub-thread.
In some examples, the processor 101 is further configured to, in the event that a user operation to exit playing the multimedia file is not received, continue downloading the first target data by the first sub-thread if the first sub-thread determines that the first total number acquired by the communicator 102 is greater than the second total number acquired by the communicator 102.
In some practical examples, the processor 101 is further configured to, in a process of playing the multimedia file, if a user operation of adjusting the current playing time to the target playing time is received, and the frame index table is not constructed, and the first sub-thread determines that the timestamp corresponding to the target playing time is greater than the maximum timestamp in the frame index table, control the first sub-thread to set the second total number to a preset value, and stop downloading the first target data; the processor 101 is further configured to, when the second sub-thread determines that the first sub-thread sets the second total number to a preset value and stops downloading the first target data, control the second sub-thread to send second information to the first sub-thread through the communicator 102 if the second sub-thread parses a key frame with a timestamp difference corresponding to the target playing time being smaller than the preset difference; the processor 101 is further configured to control the first sub-thread to set the second total number acquired by the communicator 102 to be the total number of video frames and audio frames accumulated when reading the key frame after receiving the second information sent by the second sub-thread, and continue to download the first target data.
In some practical examples, the processor 101 is further configured to, during playing of the multimedia file on the display, jump to the target playing time for playing if a user operation is received to adjust the current playing time to the target playing time and the frame index table is already constructed.
In some practical examples, the processor 101 is further configured to, in a process of playing the multimedia file on the display, skip to the target playing time to play if a user operation of adjusting the current playing time to the target playing time is received, the frame index table is not constructed, and the first sub-thread determines that the timestamp corresponding to the target playing time is less than or equal to the maximum timestamp in the frame index table.
All relevant contents of each step related to the above method embodiment may be cited to the functional descriptions of the corresponding functional modules, and their effects are not described herein.
Of course, the display device 200 provided in the embodiment of the present application includes, but is not limited to, the above modules, for example, the display device 200 may further include the memory 104. The memory 104 may be used to store program code for the display device 200 and may also be used to store data generated by the display device 200 during operation, such as data in write requests, and the like.
As an example, in conjunction with fig. 4, the download module 210 in the television 1 performs the same function as the communicator 102, and the video decapsulation parsing module 211, the video decoding module 213, the video synchronous rendering module 215, the audio decoding module 214, and the audio synchronous rendering module 216 perform the same function as the processor 101, and the ES buffer module 212 and the storage module 217 perform the same function as the memory 104.
The embodiment of the present application also provides a chip system that can be applied to the display device 200 in the foregoing embodiment. The system-on-chip includes at least one processor 1501 and at least one interface circuit 1502. The processor 1501 may be a processor in the display device 200 described above. The processor 1501 and the interface circuit 1502 may be interconnected by wires. The processor 1501 may receive and execute computer instructions from the memory of the display device 200 described above through the interface circuit 1502. The computer instructions, when executed by the processor 1501, may cause the display device 200 to perform the steps performed by the display device 200 in the embodiments described above. Of course, the system-on-chip may also include other discrete devices, which are not particularly limited in accordance with embodiments of the present application.
The embodiment of the present application further provides a computer readable storage medium for storing computer instructions for operating the display device 200.
The foregoing is merely a specific embodiment of the disclosure to enable one skilled in the art to understand or practice the disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown and described herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A display device, characterized by comprising:
A processor configured to control the communicator to acquire multimedia data of a multimedia file through a first sub-thread in response to a selection operation of playing the multimedia file in a video format which is an international organization for standardization basic media file format; wherein the first sub-thread is a sub-thread for decapsulating the multimedia data;
The processor is further configured to control the first sub-thread to parse the multimedia data acquired by the communicator, and when the first sub-thread locates to the position information of the first target data for storing media information, download at least one piece of audio stream information and at least one piece of video stream information in the first target data through the first sub-thread;
The processor is further configured to perform a target operation on each of the video stream information and each of the audio stream information: the target operation comprises the steps of controlling the first sub-thread to analyze the target information, and creating a second sub-thread when analyzing second target data containing a sample sequence number, time or file position mapping; the second sub-thread is controlled to analyze the second target data, and a frame index table corresponding to the target information is established based on the analyzed second target data; or when the first sub-thread analyzes to the first second target data, recording the starting position and the ending position of the second target data, creating a second sub-thread and continuously downloading other target data; the second sub-thread is controlled to download the second target data according to the starting position and the ending position, the second sub-thread is controlled to analyze all the second target data, and a frame index table corresponding to the target information is established based on the analyzed second target data; wherein the target information comprises any one of the video stream information and the audio stream information, and different video stream information and different audio stream information correspond to different second sub-threads;
The processor is further configured to control the first sub-thread to read video frames and audio frames based on the frame index table and play the video frames and the audio frames.
2. The display device of claim 1, wherein the communicator is further configured to obtain a first total number of currently established frame index tables and a second total number of both the video frames and the audio frames that are currently read;
The processor is further configured to stop downloading the first target data by the first sub-thread if the first sub-thread determines that the first total number acquired by the communicator is less than or equal to the second total number acquired by the communicator, in the case that the exit to play the multimedia file is not received;
The processor is further configured to, if the second sub-thread determines that the first sub-thread stops downloading the first target data, control the second sub-thread to send first information to the first sub-thread through the communicator if the first total number acquired by the communicator is greater than the second total number acquired by the communicator and both the first total number acquired by the communicator and the second total number acquired by the communicator are greater than or equal to 0;
The processor is further configured to control the first sub-thread to continue downloading the first target data after receiving the first information sent by the second sub-thread.
3. The display device of claim 2, wherein the processor is further configured to, in the event that no user operation is received to exit playing the multimedia file, continue downloading the first target data by the first sub-thread if the first sub-thread determines that the first total number acquired by the communicator is greater than the second total number acquired by the communicator.
4. The display device according to claim 2, wherein the processor is further configured to control the first sub-thread to set the second total number to a preset value and stop downloading the first target data if a user operation to adjust a current playing time to a target playing time is received and the frame index table is not constructed, and the first sub-thread determines that a timestamp corresponding to the target playing time is greater than a maximum timestamp in the frame index table during playing the multimedia file;
the processor is further configured to control, when the second sub-thread determines that the first sub-thread sets the second total number to a preset value and stops downloading the first target data, the second sub-thread to send second information to the first sub-thread through the communicator if the second sub-thread parses a key frame with a timestamp difference corresponding to the target playing time smaller than the preset difference;
the processor is further configured to control the first sub-thread to set the second total number acquired by the communicator to be the total number of video frames and audio frames accumulated when the second total number is read to the key frame after receiving the second information sent by the second sub-thread, and continue to download the first target data.
5. The display device of claim 4, wherein the processor is further configured to skip to the target playing time for playing if a user operation to adjust the current playing time to the target playing time is received and the frame index table is constructed during the playing of the multimedia file by the display.
6. The display device of claim 4, wherein the processor is further configured to skip to the target playing time to play if a user operation to adjust the current playing time to the target playing time is received and the frame index table is not constructed, and the first sub-thread determines that the timestamp corresponding to the target playing time is less than or equal to the maximum timestamp in the frame index table during the playing of the multimedia file by the display.
7. A method for playing a multimedia file, comprising:
responding to the selection operation of playing a multimedia file with a video format being an international standardization organization basic media file format, and acquiring multimedia data of the multimedia file through a first sub-thread; wherein the first sub-thread is a sub-thread for decapsulating the multimedia data;
Controlling the first sub-thread to analyze the multimedia data, and downloading at least one piece of audio stream information and at least one piece of video stream information in the first target data through the first sub-thread when the first sub-thread is positioned to the position information of the first target data for storing media information;
Performing a target operation on each of the video stream information and each of the audio stream information: the target operation comprises the steps of controlling the first sub-thread to analyze the target information, and creating a second sub-thread when analyzing second target data containing a sample sequence number, time or file position mapping; the second sub-thread is controlled to analyze the second target data, and a frame index table corresponding to the target information is established based on the analyzed second target data; or when the first sub-thread analyzes to the first second target data, recording the starting position and the ending position of the second target data, creating a second sub-thread and continuously downloading other target data; the second sub-thread is controlled to download the second target data according to the starting position and the ending position, the second sub-thread is controlled to analyze all the second target data, and a frame index table corresponding to the target information is established based on the analyzed second target data; wherein the target information comprises any one of the video stream information and the audio stream information, and different video stream information and different audio stream information correspond to different second sub-threads;
And controlling the first sub-thread to read video frames and audio frames based on the frame index table, and playing.
8. The method for playing a multimedia file according to claim 7, further comprising:
Acquiring a first total number of currently established frame index tables and a second total number of both the video frames and the audio frames which are currently read;
under the condition that the multimedia file is not received to be quit played, if the first sub-thread determines that the first total number is smaller than or equal to the second total number, the first sub-thread stops downloading the first target data;
Controlling the second sub-thread to send first information to the first sub-thread if the second sub-thread determines that the first sub-thread stops downloading the first target data and if the first total number is greater than the second total number and both the first total number and the second total number are greater than or equal to 0;
and controlling the first sub-thread to continuously download the first target data after receiving the first information sent by the second sub-thread.
9. The method for playing a multimedia file according to claim 8, further comprising:
And under the condition that the multimedia file is not received to be exited, if the first sub-thread determines that the first total number is greater than the second total number, the first sub-thread continues to download the first target data.
10. A computer-readable storage medium, comprising: the computer readable storage medium having stored thereon a computer program which, when executed by a computing device, causes the computing device to implement the method of playing a multimedia file as claimed in any of claims 7 to 9.
CN202311676880.XA 2023-12-07 2023-12-07 Multimedia file playing method and device and electronic equipment Pending CN117914834A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311676880.XA CN117914834A (en) 2023-12-07 2023-12-07 Multimedia file playing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311676880.XA CN117914834A (en) 2023-12-07 2023-12-07 Multimedia file playing method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN117914834A true CN117914834A (en) 2024-04-19

Family

ID=90682885

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311676880.XA Pending CN117914834A (en) 2023-12-07 2023-12-07 Multimedia file playing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN117914834A (en)

Similar Documents

Publication Publication Date Title
CN104253999B (en) Apparatus and method for transmission content
CN105049920B (en) A kind of method for recording and device of multimedia file
US11064269B2 (en) Conversion method, device and storage medium for media file
CN101106637A (en) Method for playing media files in external storage device via STB
JP2010537468A (en) Method and apparatus for encoding / decoding metadata
KR101952260B1 (en) Video display terminal and method for displaying a plurality of video thumbnail simultaneously
CN111669645B (en) Video playing method and device, electronic equipment and storage medium
BRPI0706887A2 (en) "method for suppressing some multimedia content from a multimedia content presentation provided by a remote server to a client multimedia content player and method for applying and synchronizing media content filter data with a multimedia content presentation . "
US20200388304A1 (en) Synchronously playing method and device of media file, and storage medium
KR20070091962A (en) Method for offerring naration of data channel dmb using animation and recording media implementing the same
CN105049904B (en) A kind of playing method and device of multimedia file
US10965969B2 (en) Method and apparatus for playing online television program
JP2003018568A (en) Reproducing system, server apparatus and reproducer
US20070186250A1 (en) Video processing methods and systems for portable electronic devices lacking native video support
CN102123281A (en) Fast forward and fast backward treatment method and device during video playing and mobile terminal
KR20130127639A (en) Device and method for playing video
CN105847994B (en) A kind of playing method and device of multimedia file
CN106899881B (en) Audio and video file playing method and device
CN117914834A (en) Multimedia file playing method and device and electronic equipment
EP3884678A1 (en) Non-television experience triggers
US11985377B2 (en) Combined media capability for multiple media devices
CN113691860B (en) UGC media content generation method, device, equipment and storage medium
CN101960525B (en) Playback method and apparatus
US11785300B2 (en) HDMI customized ad insertion
KR100697854B1 (en) Multimedia source making and playing system and method of multimedia source making and playing thereof

Legal Events

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