CN108335706B - Seamless playing method of multimedia file, terminal equipment and storage medium - Google Patents

Seamless playing method of multimedia file, terminal equipment and storage medium Download PDF

Info

Publication number
CN108335706B
CN108335706B CN201810165901.4A CN201810165901A CN108335706B CN 108335706 B CN108335706 B CN 108335706B CN 201810165901 A CN201810165901 A CN 201810165901A CN 108335706 B CN108335706 B CN 108335706B
Authority
CN
China
Prior art keywords
multimedia file
parameter information
target multimedia
target
data 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.)
Expired - Fee Related
Application number
CN201810165901.4A
Other languages
Chinese (zh)
Other versions
CN108335706A (en
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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201810165901.4A priority Critical patent/CN108335706B/en
Publication of CN108335706A publication Critical patent/CN108335706A/en
Application granted granted Critical
Publication of CN108335706B publication Critical patent/CN108335706B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B20/00Signal processing not specific to the method of recording or reproducing; Circuits therefor
    • G11B20/10Digital recording or reproducing
    • G11B20/10009Improvement or modification of read or write signals
    • G11B20/10018Improvement or modification of read or write signals analog processing for digital recording or reproduction

Abstract

The application is applicable to the technical field of multimedia, and provides a seamless playing method of a multimedia file, a terminal device and a computer readable storage medium, wherein the method comprises the following steps: when a preset instruction is received, parameter information of a target multimedia file and parameter information of a next multimedia file of the target multimedia file are obtained, if the parameter information of the target multimedia file and the parameter information of the next multimedia file meet preset requirements, data information of the target multimedia file and data information of the next multimedia file are cached in a preset buffer space, data information is sequentially obtained from the preset buffer space, decoding and playing are carried out on the data information, and therefore continuity in the process of switching the current multimedia files can be improved through the method and the device, and seamless playing is achieved.

Description

Seamless playing method of multimedia file, terminal equipment and storage medium
Technical Field
The present application belongs to the field of multimedia technologies, and in particular, to a seamless playing method for a multimedia file, a terminal device, and a computer-readable storage medium.
Background
With the increasing requirements of people on the video quality, the data volume of video data with the same playing time is also increasing, and due to the limitation of some storage formats or the requirement of users for selecting the segments, the video data is usually divided into a plurality of multimedia files for storage.
For example, video data of a concert or a concert scene is usually divided into a plurality of multimedia files according to different songs. When a user plays video data of a concert or a concert site formed by a plurality of multimedia files, the problem of discontinuity usually occurs when switching between the multimedia files.
Disclosure of Invention
In view of this, embodiments of the present application provide a seamless playing method for multimedia files, a terminal device and a computer readable storage medium, so as to solve the problem of discontinuous multimedia file switching at present.
A first aspect of an embodiment of the present application provides a method for seamlessly playing a multimedia file, including:
when a preset instruction is received, acquiring parameter information of a target multimedia file and parameter information of a next multimedia file of the target multimedia file;
if the parameter information of the target multimedia file and the parameter information of the next multimedia file meet the preset requirement, caching the data information of the target multimedia file and the data information of the next multimedia file in a preset buffer space;
and sequentially acquiring data information from the preset buffer space, and decoding and playing the data information.
A second aspect of an embodiment of the present application provides a terminal device, including:
the system comprises an acquisition module, a processing module and a display module, wherein the acquisition module is used for acquiring parameter information of a target multimedia file and parameter information of a next multimedia file of the target multimedia file when a preset instruction is received;
the cache module is used for caching the data information of the target multimedia file and the data information of the next multimedia file in a preset buffer space if the parameter information of the target multimedia file and the parameter information of the next multimedia file meet preset requirements;
and the first playing module is used for sequentially acquiring the data information from the preset buffer space and decoding and playing the data information.
A third aspect of an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the method provided in the first aspect of the embodiment of the present application when executing the computer program.
A fourth aspect of embodiments of the present application provides a computer-readable storage medium storing a computer program which, when executed by one or more processors, performs the steps of the method provided by the first aspect of embodiments of the present application.
A fifth aspect of embodiments of the present application provides a computer program product comprising a computer program that, when executed by one or more processors, performs the steps of the method provided by the first aspect of embodiments of the present application.
In the embodiment of the application, when a preset instruction is received, the parameter information of the target multimedia file and the parameter information of the next multimedia file of the target multimedia file are acquired, if the parameter information of the target multimedia file and the parameter information of the next multimedia file meet the preset requirement, which indicates that the target multimedia file and the next multimedia file meet the requirement of seamless play in the playing process, the data information of the target multimedia file and the data information of the next multimedia file can be cached in the preset buffer space, the data information is sequentially acquired from the preset buffer space, and the data information is decoded and played, because the data information of the target multimedia file and the data information of the next multimedia file are sequentially acquired from the buffer space, the data information can be regarded as the multimedia file stored in the buffer space, so that no pause phenomenon exists in the switching process of the target multimedia file and the next multimedia file, and the seamless playing is realized because of the consistency.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic flowchart illustrating an implementation process of a seamless playing method for a multimedia file according to an embodiment of the present application;
fig. 2 is a schematic flowchart illustrating an implementation process of a method for seamlessly playing a multimedia file according to another embodiment of the present application;
fig. 3 is a schematic block diagram of a terminal device provided in an embodiment of the present application;
fig. 4 is a schematic block diagram of a terminal device according to another embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the present application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of the present application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to a determination" or "in response to a detection". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
In order to explain the technical solution described in the present application, the following description will be given by way of specific examples.
Fig. 1 is a schematic flow chart of an implementation of a seamless playing method for a multimedia file according to an embodiment of the present application, as shown in the figure, the method may include the following steps:
step S101, when a preset instruction is received, acquiring parameter information of a target multimedia file and parameter information of a next multimedia file of the target multimedia file.
In this embodiment of the present application, the obtaining parameter information of a target multimedia file and parameter information of a next multimedia file of the target multimedia file when the preset instruction is received includes:
when a playing instruction of a multimedia file selected by a user is received, taking the multimedia file as a target multimedia file, and acquiring parameter information of the target multimedia file and parameter information of a next multimedia file of the target multimedia file in a playing list;
or when receiving a playing instruction of at least two multimedia files selected by a user, generating a playing list according to the multimedia files selected by the user, and taking a first multimedia file in the playing list as a target multimedia file;
and acquiring the parameter information of the target multimedia file and the parameter information of the next multimedia file of the target multimedia file in the generated play list.
In practical application, the multimedia file may be a video file or an audio file, taking the audio file as an example, when a user wants to play a song, a song may be selected in a file directory of the terminal device, and if an instruction for the user to select a song for playing is received, the song selected by the user is taken as a target multimedia file, and simultaneously, a next multimedia file of the target multimedia file in the file directory may be taken as a next multimedia file to be played after the playing of the target multimedia file is finished. Of course, one of the multimedia files may be selected by the playing software to be played, so that in the play list of the playing software, the currently selected multimedia file is the target multimedia file, and at the same time, the next multimedia file of the target multimedia file in the play list may be confirmed.
In practical application, the following can be set: the user may select the plurality of multimedia files for playing, play according to an order selected by the user, or generate a play list of the selected plurality of multimedia files by sorting the selected plurality of multimedia files according to a preset rule (e.g., according to initials of names). And taking the first multimedia file in the generated play list as a target multimedia file.
Step S102, if the parameter information of the target multimedia file and the parameter information of the next multimedia file meet the preset requirements, caching the data information of the target multimedia file and the data information of the next multimedia file in a preset buffer space.
In this embodiment of the present application, after a target multimedia file and a next multimedia file are confirmed, parameter information of the target multimedia file and parameter information of the next multimedia file need to be obtained, where the parameter information may be file format information, and we take an android system as an example, the android system provides a multimedia database-MediaStore, and the information of the multimedia file may be extracted from the MediaStore, for example, a header, a suffix, a number of channels, a sampling rate, a number of sampling bits, and the like of the multimedia file may be obtained. If the parameter information of the target multimedia file and the parameter information of the next multimedia file meet the preset requirement, it can be considered that the parameter information of the multimedia file and the parameter information of the next multimedia file are consistent, and certainly, in practical application, part of the parameter information can be consistent, and other parameter information which does not affect seamless playing can be inconsistent, so that part of the parameter information can be preset, and when it is determined whether the parameter information of the target multimedia file and the parameter information of the next multimedia file meet the preset requirement, it is only required to determine whether the set part of the parameter information is consistent. If the consistent representation meets the requirement of seamless playing, the data information of the target multimedia file and the data information of the next multimedia file can be cached in a preset buffer space.
And step S103, sequentially acquiring data information from the preset buffer space, and decoding and playing the data information.
In the embodiment of the present application, the data information of the multimedia file cached in the preset caching space is cached in audio stream data or video stream data, that is, the data information is stored in a sequence of one frame of data and one frame of data, for example: first frame data of the target multimedia file, second frame data of the target multimedia file, … …, last frame data of the target multimedia file, first frame data of the next multimedia file, second frame data of the next multimedia file, … …, last frame data of the next multimedia file. The decoding playing is performed from a buffer queue of a preset buffer space according to the sequence of one frame of data and one frame of data, so that seamless playing between two multimedia files can be realized.
According to the embodiment of the application, when a preset instruction is received, the parameter information of the target multimedia file and the parameter information of the next multimedia file of the target multimedia file are acquired, if the parameter information of the target multimedia file and the parameter information of the next multimedia file meet the preset requirement, the data information of the target multimedia file and the data information of the next multimedia file can be cached in the preset buffer space, the data information is sequentially acquired from the preset buffer space, the data information is decoded and played, and the data information of the target multimedia file and the data information of the next multimedia file are sequentially acquired from the buffer space, so that the multimedia file can be regarded as being stored in the buffer space, and the target multimedia file and the next multimedia file can be switched without a pause phenomenon in the process of switching the target multimedia file and the next multimedia file, And the seamless playing is realized because of the consistency.
Fig. 2 is a flowchart illustrating a method for seamlessly playing a multimedia file according to another embodiment of the present application, where the method may include the following steps:
step S201, when a play instruction of a multimedia file selected by a user is received, the multimedia file is used as a target multimedia file, and parameter information of the target multimedia file and parameter information of a next multimedia file of the target multimedia file in a play list are obtained.
Step S202, if the parameter information of the target multimedia file is consistent with the parameter information of the next multimedia file, acquiring the data information of the target multimedia file, and sequentially storing the data information of the target multimedia file into a buffer queue of a preset buffer space; and sequentially acquiring data information from the preset buffer space, and decoding and playing the data information.
In this embodiment of the present application, if only one preset parameter information for comparison is available, it indicates that the target multimedia file and the next multimedia file meet the requirement of seamless play if the parameter information of the target multimedia file is consistent with the parameter information of the next multimedia file, and if the preset parameter information for comparison includes at least two parameter information, it indicates that the multimedia file and the next multimedia file meet the requirement of seamless play if the parameter information of the target multimedia file is consistent with the parameter information of the next multimedia file in the preset parameter information for comparison.
The step of sequentially storing the data information of the target multimedia file into a buffer queue of a preset buffer space comprises:
analyzing the data information of the target multimedia file, obtaining the playing position of each frame of data in the target multimedia file, and sequentially storing the playing position of each frame of data in the target multimedia file into a buffer queue of a preset buffer space.
In this embodiment of the present application, when the data information of the target multimedia file and the data information of the next multimedia file are cached in the buffer queue, each frame of stream data is cached according to the playing sequence, so that when the data information of the target multimedia file is analyzed, the playing position of each frame of data when the target multimedia file is played is obtained, and the data information is sequentially stored in the buffer queue of the preset buffer space according to the playing position of each frame of data.
Step S203, after the data information of the target multimedia file is cached, acquiring the data information of the next multimedia file, sequentially storing the data information of the next multimedia file into the buffer queue, sequentially acquiring the data information from the preset buffer space, and decoding and playing the data information.
In the embodiment of the application, the target multimedia file is cached, and after the target multimedia file is cached, the next multimedia file is cached, wherein the caching mode is consistent with the caching mode of the target multimedia file.
The sequentially storing the data information of the next multimedia file into the buffer queue comprises:
and analyzing the data information of the next multimedia file, obtaining the playing position of each frame of data in the next multimedia file, and sequentially storing the playing positions of each frame of data in the next multimedia file into the buffer queue.
After the target multimedia file and the next multimedia file are cached, the data can be read from the cache space in sequence for decoding and playing. In practical application, after the target multimedia file and the next multimedia file are cached, the data can be sequentially read from the cache space for playing, and certainly, when the caching is not completely finished, the data can be sequentially read from the cache space for playing as long as the playing progress is smaller than the caching progress.
Step S204, after the data information of the next multimedia file is cached, the next multimedia file is taken as the target multimedia file, and whether the target multimedia file has the next multimedia file or not is judged.
In this embodiment of the present application, there may be more than two multimedia files in the playlist, after the target multimedia file is played, the next multimedia file is played, and after the next multimedia file is played, the next multimedia file is also played. In fact, in the playlist, a cyclic process is performed between every two adjacent multimedia files, that is, after the data information of the next multimedia file is cached, the next multimedia file is used as the target multimedia file, and whether the next multimedia file exists in the target multimedia file is determined.
Step S205, if yes, acquiring the parameter information of the target multimedia file and the parameter information of the next multimedia file of the target multimedia file.
In this embodiment of the application, if the parameter information does not exist, the playing is stopped after the playing of the data information in the preset buffer space is finished, and if the parameter information exists, the parameter information of the target multimedia file and the parameter information of the next multimedia file of the target multimedia file need to be continuously obtained to be compared.
After step S205, steps S202 to S205 are executed in a loop, or steps S206 to S207 are executed in a loop.
Step S206, if the parameter information of the target multimedia file and the parameter information of the next multimedia file do not meet the preset requirement, acquiring the data information of the target multimedia file in the current storage space of the target multimedia file, and decoding and playing the data information.
In the embodiment of the present application, steps S202 to S205 are executed when the target multimedia file and the next multimedia file satisfy the seamless playing requirement, and if the target multimedia file and the next multimedia file do not satisfy the seamless playing requirement, steps S206 to S207 are executed.
And if the parameter information of the target multimedia file and the parameter information of the next multimedia file do not meet the preset requirement, the target multimedia file cannot be played seamlessly, and the data information of the target multimedia file is acquired in the current storage space of the target multimedia file and decoded and played without caching each frame of data of the target multimedia file and the next multimedia file according to the playing sequence.
Step S207, in the current storage space of the target multimedia file, after the target multimedia file is played, taking the next multimedia file as the target multimedia file, and obtaining the parameter information of the target multimedia file and the parameter information of the next multimedia file of the target multimedia file.
In this embodiment of the present application, after the target multimedia file is played, the next multimedia file is continuously played, and at this time, the next multimedia file may be used as the target multimedia file, and meanwhile, it is also necessary to determine whether the current target multimedia file has the next multimedia file, and if so, it is also necessary to obtain parameter information of the target multimedia file and parameter information of the next multimedia file of the target multimedia file, and determine whether to execute step S202 to step S205 or execute step S206 to step S207 according to the parameter information of the target multimedia file and the parameter information of the next multimedia file of the target multimedia file.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Fig. 3 is a schematic block diagram of a terminal device according to an embodiment of the present application, and only a part related to the embodiment of the present application is shown for convenience of description.
The terminal device 3 may be a software unit, a hardware unit, or a combination of software and hardware unit built in an existing terminal device such as a mobile phone and a notebook, may be integrated into the existing terminal device such as a mobile phone and a notebook as an independent pendant, and may exist as an independent terminal device.
The terminal device 3 includes:
the acquiring module 31 is configured to acquire parameter information of a target multimedia file and parameter information of a next multimedia file of the target multimedia file when a preset instruction is received;
a caching module 32, configured to cache the data information of the target multimedia file and the data information of the next multimedia file in a preset caching space if the parameter information of the target multimedia file and the parameter information of the next multimedia file meet preset requirements;
the first playing module 33 is configured to sequentially obtain data information from the preset buffer space, and decode and play the data information.
Optionally, the obtaining module 31 is further configured to:
when a playing instruction of a multimedia file selected by a user is received, taking the multimedia file as a target multimedia file, and acquiring parameter information of the target multimedia file and parameter information of a next multimedia file of the target multimedia file in a playing list;
or when receiving a playing instruction of at least two multimedia files selected by a user, generating a playing list according to the multimedia files selected by the user, and taking a first multimedia file in the playing list as a target multimedia file;
and acquiring the parameter information of the target multimedia file and the parameter information of the next multimedia file of the target multimedia file in the generated play list.
Optionally, the parameter information includes at least one of: header, suffix, number of channels, sampling rate, number of sampling bits of the multimedia file;
the cache module 32 includes:
a first caching unit 321, configured to obtain data information of the target multimedia file if the parameter information of the target multimedia file is consistent with the parameter information of the next multimedia file, and sequentially store the data information of the target multimedia file in a buffering queue of a preset buffering space;
the second buffer unit 322 is configured to, after the data information of the target multimedia file is buffered, obtain the data information of the next multimedia file, and sequentially store the data information of the next multimedia file in the buffer queue.
Optionally, the terminal device 3 further includes:
a first loop module 34, configured to use the next multimedia file as the target multimedia file, and determine whether the target multimedia file has the next multimedia file;
the obtaining module 31 is further configured to, if the parameter information of the target multimedia file exists, obtain parameter information of a next multimedia file of the target multimedia file.
Optionally, the first cache unit 321 is further configured to:
analyzing the data information of the target multimedia file, acquiring the playing position of each frame of data in the target multimedia file, and sequentially storing the playing position of each frame of data in the target multimedia file into a buffer queue of a preset buffer space;
the second cache unit 322 is further configured to:
and analyzing the data information of the next multimedia file, obtaining the playing position of each frame of data in the next multimedia file, and sequentially storing the playing positions of each frame of data in the next multimedia file into the buffer queue.
Optionally, the terminal device 3 further includes:
the second playing module 35 is configured to, after acquiring the parameter information of the target multimedia file and the parameter information of the next multimedia file of the target multimedia file, if the parameter information of the target multimedia file and the parameter information of the next multimedia file do not meet the preset requirement, acquire the data information of the target multimedia file in the current storage space of the target multimedia file, and decode and play the data information.
Optionally, the terminal device 3 further includes:
a second loop module 36, configured to use the next multimedia file as the target multimedia file after the target multimedia file is played in the current storage space of the target multimedia file, and obtain parameter information of the target multimedia file and parameter information of the next multimedia file of the target multimedia file.
It is obvious to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional units and modules is merely used as an example, and in practical applications, the foregoing function distribution may be performed by different functional units and modules as needed, that is, the internal structure of the terminal device is divided into different functional units or modules to perform all or part of the above-described functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the above-mentioned apparatus may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
Fig. 4 is a schematic block diagram of a terminal device according to another embodiment of the present application. As shown in fig. 4, the terminal device 4 of this embodiment includes: one or more processors 40, a memory 41, and a computer program 42 stored in the memory 41 and executable on the processors 40. The processor 40 executes the computer program 42 to implement the steps in the above-mentioned playing method embodiments of the multimedia files, such as the steps S101 to S103 shown in fig. 1. Alternatively, the processor 40, when executing the computer program 42, implements the functions of the modules/units in the terminal device embodiments described above, such as the functions of the modules 31 to 33 shown in fig. 3.
Illustratively, the computer program 42 may be partitioned into one or more modules/units that are stored in the memory 41 and executed by the processor 40 to accomplish the present application. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program 42 in the terminal device 4. For example, the computer program 42 may be divided into an acquisition module, a caching module, and a first playback module.
The acquisition module is used for acquiring parameter information of a target multimedia file and parameter information of a next multimedia file of the target multimedia file when a preset instruction is received;
the cache module is used for caching the data information of the target multimedia file and the data information of the next multimedia file in a preset buffer space if the parameter information of the target multimedia file and the parameter information of the next multimedia file meet preset requirements;
and the first playing module is used for sequentially acquiring data information from the preset buffer space and decoding and playing the data information.
Other modules or units can refer to the description of the embodiment shown in fig. 3, and are not described again here.
The terminal device includes, but is not limited to, a processor 40, and a memory 41. Those skilled in the art will appreciate that fig. 4 is only one example of a terminal device 4 and does not constitute a limitation of terminal device 4 and may include more or fewer components than shown, or some components may be combined, or different components, for example, the terminal device may also include an input device, an output device, a network access device, a bus, etc.
The Processor 40 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 41 may be an internal storage unit of the terminal device 4, such as a hard disk or a memory of the terminal device 4. The memory 41 may also be an external storage device of the terminal device 4, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the terminal device 4. Further, the memory 41 may also include both an internal storage unit and an external storage device of the terminal device 4. The memory 41 is used for storing the computer program and other programs and data required by the terminal device. The memory 41 may also be used to temporarily store data that has been output or is to be output.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. 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.
In the embodiments provided in the present application, it should be understood that the disclosed terminal device and method may be implemented in other ways. For example, the above-described terminal device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical function division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow in the method of the embodiments described above can be realized by a computer program, which can be stored in a computer-readable storage medium and can realize the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain other components which may be suitably increased or decreased as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media which may not include electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (6)

1. A method for seamless playback of a multimedia file, comprising:
step S201, when a preset instruction is received, acquiring parameter information of a target multimedia file and parameter information of a next multimedia file of the target multimedia file; wherein the multimedia file is a video file, or an audio file;
step S202, if the parameter information of the target multimedia file and the parameter information of the next multimedia file meet the preset requirements, caching the data information of the target multimedia file and the data information of the next multimedia file in a preset buffer space; wherein the parameter information is file format information, including: header, suffix, number of channels, sampling rate, number of sampling bits of the multimedia file; presetting partial parameter information, when confirming whether the parameter information of the target multimedia file and the parameter information of the next multimedia file meet preset requirements, only determining whether the preset partial parameter information is consistent, and if the preset partial parameter information is consistent, indicating that the requirement of seamless playing is met, the parameter information of the target multimedia file and the parameter information of the next multimedia file meet the preset requirements;
if the parameter information of the target multimedia file and the parameter information of the next multimedia file meet preset requirements, caching the data information of the target multimedia file and the data information of the next multimedia file in a preset buffer space comprises:
acquiring data information of the target multimedia file, and sequentially storing the data information of the target multimedia file into a buffer queue of a preset buffer space;
step S203, after the data information of the target multimedia file is cached, acquiring the data information of the next multimedia file, and sequentially storing the data information of the next multimedia file into the buffer queue;
sequentially acquiring data information from the preset buffer space, and decoding and playing the data information;
step S206, if the parameter information of the target multimedia file and the parameter information of the next multimedia file do not meet the preset requirement, acquiring the data information of the target multimedia file in the current storage space of the target multimedia file, and decoding and playing the data information;
step S207, using the next multimedia file as the target multimedia file, and acquiring parameter information of the target multimedia file and parameter information of the next multimedia file of the target multimedia file;
after the data information of the next multimedia file is cached, taking the next multimedia file as the target multimedia file, and judging whether the target multimedia file has the next multimedia file or not; in the playlist, a cyclic process is performed between every two adjacent multimedia files, that is, after the data information of the next multimedia file is cached, the next multimedia file is used as the target multimedia file, and whether the next multimedia file exists in the target multimedia file is judged;
if the target multimedia file exists, acquiring the parameter information of the target multimedia file and the parameter information of the next multimedia file of the target multimedia file for comparison;
circularly executing and judging whether the parameter information of the target multimedia file and the parameter information of the next multimedia file meet the preset requirement, and executing steps S202 to S203 if the target multimedia file and the next multimedia file meet the seamless playing requirement; if the target multimedia file and the next multimedia file do not satisfy the seamless playing requirement, steps S206 to S207 are executed.
2. The method of claim 1, wherein the obtaining the parameter information of the target multimedia file and the parameter information of the next multimedia file of the target multimedia file when the preset instruction is received comprises:
when a playing instruction of a multimedia file selected by a user is received, taking the multimedia file as a target multimedia file, and acquiring parameter information of the target multimedia file and parameter information of a next multimedia file of the target multimedia file in a playing list;
or when receiving a playing instruction of at least two multimedia files selected by a user, generating a playing list according to the multimedia files selected by the user, and taking a first multimedia file in the playing list as a target multimedia file;
and acquiring the parameter information of the target multimedia file and the parameter information of the next multimedia file of the target multimedia file in the generated play list.
3. The method of claim 1, wherein the sequentially storing the data information of the target multimedia file into the buffer queue of a predetermined buffer space comprises:
analyzing the data information of the target multimedia file, acquiring the playing position of each frame of data in the target multimedia file, and sequentially storing the playing position of each frame of data in the target multimedia file into a buffer queue of a preset buffer space;
the sequentially storing the data information of the next multimedia file into the buffer queue comprises:
and analyzing the data information of the next multimedia file, obtaining the playing position of each frame of data in the next multimedia file, and sequentially storing the playing positions of each frame of data in the next multimedia file into the buffer queue.
4. A terminal device, comprising:
the system comprises an acquisition module, a processing module and a display module, wherein the acquisition module is used for acquiring parameter information of a target multimedia file and parameter information of a next multimedia file of the target multimedia file when a preset instruction is received; wherein the multimedia file is a video file, or an audio file;
the cache module is used for caching the data information of the target multimedia file and the data information of the next multimedia file in a preset buffer space if the parameter information of the target multimedia file and the parameter information of the next multimedia file meet preset requirements; wherein the parameter information is file format information, including: header, suffix, number of channels, sampling rate, number of sampling bits of the multimedia file; presetting partial parameter information, when confirming whether the parameter information of the target multimedia file and the parameter information of the next multimedia file meet preset requirements, only determining whether the preset partial parameter information is consistent, and if the preset partial parameter information is consistent, indicating that the requirement of seamless playing is met, the parameter information of the target multimedia file and the parameter information of the next multimedia file meet the preset requirements;
if the parameter information of the target multimedia file and the parameter information of the next multimedia file meet preset requirements, caching the data information of the target multimedia file and the data information of the next multimedia file in a preset buffer space comprises:
acquiring data information of the target multimedia file, and sequentially storing the data information of the target multimedia file into a buffer queue of a preset buffer space;
after the data information of the target multimedia file is cached, acquiring the data information of the next multimedia file, and sequentially storing the data information of the next multimedia file into the buffer queue;
if the parameter information of the target multimedia file and the parameter information of the next multimedia file do not meet the preset requirement, acquiring the data information of the target multimedia file in the current storage space of the target multimedia file, and decoding and playing the data information;
taking the next multimedia file as the target multimedia file, and acquiring parameter information of the target multimedia file and parameter information of the next multimedia file of the target multimedia file;
after the data information of the next multimedia file is cached, taking the next multimedia file as the target multimedia file, and judging whether the target multimedia file has the next multimedia file or not; in the playlist, a cyclic process is performed between every two adjacent multimedia files, that is, after the data information of the next multimedia file is cached, the next multimedia file is used as the target multimedia file, and whether the next multimedia file exists in the target multimedia file is judged;
if the target multimedia file exists, acquiring the parameter information of the target multimedia file and the parameter information of the next multimedia file of the target multimedia file for comparison;
circularly executing and judging whether the parameter information of the target multimedia file and the parameter information of the next multimedia file meet the preset requirement, if the target multimedia file and the next multimedia file meet the seamless playing requirement, executing by the cache module according to the condition that the parameter information of the target multimedia file and the parameter information of the next multimedia file meet the preset requirement; if the target multimedia file and the next multimedia file do not meet the seamless playing requirement, the cache module executes the operation according to the condition that the parameter information of the target multimedia file and the parameter information of the next multimedia file do not meet the preset requirement;
and the first playing module is used for sequentially acquiring the data information from the preset buffer space and decoding and playing the data information.
5. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 3 when executing the computer program.
6. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by one or more processors, implements the steps of the method according to any one of claims 1 to 3.
CN201810165901.4A 2018-02-28 2018-02-28 Seamless playing method of multimedia file, terminal equipment and storage medium Expired - Fee Related CN108335706B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810165901.4A CN108335706B (en) 2018-02-28 2018-02-28 Seamless playing method of multimedia file, terminal equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810165901.4A CN108335706B (en) 2018-02-28 2018-02-28 Seamless playing method of multimedia file, terminal equipment and storage medium

Publications (2)

Publication Number Publication Date
CN108335706A CN108335706A (en) 2018-07-27
CN108335706B true CN108335706B (en) 2021-03-02

Family

ID=62930032

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810165901.4A Expired - Fee Related CN108335706B (en) 2018-02-28 2018-02-28 Seamless playing method of multimedia file, terminal equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108335706B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114157918A (en) * 2021-11-02 2022-03-08 统信软件技术有限公司 Media file playing method and device, computing equipment and readable storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2679015A4 (en) * 2011-06-07 2014-05-21 Huawei Tech Co Ltd Monitoring device and method for monitoring a video session in a data network
CN105657524A (en) * 2016-01-13 2016-06-08 上海视云网络科技有限公司 Seamless video switching method

Also Published As

Publication number Publication date
CN108335706A (en) 2018-07-27

Similar Documents

Publication Publication Date Title
US9794605B2 (en) Using time-stamped event entries to facilitate synchronizing data streams
CN110365973B (en) Video detection method and device, electronic equipment and computer readable storage medium
CN110213614B (en) Method and device for extracting key frame from video file
CN110267083B (en) Audio and video synchronization detection method, device, equipment and storage medium
CN107801095B (en) audio and video decoding method and terminal equipment
CN111325096B (en) Live stream sampling method and device and electronic equipment
CN110418183B (en) Audio and video synchronization method and device, electronic equipment and readable medium
US20080172140A1 (en) Audio playback time estimating apparatus and method
KR102505973B1 (en) Image processing apparatus, control method thereof and computer readable medium having computer program recorded therefor
CN111813465B (en) Information acquisition method, device, medium and equipment
CN112532998B (en) Method, device and equipment for extracting video frame and readable storage medium
CN104601535B (en) Method for processing video frequency and system
US9779093B2 (en) Spatial seeking in media files
CN110188782B (en) Image similarity determining method and device, electronic equipment and readable storage medium
CN113395538B (en) Sound effect rendering method and device, computer readable medium and electronic equipment
CN114299972A (en) Audio processing method, device, equipment and storage medium
CN108335706B (en) Seamless playing method of multimedia file, terminal equipment and storage medium
EP3598738A1 (en) Video synthesis method, apparatus and device, and video playing method, apparatus and device
CN111669599A (en) Video decoding method, video decoding device and terminal equipment
CN111263211B (en) Method for caching video data and terminal equipment
WO2023083213A1 (en) Data decoding method and apparatus, electronic device and readable storage medium
US9378341B2 (en) Electronic device and audio processing method
CN106572140B (en) Media file playing method and terminal equipment
JP3818965B2 (en) FIFO write / LIFO read tracking buffer with software and hardware loop compression
CN114268833A (en) Live broadcast content acquisition and processing method and device, electronic equipment and medium

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20210302