WO2017092433A1 - Method and device for video real-time playback - Google Patents

Method and device for video real-time playback Download PDF

Info

Publication number
WO2017092433A1
WO2017092433A1 PCT/CN2016/096989 CN2016096989W WO2017092433A1 WO 2017092433 A1 WO2017092433 A1 WO 2017092433A1 CN 2016096989 W CN2016096989 W CN 2016096989W WO 2017092433 A1 WO2017092433 A1 WO 2017092433A1
Authority
WO
WIPO (PCT)
Prior art keywords
video
frame image
program
transport stream
slice
Prior art date
Application number
PCT/CN2016/096989
Other languages
French (fr)
Chinese (zh)
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 乐视控股(北京)有限公司
Publication of WO2017092433A1 publication Critical patent/WO2017092433A1/en

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/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
    • 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/4345Extraction or processing of SI, e.g. extracting service information from an MPEG stream
    • 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/4348Demultiplexing of additional data 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/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • 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/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • H04N21/8455Structuring of content, e.g. decomposing content into time segments involving pointers to the content, e.g. pointers to the I-frames of the video stream
    • 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/85Assembly of content; Generation of multimedia applications
    • H04N21/854Content authoring
    • H04N21/8547Content authoring involving timestamps for synchronizing content

Definitions

  • the present application relates to the field of audio and video technologies, and in particular, to a video real-time playing method and apparatus.
  • the HLS (HTTP Live Streaming) protocol is an extended HTTP protocol developed by Apple Inc. for use in live webcast and on-demand scenarios.
  • the protocol encapsulates data using a Transport Stream (TS).
  • TS Transport Stream
  • Each transport stream carries data information such as video (Video), audio (Audio), and the like, and carries flow index information such as a Program Association Table (PAT) and a Program Map Table (PMT).
  • PAT Program Association Table
  • PMT Program Map Table
  • the embodiment of the present invention provides a video real-time playing method and device, which are used to solve the technical problem that the preview operation cannot be performed by the thumbnail image in the prior art.
  • the embodiment of the present application provides a video real-time playing method, including:
  • the embodiment of the present application further provides a video real-time playing device, including:
  • a preview information obtaining module configured to store a first frame image of the video data packet and a time stamp corresponding to the first frame image into a database
  • a preview information display module configured to convert the first frame image into a thumbnail image, and display the thumbnail image and a corresponding time stamp in a preview area
  • a playing module configured to receive an operation request, and play a video according to the operation request.
  • the device further includes:
  • a download module for downloading slices in the transport stream
  • a demultiplexing module configured to demultiplex the slice in the transport stream to obtain a grouped video original stream and program specific information.
  • the embodiment of the present application provides a non-transitory computer readable storage medium, wherein the non-transitory computer readable storage medium can store a computer program, and the program can implement a part of the video real-time playing method described above when executed. Or all steps.
  • An embodiment of the present application further provides an electronic device, including: one or more processors; and a memory; wherein the memory stores instructions executable by the one or more processors, the instructions being The one or more processors are executed to enable the one or more processors to perform the video real time playback method of the present application.
  • An embodiment of the present application provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions, when the program instructions are executed by a computer, The computer is caused to execute the above-mentioned video real-time playing method in the embodiment of the present application.
  • the video real-time playing method and device captureds the first frame image of each slice in the program transmission stream and the corresponding time stamp into the database when playing the program, and converts the first frame image into a thumbnail. Slightly image, then display several thumbnail images in the preview area for the user to preview to enhance the user's experience.
  • FIG. 1 is a schematic diagram of a format of a slice of a transport stream in the prior art
  • FIG. 2 is a schematic diagram showing the structure of a packet of a slice of a transport stream in the prior art
  • FIG. 3 is a flowchart of a video real-time playing method according to an embodiment of the present application.
  • FIG. 4 is a schematic diagram of a video real-time playing device according to an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of hardware of a device for playing a video in real time according to an embodiment of the present disclosure.
  • the server in order to implement video on demand, the server first divides the video data into different slices according to a certain time interval, different media encoding formats and code rate sizes, and then stores all the slices in the server.
  • the information of each slice and its length of time is stored as an M3U8 format file; before the client plays, the server first transmits the M3U8 format file to the client, and the M3U8 file includes a program association table, a program mapping table, and a timestamp.
  • the client After the client receives the M3U8 format file, if the user wants to perform the on-demand operation, the user may issue an operation request to the client, and the client performs the SEEK operation to download the fragment file specified in the operation request from the server for parsing and playing.
  • the inventor of the present application discovered that the SEEK operation provided in the existing HLS protocol can only be clicked according to information such as time stamps, and cannot provide an image corresponding to the time stamp to the user for previewing, so the experience is experienced. Poor. To this end, the inventors have proposed the following technical solutions of the present application to improve the user's experience.
  • FIG. 1 is a schematic diagram of a format of a slice of a transport stream in the prior art.
  • the transport stream is a hierarchical encapsulation format, and the program association table needs to be first found to obtain the number of program map tables in the transport stream, thereby obtaining the number of programs in the transport stream, where each program map corresponds to one program, and then A video packet identifier (PID) and an audio packet identifier of the program are obtained according to the program map.
  • PID video packet identifier
  • audio packet identifier of the program are obtained according to the program map.
  • the slice of the transport stream is used to facilitate the user to receive the transport stream at any time and ensure that the audio and video data in the slice is not pirated, and the transmission end periodically inserts the program association table and the program map into the transport stream. In the slice.
  • a program is cut into n slices, user A can receive from the program association table 1, and user B can receive from the program association table n to find the program map in the vicinity, thereby facilitating live broadcast.
  • FIG. 2 is a schematic diagram showing the structure of a packet of a slice of a transport stream in the prior art.
  • a slice consists of multiple packets, each consisting of a header and data, each of which is 188 bytes or 204 bytes, of which 204 bytes are added after the 188-byte packet.
  • the CRC check data of the bytes is formed.
  • the header can also include an extended self-use area, the length of the header is 4 bytes, and the self-use area and the packet data share 184 bytes.
  • the packet header consists of a sync byte, a transmission error indicator, a payload unit start indicator, a transmission priority, a packet identifier, a transmission scrambling control, an adaptive zone control, and a continuous counter.
  • the packet correlation in the data stream can be detected by the automatic correlation feature of the bit string of the synchronization byte, and the packet synchronization can be established.
  • the error correction decoder can be used. Indicates a 1-bit error, but cannot correct the error; the payload unit start indicator indicates whether the packet has a determined start message; the transmission priority is used to assign a priority to the packet; the packet identifier value is determined by the user Determining, the decoder distinguishes different original stream (ES) packets according to the packet identifier to reconstruct the original stream; the transmission scrambling control can be used to indicate whether the packet content is scrambled; the adaptive area control is used to indicate that there is No adaptive zone, usually represented by 2 bits, for example, "01" means that there is useful information, but there is no adaptive zone, "10” means no useful information, and there is an adaptive zone, "11” means that there is useful information and there is In the adaptive zone, “00” means no definition; the continuous counter can count the
  • the packet identifier is a unique identifier in the transport stream, and the data content in the packet is determined by the packet identifier. If the packet identifier in the header of a packet in a transport stream is 0, then the data content of the packet is the program association table. If it is not 0, it is video data, audio data, program map, or other type of data.
  • FIG. 3 is a flowchart of a video real-time playing method according to an embodiment of the present application.
  • the slice is downloaded simultaneously by two threads.
  • the slice may be downloaded by one or more threads.
  • the number of threads may be based on the processing capability of the client and the server, and the network.
  • the bandwidth is set, which is not limited in this application.
  • the first thread starts downloading from the first slice of the transport stream, and simultaneously passes the first Two threads start downloading from the last slice of the transport stream to speed up the download.
  • S302 Demultiplexing the slice in the transport stream to obtain a grouped video original stream and program specific information.
  • the slice is formed by multiplexing the program specific information, the packetized audio original stream, and the grouped video original stream, and having a length of 188 bytes.
  • the program specific information typically includes at least a program association table, a program map table, and a time stamp.
  • S303 Decode the video original stream of the packet to obtain a video data packet.
  • the video original stream includes a plurality of access units, each of which is encoded data of an image.
  • the video coding method may adopt transform coding, entropy coding, motion estimation and motion compensation, or hybrid coding, and the video data packet includes images of several frames.
  • S304 Store the first frame image of the video data packet and the time stamp corresponding to the first frame image into the database.
  • the first frame image of the slice and the corresponding time stamp are stored in a database named vod.databse.db.
  • the data may also be named as another name, which is not limited in this application.
  • S305 Convert the first frame image into a thumbnail image, and display the thumbnail image and the corresponding time stamp in the preview area.
  • the preview area is located below the play area, and may also be disposed above the play area, even on the left or right side, and may be set as needed during actual implementation.
  • the thumbnail image may be displayed by reducing the first frame image, and the entire preview area is arranged by a plurality of thumbnail images. If the preview area on the screen cannot display all the thumbnail images, you can also display them by clicking the arrow at one end of the preview area or other buttons.
  • the time stamp corresponding to the thumbnail image will be popped up at the same time, so that the user can directly observe, the playing time and the picture, which improves the user experience.
  • S306 Receive an operation request, and play a video according to the operation request.
  • the timestamp corresponding to the preview image is read. If the timestamp has no value, the seek flag is directly cleared and the data packet is returned. If the timestamp has a value, the value of the timestamp is converted to microseconds and compared with the incoming time of the seek. If the value of the timestamp is greater than the seek time, it indicates that the read packet reaches the seek requirement, otherwise it continues to read. Take the packet until the value of the timestamp is equal to the seek time. When the value of the timestamp is equal to the seek time, it is checked whether the flag of the data packet is a key frame, and if so, the data packet is returned, otherwise the data packet is continued.
  • FIG. 4 is a schematic diagram of a video real-time playing device according to an embodiment of the present application.
  • the video real-time playing device of the embodiment of the present application includes a downloading module 100, a demultiplexing module 200, a decoding module 300, a preview information acquiring module 400, a preview information display module 500, and a playing module 600.
  • the download module 100 is configured to download a slice in the transport stream.
  • the download module 100 specifically includes a first download submodule 101 and a second download submodule 102.
  • the first download sub-module 101 is configured to start downloading from the first slice of the transport stream by using the first thread, and the second download sub-module 102, for downloading from the last slice of the transport stream by the second thread.
  • the slice is downloaded simultaneously by two threads.
  • the slice may be downloaded by one or more threads.
  • the number of threads may be based on the processing capability of the client and the server, and the network.
  • the bandwidth is set, which is not limited in this application.
  • the first thread starts downloading from the first slice of the transport stream
  • the second thread starts downloading from the last slice of the transport stream to speed up the download speed
  • the demultiplexing module 200 is configured to demultiplex the slice in the transport stream to obtain a grouped video original stream and program specific information.
  • the slice is formed by multiplexing the program specific information, the packetized audio original stream, and the grouped video original stream. It is a 188-byte slice.
  • the program specific information typically includes at least a program association table, a program map table, and a time stamp.
  • the decoding module 300 is configured to decode the video original stream of the packet to obtain a video data packet.
  • the video original stream includes a plurality of access units, each of which is encoded data of an image.
  • the video coding method may adopt transform coding, entropy coding, motion estimation and motion compensation, or hybrid coding, and the video data packet includes images of several frames.
  • the preview information obtaining module 400 is configured to store the first frame image of the video data packet and the time stamp corresponding to the first frame image into the database.
  • the first frame image of the slice and the corresponding time stamp are stored in a database named vod.databse.db.
  • the data may also be named as another name, which is not limited in this application.
  • the preview information display module 500 is configured to convert the first frame image into a thumbnail image, and display the thumbnail image and the corresponding time stamp in the preview area.
  • the preview area is located below the play area, and may also be disposed above the play area, even on the left or right side, and may be set as needed during actual implementation.
  • the thumbnail image may be displayed by reducing the first frame image, and the entire preview area is arranged by a plurality of thumbnail images. If the preview area on the screen cannot display all the thumbnail images, you can also display them by clicking the arrow at one end of the preview area or other buttons.
  • the time stamp corresponding to the thumbnail image will be popped up at the same time, so that the user can directly observe, the playing time and the picture, which improves the user experience.
  • the playing module 600 is configured to receive an operation request, and play the video according to the operation request.
  • the timestamp corresponding to the preview image First read the timestamp corresponding to the preview image. If the timestamp has no value, the seek flag is directly cleared and returned. Back to the packet. If the timestamp has a value, the value of the timestamp is converted to microseconds and compared with the incoming time of the seek. If the value of the timestamp is greater than the seek time, it indicates that the read packet reaches the seek requirement, otherwise it continues to read. Take the packet until the value of the timestamp is equal to the seek time. When the value of the timestamp is equal to the seek time, it is checked whether the flag of the data packet is a key frame, and if so, the data packet is returned, otherwise the data packet is continued.
  • the above technical solution of the embodiment of the present application is to store a first frame image of each slice in the program transmission stream and a corresponding time stamp into the database when the program is being played, and convert the first frame image into a thumbnail image, and then convert the first frame image into a thumbnail image, and then Several thumbnail images are displayed in the preview area for the user to preview to enhance the user's experience.
  • the embodiment of the present application further provides a non-transitory computer readable storage medium, where the non-transitory computer readable storage medium can store a program, and when executed, the program can implement a video real-time provided by any one of the foregoing embodiments.
  • FIG. 5 is a schematic structural diagram of hardware of an electronic device for playing a video in real time according to an embodiment of the present disclosure. As shown in FIG. 5, the device includes:
  • processors 510 and memory 520 one processor 510 is taken as an example in FIG.
  • the device that performs the video real-time playing method may further include: an input device 530 and an output device 540.
  • the processor 510, the memory 520, the input device 530, and the output device 540 may be connected by a bus or other means, as exemplified by a bus connection in FIG.
  • the memory 520 is used as a non-transitory computer readable storage medium, and can be used for storing a non-volatile software program, a non-volatile computer executable program, and a module, such as a program instruction corresponding to the video real-time playing method in the embodiment of the present application. / module.
  • the processor 510 executes various functional applications and data processing of the electronic device by executing non-volatile software programs, instructions, and modules stored in the memory 520, that is, the video real-time playing method of the foregoing method embodiments.
  • the memory 520 may include a storage program area and an storage data area, wherein the storage program area may store an operating system, an application required for at least one function; the storage data area may store data created according to use of the video real-time playback device, and the like.
  • the memory 520 may include a high speed random access memory, and may also include a non- Volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device.
  • memory 520 can optionally include memory remotely located relative to processor 510, which can be connected to the video real-time playback device over a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • Input device 530 can receive input numeric or character information and generate key signal inputs related to user settings and function control of the video real-time playback device.
  • the output device 540 can include a display device such as a display screen.
  • the one or more modules are stored in the memory 520, and when executed by the one or more processors 510, perform a video real-time playback method in any of the above method embodiments.
  • the electronic device of the embodiment of the invention exists in various forms, including but not limited to:
  • Mobile communication devices These devices are characterized by mobile communication functions and are mainly aimed at providing voice and data communication.
  • Such terminals include: smart phones (such as iPhone), multimedia phones, functional phones, and low-end phones.
  • Ultra-mobile personal computer equipment This type of equipment belongs to the category of personal computers, has computing and processing functions, and generally has mobile Internet access.
  • Such terminals include: PDAs, MIDs, and UMPC devices, such as the iPad.
  • Portable entertainment devices These devices can display and play multimedia content. Such devices include: audio, preview players (such as iPod), handheld game consoles, e-books, and smart toys and portable car navigation devices.
  • the server consists of a processor, a hard disk, a memory, a system bus, etc.
  • the server is similar to a general-purpose computer architecture, but because of the need to provide highly reliable services, processing power and stability High reliability in terms of reliability, security, scalability, and manageability.
  • the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical. Units can be located in one place or distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment. Those of ordinary skill in the art can understand and implement without deliberate labor.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

Provided are a video real-time playback method and a video real-time playback device. The video real-time playback method comprises: storing a first frame image of a video packet and a timestamp corresponding to the first frame image to a database; converting the first frame image into a thumbnail image, displaying the thumbnail image and the corresponding timestamp in a preview area; receiving an operation request, and play back a video on the basis of the operation request. Also provided is a video real-time playback device. Several thumbnail images can be displayed in the preview area to be previewed by a user, thus enhancing user experience.

Description

视频实时播放方法及装置Video real-time playing method and device
本申请要求于2015年12月3日提交中国专利局、申请号为2015108835314、发明名称为“视频实时播放方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. 2015108835314, the entire disclosure of which is incorporated herein in
技术领域Technical field
本申请涉及音视频技术领域,尤其涉及一种视频实时播放方法及装置。The present application relates to the field of audio and video technologies, and in particular, to a video real-time playing method and apparatus.
背景技术Background technique
HLS(HTTP Live Streaming)协议是苹果公司研发出的,用在网络直播和点播场景中的扩展HTTP协议,该协议使用传输流(Transport Stream,TS)的方式封装数据。每个传输流都携带视频(Video)、音频(Audio)等数据信息,以及携带节目关联表(Program Association Table,PAT)、节目映射表(Program Map Table,PMT)等流索引信息。The HLS (HTTP Live Streaming) protocol is an extended HTTP protocol developed by Apple Inc. for use in live webcast and on-demand scenarios. The protocol encapsulates data using a Transport Stream (TS). Each transport stream carries data information such as video (Video), audio (Audio), and the like, and carries flow index information such as a Program Association Table (PAT) and a Program Map Table (PMT).
在播放遵循HLS协议的节目时,有时候客户需要进行预览操作,但是现有的HLS协议并不支持通过缩略图像进行预览操作,因此用户体验较差。When playing a program that follows the HLS protocol, sometimes the client needs to perform a preview operation, but the existing HLS protocol does not support the preview operation through the thumbnail image, so the user experience is poor.
发明内容Summary of the invention
本申请实施例提供一种视频实时播放方法及装置,用以解决现有技术中无法通过缩略图像进行预览操作的技术问题。The embodiment of the present invention provides a video real-time playing method and device, which are used to solve the technical problem that the preview operation cannot be performed by the thumbnail image in the prior art.
本申请实施例提供一种视频实时播放方法,包括:The embodiment of the present application provides a video real-time playing method, including:
将视频数据包的第一帧图像,以及与所述第一帧图像对应的时间戳存储进数据库;And storing a first frame image of the video data packet and a time stamp corresponding to the first frame image into a database;
将所述第一帧图像转换为缩略图像,并将所述缩略图像及对应的时间戳显示于预览区域; Converting the first frame image into a thumbnail image, and displaying the thumbnail image and a corresponding time stamp in a preview area;
接收操作请求,并根据所述操作请求播放视频。Receiving an operation request and playing a video according to the operation request.
本申请实施例还提供一种视频实时播放装置,包括:The embodiment of the present application further provides a video real-time playing device, including:
预览信息获取模块,用于将视频数据包的第一帧图像,以及与所述第一帧图像对应的时间戳存储进数据库;a preview information obtaining module, configured to store a first frame image of the video data packet and a time stamp corresponding to the first frame image into a database;
预览信息显示模块,用于将所述第一帧图像转换为缩略图像,并将所述缩略图像及对应的时间戳显示于预览区域;a preview information display module, configured to convert the first frame image into a thumbnail image, and display the thumbnail image and a corresponding time stamp in a preview area;
播放模块,用于接收操作请求,并根据所述操作请求播放视频。a playing module, configured to receive an operation request, and play a video according to the operation request.
进一步的,所述的装置,还包括:Further, the device further includes:
下载模块,用于下载传输流中的切片;a download module for downloading slices in the transport stream;
解复用模块,用于对所述传输流中的切片进行解复用后得到分组的视频原始流以及节目特定信息。And a demultiplexing module, configured to demultiplex the slice in the transport stream to obtain a grouped video original stream and program specific information.
本申请实施例提供了一种非暂态计算机可读存储介质,其中,该非暂态计算机可读存储介质可存储有计算机程序,该程序执行时可实现上述的一种视频实时播放方法的部分或全部步骤。The embodiment of the present application provides a non-transitory computer readable storage medium, wherein the non-transitory computer readable storage medium can store a computer program, and the program can implement a part of the video real-time playing method described above when executed. Or all steps.
本申请实施例还提供了一种电子设备,包括:一个或多个处理器;以及,存储器;其中,所述存储器存储有可被所述一个或多个处理器执行的指令,所述指令被所述一个或多个处理器执行,以使所述一个或多个处理器能够执行本申请上述视频实时播放方法。An embodiment of the present application further provides an electronic device, including: one or more processors; and a memory; wherein the memory stores instructions executable by the one or more processors, the instructions being The one or more processors are executed to enable the one or more processors to perform the video real time playback method of the present application.
本申请实施例提供一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行本申请实施例上述视频实时播放方法。An embodiment of the present application provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions, when the program instructions are executed by a computer, The computer is caused to execute the above-mentioned video real-time playing method in the embodiment of the present application.
本申请实施例提供的视频实时播放方法及装置,通过在播放节目时抓取节目传输流中每个切片的第一帧图像及对应的时间戳存储进数据库,并将第一帧图像转换为缩 略图像,然后在预览区域显示若干幅缩略图像提供给用户进行预览,以提高用户的体验。The video real-time playing method and device provided by the embodiment of the present application captures the first frame image of each slice in the program transmission stream and the corresponding time stamp into the database when playing the program, and converts the first frame image into a thumbnail. Slightly image, then display several thumbnail images in the preview area for the user to preview to enhance the user's experience.
附图说明DRAWINGS
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings to be used in the embodiments or the prior art description will be briefly described below. Obviously, the drawings in the following description are Some embodiments of the present application can also obtain other drawings based on these drawings without departing from the prior art by those skilled in the art.
图1为现有技术中传输流的切片的格式示意图;1 is a schematic diagram of a format of a slice of a transport stream in the prior art;
图2为现有技术中传输流的切片的包的构成示意图;2 is a schematic diagram showing the structure of a packet of a slice of a transport stream in the prior art;
图3为本申请实施例视频实时播放方法的流程图;3 is a flowchart of a video real-time playing method according to an embodiment of the present application;
图4为本申请实施例视频实时播放装置的示意图;4 is a schematic diagram of a video real-time playing device according to an embodiment of the present application;
图5为本申请实施例提供的视频实时播放方法的设备的硬件结构示意图。FIG. 5 is a schematic structural diagram of hardware of a device for playing a video in real time according to an embodiment of the present disclosure.
具体实施方式detailed description
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present application. It is a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without departing from the inventive scope are the scope of the present application.
根据HLS协议的现有规定,为了实现视频点播,服务器需首先按照一定的时间间隔、不同的媒体编码格式和码率大小将视频数据分割打包成不同的切片,然后把所有的切片存储在服务器,每个切片及其时间长度等信息存储为M3U8格式文件;客户端在播放之前,服务器首先将M3U8格式文件传输给客户端,该M3U8文件中包含节目关联表、节目映射表,以及时间戳。 According to the existing regulations of the HLS protocol, in order to implement video on demand, the server first divides the video data into different slices according to a certain time interval, different media encoding formats and code rate sizes, and then stores all the slices in the server. The information of each slice and its length of time is stored as an M3U8 format file; before the client plays, the server first transmits the M3U8 format file to the client, and the M3U8 file includes a program association table, a program mapping table, and a timestamp.
客户端收到M3U8格式文件后,用户如果要进行点播操作,可向客户端发出操作请求,由客户端通过SEEK操作从服务端下载操作请求中所指定的分片文件进行解析后播放。After the client receives the M3U8 format file, if the user wants to perform the on-demand operation, the user may issue an operation request to the client, and the client performs the SEEK operation to download the fragment file specified in the operation request from the server for parsing and playing.
本申请的发明人在通过深入研究上述现有技术后发现,现有HLS协议中提供的SEEK操作只能根据时间戳等信息进行点播,无法提供与该时间戳对应的图像给用户预览,因此体验较差。为此,发明人提出了本申请的下述技术方案以提高用户的体验。The inventor of the present application discovered that the SEEK operation provided in the existing HLS protocol can only be clicked according to information such as time stamps, and cannot provide an image corresponding to the time stamp to the user for previewing, so the experience is experienced. Poor. To this end, the inventors have proposed the following technical solutions of the present application to improve the user's experience.
图1为现有技术中传输流的切片的格式示意图。FIG. 1 is a schematic diagram of a format of a slice of a transport stream in the prior art.
传输流为层次型的封装格式,需要先找到节目关联表,以获取传输流中节目映射表的数量,以此获得传输流中节目的数量,其中每一张节目映射表对应一个节目,然后再根据节目映射表获取节目的视频包标示符(Packet Identification,PID)和音频包标示符。The transport stream is a hierarchical encapsulation format, and the program association table needs to be first found to obtain the number of program map tables in the transport stream, thereby obtaining the number of programs in the transport stream, where each program map corresponds to one program, and then A video packet identifier (PID) and an audio packet identifier of the program are obtained according to the program map.
根据HLS协议的规定,一个长时间的节目通常被切割分成多个时长为10秒的切片。因此,现有技术中传输流的切片,为了方便用户随时接收传输流并保证切片中的音视频数据不被盗播,传输端是周期性的将节目关联表和节目映射表插入到传输流的切片中。According to the HLS protocol, a long-term program is usually cut into a plurality of slices of 10 seconds. Therefore, in the prior art, the slice of the transport stream is used to facilitate the user to receive the transport stream at any time and ensure that the audio and video data in the slice is not pirated, and the transmission end periodically inserts the program association table and the program map into the transport stream. In the slice.
例如,图1中,一个节目被切割为n个切片,用户A可以从节目关联表1处接收,用户B可以从节目关联表n处接收,以就近找到节目映射表,从而方便直播。For example, in FIG. 1, a program is cut into n slices, user A can receive from the program association table 1, and user B can receive from the program association table n to find the program map in the vicinity, thereby facilitating live broadcast.
图2为现有技术中传输流的切片的包的构成示意图。2 is a schematic diagram showing the structure of a packet of a slice of a transport stream in the prior art.
切片由多个包构成,每个包由包头和数据组成,每个包是188个字节或204个字节,其中204个字节的包是在188个字节的包之后加上了16字节的CRC校验数据形成。A slice consists of multiple packets, each consisting of a header and data, each of which is 188 bytes or 204 bytes, of which 204 bytes are added after the 188-byte packet. The CRC check data of the bytes is formed.
包头还可以包括扩展的自使用区,包头长度占4个字节,自使用区和包数据共占 184个字节。包头包括同步字节、传输误码指示符、有效载荷单元起始指示符、传输优先、包识别符、传输加扰控制、自适应区控制和连续计数器8个部分组成。The header can also include an extended self-use area, the length of the header is 4 bytes, and the self-use area and the packet data share 184 bytes. The packet header consists of a sync byte, a transmission error indicator, a payload unit start indicator, a transmission priority, a packet identifier, a transmission scrambling control, an adaptive zone control, and a continuous counter.
其中,可以通过同步字节的位串的自动相关特性,检测数据流中的包限制,建立包同步;传输误码指示符,是指有不能消除的误码时,采用误码校正解码器可表示1位的误码,但无法校正该误码;有效载荷单元起始指示符,表示该包是否存在确定的起始信息;传输优先用于是给包分配优先权;包标示符值是由用户确定的,由解码器根据包标示符区别不同原始流(Elementary Stream,ES)的包,以重建原始流;传输加扰控制可用于指示包内容是否加扰;自适应区控制是用于表示有否自适应区,通常用2位来表示,比如“01”表示有有用信息,但是无自适应区,“10”表示无有用信息,且有自适应区,“11”表示有有用信息且有自适应区,“00”表示无定义;连续计数器可对包标示符传送顺序计数,根据连续计数器的读数,接收端可以判断是否有包丢失及包传送顺序错误。总而言之,包头对传输流具有同步、识别、检错及加密功能。Among them, the packet correlation in the data stream can be detected by the automatic correlation feature of the bit string of the synchronization byte, and the packet synchronization can be established. When the error code indicator is transmitted, the error correction decoder can be used. Indicates a 1-bit error, but cannot correct the error; the payload unit start indicator indicates whether the packet has a determined start message; the transmission priority is used to assign a priority to the packet; the packet identifier value is determined by the user Determining, the decoder distinguishes different original stream (ES) packets according to the packet identifier to reconstruct the original stream; the transmission scrambling control can be used to indicate whether the packet content is scrambled; the adaptive area control is used to indicate that there is No adaptive zone, usually represented by 2 bits, for example, "01" means that there is useful information, but there is no adaptive zone, "10" means no useful information, and there is an adaptive zone, "11" means that there is useful information and there is In the adaptive zone, “00” means no definition; the continuous counter can count the transmission order of the packet identifier. According to the reading of the continuous counter, the receiving end can judge whether there is packet loss and packet transmission. Error. In summary, the packet header has synchronization, identification, error detection and encryption functions for the transport stream.
此外,包标示符是传输流中的唯一识别标志,包中的数据内容是由包标示符决定。如果一个传输流中的一个包的包头中的包标示符是0,那么该包的数据内容就是节目关联表,如果不是0,就是视频数据,音频数据,节目映射表,或者是其他类型数据。In addition, the packet identifier is a unique identifier in the transport stream, and the data content in the packet is determined by the packet identifier. If the packet identifier in the header of a packet in a transport stream is 0, then the data content of the packet is the program association table. If it is not 0, it is video data, audio data, program map, or other type of data.
图3为本申请实施例视频实时播放方法的流程图。FIG. 3 is a flowchart of a video real-time playing method according to an embodiment of the present application.
S301:下载传输流中的切片。S301: Download a slice in the transport stream.
本实施例中,主要通过两个线程同时下载切片,当然在其他实施例中,还可以通过一个或者三个以上的线程下载切片,线程的数量可根据客户端及服务器的处理能力,以及网络的带宽进行设定,本申请对此不作限定。In this embodiment, the slice is downloaded simultaneously by two threads. In other embodiments, the slice may be downloaded by one or more threads. The number of threads may be based on the processing capability of the client and the server, and the network. The bandwidth is set, which is not limited in this application.
具体到本实施例则是通过第一线程从传输流的第一个切片开始下载,同时通过第 二线程从所述传输流的最后一个切片开始下载,以加快下载速度。Specifically, in this embodiment, the first thread starts downloading from the first slice of the transport stream, and simultaneously passes the first Two threads start downloading from the last slice of the transport stream to speed up the download.
S302:对传输流中的切片进行解复用后得到分组的视频原始流以及节目特定信息。S302: Demultiplexing the slice in the transport stream to obtain a grouped video original stream and program specific information.
切片是由节目特定信息、分组的音频原始流及分组的视频原始流经过复用而成,其长度为188字节的切片。节目特定信息通常至少包括节目关联表、节目映射表和时间戳。The slice is formed by multiplexing the program specific information, the packetized audio original stream, and the grouped video original stream, and having a length of 188 bytes. The program specific information typically includes at least a program association table, a program map table, and a time stamp.
S303:对分组的视频原始流解码,得到视频数据包。S303: Decode the video original stream of the packet to obtain a video data packet.
视频原始流包括多个访问单元,每一个访问单元是一幅图像的编码数据。视频编码方式可以采用变换编码、熵编码、运动估计和运动补偿,或者是混合编码方式进行编码,视频数据包则包括若干帧的图像。The video original stream includes a plurality of access units, each of which is encoded data of an image. The video coding method may adopt transform coding, entropy coding, motion estimation and motion compensation, or hybrid coding, and the video data packet includes images of several frames.
S304:将视频数据包的第一帧图像,以及与第一帧图像对应的时间戳存储进数据库。具体而言,是将切片的第一帧图像及对应的时间戳存储进名字为vod.databse.db的数据库,当然该数据也可以命名为其它名字,本申请对此不作限定。S304: Store the first frame image of the video data packet and the time stamp corresponding to the first frame image into the database. Specifically, the first frame image of the slice and the corresponding time stamp are stored in a database named vod.databse.db. Of course, the data may also be named as another name, which is not limited in this application.
S305:将第一帧图像转换为缩略图像,并将缩略图像及对应的时间戳显示于预览区域。S305: Convert the first frame image into a thumbnail image, and display the thumbnail image and the corresponding time stamp in the preview area.
在本实施例中,预览区域位于播放区域的下方,当然也可以设置在播放区域的上方,甚至设置在左边或者右边,在实际实施过程中可根据需要进行设置。缩略图像可以是将第一帧图像进行缩小后进行显示,整个预览区域由若干张缩略图像排列而成。如果屏幕上的预览区域没法显示所有的缩略图像,还可以通过点击预览区域某一端的箭头或者是其它按钮进行显示。In this embodiment, the preview area is located below the play area, and may also be disposed above the play area, even on the left or right side, and may be set as needed during actual implementation. The thumbnail image may be displayed by reducing the first frame image, and the entire preview area is arranged by a plurality of thumbnail images. If the preview area on the screen cannot display all the thumbnail images, you can also display them by clicking the arrow at one end of the preview area or other buttons.
当用户选中某一缩略图像时,将会同时弹出与该缩略图像对应的时间戳,让用户直接观察到,播放时长及画面,较好的提高了用户的体验。When the user selects a certain thumbnail image, the time stamp corresponding to the thumbnail image will be popped up at the same time, so that the user can directly observe, the playing time and the picture, which improves the user experience.
S306:接收操作请求,并根据操作请求播放视频。 S306: Receive an operation request, and play a video according to the operation request.
当用户通过用户界面(User Interface,UI)选中预览区域上的某一幅图像后,就会触发SEEK操作,整个SEEK操作的流程如下:When the user selects an image on the preview area through the User Interface (UI), the SEEK operation is triggered. The flow of the entire SEEK operation is as follows:
首先读取预览图像对应的时间戳,如果时间戳没有值,则直接清除seek标志并返回数据包。如果时间戳有值,则将时间戳的值转化为微秒并与seek传入的时间进行比较,如果时间戳的值大于seek时间,则表明读取的数据包达到了seek要求,否则继续读取数据包,直到时间戳的值等于seek时间。当时间戳的值等于seek时间,则看该数据包的标志是否是关键帧,如果是则返回该数据包,否则继续取数据包。First, the timestamp corresponding to the preview image is read. If the timestamp has no value, the seek flag is directly cleared and the data packet is returned. If the timestamp has a value, the value of the timestamp is converted to microseconds and compared with the incoming time of the seek. If the value of the timestamp is greater than the seek time, it indicates that the read packet reaches the seek requirement, otherwise it continues to read. Take the packet until the value of the timestamp is equal to the seek time. When the value of the timestamp is equal to the seek time, it is checked whether the flag of the data packet is a key frame, and if so, the data packet is returned, otherwise the data packet is continued.
图4为本申请实施例视频实时播放装置的示意图。FIG. 4 is a schematic diagram of a video real-time playing device according to an embodiment of the present application.
本申请实施例的视频实时播放装置包括下载模块100、解复用模块200、解码模块300、预览信息获取模块400、预览信息显示模块500以及播放模块600。The video real-time playing device of the embodiment of the present application includes a downloading module 100, a demultiplexing module 200, a decoding module 300, a preview information acquiring module 400, a preview information display module 500, and a playing module 600.
下载模块100,用于下载传输流中的切片。下载模块100具体包括第一下载子模块101和第二下载子模块102。第一下载子模块101,用于通过第一线程从传输流的第一个切片开始下载;以及第二下载子模块102,用于通过第二线程从传输流的最后一个切片开始下载。The download module 100 is configured to download a slice in the transport stream. The download module 100 specifically includes a first download submodule 101 and a second download submodule 102. The first download sub-module 101 is configured to start downloading from the first slice of the transport stream by using the first thread, and the second download sub-module 102, for downloading from the last slice of the transport stream by the second thread.
本实施例中,主要通过两个线程同时下载切片,当然在其他实施例中,还可以通过一个或者三个以上的线程下载切片,线程的数量可根据客户端及服务器的处理能力,以及网络的带宽进行设定,本申请对此不作限定。In this embodiment, the slice is downloaded simultaneously by two threads. In other embodiments, the slice may be downloaded by one or more threads. The number of threads may be based on the processing capability of the client and the server, and the network. The bandwidth is set, which is not limited in this application.
具体到本实施例则是通过第一线程从传输流的第一个切片开始下载,同时通过第二线程从所述传输流的最后一个切片开始下载,以加快下载速度。Specifically, in this embodiment, the first thread starts downloading from the first slice of the transport stream, and the second thread starts downloading from the last slice of the transport stream to speed up the download speed.
解复用模块200,用于对传输流中的切片进行解复用后得到分组的视频原始流以及节目特定信息。The demultiplexing module 200 is configured to demultiplex the slice in the transport stream to obtain a grouped video original stream and program specific information.
切片是由节目特定信息、分组的音频原始流及分组的视频原始流经过复用而成, 其长度为188字节的切片。节目特定信息通常至少包括节目关联表、节目映射表和时间戳。The slice is formed by multiplexing the program specific information, the packetized audio original stream, and the grouped video original stream. It is a 188-byte slice. The program specific information typically includes at least a program association table, a program map table, and a time stamp.
解码模块300,用于对分组的视频原始流解码,得到视频数据包。The decoding module 300 is configured to decode the video original stream of the packet to obtain a video data packet.
视频原始流包括多个访问单元,每一个访问单元是一幅图像的编码数据。视频编码方式可以采用变换编码、熵编码、运动估计和运动补偿,或者是混合编码方式进行编码,视频数据包则包括若干帧的图像。The video original stream includes a plurality of access units, each of which is encoded data of an image. The video coding method may adopt transform coding, entropy coding, motion estimation and motion compensation, or hybrid coding, and the video data packet includes images of several frames.
预览信息获取模块400,用于将视频数据包的第一帧图像,以及与第一帧图像对应的时间戳存储进数据库。The preview information obtaining module 400 is configured to store the first frame image of the video data packet and the time stamp corresponding to the first frame image into the database.
具体而言,是将切片的第一帧图像及对应的时间戳存储进名字为vod.databse.db的数据库,当然该数据也可以命名为其它名字,本申请对此不作限定。Specifically, the first frame image of the slice and the corresponding time stamp are stored in a database named vod.databse.db. Of course, the data may also be named as another name, which is not limited in this application.
预览信息显示模块500,用于将第一帧图像转换为缩略图像,并将缩略图像及对应的时间戳显示于预览区域。The preview information display module 500 is configured to convert the first frame image into a thumbnail image, and display the thumbnail image and the corresponding time stamp in the preview area.
在本实施例中,预览区域位于播放区域的下方,当然也可以设置在播放区域的上方,甚至设置在左边或者右边,在实际实施过程中可根据需要进行设置。缩略图像可以是将第一帧图像进行缩小后进行显示,整个预览区域由若干张缩略图像排列而成。如果屏幕上的预览区域没法显示所有的缩略图像,还可以通过点击预览区域某一端的箭头或者是其它按钮进行显示。In this embodiment, the preview area is located below the play area, and may also be disposed above the play area, even on the left or right side, and may be set as needed during actual implementation. The thumbnail image may be displayed by reducing the first frame image, and the entire preview area is arranged by a plurality of thumbnail images. If the preview area on the screen cannot display all the thumbnail images, you can also display them by clicking the arrow at one end of the preview area or other buttons.
当用户选中某一缩略图像时,将会同时弹出与该缩略图像对应的时间戳,让用户直接观察到,播放时长及画面,较好的提高了用户的体验。When the user selects a certain thumbnail image, the time stamp corresponding to the thumbnail image will be popped up at the same time, so that the user can directly observe, the playing time and the picture, which improves the user experience.
播放模块600,用于接收操作请求,并根据操作请求播放视频。The playing module 600 is configured to receive an operation request, and play the video according to the operation request.
当用户通过用户界面(User Interface,UI)选中预览区域上的某一幅图像后,就会触发SEEK操作,整个SEEK操作的流程如下:When the user selects an image on the preview area through the User Interface (UI), the SEEK operation is triggered. The flow of the entire SEEK operation is as follows:
首先读取预览图像对应的时间戳,如果时间戳没有值,则直接清除seek标志并返 回数据包。如果时间戳有值,则将时间戳的值转化为微秒并与seek传入的时间进行比较,如果时间戳的值大于seek时间,则表明读取的数据包达到了seek要求,否则继续读取数据包,直到时间戳的值等于seek时间。当时间戳的值等于seek时间,则看该数据包的标志是否是关键帧,如果是则返回该数据包,否则继续取数据包。First read the timestamp corresponding to the preview image. If the timestamp has no value, the seek flag is directly cleared and returned. Back to the packet. If the timestamp has a value, the value of the timestamp is converted to microseconds and compared with the incoming time of the seek. If the value of the timestamp is greater than the seek time, it indicates that the read packet reaches the seek requirement, otherwise it continues to read. Take the packet until the value of the timestamp is equal to the seek time. When the value of the timestamp is equal to the seek time, it is checked whether the flag of the data packet is a key frame, and if so, the data packet is returned, otherwise the data packet is continued.
本申请实施例的上述技术方案,通过在播放节目时抓取节目传输流中每个切片的第一帧图像及对应的时间戳存储进数据库,并将第一帧图像转换为缩略图像,然后在预览区域显示若干幅缩略图像提供给用户进行预览,以提高用户的体验。The above technical solution of the embodiment of the present application is to store a first frame image of each slice in the program transmission stream and a corresponding time stamp into the database when the program is being played, and convert the first frame image into a thumbnail image, and then convert the first frame image into a thumbnail image, and then Several thumbnail images are displayed in the preview area for the user to preview to enhance the user's experience.
本申请实施例还提供一种非暂态计算机可读存储介质,所述非暂态计算机可读存储介质可存储有程序,该程序执行时可实现执行前述任意一个实施例提供的一种视频实时播放方法的各实现方式中的部分或全部步骤。The embodiment of the present application further provides a non-transitory computer readable storage medium, where the non-transitory computer readable storage medium can store a program, and when executed, the program can implement a video real-time provided by any one of the foregoing embodiments. Some or all of the various implementations of the playback method.
图5是本申请实施例提供的视频实时播放方法的电子设备的硬件结构示意图,如图5所示,该设备包括:FIG. 5 is a schematic structural diagram of hardware of an electronic device for playing a video in real time according to an embodiment of the present disclosure. As shown in FIG. 5, the device includes:
一个或多个处理器510以及存储器520,图5中以一个处理器510为例。One or more processors 510 and memory 520, one processor 510 is taken as an example in FIG.
执行视频实时播放方法的设备还可以包括:输入装置530和输出装置540。The device that performs the video real-time playing method may further include: an input device 530 and an output device 540.
处理器510、存储器520、输入装置530和输出装置540可以通过总线或者其他方式连接,图5中以通过总线连接为例。The processor 510, the memory 520, the input device 530, and the output device 540 may be connected by a bus or other means, as exemplified by a bus connection in FIG.
存储器520作为一种非暂态计算机可读存储介质,可用于存储非易失性软件程序、非易失性计算机可执行程序以及模块,如本申请实施例中的视频实时播放方法对应的程序指令/模块。处理器510通过运行存储在存储器520中的非易失性软件程序、指令以及模块,从而执行电子设备的各种功能应用以及数据处理,即实现上述方法实施例的视频实时播放方法。The memory 520 is used as a non-transitory computer readable storage medium, and can be used for storing a non-volatile software program, a non-volatile computer executable program, and a module, such as a program instruction corresponding to the video real-time playing method in the embodiment of the present application. / module. The processor 510 executes various functional applications and data processing of the electronic device by executing non-volatile software programs, instructions, and modules stored in the memory 520, that is, the video real-time playing method of the foregoing method embodiments.
存储器520可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据视频实时播放装置的使用所创建的数据等。此外,存储器520可以包括高速随机存取存储器,还可以包括非 易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。在一些实施例中,存储器520可选包括相对于处理器510远程设置的存储器,这些远程存储器可以通过网络连接至视频实时播放装置。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 520 may include a storage program area and an storage data area, wherein the storage program area may store an operating system, an application required for at least one function; the storage data area may store data created according to use of the video real-time playback device, and the like. In addition, the memory 520 may include a high speed random access memory, and may also include a non- Volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, memory 520 can optionally include memory remotely located relative to processor 510, which can be connected to the video real-time playback device over a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
输入装置530可接收输入的数字或字符信息,以及产生与视频实时播放装置的用户设置以及功能控制有关的键信号输入。输出装置540可包括显示屏等显示设备。 Input device 530 can receive input numeric or character information and generate key signal inputs related to user settings and function control of the video real-time playback device. The output device 540 can include a display device such as a display screen.
所述一个或者多个模块存储在所述存储器520中,当被所述一个或者多个处理器510执行时,执行上述任意方法实施例中的视频实时播放方法。The one or more modules are stored in the memory 520, and when executed by the one or more processors 510, perform a video real-time playback method in any of the above method embodiments.
上述产品可执行本申请实施例所提供的方法,具备执行方法相应的功能模块和有益效果。未在本实施例中详尽描述的技术细节,可参见本申请实施例所提供的方法。The above products can perform the methods provided by the embodiments of the present application, and have the corresponding functional modules and beneficial effects of the execution method. For technical details that are not described in detail in this embodiment, reference may be made to the method provided by the embodiments of the present application.
本发明实施例的电子设备以多种形式存在,包括但不限于:The electronic device of the embodiment of the invention exists in various forms, including but not limited to:
(1)移动通信设备:这类设备的特点是具备移动通信功能,并且以提供话音、数据通信为主要目标。这类终端包括:智能手机(例如iPhone)、多媒体手机、功能性手机,以及低端手机等。(1) Mobile communication devices: These devices are characterized by mobile communication functions and are mainly aimed at providing voice and data communication. Such terminals include: smart phones (such as iPhone), multimedia phones, functional phones, and low-end phones.
(2)超移动个人计算机设备:这类设备属于个人计算机的范畴,有计算和处理功能,一般也具备移动上网特性。这类终端包括:PDA、MID和UMPC设备等,例如iPad。(2) Ultra-mobile personal computer equipment: This type of equipment belongs to the category of personal computers, has computing and processing functions, and generally has mobile Internet access. Such terminals include: PDAs, MIDs, and UMPC devices, such as the iPad.
(3)便携式娱乐设备:这类设备可以显示和播放多媒体内容。该类设备包括:音频、预览播放器(例如iPod),掌上游戏机,电子书,以及智能玩具和便携式车载导航设备。(3) Portable entertainment devices: These devices can display and play multimedia content. Such devices include: audio, preview players (such as iPod), handheld game consoles, e-books, and smart toys and portable car navigation devices.
(4)服务器:提供计算服务的设备,服务器的构成包括处理器、硬盘、内存、系统总线等,服务器和通用的计算机架构类似,但是由于需要提供高可靠的服务,因此在处理能力、稳定性、可靠性、安全性、可扩展性、可管理性等方面要求较高。(4) Server: A device that provides computing services. The server consists of a processor, a hard disk, a memory, a system bus, etc. The server is similar to a general-purpose computer architecture, but because of the need to provide highly reliable services, processing power and stability High reliability in terms of reliability, security, scalability, and manageability.
(5)其他具有数据交互功能的电子装置。(5) Other electronic devices with data interaction functions.
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理 单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical. Units can be located in one place or distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment. Those of ordinary skill in the art can understand and implement without deliberate labor.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the various embodiments can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware. Based on such understanding, the above-described technical solutions may be embodied in the form of software products in essence or in the form of software products, which may be stored in a computer readable storage medium such as ROM/RAM, magnetic Discs, optical discs, etc., include instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform the methods described in various embodiments or portions of the embodiments.
最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。 Finally, it should be noted that the above embodiments are only used to explain the technical solutions of the present application, and are not limited thereto; although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still The technical solutions described in the foregoing embodiments are modified, or the equivalents of the technical features are replaced by the equivalents. The modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (13)

  1. 一种视频实时播放方法,其特征在于,包括:A video real-time playing method, comprising:
    将视频数据包的第一帧图像,以及与所述第一帧图像对应的时间戳存储进数据库;And storing a first frame image of the video data packet and a time stamp corresponding to the first frame image into a database;
    将所述第一帧图像转换为缩略图像,并将所述缩略图像及对应的时间戳显示于预览区域;Converting the first frame image into a thumbnail image, and displaying the thumbnail image and a corresponding time stamp in a preview area;
    接收操作请求,并根据所述操作请求播放视频。Receiving an operation request and playing a video according to the operation request.
  2. 根据权利要求1所述的方法,其特征在于,所述将视频数据包的第一帧图像,以及与所述第一帧图像对应的时间戳存储进数据库的步骤之前包括:The method according to claim 1, wherein the step of storing the first frame image of the video data packet and the time stamp corresponding to the first frame image into the database comprises:
    下载传输流中的切片;Download the slice in the transport stream;
    对所述传输流中的切片进行解复用后得到分组的视频原始流以及节目特定信息。Demultiplexing the slices in the transport stream to obtain a packetized video original stream and program specific information.
  3. 根据权利要求2所述的方法,其特征在于,所述将视频数据包的第一帧图像,以及与所述第一帧图像对应的时间戳存储进数据库的步骤之前还包括:The method according to claim 2, wherein the step of storing the first frame image of the video data packet and the time stamp corresponding to the first frame image into the database further comprises:
    对所述分组的视频原始流解码,得到所述视频数据包。Decoding the video original stream of the packet to obtain the video data packet.
  4. 根据权利要求2或3所述的方法,其特征在于,所述节目特定信息包括节目关联表、节目映射表和时间戳。The method according to claim 2 or 3, wherein the program specific information comprises a program association table, a program map table, and a time stamp.
  5. 根据权利要求2所述的方法,其特征在于,所述下载传输流中的切片的步骤具体包括:The method according to claim 2, wherein the step of downloading the slice in the transport stream specifically comprises:
    通过第一线程从所述传输流的第一个切片开始下载,同时通过第二线程从所述传输流的最后一个切片开始下载。The download is started from the first slice of the transport stream by the first thread while the download is started from the last slice of the transport stream by the second thread.
  6. 一种视频实时播放装置,其特征在于,包括:A video real-time playing device, comprising:
    预览信息获取模块,用于将视频数据包的第一帧图像,以及与所述第一帧图 像对应的时间戳存储进数据库;a preview information obtaining module, configured to: image a first frame of the video data packet, and the first frame image Store the corresponding timestamp into the database;
    预览信息显示模块,用于将所述第一帧图像转换为缩略图像,并将所述缩略图像及对应的时间戳显示于预览区域;a preview information display module, configured to convert the first frame image into a thumbnail image, and display the thumbnail image and a corresponding time stamp in a preview area;
    播放模块,用于接收操作请求,并根据所述操作请求播放视频。a playing module, configured to receive an operation request, and play a video according to the operation request.
  7. 根据权利要求6所述的装置,其特征在于,还包括:The device according to claim 6, further comprising:
    下载模块,用于下载传输流中的切片;a download module for downloading slices in the transport stream;
    解复用模块,用于对所述传输流中的切片进行解复用后得到分组的视频原始流以及节目特定信息。And a demultiplexing module, configured to demultiplex the slice in the transport stream to obtain a grouped video original stream and program specific information.
  8. 根据权利要求7所述的装置,其特征在于,还包括:The device according to claim 7, further comprising:
    解码模块,用于对所述分组的视频原始流解码,得到所述视频数据包。And a decoding module, configured to decode the video original stream of the packet, to obtain the video data packet.
  9. 根据权利要求7或8所述的装置,其特征在于,所述节目特定信息包括节目关联表、节目映射表和时间戳。The apparatus according to claim 7 or 8, wherein said program specific information comprises a program association table, a program map table, and a time stamp.
  10. 根据权利要求7所述的装置,其特征在于,所述下载模块具体包括:The device according to claim 7, wherein the downloading module specifically comprises:
    第一下载子模块,用于通过第一线程从所述传输流的第一个切片开始下载;以及a first download submodule for downloading from the first slice of the transport stream by the first thread;
    第二下载子模块,用于通过第二线程从所述传输流的最后一个切片开始下载。a second download submodule for downloading from the last slice of the transport stream by the second thread.
  11. 一种非暂态计算机可读存储介质,其特征在于,所述非暂态计算机可读存储介质存储计算机程序,所述计算机程序用于使所述计算机执行权利要求1-5任一所述方法。A non-transitory computer readable storage medium, characterized in that the non-transitory computer readable storage medium stores a computer program for causing the computer to perform the method of any of claims 1-5 .
  12. 一种电子设备,包括:An electronic device comprising:
    一个或多个处理器;以及,One or more processors; and,
    存储器;其特征在于,Memory; characterized in that
    所述存储器存储有可被所述一个或多个处理器执行的指令,所述指令被所述 一个或多个处理器执行,以使所述一个或多个处理器:The memory stores instructions executable by the one or more processors, the instructions being Executing by one or more processors to cause the one or more processors to:
    将视频数据包的第一帧图像,以及与所述第一帧图像对应的时间戳存储进数据库;And storing a first frame image of the video data packet and a time stamp corresponding to the first frame image into a database;
    将所述第一帧图像转换为缩略图像,并将所述缩略图像及对应的时间戳显示于预览区域;Converting the first frame image into a thumbnail image, and displaying the thumbnail image and a corresponding time stamp in a preview area;
    接收操作请求,并根据所述操作请求播放视频。Receiving an operation request and playing a video according to the operation request.
  13. 一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行权利要求1-5所述的方法。 A computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions that, when executed by a computer, cause the computer to execute The method of claims 1-5.
PCT/CN2016/096989 2015-12-03 2016-08-26 Method and device for video real-time playback WO2017092433A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510883531.4 2015-12-03
CN201510883531.4A CN105916011A (en) 2015-12-03 2015-12-03 Video real-time playing method and device

Publications (1)

Publication Number Publication Date
WO2017092433A1 true WO2017092433A1 (en) 2017-06-08

Family

ID=56744205

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/096989 WO2017092433A1 (en) 2015-12-03 2016-08-26 Method and device for video real-time playback

Country Status (2)

Country Link
CN (1) CN105916011A (en)
WO (1) WO2017092433A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114125498A (en) * 2021-11-24 2022-03-01 北京百度网讯科技有限公司 Video data processing method, device, equipment and storage medium
CN114374860A (en) * 2021-12-29 2022-04-19 中国电信股份有限公司 Video service processing method and device

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107864399B (en) * 2017-11-17 2020-05-05 山东云缦智能科技有限公司 Method and device for acquiring real-time poster from live stream
CN111885412B (en) * 2020-07-06 2022-08-09 深圳市宝泽科技有限公司 HDMI signal screen transmission method and wireless screen transmission device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101438593A (en) * 2006-03-10 2009-05-20 Lg电子株式会社 Video browsing based on thumbnail image
CN101540861A (en) * 2009-01-14 2009-09-23 宇龙计算机通信科技(深圳)有限公司 Playing method, system and mobile terminal of video file
US20140317658A1 (en) * 2007-11-16 2014-10-23 At&T Intellectual Property I, L.P. Methods And Computer Program Products For Subcontent Tagging And Playback
CN104767801A (en) * 2015-03-23 2015-07-08 上海大唐移动通信设备有限公司 Two-thread ftp transmission method and system
CN105049768A (en) * 2015-08-18 2015-11-11 深圳市为有视讯有限公司 Video playback method of video recording equipment
CN105100961A (en) * 2015-07-23 2015-11-25 华为技术有限公司 Media preview generation method and generation apparatus

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000332829A (en) * 1999-05-25 2000-11-30 Nippon Telegr & Teleph Corp <Ntt> Reception data quantity control method in telephone system, device therefor and storage medium recording its method
KR101454025B1 (en) * 2008-03-31 2014-11-03 엘지전자 주식회사 Method and device for playing the picture using the recording information
EP2749027B1 (en) * 2011-08-25 2020-04-29 Sun Patent Trust Methods and apparatuses for encoding and decoding video using updated buffer description

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101438593A (en) * 2006-03-10 2009-05-20 Lg电子株式会社 Video browsing based on thumbnail image
US20140317658A1 (en) * 2007-11-16 2014-10-23 At&T Intellectual Property I, L.P. Methods And Computer Program Products For Subcontent Tagging And Playback
CN101540861A (en) * 2009-01-14 2009-09-23 宇龙计算机通信科技(深圳)有限公司 Playing method, system and mobile terminal of video file
CN104767801A (en) * 2015-03-23 2015-07-08 上海大唐移动通信设备有限公司 Two-thread ftp transmission method and system
CN105100961A (en) * 2015-07-23 2015-11-25 华为技术有限公司 Media preview generation method and generation apparatus
CN105049768A (en) * 2015-08-18 2015-11-11 深圳市为有视讯有限公司 Video playback method of video recording equipment

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114125498A (en) * 2021-11-24 2022-03-01 北京百度网讯科技有限公司 Video data processing method, device, equipment and storage medium
CN114125498B (en) * 2021-11-24 2024-02-27 北京百度网讯科技有限公司 Video data processing method, device, equipment and storage medium
CN114374860A (en) * 2021-12-29 2022-04-19 中国电信股份有限公司 Video service processing method and device

