WO2018076899A1 - 一种数据切换方法、装置、终端及计算机可读存储介质 - Google Patents
一种数据切换方法、装置、终端及计算机可读存储介质 Download PDFInfo
- Publication number
- WO2018076899A1 WO2018076899A1 PCT/CN2017/097711 CN2017097711W WO2018076899A1 WO 2018076899 A1 WO2018076899 A1 WO 2018076899A1 CN 2017097711 W CN2017097711 W CN 2017097711W WO 2018076899 A1 WO2018076899 A1 WO 2018076899A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- video
- data
- sub
- related sub
- attribute
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 49
- 238000003860 storage Methods 0.000 title claims abstract description 15
- 238000004590 computer program Methods 0.000 claims description 11
- 230000004044 response Effects 0.000 claims description 8
- 230000011218 segmentation Effects 0.000 claims description 5
- 238000012217 deletion Methods 0.000 claims description 2
- 230000037430 deletion Effects 0.000 claims description 2
- 230000001360 synchronised effect Effects 0.000 abstract description 8
- 238000010586 diagram Methods 0.000 description 7
- 230000006870 function Effects 0.000 description 5
- 230000003287 optical effect Effects 0.000 description 2
- 238000000926 separation method Methods 0.000 description 2
- 238000004904 shortening Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing 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/4302—Content synchronisation processes, e.g. decoder synchronisation
- H04N21/4307—Synchronising 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing 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/44—Processing 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/4402—Processing 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing 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/44—Processing 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/4402—Processing 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
- H04N21/440218—Processing 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 by transcoding between formats or standards, e.g. from MPEG-2 to MPEG-4
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/45—Management operations performed by the client for facilitating the reception of or the interaction with the content or administrating data related to the end-user or to the client device itself, e.g. learning user preferences for recommending movies, resolving scheduling conflicts
- H04N21/458—Scheduling content for creating a personalised stream, e.g. by combining a locally stored advertisement with an incoming stream; Updating operations, e.g. for OS modules ; time-related management operations
Definitions
- the present invention relates to the field of information processing, and in particular, to a data switching method, apparatus, terminal, and computer readable storage medium.
- the same video file may have multiple language types, such as Chinese, English, etc.; when playing media files using the media player, when the user selects different language types for playback, audio data will be involved. Or switching of subtitles.
- the audio data frame and the synchronization stamp of the track to be switched are generally searched according to the audio switching instruction, that is, the corresponding audio data frame and the synchronization stamp are searched according to the time stamp of the video when the track is switched. That is to say, when the user needs to synchronize audio or subtitles, if the video is played continuously, the method of finding the audio data of the track to be switched according to the synchronization stamp may cause the synchronization between the video and the audio, video and subtitles to be time consuming. Long or sync failed.
- the synchronization between the video and the audio and the subtitle may be too long or the synchronization may fail, and the user experience is poor.
- embodiments of the present invention provide a data switching method, apparatus, terminal, and computer readable storage medium.
- an embodiment of the present invention provides a data switching method, including: receiving a video related data switching instruction, where the video related switching instruction is used to switch current video related data to target video related sub data,
- the target video related sub-data is video-related sub-data having a first attribute;
- the video-related data switching instruction is executed, and the i-th video-related sub-data is obtained from a head of the preset video-related data queue, wherein the i An integer greater than or equal to 1; if the ith video-related sub-data is not video-related sub-data having a first attribute, obtaining an i+1th video correlation sub-score from the preset video-related data queue Data, and so on, until the video-related sub-data having the first attribute is obtained, and the video-related sub-data having the first attribute is determined as the target video-related sub-data; and the target video-related sub-data is sent to the decoder Decoding is performed to enable playback in synchronization with the corresponding video frame.
- the embodiment of the present invention provides a data switching apparatus, including: a receiving module, configured to receive a video related data switching instruction, where the video related switching instruction is configured to switch current video related data to a target video Corresponding sub-data, the target video-related sub-data is video-related sub-data having a first attribute; the acquiring module is configured to execute the video-related data switching instruction, and obtain an i-th from a preset head of the video-related data queue Video related sub-data, wherein the i is an integer greater than or equal to 1; the determining module is configured to: if the i-th video-related sub-data is not video-related sub-data having a first attribute, Obtaining the (i+1)th video related sub-data in the video-related data queue, and so on, until the video-related sub-data having the first attribute is obtained, and determining the video-related sub-data having the first attribute as the target video Corresponding sub-data; a sending module configured to send the target video-related sub
- an embodiment of the present invention provides a terminal, including: a touch screen and a processor, wherein the touch screen is configured to receive a video related data switching instruction, where the video related switching instruction is configured to use a current video
- the related data is switched to target video related sub-data, the target video-related sub-data is video-related sub-data having a first attribute
- the processor is configured to execute the video-related data switching instruction from a preset video correlation
- the head of the data queue obtains the i-th video-related sub-data, wherein the i is an integer greater than or equal to 1; if the ith video-related sub-data is not the video-related sub-data having the first attribute, then Acquiring the i+1th video related sub-data in the preset video-related data queue, and so on, until the video-related sub-data having the first attribute is obtained, and the video-related sub-function having the first attribute is obtained
- the data is determined as target video related sub-data; the target video related sub-data is sent to
- an embodiment of the present invention further provides a computer readable storage medium having stored thereon a computer program, the computer program being executed by a processor to implement the steps of any of the foregoing methods.
- Embodiments of the present invention provide a data switching method, apparatus, terminal, and computer readable storage medium. First, by receiving a video related data switching instruction, executing a video related instruction, obtaining an i th from a preset head of a video related data queue.
- the i+1th video-related sub-data is obtained from the preset video-related data queue, and so on until Obtaining video-related sub-data having the first attribute, and determining the video-related sub-data having the first attribute as the target video-related sub-data, that is, the attribute information of the video-related sub-data is a finite number, corresponding to the video frame
- the attribute information of the video-related sub-data obtains the target video-related sub-data from the head of the video-related data queue, improves the switching speed, enables smooth switching of the video-related sub-data, and then sends the target video-related sub-data to the decoding.
- the solution of the embodiment of the present invention can improve the switching speed of video related data during video playback, shorten the video related data and video synchronization time, and improve the user experience.
- FIG. 1-1 is a schematic flowchart of a data switching method according to Embodiment 1 of the present invention.
- 1-2 is a schematic structural diagram of a video related data queue according to Embodiment 1 of the present invention.
- FIG. 2 is a schematic flowchart of a data switching method according to Embodiment 2 of the present invention.
- FIG. 3 is a schematic flowchart of a data switching method according to Embodiment 3 of the present invention.
- Embodiment 4 is a schematic flowchart of a data switching method in Embodiment 4 of the present invention.
- FIG. 5 is a schematic structural diagram of a data switching apparatus according to Embodiment 5 of the present invention.
- FIG. 6 is a schematic structural diagram of a terminal in Embodiment 6 of the present invention.
- Embodiment 1 is a diagrammatic representation of Embodiment 1:
- the embodiment of the present invention provides a data switching method, where the execution body of the data switching method is a data switching device, and the data switching device can be built in or externally connected to a terminal.
- the terminal can be a smart phone, a computer, or a set top box.
- the terminal having the function of playing the media file is not specifically limited in the embodiment of the present invention.
- FIG. 1-1 is a schematic flowchart of a data switching method according to Embodiment 1 of the present invention. Referring to FIG. 1-1, the method includes:
- the video related switching instruction is used to switch the current video related data to the target video related sub data
- the target video related sub data is the video related sub data having the first attribute.
- the video related data includes audio data and subtitle data.
- the video related sub-data of the preset video-related data queue is synchronized with the video frame of the preset video data queue and sent to the respective decoder for decoding and playing, and the receiving is triggered by the user or
- the video-related data switching instruction of the system preset (for example, setting the third second to play in Chinese) is not specifically limited in the embodiment of the present invention. Take the example of switching audio data as an example: If the user is watching a Chinese-speaking movie, if the user wants to switch the movie to English pronunciation and continue watching, he can click on the button or option on the terminal for switching audio attributes. Switching of video related data.
- the attribute is used to represent the language of the video related data, for example, Chinese, English, etc.; or, it may be set by the system.
- S102 Perform a video related data switching instruction, and acquire an ith video related sub-data from a head of the preset video related data queue;
- the video related data queue may sequentially arrange video related sub-data having different attributes according to a time stamp of the video frame and a preset order. Queue.
- obtaining video related sub-data in a preset video-related data queue is to dequeue the video-related sub-data in a first-in first-out order, and when performing a video-related data switching instruction, determining a preset video-related data queue Whether it is non-empty, when the preset video related data queue is not empty, the i-th video-related sub-data for dequeuing is obtained from the address pointed to by the preset video-related data queue head pointer; when the preset video is related When the data queue is empty, it waits for the enrollment of the video-related subdata corresponding to the video frame.
- video-related sub-data a, b, c, d, e are present in a preset video-related data queue.
- the first pointer of the team points to the video-related sub-data a, and the tail-of-tail pointer points to the video-related sub-data e or d, and then the video-related data switching instruction is executed, and the queue-point pointer is obtained from the preset video-related data queue for dequeuing.
- the video is related to the sub-data a, and then a is deleted from the preset video-related data queue, and the leader pointer is incremented by one; then the video-related sub-data b, c, d, e is present in the currently preset video-related data queue.
- the leader pointer points to the video-related sub-data b, and the tail pointer points to the video-related sub-data e or d.
- the attribute of the i-th video-related sub-data is obtained, and it is determined whether the attribute of the i-th video-related sub-data is consistent with the first attribute; wherein, if the attribute of the i-th video-related sub-data is consistent with the first attribute And determining the i-th video-related sub-data as the target video-related sub-data; if the attribute of the i-th video-related sub-data is inconsistent with the first attribute, the i-th video-related sub-data is not the video-related having the first attribute Subdata, then release video related subdata that is not the first attribute.
- the attribute of the i-th video-related sub-data a is obtained in Chinese, and it is determined whether the attribute of the video-related sub-data a is consistent with the first attribute, and when the first attribute is English, the video-related sub-data a is released; When an attribute is Chinese, the video-related sub-data a is determined as the target video-related sub-data.
- S104 Send to the decoder for decoding, so as to play synchronously with the corresponding video frame.
- the player simultaneously calls the audio decoder to decode the target audio sub-data obtained above, and calls the subtitle decoder to decode the target sub-sub-data, and decodes the audio sub-data and subtitle according to the same time stamp.
- Data and video frames are output to the playback window and synchronized.
- the video related data queue is a queue as shown in FIG. 1-2, and it is assumed that the video related queue has two types of attributes, that is, video related sub-data a 1 and a in the video-related data queue.
- 2 is video-related sub-data of different attributes corresponding to the second video frame
- a 3 and a 4 are video-related sub-data having different attributes corresponding to the third video frame
- a 1 and a 3 have the same attribute.
- the video data When playing the second video frame, the video data is received the switching instruction, the video data from the queue out to take the first video data associated with the third sub-frames of video corresponding to a 3, 3 determines a property of, if a is 3 attribute is the first attribute, a 3 will be transmitted to the decoder for decoding; attribute if the first attribute is not a 3, then the head of the queue pointer is incremented, data taken from the video queue associated sub video data a 4, if The attribute of the video-related sub-data a 4 is the first attribute, and the video-related sub-data a 4 is determined as the target video-priority sub-data, and the target video-related sub-data is sent to the decoder for decoding. Since the attributes of the video-related data in the video-related queue are two types, the number of times of the video-related sub-data corresponding to the video frame is limited from the video-related data queue, and the smooth switching of the video-related data can be realized.
- the data switching method first, by receiving a video related data switching instruction, executing a video related instruction, acquiring an i th video related sub-data from a head of a preset video related data queue, if the i-th video is related If the sub-data is not the video-related sub-data having the first attribute, the i+1th video-related sub-data is obtained from the preset video-related data queue, and so on, until the video-related sub-data having the first attribute is obtained, and The video-related sub-data having the first attribute is determined as the target video-related sub-data.
- the attribute information of the video-related sub-data is limited, and the target video-related sub-data is obtained from the head of the video-related data queue according to the attribute information of the video-related sub-data corresponding to the video frame, thereby improving the switching speed and capable of The smooth switching of the video-related sub-data is implemented, and then the target video-related sub-data is sent to the decoder for decoding, so as to realize synchronous play with the corresponding video frame, shortening the video-related data and video synchronization time, and improving the user experience.
- the embodiment provides a data switching method. As shown in FIG. 2, the method includes:
- the play request is used to play the current media file.
- the media file is a file synthesized by the encoded video data and the encoded video related data.
- S202 Acquire a media file in response to the media file play request.
- multimedia video processing tools such as Fast Forward Moving Picture Experts Group (FFMPEG) software
- FFMPEG Fast Forward Moving Picture Experts Group
- other software may be used. Specifically limited.
- S204 Process video data to obtain at least one video frame.
- S205 Perform video segmentation according to a preset segmentation policy to obtain video-related sub-data corresponding to at least one video frame.
- S206 Align the video-related sub-data having different attributes corresponding to the video frame according to the timestamp of the at least one video frame and the preset order, to obtain a video-related data queue.
- the preset order is the order of the attributes of the video-related sub-data
- the attribute indicates the language type of the video-related sub-data, for example, Chinese, English, and the like, which are not specifically limited in the embodiment of the present invention.
- a queue is pre-created, and the video-related sub-data is stored in a preset in a first-in-first-out order according to a time stamp of at least one video frame and a preset order of video-related sub-data having different attributes.
- a queue is created in advance, and it is assumed that the preset video-related sub-data having different attributes has an even-ordered order of Chinese, and the odd-numbered bits are English, and the video-related sub-data corresponding to the first video frame has English attributes. The first one enters the queue, and then the second video-related sub-data corresponding to the first video frame with the Chinese attribute is enqueued, and so on, the video-related data queue is obtained.
- the pre-created queue may be a chain queue or a loop queue, which is not specifically limited in the embodiment of the present invention.
- the queue leader and tail pointer of the queue can be customized.
- the head pointer Can point to the actual team leader, the tail pointer points to the next slot at the end of the team; it can also point the leader pointer to the first slot in the team leader, and the tail pointer points to the actual team tail.
- Embodiment 3 is a diagrammatic representation of Embodiment 3
- the embodiment provides a data switching method. As shown in FIG. 3, the method includes:
- the play request is used to play the current media file.
- the media file may be a video media file or an audio media file, which is not specifically limited in the embodiment of the present invention.
- the separation may be to separate media files including audio, video, and subtitles into independent audio data, video data, and subtitle data.
- the media file separator can be used to separate the packaged and synthesized media files to obtain independent video data and video related data.
- the player opens the media file and the player calls the splitter to separate the media file into separate video data and video related data.
- S304 Process video data to obtain at least one video frame.
- S305 Segment video related data according to a preset splitting strategy, to obtain video related sub-data corresponding to at least one video frame;
- S308 Align the video-related sub-data with different attributes corresponding to the video frame according to the timestamp of the at least one video frame and the preset order, to obtain a video-related data queue.
- Embodiment 4 is a diagrammatic representation of Embodiment 4:
- the embodiment provides a data switching method. As shown in FIG. 4, the method includes:
- the play request is used to play the current media file.
- S402 Acquire a media file in response to the media file play request.
- S403 determining whether the video related data queue is full; wherein, if the video related data queue is full, executing S410; if the video related data queue is not full, executing S404;
- S405 Process video data to obtain at least one video frame.
- S406 Segment video related data according to a preset splitting strategy, to obtain video related sub-data corresponding to at least one video frame;
- the data types include: video, audio, subtitles.
- S409 Align the video-related sub-data with different attributes corresponding to the video frame according to the timestamp of the at least one video frame and the preset order, to obtain a video-related data queue.
- the data switching method provided in this embodiment determines whether the video related data queue is full before the media file is separated, and stops the media file separation if the video related data queue is full, thereby avoiding the video related data queue team.
- the video-related sub-data written after the overlay covers the risk of the video-related sub-data written first, and the integrity of the video-related data can be guaranteed.
- Embodiment 5 is a diagrammatic representation of Embodiment 5:
- the present embodiment provides a data switching apparatus, which can be applied to a terminal in one or more of the above embodiments.
- the data switching apparatus 50 includes: a receiving module 51 configured to receive a video related data switching instruction, where a video related switching instruction For the current video related data to be switched to the target video related subdata, the target video related sub data is the video related subdata having the first attribute; the obtaining module 52 is configured to execute the video related data switching instruction from the preset video The head of the associated data queue obtains the i-th video-related sub-data, where i is an integer greater than or equal to 1; the determining module 53 is configured to if the i-th video-related sub-data is not the video-related sub-data having the first attribute And obtaining the i+1th video related sub-data from the preset video related data queue, and so on until obtaining the video-related sub-data having the first attribute, and determining the video-related sub-data having the first attribute as Target video related sub-data; the sending module 54 is configured to send the target
- the apparatus may further include: a storage module configured to receive a media file play request, wherein the play request is used to play the current media file; the media file is retrieved in response to the media file play request; and the media file is separated Obtaining video data and video related data; processing the video data to obtain at least one video frame; dividing the video related data according to a preset segmentation strategy, and obtaining video related subdata corresponding to the at least one video frame; according to at least one The time stamp of the video frame and the preset order are sequentially arranged with the video-related sub-data having different attributes corresponding to the video frame to obtain a video-related data queue.
- the apparatus may further include: a deletion module configured to acquire video-related sub-data whose data type cannot be read; and release video-related sub-data whose data type cannot be read from the video-related sub-data.
- the apparatus may further include: a determining module configured to determine whether the video related data queue is full; if the video related data queue is full, stop separating the media files; if the video related data queue is not full , then separate the media files.
- a determining module configured to determine whether the video related data queue is full; if the video related data queue is full, stop separating the media files; if the video related data queue is not full , then separate the media files.
- an embodiment of the present invention provides a terminal that is consistent with a terminal in one or more of the foregoing embodiments.
- the terminal 60 includes: a touch screen 61 and a processor 62, wherein the touch screen 61 is configured to receive a video related data switching instruction, wherein the video related switching instruction is used to switch the current video related data to the target Video-related sub-data, the target video-related sub-data is video-related sub-data having a first attribute; the processor 62 is configured to execute a video-related data switching instruction to obtain an ith video from a preset head of the video-related data queue Relevant sub-data, where i is an integer greater than or equal to 1; if the i-th video-related sub-data is not video-related sub-data having the first attribute, the i+1th is obtained from the preset video-related data queue Video-related sub-data, and so on, until the video-related sub-data having the first attribute is obtained, and the video-related sub-data having the first attribute is determined as the target video-related sub-data; and the target video-related sub-data is sent to the decoder.
- the touch screen 61
- the processor 62 is configured to receive a media file play request, where the play request is used to play the current media file; in response to the media file play request, the media file is obtained; and the media file is separated to obtain the video data.
- video related data processing the video data to obtain at least one video frame; dividing the video related data according to a preset segmentation strategy to obtain video related subdata corresponding to the at least one video frame; according to at least one video frame time
- the video-related sub-data having different attributes corresponding to the video frame are sequentially arranged to obtain a video-related data queue.
- the processor 62 is configured to acquire video-related sub-data whose data type cannot be read; and to release video-related sub-data whose data type cannot be read from the video-related sub-data.
- the processor 62 is configured to determine whether the video related data queue is full; if the video related data queue is full, stop separating the media files; if the video related data queue is not full, the media is The files are separated.
- the processor may be an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), and a programmable At least one of a PLD (Programmable Logic Device), a Field Programmable Gate Array (FPGA), a Central Processing Unit (CPU), a controller, a microcontroller, and a microprocessor .
- ASIC Application Specific Integrated Circuit
- DSP Digital Signal Processor
- DSPD Digital Signal Processing Device
- a PLD Programmable Logic Device
- FPGA Field Programmable Gate Array
- CPU Central Processing Unit
- the electronic device configured to implement the above-mentioned processor functions may be other, which is not specifically limited in the embodiment of the present invention.
- embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
- the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
- the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
- These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
- the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
- an embodiment of the present invention further provides a computer readable storage medium, which can be executed by the processor 62 of the terminal to complete the steps of the foregoing method.
- the computer readable storage medium may be a magnetic random access memory (FRAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), and an erasable memory. Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Flash Memory, Magnetic Surface Memory, Optical Disc Or a memory such as a CD-ROM (Compact Disc Read-Only Memory).
- an embodiment of the present invention provides a computer readable storage medium having stored thereon a computer program that, when executed by a processor, performs the method provided by one or more of the above technical solutions.
- the solution provided by the embodiment of the present invention obtains the i-th video-related sub-data from the head of the preset video-related data queue by receiving the video-related data switching instruction and executing the video-related instruction, if the i-th video-related sub-data is not
- the video-related sub-data having the first attribute obtains the i+1th video-related sub-data from the preset video-related data queue, and so on, until the video-related sub-data having the first attribute is obtained, and will have the first
- the video-related sub-data of an attribute is determined as the target video-related sub-data, that is, the attribute information of the video-related sub-data is a finite number, and the video-related number is obtained according to the attribute information of the video-related sub-data corresponding to the video frame.
- the target video related sub-data is obtained, the switching speed is improved, and the video-related sub-data can be smoothly switched; the target video-related sub-data is sent to the decoder for decoding, so as to realize synchronous playback with the corresponding video frame. Reduced video-related data and video synchronization time and improved user experience.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Databases & Information Systems (AREA)
- Television Signal Processing For Recording (AREA)
Abstract
本发明实施例公开了一种数据切换方法、装置、终端及计算机可读存储介质,方法包括:接收视频相关数据切换指令,其中,视频相关切换指令用于将当前的视频相关数据切换为目标视频相关子数据,目标视频相关子数据为具有第一属性的视频相关子数据;执行视频相关数据切换指令,从预设的视频相关数据队列的队首获取第i个视频相关子数据,如果第i个视频相关子数据不是具有第一属性的视频相关子数据,则从预设的视频相关数据队列中获取第i+1个视频相关子数据,依次类推,直至获得具有第一属性的视频相关子数据,并将具有第一属性的视频相关子数据确定为目标视频相关子数据;将目标视频相关子数据发送到解码器进行解码,以实现与对应的视频帧同步播放。
Description
相关申请的交叉引用
本申请基于申请号为201610967202.2、申请日为2016年10月28日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。
本发明涉及信息处理领域,尤其涉及一种数据切换方法、装置、终端及计算机可读存储介质。
为了满足用户的需求,同一视频文件可能有多种语言类型,例如,中文、英文等;当使用媒体播放器播放这种媒体文件时,用户选择不同语言类型进行播放时,将会涉及到音频数据或者字幕的切换。
在相关技术中,一般根据音频切换指令,查找需要切换的音轨的音频数据帧和同步戳,即根据进行音轨切换时视频的时间戳去查找对应的音频数据帧和同步戳。也就是说,当用户需要同步音频或者字幕时,如果视频不间断播放,根据同步戳查找需要切换的音轨的音频数据的方法,可能导致视频和音频、视频和字幕之间的同步耗时过长或者同步失败。
可见,采用相关技术进行视频相关数据切换时,可能导致视频和音频、字幕之间的同步耗时过长或者同步失败的问题,用户体验较差。
发明内容
为解决现有存在的技术问题,本发明实施例提供一种数据切换方法、装置、终端及计算机可读存储介质。
本发明实施例的技术方案是这样实现的:
第一方面,本发明实施例提供一种数据切换方法,包括:接收视频相关数据切换指令,其中,所述视频相关切换指令用于将当前的视频相关数据切换为目标视频相关子数据,所述目标视频相关子数据为具有第一属性的视频相关子数据;执行所述视频相关数据切换指令,从预设的视频相关数据队列的队首获取第i个视频相关子数据,其中,所述i为大于或等于1的整数;如果所述第i个视频相关子数据不是具有第一属性的视频相关子数据,则从所述预设的视频相关数据队列中获取第i+1个视频相关子数据,依次类推,直至获得具有第一属性的视频相关子数据,并将所述具有第一属性的视频相关子数据确定为目标视频相关子数据;将所述目标视频相关子数据发送到解码器进行解码,以实现与对应的视频帧同步播放。
第二方面,本发明实施例提供了一种数据切换装置,包括:接收模块,配置为接收视频相关数据切换指令,其中,所述视频相关切换指令配置为将当前的视频相关数据切换为目标视频相关子数据,所述目标视频相关子数据为具有第一属性的视频相关子数据;获取模块,配置为执行所述视频相关数据切换指令,从预设的视频相关数据队列的队首获取第i个视频相关子数据,其中,所述i为大于或等1的整数;确定模块,配置为如果所述第i个视频相关子数据不是具有第一属性的视频相关子数据,则从所述预设的视频相关数据队列中获取第i+1个视频相关子数据,依次类推,直至获得具有第一属性的视频相关子数据,并将所述具有第一属性的视频相关子数据确定为目标视频相关子数据;发送模块,配置为将所述目标视频相关子数据发送到解码器进行解码,以实现与对应的视频帧同步播放。
第三方面,本发明实施例提供了一种终端,包括:触摸屏和处理器,其中,所述触摸屏,配置为接收视频相关数据切换指令,其中,所述视频相关切换指令配置为将当前的视频相关数据切换为目标视频相关子数据,所述目标视频相关子数据为具有第一属性的视频相关子数据;所述处理器,配置为执行所述视频相关数据切换指令,从预设的视频相关数据队列的队首获取第i个视频相关子数据,其中,所述i为大于或等1的整数;如果所述第i个视频相关子数据不是具有第一属性的视频相关子数据,则从所述预设的视频相关数据队列中获取第i+1个视频相关子数据,依次类推,直至获得具有第一属性的视频相关子数据,并将所述具有第一属性的视频相关子
数据确定为目标视频相关子数据;将所述目标视频相关子数据发送到解码器进行解码,以实现与对应的视频帧同步播放。
第四方面,本发明实施例还提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述任一方法的步骤。
本发明实施例提供一种数据切换方法、装置、终端及计算机可读存储介质,首先,通过接收视频相关数据切换指令,执行视频相关指令,从预设的视频相关数据队列的队首获取第i个视频相关子数据,如果第i个视频相关子数据不是具有第一属性的视频相关子数据,则从预设的视频相关数据队列中获取第i+1个视频相关子数据,依次类推,直至获得具有第一属性的视频相关子数据,并将具有第一属性的视频相关子数据确定为目标视频相关子数据,也就是说,视频相关子数据的属性信息为有限个,按照与视频帧对应的视频相关子数据的属性信息,从视频相关数据队列的队首获取目标视频相关子数据,提高了切换速度,能够实现视频相关子数据的平滑切换,然后,将目标视频相关子数据发送到解码器进行解码,以实现与对应的视频帧同步播放,缩短了视频相关数据和视频同步时间,提高了用户体验。换句话说,采用本发明实施例的方案能够提高在视频播放过程中视频相关数据的切换速度,缩短了视频相关数据和视频同步时间,提高了用户体验。
图1-1为本发明实施例一中的数据切换方法的流程示意图;
图1-2为本发明实施例一中的视频相关数据队列的结构示意图;
图2为本发明实施例二中的数据切换方法的流程示意图;
图3为本发明实施例三中的数据切换方法的流程示意图;
图4为本发明实施例四中的数据切换方法的流程示意图;
图5为本发明实施例五中的数据切换装置的结构示意图;
图6为本发明实施例六中的终端的结构示意图。
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述。
实施例一:
本发明实施例提供一种数据切换方法,该数据切换方法的执行主体为数据切换装置,该数据切换装置可以内置或者外接于一终端,在实际应用中,上述终端可以为智能手机、电脑、机顶盒等具有媒体文件播放功能的终端,本发明实施例不做具体限定。
图1-1为本发明实施例一中的数据切换方法的流程示意图,参见图1-1所示,该方法包括:
S101:接收视频相关数据切换指令;
这里,视频相关切换指令用于将当前的视频相关数据切换为目标视频相关子数据,目标视频相关子数据为具有第一属性的视频相关子数据。
这里,视频相关数据包括音频数据和字幕数据。
在实际应用中,将预设的视频相关数据队列的视频相关子数据与预设的视频数据队列的视频帧同步出队并发送到各自的解码器进行解码播放的过程中,接收由用户触发或者系统预设(例如,设置第3秒为中文播放)的视频相关数据切换指令,本发明实施例不做具体限定。以切换音频数据为例进行具体说明:假设用户正在观看中文发音的影片时,如果用户想将该影片切换为英语发音并继续观看,则可以通过点击终端上用于切换音频属性的按钮或者选项进行视频相关数据的切换。
这里,属性用于表征视频相关数据的语言,例如,中文、英文等;或者,也可以是系统设置的。
S102:执行视频相关数据切换指令,从预设的视频相关数据队列的队首获取第i个视频相关子数据;
这里,i为大于或等于1的整数。这里,视频相关数据队列可以为按照视频帧的时间戳和预设次序,将具有不同属性的视频相关子数据依次排列
的队列。
在实际应用中,获取预设的视频相关数据队列中视频相关子数据也就是将视频相关子数据按照先入先出的次序出队,当执行视频相关数据切换指令,判断预设的视频相关数据队列是否非空,当预设的视频相关数据队列非空时,从预设的视频相关数据队列队首指针指向的地址获取用于出队的第i个视频相关子数据;当预设的视频相关数据队列为空时,等待与视频帧对应的视频相关子数据的入队。例如,假设预设的视频相关数据队列中存在视频相关子数据a,b,c,d,e。队首指针指向视频相关子数据a,队尾指针指向视频相关子数据e或者d,则执行视频相关数据切换指令,从预设的视频相关数据队列中获取队首指针指向的用于出队的视频相关子数据a,然后从预设的视频相关数据队列中删除a,并将队首指针加1;则当前预设的视频相关数据队列中存在视频相关子数据b,c,d,e。队首指针指向视频相关子数据b,队尾指针指向视频相关子数据e或者d。
S103:判断第i个视频相关子数据是否为具有第一属性的视频相关子数据,其中,如果第i个视频相关子数据不是具有第一属性的视频相关子数据,执行S102,其中,此时i=i+1,依次类推,直至获得具有第一属性的视频相关子数据,并将具有第一属性的视频相关子数据确定为目标视频相关子数据;如果第i个视频相关子数据为具有第一属性的视频相关子数据,则执行S104;
在实际应用中,获取第i个视频相关子数据的属性,判断第i个视频相关子数据的属性与第一属性是否一致;其中,如果第i个视频相关子数据的属性与第一属性一致,则将第i个视频相关子数据确定为目标视频相关子数据;如果第i个视频相关子数据的属性与第一属性不一致,则第i个视频相关子数据不是具有第一属性的视频相关子数据,则释放不是具有第一属性的视频相关子数据。例如,获取第i个视频相关子数据a的属性为中文,判断视频相关子数据a的属性是否与第一属性一致,当第一属性为英语时,则释放该视频相关子数据a;当第一属性为中文时,则将该视频相关子数据a确定为目标视频相关子数据。
S104:发送到解码器进行解码,以实现与对应的视频帧同步播放。
在实际应用中,播放器同时调用音频解码器对上述获取的目标音频子数据进行解码,调用字幕解码器对目标字幕子数据进行解码,并依据同样的时间戳将解码后音频子数据、字幕子数据和视频帧输出到播放窗口并使之保持同步。
在实际应用中,假设视频相关数据队列为如图1-2所示的队列,假设该视频相关队列的属性种类为两种,也就是说,视频相关数据队列中视频相关子数据a1和a2为与第二视频帧对应的不同属性的视频相关子数据,a3、a4为与第三视频帧对应的具有不同属性的视频相关子数据,a1、a3具有相同的属性。当播放第二视频帧后,接收到视频相关数据切换指令,则从视频相关数据队列的队首取与第三视频帧对应的视频相关子数据a3,判断a3的属性,如果a3的属性为第一属性,则将a3发送到解码器进行解码;如果a3的属性不是第一属性,则将队首指针加1,从视频相关数据队列中取视频相关子数据a4,如果视频相关子数据a4的属性为第一属性,则将视频相关子数据a4确定为目标视频先关子数据,将该目标视频相关子数据发送到解码器进行解码。由于该视频相关队列中视频相关数据的属性为两种,因此,从视频相关数据队列中判断与视频帧对应的视频相关子数据的次数有限,能够实现视频相关数据的平滑切换。
本实施例提供的数据切换方法,首先,通过接收视频相关数据切换指令,执行视频相关指令,从预设的视频相关数据队列的队首获取第i个视频相关子数据,如果第i个视频相关子数据不是具有第一属性的视频相关子数据,则从预设的视频相关数据队列中获取第i+1个视频相关子数据,依次类推,直至获得具有第一属性的视频相关子数据,并将具有第一属性的视频相关子数据确定为目标视频相关子数据。也就是说,视频相关子数据的属性信息为有限个,按照与视频帧对应的视频相关子数据的属性信息,从视频相关数据队列的队首获取目标视频相关子数据,提高了切换速度,能够实现视频相关子数据的平滑切换,然后,将目标视频相关子数据发送到解码器进行解码,以实现与对应的视频帧同步播放,缩短了视频相关数据和视频同步时间,提高了用户体验。
基于前述实施例,本实施例提供了一种数据切换方法,如图2所示,该方法包括:
S201:接收媒体文件播放请求;
这里,播放请求用于播放当前媒体文件。
在实际应用中,媒体文件为编码后的视频数据和编码后视频相关数据合成的文件。
S202:响应媒体文件播放请求,获取媒体文件;
S203:将媒体文件进行分离,获得视频数据和视频相关数据;
在实际应用中,可以采用多媒体视频处理工具,例如,快进动态图像专家组(FFMPEG,Fast Forward Moving Picture Experts Group)软件将媒体文件进行分离,当然,也可以为其它软件,本发明实施不做具体限定。
S204:对视频数据进行处理,获得至少一个视频帧;
S205:按照预设分割策略,将视频相关数据进行分割,获得与至少一个视频帧对应的视频相关子数据;
S206:按照至少一个视频帧的时间戳和预设的次序,将与视频帧对应的具有不同属性的视频相关子数据依次排列,获得视频相关数据队列。
这里,预设的次序为视频相关子数据的属性的排列次序,属性表示视频相关子数据的语言类型,例如:中文、英文等,本发明实施例不做具体限定。
在实际应用中,预先创建一个队列,按照至少一个视频帧的时间戳和预设的具有不同属性的视频相关子数据的排列次序,将视频相关子数据按照先入先出的次序存储在预设的队列中。例如,预先创建一个队列,假设预设的具有不同属性的视频相关子数据的排列次序为偶数位为中文,奇数位为英语,则将与第一视频帧对应的具有英语属性的视频相关子数据第一个入队,然后将与第一视频帧对应的具有中文属性的视频相关子数据第二个入队,依次类推,则获得视频相关数据队列。
在实际应用中,预先创建的队列可以为链式队列,也可以为循环队列,本发明实施例不做具体限定。该队列的队首指针和队尾指针可以自定义设
置,为了避免在判断获得的视频相关数据队列的队满和队空时出现误判,在设置队首指针和队尾指针的指向地址时,需要将其中之一指向空位,例如,队首指针可以指向实际队首,队尾指针指向队尾的下一个空位;也可以将队首指针指向队首前一个空位,队尾指针指向实际队尾。
实施例三:
基于前述实施例,本实施例提供了一种数据切换方法,如图3所示,该方法包括:
S301:接收媒体文件播放请求;
这里,播放请求用于播放当前媒体文件。
这里,媒体文件可以是视频媒体文件,也可以是音频媒体文件,本发明实施例不做具体限定。
S302:响应媒体文件播放请求,获取媒体文件;
S303:将媒体文件进行分离,获得视频数据和视频相关数据;
这里,分离可以为将包含音频、视频、字幕的媒体文件分成独立的音频数据、视频数据和字幕数据。
在实际应用中,可以采用媒体文件分离器将封装合成的媒体文件进行分离,得到独立的视频数据和视频相关数据。例如,播放器打开媒体文件,播放器调用分离器将媒体文件分离为单独的视频数据和视频相关数据。
S304:对视频数据进行处理,获得至少一个视频帧;
S305:按照预设分割策略,将视频相关数据进行分割,获得与至少一个视频帧对应的视频相关子数据;
S306:获取数据类型不能被读取的视频相关子数据;
S307:从视频相关子数据中释放数据类型不能被读取的视频相关子数据;
S308:按照至少一个视频帧的时间戳和预设的次序,将与视频帧对应的具有不同属性的视频相关子数据依次排列,获得视频相关数据队列。
实施例四:
基于前述实施例,本实施例提供了一种数据切换方法,如图4所示,该方法包括:
S401:接收媒体文件播放请求;
这里,播放请求用于播放当前媒体文件。
S402:响应媒体文件播放请求,获取媒体文件;
S403:判断视频相关数据队列是否队满;其中,如果视频相关数据队列队满,则执行S410;如果视频相关数据队列未满,则执行S404;
S404:将媒体文件进行分离,获得视频数据和视频相关数据;
S405:对视频数据进行处理,获得至少一个视频帧;
S406:按照预设分割策略,将视频相关数据进行分割,获得与至少一个视频帧对应的视频相关子数据;
S407:获取数据类型不能被读取的视频相关子数据;
这里,数据类型包括:视频、音频、字幕。
S408:从视频相关子数据中释放数据类型不能被读取的视频相关子数据;
S409:按照至少一个视频帧的时间戳和预设的次序,将与视频帧对应的具有不同属性的视频相关子数据依次排列,获得视频相关数据队列。
S410:如果视频相关数据队列队满,则停止将媒体文件进行分离。
本实施例提供的数据切换方法,通过在将媒体文件进行分离前,判断视频相关数据队列是否队满,如果视频相关数据队列队满,则停止将媒体文件进行分离,避免了视频相关数据队列队满时,后写入的视频相关子数据的覆盖先写入的视频相关子数据的风险,能够保证视频相关数据的完整性。
实施例五:
基于同一发明构思,本实施例提供一种数据切换装置,该数据切换装置可以应用于上述一个或者多个实施例中的终端。
图5为本发明实施例五中的数据切换装置的结构示意图,如图5所示,该数据切换装置50,包括:接收模块51,配置为接收视频相关数据切换指令,其中,视频相关切换指令用于将当前的视频相关数据切换为目标视频相关子数据,目标视频相关子数据为具有第一属性的视频相关子数据;获取模块52,配置为执行视频相关数据切换指令,从预设的视频相关数据队列的队首获取第i个视频相关子数据,其中,i为大于或等1的整数;确定模块53,配置为如果第i个视频相关子数据不是具有第一属性的视频相关子数据,则从预设的视频相关数据队列中获取第i+1个视频相关子数据,依次类推,直至获得具有第一属性的视频相关子数据,并将具有第一属性的视频相关子数据确定为目标视频相关子数据;发送模块54,配置为将目标视频相关子数据发送到解码器进行解码,以实现与对应的视频帧同步播放。
在本发明其它实施例中,装置还可以包括:存储模块,配置为接收媒体文件播放请求,其中,播放请求用于播放当前媒体文件;响应媒体文件播放请求,获取媒体文件;将媒体文件进行分离,获得视频数据和视频相关数据;对视频数据进行处理,获得至少一个视频帧;按照预设分割策略,将视频相关数据进行分割,获得与至少一个视频帧对应的视频相关子数据;按照至少一个视频帧的时间戳和预设的次序,将与视频帧对应的具有不同属性的视频相关子数据依次排列,获得视频相关数据队列。
在本发明其它实施例中,装置还可以包括:删除模块,配置为获取数据类型不能被读取的视频相关子数据;从视频相关子数据中释放数据类型不能被读取的视频相关子数据。
在本发明其它实施例中,装置还可以包括:判断模块,配置为判断视频相关数据队列是否队满;如果视频相关数据队列队满,则停止将媒体文件进行分离;如果视频相关数据队列未满,则将媒体文件进行分离。
这里需要指出的是:以上装置实施例项的描述,与上述方法描述是类似的,具有同方法实施例相同的有益效果,因此不做赘述。对于本发明装置实施例中未披露的技术细节,本领域的技术人员请参照本发明方法实施
例的描述而理解,为节约篇幅,这里不再赘述。
实施例六:
基于同一发明构思,本发明实施例提供一种终端,该终端与上述一个或者多个实施例中的终端一致。
参见图6所示,该终端60,包括:触摸屏61和处理器62,其中,触摸屏61,配置为接收视频相关数据切换指令,其中,视频相关切换指令用于将当前的视频相关数据切换为目标视频相关子数据,目标视频相关子数据为具有第一属性的视频相关子数据;处理器62,配置为执行视频相关数据切换指令,从预设的视频相关数据队列的队首获取第i个视频相关子数据,其中,i为大于或等1的整数;如果第i个视频相关子数据不是具有第一属性的视频相关子数据,则从预设的视频相关数据队列中获取第i+1个视频相关子数据,依次类推,直至获得具有第一属性的视频相关子数据,并将具有第一属性的视频相关子数据确定为目标视频相关子数据;将目标视频相关子数据发送到解码器进行解码,以实现与对应的视频帧同步播放。
在本发明其它实施例中,处理器62,配置为接收媒体文件播放请求,其中,播放请求用于播放当前媒体文件;响应媒体文件播放请求,获取媒体文件;将媒体文件进行分离,获得视频数据和视频相关数据;对视频数据进行处理,获得至少一个视频帧;按照预设分割策略,将视频相关数据进行分割,获得与至少一个视频帧对应的视频相关子数据;按照至少一个视频帧的时间戳和预设的次序,将与视频帧对应的具有不同属性的视频相关子数据依次排列,获得视频相关数据队列。
在本发明其它实施例中,处理器62,配置为获取数据类型不能被读取的视频相关子数据;从视频相关子数据中释放数据类型不能被读取的视频相关子数据。
在本发明其它实施例中,处理器62,配置为判断视频相关数据队列是否队满;如果视频相关数据队列队满,则停止将媒体文件进行分离;如果视频相关数据队列未满,则将媒体文件进行分离。
在实际应用中,上述处理器可以为特定用途集成电路(ASIC,Application Specific Integrated Circuit)、数字信号处理器(DSP,Digital Signal Processor)、数字信号处理装置(DSPD,Digital Signal Processing Device)、可编程逻辑装置(PLD,Programmable Logic Device)、现场可编程门阵列(FPGA,Field Programmable Gate Array)、中央处理器(CPU,Central Processing Unit)、控制器、微控制器、微处理器中的至少一种。可以理解地,对于不同的终端,配置为实现上述处理器功能的电子器件还可以为其它,本发明实施例不作具体限定。
这里需要指出的是:以上终端实施例的描述,与上述方法实施例的描述是类似的,具有同方法实施例相似的有益效果,因此不做赘述。对于本发明终端实施例中未披露的技术细节,请参照本发明方法实施例的描述而理解,为节约篇幅,因此不再赘述。
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
基于此,在示例性实施例中,本发明实施例还提供了一种计算机可读存储介质,上述计算机程序可由终端的处理器62执行,以完成前述方法所述步骤。计算机可读存储介质可以是磁性随机存取存储器(FRAM,ferromagnetic random access memory)、只读存储器(ROM,Read Only Memory)、可编程只读存储器(PROM,Programmable Read-Only Memory)、可擦除可编程只读存储器(EPROM,Erasable Programmable Read-Only Memory)、电可擦除可编程只读存储器(EEPROM,Electrically Erasable Programmable Read-Only Memory)、快闪存储器(Flash Memory)、磁表面存储器、光盘、或只读光盘(CD-ROM,Compact Disc Read-Only Memory)等存储器。
具体地,本发明实施例提供了一种一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器运行时,执行上述一个或或多个技术方案提供的方法。
以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。
本发明实施例提供的方案,通过接收视频相关数据切换指令,执行视频相关指令,从预设的视频相关数据队列的队首获取第i个视频相关子数据,如果第i个视频相关子数据不是具有第一属性的视频相关子数据,则从预设的视频相关数据队列中获取第i+1个视频相关子数据,依次类推,直至获得具有第一属性的视频相关子数据,并将具有第一属性的视频相关子数据确定为目标视频相关子数据,也就是说,视频相关子数据的属性信息为有限个,按照与视频帧对应的视频相关子数据的属性信息,从视频相关数
据队列的队首获取目标视频相关子数据,提高了切换速度,能够实现视频相关子数据的平滑切换;将目标视频相关子数据发送到解码器进行解码,以实现与对应的视频帧同步播放,缩短了视频相关数据和视频同步时间,提高了用户体验。
Claims (11)
- 一种数据切换方法,所述方法包括:接收视频相关数据切换指令,其中,所述视频相关切换指令用于将当前的视频相关数据切换为目标视频相关子数据,所述目标视频相关子数据为具有第一属性的视频相关子数据;执行所述视频相关数据切换指令,从预设的视频相关数据队列的队首获取第i个视频相关子数据,其中,i为大于或等于1的整数;如果所述第i个视频相关子数据不是具有第一属性的视频相关子数据,则从所述预设的视频相关数据队列中获取第i+1个视频相关子数据,依次类推,直至获得具有第一属性的视频相关子数据,并将所述具有第一属性的视频相关子数据确定为目标视频相关子数据;将所述目标视频相关子数据发送到解码器进行解码,以实现与对应的视频帧同步播放。
- 根据权利要求1所述的方法,其中,所述接收视频相关数据切换指令之前,所述方法还包括:接收媒体文件播放请求,其中,所述播放请求用于播放当前媒体文件;响应所述媒体文件播放请求,获取所述媒体文件;将所述媒体文件进行分离,获得视频数据和视频相关数据;对所述视频数据进行处理,获得至少一个视频帧;按照预设分割策略,将所述视频相关数据进行分割,获得与所述至少一个视频帧对应的视频相关子数据;按照所述至少一个视频帧的时间戳和预设的次序,将与所述视频帧对应的具有不同属性的视频相关子数据依次排列,获得视频相关数据队列。
- 根据权利要求2所述的方法,其中,所述按照所述至少一个视频帧的时间戳和预设的次序,将与所述视频帧对应的具有不同属性的视频相关子数据依次排列,获得视频相关数据队列之前,所述方法还包括:获取数据类型不能被读取的视频相关子数据;从所述视频相关子数据中释放所述数据类型不能被读取的视频相关子数据。
- 根据权利要求2所述的方法,其中,所述响应所述媒体文件播放请求,获取媒体文件之后,所述方法还包括:判断所述视频相关数据队列是否队满;如果所述视频相关数据队列队满,则停止将所述媒体文件进行分离;如果所述视频相关数据队列未满,则将所述媒体文件进行分离。
- 根据权利要求1所述的方法,其中,所述视频相关数据包括:字幕数据和音频数据。
- 一种数据切换装置,所述装置包括:接收模块,配置为接收视频相关数据切换指令,其中,所述视频相关切换指令用于将当前的视频相关数据切换为目标视频相关子数据,所述目标视频相关子数据为具有第一属性的视频相关子数据;获取模块,配置为执行所述视频相关数据切换指令,从预设的视频相关数据队列的队首获取第i个视频相关子数据,其中,所述i为大于或等1的整数;确定模块,配置为如果所述第i个视频相关子数据不是具有第一属性的视频相关子数据,则从所述预设的视频相关数据队列中获取第i+1个视频相关子数据,依次类推,直至获得具有第一属性的视频相关子数据,并将所述具有第一属性的视频相关子数据确定为目标视频相关子数据;发送模块,配置为将所述目标视频相关子数据发送到解码器进行解码,以实现与对应的视频帧同步播放。
- 根据权利要求6所述的装置,其中,所述装置还包括:存储模块,配置为接收媒体文件播放请求,其中,所述播放请求用于播放当前媒体文件;响应所述媒体文件播放请求,获取所述媒体文件;将所述媒体文件进行分离,获得视频数据和视频相关数据;对所述视频数据进行处理,获得至少一个视频帧;按照预设分割策略,将所述视频相关数据进行分割,获得与所述至少一个视频帧对应的视频相关子数据;按照所述至少一个视频 帧的时间戳和预设的次序,将与所述视频帧对应的具有不同属性的视频相关子数据依次排列,获得视频相关数据队列。
- 根据权利要求6所述的装置,其中,所述装置还包括:删除模块,配置为获取数据类型不能被读取的视频相关子数据;从所述视频相关子数据中释放所述数据类型不能被读取的视频相关子数据。
- 根据权利要求6所述的装置,其中,所述装置还包括:判断模块,配置为判断所述视频相关数据队列是否队满;如果所述视频相关数据队列队满,则停止将所述媒体文件进行分离;如果所述视频相关数据队列未满,则将所述媒体文件进行分离。
- 一种终端,所述终端包括:触摸屏和处理器,其中,所述触摸屏,配置为接收视频相关数据切换指令,其中,所述视频相关切换指令用于将当前的视频相关数据切换为目标视频相关子数据,所述目标视频相关子数据为具有第一属性的视频相关子数据;所述处理器,配置为执行所述视频相关数据切换指令,从预设的视频相关数据队列的队首获取第i个视频相关子数据,其中,所述i为大于或等1的整数;如果所述第i个视频相关子数据不是具有第一属性的视频相关子数据,则从所述预设的视频相关数据队列中获取第i+1个视频相关子数据,依次类推,直至获得具有第一属性的视频相关子数据,并将所述具有第一属性的视频相关子数据确定为目标视频相关子数据;将所述目标视频相关子数据发送到解码器进行解码,以实现与对应的视频帧同步播放。
- 一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1至5任一项所述方法的步骤。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610967202.2A CN108012176A (zh) | 2016-10-28 | 2016-10-28 | 一种数据切换方法、装置及终端 |
CN201610967202.2 | 2016-10-28 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2018076899A1 true WO2018076899A1 (zh) | 2018-05-03 |
Family
ID=62024319
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2017/097711 WO2018076899A1 (zh) | 2016-10-28 | 2017-08-16 | 一种数据切换方法、装置、终端及计算机可读存储介质 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN108012176A (zh) |
WO (1) | WO2018076899A1 (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111464829A (zh) * | 2020-05-14 | 2020-07-28 | 广州酷狗计算机科技有限公司 | 切换媒体数据的方法、装置、设备及存储介质 |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110943796B (zh) * | 2019-11-19 | 2022-06-17 | 深圳市道通智能航空技术股份有限公司 | 时间戳对齐方法、装置、存储介质及设备 |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2004320322A (ja) * | 2003-04-15 | 2004-11-11 | Funai Electric Co Ltd | 光ディスク再生装置 |
CN1914906A (zh) * | 2004-02-10 | 2007-02-14 | Lg电子株式会社 | 再现文本字幕的方法和文本字幕解码系统 |
CN105453581A (zh) * | 2013-04-30 | 2016-03-30 | 杜比实验室特许公司 | 从单个容器输出多种语言的音频和关联音频的系统和方法 |
US20160105707A1 (en) * | 2014-10-09 | 2016-04-14 | Disney Enterprises, Inc. | Systems and methods for delivering secondary content to viewers |
CN105744346A (zh) * | 2014-12-12 | 2016-07-06 | 深圳Tcl数字技术有限公司 | 字幕切换方法及装置 |
-
2016
- 2016-10-28 CN CN201610967202.2A patent/CN108012176A/zh not_active Withdrawn
-
2017
- 2017-08-16 WO PCT/CN2017/097711 patent/WO2018076899A1/zh active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2004320322A (ja) * | 2003-04-15 | 2004-11-11 | Funai Electric Co Ltd | 光ディスク再生装置 |
CN1914906A (zh) * | 2004-02-10 | 2007-02-14 | Lg电子株式会社 | 再现文本字幕的方法和文本字幕解码系统 |
CN105453581A (zh) * | 2013-04-30 | 2016-03-30 | 杜比实验室特许公司 | 从单个容器输出多种语言的音频和关联音频的系统和方法 |
US20160105707A1 (en) * | 2014-10-09 | 2016-04-14 | Disney Enterprises, Inc. | Systems and methods for delivering secondary content to viewers |
CN105744346A (zh) * | 2014-12-12 | 2016-07-06 | 深圳Tcl数字技术有限公司 | 字幕切换方法及装置 |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111464829A (zh) * | 2020-05-14 | 2020-07-28 | 广州酷狗计算机科技有限公司 | 切换媒体数据的方法、装置、设备及存储介质 |
CN111464829B (zh) * | 2020-05-14 | 2022-02-22 | 广州酷狗计算机科技有限公司 | 切换媒体数据的方法、装置、设备及存储介质 |
Also Published As
Publication number | Publication date |
---|---|
CN108012176A (zh) | 2018-05-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10129587B2 (en) | Fast switching of synchronized media using time-stamp management | |
CN110476431B (zh) | 低时延移动设备视听流传输 | |
CN109168078B (zh) | 一种视频清晰度切换方法及装置 | |
WO2018076982A2 (zh) | 一种音视频同步播放的方法及终端 | |
CN110418186B (zh) | 音视频播放方法、装置、计算机设备和存储介质 | |
US8670072B1 (en) | Method and apparatus for streaming media data processing, and streaming media playback equipment | |
US7139470B2 (en) | Navigation for MPEG streams | |
WO2017092344A1 (zh) | 一种视频的播放方法和装置 | |
WO2017092340A1 (zh) | 一种视频压缩、播放方法以及装置 | |
CN108174280B (zh) | 一种音视频在线播放方法及系统 | |
WO2018133797A1 (zh) | 一种视频合成方法及终端 | |
WO2019109678A1 (zh) | 字幕切换方法及显示设备 | |
CN102215429A (zh) | 一种用于移动电视的录制方法 | |
US9905268B2 (en) | Drawing processing device and method | |
CN110519627B (zh) | 一种音频数据的同步方法和装置 | |
CN113596545A (zh) | 音轨切换方法、装置、媒体播放设备和计算机存储介质 | |
CN114697712B (zh) | 一种媒体流的下载方法、装置、设备及存储介质 | |
WO2018076899A1 (zh) | 一种数据切换方法、装置、终端及计算机可读存储介质 | |
TWI345174B (en) | Method and apparatus for storage or relocation of defined positions in a data stream | |
US9729919B2 (en) | Remultiplexing bitstreams of encoded video for video playback | |
TW201205314A (en) | Method for seeking a document position and a corresponding electronic device | |
EP1871108B1 (en) | Recording device, reproducing device, recording medium, recording method, and lsi | |
CN115086708B (zh) | 一种视频播放方法、装置、电子设备及存储介质 | |
CN113873275B (zh) | 一种视频媒体数据的传输方法及装置 | |
US9542922B2 (en) | Method for inserting watermark to image and electronic device thereof |
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: 17864150 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: 17864150 Country of ref document: EP Kind code of ref document: A1 |