Method, apparatus, storage medium and electronic device for playing media data

By switching to real-time media data after playing historical media data, the problem of low efficiency in switching playback media data in the prior art is solved, seamless switching and efficient playback are achieved, and user experience is improved.

CN116017076BActive Publication Date: 2025-08-01HANGZHOU HUACHENG SOFTWARE TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211608328.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-14
Publication Date
2025-08-01
Estimated Expiration
2042-12-14

AI Technical Summary

Technical Problem

In the prior art, the solution of querying and switching to play the latest media data is relatively complex, resulting in low efficiency of switching to play the media data and poor user experience.

Method used

In response to the target playback operation, the target historical media data is played at a preset speed, and after the target historical media data is played, the first historical media data is played at N times speed, and then when the time difference between the first ending moment and the current moment is less than or equal to the first preset threshold, the target real-time media data is played at a preset speed, so as to achieve seamless switching from historical media data to real-time media data.

Benefits of technology

The operation process of querying the latest media data is simplified, the playback efficiency and user experience of media data are improved, and the seamless switching from historical media data to real-time media data is realized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116017076B_ABST
    Figure CN116017076B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention provides a method, apparatus, storage medium, and electronic device for playing media data. The method includes: in response to a target play operation, playing target historical media data at a preset speed; after the target historical media data finishes playing, playing first historical media data at N times the speed; and then, when a first time difference between a first end moment and a first current moment is less than or equal to a first preset threshold, playing target real-time media data at the preset speed, where the target real-time media data is media data collected by a real-time image acquisition device at the first current moment, and the first current moment represents the current system moment when the first historical media data finishes playing. Through the present invention, it is possible to solve the problem in the related art that the solution for querying and switching to play the latest media data is relatively complex, resulting in low efficiency in switching to play media data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of computers, and in particular, to a method, device, storage medium, and electronic device for playing media data. Background Art

[0002] Currently, in the related art, when a user plays a media data file, only the saved media data can be queried, and the user can only play the saved media data. When the saved media data is played out, media data has actually been saved for a period of time. At this time, if the user wants to play the media data saved during this period, the user needs to exit the play page again to find its corresponding index information, and then can play the most recently saved media data. This makes the operations of the user to query the latest media data and switch to play the latest media data relatively complex, and the user experience is poor.

[0003] In view of the problem that the solution for querying and switching to play the latest media data in the related art is relatively complex, resulting in low efficiency of switching to play media data, no effective solution has been proposed yet. Summary of the Invention

[0004] The embodiments of the present invention provide a method, device, storage medium, and electronic device for playing media data, so as to at least solve the problem that the solution for querying and switching to play the latest media data in the related art is relatively complex, resulting in low efficiency of switching to play media data.

[0005] According to an embodiment of the present invention, a method for playing media data is provided, including: in response to a target play operation, playing target historical media data at a preset speed, where the target historical media data is the media data that needs to be played selected by the target play operation; after the target historical media data is played out, playing first historical media data at N times the speed, where the playing duration of the target historical media data is a target playing duration, the first historical media data is the media data saved after being recorded for the target playing duration during the process of playing the target historical media data, the system time when the first historical media data starts to play is a first start time, the system time when the first historical media data ends playing is a first end time, the duration between the first start time and the first end time is determined by the target playing duration and the N times the speed, the N times the speed represents N times the preset speed, and N is greater than 1; in the case that a first time difference between the first end time and the current system time is less than or equal to a first preset threshold, after the first historical media data is played out, playing target real-time media data at the preset speed, where the target real-time media data is the media data collected by a real-time image acquisition device at the current system time.

[0006] According to another embodiment of the present invention, a playback device for media data is provided, including:

[0007] A first playback module for playing target historical media data at a preset speed in response to a target playback operation, where the target historical media data is the media data to be played selected by the target playback operation;

[0008] A second playback module for playing first historical media data at N times the speed after the target historical media data is played, where the playback duration of the target historical media data is the target playback duration, and the first historical media data is the media data saved after being recorded for the target playback duration during the playback of the target historical media data. The system time when the first historical media data starts recording is the first start time, and the system time when the first historical media data ends recording is the first end time. The N times the speed represents N times the preset speed, and N is greater than 1;

[0009] A third playback module for playing target real-time media data at the preset speed when a first time difference between the first end time and a first current time is less than or equal to a first preset threshold, where the target real-time media data is the media data collected by a real-time image acquisition device at the first current time, and the first current time represents the current system time when the first historical media data is played to the end.

[0010] Optionally, the device is further configured to: when the first time difference is greater than the first preset threshold, after the first historical media data is played, play second historical media data at N times the speed, where the second historical media data is the media data saved after being recorded for a first playback duration during the playback of the first historical media data. The first playback duration is the ratio of the target playback duration to N. The system time when the second historical media data starts recording is the second start time, and the system time when the second historical media data ends recording is the second end time; when a second time difference between the second end time and a second current time is less than or equal to the first preset threshold, play the target real-time media data at the preset speed, where the second current time represents the current system time when the second historical media data is played to the end.

[0011] Optionally, the device is further configured to: when the first time difference is greater than the first preset threshold, determine the second start time according to the first end time, where the system time indicated by the first end time is the same as that indicated by the second start time; search for the second historical media data according to the second start time, and play the second historical media data at N times the speed.

[0012] Optionally, the device is further configured to: obtain target index information, where the target index information records the second start time and the second end time. When the second historical media data has not been recorded yet, the second end time is the system time when the first historical media data is played; when the second historical media data has been recorded, the second end time is the system time when the second historical media data is recorded; search for the second historical media data according to the second start time and the second end time, and play the second historical media data at N times the speed.

[0013] Optionally, the device is further configured to: when the first time difference is greater than the first preset threshold and less than or equal to the second preset threshold, establish a transmission channel for real-time media data before playing the first historical media data, and cache the first real-time media data during the playback of the first historical media data, where the second preset threshold is greater than the first preset threshold, and the first real-time media data is media data collected by a real-time image acquisition device between the first start time and the first end time; after the first historical media data is played, play the first real-time media data at M times the speed, where the system time when the first real-time media data starts to be cached is the third start time, the system time when the first real-time media data ends to be cached is the third end time, M times the speed represents M times the preset speed, and M is greater than 1; when the third time difference between the third end time and the third current time is less than or equal to the first preset threshold, play the target real-time media data at the preset speed, where the third current time represents the current system time when the first real-time media data is played.