Also Published As

Publication number Publication date
CN105916011A (en) 2016-08-31

Similar Documents

Publication Publication Date Title
WO2019205872A1 (en) Video stream processing method and apparatus, computer device and storage medium
WO2016150317A1 (en) Method, apparatus and system for synthesizing live video
US9357239B2 (en) Converting live streaming content to video-on-demand streaming content
US10638192B2 (en) Live streaming quick start method and system
EP3448040A1 (en) Live broadcast rapid-startup method and system
WO2016182844A1 (en) Transferring media data using a websocket subprotocol
CN107634930B (en) Method and device for acquiring media data
WO2017092434A1 (en) Method and device for audio/video real-time transmission, method and device for audio/video real-time playback
US20190020915A1 (en) Processing media data using file tracks for web content
US11321516B2 (en) Processing dynamic web content of an ISO BMFF web resource track
WO2017092433A1 (en) Method and device for video real-time playback
US20210014558A1 (en) Media Information Processing Method, Related Device, and Computer Storage Medium
US20180176278A1 (en) Detecting and signaling new initialization segments during manifest-file-free media streaming
EP4192020A1 (en) Channel change method and apparatus
WO2019114330A1 (en) Video playback method and apparatus, and terminal device
WO2017185601A1 (en) Method and device for providing and downloading video
US20230045876A1 (en) Video Playing Method, Apparatus, and System, and Computer Storage Medium
CN107566854B (en) Method and device for acquiring and sending media content
CN109756744B (en) Data processing method, electronic device and computer storage medium
WO2015123861A1 (en) Method for processing video, terminal and server
CN106331763B (en) Method for seamlessly playing fragmented media file and device for implementing method
WO2017071428A1 (en) Fast forward/rewind processing method and terminal
WO2016090916A1 (en) Code stream transmission method and device
US20230300430A1 (en) Method and system to highlight video segments in a video stream
WO2017092435A1 (en) Method and device for audio/video real-time transmission, transmission stream packing method, and multiplexer

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16869744

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16869744

Country of ref document: EP

Kind code of ref document: A1