Search

EP-4007287-B1 - VIDEO PROCESSING METHOD, DEVICE, TERMINAL, AND STORAGE MEDIUM

EP4007287B1EP 4007287 B1EP4007287 B1EP 4007287B1EP-4007287-B1

Inventors

  • FENG, Zhongjian

Dates

Publication Date
20260506
Application Date
20200721

Claims (13)

  1. A method for processing a video, comprising: superimposing (S101; S203) a transparent canvas image layer on a video playback window, wherein the video playback window is a window corresponding to a video player of a browser; acquiring (S102; S204) a first image by capturing images from a video played in the video playback window in response to acquiring a drawn specified region to be enlarged and displayed in the video playback window; acquiring (S103; S205) a second image by clipping the first image based on the specified region, wherein the second image comprises the specified region; and enlarging and displaying (S104; S206) the second image on the transparent canvas image layer; wherein acquiring the first image by capturing images from the video played in the video playback window comprises: acquiring one first image by capturing images from the video for every preset time period; acquiring the second image by clipping the first image based on the specified region comprises: acquiring, each time one first image is acquired, one second image by clipping the one first image currently acquired based on the specified region; and enlarging and displaying the second image on the transparent canvas image layer comprises: updating, each time one second image is acquired, the second image currently displayed on the transparent canvas image layer to the one second image currently acquired or keeping the second image currently displayed unchanged, based on the one second image currently acquired.
  2. The method according to claim 1, wherein updating the second image currently displayed on the transparent canvas image layer to the second image currently acquired or keeping the second image currently displayed unchanged, based on the second image currently acquired comprises: acquiring a similarity degree between the second image currently acquired and the second image currently displayed; and updating the second image currently displayed to the second image currently acquired in the case that the similarity degree is less than a preset threshold; or keeping the second image currently displayed unchanged in the case that the similarity degree is greater than or equal to the preset threshold.
  3. The method according to claim 1, wherein prior to superimposing the transparent canvas image layer on the video playback window, the method further comprises: enabling (S202) an enlarging function in response to receiving an enabling instruction of the enlarging function, wherein the enlarging function is configured to enlarge and display any region of the video in the video playback window.
  4. The method according to claim 1, wherein upon enlarging and displaying the second image on the transparent canvas image layer, the method further comprises: disabling an enlarging function in response to receiving a disabling instruction of the enlarging function, wherein the enlarging function is configured to enlarge and display any region of the video in the video playback window; and deleting the transparent canvas image layer.
  5. The method according to claim 1, wherein prior to superimposing the transparent canvas image layer on the video playback window, the method further comprises: playing (S201) the video in the video playback window over the video player of the browser.
  6. The method according to claim 1, wherein a size of the transparent canvas image layer is equal to a size of the video playback window, and a displayed size of the second image is equal to the size of the transparent canvas image layer.
  7. An apparatus for processing a video, comprising: a superimposing module (601), configured to superimpose a transparent canvas image layer on a video playback window, wherein the video playback window is a window corresponding to a video player of a browser; an image capturing module (602), configured to acquire a first image by capturing images from a video played in the video playback window in response to acquiring a drawn specified region to be enlarged and displayed in the video playback window; a clipping module (603), configured to acquire a second image by clipping the first image based on the specified region, wherein the second image comprises the specified region; and a displaying module (604), configured to enlarge and display the second image on the transparent canvas image layer; wherein the image capturing module (602) is configured to acquire one first image by capturing images from the video for every preset time period; the clipping module (603) is configured to acquire, each time one first image is acquired, one second image by clipping the one first image currently acquired based on the specified region; and the displaying module (604) is configured to update, each time one second image is acquired, the second image currently displayed on the transparent canvas image layer to the one second image currently acquired or keep the second image currently displayed unchanged, based on the one second image currently acquired.
  8. The apparatus according to claim 7, wherein the displaying module is configured to: acquire a similarity degree between the second image currently acquired and the second image currently displayed; and update the second image currently displayed to the second image currently acquired in the case that the similarity degree is less than a preset threshold; or keep the second image currently displayed unchanged in the case that the similarity degree is greater than or equal to the preset threshold.
  9. The apparatus according to claim 7, further comprising: a playing module, configured to play the video in the video playback window over the video player of the browser.
  10. The apparatus according to claim 7, further comprising: an enabling module, configured to enable an enlarging function in response to receiving an enabling instruction of the enlarging function, wherein the enlarging function is configured to enlarge and display any region of the video in the video playback window.
  11. The apparatus according to claim 7, further comprising: a disabling module, configured to disable an enlarging function in response to receiving a disabling instruction of the enlarging function, wherein the enlarging function is configured to enlarge and display any region of the video in the video playback window; and a deleting module, configured to delete the transparent canvas image layer.
  12. The apparatus according to claim 7, wherein a size of the transparent canvas image layer is equal to a size of the video playback window, and a displayed size of the second image is equal to the size of the transparent canvas image layer.
  13. A non-transitory storage medium storing at least one instruction, wherein the at least one instruction, when executed by a processor (701; 801), causes the processor (701; 801) to perform the method for processing the video as defined in any one of claims 1 to 6.