[0014] Optionally, the device is further configured to: when the first time difference is greater than the second preset threshold, after the playback of the first historical media data ends, play the third historical media data at the N-fold speed, where the third historical media data is the historical media data saved after being recorded for a first playback duration during the playback of the first historical media data, the first playback duration is the ratio of the target playback duration to N, the system time when the recording of the third historical media data starts is the fourth start time, and the system time when the recording of the third historical media data ends is the fourth end time; when the fourth time difference between the fourth end time and the fourth current time is greater than the first preset threshold and less than or equal to the second preset threshold, before the playback of the third historical media data, establish a transmission channel for the real-time media data, and during the playback of the third historical media data, cache the second real-time media data, where the second real-time media data is the media data collected by a real-time image acquisition device between the fourth start time and the fourth end time; after the playback of the third historical media data ends, play the second real-time media data at the M-fold speed, where the system time when the caching of the second real-time media data ends is the fifth end time; when the fifth time difference between the fifth end time and the fifth current time is less than or equal to the first preset threshold, play the target real-time media data at the preset speed, where the fifth current time represents the current system time when the playback of the second real-time media data ends.

[0015] Optionally, the device is further configured to: after the playback of the target historical media data ends, update the page playback progress bar, where the end time before the update of the page playback progress bar is the system time when the recording of the target historical media data ends, and the end time after the update of the page playback progress bar is the first end time; when starting to play the target real-time media data at the preset speed, cancel the display of the page playback progress bar and display a target prompt message, where the target prompt message indicates that the real-time media data is currently being played.

[0016] According to another embodiment of the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, and the computer program is configured to execute the steps in any one of the above method embodiments when running.

[0017] According to another embodiment of the present invention, there is also provided an electronic device, including a memory and a processor, where a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0018] According to the present invention, in response to a target playback operation, the target historical media data is played at a preset speed. After the playback of the target historical media data ends, the first historical media data is played at N times the speed. Then, when the first time difference between the first end moment and the first current moment is less than or equal to the first preset threshold, the target real-time media data is played at the preset speed. In this way, when switching from playing the target historical media data to playing the target real-time media data, the problem in the related art that the solution for querying and switching to play the latest media data is relatively complex, resulting in low efficiency of switching to play media data, is solved. The technical effects of simplifying the solution for querying the latest video data, improving the efficiency of resuming playback of the latest video, and enhancing the user experience are achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 is a hardware structure block diagram of a mobile terminal for a method of playing media data according to an embodiment of the present invention;

[0020] Figure 2 is a flowchart of a method of playing media data according to an embodiment of the present invention;

[0021] Figure 3 is a schematic diagram of a specific example of a method of playing media data according to an embodiment of the present invention;

[0022] Figure 4 is a schematic diagram of a specific example of another method of playing media data according to an embodiment of the present invention;

[0023] Figure 5 is a schematic diagram of a specific example of yet another method of playing media data according to an embodiment of the present invention;

[0024] Figure 6 is a schematic diagram of a specific example of yet another method of playing media data according to an embodiment of the present invention;

[0025] Figure 7 is a schematic diagram of a specific example of yet another method of playing media data according to an embodiment of the present invention;

[0026] Figure 8 is a schematic diagram of a specific example of yet another method of playing media data according to an embodiment of the present invention;

[0027] Figure 9 is a structure block diagram of a device for playing media data according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0028] In the following, embodiments of the present invention will be described in detail with reference to the drawings and in conjunction with the embodiments.

[0029] It should be noted that the terms "first", "second", etc. in the description, claims and the above-mentioned drawings of the present invention are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence.

[0030] The method embodiments provided in the embodiments of the present application can be executed on a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 is a hardware structure block diagram of a mobile terminal for a method of playing media data according to an embodiment of the present invention. As Figure 1 shown, the mobile terminal may include one or more ( Figure 1 only one is shown in Figure 1 figures) processors 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Among them, the above-mentioned mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those of ordinary skill in the art can understand that Figure 1 the structure shown is only schematic and does not limit the structure of the above-mentioned mobile terminal. For example, the mobile terminal may further include more or fewer components than Figure 1 shown in

[0031] The memory 104 can be used to store computer programs. For example, software programs and modules of application software, such as the computer program corresponding to the method of playing media data in the embodiments of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implements the above-mentioned method. The memory 104 may include a high-speed random access memory, and may further include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely disposed relative to the processor 102, and these remote memories may be connected to the mobile terminal through a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.

[0032] The transmission device 106 is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wireless network provided by a communication provider of the mobile terminal. In one instance, the transmission device 106 includes a network adapter (abbreviated as NIC), which can be connected to other network devices through a base station and thus communicate with the Internet. In one instance, the transmission device 106 may be a radio frequency (abbreviated as RF) module, which is used to communicate with the Internet wirelessly.

[0033] In this embodiment, a method for playing media data is provided. Figure 2 It is a flowchart of the method for playing media data according to an embodiment of the present invention, as Figure 2 shown, and the process includes the following steps:

[0034] S202, in response to a target play operation, play the target historical media data at a preset speed, where the target historical media data is the media data that needs to be played selected by the target play operation;

[0035] Optionally, in this embodiment, the above-mentioned media data may be images that can be played by a user collected by video capture devices such as cameras, cameras, and webcams. Among them, the steps of collecting and saving video data may include, but are not limited to, being synchronized. The above-mentioned media data may also include, but is not limited to, data in formats such as video, audio, animation, and text.

[0036] Optionally, in this embodiment, the above-mentioned target play operation may include, but is not limited to, operations such as clicking, dragging, double-clicking, and inputting voice commands that can be used to indicate playing media data.

[0037] For example, Figure 3 is a schematic diagram of a specific example of a method for playing media data according to an embodiment of the present invention. As Figure 3 shown, the user performs a target play operation 302 on the client interface 301 to select the target historical media data 304 in the media data list 303.

[0038] The above is only an example, and the present application does not make any specific limitations.

[0039] Optionally, in this embodiment, the above-mentioned preset speed may include, but is not limited to, a speed set in advance according to requirements. The preset speed may be 1x speed, or may also be 0.75x speed, 1.75x speed, etc. No specific limitation is made on what the preset speed is set to.

[0040] Optionally, in this embodiment, the above-mentioned target historical media data may include, but is not limited to, the media data that has been saved after the user's retrieval. Among them, the target historical media data is the media data that needs to be played selected by the target play operation.

