Search

EP-4207784-B1 - PLAYBACK CONTROL METHOD AND DEVICE

EP4207784B1EP 4207784 B1EP4207784 B1EP 4207784B1EP-4207784-B1

Inventors

  • HE, Zhe

Dates

Publication Date
20260506
Application Date
20210923

Claims (9)

  1. A computer-implemented playback control method, comprising: receiving (202, 402) a playback rate control instruction submitted by setting control points on a multimedia resource processing interface by a user for a to-be-processed multimedia resource, wherein the control points are used to control a playback rate of a corresponding resource frame in the to-be-processed multimedia resource; obtaining location coordinates of any two adjacent control points carried in the playback rate control instruction in a location coordinate system established on the multimedia resource processing interface, wherein the location coordinates represent locations of the any two adjacent control points on the multimedia resource processing interface; determining (202) playback control coordinates of the any two adjacent control points in a plane rectangular coordinate system, comprising: performing coordinate conversion on the location coordinates of the any two adjacent control points to convert the location coordinates of the any two adjacent control points in the location coordinate system established on the multimedia resource processing interface into the playback control coordinates of the any two adjacent control points in the plane rectangular coordinate system, wherein a horizontal coordinate of the playback control coordinates represents time and a vertical coordinate of the playback control coordinates represents a playback rate of the respective control point; calculating (204) playback control coordinates of a preset quantity of virtual control points between the any two adjacent control points based on the playback control coordinates of the any two adjacent control points, comprising: calculating a horizontal coordinate of a first virtual control point located between a first control point and a second control point of the any two adjacent control points based on a difference between horizontal coordinates of the playback control coordinates of the second control point and the first control point, and determining a vertical coordinate of the first virtual control point based on a vertical coordinate of the playback control coordinates of the first control point; and calculating a horizontal coordinate of a second virtual control point located between the first control point and the second control point based on the difference between the horizontal coordinates of the playback control coordinates of the second control point and the first control point, and determining a vertical coordinate of the second virtual control point based on a vertical coordinate of the playback control coordinates of the second control point; and determining (206) the any two adjacent control points respectively as a start point and an end point, and drawing a playback rate curve of a multimedia resource segment between the any two adjacent control points based on the start point, the end point, and the playback control coordinates of the preset quantity of virtual control points, wherein the preset quantity of virtual control points are used to control a shape path of the playback rate curve, wherein drawing the playback rate curve of the multimedia resource segment between the any two adjacent control points based on the start point, the end point, and the playback control coordinates of the preset quantity of virtual control points comprises: drawing, based on the start point, the end point, and the playback control coordinates of the preset quantity of virtual control points, a Bézier curve corresponding to the multimedia resource segment between the any two adjacent control points, which comprises: substituting (422) the playback control coordinates of the any two adjacent control points and the preset quantity of virtual control points between the any two adjacent control points into a third-order Bézier curve function, to obtain the Bézier curve corresponding to the multimedia resource segment between the any two adjacent control points; and splicing and displaying each Bézier curve.
  2. The playback control method according to claim 1, wherein determining (202) the playback control coordinates of the any two adjacent control points in the plane rectangular system comprises: establishing (406) the plane rectangular coordinate system with a lower boundary of the multimedia resource processing interface as a horizontal axis and a straight line that is perpendicular to the horizontal axis and passes through the first control point of the any two adjacent control points as a vertical axis; determining (408) playback control coordinates of the first control point in the plane rectangular coordinate system, and determining (410) a coordinate conversion relationship of a control point based on location coordinates and the playback control coordinates of the first control point; and calculating (412) playback control coordinates of a second control point of the any two adjacent control points based on the coordinate conversion relationship and location coordinates of the second control point.
  3. The playback control method according to any one of claims 1 to 2, wherein the playback control coordinates of the first virtual control point are determined by: calculating a difference between horizontal coordinates of the playback control coordinates of the second control point and the first control point; and calculating a product of a first preset ratio threshold and the difference as a horizontal coordinate of the first virtual control point, and determining a vertical coordinate of the playback control coordinates of the first control point as a vertical coordinate of the first virtual control point.
  4. The playback control method according to any one of claims 1 to 3, wherein the playback control coordinates of the second virtual control point are determined by: calculating a product of a second preset ratio threshold and the difference as a horizontal coordinate of the second virtual control point, and determining a vertical coordinate of the playback control coordinates of the second control point as a vertical coordinate of the second virtual control point.
  5. A playback control apparatus, comprising: a receiving means (502), configured to: receive a playback rate control instruction submitted by setting control points on a multimedia resource processing interface by a user for a to-be-processed multimedia resource, wherein the control points are used to control a playback rate of a corresponding resource frame in the to-be-processed multimedia resource; obtain location coordinates of any two adjacent control points carried in the playback rate control instruction in a location coordinate system established on the multimedia resource processing interface, wherein the location coordinates represent locations of the any two adjacent control points on the multimedia resource processing interface; and determine playback control coordinates of the any two adjacent control points in a plane rectangular coordinate system, comprising: performing coordinate conversion on the location coordinates of the any two adjacent control points to convert the location coordinates of the any two adjacent control points in the location coordinate system established on the multimedia resource processing interface into the playback control coordinates of the any two adjacent control points in the plane rectangular coordinate system, wherein a horizontal coordinate of the playback control coordinates represents time and a vertical coordinate of the playback control coordinates represents a playback rate of the respective control point; a calculation means (504), configured to calculate playback control coordinates of a preset quantity of virtual control points between the any two adjacent control points based on the playback control coordinates of the any two adjacent control points, comprising: calculating a horizontal coordinate of a first virtual control point located between a first control point and a second control point of the any two adjacent control points based on a difference between horizontal coordinates of the playback control coordinates of the second control point and the first control point, and determining a vertical coordinate of the first virtual control point based on a vertical coordinate of the playback control coordinates of the first control point; and calculating a horizontal coordinate of a second virtual control point located between the first control point and the second control point based on the difference between the horizontal coordinates of the playback control coordinates of the second control point and the first control point, and determining a vertical coordinate of the second virtual control point based on a vertical coordinate of the playback control coordinates of the second control point; and a drawing means (506), configured to determine the any two adjacent control points respectively as a start point and an end point, and draw a playback rate curve of a multimedia resource segment between the any two adjacent control points based on the start point, the end point, and the playback control coordinates of the preset quantity of virtual control points, wherein the preset quantity of virtual control points are used to control a shape path of the playback rate curve, wherein drawing the playback rate curve of the multimedia resource segment between the any two adjacent control points based on the start point, the end point, and the playback control coordinates of the preset quantity of virtual control points comprises: drawing, based on the start point, the end point, and the playback control coordinates of the preset quantity of virtual control points, a Bézier curve corresponding to the multimedia resource segment between the any two adjacent control points, which comprises: substituting (422) the playback control coordinates of the any two adjacent control points and the preset quantity of virtual control points between the any two adjacent control points into a third-order Bézier curve function, to obtain the Bézier curve corresponding to the multimedia resource segment between the any two adjacent control points; and splicing and displaying each Bézier curve.
  6. The playback control apparatus according to claim 5, wherein the receiving means further comprises: a coordinate system establishment sub-means, configured establish the plane rectangular coordinate system with a lower boundary of the multimedia resource processing interface as a horizontal axis and a straight line that is perpendicular to the horizontal axis and passes through the first control point of the any two adjacent control points as a vertical axis; a conversion relationship determining sub-means, configured to determine playback control coordinates of the first control point in the plane rectangular coordinate system, and determine a coordinate conversion relationship of a control point based on location coordinates and the playback control coordinates of the first control point; and a calculation sub-means, configured to calculate playback control coordinates of a second control point of the any two adjacent control points based on the coordinate conversion relationship and location coordinates of the second control point.
  7. The playback control apparatus according to claim 5, wherein the means comprises: at least one processor; and at least one memory comprising computer program code, the at least one memory and computer program code configured to, with the at least one processor, cause the performance of the playback control apparatus.
  8. A computer-readable storage medium storing computer instructions, wherein the computer instructions, when executed by a processor, cause the processor to perform the playback control method according to claims 1 to 4.
  9. A computer program product comprising computer instructions, wherein the computer instructions, when executed by a processor, cause the processor to perform the playback control method according to any one of claims 1 to 4.