Description

TECHNICAL FIELD The present disclosure relates to the field of video processing technologies, and in particular, relates to a method and an apparatus for processing a video, and a storage medium. BACKGROUND With the development of browsers, more and more users watch videos over the browsers. In the process of watching videos, the users may have to enlarge and display partial regions of a video image, and thus a method for processing a video is urgently desired. US20120017142A1 discloses an information processing apparatus, a processing method of the same, and a non-transitory computer-readable storage medium. CN108008991A discloses an image processing method, a terminal and a computer-readable storage medium. SUMMARY Embodiments of the present disclosure provide a method and apparatus for processing a video, and a storage medium. The technical solutions of the present disclosure are as follows. According to a first aspect of the present invention, there is provided a method for processing a video. The method includes: superimposing a transparent canvas image layer on a video playback window, wherein the video playback window is a window corresponding to a video player of a browser;acquiring a first image by capturing images from a video played in the video playback window in response to acquiring a drawn specified region to be enlarged and displayed in the video playback window;acquiring a second image by clipping the first image based on the specified region, wherein the second image includes the specified region; andenlarging and displaying the second image on the transparent canvas image layer;wherein acquiring the first image by capturing images from the video played in the video playback window includes: acquiring one first image by capturing images from the video for every preset time period;acquiring the second image by clipping the first image based on the specified region includes: acquiring, each time one first image is acquired, one second image by clipping the one first image currently acquired based on the specified region; andenlarging and displaying the second image on the transparent canvas image layer includes: updating, each time one second image is acquired, the second image currently displayed on the transparent canvas image layer to the one second image currently acquired or keeping the second image currently displayed unchanged, based on the one second image currently acquired. In a possible embodiment, updating the second image currently displayed on the transparent canvas image layer to the second image currently acquired or keeping the second image currently displayed unchanged, based on the currently acquired second image includes: acquiring a similarity degree between the second image currently acquired and the second image currently displayed; andupdating the second image currently displayed to the second image currently acquired in the case that the similarity degree is less than a preset threshold; orkeeping the second image currently displayed unchanged in the case that the similarity degree is greater than or equal to the preset threshold. In a possible embodiment, prior to superimposing the transparent canvas image layer on the video playback window, the method further includes: enabling an enlarging function in response to receiving an enabling instruction of the enlarging function, wherein the enlarging function is configured to enlarge and display any region of the video in the video playback window. In a possible embodiment, upon enlarging and displaying the second image on the transparent canvas image layer, the method further includes: disabling an enlarging function in response to receiving a disabling instruction of the enlarging function, wherein the enlarging function is configured to enlarge and display any region of the video in the video playback window; anddeleting the transparent canvas image layer. In a possible embodiment, prior to superimposing the transparent canvas image layer on the video playback window, the method further includes: playing the video in the video playback window over the video player of the browser. In a possible embodiment, a size of the transparent canvas image layer is equal to a size of the video playback window, and a displayed size of the second image is equal to the size of the transparent canvas image layer. According to a second aspect of the present invention, there is provided an apparatus for processing a video is provided. The apparatus includes: a superimposing module, configured to superimpose a transparent canvas image layer on a video playback window, wherein the video playback window is a window corresponding to a video player of a browser;an image capturing module, configured to acquire a first image by capturing images from a video played in the video playback window in response to acquiring a drawn specified region to be enlarged and displayed in the video playback window;a clipping module, configured to acquire a s