WO2017101412A1 - 用于安卓平台的播放方法、装置及移动终端设备 - Google Patents

用于安卓平台的播放方法、装置及移动终端设备 Download PDF

Info

Publication number
WO2017101412A1
WO2017101412A1 PCT/CN2016/089531 CN2016089531W WO2017101412A1 WO 2017101412 A1 WO2017101412 A1 WO 2017101412A1 CN 2016089531 W CN2016089531 W CN 2016089531W WO 2017101412 A1 WO2017101412 A1 WO 2017101412A1
Authority
WO
WIPO (PCT)
Prior art keywords
multimedia resource
video
audio
unit
multimedia
Prior art date
Application number
PCT/CN2016/089531
Other languages
English (en)
French (fr)
Inventor
石学会
Original Assignee
乐视控股(北京)有限公司
乐视网信息技术(北京)股份有限公司
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 乐视控股(北京)有限公司, 乐视网信息技术(北京)股份有限公司 filed Critical 乐视控股(北京)有限公司
Priority to EP16791516.4A priority Critical patent/EP3200470A4/en
Priority to US15/234,661 priority patent/US20170171281A1/en
Publication of WO2017101412A1 publication Critical patent/WO2017101412A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/443OS processes, e.g. booting an STB, implementing a Java virtual machine in an STB or power management in an STB
    • H04N21/4433Implementing client middleware, e.g. Multimedia Home Platform [MHP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/434Disassembling of a multiplex stream, e.g. demultiplexing audio and video streams, extraction of additional data from a video stream; Remultiplexing of multiplex streams; Extraction or processing of SI; Disassembling of packetised elementary stream
    • H04N21/4341Demultiplexing of audio and video streams
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/4302Content synchronisation processes, e.g. decoder synchronisation
    • H04N21/4307Synchronising the rendering of multiple content streams or additional data on devices, e.g. synchronisation of audio on a mobile phone with the video output on the TV screen
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/81Monomedia components thereof
    • H04N21/8166Monomedia components thereof involving executable data, e.g. software
    • H04N21/8193Monomedia components thereof involving executable data, e.g. software dedicated tools, e.g. video decoder software or IPMP tool

Definitions

  • the present application relates to the field of video playback, and in particular, to a playback method, device, and mobile terminal device for an Android platform.
  • the Android-based video player uses the HyperText Transfer Protocol Live Stream (HLS) video transmission and encapsulation protocol for video processing, and can only call a single player instance for audio and video processing, which is inefficient. .
  • HLS HyperText Transfer Protocol Live Stream
  • An object of the embodiments of the present invention is to provide a playback method, device, and mobile terminal device for an Android platform, and simultaneously decode a multi-channel audio and video stream on an Android platform.
  • a method for playing an Android platform includes: acquiring at least one multimedia resource; parsing a corresponding multimedia resource in a time-sharing manner; and separating the parsed multimedia resource into audio and video; The audio and video are decoded in parallel; the corresponding audio and video are played synchronously after decoding.
  • the method further includes: acquiring a play request; parsing a play address of the multimedia in the play request; and the method of acquiring the at least one multimedia resource comprises: acquiring a multimedia resource according to the play address.
  • the synchronizing the corresponding multimedia resources includes: creating a player instance; dynamically enabling or disabling the player instance to call the parsing interface to parse the corresponding multimedia resource.
  • the time-sharing corresponding multimedia resource further includes: acquiring audio and video parameter information in the multimedia resource.
  • the decoding the audio and video in parallel comprises: creating an audio handle and a video handle; respectively initiating a thread to decode the audio using the audio handle and decoding the video using the video handle.
  • a playback device for an Android platform, where the device includes: a multimedia resource acquiring unit, configured to acquire at least one multimedia resource; and a multimedia resource parsing unit, configured to perform time-sharing analysis
  • the multimedia resource acquiring unit obtains the multimedia resource;
  • the multimedia resource separating unit is configured to separate the multimedia resource parsed by the multimedia resource parsing unit into audio and video;
  • the multimedia resource decoding unit is configured to perform parallel decoding on the multimedia resource.
  • the audio and video obtained by the unit; the multimedia resource playing unit is configured to synchronously play the corresponding audio and video after the multimedia resource decoding unit decodes.
  • the device further includes: a play request obtaining unit, configured to acquire a play request; and a play address parsing unit, configured to parse a play address of the multimedia in the play request acquired by the play request acquisition unit;
  • the multimedia resource acquiring unit is configured to acquire a multimedia resource according to the play address obtained by the play address parsing unit.
  • the multimedia resource parsing unit includes: a player instance creating subunit, configured to create a player instance; a multimedia resource parsing subunit, configured to dynamically enable or disable the player instance to create a subunit The created player instance invokes the parsing interface to parse the corresponding multimedia resource.
  • the multimedia resource decoding unit includes: a handle creation subunit for creating an audio handle and a video handle; and a multimedia resource decoding subunit for respectively starting a thread to create an audio created by using the handle to create a subunit.
  • the handle decodes the audio and decodes the video with a video handle.
  • an Android mobile terminal device comprising a playback device for an Android platform as described above.
  • the method, device and mobile terminal device for multimedia preview according to the embodiment of the present invention enable the Android platform to simultaneously decode multiple audio and video streams to improve efficiency by calling the resolution interface and calling the decoding interface in parallel.
  • FIG. 1 is a flowchart showing a playing method for an Android platform according to Embodiment 1 of the present invention
  • FIG. 2 is a flowchart showing a playing method for an Android platform according to Embodiment 2 of the present invention
  • FIG. 3 is a schematic structural diagram of a playback apparatus for an Android platform according to Embodiment 3 of the present invention.
  • FIG. 4 is a schematic structural diagram of a playback apparatus for an Android platform according to Embodiment 4 of the present invention.
  • a playback method for an Android platform according to an embodiment of the present invention includes the following steps:
  • At step S110 at least one multimedia resource is acquired.
  • the multimedia device may be a video and/or audio.
  • the main body of the method is a mobile terminal device installed with an Android system, and the terminal device includes but is not limited to a mobile phone, a tablet computer, and/or a smart TV.
  • the terminal device when a user plays a video and/or audio by using a terminal device, since the terminal device has only one parsing interface, only one multimedia resource is usually processed/played.
  • the terminal device in order to play multiple multimedia resources.
  • the terminal device needs to acquire multiple multimedia resources and store the resources in a local storage card for processing. For example, it is optional to obtain video resource information such as the Romance of the Three Kingdoms, the Water Margin and the Dream of Red Mansions.
  • step S120 the corresponding multimedia resource is parsed in time sharing.
  • the time-sharing means that multiple resources share the same resolution interface.
  • the time-resolving corresponding multimedia resources is to sequentially analyze multiple multimedia resources. For example, when the terminal device obtains the video of the Romance of the Three Kingdoms, the Water Margin and the Dream of Red Mansions, it analyzes the Romance of the Three Kingdoms, the Water Margin and the Dream of Red Mansions in sequence.
  • the method for time-sharing the corresponding multimedia resource includes: acquiring audio and video parameter information in the multimedia resource.
  • video resolution eg, 176 pixels ⁇ 144 pixels, 352 pixels ⁇ 288 pixels, 704 pixels ⁇ 288 pixels, and 704 pixels ⁇ 576).
  • video frame rate such as 30Hz, 40Hz And 60Hz, etc.
  • audio sampling rate such as 22.05KHz, 44.1KHz and 48KHz, etc.
  • number of channels such as mono, two and four channels
  • bit rate such as 160kbit/s, 192kbit/s and 320kbit/s
  • the specific implementation manner of this embodiment is to parse the multimedia resource by using the output of the function as a parsing interface.
  • avformat_open_input() is used as a function to open the multimedia data stream
  • avformat_find_stream_info() is used as a function for parsing parameters of the multimedia data stream, and the output of both is used as a parsing interface.
  • step S130 the parsed multimedia resource is separated into audio and video.
  • the separation of audio and video from a certain episode of the Three Kingdoms is the process of separating the sound and image of the episode into two files.
  • the separation processing may use audio and video separation software or the ffmpeg program that is included in the Android platform.
  • the separation of the multimedia resources requires a process, and the multimedia resources that have not been separated may remain in the memory card, and the separated audio and video may be temporarily placed in the cache or may be stored in the memory card in advance.
  • the folder For example, when separating a certain set of the Three Kingdoms, you can set the folder "123" in the memory card to store the unseparated Three Kingdoms, and set the folders "a" and "b" to store the separated audio. And video.
  • step S140 the audio and video are decoded in parallel.
  • parallel refers to a group of programs executing at an independent asynchronous speed.
  • the terminal device acquires multiple multimedia resources, after the audio and video are separated from the multimedia resources, multiple sets of audio and multiple sets of video are obtained.
  • the terminal device decodes these audio and video, it can decode at the same time in a certain period of time.
  • the decoding interfaces used for decoding audio and video are respectively a sound card and a graphics card. Since the amount of data of the audio is small, the decoded data can be directly sent to the sound device; since the amount of data of the video is large, the decoded data is still placed on the memory card.
  • the decoded audio is directly sent to the sound device, and the decoded video is placed in the decoded video buffer queue or/and the storage card preset folder (for example, in the folder "c"), the undecoded video data in the decoded folder "b" is gradually reduced, and the decoded video data in the decoded video buffer queue or/and the folder "c" is gradually increased.
  • the video has a large amount of data compared to the audio, and the video can be preferentially decoded.
  • the audio and video decoding can be performed after the audio and video are completely separated.
  • the audio and video separation and the audio and video decoding can be performed simultaneously, that is, while the audio and video are separated, the separated audio and video synchronization is decoded to improve efficiency and save time.
  • step S150 the corresponding audio and video are played synchronously after decoding.
  • the terminal device acquires multiple multimedia resources, multiple sets of audio and video are obtained after decoding. Therefore, when the audio and video are synchronously played, multiple multimedia resources can be simultaneously played. For example, using multiple windows on a terminal device can simultaneously play the Three Kingdoms, Water Margin and Dream of Red Mansions.
  • multimedia playback can be performed after all audio and video decoding is completed.
  • multimedia playback and audio and video decoding are performed simultaneously to improve efficiency and save time.
  • the playing method for the Android platform provided by the embodiment of the present invention enables the Android platform to simultaneously decode multiple audio and video streams to improve efficiency by calling the parsing interface and calling the decoding interface in parallel.
  • FIG. 2 is a flow chart showing a playing method for an Android platform according to a second embodiment of the present invention.
  • the method for multimedia preview of this embodiment specifically includes the following steps:
  • a play request is acquired.
  • the terminal device when the user uses the mobile terminal device to play the multimedia resource, click or install the name or video frame of the multimedia resource, and the terminal device acquires the play request.
  • the terminal device can acquire a play request of multiple multimedia resources at the same time.
  • the terminal device searches for a play address of the corresponding multimedia resource according to the play request.
  • a play address of the corresponding multimedia resource For example, the play address of the Romance of the Three Kingdoms, the play address of the Water Margin and the play address of the Dream of Red Mansions.
  • step S230 the multimedia resource is acquired according to the play address.
  • the play address of the Romance of the Three Kingdoms the play address of the Water Margin and the play address of the Dream of Red Mansions, the resource information of the Romance of the Three Kingdoms, the Water Margin and the Dream of Red Mansions are respectively obtained.
  • the method step can be regarded as a specific implementation manner of the foregoing S110.
  • a player instance is created.
  • an instance refers to some database programs that can support database operations.
  • the player instance refers to a program capable of supporting playback, like a controller, controlling multimedia resources for playing.
  • the terminal device can create multiple player instances to simultaneously control multiple multimedia resources to improve efficiency and save time.
  • step S250 the dynamic enable or disable of the player instance calls the parsing interface to parse the corresponding multimedia resource.
  • a parsing interface can only allow one player instance to parse the corresponding multimedia resource at the same time, for multiple player instances, a startup parsing is required, and other stops parsing.
  • a player instance is parsed, another player instance immediately parses the multimedia resource, so dynamically enabling or disabling the player instance to call the parsing interface can make the operation more compact and improve efficiency.
  • step S240 and step S250 can be regarded as a specific implementation manner of step S120 in the first embodiment.
  • step S260 the parsed multimedia resource is separated into audio and video.
  • step S260 is the same as the content of S130 in the first embodiment.
  • an audio handle and a video handle are created.
  • the handle is used to identify different instances of different objects and similar objects in the application, and the program can access the information of the corresponding object through the handle. For example, a window, button, icon, scroll bar, output device, control or file.
  • corresponding handles are respectively created for the audio and video to provide an identifier.
  • step S280 a thread is respectively activated to decode the audio by using an audio handle and to decode the video by using a video handle.
  • each audio or video needs to start a separate thread to decode through the corresponding handle to improve efficiency.
  • the audio and video of the Three Kingdoms, the audio and video of the Water Margin, and the audio and video of Dream of the Red Chamber need to start separate threads and decode them through the corresponding handles.
  • step S270 and step S280 can be regarded as a specific implementation manner of step S140 in the first embodiment.
  • step S290 the corresponding audio and video are played synchronously after decoding.
  • step S290 is the same as step S150 in the first embodiment.
  • the playing method for the Android platform performs the time-sharing calling interface, the audio and video separation of multiple multimedia resources, and uses multiple player instances to call the decoding interface in parallel to perform audio and video on the multimedia resource.
  • Synchronous decoding enables the Android platform to simultaneously decode multiple audio and video streams, improving efficiency, and the terminal device can also play different multimedia resources through multiple windows, thereby improving the user's viewing experience.
  • FIG. 3 is a schematic structural diagram showing a playback apparatus for an Android platform according to Embodiment 3 of the present invention.
  • the apparatus for multimedia preview in this embodiment may be used to perform the method steps of FIG. 1 above, where the apparatus includes: a multimedia resource acquiring unit 310, a multimedia resource parsing unit 320, a multimedia resource separating unit 330, and a multimedia resource decoding unit. 340 and multimedia resource playing unit 350.
  • the multimedia resource obtaining unit 310 is configured to acquire at least one multimedia resource.
  • the multimedia resource parsing unit 320 is configured to analyze the multimedia resources acquired by the corresponding multimedia resource acquiring unit 310 in a time-sharing manner.
  • the multimedia resource separation unit 330 is configured to perform audio and video separation on the multimedia resources parsed by the multimedia resource parsing unit 320.
  • the multimedia resource decoding unit 340 is configured to decode the audio and video acquired by the multimedia resource separation unit 330 in parallel.
  • the multimedia resource playing unit 350 is configured to decode the corresponding audio and video after the multimedia resource decoding unit 340 decodes.
  • the playback device for the Android platform provided by the embodiment of the present invention enables the Android platform to simultaneously decode multiple audio and video streams to improve efficiency by calling the resolution interface and calling the decoding interface in parallel.
  • FIG. 4 is a schematic structural diagram showing a playback apparatus for an Android platform according to Embodiment 4 of the present invention.
  • the apparatus for multimedia preview in this embodiment may be used to perform the method steps of FIG. 2, where the apparatus includes: a play request obtaining unit 360, a play address parsing unit 370, a multimedia resource acquiring unit 310, and a multimedia resource parsing unit. 320.
  • the play request acquisition unit 360 is configured to acquire a play request.
  • the play address resolution unit 370 is configured to parse the play address of the multimedia in the play request acquired by the play request acquisition unit 360.
  • the multimedia resource obtaining unit 310 is specifically configured to acquire the multimedia resource according to the play address obtained by the play address parsing unit 370.
  • the multimedia resource parsing unit 320 is configured to analyze the multimedia resources acquired by the corresponding multimedia resource acquiring unit 310 in a time-sharing manner.
  • the multimedia resource parsing unit includes a player instance creation subunit 321 and a multimedia resource parsing subunit 322.
  • the player instance creation sub-unit 321 is used to create a player instance.
  • the multimedia resource parsing sub-unit 322 is configured to dynamically enable or disable the player instance created by the player instance creation sub-unit 321 to call the parsing interface to parse the corresponding multimedia resource.
  • the multimedia resource separation unit 330 is configured to perform audio and video separation on the multimedia resources parsed by the multimedia resource parsing unit 320.
  • the multimedia resource decoding unit 340 is configured to decode the audio and video acquired by the multimedia resource separation unit 330 in parallel.
  • the media resource decoding unit includes: a handle creation sub-unit 341 and a multimedia resource decoding sub-unit 342.
  • the handle creation subunit 341 is used to create an audio handle and a video handle.
  • the multimedia resource decoding sub-unit 342 is configured to respectively start a thread to decode audio by using an audio handle created by the handle creation sub-unit and decode the video by using a video handle.
  • the multimedia resource playing unit 350 is configured to decode the corresponding audio and video after the multimedia resource decoding unit 340 decodes.
  • the playing device for the Android platform provided by the embodiment of the present invention performs the time-sharing calling interface, the audio and video separation of multiple multimedia resources, and uses multiple player instances to call the decoding interface in parallel to perform audio and video on the multimedia resource. Synchronous decoding, making the Android platform The multi-channel audio and video stream can be decoded at the same time, the efficiency is improved, and the terminal device can also play different multimedia resources through multiple windows, thereby improving the user's viewing experience.
  • the embodiment of the invention further provides an Android mobile terminal device, which comprises the above device for multimedia preview.
  • the mobile terminal device may be a mobile phone, a tablet computer, a smart TV, or the like.
  • the Android mobile terminal device provided by the embodiment of the present invention synchronously decodes the audio and video of the multimedia resource by calling the resolution interface, the audio and video separation, and using multiple player instances to call the decoding interface in parallel.
  • the Android platform can decode multiple audio and video streams at the same time, which improves the efficiency, and the terminal device can also play different multimedia resources through multiple windows, thereby improving the user's viewing experience.
  • the above method according to the present invention can be implemented in hardware, firmware, or as software or computer code that can be stored in a recording medium such as a CD ROM, a RAM, a floppy disk, a hard disk, or a magneto-optical disk, or can be downloaded through a network.
  • a recording medium such as a CD ROM, a RAM, a floppy disk, a hard disk, or a magneto-optical disk, or can be downloaded through a network.
  • the computer code originally stored in a remote recording medium or non-transitory machine readable medium and to be stored in a local recording medium, whereby the methods described herein can be stored using a general purpose computer, a dedicated processor, or programmable or dedicated Such software processing on a recording medium of hardware such as an ASIC or an FPGA.
  • a computer, processor, microprocessor controller or programmable hardware includes storage components (eg, RAM, ROM, flash memory, etc.) that can store or receive software or computer code, when the software or computer code is The processing methods described herein are implemented when the processor or hardware is accessed and executed. Moreover, when a general purpose computer accesses code for implementing the processing shown herein, the execution of the code converts the general purpose computer into a special purpose computer for performing the processing shown herein.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Telephone Function (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

本发明实施例提供一种用于安卓平台的播放方法、装置及移动终端设备,所述方法包括:获取至少一个多媒体资源;分时解析对应的多媒体资源;将解析的多媒体资源进行音频和视频分离;并行解码所述音频和视频;解码后同步播放相应的音频和视频。本实施例通过分时调用解析接口和并行调用解码接口,使得安卓平台可以同时解码多路音视频流,以提高效率。

Description

用于安卓平台的播放方法、装置及移动终端设备
本申请要求于2015年12月14日提交中国专利局、申请号为201510929132.7的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及视频播放领域,尤其涉及一种用于安卓平台的播放方法、装置及移动终端设备。
背景技术
随着安卓智能设备性能的不断提高,用户对于视频观看的需求也不断增加。目前基于安卓的视频播放器采用超文本传输协议流媒体直播系统(HyperText Transfer ProtocolLive Stream,HLS)的视频传输和封装协议进行视频处理,仅可以调用单个播放器实例进行音视频的处理,效率较低。
发明内容
本发明实施例的目的在于,提供一种用于安卓平台的播放方法、装置及移动终端设备,在安卓平台上同时解码多路音视频流。
根据本发明实施例的一方面,提供一种用于安卓平台的播放方法,所述方法包括:获取至少一个多媒体资源;分时解析对应的多媒体资源;将解析的多媒体资源进行音频和视频分离;并行解码所述音频和视频;解码后同步播放相应的音频和视频。
在一个实施例中,所述方法还包括:获取播放请求;解析所述播放请求中的多媒体的播放地址;所述获取至少一个多媒体资源的方法包括:根据所述播放地址,获取多媒体资源。
在一个实施例中,所述分时解析对应的多媒体资源包括:创建播放器实例;动态的启用或停用所述播放器实例调用解析接口解析对应的多媒体资源。
在一个实施例中,所述分时解析对应的多媒体资源还包括:获取所述多媒体资源中的音视频参数信息。
在一个实施例中,所述并行解码所述音频和视频包括:创建音频句柄和视频句柄;分别启动一个线程采用音频句柄解码音频和采用视频句柄解码视频。
根据本发明实施例的另一方面,提供一种用于安卓平台的播放装置,所述装置包括:多媒体资源获取单元,用于获取至少一个多媒体资源;多媒体资源解析单元,用于分时解析对应的所述多媒体资源获取单元获取的多媒体资源;多媒体资源分离单元,用于将所述多媒体资源解析单元解析的多媒体资源进行音频和视频分离;多媒体资源解码单元,用于并行解码所述多媒体资源分离单元获取的所述音频和视频;多媒体资源播放单元,用于所述多媒体资源解码单元解码后同步播放相应的音频和视频。
在一个实施例中,所述装置还包括:播放请求获取单元,用于获取播放请求;播放地址解析单元,用于解析所述播放请求获取单元获取的所述播放请求中的多媒体的播放地址;所述多媒体资源获取单元具体用于,根据所述播放地址解析单元获取的所述播放地址,获取多媒体资源。
在一个实施例中,所述多媒体资源解析单元包括:播放器实例创建子单元,用于创建播放器实例;多媒体资源解析子单元,用于动态的启用或停用所述播放器实例创建子单元创建的所述播放器实例调用解析接口解析对应的多媒体资源。
在一个实施例中,所述多媒体资源解码单元包括:句柄创建子单元,用于创建音频句柄和视频句柄;多媒体资源解码子单元,用于分别启动一个线程采用所述句柄创建子单元创建的音频句柄解码音频和采用视频句柄解码视频。
根据本发明实施例的另一方面,提供一种安卓移动终端设备,所述安卓移动终端设备包括如前所述的用于安卓平台的播放装置。
根据本发明实施例提供的用于多媒体预览的方法、装置及移动终端设备,通过分时调用解析接口和并行调用解码接口,使得安卓平台可以同时解码多路音视频流,以提高效率。
附图说明
图1示出根据本发明实施例一的用于安卓平台的播放方法的流程图;
图2示出根据本发明实施例二的用于安卓平台的播放方法的流程图;
图3示出根据本发明实施例三的用于安卓平台的播放装置的结构示意图;
图4示出根据本发明实施例四的用于安卓平台的播放装置的结构示意图。
具体实施方式
下面结合附图详细描述本发明的示例性实施例。
实施例一
图1是示出根据本发明实施例一的用于安卓平台的播放方法的流程图。参照图1,本发明实施例用于安卓平台的播放方法包括以下步骤:
在步骤S110,获取至少一个多媒体资源。
其中,多媒体可以是视频和/或音频,本方法的执行主体为安装有安卓系统的移动终端设备,该终端设备包括但不限于手机、平板电脑和/或智能电视机等。
现有技术中,用户在利用终端设备播放视频和/或音频时,由于终端设备只有一个解析接口,因此,通常只会处理/播放一个多媒体资源,在本实施例中,为了播放多个多媒体资源,终端设备需要获取多个多媒体资源,并将这些资源存储在本地的储存卡中以待处理。例如,可选的,同时获取三国演义、水浒传和红楼梦等视频资源信息。
在步骤S120,分时解析对应的多媒体资源。
在本实施例中,分时是指多个资源共用同一个解析接口,在本实施例中,分时解析对应的多媒体资源即为对多个多媒体资源进行顺序解析。例如,当终端设备获取到三国演义、水浒传和红楼梦的视频后,按照先后顺序分别对三国演义、水浒传和红楼梦进行解析。
在本实施例中,分时解析对应的多媒体资源的方法包括:获取多媒体资源中的音视频参数信息。
具体地,在对多媒体资源进行解析时,通常需要获取视频和/或音频的参数,包括视频分辨率(如176像素×144像素、352像素×288像素、704像素×288像素和704像素×576像素等)、视频帧率(如30Hz、40Hz 和60Hz等)、音频采样率(如22.05KHz、44.1KHz和48KHz等)、声道数(如单声道、二声道和四声道)和比特率(如160kbit/s、192kbit/s和320kbit/s)等。
本实施例的具体实现方式为通过调用函数的输出作为解析接口对多媒体资源进行解析。例如,将avformat_open_input()作为打开多媒体数据流的函数,将avformat_find_stream_info()作为用来解析多媒体数据流参数的函数,并将二者的输出结果作为解析接口。
在步骤S130,将解析的多媒体资源进行音频和视频分离。
例如,对三国演义的某一集进行音频和视频的分离即为将该集的声音和图像分开成为两个文件的处理。在本实施例中,分离处理可以用音视频分离软件也可以用安卓平台中自带的ffmpeg程序。
在本实施例中,多媒体资源的分离需要一个过程,尚未分离的多媒体资源可留在储存卡中,分离好的音频和视频可暂时放置在缓存中也可以储存在存储卡中提前预设的文件夹内。例如,对三国演义的某一集进行分离时,可在存储卡中设置文件夹“123”用来存放未分离的三国演义,设置文件夹“a”和“b”分别存储已经分离好的音频和视频。
在步骤S140,并行解码音频和视频。
具体地,并行指一组程序按独立异步的速度执行。在本实施例中,由于终端设备获取多个多媒体资源,对这些多媒体资源进行音视频分离后,得到多组音频和多组视频。终端设备对这些音视频进行解码时,做到在某个时间段内同时解码。
在本实施例中,对音频和视频进行解码用到的解码接口分别为声卡和显卡。由于音频的数据量很小,可将解码后的数据直接送给声音设备;由于视频的数据量大,对解码后的数据仍放置在存储卡中。
具体地,音视频分离后的三国演义,音频和视频均未解码,解码后的音频直接送给声音设备,解码后的视频放置在已解码视频缓存队列或/和储存卡预设的文件夹(例如文件夹“c”)中,经过解码文件夹“b”中未解码的视频数据逐渐变少,已解码视频缓存队列或/和文件夹“c”中已解码的视频数据逐渐变多。优选地,和音频相比,视频的数据量大,可优先对视频进行解码。
在本实施例中,可以在音视频完全分离后进行音视频的解码。优选地,音视频分离和音视频解码可同步进行,即在分离音视频的同时,对已经分离完毕的音视频同步进行解码,以提高效率,节省时间。
在步骤S150,解码后同步播放相应的音频和视频。
具体地,由于终端设备获取多个多媒体资源,解码后得到多组音频和视频,因此对这是音频和视频进行同步播放时可实现多个多媒体资源同时播放。例如,在终端设备上利用多个窗口可同时播放三国演义、水浒传和红楼梦。
在本实施例中,可在所有的音频和视频解码完成后进行多媒体的播放。优选地,多媒体的播放和音视频解码同步进行,以提高效率,节省时间。
本发明实施例提供的用于安卓平台的播放方法,通过分时调用解析接口和并行调用解码接口,使得安卓平台可以同时解码多路音视频流,以提高效率。
实施例二
图2是示出根据本发明实施例二的用于安卓平台的播放方法的流程图。参照图2,本实施例的用于多媒体预览的方法具体包括如下步骤:
在步骤S210,获取播放请求。
具体地,用户利用移动终端设备进行多媒体资源的播放时,点击或安装该多媒体资源的名称或视频帧,终端设备获取该播放请求。优选地,终端设备可同时获取多个多媒体资源的播放请求。
S220,解析播放请求中的多媒体的播放地址。
具体地,终端设备根据播放请求,查找对应的多媒体资源的播放地址。例如,三国演义的播放地址、水浒传的播放地址和红楼梦的播放地址等。
在步骤S230,根据播放地址,获取多媒体资源。
例如,根据三国演义的播放地址、水浒传的播放地址和红楼梦的播放地址分别获取三国演义、水浒传和红楼梦的资源信息。
在本实施例中,该方法步骤可视为上述S110的具体实现方式。
在步骤S240,创建播放器实例。
在本实施例中,实例是指一些能支撑数据库运行的数据库程序。在本实施例中,播放器实例是指能够支持播放的程序,如同一个控制器,控制多媒体资源进行播放。
优选地,终端设备可创建多个播放器实例同时对多个多媒体资源进行控制,以提高效率,节省时间。
在步骤S250,动态的启用或停用播放器实例调用解析接口解析对应的多媒体资源。
由于一个解析接口同一时刻只可允许一个播放器实例解析相应的多媒体资源,因此,对于多个播放器实例来说,则需要一个启动解析,其他的停止解析。当一个播放器实例解析完成后,另一个播放器实例紧接着进行解析多媒体资源,这样动态的启用或停用播放器实例调用解析接口可使操作更加紧凑,提高了效率。
在本实施例中,步骤S240和步骤S250可视为上述实施例一中步骤S120的具体实现方式。
在步骤S260,将解析的多媒体资源进行音频和视频分离。
具体地,步骤S260与上述实施例一中S130内容相同。
在步骤S270,创建音频句柄和视频句柄。
具体地,句柄是用来标识应用程序中不同对象和同类对象中不同的实例,程序可通过句柄访问相应的对象的信息。例如,一个窗口,按钮,图标,滚动条,输出设备,控件或者文件等。在本实施例中,在对音视频进行分离后,分别对音频和视频创建相应的句柄,以提供标识。
在步骤S280,分别启动一个线程采用音频句柄解码音频和采用视频句柄解码视频。
具体地,在对多个音频和视频进行解码时,每一个音频或视频都需要启动一个独立的线程通过相对应的句柄进行解码,以提高效率。例如,三国演义的音频和视频、水浒传的音频和视频以及红楼梦的音频和视频均需要启动独立的线程,并通过相对应的句柄进行解码。
在本实施例中,步骤S270和步骤S280可视为上述实施例一中步骤S140的具体实现方式。
在步骤S290,解码后同步播放相应的音频和视频。
具体地,步骤S290与上述实施例一中步骤S150相同。
本发明实施例提供的用于安卓平台的播放方法,通过对多个多媒体资源进行分时调用解析接口、音视频分离,利用多个播放器实例并行调用解码接口,对多媒体资源的音频和视频进行同步解码,使得安卓平台可以同时解码多路音视频流,提高了效率,并且终端设备还可以通过多窗口播放不同的多媒体资源,提高了用户的观看体验。
实施例三
图3是示出根据本发明实施例三的用于安卓平台的播放装置的结构示意图。
参照图3,本实施例的用于多媒体预览的装置可用于执行上述图1的方法步骤,该装置包括:多媒体资源获取单元310、多媒体资源解析单元320、多媒体资源分离单元330、多媒体资源解码单元340和多媒体资源播放单元350。
多媒体资源获取单元310用于获取至少一个多媒体资源。
多媒体资源解析单元320用于分时解析对应的多媒体资源获取单元310获取的多媒体资源。
多媒体资源分离单元330用于将多媒体资源解析单元320解析的多媒体资源进行音频和视频分离。
多媒体资源解码单元340用于并行解码多媒体资源分离单元330获取的音频和视频。
多媒体资源播放单元350用于多媒体资源解码单元340解码后同步播放相应的音频和视频。
本发明实施例提供的用于安卓平台的播放装置,通过分时调用解析接口和并行调用解码接口,使得安卓平台可以同时解码多路音视频流,以提高效率。
实施例四
图4是示出根据本发明实施例四的用于安卓平台的播放装置的结构示意图。
参照图4,本实施例的用于多媒体预览的装置可用于执行上述图2的方法步骤,该装置包括:播放请求获取单元360、播放地址解析单元370、多媒体资源获取单元310、多媒体资源解析单元320、多媒体资源分离单元330、多媒体资源解码单元340和多媒体资源播放单元350。
播放请求获取单元360用于获取播放请求。
播放地址解析单元370用于解析播放请求获取单元360获取的播放请求中的多媒体的播放地址。
多媒体资源获取单元310具体用于,根据播放地址解析单元370获取的播放地址,获取多媒体资源。
多媒体资源解析单元320用于分时解析对应的多媒体资源获取单元310获取的多媒体资源。
在本实施例中,多媒体资源解析单元包括:播放器实例创建子单元321和多媒体资源解析子单元322。
播放器实例创建子单元321用于创建播放器实例。
多媒体资源解析子单元322用于动态的启用或停用播放器实例创建子单元321创建的播放器实例调用解析接口解析对应的多媒体资源。
多媒体资源分离单元330用于将多媒体资源解析单元320解析的多媒体资源进行音频和视频分离。
多媒体资源解码单元340用于并行解码多媒体资源分离单元330获取的音频和视频。
在本实施例中,媒体资源解码单元包括:句柄创建子单元341和多媒体资源解码子单元342。
句柄创建子单元341用于创建音频句柄和视频句柄。
多媒体资源解码子单元342用于分别启动一个线程采用句柄创建子单元创建的音频句柄解码音频和采用视频句柄解码视频。
多媒体资源播放单元350用于多媒体资源解码单元340解码后同步播放相应的音频和视频。
本发明实施例提供的用于安卓平台的播放装置,通过对多个多媒体资源进行分时调用解析接口、音视频分离,利用多个播放器实例并行调用解码接口,对多媒体资源的音频和视频进行同步解码,使得安卓平台 可以同时解码多路音视频流,提高了效率,并且终端设备还可以通过多窗口播放不同的多媒体资源,提高了用户的观看体验。
实施例五
本发明实施例还提供了一种安卓移动终端设备,该设备包括上述用于多媒体预览的装置。
具体地,该移动终端设备可以为手机、平板电脑或智能电视机等。
本发明实施例提供的安卓移动终端设备,通过对多个多媒体资源进行分时调用解析接口、音视频分离,利用多个播放器实例并行调用解码接口,对多媒体资源的音频和视频进行同步解码,使得安卓平台可以同时解码多路音视频流,提高了效率,并且终端设备还可以通过多窗口播放不同的多媒体资源,提高了用户的观看体验。
需要指出,根据实施的需要,可将本申请中描述的各个步骤/部件拆分为更多步骤/部件,也可将两个或多个步骤/部件或者步骤/部件的部分操作组合成新的步骤/部件,以实现本发明的目的。
上述根据本发明的方法可在硬件、固件中实现,或者被实现为可存储在记录介质(诸如CD ROM、RAM、软盘、硬盘或磁光盘)中的软件或计算机代码,或者被实现通过网络下载的原始存储在远程记录介质或非暂时机器可读介质中并将被存储在本地记录介质中的计算机代码,从而在此描述的方法可被存储在使用通用计算机、专用处理器或者可编程或专用硬件(诸如ASIC或FPGA)的记录介质上的这样的软件处理。可以理解,计算机、处理器、微处理器控制器或可编程硬件包括可存储或接收软件或计算机代码的存储组件(例如,RAM、ROM、闪存等),当所述软件或计算机代码被计算机、处理器或硬件访问且执行时,实现在此描述的处理方法。此外,当通用计算机访问用于实现在此示出的处理的代码时,代码的执行将通用计算机转换为用于执行在此示出的处理的专用计算机。
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。

Claims (10)

  1. 一种用于安卓平台的播放方法,所述方法包括:
    获取至少一个多媒体资源;
    分时解析对应的多媒体资源;
    将解析的多媒体资源进行音频和视频分离;
    并行解码所述音频和视频;
    解码后同步播放相应的音频和视频。
  2. 根据权利要求1所述的方法,其中,所述方法还包括:
    获取播放请求;
    解析所述播放请求中的多媒体的播放地址;
    所述获取至少一个多媒体资源的方法包括:根据所述播放地址,获取多媒体资源。
  3. 根据权利要求1或2所述的方法,其中,所述分时解析对应的多媒体资源包括:
    创建播放器实例;
    动态的启用或停用所述播放器实例调用解析接口解析对应的多媒体资源。
  4. 根据权利要求3所述的方法,其中,所述分时解析对应的多媒体资源还包括:
    获取所述多媒体资源中的音视频参数信息。
  5. 根据权利要求1至4任一项所述的方法,其中,所述并行解码所述音频和视频包括:
    创建音频句柄和视频句柄;
    分别启动一个线程采用音频句柄解码音频和采用视频句柄解码视频。
  6. 一种用于安卓平台的播放装置,所述装置包括:
    多媒体资源获取单元,用于获取至少一个多媒体资源;
    多媒体资源解析单元,用于分时解析对应的所述多媒体资源获取单元获取的多媒体资源;
    多媒体资源分离单元,用于将所述多媒体资源解析单元解析的多媒体资源进行音频和视频分离;
    多媒体资源解码单元,用于并行解码所述多媒体资源分离单元获取的所述音频和视频;
    多媒体资源播放单元,用于所述多媒体资源解码单元解码后同步播放相应的音频和视频。
  7. 根据权利要求6所述的装置,其中,所述装置还包括:
    播放请求获取单元,用于获取播放请求;
    播放地址解析单元,用于解析所述播放请求获取单元获取的所述播放请求中的多媒体的播放地址;
    所述多媒体资源获取单元具体用于,根据所述播放地址解析单元获取的所述播放地址,获取多媒体资源。
  8. 根据权利要求6或7所述的装置,其中,所述多媒体资源解析单元包括:
    播放器实例创建子单元,用于创建播放器实例;
    多媒体资源解析子单元,用于动态的启用或停用所述播放器实例创建子单元创建的所述播放器实例调用解析接口解析对应的多媒体资源。
  9. 根据权利要求6,7或8所述的装置,其中,所述多媒体资源解码单元包括:
    句柄创建子单元,用于创建音频句柄和视频句柄;
    多媒体资源解码子单元,用于分别启动一个线程采用所述句柄创建子单元创建的音频句柄解码音频和采用视频句柄解码视频。
  10. 一种安卓移动终端设备,所述安卓移动终端设备包括如权利要求6-9中任意一项所述的用于安卓平台的播放装置。
PCT/CN2016/089531 2015-12-14 2016-07-10 用于安卓平台的播放方法、装置及移动终端设备 WO2017101412A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP16791516.4A EP3200470A4 (en) 2015-12-14 2016-07-10 Playing method and device for android platform, and mobile terminal device
US15/234,661 US20170171281A1 (en) 2015-12-14 2016-08-11 Play method and apparatus and mobile terminal device for android platform

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510929132.7A CN105898538A (zh) 2015-12-14 2015-12-14 用于安卓平台的播放方法、装置及移动终端设备
CN201510929132.7 2015-12-14

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US15/234,661 Continuation US20170171281A1 (en) 2015-12-14 2016-08-11 Play method and apparatus and mobile terminal device for android platform

Publications (1)

Publication Number Publication Date
WO2017101412A1 true WO2017101412A1 (zh) 2017-06-22

Family

ID=57002437

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/089531 WO2017101412A1 (zh) 2015-12-14 2016-07-10 用于安卓平台的播放方法、装置及移动终端设备

Country Status (3)

Country Link
EP (1) EP3200470A4 (zh)
CN (1) CN105898538A (zh)
WO (1) WO2017101412A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2734109C1 (ru) * 2017-09-30 2020-10-13 Зте Корпорейшн Способ воспроизведения нескольких видео на мобильном терминале, мобильный терминал и считываемая запоминающая среда

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106954097B (zh) * 2017-03-03 2019-08-02 腾讯科技(深圳)有限公司 视频播放的控制方法和装置
CN107613369B (zh) * 2017-10-10 2020-06-16 海信视像科技股份有限公司 基于GStreamer框架的视频播放方法、装置及电子设备
CN110213636B (zh) * 2018-04-28 2023-01-10 腾讯科技(深圳)有限公司 在线视频的视频帧生成方法、装置、存储介质及设备
CN109168063B (zh) * 2018-09-10 2021-01-26 苏宁智能终端有限公司 一种视频广告播放方法及终端
CN109257646B (zh) * 2018-10-15 2020-09-22 Oppo广东移动通信有限公司 视频处理方法、装置、电子设备及计算机可读介质
CN109857953A (zh) * 2018-11-08 2019-06-07 北京达佳互联信息技术有限公司 音视频分离方法、装置、电子设备及可读存储介质
CN110248233B (zh) * 2019-07-17 2021-11-16 腾讯科技(深圳)有限公司 一种音视频播放方法、装置、设备及存储介质
CN113225570B (zh) * 2021-03-31 2022-09-13 深圳市鹰硕技术有限公司 基于全局虚拟数据视图的播放处理方法及相关设备

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1852425A (zh) * 2006-05-19 2006-10-25 北京中星微电子有限公司 在播放多媒体文件时获得当前播放时间的方法和装置
CN103581754A (zh) * 2012-07-20 2014-02-12 腾讯科技(深圳)有限公司 一种数据显示方法及智能设备
CN103680551A (zh) * 2012-09-21 2014-03-26 深圳市快播科技有限公司 一种播放器及其多视频并行播放的方法
WO2014093713A1 (en) * 2012-12-12 2014-06-19 Smule, Inc. Audiovisual capture and sharing framework with coordinated, user-selectable audio and video effects filters
CN103957447A (zh) * 2014-05-08 2014-07-30 济南四叶草信息技术有限公司 悬浮多窗口播放系统
CN104333808A (zh) * 2014-11-14 2015-02-04 复旦大学 用于Android及Linux智能电视机上的通用播放器

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2477397A1 (en) * 2011-01-12 2012-07-18 Nxp B.V. Handling the initialization for HTTP streaming of multimedia files via parallel TCP connections
CN103200458A (zh) * 2013-04-09 2013-07-10 华为终端有限公司 一种电视节目信息显示方法及用户设备
CN104519319A (zh) * 2014-12-11 2015-04-15 北京中星微电子有限公司 用于电子地图的监控视频显示方法和装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1852425A (zh) * 2006-05-19 2006-10-25 北京中星微电子有限公司 在播放多媒体文件时获得当前播放时间的方法和装置
CN103581754A (zh) * 2012-07-20 2014-02-12 腾讯科技(深圳)有限公司 一种数据显示方法及智能设备
CN103680551A (zh) * 2012-09-21 2014-03-26 深圳市快播科技有限公司 一种播放器及其多视频并行播放的方法
WO2014093713A1 (en) * 2012-12-12 2014-06-19 Smule, Inc. Audiovisual capture and sharing framework with coordinated, user-selectable audio and video effects filters
CN103957447A (zh) * 2014-05-08 2014-07-30 济南四叶草信息技术有限公司 悬浮多窗口播放系统
CN104333808A (zh) * 2014-11-14 2015-02-04 复旦大学 用于Android及Linux智能电视机上的通用播放器

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3200470A4 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2734109C1 (ru) * 2017-09-30 2020-10-13 Зте Корпорейшн Способ воспроизведения нескольких видео на мобильном терминале, мобильный терминал и считываемая запоминающая среда

Also Published As

Publication number Publication date
EP3200470A1 (en) 2017-08-02
EP3200470A4 (en) 2017-08-02
CN105898538A (zh) 2016-08-24

Similar Documents

Publication Publication Date Title
WO2017101412A1 (zh) 用于安卓平台的播放方法、装置及移动终端设备
CN109168078B (zh) 一种视频清晰度切换方法及装置
EP3598761B1 (en) Method and device for synthesizing audio and video data stream
WO2017063399A1 (zh) 一种视频播放方法和装置
US9473677B2 (en) Method and server system for synchronization of audio/video media files
US9516082B2 (en) System and method for advancing to a predefined portion of a decompressed media stream
WO2017101415A1 (zh) 基于安卓平台的多媒体资源的播放方法、装置和终端设备
WO2020200302A1 (zh) 直播方法、装置、计算机设备与存储介质
CN107027046B (zh) 辅助直播的音视频处理方法及装置
US20140298179A1 (en) Method and device for playback of presentation file
CA2863733C (en) Method and system of playing online video at a speed variable in real time
US20170171281A1 (en) Play method and apparatus and mobile terminal device for android platform
WO2020155964A1 (zh) 音视频的切换方法、装置、计算机设备及可读存储介质
WO2016112639A1 (zh) 流媒体数据传输方法、客户端和服务器
WO2017092333A1 (zh) 一种视频的生成、播放方法和装置
WO2017092561A1 (zh) 实现音视频内容播放的方法和装置
CN111050201A (zh) 数据处理方法、装置、电子设备及存储介质
US20200097528A1 (en) Method and Device for Quickly Inserting Text of Speech Carrier
WO2018192183A1 (zh) 无线传屏中视频文件的处理方法及装置
WO2023045973A1 (zh) 直播礼物云渲染方法、装置、电子设备及存储介质
WO2017113853A1 (zh) 多路视频信息显示的方法及装置
WO2016160240A1 (en) Digital content streaming from digital tv broadcast
US10902884B2 (en) Methods and apparatus for ordered serial synchronization of multimedia streams upon sensor changes
CN105120323A (zh) 一种分布式播放器任务调度的方法及系统
CN103514196B (zh) 一种信息处理方法及电子设备

Legal Events

Date Code Title Description
REEP Request for entry into the european phase

Ref document number: 2016791516

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2016791516

Country of ref document: EP

NENP Non-entry into the national phase

Ref country code: DE