Description

TECHNICAL FIELD Embodiments of this application relate to the field of computer technologies, and in particular, to a playback control method, a playback control apparatus, a computer-readable storage medium, and a computer program product. BACKGROUND With increasing in user requirements and development of media technologies, a quantity of videos increases exponentially. Because features of the videos such as timeliness and diversity meet user experience during video watching, more and more video processing applications emerge accordingly. Currently, most intelligent terminals have a touchscreen for interaction with a user. Based on the touchscreen, a user can not only implement a tap-touch operation, for example, enable an application by tapping an icon of the application, but also perform operations such as video clipping. However, in a conventional video clipping process, a user may control a playback rate of a video by dragging a pointer on a curve variable speed panel of a terminal. In this process, the terminal needs to dynamically inversely calculate a real-time rate of the video based on a timestamp corresponding to the pointer, to control a point insertion operation and display of the playback rate. Usually, each time the pointer is dragged, thousands of step-by-step iterations are required to approximately calculate a playback rate of a corresponding video frame or video segment. In this processing manner, calculation load is high. In a real-time response scenario of fast dragging the pointer, calculation through large step-by-step iterations requires high performance of the terminal, which easily causes frame freezing of the terminal. US 2010/275121 A1 describes the application of speed effects to a video presentation. Each keyframe of the video has inbez and outbez knobs. By changing the position of these knobs, the editor can change the shape of the speed bar. For example, the editor can add to the curvature of the speed bar about the keyframe by moving the outbez knob down and/or moving the inbez knob up. The inbez and outbez knobs of the keyframes are used to generate a speed bar with smooth curves. In other words, the inbez and outbez values along with the coordinates of the keyframes are plugged into a standard mathematical expression for drawing a bezier curve, and the solution for this expression provides the smooth shape of the speed bar. CN101763439B describes a video playback rate adjustment method based on a connection line. The video playback rate adjustment method based on connecting lines drags the control points of the connecting lines between different sketch nodes to change the shape of the connecting curve, thereby achieving the purpose of controlling the playback speed of the video clip, and different playback rates can be set for different areas. The connection lines connecting the sketch nodes are divided into several segments, each of which is an independent Bezier curve representing a shot. P0 and P1 are the two endpoints of a Bezier curve and C1 is a control point of the curve. The curve is initially a straight line, and the initial position of the control point C1 is the midpoint of the line segment. When the control point is dragged, the shape of the corresponding curve changes, and the playback speed of the shot corresponding to the curve changes with the shape of the curve. US 2013/163962 A1 describes a method for generating transitions for remapping video playback time including providing a user interface for a digital video editing system, the user interface comprising a variable rate speed control configured to define associated keyframe elements comprising a begin element, an end element and an intermediate time element; receiving, through the variable rate speed control, input defining at least one of the keyframe elements in relation to a sequence of digital video associated with a playback time; based on the received input, generating a time transition function between the begin element and the end element using the intermediate time element, wherein the time transition function maintains predefined speed for video frames leading into the begin element, maintains predefined speed for video frames leading away from the end element, and changes video speed from a begin speed value associated with the begin element to an end speed value associated with the end element in accordance with one or more values associated with the intermediate time element; and remapping the playback time of the sequence of digital video based on the generated time transition function SUMMARY In view of this, an embodiment of this application provides a playback control method. One or more embodiments of this application relate to a playback control apparatus, a computer-readable storage medium, and a computer program product, to resolve a possible technical disadvantage of frame freezing of a device in a conventional technology due to that in a real-time response scenario of fast dragg