[0041] S204. After the playback of the target historical media data ends, play the first historical media data at N times the speed, where the playback duration of the target historical media data is the target playback duration. The first historical media data is the media data saved after being recorded for the target playback duration during the playback of the target historical media data. The system time when the recording of the first historical media data starts is the first start time, and the system time when the recording of the first historical media data ends is the first end time. N times the speed represents N times the preset speed, and N is greater than 1.

[0042] Optionally, in this embodiment, the above-mentioned first historical media data may include, but is not limited to, images that can be played by users collected by video recording devices such as cameras, cameras, and webcams. The first historical media data may also include, but is not limited to, data in formats such as videos, audios, animations, and texts. The first historical media data may be the media data saved after being recorded for the target playback duration during the playback of the target historical media data.

[0043] Optionally, in this embodiment, the above-mentioned first start time may include, but is not limited to, the system time when the recording of the first historical media data starts; the above-mentioned first end time may include, but is not limited to, the system time when the recording of the first historical media data ends. The duration between the first start time and the first end time is determined by the target playback duration and N times the speed, and N times the speed represents N times the preset speed.

[0044] Optionally, in this embodiment, the above-mentioned target playback duration may include, but is not limited to, 1 second, 8 seconds, 1 minute, 1 hour, etc. The target playback duration is the total time used for the target historical media data from the start of playback to the end of playback. The specific size of the target playback duration is determined by the total duration of the target historical media data and the preset playback speed.

[0045] For example, when the preset speed is 1 and N is 2, N times the speed is 2 times the speed. When the duration of the target historical media data is 8 seconds and the 2 - times - speed target historical media data is played starting from 1:00 am, the target historical media data can be played in 4 seconds. At this time, the target playback duration is 4 seconds. Then the start time of recording the first historical media data is 1:00 am, and the end time of recording is 1:04 am.

[0046] Optionally, in this embodiment, the above-mentioned event video data may include, but is not limited to, video data that has been collected and saved by video recording devices such as cameras, cameras, and webcams. When the user plays the video data, they can choose to play it at normal speed or at multiple speeds according to their personal needs.

[0047] S206, when the first time difference between the first end moment and the first current moment is less than or equal to the first preset threshold, play the target real-time media data at a preset speed, where the target real-time media data is the media data collected by the real-time image acquisition device at the first current moment, and the first current moment represents the current system moment when the playback of the first historical media data ends.

[0048] Optionally, in this embodiment, the above-mentioned first current moment is used to represent the specific time corresponding to the end of the playback of the first historical media data. The specific time may include, but is not limited to, any specific time point from 0:00 to 24:00. It may be determined by the time where the user is located, or may be determined by taking the start recording time as 0:00 and incrementing the recording time from 0:00 to the time when the playback of the first historical media data ends. The above-mentioned first current moment represents the current system moment when the playback of the first historical media data ends. Among them, the above-mentioned first time difference may include, but is not limited to, the difference between the first end moment and the first current moment.

[0049] Optionally, in this embodiment, the above-mentioned target real-time media data may include, but is not limited to, the media data collected by the real-time image acquisition device at the first current moment. The media data may include, but is not limited to, data in formats such as video, audio, animated text, etc. For example, the target real-time media data may be the news broadcast picture at 7 pm every night, the latest live game picture, real-time voice call data, real-time video data, and other media data.

[0050] Optionally, in this embodiment, the above-mentioned first preset threshold may include, but is not limited to, being pre-set by relevant technical personnel according to prior data. The first preset threshold may be set to 1 minute, or may also be set to 3 seconds. The specific setting time is determined according to actual needs. When the above-mentioned first time difference is less than or equal to the first preset threshold, after playing the first historical media data, the target real-time data may be played at a preset speed.

[0051] Through the embodiments of the present application, in response to a target playback operation, play the target historical media data at a preset speed. After the playback of the target historical media data ends, play the first historical media data at N times the speed. When the first time difference between the first end moment and the current system moment is less than or equal to the first preset threshold, after the playback of the first historical media data ends, play the target real-time media data at a preset speed, enabling the user to seamlessly switch from historical media data to target real-time media data naturally. It solves the problem in the related art that the playback scheme of media data is relatively complex, resulting in low display efficiency, and achieves the technical effects of improving the playback efficiency of media data and simplifying the playback method of media data.

[0052] As an alternative embodiment, after the playback of the target historical media data ends and the first historical media data is played back at N times the speed, the method further includes: when the first time difference is greater than the first preset threshold, after the playback of the first historical media data ends, the second historical media data is played back at N times the speed, where the second historical media data is the media data saved after being recorded for the first playback duration during the playback of the first historical media data, the first playback duration is the ratio of the target playback duration to N, the system time when the recording of the second historical media data starts is the second start time, and the system time when the recording of the second historical media data ends is the second end time; when the second time difference between the second end time and the second current time is less than or equal to the first preset threshold, the target real-time media data is played back at a preset speed, where the second current time represents the current system time when the playback of the second historical media data ends.

[0053] Optionally, in this embodiment, the above-mentioned second historical media data may include, but is not limited to, data in formats such as video, audio, animated text, etc. The second historical media data is the media data saved after being recorded for the first playback duration during the playback of the first historical media data, that is, the second historical media data is recorded for as long as the first historical media data is played. The second historical media data is the media data recorded after the first historical media data.

[0054] It should be noted that the above-mentioned first playback duration being the ratio of the target playback duration to N can be understood as, for example, if the target playback duration is 8 seconds and the playback speed is 2 times, the first playback duration is 4 seconds.

[0055] Optionally, in this embodiment, the above-mentioned first playback duration represents the duration between the first start time and the first end time, and the second media data will be continuously recorded within this duration. The above-mentioned second start time may include, but is not limited to, the system time when the recording of the second historical media data starts, and the second end time may include, but is not limited to, the system time when the recording of the second historical media data ends.

[0056] Optionally, in this embodiment, the above-mentioned second current time may include, but is not limited to, any time between 0:00 and 24:00 in a day. This time represents the current system time corresponding to when the playback of the second historical media data ends. For example, if the time when the playback of the second historical media data ends is 6:00, then the second current time is 6:00.

[0057] Optionally, in this embodiment, the second time difference may include, but is not limited to, the difference between the second end time and the second current time. When the second time difference is less than or equal to the first preset threshold and the playback of the second historical media data ends, the target real-time media data is played at a preset speed.

