CN108769769B - Video playing method and device and computer readable storage medium - Google Patents

Video playing method and device and computer readable storage medium Download PDF

Info

Publication number
CN108769769B
CN108769769B CN201810540936.1A CN201810540936A CN108769769B CN 108769769 B CN108769769 B CN 108769769B CN 201810540936 A CN201810540936 A CN 201810540936A CN 108769769 B CN108769769 B CN 108769769B
Authority
CN
China
Prior art keywords
playing
video
frame rate
background music
video segment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810540936.1A
Other languages
Chinese (zh)
Other versions
CN108769769A (en
Inventor
罗序满
王倩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN201810540936.1A priority Critical patent/CN108769769B/en
Publication of CN108769769A publication Critical patent/CN108769769A/en
Application granted granted Critical
Publication of CN108769769B publication Critical patent/CN108769769B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/4302Content synchronisation processes, e.g. decoder synchronisation
    • H04N21/4307Synchronising the rendering of multiple content streams or additional data on devices, e.g. synchronisation of audio on a mobile phone with the video output on the TV screen
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/433Content storage operation, e.g. storage operation in response to a pause request, caching operations
    • H04N21/4334Recording operations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/439Processing of audio elementary streams
    • H04N21/4394Processing of audio elementary streams involving operations for analysing the audio stream, e.g. detecting features or characteristics in audio streams
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • H04N21/440245Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display the reformatting operation being performed only on part of the stream, e.g. a region of the image or a time segment
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/63Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
    • H04N21/647Control signaling between network components and server or clients; Network processes for video distribution between server and clients, e.g. controlling the quality of the video stream, by dropping packets, protecting content from unauthorised alteration within the network, monitoring of network load, bridging between two different networks, e.g. between IP and wireless
    • H04N21/64746Control signals issued by the network directed to the server or the client
    • H04N21/64761Control signals issued by the network directed to the server or the client directed to the server
    • H04N21/64769Control signals issued by the network directed to the server or the client directed to the server for rate control

Abstract

The disclosure relates to a video playing method and device and a computer readable storage medium, and relates to the technical field of terminals. The method comprises the following steps: at least one rhythm area in background music of the target video is determined, the target video is segmented according to the at least one rhythm area, and then at least one first video segment and at least one second video segment are obtained, namely, the target video can be automatically segmented according to the background music. Then, in the process of playing the background music, the at least one first video segment can be played at the first playing frame rate, and the at least one second video segment can be played at the second playing frame rate. Because the first play frame rate and the second play frame rate are different, the method provided by the embodiment of the disclosure can automatically adjust the play frame rate of the video and automatically match and play the music and the video.

Description

Video playing method and device and computer readable storage medium
Technical Field
The present disclosure relates to the field of terminal technologies, and in particular, to a method and an apparatus for playing a video, and a computer-readable storage medium.
Background
With the recent development of the movie and television play industry, the richness of videos is increasing, and in order to facilitate users to watch various videos, the videos are generally required to be played.
At present, videos can be played at different playing frame rates, and a piece of music can also be selected as background music of the videos, that is, the videos and the music are played simultaneously. The playback frame rate refers to the number of pictures of video played back per second. When the video and the music are played simultaneously, different parts in the music can be collocated with parts corresponding to different playing frame rates in the video. For example, a climax part of music is collocated with a part with a higher video playing frame rate, and a non-climax part of the music is collocated with a part with a lower video playing frame rate. At present, users basically adjust the playing frame rate of videos manually, so as to play music and videos in a matching manner.
Disclosure of Invention
To overcome the problems in the related art, the present disclosure provides a method and an apparatus for playing a video, and a computer-readable storage medium.
In a first aspect, a method for playing a video is provided, including:
determining at least one rhythm area in background music of a target video, wherein the at least one rhythm area is determined by a time interval for which each volume in the background music lasts;
segmenting the target video according to the at least one rhythm area to obtain at least one first video segment and at least one second video segment, wherein the at least one first video segment is a video segment corresponding to the at least one rhythm area in the target video, and the at least one second video segment is a video segment except the at least one first video segment in the target video;
in the process of playing the background music, playing the at least one first video segment at a first playing frame rate, and playing the at least one second video segment at a second playing frame rate, where the first playing frame rate and the second playing frame rate are different.
Optionally, the determining at least one rhythm region in background music of the target video includes:
determining a sound wave track graph of background music of the target video, wherein the sound wave track graph is obtained by drawing according to time intervals during which different volumes of the background music last;
and determining at least one rhythm area in the background music according to the time interval corresponding to each volume in the sound wave track diagram.
Optionally, the determining at least one rhythm region in the background music according to a time interval corresponding to each volume in the sound wave track diagram includes:
determining a time interval corresponding to the highest volume in the sound wave locus diagram to obtain at least one high volume area of the background music;
determining at least two fluctuation cycles of the background music according to the sound wave track map;
determining at least one rhythm conversion area of the background music according to the at least two fluctuation cycles, wherein each rhythm conversion area is a time interval corresponding to one volume between two adjacent different fluctuation cycles in the at least two fluctuation cycles;
determining the at least one high volume region and the at least one tempo transition region as at least one tempo region in the background music.
Optionally, each tempo region comprises a time start and a time end;
the segmenting the target video according to the at least one rhythm area region comprises:
and segmenting the target video according to the time starting point and the time ending point included by each rhythm area.
Optionally, the playing the at least one first video segment at a first playing frame rate and playing the at least one second video segment at a second playing frame rate during the playing of the background music includes:
and in the process of playing the background music, playing the at least one first video segment in a reverse order at the first playing frame rate, and playing the at least one second video segment in a reverse order at the second playing frame rate.
Optionally, the first play frame rate is greater than the recording frame rate of the target video, and the second play frame rate is less than the recording frame rate of the target video.
In a second aspect, there is provided a video playing apparatus, the apparatus including:
the device comprises a determining module, a judging module and a judging module, wherein the determining module is used for determining at least one rhythm area in background music of a target video, and the at least one rhythm area is determined by a time interval for which each volume in the background music lasts;
a segmentation module, configured to segment the target video according to the at least one rhythm zone to obtain at least one first video segment and at least one second video segment, where the at least one first video segment is a video segment corresponding to the at least one rhythm zone in the target video, and the at least one second video segment is a video segment in the target video other than the at least one first video segment;
and the playing module is used for playing the at least one first video segment at a first playing frame rate and playing the at least one second video segment at a second playing frame rate in the process of playing the background music, wherein the first playing frame rate is different from the second playing frame rate.
Optionally, the determining module includes:
the first determining submodule is used for determining a sound wave track graph of background music of the target video, and the sound wave track graph is obtained by drawing according to time intervals during which different volumes of the background music last;
and the second determining submodule is used for determining at least one rhythm area in the background music according to the time interval corresponding to each volume in the sound wave track diagram.
Optionally, the second determining sub-module includes:
the first determining unit is used for determining a time interval corresponding to the highest volume in the sound wave locus diagram so as to obtain at least one high volume area of the background music;
a second determining unit, configured to determine at least two fluctuation cycles of the background music according to the sound wave trace diagram;
a third determining unit, configured to determine at least one rhythm conversion region of the background music according to the at least two fluctuation cycles, where each rhythm conversion region is a time interval corresponding to a volume between two adjacent different fluctuation cycles in the at least two fluctuation cycles;
a fourth determination unit configured to determine the at least one high volume region and the at least one tempo conversion region as at least one tempo region in the background music.
Optionally, each tempo region comprises a time start and a time end;
the segmentation module comprises:
and the segmenting submodule is used for segmenting the target video according to the time starting point and the time ending point included in each rhythm area.
Optionally, the playing module includes:
and the playing sub-module is used for playing the at least one first video segment in the reverse order at the first playing frame rate and playing the at least one second video segment in the reverse order at the second playing frame rate in the process of playing the background music.
Optionally, the first play frame rate is greater than the recording frame rate of the target video, and the second play frame rate is less than the recording frame rate of the target video.
In a third aspect, an apparatus for playing a video is provided, the apparatus comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to perform the steps of any of the methods of the first aspect described above.
In a fourth aspect, a computer-readable storage medium is provided, having instructions stored thereon, which when executed by a processor, implement the steps of any of the methods of the first aspect described above.
In a fifth aspect, there is provided a computer program product comprising instructions which, when run on a computer, cause the computer to perform the steps of the method of any of the first aspects above.
The technical scheme provided by the embodiment of the disclosure at least has the following beneficial effects:
in the embodiment of the present disclosure, at least one rhythm region in the background music of the target video is determined, and the target video is segmented according to the at least one rhythm region, so as to obtain at least one first video segment and at least one second video segment, that is, the target video may be automatically segmented according to the background music. Then, in the process of playing the background music, the at least one first video segment can be played at the first playing frame rate, and the at least one second video segment can be played at the second playing frame rate. Because the first play frame rate and the second play frame rate are different, the method provided by the embodiment of the disclosure can automatically adjust the play frame rate of the video and automatically match and play the music and the video.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
Fig. 1 is a flow chart illustrating a method of playing a video according to an exemplary embodiment.
Fig. 2 is a flow chart illustrating a method of playing a video according to an exemplary embodiment.
FIG. 3 is an exemplary diagram illustrating a sonic trace diagram in accordance with one illustrative embodiment.
Fig. 4 is an exemplary diagram illustrating a rhythm region in a sound wave trace diagram including two high-volume regions and one rhythm conversion region according to an exemplary embodiment.
Fig. 5 is an exemplary diagram illustrating a target video segment according to a temporal start point and a temporal end point included in a cadence region according to an exemplary embodiment.
Fig. 6 is an exemplary diagram illustrating fast playing a first video segment and slow playing a second video segment in fig. 5 according to an exemplary embodiment.
Fig. 7 is an exemplary diagram illustrating reverse order play of a target video according to an exemplary embodiment.
Fig. 8 is a block diagram illustrating a video playback device according to an example embodiment.
Fig. 9 is a block diagram illustrating a video playback device according to an example embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
Before explaining the embodiments of the present disclosure in detail, an application scenario of the embodiments of the present disclosure is introduced:
the fast shot and the slow shot are two common playing modes in the video, and when a fast visual impact effect needs to be presented, the playing frame rate of the video can be improved to form the fast shot; when a person or object in the video needs to be close-up, the playing frame rate of the video can be reduced to form a slow shot. In order to enhance the playing effect of the fast and slow shots, the background music may be played in combination with the fast and slow shots, for example, when the fast shot is played, the climax part of the music is played at the same time, and when the slow shot is played, the gentle part of the music is played at the same time.
At present, users usually adjust the playing frame rate of videos manually to form slow shots or fast shots, and still users play music and videos together manually, which is inconvenient for users. Therefore, the present disclosure provides a video playing method, which can automatically adjust the video playing frame rate and also automatically match music and video for playing.
Fig. 1 is a flowchart illustrating a video playing method according to an exemplary embodiment, and the method is applied to a terminal, as shown in fig. 1, and includes the following steps.
In step 101, at least one rhythm region in background music of a target video is determined, wherein the at least one rhythm region is determined by a time interval for which each volume in the background music lasts.
In step 102, the target video is segmented according to the at least one rhythm zone to obtain at least one first video segment and at least one second video segment, where the at least one first video segment is a video segment corresponding to the at least one rhythm zone in the target video, and the at least one second video segment is a video segment of the target video other than the at least one first video segment.
In step 103, during the playing of the background music, the at least one first video segment is played at a first frame rate, and the at least one second video segment is played at a second frame rate, where the first frame rate and the second frame rate are different.
In the embodiment of the present disclosure, at least one rhythm region in the background music of the target video is determined, and the target video is segmented according to the at least one rhythm region, so as to obtain at least one first video segment and at least one second video segment, that is, the target video may be automatically segmented according to the background music. Then, in the process of playing the background music, the at least one first video segment can be played at the first playing frame rate, and the at least one second video segment can be played at the second playing frame rate. Because the first play frame rate and the second play frame rate are different, the method provided by the embodiment of the disclosure can automatically adjust the play frame rate of the video and automatically match and play the music and the video.
Optionally, determining at least one rhythm region in background music of the target video comprises:
determining a sound wave track graph of background music of the target video, wherein the sound wave track graph is obtained by drawing according to time intervals of different volumes of the background music;
and determining at least one rhythm area in the background music according to the time interval corresponding to each volume in the sound wave track diagram.
Optionally, determining at least one rhythm area in the background music according to a time interval corresponding to each volume in the sound wave track diagram, including:
determining a time interval corresponding to the highest volume in the sound wave track diagram to obtain at least one high volume area of the background music;
determining at least two fluctuation cycles of the background music according to the sound wave track map;
determining at least one rhythm conversion area of the background music according to the at least two fluctuation cycles, wherein each rhythm conversion area is a time interval corresponding to one volume between two adjacent different fluctuation cycles in the at least two fluctuation cycles;
the at least one high volume region and the at least one tempo transition region are determined to be at least one tempo region in the background music.
Optionally, each tempo region comprises a time start and a time end;
segmenting the target video according to the at least one cadence region, including:
and segmenting the target video according to the time starting point and the time ending point which are included in each rhythm area.
Optionally, in the process of playing the background music, playing the at least one first video segment at a first playing frame rate, and playing the at least one second video segment at a second playing frame rate, the playing includes:
in the process of playing the background music, the at least one first video segment is played in reverse order at the first playing frame rate, and the at least one second video segment is played in reverse order at the second playing frame rate.
Optionally, the first play frame rate is greater than the recording frame rate of the target video, and the second play frame rate is less than the recording frame rate of the target video.
All the above optional technical solutions can be combined arbitrarily to form optional embodiments of the present disclosure, and the embodiments of the present disclosure are not described in detail again.
Fig. 2 is a flowchart illustrating a method for playing a video according to an exemplary embodiment, and the present embodiment will explain the embodiment illustrated in fig. 1. The method is applied to a terminal, and as shown in fig. 2, the method comprises the following steps.
In step 201, a sound wave trace diagram of the background music of the target video is determined, wherein the sound wave trace diagram is drawn according to time intervals during which different sound volumes of the background music last.
In order to enhance the effect of video playing, background music can be added to the video, and the background music is played while the video is played. The background music usually has a corresponding sound wave track diagram, and the sound wave track diagram is drawn according to time intervals during which different volumes of the background music last, and can be used for describing the change situation of the volume of the background music along with time. As shown in fig. 3, fig. 3 is an exemplary diagram of a sound wave trace diagram, in which the horizontal direction represents time and the vertical direction represents volume.
In step 202, at least one rhythm area in the background music is determined according to the time interval corresponding to each volume in the sound wave track diagram.
Background music usually includes a plurality of sound volumes, and during the process of playing the background music at each sound volume, the sound volume usually lasts for a period of time, that is, the sound volume corresponds to a time interval, and since the sound wave trace diagram of the background music can describe the change of the sound volume of the background music with time, at least one rhythm area in the background music can be determined according to the time interval corresponding to each sound volume.
In a possible embodiment, a time interval corresponding to the highest volume in the sound wave trace diagram may be determined to obtain at least one high volume region of the background music, at least two fluctuation cycles of the background music may be determined according to the sound wave trace diagram, then at least one rhythm conversion region of the background music may be determined according to the at least two fluctuation cycles, and then the at least one high volume region and the at least one rhythm conversion region may be determined as the at least one rhythm region in the background music. Each rhythm conversion area refers to a time interval corresponding to one sound volume between two adjacent different fluctuation cycles in the at least two fluctuation cycles.
It should be noted that all the volumes included in the sound wave trace diagram may be determined, the highest volume may be determined from all the volumes, and then a time interval corresponding to the highest volume may be determined, so as to obtain at least one high volume region.
In addition, the background music generally includes a plurality of fluctuation cycles, the change rule of the volume in the same fluctuation cycle is the same, the change of the volume in different fluctuation cycles is different, and a time zone corresponding to one volume between two adjacent different fluctuation cycles is a rhythm conversion zone for representing the conversion of the change rule of the volume of the background music. Therefore, at least one rhythm conversion region can be determined by at least two fluctuation periods according to the sound wave locus diagram.
It should be noted that the background music generally corresponds to a plurality of different volumes, and the volumes of the background music played at different times may be different, so that, in addition to the high volume region and the rhythm conversion region included in the rhythm region in the sound wave trajectory diagram, other volume regions in the sound wave trajectory diagram may also be determined. Among them, the volume region other than the rhythm region may be referred to as a flat volume region.
Since the time intervals corresponding to the sound volumes in the sound wave trace diagram are plotted according to the same time length, the time lengths corresponding to all the sound volumes in the background music determined by the sound wave trace diagram are the same, and the time lengths can be preset, for example, 0.5 s.
It should be noted that, when the background music includes only one rhythm region and the rhythm region is a high volume region, the rhythm region may be located at a first volume region of all volume regions or at a last volume region of all volume regions.
In addition, since the rhythm area is a time interval corresponding to the volume, and usually a time interval includes a time start point and a time end point, each rhythm area includes a time start point, i.e., a time point at which the rhythm area starts, and a time end point, i.e., a time point at which the rhythm area ends. As shown in fig. 4, fig. 4 is an exemplary diagram in which the rhythm regions in the sound wave trajectory diagram shown in fig. 3 include two high volume regions and one rhythm conversion region, where P1 and P2 are the two high volume regions, P3 is the rhythm conversion region, and P1, P2, and P3 include a time start point and a time end point, respectively.
In step 203, the target video is segmented according to the at least one rhythm zone to obtain at least one first video segment and at least one second video segment, where the at least one first video segment is a video segment corresponding to the at least one rhythm zone in the target video, and the at least one second video segment is a video segment of the target video other than the at least one first video segment.
Since the background music includes at least one rhythm region, after the at least one rhythm region in the background music is obtained in step 202, the target video may be segmented according to the at least one rhythm region to obtain at least two video segments, where the at least two video segments include at least one first video segment and at least one second video segment, the at least one first video segment is a video segment corresponding to the at least one rhythm region in the target video, and the at least one second video segment is a video segment of the target video other than the at least one first video segment. Since the volume regions of the background music except for the rhythm are called stationary volume regions, and the at least one first video segment corresponds to the at least one rhythm region, the at least one second video segment corresponds to the at least one stationary volume region, that is, the at least one second video segment also refers to the video segment corresponding to the at least one stationary volume region in the target video.
It should be noted that, when the background music includes only one rhythm region and the rhythm region is a high volume region, the rhythm region may be located at a first volume region of all volume regions or at a last volume region of all volume regions. Therefore, in the case where the background music includes only one rhythm region which is a high volume region and which is at the position of the first volume region or the position of the last volume region among all the volume regions, when the target video is segmented by the one rhythm region of the background music, the target video may be divided into two video segments, i.e., a first video segment which is the video segment corresponding to the one rhythm region and a second video segment which is the video segment other than the first video segment.
In a possible embodiment, since each of the rhythm areas includes a time start point and a time end point, when the target video is segmented according to at least one rhythm area, the target video may be segmented according to the time start point and the time end point included in each rhythm area to obtain at least one first video segment and at least one second video segment.
Alternatively, the time start point and the time end point of each cadence area may be segmented as a plurality of division points of the target video. For example, as shown in fig. 5, fig. 5 is an exemplary view of segmenting a target video according to a time start point and a time end point included in a rhythm region, in which a black dot in one line represents the target video, and there are two high-volume regions and a rhythm conversion region in total, a first division point being the time start point of a first high-volume region, a second division point being the time end point of a first high-volume region, a third division point being the time start point of a second high-volume region, a fourth division point being the time end point of a second high-volume region, a fifth division point being the time start point of the rhythm conversion region, and a sixth division point being the time end point of the rhythm conversion region, the target video is divided into five video segments according to the six division points, including three first video segments and two second video segments. In addition, fig. 5 segments the target video only according to the time start point and the time end point included in the rhythm area, but does not adjust the play frame rate, and therefore, the black dots therein are uniformly distributed, which indicates that the target video is played at the normal play frame rate.
In the process of combining music and video, different music is often played in different video segments, so that different video segments need to be distinguished, namely, the video is segmented, however, the video is often manually segmented at present, and the video is inconvenient, so that the method provided by the embodiment of the disclosure can automatically segment the target video according to at least one rhythm region included in the background music, and the inconvenience and the rapidity of manually segmenting the video are solved.
In step 204, during the playing of the background music, the at least one first video segment is played at a first frame rate, and the at least one second video segment is played at a second frame rate, where the first frame rate and the second frame rate are different.
In the process of simultaneously playing background music and video, different music is often required to be played in different video segments, and in order to embody a better visual effect, different video segments can be played at different playing frame rates.
Optionally, after the at least one first video segment and the at least one second video segment are obtained in step 203, the at least one first video segment may be played at a first frame rate, and the at least one second video segment may be played at a second frame rate, where the first frame rate and the second frame rate are different, that is, the first frame rate may be greater than the second frame rate, or may be less than the second frame rate.
It should be noted that the target video is recorded at a certain recording frame rate during recording, and is played at a certain playing frame rate during playing. When the playing frame rate is greater than the recording frame rate, it is equivalent to fast playing the target video, for example, the recording frame rate of the target video is 30 frames/s, and the playing frame rate is 60 frames/s, that is, 30 images are recorded in 1s when the target video is recorded, and 60 images are played in 1s when the target video is played, that is, the video that can be played in 1s originally needs to be played in 0.5s, and obviously, the target video is fast played, that is, fast played. When the playing frame rate is less than the recording frame rate, it is equivalent to slow playing the target video, for example, the recording frame rate of the target video is 120 frames/s, and the playing frame rate is 30 frames/s, that is, 120 images are recorded in 1s while the target video is recorded, and only 30 images are played in 1s while the target video is played, that is, the video that can be played in 1s originally needs 4s to be played, obviously, the target video is slowly played, that is, the target video is slowly played. In the process of slowly playing the target video, when the playing frame rate is smaller than the normal playing frame rate, the target video may be jammed, and the normal playing frame rate may be 24 frames/s.
Therefore, when the first playing frame rate is greater than the recording frame rate of the target video and the second playing frame rate is less than the recording frame rate of the target video, it means that the at least one first video segment is played fast and the at least one second video segment is played slowly. When the first playing frame rate is smaller than the recording frame rate of the target video and the second playing frame rate is larger than the recording frame rate of the target video, the slow playing of the at least one first video segment is indicated, and the fast playing of the at least one second video segment is indicated. As shown in fig. 6, fig. 6 is an exemplary diagram of fast playing three first video segments and slow playing two second video segments in fig. 5, wherein the density of black dots representing the first video segments in a row of black dots indicates that the first video segments are fast played, and the density of black dots representing the second video segments is loose, indicates that the second video segments are slow played.
Note that, in general, the rhythm region of the background music represents a climax part or a turning part of the background music, and the flat volume region of the background music represents a flat part of the background music. Therefore, in order to improve the audio visual effect of simultaneously playing the background music and the target video, when the background music and the target video are simultaneously played, the first video segment corresponding to the rhythm area of the background music can be played quickly, and the second video segment corresponding to the stable volume area of the background music can be played slowly. Of course, the first video segment corresponding to the rhythm region of the background music may be slowly played, and the second video segment corresponding to the steady volume region of the background music may be quickly played.
In another possible embodiment, at least one first video segment can be played at different frame rates, and at least one second video segment can be played at different frame rates.
In addition, in order to further improve the audiovisual effect of simultaneously playing the background music and the target video, during the process of playing the background music, the target video may also be played in reverse order, that is, the at least one first video segment is played in reverse order at the first playing frame rate, and the at least one second video segment is played in reverse order at the second playing frame rate. As shown in fig. 7, fig. 7 is an exemplary diagram of playing a target video in reverse order.
In the embodiment of the present disclosure, at least one rhythm region in the background music of the target video is determined, and the target video is segmented according to the at least one rhythm region, so as to obtain at least one first video segment and at least one second video segment, that is, the target video may be automatically segmented according to the background music. Then, in the process of playing the background music, the at least one first video segment can be played at the first playing frame rate, and the at least one second video segment can be played at the second playing frame rate. Because the first play frame rate and the second play frame rate are different, the method provided by the embodiment of the disclosure can automatically adjust the play frame rate of the video and automatically match and play the music and the video.
Fig. 8 is a block diagram illustrating a video playback device 800 according to an exemplary embodiment. As shown in fig. 8, the apparatus includes a determination module 801, a segmentation module 802, and a playback module 803.
A determining module 801, configured to determine at least one rhythm area in the background music of the target video, where the at least one rhythm area is determined by a time interval during which each volume in the background music lasts;
a segmenting module 802, configured to segment the target video according to the at least one rhythm zone to obtain at least one first video segment and at least one second video segment, where the at least one first video segment is a video segment corresponding to the at least one rhythm zone in the target video, and the at least one second video segment is a video segment of the target video other than the at least one first video segment;
the playing module 803 is configured to play the at least one first video segment at a first playing frame rate and play the at least one second video segment at a second playing frame rate during the process of playing the background music, where the first playing frame rate is different from the second playing frame rate.
Optionally, the determining module 801 includes:
the first determining submodule is used for determining a sound wave track graph of background music of the target video, and the sound wave track graph is obtained by drawing according to time intervals during which different volumes of the background music last;
and the second determining submodule is used for determining at least one rhythm area in the background music according to the time interval corresponding to each volume in the sound wave track diagram.
Optionally, the second determining sub-module includes:
the first determining unit is used for determining a time interval corresponding to the highest volume in the sound wave locus diagram so as to obtain at least one high volume area of the background music;
a second determining unit, configured to determine at least two fluctuation cycles of the background music according to the sound wave trace diagram;
a third determining unit, configured to determine at least one rhythm conversion region of the background music according to the at least two fluctuation cycles, where each rhythm conversion region is a time interval corresponding to a volume between two adjacent different fluctuation cycles in the at least two fluctuation cycles;
a fourth determination unit for determining the at least one high volume region and the at least one tempo transition region as the at least one tempo region in the background music.
Optionally, each tempo region comprises a time start and a time end;
the segmentation module 802 includes:
and the segmenting submodule is used for segmenting the target video according to the time starting point and the time ending point included in each rhythm area.
Optionally, the playing module 803 includes:
and the playing submodule is used for playing the at least one first video segment in the reverse order at the first playing frame rate and playing the at least one second video segment in the reverse order at the second playing frame rate in the process of playing the background music.
Optionally, the first play frame rate is greater than the recording frame rate of the target video, and the second play frame rate is less than the recording frame rate of the target video.
In the embodiment of the present disclosure, at least one rhythm region in the background music of the target video is determined, and the target video is segmented according to the at least one rhythm region, so as to obtain at least one first video segment and at least one second video segment, that is, the target video may be automatically segmented according to the background music. Then, in the process of playing the background music, the at least one first video segment can be played at the first playing frame rate, and the at least one second video segment can be played at the second playing frame rate. Because the first play frame rate and the second play frame rate are different, the method provided by the embodiment of the disclosure can automatically adjust the play frame rate of the video and automatically match and play the music and the video.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 9 is a block diagram illustrating an apparatus 900 for playback of a video according to an example embodiment. For example, the apparatus 900 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 9, apparatus 900 may include one or more of the following components: processing component 902, memory 904, power component 906, multimedia component 908, audio component 910, input/output (I/O) interface 912, sensor component 914, and communication component 916.
The processing component 902 generally controls overall operation of the device 900, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. Processing component 902 may include one or more processors 920 to execute instructions to perform all or a portion of the steps of the methods described above. Further, processing component 902 can include one or more modules that facilitate interaction between processing component 902 and other components. For example, the processing component 902 can include a multimedia module to facilitate interaction between the multimedia component 908 and the processing component 902.
The memory 904 is configured to store various types of data to support operation at the apparatus 900. Examples of such data include instructions for any application or method operating on device 900, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 904 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 906 provides power to the various components of the device 900. The power components 906 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power supplies for the device 900.
The multimedia component 908 comprises a screen providing an output interface between the device 900 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 908 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the device 900 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 910 is configured to output and/or input audio signals. For example, audio component 910 includes a Microphone (MIC) configured to receive external audio signals when apparatus 900 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 904 or transmitted via the communication component 916. In some embodiments, audio component 910 also includes a speaker for outputting audio signals.
I/O interface 912 provides an interface between processing component 902 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor component 914 includes one or more sensors for providing status assessment of various aspects of the apparatus 900. For example, sensor assembly 914 may detect an open/closed state of device 900, the relative positioning of components, such as a display and keypad of device 900, the change in position of device 900 or a component of device 900, the presence or absence of user contact with device 900, the orientation or acceleration/deceleration of device 900, and the change in temperature of device 900. The sensor assembly 914 may include a proximity sensor configured to detect the presence of a nearby object in the absence of any physical contact. The sensor assembly 914 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 914 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 916 is configured to facilitate communications between the apparatus 900 and other devices in a wired or wireless manner. The apparatus 900 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 916 receives a broadcast signal or broadcast associated information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 916 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 900 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the methods provided by the embodiments shown in fig. 1 or fig. 2 and described above.
In an exemplary embodiment, a non-transitory computer readable storage medium comprising instructions, such as the memory 904 comprising instructions, executable by the processor 920 of the apparatus 900 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
A non-transitory computer-readable storage medium, in which instructions, when executed by a processor of a terminal, enable the terminal to perform a method of playing a video.
A computer program product containing instructions which, when executed by a processor of a terminal, enable the terminal to perform the above-described playing method of the video in fig. 1 and 2.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (8)

1. A method for playing a video, the method comprising:
determining a sound wave track graph of background music of a target video, wherein the sound wave track graph is obtained by drawing according to time intervals of different volumes of the background music;
determining a time interval corresponding to the highest volume in the sound wave locus diagram to obtain at least one high volume area of the background music;
determining at least two fluctuation cycles of the background music according to the sound wave track map;
determining at least one rhythm conversion area of the background music according to the at least two fluctuation cycles, wherein each rhythm conversion area is a time interval corresponding to one volume between two adjacent different fluctuation cycles in the at least two fluctuation cycles;
determining the at least one high volume region and the at least one rhythm conversion region as at least one rhythm region in the background music, wherein the volume regions except the at least one rhythm region in the background music are stable volume regions;
segmenting the target video according to the at least one rhythm area to obtain at least one first video segment and at least one second video segment, wherein the at least one first video segment is a video segment corresponding to the at least one rhythm area in the target video, and the at least one second video segment is a video segment corresponding to at least one stable volume area in the target video;
and in the process of playing the background music, playing the at least one first video segment at a first playing frame rate, and playing the at least one second video segment at a second playing frame rate, wherein the first playing frame rate is greater than the recording frame rate of the target video, and the second playing frame rate is less than the recording frame rate of the target video.
2. The method of claim 1, wherein each cadence region includes a time start and a time end;
the segmenting the target video according to the at least one cadence region includes:
and segmenting the target video according to the time starting point and the time ending point included by each rhythm area.
3. The method of claim 1, wherein said playing said at least one first video segment at a first frame rate and said at least one second video segment at a second frame rate during said playing of said background music comprises:
and in the process of playing the background music, playing the at least one first video segment in a reverse order at the first playing frame rate, and playing the at least one second video segment in a reverse order at the second playing frame rate.
4. A video playback apparatus, comprising:
the determining module is used for determining a sound wave track graph of background music of the target video, wherein the sound wave track graph is obtained by drawing according to time intervals during which different volumes of the background music last; determining a time interval corresponding to the highest volume in the sound wave locus diagram to obtain at least one high volume area of the background music; determining at least two fluctuation cycles of the background music according to the sound wave track map; determining at least one rhythm conversion area of the background music according to the at least two fluctuation cycles, wherein each rhythm conversion area is a time interval corresponding to one volume between two adjacent different fluctuation cycles in the at least two fluctuation cycles; determining the at least one high volume region and the at least one rhythm conversion region as at least one rhythm region in the background music, wherein the volume regions except the at least one rhythm region in the background music are stable volume regions;
a segmentation module, configured to segment the target video according to the at least one rhythm area to obtain at least one first video segment and at least one second video segment, where the at least one first video segment is a video segment corresponding to the at least one rhythm area in the target video, and the at least one second video segment is a video segment corresponding to at least one stable volume area in the target video;
and the playing module is used for playing the at least one first video segment at a first playing frame rate and playing the at least one second video segment at a second playing frame rate in the process of playing the background music, wherein the first playing frame rate is greater than the recording frame rate of the target video, and the second playing frame rate is less than the recording frame rate of the target video.
5. The apparatus of claim 4, wherein each cadence region includes a time start and a time end;
the segmentation module comprises:
and the segmenting submodule is used for segmenting the target video according to the time starting point and the time ending point included in each rhythm area.
6. The apparatus of claim 4, wherein the play module comprises:
and the playing sub-module is used for playing the at least one first video segment in the reverse order at the first playing frame rate and playing the at least one second video segment in the reverse order at the second playing frame rate in the process of playing the background music.
7. A video playback apparatus, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to perform the steps of any of the methods of claims 1-3.
8. A computer-readable storage medium having instructions stored thereon, wherein the instructions, when executed by a processor, implement the steps of any of the methods of claims 1-3.
CN201810540936.1A 2018-05-30 2018-05-30 Video playing method and device and computer readable storage medium Active CN108769769B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810540936.1A CN108769769B (en) 2018-05-30 2018-05-30 Video playing method and device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810540936.1A CN108769769B (en) 2018-05-30 2018-05-30 Video playing method and device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN108769769A CN108769769A (en) 2018-11-06
CN108769769B true CN108769769B (en) 2020-11-27

Family

ID=64004493

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810540936.1A Active CN108769769B (en) 2018-05-30 2018-05-30 Video playing method and device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN108769769B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109640170B (en) * 2018-12-04 2021-02-19 广东力昂电子科技有限公司 Speed processing method of self-shooting video, terminal and storage medium
CN109743628A (en) * 2019-01-10 2019-05-10 四川长虹电器股份有限公司 A kind of method that IP set-top box promotes video on live smoothness
CN112044053B (en) * 2020-09-03 2022-05-17 腾讯科技(深圳)有限公司 Information processing method, device, equipment and storage medium in virtual scene
CN114286191A (en) * 2021-12-09 2022-04-05 华特数字科技有限公司 Method and system for playing webpage video in cloud desktop

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007096691A2 (en) * 2006-02-21 2007-08-30 Nokia Corporation Generating a representation of a dancer dancing to music
CN101640057A (en) * 2009-05-31 2010-02-03 北京中星微电子有限公司 Audio and video matching method and device therefor
CN101650722B (en) * 2009-06-01 2011-10-26 南京理工大学 Method based on audio/video combination for detecting highlight events in football video
CN101577114B (en) * 2009-06-18 2012-01-25 无锡中星微电子有限公司 Method and device for implementing audio visualization
CN104103300A (en) * 2014-07-04 2014-10-15 厦门美图之家科技有限公司 Method for automatically processing video according to music beats

Also Published As

Publication number Publication date
CN108769769A (en) 2018-11-06

Similar Documents

Publication Publication Date Title
CN107105314B (en) Video playing method and device
CN106911961B (en) Multimedia data playing method and device
CN108769769B (en) Video playing method and device and computer readable storage medium
CN106559712B (en) Video playing processing method and device and terminal equipment
US10212386B2 (en) Method, device, terminal device, and storage medium for video effect processing
CN110602394A (en) Video shooting method and device and electronic equipment
CN107743244B (en) Video live broadcasting method and device
CN107888984B (en) Short video playing method and device
US11545188B2 (en) Video processing method, video playing method, devices and storage medium
CN104639977B (en) The method and device that program plays
US20170034336A1 (en) Event prompting method and device
CN106095300B (en) Method and device for adjusting playing progress
CN110636383A (en) Video playing method and device, electronic equipment and storage medium
US20220256230A1 (en) Method and apparatus for video playing
CN106454540B (en) Method and device for processing interactive information based on live broadcast
CN112685599A (en) Video recommendation method and device
CN105635573B (en) Camera visual angle regulating method and device
CN112445348A (en) Expression processing method, device and medium
CN110636377A (en) Video processing method, device, storage medium, terminal and server
CN110809184A (en) Video processing method, device and storage medium
CN106060253B (en) Information presentation method and device
CN108769780B (en) Advertisement playing method and device
CN114125528B (en) Video special effect processing method and device, electronic equipment and storage medium
CN111880602B (en) Dropped frame detection method and device
CN112866612A (en) Frame insertion method, device, terminal and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant