Text data display method, device, equipment and storage medium
By establishing a mapping relationship between the timestamp after variable speed processing of multimedia data and the timestamp before variable speed processing, the problem of inaccurate display of text data after variable speed processing of multimedia data is solved, accurate synchronization of text data is achieved, and processing resources are saved.
Patent Information
- Application Number
- CN202011377861.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-30
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2040-11-30
AI Technical Summary
After multimedia data speed change processing, the audio or video and the displayed text data are easily out of sync, resulting in inaccurate text data display.
By establishing a mapping relationship between the timestamp after speed change processing of multimedia data and the timestamp before speed change processing, it is ensured that the timestamp before speed change processing is obtained according to the timestamp after speed change processing during playback, thereby accurately displaying text data.
It improves the accuracy of text data and avoids the problem of inaccurate display of text data caused by changes in timestamps after variable speed processing of multimedia data. There is no need for additional processing of text data and processing resources are saved.
Smart Images

Figure CN112507147B
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a text data display method, apparatus, device and storage medium. Background Art
[0002] With the rapid development of computer technology, multimedia data playing forms are becoming more and more diverse. For example, when playing multimedia data, multiple playing effects can be added to audio or video, such as setting multiple speed playback, one-key DJ (Disc Jockey, disc jockey), etc.
[0003] In the related art, as the audio or video is played, the terminal will also display the corresponding text, for example, when playing a song, the lyrics are displayed; when playing a video, the subtitles are displayed, etc. However, after adding a playback effect to the audio or video, the playback rate of the audio or video may change. When playing the audio or video after the speed change processing, the audio or video will be out of sync with the displayed text. Summary of the invention
[0004] The embodiments of the present application provide a method, device, equipment and storage medium for displaying text data, which improves the accuracy of the displayed text data. The technical solution is as follows:
[0005] In one aspect, a text data display method is provided, the method comprising:
[0006] Establishing a timestamp mapping relationship of the multimedia data, wherein the timestamp mapping relationship represents a mapping relationship between a first timestamp of the multimedia data after speed change processing and an original second timestamp of the multimedia data;
[0007] When playing the multimedia data according to the first timestamp, acquiring the corresponding second timestamp from the timestamp mapping relationship according to the first timestamp;
[0008] The text data corresponding to the second timestamp is acquired, and the text data is displayed.
[0009] In a possible implementation, the first timestamp is a timestamp of the multimedia data after a speed change process, and the establishing of a timestamp mapping relationship of the multimedia data includes:
[0010] Before performing speed-changing processing on the multimedia data, obtaining the second timestamp;
[0011] After the multimedia data is speed-changed, the first timestamp of the multimedia data is obtained; and the timestamp mapping relationship is established based on the first timestamp and the second timestamp.
[0012] In a possible implementation, the first timestamp is a timestamp of the multimedia data after multiple speed changes, and the establishing of the timestamp mapping relationship of the multimedia data includes:
[0013] For each speed change processing, obtaining the timestamp of the multimedia data before the speed change processing, obtaining the timestamp of the multimedia data after the speed change processing, and establishing a mapping relationship between the timestamp before the speed change processing and the timestamp after the speed change processing;
[0014] The first timestamp is the timestamp after the last speed change processing is performed on the multimedia data.
[0015] In a possible implementation, the speed change processing includes sound effect adjustment processing, and for each speed change processing, obtaining a timestamp of the multimedia data before the speed change processing, obtaining a timestamp of the multimedia data after the speed change processing, and establishing a mapping relationship between the timestamp before the speed change processing and the timestamp after the speed change processing, including:
[0016] In response to each receipt of a sound effect adjustment instruction for the multimedia data, a timestamp before the sound effect adjustment process is obtained, the sound effect adjustment process is performed on the multimedia data, a timestamp after the sound effect adjustment process is obtained, and a mapping relationship is established between the timestamp after the sound effect adjustment process and the timestamp before the sound effect adjustment process.
[0017] In a possible implementation, the multimedia data is the first multimedia data fragment in the multimedia file, the timestamp after the current speed change processing includes a first start timestamp and a first end timestamp, the timestamp before the current speed change processing includes a second start timestamp and a second end timestamp, and the second start timestamp is 0; the step of obtaining the timestamp after the current speed change processing of the multimedia data includes:
[0018] After speed-changing processing is performed on the multimedia data, the first start timestamp is determined to be 0;
[0019] The first end timestamp is determined based on the playback length of the multimedia data after speed change processing and the first start timestamp.
[0020] In a possible implementation, the multimedia data is any multimedia data segment after the first multimedia data segment in the multimedia file, and obtaining the timestamp of the multimedia data after the current speed change processing includes:
[0021] After speed-changing processing is performed on the multimedia data, the timestamp after the speed-changing processing is determined based on the playback length of the multimedia data after the speed-changing processing and the timestamp of the previous multimedia data segment of the multimedia data in the multimedia file after the speed-changing processing.
[0022] In a possible implementation, the multimedia data includes multiple media frames, the timestamp after the current speed change processing includes the first frame timestamp of each media frame, the timestamp before the current speed change processing includes the second frame timestamp of each media frame, and establishing a mapping relationship between the timestamp before the current speed change processing and the timestamp after the current speed change processing includes:
[0023] Fitting processing is performed on the first first frame timestamp and the last first frame timestamp in the timestamp after the speed change processing, and the first second frame timestamp and the last second frame timestamp in the timestamp before the speed change processing to generate a timestamp mapping function, wherein the timestamp mapping function indicates the mapping relationship between the timestamp after the speed change processing and the timestamp before the speed change processing of each media frame in the multimedia data.
[0024] In a possible implementation, the first timestamp includes a third frame timestamp of each media frame, the second timestamp includes a fourth frame timestamp of each media frame, and when playing the multimedia data according to the first timestamp, acquiring the corresponding second timestamp from the timestamp mapping relationship according to the first timestamp includes:
[0025] When playing a corresponding media frame according to any third frame timestamp, determining a fourth frame timestamp corresponding to the third frame timestamp according to a timestamp mapping function corresponding to each speed change process;
[0026] The acquiring text data corresponding to the second timestamp and displaying the text data includes:
[0027] The text data corresponding to the fourth frame timestamp is obtained, and the text data is displayed.
[0028] In a possible implementation, the timestamp mapping relationship includes a multi-layer mapping relationship, and when playing the multimedia data according to the first timestamp, acquiring the corresponding second timestamp from the timestamp mapping relationship according to the first timestamp includes:
[0029] When playing the multimedia data according to the first timestamp, the first intermediate timestamp corresponding to the first timestamp is queried according to the first layer mapping relationship, and the second intermediate timestamp corresponding to the first intermediate timestamp is queried according to the second layer mapping relationship, until the second timestamp is queried according to the last layer mapping relationship.
[0030] In one possible implementation, the method further includes:
[0031] When playing the Nth multimedia data before the multimedia data, the multimedia data is subjected to speed change processing, the multimedia data and the Nth multimedia data are data in the same multimedia file, and N is any integer greater than or equal to 1.
[0032] In a possible implementation, the text file includes a plurality of text data and a third timestamp of each text data, and the acquiring the text data corresponding to the second timestamp and displaying the text data includes:
[0033] Based on the second timestamp, text data whose third timestamp matches the second timestamp is acquired from the text file, and the text data is displayed.
[0034] In another aspect, a text data display device is provided, the device comprising:
[0035] An establishing module, used to establish a timestamp mapping relationship of multimedia data, wherein the timestamp mapping relationship represents a mapping relationship between a first timestamp of the multimedia data after speed change processing and an original second timestamp of the multimedia data;
[0036] an acquisition module, configured to acquire the corresponding second timestamp from the timestamp mapping relationship according to the first timestamp when playing the multimedia data according to the first timestamp;
[0037] The display module is used to obtain the text data corresponding to the second timestamp and display the text data.
[0038] In a possible implementation, the establishing module includes:
[0039] an acquisition unit, configured to acquire the second timestamp before speed-changing processing is performed on the multimedia data; and acquire the first timestamp of the multimedia data after speed-changing processing is performed on the multimedia data;
[0040] An establishing unit is used to establish the timestamp mapping relationship based on the first timestamp and the second timestamp.
[0041] In a possible implementation, the first timestamp is the timestamp of the multimedia data after multiple speed changes, and the establishment module is used to obtain the timestamp of the multimedia data before the current speed change processing, obtain the timestamp of the multimedia data after the current speed change processing, and establish a mapping relationship between the timestamp before the current speed change processing and the timestamp after the current speed change processing for each speed change processing;
[0042] The first timestamp is the timestamp after the last speed change processing is performed on the multimedia data.
[0043] In one possible implementation, the speed change processing includes a sound effect adjustment processing, and the establishment module is used to respond to each receipt of a sound effect adjustment instruction for the multimedia data, obtain a timestamp before the sound effect adjustment processing, perform sound effect adjustment processing on the multimedia data, obtain a timestamp after the sound effect adjustment processing, and establish a mapping relationship between the timestamp after the sound effect adjustment processing and the timestamp before the sound effect adjustment processing.
[0044] In one possible implementation, the multimedia data is the first multimedia data fragment in a multimedia file, the timestamp after the speed change processing includes a first start timestamp and a first end timestamp, the timestamp before the speed change processing includes a second start timestamp and a second end timestamp, and the second start timestamp is 0; the establishment module is used to determine the first start timestamp to be 0 after the multimedia data is speed-changed; and determine the first end timestamp based on the playback length of the multimedia data after the speed change processing and the first start timestamp.
[0045] In one possible implementation, the multimedia data is any multimedia data segment after the first multimedia data segment in the multimedia file, and the establishment module is used to determine the timestamp after the speed change processing based on the playback length of the multimedia data after the speed change processing and the timestamp of the previous multimedia data segment of the multimedia data in the multimedia file after the speed change processing after the speed change processing of the multimedia data.
[0046] In one possible implementation, the multimedia data includes multiple media frames, the timestamp after the speed change processing includes the first frame timestamp of each media frame, and the timestamp before the speed change processing includes the second frame timestamp of each media frame. The establishment module is used to fit the first first frame timestamp and the last first frame timestamp in the timestamp after the speed change processing, and the first second frame timestamp and the last second frame timestamp in the timestamp before the speed change processing to generate a timestamp mapping function, and the timestamp mapping function indicates the mapping relationship between the timestamp after the speed change processing and the timestamp before the speed change processing of each media frame in the multimedia data.
[0047] In a possible implementation, the first timestamp includes a third frame timestamp of each media frame, the second timestamp includes a fourth frame timestamp of each media frame, and the acquisition module is used to determine, when playing a corresponding media frame according to any third frame timestamp, a fourth frame timestamp corresponding to the third frame timestamp according to a timestamp mapping function corresponding to each speed change process;
[0048] The display module is used to obtain the text data corresponding to the fourth frame timestamp and display the text data.
[0049] In one possible implementation, the timestamp mapping relationship includes multiple layers of mapping relationships, and the acquisition module is used to query the first intermediate timestamp corresponding to the first timestamp according to the first layer mapping relationship when playing the multimedia data according to the first timestamp, and query the second intermediate timestamp corresponding to the first intermediate timestamp according to the second layer mapping relationship, until the second timestamp is queried according to the last layer mapping relationship.
[0050] In a possible implementation, the device further includes:
[0051] The processing module is used to perform speed change processing on the multimedia data when playing the Nth multimedia data before the multimedia data, the multimedia data and the Nth multimedia data are data in the same multimedia file, and N is any integer greater than or equal to 1.
[0052] In one possible implementation, the text file includes multiple text data and a third timestamp for each text data, and the display module is used to obtain text data whose third timestamp matches the second timestamp from the text file based on the second timestamp, and display the text data.
[0053] On the other hand, a computer device is provided, comprising a processor and a memory, wherein the memory stores at least one computer program, and the at least one computer program is loaded and executed by the processor to implement the operations performed in the text data display method.
[0054] On the other hand, a computer-readable storage medium is provided, in which at least one computer program is stored. The at least one computer program is loaded and executed by a processor to implement the operations performed in the text data display method.
[0055] On the other hand, an embodiment of the present application further provides a computer program, in which at least one computer program code is stored, and the at least one computer program code is loaded and executed by a processor to implement the operations performed in the text data display method.
[0056] The text data display method, apparatus, device and storage medium provided in the embodiments of the present application, because the timestamp of the multimedia data will be changed after the speed change processing of the multimedia data, and thus the accurate text data cannot be obtained based on the timestamp of the multimedia data. However, the present application establishes a mapping relationship between the timestamp of the multimedia data after the speed change processing and the timestamp before the speed change processing, so that when the multimedia data is played, the timestamp before the speed change processing can be obtained according to the timestamp after the speed change processing, so that the accurate text data can be obtained according to the timestamp before the speed change processing, thereby avoiding the problem of being unable to obtain accurate text data due to the change of the timestamp after the speed change processing of the multimedia data, improving the accuracy of the displayed text data, and eliminating the need for additional processing of the text data, thereby saving processing resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0058] Figure 1 It is a structural diagram of an implementation environment provided by an embodiment of the present application.
[0059] Figure 2 It is a flowchart of a text data display method provided in an embodiment of the present application.
[0060] Figure 3 It is a flowchart of a text data display method provided in an embodiment of the present application.
[0061] Figure 4 It is a flowchart of multiple sound effect adjustment processing provided in an embodiment of the present application.
[0062] Figure 5 It is a schematic diagram of a timestamp mapping function provided in an embodiment of the present application.
[0063] Figure 6 It is a structural schematic diagram of a text data display device provided in an embodiment of the present application.
[0064] Figure 7 It is a structural schematic diagram of another text data display device provided in an embodiment of the present application.
[0065] Figure 8 It is a structural diagram of a terminal provided in an embodiment of the present application.
[0066] Fig. 9 It is a structural diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0067] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.
[0068] It is understood that the terms "first", "second", "third", "fourth", "fifth", "sixth", etc. used in this application may be used in this article to describe various concepts, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. For example, a first timestamp may be referred to as a second timestamp, and a second timestamp may be referred to as a first timestamp without departing from the scope of this application.
[0069] The terms "each", "multiple", "at least one", "any", etc. used in this application include one, two or more than two, multiple include two or more than two, each refers to each of the corresponding multiple, and any refers to any one of the multiple. For example, multiple timestamps include 3 timestamps, and each refers to each of the 3 timestamps, and any refers to any one of the 3 timestamps, which can be the first, the second, or the third.
[0070] The text data display method provided in the embodiment of the present application is applied to a computer device. In one possible implementation, the computer device is a terminal, such as a mobile phone, a tablet computer, a computer, etc. In another possible implementation, the computer device includes a terminal and a server.
[0071] Figure 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application. Figure 1 , the implementation environment includes a terminal 101 and a server 102. The terminal 101 and the server 102 are connected via a wireless or wired network.
[0072] The target application provided by the server 102 is installed on the terminal 101, and the terminal 101 can realize functions such as data transmission through the target application. Optionally, the target application is a target application in the operating system of the terminal 101, or a target application provided by a third party. For example, the target application is a multimedia playback application, and the multimedia playback application has the function of playing multimedia data, for example, the function of playing audio, or the function of playing video, or the function of playing audio and video, or the function of displaying text, etc. Of course, the multimedia playback application can also have other functions, such as multimedia data sharing function, comment function, etc.
[0073] Optionally, the server 102 performs speed-changing processing on multiple multimedia data in the first multimedia file, generates a second multimedia file based on the multiple multimedia data after the speed-changing processing, and establishes a timestamp mapping relationship between the first timestamp of each multimedia data before the speed-changing processing and the original second timestamp of the multimedia data. The terminal 101 obtains the second multimedia file from the server 102, and obtains the timestamp mapping relationship corresponding to the second multimedia file and the text file corresponding to the first multimedia file. In the process of playing the multiple multimedia data in the second multimedia file, the terminal 101 obtains the text data corresponding to the currently played multimedia data from the file text according to the timestamp mapping relationship, and displays the text data.
[0074] It should be noted that the embodiment of the present application only takes the example of a server performing speed change processing on a multimedia file and sending the multimedia file after speed change processing to a terminal for playback to exemplify the interaction process between the terminal and the server. In another embodiment, after the server obtains the second timestamp of any multimedia data in the multimedia file, after speed change processing is performed on the multimedia data, the server obtains the first timestamp of the multimedia data, establishes a timestamp mapping relationship between the first timestamp and the second timestamp, and sends the multimedia data after speed change processing and the timestamp mapping relationship to the terminal. When the terminal plays the multimedia data after speed change processing, the terminal obtains text data corresponding to the multimedia data currently being played from the file text according to the timestamp mapping relationship, and displays the text data.
[0075] The text data display method provided in the embodiment of the present application can be applied to the scenario of multimedia data playback:
[0076] For example, it is applied in a song playing scenario.
[0077] During the playing of a song, if the user adds sound effects to the song, causing the playing rate of the song to change, the text data display method provided in the embodiment of the present application can accurately display the corresponding lyrics for the song after the speed change processing.
[0078] For example, it is used in the scenario of playing a TV series.
[0079] When playing an episode video, if the user adds sound effects to the episode video, causing the playback rate of the episode video to change, the text data display method provided in the embodiment of the present application can accurately display corresponding subtitles for the episode video after the speed change processing.
[0080] It should be noted that the embodiments of the present application only take the song playback scene and the video playback scene as examples to exemplify the multimedia data playback scene, and do not limit the multimedia data playback scene. Optionally, the text data display method provided in the embodiments of the present application can also be applied to MV (
[0081] Music Video, music video) playback scene or any other multimedia data playback scene.
[0082] Figure 2 1 is a flowchart of a text data display method provided by an embodiment of the present application. The execution subject of the embodiment of the present application is a computer device. Figure 2 , the method comprising:
[0083] 201. Establish a timestamp mapping relationship for multimedia data, where the timestamp mapping relationship identifies a mapping relationship between a first timestamp of the multimedia data after speed change processing and an original second timestamp of the multimedia data.
[0084] 202. When playing multimedia data according to the first timestamp, obtain a corresponding second timestamp from a timestamp mapping relationship according to the first timestamp.
[0085] 203. Obtain text data corresponding to the second timestamp, and display the text data.
[0086] The text data display method provided in the embodiment of the present application establishes a mapping relationship between the timestamp after the multimedia data is speed-changed and the timestamp before the speed-changed processing, so that when the multimedia data is played, the timestamp before the speed-changed processing can be obtained according to the timestamp after the speed-changed processing, thereby obtaining accurate text data according to the timestamp before the speed-changed processing, thereby avoiding the problem of being unable to obtain accurate text data due to the change of the timestamp after the speed-changed processing of the multimedia data, improving the accuracy of the displayed text data, and eliminating the need for additional processing of the text data, thereby saving processing resources.
[0087] In a possible implementation, the first timestamp is a timestamp of the multimedia data after a speed change process, and establishing a timestamp mapping relationship of the multimedia data includes:
[0088] Before performing speed-changing processing on the multimedia data, obtaining a second timestamp;
[0089] After the multimedia data is speed-changed, a first timestamp of the multimedia data is obtained; and a timestamp mapping relationship is established based on the first timestamp and the second timestamp.
[0090] In a possible implementation, the first timestamp is a timestamp of the multimedia data after multiple speed changes, and establishing a timestamp mapping relationship of the multimedia data includes:
[0091] For each speed change process, obtain the timestamp of the multimedia data before the speed change process, obtain the timestamp of the multimedia data after the speed change process, and establish a mapping relationship between the timestamp before the speed change process and the timestamp after the speed change process;
[0092] The first timestamp is the timestamp of the last time the multimedia data is speed-changed.
[0093] In a possible implementation, the speed change processing includes sound effect adjustment processing. For each speed change processing, a timestamp of the multimedia data before the speed change processing is obtained, a timestamp of the multimedia data after the speed change processing is obtained, and a mapping relationship between the timestamp before the speed change processing and the timestamp after the speed change processing is established, including:
[0094] In response to each receipt of a sound effect adjustment instruction for multimedia data, a timestamp before the sound effect adjustment process is obtained, sound effect adjustment process is performed on the multimedia data, a timestamp after the sound effect adjustment process is obtained, and a mapping relationship is established between the timestamp after the sound effect adjustment process and the timestamp before the sound effect adjustment process.
[0095] In a possible implementation, the multimedia data is the first multimedia data segment in the multimedia file, the timestamp after the speed change processing includes a first start timestamp and a first end timestamp, and the timestamp before the speed change processing includes a second start timestamp and a second end timestamp, and the second start timestamp is 0; obtaining the timestamp after the speed change processing of the multimedia data includes:
[0096] After the multimedia data is subjected to speed change processing, the first start timestamp is determined to be 0;
[0097] A first end timestamp is determined based on the playback length of the multimedia data after speed change processing and the first start timestamp.
[0098] In a possible implementation, the multimedia data is any multimedia data segment after the first multimedia data segment in the multimedia file, and obtaining the timestamp of the multimedia data after the current speed change processing includes:
[0099] After the multimedia data is speed-changed, the timestamp after the current speed-changed processing is determined based on the playback length of the multimedia data after the speed-changed processing and the timestamp of the previous multimedia data segment after the speed-changed processing of the multimedia data in the multimedia file.
[0100] In a possible implementation, the multimedia data includes multiple media frames, the timestamp after the current speed change processing includes the first frame timestamp of each media frame, and the timestamp before the current speed change processing includes the second frame timestamp of each media frame, and establishing a mapping relationship between the timestamp before the current speed change processing and the timestamp after the current speed change processing includes:
[0101] Fitting processing is performed on the first first frame timestamp and the last first frame timestamp in the timestamp after the current speed change processing, and the first second frame timestamp and the last second frame timestamp in the timestamp before the current speed change processing to generate a timestamp mapping function. The timestamp mapping function indicates the mapping relationship between the timestamp after the current speed change processing and the timestamp before the current speed change processing of each media frame in the multimedia data.
[0102] In a possible implementation, the first timestamp includes the third frame timestamp of each media frame, the second timestamp includes the fourth frame timestamp of each media frame, and when the multimedia data is played according to the first timestamp, the corresponding second timestamp is obtained from the timestamp mapping relationship according to the first timestamp, including:
[0103] When playing a corresponding media frame according to any third frame timestamp, determining a fourth frame timestamp corresponding to the third frame timestamp according to a timestamp mapping function corresponding to each speed change process;
[0104] Obtaining text data corresponding to the second timestamp and displaying the text data, including:
[0105] Get the text data corresponding to the fourth frame timestamp and display the text data.
[0106] In a possible implementation, the timestamp mapping relationship includes a multi-layer mapping relationship, and when multimedia data is played according to the first timestamp, a corresponding second timestamp is obtained from the timestamp mapping relationship according to the first timestamp, including:
[0107] When multimedia data is played according to the first timestamp, the first intermediate timestamp corresponding to the first timestamp is queried according to the first layer mapping relationship, and the second intermediate timestamp corresponding to the first intermediate timestamp is queried according to the second layer mapping relationship, until the second timestamp is queried according to the last layer mapping relationship.
[0108] In one possible implementation, the method further includes:
[0109] When playing the Nth multimedia data before the multimedia data, the multimedia data is subjected to speed change processing, the multimedia data and the Nth multimedia data are data in the same multimedia file, and N is any integer greater than or equal to 1.
[0110] In a possible implementation, the text file includes a plurality of text data and a third timestamp of each text data, and acquiring the text data corresponding to the second timestamp and displaying the text data include:
[0111] Based on the second timestamp, text data whose third timestamp matches the second timestamp is acquired from the text file, and the text data is displayed.
[0112] Figure 3 is a flowchart of a text data display method provided by an embodiment of the present application. Figure 3 , the method is applied in a computer device, the method comprising:
[0113] 301. Before performing speed change processing on multimedia data, obtain an original second timestamp of the multimedia data.
[0114] The multimedia data includes at least one of audio data or video data, and the embodiment of the present application does not limit the content of the multimedia data.
[0115] Optionally, the multimedia data is a multimedia data segment in a multimedia file, that is, the multimedia data is a data sequence including at least one media frame. Optionally, the multimedia data is multimedia data of a target duration, wherein the target duration is any duration, for example, the multimedia data of the target duration is multimedia data of 1 second, etc.
[0116] The multimedia file is a collection of at least one multimedia data, and optionally, the multimedia file is a complete audio or video, such as a song, an episode of a TV series, etc. Optionally, the multimedia file is a text stored locally on the terminal, or a file downloaded from a server, or a text obtained by other means. The embodiment of the present application does not limit the method for obtaining the multimedia file.
[0117] The timestamp of multimedia data indicates the playback time point of the multimedia data in the multimedia file to which it belongs. For example, if the multimedia file is a 3-minute audio file, and the timestamp of a certain multimedia data in the multimedia file is 58 seconds, then when the multimedia file is played to the 58th second, the multimedia data played is the certain multimedia data. The timestamp of multimedia data is related to the playback rate of the multimedia file. For example, when the multimedia file is played at 1x speed, the playback length of the multimedia file is 3 minutes, and the timestamp of the multimedia data is 58 seconds. If the multimedia file is played at 2x speed, the playback length of the multimedia file is 1.5 minutes, and the timestamp of the multimedia data is 29 seconds.
[0118] The second timestamp of the multimedia data is the timestamp before the multimedia data is speed-changed, and is the original timestamp of the multimedia data. For example, the second timestamp of the multimedia data indicates the playback time point of the multimedia data in the multimedia file when the multimedia file to which the multimedia data belongs is played at the original playback rate. Optionally, the original playback rate is 1x speed.
[0119] In the process of playing multimedia files on the terminal, the text file can also be displayed accordingly, for example, when playing songs, lyrics are displayed; when playing videos, subtitles are displayed, etc. Among them, the multimedia file includes at least one multimedia data, and the text file includes at least one text data. In the process of playing the multimedia file, the played multimedia data and the displayed text data need to match. In order to match the played multimedia data and the displayed text data, when making the multimedia file and the text file, timestamps are set for the multimedia data in the multimedia file and the text data in the text file. When playing the multimedia data corresponding to a certain timestamp, the text data of the corresponding timestamp is obtained from the text file for display. Among them, obtaining the text data of the corresponding timestamp from the text file for display means: if the timestamp of the text data is the same as the timestamp of the currently played multimedia data, the text data is obtained for display; if the timestamp of the text data is less than the timestamp of the currently played multimedia data, and the difference between the two timestamps is the reference difference, the text data is obtained for display. For example, the first 10 seconds of the song are accompaniment, and the singer starts singing after 10 seconds, and the terminal displays the corresponding lyrics. Among them, the timestamp of the lyrics differs from the timestamp of the corresponding audio by 10 seconds.
[0120] If the multimedia data is subjected to speed-changing processing, the timestamp of the multimedia data may be changed, so that accurate text data cannot be obtained. Step 301 obtains the second timestamp of the multimedia data before the multimedia data is subjected to speed-changing processing. In a possible implementation, the multimedia file includes a plurality of multimedia data and a second timestamp of each multimedia data. Step 301 obtains the second timestamp of the multimedia data from the multimedia file.
[0121] It should be noted that the text data is a sentence, or a character, or a word, etc. The embodiment of the present application does not limit the text data.
[0122] 302. After performing speed-changing processing on the multimedia data, obtain a first timestamp of the multimedia data.
[0123] The speed change processing is used to change the playback rate of the multimedia data. Optionally, the speed change processing includes a sound effect adjustment processing, and the sound effect adjustment processing is used to adjust the sound effect of the multimedia data. The adjustment process will cause the playback rate of the multimedia data to change.
[0124] Optionally, adjusting the sound effect of the multimedia data includes: adding a playback effect to the multimedia data, for example, adding a soothing playback effect to the multimedia data; or adding a rock playback effect to the multimedia data, etc.
[0125] In one possible implementation, the speed-changing processing of multimedia data includes: in response to receiving a sound effect adjustment instruction for the multimedia data, performing sound effect adjustment processing on the multimedia data. It should be noted that the received sound effect adjustment instruction for the multimedia data is one or more, and therefore, in response to receiving the sound effect adjustment instruction for the multimedia data, the sound effect adjustment processing will be performed on the multimedia data once or multiple times. When the sound effect adjustment processing is performed on the multimedia data multiple times, the multimedia data output from the previous sound effect adjustment processing will be used as the input data for the next sound effect adjustment processing, such as Figure 4 shown.
[0126] Optionally, the audio effect adjustment instruction for multimedia data is generated by a user triggering at least one audio effect adjustment option provided by the terminal, wherein the triggering operation is any one or a combination of multiple operations such as a click operation, a double-click operation, and a slide operation, and the embodiment of the present application does not limit the triggering operation.
[0127] In one possible implementation, the terminal displays at least one sound effect adjustment option for the multimedia file, and in response to a triggering operation on any sound effect adjustment option, performs corresponding sound effect adjustment processing on the multimedia data according to the any sound effect adjustment option.
[0128] For example, the sound effect adjustment options displayed on the terminal include: "One-click DJ", "1.25x speed", "1.5x speed", "2x speed", "Rock" and "Soothing", etc. If the user selects "1.25x speed" and "One-click DJ", the multimedia data will be processed at 1.25x speed and one-click DJ.
[0129] Optionally, the multimedia data is processed at 1.25 times the speed and processed with one-click DJ, including: first processing the multimedia data at 1.25 times the speed, and then performing one-click DJ processing on the processed multimedia data; or, first performing one-click DJ processing on the multimedia data, and then processing the processed multimedia data at 1.25 times the speed.
[0130] It should be noted that the embodiment of the present application only takes the speed change processing of multimedia data as an example to exemplify the speed change process, while in another embodiment, in response to receiving a sound effect adjustment instruction for a multimedia file, the multimedia file is subjected to sound effect adjustment processing. Among them, the sound effect adjustment processing of a multimedia file refers to: performing sound effect adjustment processing on the multimedia data in the entire multimedia file; or performing sound effect adjustment processing on the multimedia data that has not been played in the multimedia file. For example, the multimedia file is a 3-minute audio file. When the multimedia file is played to the first minute, a sound effect adjustment instruction for the multimedia file is received, and the sound effect adjustment processing is performed on the multimedia data in the last two minutes of the multimedia file.
[0131] The first timestamp of the multimedia data is the playback time point of the multimedia data in the multimedia file to which it belongs after the speed change processing. The embodiment of the present application does not limit whether other multimedia data in the multimedia file is speed-changed.
[0132] The first timestamp of the multimedia data is related to the position of the multimedia data in the multimedia file. In a possible implementation, the multimedia data is the first multimedia data segment in the multimedia file, and the first timestamp and the second timestamp are both 0.
[0133] For example, the timestamp of the first media frame of a multimedia file of multimedia data remains 0 and does not change, regardless of the playback rate of the multimedia file or the playback rate of the multimedia data in the multimedia file.
[0134] Optionally, the multimedia data is the first multimedia data segment in the multimedia file, the first timestamp includes a first start timestamp and a first end timestamp, the second timestamp includes a second start timestamp and a second end timestamp, and the second start timestamp is 0. Optionally, the multimedia data includes multiple media frames, the first start timestamp is a first frame timestamp corresponding to the first media frame in the multimedia data, and the first end timestamp is a first frame timestamp corresponding to the last media frame in the multimedia data; or, the first start timestamp indicates that the multimedia data is played from the time point indicated by the first start timestamp, and the multimedia data is stopped after reaching the time point indicated by the first end timestamp.
[0135] After speed-changing the multimedia data, obtaining a first timestamp of the multimedia data includes: after speed-changing the multimedia data, determining a first start timestamp as 0; and determining a first end timestamp based on a playback length of the multimedia data after speed-changing and the first start timestamp.
[0136] For example, before the multimedia data speed is changed, the playback length is 2 seconds, then the second start timestamp of the multimedia data is 0, and the second end timestamp is 2 seconds; after the multimedia data speed is changed, the playback length is 1 second, then the first start timestamp of the multimedia data is 0, and the first end timestamp is 1 second.
[0137] In another possible implementation, the multimedia data is not the first multimedia data segment in the multimedia file, and after the multimedia data is speed-changed, a first timestamp of the multimedia data is obtained, including: after the multimedia data is speed-changed, based on the playback length of the multimedia data after the speed-changed processing and the timestamp of the previous multimedia data segment of the multimedia data in the multimedia file after the speed-changed processing, determining the first timestamp.
[0138] For example, the multimedia data is the fifth multimedia data segment in the multimedia file, the playback length of the multimedia data segment after speed change processing is 1 second, and the timestamp of the fourth multimedia data segment after speed change processing is 7 seconds, then the first timestamp of the multimedia data is 8 seconds.
[0139] Optionally, the multimedia data is the first multimedia data segment in the multimedia file, the first timestamp includes a first start timestamp and a first end timestamp, and the second timestamp includes a second start timestamp and a second end timestamp. Optionally, the multimedia data includes multiple media frames, the first start timestamp is the first frame timestamp corresponding to the first media frame in the multimedia data, and the first end timestamp is the first frame timestamp corresponding to the last media frame in the multimedia data; or, the first start timestamp indicates that the multimedia data starts to be played from the time point indicated by the first start timestamp, and stops playing the multimedia data after reaching the time point indicated by the first end timestamp.
[0140] After the multimedia data is speed-changed, a first timestamp is determined based on the playback length of the multimedia data after the speed-changed processing and the timestamp of the previous multimedia data segment of the multimedia data in the multimedia file after the speed-changed processing, including: after the multimedia data is speed-changed, a first start timestamp of the multimedia data is determined based on the end timestamp of the previous multimedia data segment after the speed-changed processing, and a first end timestamp of the multimedia data is determined based on the first start timestamp of the multimedia data and the playback length of the multimedia data after the speed-changed processing.
[0141] Wherein, determining the first start timestamp of the multimedia data based on the end timestamp of the previous multimedia data segment after speed change processing includes: using the end timestamp of the previous multimedia data segment after speed change processing as the first start timestamp of the multimedia data; or, performing statistical processing on the end timestamp of the previous multimedia data segment after speed change processing and a reference playback length to obtain the first start timestamp of the multimedia data. Optionally, the end timestamp of the previous multimedia data segment after speed change processing is the frame timestamp of the last media frame in the previous multimedia data segment, and the reference playback length is the playback length of the last media frame. Performing statistical processing on the end timestamp of the previous multimedia data segment after speed change processing and a reference playback length to obtain the first start timestamp of the multimedia data includes: adding the end timestamp to the reference playback length to obtain the first start timestamp of the multimedia data.
[0142] It should be noted that the embodiment of the present application also describes the timing of speed-changing multimedia data. In one possible implementation, before playing the multimedia file, speed-changing multimedia data in the multimedia file is processed to obtain a speed-changed multimedia file, and the terminal plays the speed-changed multimedia file.
[0143] During the playback of a multimedia file, the user may not be satisfied with the playback effect of the multimedia file, and thus change the playback rate of the multimedia file during the playback of the multimedia file. If a sound effect adjustment instruction for a multimedia file is received during the playback of the multimedia file by the terminal, the terminal performs sound effect adjustment processing on the multimedia file that is not played in the multimedia file according to the sound effect adjustment instruction. Therefore, in another possible implementation, during the playback of the multimedia file, the speed of the multimedia data that is not played in the multimedia file is changed. In this way, the multimedia data can be changed in speed according to the user's setting.
[0144] Optionally, when playing the Nth multimedia data before the multimedia data, the multimedia data is speed-varied, the multimedia data and the Nth multimedia data are data in the same multimedia file, and N is any integer greater than or equal to 1.
[0145] If N is 1, it means that in the process of playing any multimedia data, the next multimedia data of the any multimedia data is pre-speed-changed. If N is 2, it means that in the process of playing any multimedia data, the next multimedia data of the any multimedia data has been speed-changed, and the next multimedia data of the next multimedia data is currently speed-changed. Optionally, the next multimedia data of the any multimedia data is stored in the cache after speed-changed processing, and the smoothness of multimedia data playback can be guaranteed by caching the next multimedia data.
[0146] 303. Establish a timestamp mapping relationship based on the first timestamp and the second timestamp.
[0147] The timestamp mapping relationship includes a mapping relationship between a first timestamp after the multimedia data is speed-changed and a second timestamp before the multimedia data is speed-changed. In a possible implementation, the timestamp mapping relationship is a table, as shown in Table 1.
[0148] Table 1
[0149]
[0150]
[0151] After the first timestamp and the second timestamp are acquired, the first timestamp and the second timestamp are stored in the table in correspondence, that is, a mapping relationship between the first timestamp and the second timestamp is established.
[0152] In another possible implementation, the timestamp mapping relationship is a timestamp mapping function.
[0153] Optionally, the multimedia data is a multimedia data segment in a multimedia file, and the multimedia data includes multiple media frames, each media frame has its own frame timestamp, that is, the first timestamp includes the first frame timestamp of each media frame, and the second timestamp includes the second frame timestamp of each media frame.
[0154] Since the same speed change processing is performed on each media frame in the multimedia data in the embodiment of the present application, the first frame timestamps and the second frame timestamps of multiple media frames in the multimedia data may be linearly correlated. Therefore, if the linear correlation is obtained, the second frame timestamp corresponding to any first frame timestamp can be obtained based on the linear correlation.
[0155] Optionally, based on the first timestamp and the second timestamp, a timestamp mapping relationship is established, including: fitting the first first frame timestamp and the last first frame timestamp in the first timestamp, and the first first frame timestamp and the last second frame timestamp in the second timestamp, to generate a timestamp mapping function, wherein the timestamp mapping function indicates a mapping relationship between the timestamp after speed change processing and the timestamp before speed change processing of each media frame in the multimedia data.
[0156] Optionally, the timestamp mapping function is y=kx+b, where x is the second frame timestamp, y is the first frame timestamp, and k and b are values determined based on the first first frame timestamp and the last first frame timestamp in the first timestamp, and the first first frame timestamp and the last second frame timestamp in the second timestamp.
[0157] In a possible implementation, the speed change processing includes sound effect adjustment processing, and the speed change processing of multimedia data includes: performing at least one sound effect adjustment processing on the multimedia data. The embodiment of the present application also provides a method for generating a multi-layer timestamp mapping function when performing multiple sound effect adjustment processing on multimedia data.
[0158] Optionally, after speed-changing processing is performed on the multimedia data, a first timestamp of the multimedia data is obtained; based on the first timestamp and the second timestamp, a timestamp mapping relationship is established, including: in response to each receipt of a sound effect adjustment instruction for the multimedia data, after sound effect adjustment processing is performed on the multimedia data, a timestamp after the sound effect adjustment processing is obtained, and a mapping relationship between the timestamp after the sound effect adjustment processing and the timestamp before the sound effect adjustment processing is established; wherein the first timestamp is the timestamp after the last sound effect adjustment processing is performed on the multimedia data.
[0159] It should be noted that during the playback of multimedia files, the user may adjust the sound effects of the multimedia files, which may cause the sound effects set by the user at the previous moment to be canceled at the next moment. Therefore, the corresponding sound effect adjustment instruction will also be canceled. Therefore, the "sound effect adjustment instructions" in the above step "responding to each receipt of a sound effect adjustment instruction for multimedia data" are all valid sound effect adjustment instructions, excluding canceled sound effect adjustment instructions.
[0160] For example, in response to the received one-key DJ instruction and 1.25x speed play instruction, the multimedia data is processed by one-key DJ, the timestamp of the multimedia data after the one-key DJ processing is obtained, and a mapping relationship between the timestamp after the one-key DJ processing and the timestamp before the one-key DJ processing is established. Then, the multimedia data after the one-key DJ processing is processed by 1.25x speed, the timestamp of the multimedia data after the 1.25x speed processing is obtained, and a mapping relationship between the timestamp after the 1.25x speed processing and the timestamp before the 1.25x speed processing is established.
[0161] It should be noted that the multimedia file includes multiple multimedia data, and the playback rates of the multiple multimedia data after speed change processing may be different. Therefore, in a possible implementation, the above steps 301 to 303 are performed for each multimedia data in the multimedia file, so as to obtain the timestamp mapping relationship corresponding to each multimedia data, such as Figure 5 As shown, the horizontal axis represents the first timestamp of the multimedia data, and the vertical axis represents the second timestamp of the multimedia data, so that when playing each multimedia data, accurate text data can be displayed for each multimedia data.
[0162] 304. When playing multimedia data according to the first timestamp, obtain a corresponding second timestamp from a timestamp mapping relationship according to the first timestamp.
[0163] When multimedia data is played, corresponding text data can also be displayed, for example, when the first multimedia data is played, "XXXXX, AAAAA" is displayed, and when the second multimedia data is played, "BBBBBB" is displayed, etc. Therefore, when multimedia data is played according to the first timestamp, the steps of obtaining the second timestamp according to the first timestamp and obtaining the text data corresponding to the second timestamp are performed.
[0164] In a possible implementation, the timestamp mapping relationship is a table, and obtaining the corresponding second timestamp from the timestamp mapping relationship according to the first timestamp includes: obtaining the second timestamp corresponding to the first timestamp from the table.
[0165] Optionally, the multimedia data includes multiple media frames, the first timestamp includes a first frame timestamp of each media frame, and when the multimedia data is played according to the first timestamp, the corresponding second timestamp is obtained from a timestamp mapping relationship according to the first timestamp, including: when the corresponding media frame is played according to any first frame timestamp, the second frame timestamp corresponding to the first frame timestamp is obtained from a table.
[0166] In another possible implementation, the timestamp mapping relationship is a timestamp mapping function, and obtaining the corresponding second timestamp from the timestamp mapping relationship according to the first timestamp includes: calculating and processing the first timestamp according to the timestamp mapping function to obtain the second timestamp.
[0167] Optionally, the multimedia data includes multiple media frames, the first timestamp includes a first frame timestamp of each media frame, and when the multimedia data is played according to the first timestamp, the corresponding second timestamp is obtained from the timestamp mapping relationship according to the first timestamp, including: when the corresponding media frame is played according to any first frame timestamp, the second frame timestamp corresponding to the first frame timestamp is determined according to the timestamp mapping function.
[0168] The method of determining the second frame timestamp corresponding to the first frame timestamp according to the timestamp mapping function includes: performing calculation processing on the first frame timestamp according to the timestamp mapping function to obtain the second frame timestamp.
[0169] In one possible implementation, the timestamp mapping relationship includes multiple layers of mapping relationships. When multimedia data is played according to a first timestamp, a corresponding second timestamp is obtained from the timestamp mapping relationship according to the first timestamp, including: when multimedia data is played according to the first timestamp, a first intermediate timestamp corresponding to the first timestamp is queried according to the first layer of mapping relationship, and a second intermediate timestamp corresponding to the first intermediate timestamp is queried according to the second layer of mapping relationship, until the second timestamp is queried according to the last layer of mapping relationship.
[0170] When the multimedia data is subjected to multiple sound effect adjustment processes, a timestamp is obtained after each sound effect adjustment process, and the timestamp after the last sound effect adjustment process is the first timestamp, and the timestamps after any other sound effect adjustment processes except the last sound effect adjustment process in the multiple sound effect adjustment processes are all intermediate timestamps. For example, the timestamp after the second to last sound effect adjustment process is the first intermediate timestamp, and the timestamp after the third to last sound effect adjustment process is the second intermediate timestamp, etc.
[0171] 305. Obtain text data corresponding to the second timestamp, and display the text data.
[0172] The text data is a sentence, or a character, or a word, etc. The embodiment of the present application does not limit the text data.
[0173] Optionally, the text data is data in a text file, and the text file is a file corresponding to the multimedia file, for example, the text file is a lyrics file, a subtitle file, etc.
[0174] In one possible implementation, the text file includes multiple text data and a third timestamp for each text data. Obtaining the text data corresponding to the second timestamp and displaying the text data include: based on the second timestamp, obtaining the text data whose third timestamp matches the second timestamp from the text file and displaying the text data.
[0175] The matching of the third timestamp and the second timestamp means that the third timestamp is the same as the second timestamp, or the difference between the third timestamp and the second timestamp is a reference value.
[0176] The text data display method provided in the embodiment of the present application establishes a mapping relationship between the timestamp after the multimedia data is speed-changed and the timestamp before the speed-changed processing, so that when the multimedia data is played, the timestamp before the speed-changed processing can be obtained according to the timestamp after the speed-changed processing, thereby obtaining accurate text data according to the timestamp before the speed-changed processing, thereby avoiding the problem of being unable to obtain accurate text data due to the change of the timestamp after the speed-changed processing of the multimedia data, improving the accuracy of the displayed text data, and eliminating the need for additional processing of the text data, thereby saving processing resources.
[0177] In addition, a timestamp mapping relationship is established between the timestamp before and after the speed change processing of each multimedia data in the multimedia file. Even in complex situations such as different playback rates of the multimedia data in the multimedia file, or multiple sound effect adjustment processes are performed on the multimedia data, the corresponding text data can still be accurately obtained, thereby improving the accuracy of the displayed text data.
[0178] It should be noted that in an embodiment of the present application, multiple speed changes may be performed when multimedia data is subjected to speed change processing. Therefore, the following content describes the process of establishing a timestamp mapping relationship when multimedia data is subjected to multiple speed changes, and the process of displaying text data when playing the multimedia data after speed change.
[0179] Among them, when the multimedia data is subjected to multiple speed changes, the process of establishing a timestamp mapping relationship includes: for each speed change, obtaining the timestamp of the multimedia data before the current speed change processing, obtaining the timestamp of the multimedia data after the current speed change processing, and establishing a mapping relationship between the timestamp before the current speed change processing and the timestamp after the current speed change processing. Among them, the first timestamp is the timestamp after the last speed change processing of the multimedia data. In other words, a timestamp mapping relationship will be established for each speed change processing.
[0180] In one possible implementation, the speed change processing includes a sound effect adjustment processing. For each speed change processing, a timestamp of the multimedia data before the speed change processing is obtained, a timestamp of the multimedia data after the speed change processing is obtained, and a mapping relationship between the timestamp before the speed change processing and the timestamp after the speed change processing is established, including: in response to each receipt of a sound effect adjustment instruction for the multimedia data, obtaining the timestamp before the sound effect adjustment processing, performing sound effect adjustment processing on the multimedia data, obtaining the timestamp after the sound effect adjustment processing, and establishing a mapping relationship between the timestamp after the sound effect adjustment processing and the timestamp before the sound effect adjustment processing.
[0181] Among them, when determining the timestamp after the speed change processing of multimedia data, it can be determined by referring to whether the multimedia data is the first multimedia data segment in the multimedia file. In a possible implementation, the multimedia data is the first multimedia data segment in the multimedia file, and the timestamp after the speed change processing includes a first start timestamp and a first end timestamp. The timestamp before the speed change processing includes a second start timestamp and a second end timestamp, and the second start timestamp is 0; obtaining the timestamp of the multimedia data after the speed change processing includes: after the speed change processing of the multimedia data, determining the first start timestamp as 0; determining the first end timestamp based on the playback length of the multimedia data after the speed change processing and the first start timestamp. Since the start timestamp of the first multimedia data segment in the multimedia file is always 0, it is possible to directly determine that the start timestamp of the multimedia data is 0.
[0182] In another possible implementation, the multimedia data is any multimedia data segment after the first multimedia data segment in the multimedia file, and obtaining the timestamp of the multimedia data after the current speed change processing includes: after the multimedia data is speed-changed, based on the playback length of the multimedia data after the speed change processing and the timestamp of the previous multimedia data segment of the multimedia data in the multimedia file after the speed change processing, determining the timestamp after the current speed change processing. The timestamp of the multimedia data is not only affected by the playback length of the multimedia data after the speed change processing, but also by the timestamp of the previous multimedia data segment, and therefore, the timestamp of the multimedia data is determined by the timestamp of the previous multimedia data segment.
[0183] Among them, the multimedia data is composed of media frames, and each media frame has a corresponding frame timestamp. Optionally, the multimedia data includes multiple media frames, the timestamp after the current speed change processing includes the first frame timestamp of each media frame, and the timestamp before the current speed change processing includes the second frame timestamp of each media frame, and a mapping relationship between the timestamp before the current speed change processing and the timestamp after the current speed change processing is established, including: fitting the first first frame timestamp and the last first frame timestamp in the timestamp after the current speed change processing, and the first second frame timestamp and the last second frame timestamp in the timestamp before the current speed change processing, and generating a timestamp mapping function, the timestamp mapping function indicates the mapping relationship between the timestamp after the current speed change processing and the timestamp before the current speed change processing of each media frame in the multimedia data.
[0184] Subsequently, the original timestamp of the multimedia data can also be determined according to the established timestamp mapping function. In a possible implementation, the first timestamp includes the third frame timestamp of each media frame, and the second timestamp includes the fourth frame timestamp of each media frame. When the multimedia data is played according to the first timestamp, the corresponding second timestamp is obtained from the timestamp mapping relationship according to the first timestamp, including: when the corresponding media frame is played according to any third frame timestamp, the fourth frame timestamp corresponding to the third frame timestamp is determined according to the timestamp mapping function corresponding to each speed change process. Obtaining the text data corresponding to the second timestamp and displaying the text data includes: obtaining the text data corresponding to the fourth frame timestamp and displaying the text data.
[0185] Figure 6 This is a structural diagram of a text data display device provided by this application. Figure 6 , the device comprises:
[0186] Establishing module 601, used to establish a timestamp mapping relationship of multimedia data, where the timestamp mapping relationship represents a mapping relationship between a first timestamp after the speed change processing of the multimedia data and an original second timestamp of the multimedia data;
[0187] An acquisition module 602, configured to acquire a corresponding second timestamp from a timestamp mapping relationship according to the first timestamp when playing multimedia data according to the first timestamp;
[0188] The display module 603 is used to obtain text data corresponding to the second timestamp and display the text data.
[0189] like Figure 7 As shown, in one possible implementation, a module is established, including:
[0190] The acquisition unit 6011 is used to acquire the second timestamp before the multimedia data is subjected to speed change processing; and acquire the first timestamp of the multimedia data after the multimedia data is subjected to speed change processing;
[0191] The establishing unit 6012 is used to establish a timestamp mapping relationship based on the first timestamp and the second timestamp.
[0192] In a possible implementation, the first timestamp is a timestamp after the multimedia data has been processed by multiple speed changes, and a module 601 is established, which is used to obtain, for each speed change, a timestamp of the multimedia data before the current speed change processing, obtain a timestamp of the multimedia data after the current speed change processing, and establish a mapping relationship between the timestamp before the current speed change processing and the timestamp after the current speed change processing;
[0193] The first timestamp is the timestamp of the last time the multimedia data is speed-changed.
[0194] In one possible implementation, the speed change processing includes sound effect adjustment processing, and a module 601 is established for responding to each receipt of a sound effect adjustment instruction for multimedia data, obtaining a timestamp before the sound effect adjustment processing, performing sound effect adjustment processing on the multimedia data, obtaining a timestamp after the sound effect adjustment processing, and establishing a mapping relationship between the timestamp after the sound effect adjustment processing and the timestamp before the sound effect adjustment processing.
[0195] In one possible implementation, the multimedia data is the first multimedia data segment in the multimedia file, the timestamps after the speed change processing include a first start timestamp and a first end timestamp, and the timestamps before the speed change processing include a second start timestamp and a second end timestamp, and the second start timestamp is 0; a module 601 is established to determine the first start timestamp to be 0 after the multimedia data is speed-changed; and the first end timestamp is determined based on the playback length of the multimedia data after the speed change processing and the first start timestamp.
[0196] In one possible implementation, the multimedia data is any multimedia data segment after the first multimedia data segment in the multimedia file, and a module 601 is established for determining the timestamp after the speed change processing based on the playback length of the multimedia data after the speed change processing and the timestamp of the previous multimedia data segment of the multimedia data in the multimedia file after the speed change processing.
[0197] In one possible implementation, the multimedia data includes multiple media frames, the timestamp after the current speed change processing includes the first frame timestamp of each media frame, and the timestamp before the current speed change processing includes the second frame timestamp of each media frame, and a module 601 is established to perform fitting processing on the first first frame timestamp and the last first frame timestamp in the timestamp after the current speed change processing, and the first second frame timestamp and the last second frame timestamp in the timestamp before the current speed change processing, and generate a timestamp mapping function, which indicates the mapping relationship between the timestamp after the current speed change processing and the timestamp before the current speed change processing of each media frame in the multimedia data.
[0198] In a possible implementation, the first timestamp includes a third frame timestamp of each media frame, and the second timestamp includes a fourth frame timestamp of each media frame. The acquisition module 602 is configured to determine, when playing a corresponding media frame according to any third frame timestamp, a fourth frame timestamp corresponding to the third frame timestamp according to a timestamp mapping function corresponding to each speed change process;
[0199] 603 display module, used to obtain text data corresponding to the fourth frame timestamp and display the text data.
[0200] In one possible implementation, the timestamp mapping relationship includes multiple layers of mapping relationships, and the acquisition module 602 is used to query the first intermediate timestamp corresponding to the first timestamp according to the first layer of mapping relationship when playing multimedia data according to the first timestamp, and query the second intermediate timestamp corresponding to the first intermediate timestamp according to the second layer of mapping relationship, until the second timestamp is queried according to the last layer of mapping relationship.
[0201] In a possible implementation, the device further includes:
[0202] The processing module 604 is used to perform speed change processing on the multimedia data when playing the Nth multimedia data before the multimedia data, the multimedia data and the Nth multimedia data are data in the same multimedia file, and N is any integer greater than or equal to 1.
[0203] In a possible implementation, the text file includes multiple text data and a third timestamp for each text data. The display module 603 is used to obtain text data whose third timestamp matches the second timestamp from the text file based on the second timestamp, and display the text data.
[0204] An embodiment of the present application also provides a computer device, which includes a processor and a memory, wherein the memory stores at least one computer program, and the at least one computer program is loaded and executed by the processor to implement the operations performed in the above-mentioned text data display method.
[0205] Optionally, the computer device is provided as a terminal. Figure 8 800 is a schematic diagram of a terminal structure provided by an embodiment of the present application. The terminal 800 may be a portable mobile terminal, such as a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 player (Moving Picture Experts Group Audio Layer IV), a laptop computer or a desktop computer. The terminal 800 may also be referred to as a user device, a portable terminal, a laptop terminal, a desktop terminal or other names.
[0206] The terminal 800 includes a processor 801 and a memory 802 .
[0207] The processor 801 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 801 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 801 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 801 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 801 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0208] The memory 802 may include one or more computer-readable storage media, which may be non-transitory. The memory 802 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 802 is used to store at least one computer program, which is used to be executed by the processor 801 to implement the text data display method provided in the method embodiment of the present application.
[0209] In some embodiments, the terminal 800 may further optionally include: a peripheral device interface 803 and at least one peripheral device. The processor 801, the memory 802 and the peripheral device interface 803 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 803 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 804, a display screen 805, a camera assembly 806, an audio circuit 807, a positioning assembly 808 and a power supply 809.
[0210] The peripheral device interface 803 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 801 and the memory 802. In some embodiments, the processor 801, the memory 802, and the peripheral device interface 803 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 801, the memory 802, and the peripheral device interface 803 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
[0211] The radio frequency circuit 804 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 804 communicates with communication networks and other communication devices through electromagnetic signals. The radio frequency circuit 804 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the radio frequency circuit 804 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The radio frequency circuit 804 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes but is not limited to: the World Wide Web, a metropolitan area network, an intranet, various generations of mobile communication networks (2G, 3G, 4G and 20G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 804 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.
[0212] The display screen 805 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos and any combination thereof. When the display screen 805 is a touch display screen, the display screen 805 also has the ability to collect touch signals on the surface or above the surface of the display screen 805. The touch signal can be input to the processor 801 as a control signal for processing. At this time, the display screen 805 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 805 can be one, set on the front panel of the terminal 800; in other embodiments, the display screen 805 can be at least two, respectively set on different surfaces of the terminal 800 or in a folding design; in other embodiments, the display screen 805 can be a flexible display screen, set on the curved surface or folding surface of the terminal 800. Even, the display screen 805 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 805 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode, organic light-emitting diode).
[0213] The camera assembly 806 is used to capture images or videos. Optionally, the camera assembly 806 includes a front camera and a rear camera. The front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 806 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.
[0214] The audio circuit 807 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 801 for processing, or input them into the radio frequency circuit 804 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the terminal 800. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 801 or the radio frequency circuit 804 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 807 may also include a headphone jack.
[0215] The positioning component 808 is used to locate the current geographical location of the terminal 800 to implement navigation or LBS (Location Based Service). The positioning component 808 can be based on the US GPS (Global Positioning System), China's Beidou system or Russia's Grenas positioning system and the European Union's Galileo positioning system.
[0216] The power supply 809 is used to power various components in the terminal 800. The power supply 809 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 809 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery charged through a wired line, and a wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0217] In some embodiments, the terminal 800 further includes one or more sensors 810 , including but not limited to: an acceleration sensor 811 , a gyroscope sensor 812 , a pressure sensor 813 , a fingerprint sensor 814 , an optical sensor 815 , and a proximity sensor 816 .
[0218] The acceleration sensor 811 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the terminal 80. For example, the acceleration sensor 811 can be used to detect the components of gravity acceleration on the three coordinate axes. The processor 801 can control the display screen 805 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 811. The acceleration sensor 811 can also be used to collect game or user motion data.
[0219] The gyroscope sensor 812 can detect the body direction and rotation angle of the terminal 800, and the gyroscope sensor 812 can cooperate with the acceleration sensor 811 to collect the user's 3D actions on the terminal 800. The processor 801 can implement the following functions based on the data collected by the gyroscope sensor 812: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
[0220] The pressure sensor 813 can be set on the side frame of the terminal 800 and / or the lower layer of the display screen 805. When the pressure sensor 813 is set on the side frame of the terminal 800, it can detect the user's holding signal of the terminal 800, and the processor 801 performs left and right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 813. When the pressure sensor 813 is set on the lower layer of the display screen 805, the processor 801 controls the operability controls on the UI interface according to the user's pressure operation on the display screen 805. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
[0221] The fingerprint sensor 814 is used to collect the user's fingerprint, and the processor 801 identifies the user's identity based on the fingerprint collected by the fingerprint sensor 814, or the fingerprint sensor 814 identifies the user's identity based on the collected fingerprint. When the user's identity is identified as a trusted identity, the processor 801 authorizes the user to perform relevant sensitive operations, which include unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings. The fingerprint sensor 814 can be set on the front, back, or side of the terminal 800. When a physical button or a manufacturer logo is set on the terminal 800, the fingerprint sensor 814 can be integrated with the physical button or the manufacturer logo.
[0222] The optical sensor 815 is used to collect the ambient light intensity. In one embodiment, the processor 801 can control the display brightness of the display screen 805 according to the ambient light intensity collected by the optical sensor 815. Specifically, when the ambient light intensity is high, the display brightness of the display screen 805 is increased; when the ambient light intensity is low, the display brightness of the display screen 805 is reduced. In another embodiment, the processor 801 can also dynamically adjust the shooting parameters of the camera assembly 806 according to the ambient light intensity collected by the optical sensor 815.
[0223] The proximity sensor 816, also called a distance sensor, is disposed on the front panel of the terminal 800. The proximity sensor 816 is used to collect the distance between the user and the front of the terminal 800. In one embodiment, when the proximity sensor 816 detects that the distance between the user and the front of the terminal 800 is gradually decreasing, the processor 801 controls the display screen 805 to switch from the screen-on state to the screen-off state; when the proximity sensor 816 detects that the distance between the user and the front of the terminal 800 is gradually increasing, the processor 801 controls the display screen 805 to switch from the screen-off state to the screen-on state.
[0224] Those skilled in the art will understand that Figure 8 The structure shown in the figure does not constitute a limitation on the terminal 800, and the terminal 800 may include more or less components than those shown in the figure, or combine some components, or adopt a different component arrangement.
[0225] Optionally, the computer device is provided as a server. Fig. 9 This is a schematic diagram of the structure of a server according to an exemplary embodiment. The server 900 may have relatively large differences due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 901 and one or more memories 902, wherein the memory 902 stores at least one computer program, and at least one computer program is loaded and executed by the processor 901 to implement the methods provided by the above-mentioned various method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output, and the server may also include other components for implementing device functions, which will not be described in detail here.
[0226] An embodiment of the present application further provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is loaded and executed by a processor to implement the operations performed in the text data display method of the above embodiment.
[0227] An embodiment of the present application further provides a computer program, in which at least one computer program is stored. The at least one computer program is loaded and executed by a processor to implement the operations performed in the text data display method of the above embodiment.
[0228] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0229] The above are only optional embodiments of the embodiments of the present application and are not intended to limit the embodiments of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the protection scope of the present application.
Claims
1. A text data display method, characterized in that: The method comprises: Establishing a timestamp mapping relationship of the multimedia data, wherein the timestamp mapping relationship represents a mapping relationship between a first timestamp of the multimedia data after speed change processing and an original second timestamp of the multimedia data; When playing the multimedia data according to the first timestamp, acquiring the corresponding second timestamp from the timestamp mapping relationship according to the first timestamp; Acquire text data corresponding to the second timestamp, and display the text data; The first timestamp is a timestamp of the multimedia data after multiple speed changes, and the establishing of the timestamp mapping relationship of the multimedia data includes: For each speed change processing, obtain the timestamp of the multimedia data before the speed change processing, obtain the timestamp of the multimedia data after the speed change processing, and establish a mapping relationship between the timestamp before the speed change processing and the timestamp after the speed change processing; wherein the first timestamp is the timestamp after the last speed change processing of the multimedia data; The speed change processing includes sound effect adjustment processing, and for each speed change processing, obtaining the timestamp of the multimedia data before the speed change processing, obtaining the timestamp of the multimedia data after the speed change processing, and establishing a mapping relationship between the timestamp before the speed change processing and the timestamp after the speed change processing, including: In response to each receipt of a sound effect adjustment instruction for the multimedia data, a timestamp before the sound effect adjustment process is obtained, the sound effect adjustment process is performed on the multimedia data, a timestamp after the sound effect adjustment process is obtained, and a mapping relationship is established between the timestamp after the sound effect adjustment process and the timestamp before the sound effect adjustment process.
2. The method according to claim 1, characterized in that The first timestamp is a timestamp of the multimedia data after a speed change process, and the establishing of a timestamp mapping relationship of the multimedia data includes: Before performing speed-changing processing on the multimedia data, obtaining the second timestamp; After the multimedia data is speed-changed, the first timestamp of the multimedia data is obtained; and the timestamp mapping relationship is established based on the first timestamp and the second timestamp.
3. The method according to claim 1, characterized in that: The multimedia data is the first multimedia data fragment in the multimedia file, the timestamp after the current speed change processing includes a first start timestamp and a first end timestamp, the timestamp before the current speed change processing includes a second start timestamp and a second end timestamp, and the second start timestamp is 0; The obtaining of the timestamp of the multimedia data after the current speed change processing includes: After speed-changing processing is performed on the multimedia data, the first start timestamp is determined to be 0; The first end timestamp is determined based on the playback length of the multimedia data after speed change processing and the first start timestamp.
4. The method according to claim 1, characterized in that: The multimedia data is any multimedia data segment after the first multimedia data segment in the multimedia file, and the obtaining of the timestamp of the multimedia data after the current speed change processing includes: After speed-changing processing is performed on the multimedia data, the timestamp after the speed-changing processing is determined based on the playback length of the multimedia data after the speed-changing processing and the timestamp of the previous multimedia data segment of the multimedia data in the multimedia file after the speed-changing processing.
5. The method according to claim 1, characterized in that The multimedia data includes a plurality of media frames, the timestamp after the current speed change processing includes a first frame timestamp of each media frame, the timestamp before the current speed change processing includes a second frame timestamp of each media frame, and establishing a mapping relationship between the timestamp before the current speed change processing and the timestamp after the current speed change processing includes: Fitting processing is performed on the first first frame timestamp and the last first frame timestamp in the timestamp after the speed change processing, and the first second frame timestamp and the last second frame timestamp in the timestamp before the speed change processing to generate a timestamp mapping function, wherein the timestamp mapping function indicates the mapping relationship between the timestamp after the speed change processing and the timestamp before the speed change processing of each media frame in the multimedia data.
6. The method according to claim 5, characterized in that The first timestamp includes a third frame timestamp of each media frame, the second timestamp includes a fourth frame timestamp of each media frame, and when playing the multimedia data according to the first timestamp, acquiring the corresponding second timestamp from the timestamp mapping relationship according to the first timestamp includes: When playing a corresponding media frame according to any third frame timestamp, determining a fourth frame timestamp corresponding to the third frame timestamp according to a timestamp mapping function corresponding to each speed change process; The acquiring text data corresponding to the second timestamp and displaying the text data includes: The text data corresponding to the fourth frame timestamp is obtained, and the text data is displayed.
7. The method according to claim 1, characterized in that The timestamp mapping relationship includes a multi-layer mapping relationship, and when the multimedia data is played according to the first timestamp, obtaining the corresponding second timestamp from the timestamp mapping relationship according to the first timestamp includes: When playing the multimedia data according to the first timestamp, the first intermediate timestamp corresponding to the first timestamp is queried according to the first layer mapping relationship, and the second intermediate timestamp corresponding to the first intermediate timestamp is queried according to the second layer mapping relationship, until the second timestamp is queried according to the last layer mapping relationship.
8. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: When playing the Nth multimedia data before the multimedia data, the multimedia data is subjected to speed change processing, the multimedia data and the Nth multimedia data are data in the same multimedia file, and N is any integer greater than or equal to 1.
9. The method according to claim 1, characterized in that: The text file includes a plurality of text data and a third timestamp for each text data, and the acquiring the text data corresponding to the second timestamp and displaying the text data includes: Based on the second timestamp, text data whose third timestamp matches the second timestamp is acquired from the text file, and the text data is displayed.
10. A text data display device, characterized in that: The device comprises: An establishing module, used to establish a timestamp mapping relationship of multimedia data, wherein the timestamp mapping relationship represents a mapping relationship between a first timestamp of the multimedia data after speed change processing and an original second timestamp of the multimedia data; an acquisition module, configured to acquire the corresponding second timestamp from the timestamp mapping relationship according to the first timestamp when playing the multimedia data according to the first timestamp; A display module, used for acquiring text data corresponding to the second timestamp and displaying the text data; The first timestamp is the timestamp after the multimedia data has been processed by multiple speed changes. The establishment module is further used to obtain the timestamp of the multimedia data before the current speed change processing, obtain the timestamp of the multimedia data after the current speed change processing, and establish a mapping relationship between the timestamp before the current speed change processing and the timestamp after the current speed change processing; wherein the first timestamp is the timestamp after the last speed change processing of the multimedia data; The speed change processing includes sound effect adjustment processing. The establishment module is also used to respond to each receipt of a sound effect adjustment instruction for the multimedia data, obtain the timestamp before the sound effect adjustment processing, perform sound effect adjustment processing on the multimedia data, obtain the timestamp after the sound effect adjustment processing, and establish a mapping relationship between the timestamp after the sound effect adjustment processing and the timestamp before the sound effect adjustment processing.
11. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one computer program instruction, and the at least one computer program instruction is loaded and executed by the processor to implement the operations performed in the text data display method according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one computer program instruction, and the at least one computer program instruction is loaded and executed by a processor to implement the operations performed in the text data display method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Video playing speed regulation method and system applied to flash
CN103747287A
Data processing method, apparatus, terminal, and storage medium
CN109346111A
Method and device for displaying live broadcast subtitles, server and medium
CN111010614A
Lyric display method and device and computer storage medium
CN111092991A
Apparatus and method for generating multimedia data with various reproduction speed, apparatus and method for reproducing the multimedia data, and storage medium ...
KR1020090076298A