[0058] Through the embodiments of the present application, when the first time difference is greater than the first preset threshold, the second historical media data is played at N times the speed. When the second time difference between the second end time and the second current time is less than or equal to the first preset threshold and the playback of the second historical media data ends, the target real-time media data is played at a preset speed. In this way, the playback is switched from the second historical real-time media data to the target real-time media data. By storing the second historical media data, playing it at a preset multiple speed and catching up with the target real-time data, and then seamlessly switching to play the target real-time media data, the problems in the related art that the playback scheme of media data is relatively complex are solved, and the efficiency of switching from playing historical media data to playing target real-time media data is improved, and the technical effect of simplifying the media data switching playback method is achieved.

[0059] As an optional embodiment, the method further includes: when the first time difference is greater than the first preset threshold, after the playback of the first historical media data ends, playing the second historical media data at N times the speed, including: when the first time difference is greater than the first preset threshold, determining the second start time according to the first end time, where the system times indicated by the first end time and the second start time are the same; searching for the second historical media data according to the second start time and playing the second historical media data at N times the speed.

[0060] Optionally, in this embodiment, the first end time may include, but is not limited to, the system time when the recording of the first historical media data ends. Whenever the recording of the first historical media data ends, the first end time is the time when the recording ends. At the same time when the recording of the first historical media ends, the recording of the second historical media data starts, that is, the system times indicated by the first end time and the second start time are the same.

[0061] For example, when the first preset threshold is 3 seconds and the first time difference is 5 seconds, the recording of the second media data continues. If the first time difference is 3 seconds or less than 3 seconds, the recording of the second historical media data will not be performed.

[0062] Through the embodiments of the present application, when the first time difference is greater than the first preset threshold, the second start time is determined according to the first end time, the second historical media data is searched according to the second start time, and the second historical media data is played at N times the speed, achieving the effect of playing while storing, effectively avoiding the problem that after the latest queried video is played, it is necessary to query and update the file again.

[0063] As an alternative embodiment, the above method further includes: searching for the second historical media data according to the second start time and playing the second historical media data at N times the speed, including: obtaining target index information, where the target index information records the second start time, the second end time, and when the second historical media data has not been recorded yet, the second end time is the system time when the first historical media data is played, and when the second historical media data has been recorded, the second end time is the system time when the second historical media data is recorded; searching for the second historical media data according to the second start time and the second end time, and playing the second historical media data at N times the speed.

[0064] Optionally, in this embodiment, the above target index information may include, but is not limited to, relevant information such as the start recording time, end recording time, and estimated time to end recording of the media data. Among them, the above target index information may be index information recording the second start time and the second end time.

[0065] Optionally, in this embodiment, the above target index information may include, but is not limited to, the media data file corresponding to the recorded end, the media data file that is being recorded and has not been recorded yet. When the media data corresponding to the target index information has ended recording, the target index information may include, but is not limited to, the start recording time and the end recording time; when the media data corresponding to the target index information is being recorded and has not been recorded yet, the target index information may include, but is not limited to, the start recording time of the media data, the estimated end recording time, the estimated remaining recording time, the estimated size of the remaining recorded media data, etc. At this time, the media data that is being recorded and has not been recorded yet can be played through this target index information, and the target index information is continuously updated as the media data is recorded.

[0066] It should be noted that when the second historical media data has not been recorded yet, the second end time is the system time when the first historical media data is played, and when the second historical media data has been recorded, the second end time is the system time when the second historical media data is recorded.

[0067] Through the embodiments of the present application, by obtaining target index information, when the second historical media data has not been recorded yet, the second end time is the system time when the first historical media data is played to completion; when the second historical media data has been recorded, the second end time is the system time when the second historical media data is recorded to completion. By searching for the second historical media data according to the second start time and the second end time, and playing the second historical media data at N times the speed, the problem that after the latest retrieved video is played, there will be an updated file that needs to be queried again can be effectively avoided.

[0068] As an optional embodiment, the above method further includes: when the first time difference is greater than the first preset threshold and less than or equal to the second preset threshold, before playing the first historical media data, establishing a transmission channel for real-time media data, and during the playing of the first historical media data, caching the first real-time media data, where the second preset threshold is greater than the first preset threshold, and the first real-time media data is media data collected by a real-time image acquisition device between the first start time and the first end time; after the first historical media data is played, playing the first real-time media data at M times the speed, where the system time when the first real-time media data starts to be cached is the third start time, the system time when the first real-time media data ends caching is the third end time, and M times the speed represents M times the preset speed, and M is greater than 1; when the third time difference between the third end time and the third current time is less than or equal to the first preset threshold, playing the target real-time media data at the preset speed, where the third current time represents the current system time when the first real-time media data is played to completion.

[0069] Optionally, in this embodiment, the above second preset threshold may include but is not limited to being set by relevant technical personnel according to historical data or prior experience.

[0070] For example, if the first time difference is 5 seconds, the first preset threshold is 3 seconds, and the second preset threshold is 5 seconds, at this time 3 seconds < 5 seconds = 5 seconds, that is, the first preset threshold < the first time difference = the second preset threshold, meeting the above conditions, and at this time, a transmission channel for real-time media data is established before playing the first historical media data. When the first time difference is within the second threshold, preparations are made to switch from historical media data to real-time media data.

[0071] Optionally, in this embodiment, the above transmission channel for real-time media data may include but is not limited to a channel that can transmit and cache real-time media data for a certain period of time. The establishment of this channel is to smoothly switch the played historical media data to real-time media data.

[0072] It should be noted that the transmission channel for real-time media data is established before the playback of the first historical media data when the first time difference is greater than the first preset threshold and less than or equal to the second preset threshold.

[0073] Optionally, in this embodiment, the above-mentioned first real-time media data may include, but is not limited to, data in formats such as animation, video, pictures, sound, etc. The first real-time media data is cached during the playback of the first historical media data, that is, the media data collected by the real-time image acquisition device between the first start time and the first end time.

[0074] Optionally, in this embodiment, the above-mentioned third start time may include, but is not limited to, the system time when the first real-time media data starts to be cached, and the above-mentioned third end time may include, but is not limited to, the system time when the first real-time media data ends being cached.

[0075] Optionally, in this embodiment, the above-mentioned M times speed may include, but is not limited to, 1.25 times speed, 1.75 times speed, 2 times speed, which means 1.25 times, 1.75 times, 2 times, etc. of the preset speed, and is a multiple speed greater than 1.

[0076] Optionally, in this embodiment, the above-mentioned third current time may include, but is not limited to, the current system time when the playback of the first real-time media data ends.

[0077] Optionally, in this embodiment, the above-mentioned third time difference may include, but is not limited to, the difference between two times, which can be in units of seconds, minutes, or hours, and can be the difference between the third end time and the third current time. When this difference is less than or equal to the first preset threshold, the target real-time media data is played at the preset speed.

[0078] Optionally, in this embodiment, the above-mentioned third historical media data may include, but is not limited to, media data in formats such as video, audio, animation, text, etc. The above-mentioned third historical media data is cached after the first historical media data is cached and is played after the playback of the first historical media data. When the first time difference is greater than the second preset threshold, after the playback of the first historical media data ends, the third historical media data is played at N times speed, and the above-mentioned first playback duration represents the duration between the first start time and the first end time.

[0079] Through the embodiments of the present application, when the first time difference is greater than the first preset threshold and less than or equal to the second preset threshold, before playing the first historical media data, a transmission channel for real-time media data is established, and during the playing of the first historical media data, the first real-time media data is cached. After the playing of the first historical media data ends, the first real-time media data is played at M times the speed. When the third time difference between the third end moment and the third current moment is less than or equal to the first preset threshold, the target real-time media data is played at a preset speed. In this way, the problem that the switching playback scheme of media data in the related art is relatively complex, resulting in low efficiency of switching playback of media data, is solved, and the technical effects of improving the efficiency of switching playback of media data and simplifying the switching playback method of media data are achieved.

[0080] As an alternative embodiment, when the first time difference is greater than the second preset threshold, after the playing of the first historical media data ends, the third historical media data is played at N times the speed, where the third historical media data is the historical media data saved after being recorded for the first playing duration during the playing of the first historical media data, the first playing duration is the ratio of the target playing duration to N, the system moment when the recording of the third historical media data starts is the fourth start moment, and the system moment when the recording of the third historical media data ends is the fourth end moment; when the fourth time difference between the fourth end moment and the fourth current moment is greater than the first preset threshold and less than or equal to the second preset threshold, before playing the third historical media data, a transmission channel for real-time media data is established, and during the playing of the third historical media data, the second real-time media data is cached, where the second real-time media data is the media data collected by a real-time image acquisition device between the fourth start moment and the fourth end moment; after the playing of the third historical media data ends, the second real-time media data is played at M times the speed, where the system moment when the caching of the second real-time media data ends is the fifth end moment; when the fifth time difference between the fifth end moment and the fifth current moment is less than or equal to the first preset threshold, the target real-time media data is played at a preset speed, where the fifth current moment represents the current system moment when the playing of the second real-time media data ends.

[0081] Optionally, in this embodiment, the above fourth start moment may include but is not limited to the system moment when the recording of the third historical media data starts, and the above fourth end moment may include but is not limited to the system moment when the recording of the third historical media data ends.

[0082] Optionally, in this embodiment, the above-mentioned second real-time media data may include, but is not limited to, media data in formats such as video, audio, animated text, etc. The second real-time media data is media data collected by a real-time image acquisition device during the playback of the third historical media data, that is, between the fourth start time and the fourth end time.

[0083] Optionally, in this embodiment, the above-mentioned fourth time difference may include, but is not limited to, the difference between two moments, which may be the difference between the fourth end time and the current system time. This difference may be expressed as 1 second, 3 seconds, or may also be expressed as 1 minute, 3 minutes, etc. No specific limitation is imposed on the manifestation form of the difference here.

[0084] Optionally, in this embodiment, the above-mentioned fifth end time may include, but is not limited to, the system time when the caching of the second real-time media data ends. The above-mentioned fifth current time may include, but is not limited to, the current system time when the fifth current time represents the end of the playback of the second real-time media data. The above-mentioned fifth time difference may include, but is not limited to, the difference between two system times, which may be the difference between the fifth end time and the fifth current time. This difference may be expressed as 1 second, 3 seconds, or may also be expressed as 1 minute, 3 minutes, etc. No specific limitation is imposed on the manifestation form of the difference here.

[0085] It should be noted that the second real-time media data is cached during the playback of the third historical media data and is played at M times the speed after the playback of the third historical media data ends.

[0086] Through the embodiments of the present application, when the first time difference is greater than the second preset threshold, after the playback of the first historical media data ends, the third historical media data is played at N times the speed. Then, when the fourth time difference between the fourth end time and the fourth current time is greater than the first preset threshold and less than or equal to the second preset threshold, a transmission channel for real-time media data is established before the playback of the third historical media data, and during the playback of the third historical media data, the second real-time media data is cached. After the playback of the third historical media data ends, the second real-time media data is played at M times the speed. When the fifth time difference between the fifth end time and the fifth current time is less than or equal to the first preset threshold, the target real-time media data is played at a preset speed. In this way, the problem in the related art that the switching playback scheme of media data is relatively complex, resulting in low efficiency of switching playback of media data, is solved, and the technical effect of improving the efficiency of switching playback of media data and simplifying the switching playback method of media data is achieved.

[0087] As an alternative embodiment, after the playback of the target historical media data ends, update the page playback progress bar. Wherein, the end moment before the update of the page playback progress bar is the system moment when the target historical media data ends recording, and the end moment after the update of the page playback progress bar is the first end moment; when starting to play the target real-time media data at a preset speed, cancel the display of the page playback progress bar and display a target prompt message, where the target prompt message indicates that the currently playing media data is real-time media data.

[0088] Optionally, in this embodiment, the above-mentioned page playback progress bar may include, but is not limited to, a graph represented by a timeline to represent the playback progress of the media data. The screen can be switched by clicking on the progress bar, and when the operation pointer is placed at a specific position on the progress bar, the screen corresponding to that specific time position can be displayed.

[0089] Optionally, in this embodiment, the above-mentioned target prompt message may include, but is not limited to, information such as graphics, animations, texts, data, sounds, etc. that can be used to remind the user. The above-mentioned target prompt message can be to remind the user that the currently played data is real-time media data.

[0090] For example, the user receives a message: "The historical media data has been played, and now the real-time media data is being played." At this time, the played data will be the latest real-time media data, and the double-speed playback will no longer be available. At this time, the latest media data cannot be obtained by adjusting the position of the progress bar either. One can only wait for the update. The user can only play along with the latest real-time media data or adjust the progress bar back to the position of the previous historical media data for playback.

[0091] It should be noted that after the end of the playback process of the target historical media data, since the real-time media data is continuously updated during the playback process of the target historical media data, the page progress bar will also be updated accordingly. And the end moment before the update of the page playback progress bar is the system moment when the target historical media data ends recording. When playing the target real-time media data at a preset speed, cancel the display of the page playback progress bar and display a target prompt message, where the target prompt message indicates that the currently playing media data is real-time media data.

[0092] Optionally, in this embodiment, the above-mentioned first end moment may include, but is not limited to, the end moment after the update of the page playback progress bar.

[0093] The present invention will be specifically described below with reference to specific embodiments:

[0094] The current video recording files are saved according to a certain strategy. For example, after the video data is written into a certain video recording file for 5 minutes, the video recording file file1 ends, and then a new video recording file file2 is created for saving. After file1 ends, the index information of this video recording saves the start and end times of this video data. However, the index information of file2 only saves the start time. When querying the video recording currently, if a certain time is used as the start time and the current system time is used as the end time, then only the video data of this part is returned. When playing, it can only play up to the video with the system time as the end time at the time of querying.

[0095] For example, when a user queries the device video recording on the client, and queries according to the start time and end time. If the end time is the current system time T_curr and the start time is T_s, the device returns 3 video recordings, including the latest video recording file that is being written, as Figure 4 shown. If the user selects to play the video at normal speed starting from file2 until the time of playing to file3 is a total of 4t, then after playing the above 4t video recording, the device saves the latest video recording with a duration of 4t again and creates a new file file4, as Figure 5 shown. Since the user only queries the video recording with a duration of t at the beginning of file3, if the user wants to continue playing the updated video after playing the video recording with a duration of t at the beginning of file3, a new query needs to be made.

[0096] If the user selects to play Figure 4 the file3 in it at normal speed for a duration of t, then the playing is completed. At this time, file3 has appended a video recording with a duration of t. When currently playing this appended video recording, to exit the playing page to the query interface and then query and play again. After the playing is completed, the above problem will still be encountered, that is, after the latest video recording is played, an updated file will be generated and a new query is required, which is extremely inconvenient for the user to operate.

[0097] To solve the above problems, the following solutions are proposed:

[0098] In the above example, after the user queries 3 files (file1, file2, file3), plays file3 at normal speed, and the video recording index information of file3 is returned by the device. If the file has ended writing, the index information returns the complete start and end times; if the file is being written, the extended index information is returned. The extended index information includes the following content:

[0099] (1) The start time T_b when the file starts recording the video;

[0100] (2) The current system time as the end time T_curr for the video recording query;

[0101] (3) Estimate how long it will take to finish writing file3, i.e., the remaining writing time 2t;

[0102] (4) The remaining writable file size size;

[0103] (5) The estimated end writing time Te of this file.

[0104] When the client finishes playing the t-duration video of file3 and reaches time T_curr, the client background queries the device again for the video after T_curr, i.e., the start time is T_curr and the end time is the system time denoted as T_c1. Since the client has received the index information of file3, after the playback duration t, it predicts whether the current file will be finished. If this file will be finished, it queries the updated file; if not, it queries the current file.

[0105] For example, in this example, after file3 has been played for the duration t, file3 has written another t-duration video, i.e., a video with a total duration of 2t. When playing to the end time T_curr, the client queries the device for the video. Since file3 is not finished, the extended index information returned includes the following:

[0106] (1) The start time T_curr when the file starts recording the video;

[0107] (2) The current system time as the end time T_c1 for video query;

[0108] (3) Estimate how long it will take to finish writing file3, i.e., the remaining writing time t;

[0109] (4) The remaining writable file size size1;

[0110] (5) The estimated end writing time Te of this file.

[0111] (4) The remaining writable file size size; After the video is returned to the client, the client playback page updates the page playback progress bar in a timely manner, and the end time of the progress bar is T_c1. After the previous video is played, it starts playing from the immediately following playback progress bar, and the end time of the playback is T_c1, as Figure 6 shown.

[0112] When playing the newly queried video, regardless of the previous playback mode, intelligent playback is used when playing the new video. That is, event data is played at normal speed, and normal videos are played at 2x / 4x speed. If the proportion of event videos is more than 50%, normal videos are played at 4x speed; if the proportion of event videos is less than 50%, normal videos are played at 2x speed. For the sake of description, all videos in file3 in this example are normal videos. When playing a video with a duration of t between T_curr and T_c1 at 2x speed, it takes t / 2 time, and the actual device stores another t / 2 duration of video. When it reaches the time of T_c1, the client queries the video again. The start time is T_c1, the end time is the system time T_c2, and the duration is approximately t / 4. When playing a video with a duration of t / 4 at 2x speed, it takes approximately t / 8 time, and the actual device stores another t / 8 duration of video. As Figure 7 shown. That is, subsequent queries and playbacks are the same as before. When the current video is finished playing, the background uses the end time of the current video as the start time and the system time as the end time to query for new videos. The new videos may be only in the current file, or it is possible that the current file has been written full and ended, and a new file has been created to write the video. After the video is found, intelligent playback starts until the playback time of the video catches up with the live video screen.

[0113] Before the video playback time catches up with the live video screen, if the client requests to establish a live media stream from the device 3 seconds before the preset time, at this time, the live media stream and the video media stream are sent to the client at the same time. In order to achieve seamless switching from video data to the live media stream, seamless switching can be achieved by caching data on the client. When the client is playing the video that is the latest from the live stream on the device at variable speed and needs to switch to the live stream, the client notifies the device end that a bitrate switch is required. Then, when the device end returns the latest video to the client, it sends the live stream to the client at the same time. As Figure 8 , the client plays the video file sent by the device end and caches the live stream. After the client finishes playing the latest video at variable speed, it plays a relatively older live stream in the cache at variable speed until it is all live media stream and then plays it at normal speed. Thus, bitrate switching can be performed. At this time, there is no progress bar for video playback, and the playback page prompts that it has been switched to live data.

[0114] The above is all for ordinary video recording. When there is actual event video recording, in the case of a large number of event videos, the ordinary video is played at 4 times the speed, and the video playback can still catch up with the live stream. The principle of the video data stored in blocks is the same. That is, when there is a new block to be stored and the storage space is sufficient, the current video segment index only has a start time, and the video data is continuously written without an end time. Then, according to the above method, for the video near the live stream, the ordinary video can also be played at a multiple speed to catch up with the live stream. After catching up with the live stream, switch to the live stream and continue playing. After the client queries the latest video of the device and sends a live stream establishment message, and notifies the device that it is seamlessly switching the media stream, after the device sends the video query result, it sends the real-time stream after this video to the client for caching. The client first plays the latest video data at a multiple speed. After playing, it plays a segment of the cached live stream at a multiple speed until it can play the real-time stream. Since the event video is played at normal speed, when the event video cannot catch up with the live time and there is too much live data cached by the client, when the client finishes playing the current video, it re-queries the video and caches the new live stream. For block-stored videos, it is also possible to avoid the situation that after the latest video is played, a new video file needs to be queried and played again, which is extremely inconvenient for user operations. The same applies to other storage methods.

[0115] The above is only an exemplary embodiment, and the present application does not make any specific limitations.

[0116] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disc), and includes several instructions to enable a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of the present invention.

[0117] In this embodiment, a media data playback device is also provided. This device is used to implement the above embodiments and preferred implementation methods, and those that have been described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.

[0118] Figure 9 is a structural block diagram of the media data playback device according to an embodiment of the present invention. As Figure 8 shown, the device includes:

[0119] The first playback module 902 is configured to play the target historical media data at a preset speed in response to a target playback operation, where the target historical media data is the media data to be played selected by the target playback operation.

[0120] The second playback module 904 is configured to play the first historical media data at N times the speed after the target historical media data finishes playing. The playback duration of the target historical media data is the target playback duration. The first historical media data is the media data saved after being recorded for the target playback duration during the playback of the target historical media data. The system time when the recording of the first historical media data starts is the first start time, and the system time when the recording of the first historical media data ends is the first end time. N times the speed means N times the preset speed, and N is greater than 1.

[0121] The third playback module 906 is configured to play the target real-time media data at a preset speed when the first time difference between the first end time and the first current time is less than or equal to a first preset threshold. The target real-time media data is the media data collected by a real-time image acquisition device at the first current time, and the first current time represents the current system time when the first historical media data finishes playing.

[0122] The above device is further configured to: when the first time difference is greater than the first preset threshold, after the first historical media data finishes playing, play the second historical media data at N times the speed. The second historical media data is the media data saved after being recorded for a first playback duration during the playback of the first historical media data. The first playback duration is the ratio of the target playback duration to N. The system time when the recording of the second historical media data starts is the second start time, and the system time when the recording of the second historical media data ends is the second end time. When the second time difference between the second end time and the second current time is less than or equal to the first preset threshold, play the target real-time media data at a preset speed, where the second current time represents the current system time when the second historical media data finishes playing.

[0123] The above device is further configured to: when the first time difference is greater than the first preset threshold, determine the second start time according to the first end time, where the system times indicated by the first end time and the second start time are the same; search for the second historical media data according to the second start time, and play the second historical media data at N times the speed.

[0124] The above device is further configured to: obtain target index information, where the target index information records a second start time and a second end time. When the second historical media data has not been recorded yet, the second end time is the system time when the first historical media data is played to completion. When the second historical media data has been recorded, the second end time is the system time when the second historical media data is recorded to completion; search for the second historical media data according to the second start time and the second end time, and play the second historical media data at N times the speed.

[0125] The above device is further configured to: when the first time difference is greater than the first preset threshold and less than or equal to the second preset threshold, establish a transmission channel for real-time media data before playing the first historical media data, and cache the first real-time media data during the playback of the first historical media data, where the second preset threshold is greater than the first preset threshold, and the first real-time media data is media data collected by a real-time image acquisition device between the first start time and the first end time; after the first historical media data is played to completion, play the first real-time media data at M times the speed, where the system time when the first real-time media data starts to be cached is the third start time, and the system time when the first real-time media data ends caching is the third end time, and M times the speed represents M times the preset speed, and M is greater than 1; when the third time difference between the third end time and the third current time is less than or equal to the first preset threshold, play the target real-time media data at the preset speed, where the third current time represents the current system time when the first real-time media data is played to completion.

[0126] The above-mentioned device is further configured to: when a first time difference is greater than a second preset threshold, after the playback of first historical media data ends, play third historical media data at N times the speed, where the third historical media data is the historical media data saved after being recorded for a first playback duration during the playback of the first historical media data, the first playback duration is the ratio of a target playback duration to N, the system time when the recording of the third historical media data starts is a fourth start time, and the system time when the recording of the third historical media data ends is a fourth end time; when a fourth time difference between the fourth end time and a fourth current time is greater than a first preset threshold and less than or equal to the second preset threshold, before the playback of the third historical media data, establish a transmission channel for real-time media data, and during the playback of the third historical media data, cache second real-time media data, where the second real-time media data is the media data collected by a real-time image acquisition device between the fourth start time and the fourth end time; after the playback of the third historical media data ends, play the second real-time media data at M times the speed, where the system time when the caching of the second real-time media data ends is a fifth end time; when a fifth time difference between the fifth end time and a fifth current time is less than or equal to the first preset threshold, play target real-time media data at a preset speed, where the fifth current time represents the current system time when the playback of the second real-time media data ends.

[0127] The above-mentioned device is further configured to: after the playback of target historical media data ends, update a page playback progress bar, where the end time before the update of the page playback progress bar is the system time when the recording of the target historical media data ends, and the end time after the update of the page playback progress bar is a first end time; when starting to play target real-time media data at a preset speed, cancel the display of the page playback progress bar and display a target prompt message, where the target prompt message indicates that the currently played media data is real-time media data.

[0128] According to another embodiment of the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, where the computer program is configured to execute the steps in any one of the above method embodiments when running.

[0129] It should be noted that the above-mentioned various modules can be implemented by software or hardware. For the latter, it can be achieved in the following ways, but not limited to: the above-mentioned modules are all located in the same processor; or, the above-mentioned various modules are respectively located in different processors in any combination form.

[0130] An embodiment of the present invention also provides a computer-readable storage medium, in which a computer program is stored, where the computer program is configured to execute the steps in any one of the above method embodiments when running.

[0131] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: various media capable of storing computer programs such as USB flash drives, read-only memory (ROM for short), random access memory (RAM for short), mobile hard disks, magnetic disks, or optical discs.

[0132] An embodiment of the present invention further provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0133] In an exemplary embodiment, the above electronic device may further include a transmission device and input / output devices. Among them, the transmission device is connected to the above processor, and the input / output devices are connected to the above processor.

[0134] Specific examples in this embodiment may refer to the examples described in the above embodiments and exemplary embodiments, and will not be repeated here.

[0135] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general-purpose computing device. They can be concentrated on a single computing device or distributed on a network composed of multiple computing devices. They can be implemented by program codes executable by the computing device, so that they can be stored in a storage device and executed by the computing device. And in some cases, the steps shown or described can be executed in a different order from here, or they can be separately fabricated into individual integrated circuit modules, or multiple modules or steps among them can be fabricated into a single integrated circuit module to be implemented. In this way, the present invention is not limited to any specific combination of hardware and software.

[0136] The above is only the preferred embodiment of the present invention and is not used to limit the present invention. For those skilled in the art, the present invention can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for playing media data, characterized in that, Including: In response to a target playback operation, play target historical media data at a preset speed, where the target historical media data is the media data that needs to be played selected by the target playback operation; After the target historical media data finishes playing, play first historical media data at N times the speed, where the playback duration of the target historical media data is the target playback duration, and the first historical media data is the media data saved after being recorded for the target playback duration during the playback of the target historical media data. The system time when the first historical media data starts recording is the first start time, and the system time when the first historical media data ends recording is the first end time. The N times the speed represents N times the preset speed, and N is greater than 1; when the first time difference between the first end time and the first current time is less than or equal to a first preset threshold, play target real-time media data at the preset speed, where the target real-time media data is the media data collected by a real-time image acquisition device at the first current time, and the first current time represents the current system time when the first historical media data finishes playing; The method further includes: when the first time difference is greater than the first preset threshold and less than or equal to a second preset threshold, establish a transmission channel for real-time media data before playing the first historical media data; during the playback of the first historical media data, cache first real-time media data collected by the real-time image acquisition device, and the second preset threshold is greater than the first preset threshold; after the first historical media data finishes playing, play the first real-time media data at M times the speed, and when the third time difference between the system time when the first real-time media data finishes caching and the current system time when the first real-time media data finishes playing is less than or equal to the first preset threshold, play the target real-time media data at the preset speed. The M times the speed represents M times the preset speed, and M is greater than 1.

2. The method according to claim 1, wherein After playing the first historical media data at N times the speed after the target historical media data finishes playing, the method further includes: When the first time difference is greater than the first preset threshold, after the first historical media data finishes playing, play second historical media data at the N times the speed, where the second historical media data is the media data saved after being recorded for a first playback duration during the playback of the first historical media data. The first playback duration is the ratio of the target playback duration to N. The system time when the second historical media data starts recording is the second start time, and the system time when the second historical media data ends recording is the second end time; When a second time difference between the second end moment and a second current moment is less than or equal to the first preset threshold, play the target real-time media data at the preset speed, where the second current moment represents the current system moment when the playback of the second historical media data ends.

3. The method according to claim 2, characterized in that When the first time difference is greater than the first preset threshold, after the playback of the first historical media data ends, playing the second historical media data at the N-fold speed includes: When the first time difference is greater than the first preset threshold, determine a second start moment according to the first end moment, where the system moments indicated by the first end moment and the second start moment are the same; Search for the second historical media data according to the second start moment and play the second historical media data at the N-fold speed.

4. The method according to claim 3, wherein The searching for the second historical media data according to the second start moment and playing the second historical media data at the N-fold speed includes: Obtain target index information, where the target index information records the second start moment and the second end moment. When the second historical media data has not been recorded yet, the second end moment is the system moment when the playback of the first historical media data is completed. When the second historical media data has been recorded, the second end moment is the system moment when the second historical media data is recorded. Search for the second historical media data according to the second start moment and the second end moment and play the second historical media data at the N-fold speed.

5. The method according to claim 1, characterized in that, The method further includes: When the first time difference is greater than the second preset threshold, after the playback of the first historical media data ends, play the third historical media data at the N-fold speed, where the third historical media data is the historical media data saved after being recorded for a first playback duration during the playback of the first historical media data. The first playback duration is the ratio of the target playback duration to N. The system moment when the third historical media data starts to be recorded is the fourth start moment, and the system moment when the third historical media data ends being recorded is the fourth end moment; When a fourth time difference between the fourth end moment and a fourth current moment is greater than the first preset threshold and less than or equal to the second preset threshold, before playing the third historical media data, establish a transmission channel for the real-time media data and cache second real-time media data during the playback of the third historical media data, where the second real-time media data is the media data collected by a real-time image acquisition device between the fourth start moment and the fourth end moment; After the playback of the third historical media data ends, play the second real-time media data at the M-fold speed, where the system moment when the second real-time media data ends being cached is the fifth end moment; When a fifth time difference between the fifth end moment and a fifth current moment is less than or equal to the first preset threshold, play the target real-time media data at the preset speed, where the fifth current moment represents the current system moment when the second real-time media data playback ends.

6. The method according to claim 1, wherein The method further includes: After the target historical media data playback ends, update a page playback progress bar, where an end moment before the page playback progress bar is updated is the system moment when the target historical media data ends recording, and an end moment after the page playback progress bar is updated is the first end moment; When starting to play the target real-time media data at the preset speed, cancel displaying the page playback progress bar and display a target prompt message, where the target prompt message indicates that real-time media data is currently being played.

7. A playback device for media data, characterized in that, Includes: A first playback module, configured to, in response to a target playback operation, play target historical media data at a preset speed, where the target historical media data is the media data that needs to be played selected by the target playback operation; A second playback module, configured to, after the target historical media data playback ends, play first historical media data at N times the speed, where a playback duration of the target historical media data is a target playback duration, the first historical media data is the media data saved after being recorded for the target playback duration during the playback process of the target historical media data, a system moment when the first historical media data starts recording is a first start moment, a system moment when the first historical media data ends recording is a first end moment, the N times the speed represents N times the preset speed, and N is greater than 1; A third playback module, configured to, when a first time difference between the first end moment and a first current moment is less than or equal to a first preset threshold, play target real-time media data at the preset speed, where the target real-time media data is the media data collected by a real-time image acquisition device at the first current moment, and the first current moment represents the current system moment when the first historical media data playback ends; The device is further configured to: when the first time difference is greater than the first preset threshold and less than or equal to a second preset threshold, establish a transmission channel for real-time media data before the first historical media data is played; during the playback process of the first historical media data, cache first real-time media data collected by the real-time image acquisition device, the second preset threshold being greater than the first preset threshold; after the first historical media data playback ends, play the first real-time media data at M times the speed, and when a third time difference between a system moment when the first real-time media data ends caching and a current system moment when the first real-time media data playback ends is less than or equal to the first preset threshold, play the target real-time media data at the preset speed, the M times the speed representing M times the preset speed, and M being greater than 1.

8. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, wherein when the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 6 are implemented.

9. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, the steps of the method described in any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Live broadcast watching method and device based on time shift acceleration

    CN114363710A