Video playback detection method, device and electronic equipment
By acquiring and framed video recording, and using brightness changes to identify the first frame image, the problem of low testing efficiency of existing video playback performance indicators is solved, and the effect of simplifying the test process and improving efficiency is achieved.
Patent Information
- Application Number
- CN202110061115.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-18
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2041-01-18
AI Technical Summary
The existing test scheme for video playback performance indicators has the problem of low testing efficiency, especially the process of obtaining first-frame image feature prediction and dynamic link library of videos is cumbersome and labor-consuming.
By acquiring the target recorded video, multiple frame images are obtained in frames, the first frame image is identified using the brightness change amplitude value, and the video playback start time is calculated, which simplifies the testing process and reduces the dependence on video application code.
It improves the efficiency of video playback detection, simplifies the testing process, and allows non-technical testers to perform tests, improving overall testing efficiency.
Smart Images

Figure CN114827712B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a video playback detection method, device and electronic equipment. Background Art
[0002] As we all know, the start-up time of video playback, that is, the time it takes for the video to be played from the time the playback is triggered to the time the first frame image of the video is displayed, is one of the important performance indicators for measuring playback video applications. In some existing solutions, the first frame image of the video needs to be determined in advance. The first frame image features of the target video, that is, every time the target video source changes, the first frame image features need to be re-acquired. Another solution is to use a dynamic link library to obtain the video rendering process, but this solution must establish a target dynamic library embedded in the target folder and generate a new target application, that is, the tester must have the application code. The above test solution has a cumbersome test process and consumes manpower and time, resulting in low test efficiency. Summary of the invention
[0003] The purpose of the present invention is to provide a video playback detection method, device and electronic equipment, which are used to solve the problem of low test efficiency in existing video playback performance index testing solutions.
[0004] In order to achieve the above object, the present invention provides a video playback detection method, comprising:
[0005] Acquire a target recorded video, where the target recorded video is a target video segment including a first image and a first frame image of a first video, where the first image is a frame image corresponding to when the first video is triggered to play;
[0006] Dividing the target recorded video into frames to obtain continuous multiple frame images;
[0007] According to the multiple frames of images, the first image and the first frame of image are identified, wherein the first frame of image is determined based on the brightness change amplitude between adjacent frames of image of the multiple frames of image;
[0008] Determine a time interval between the first image and the first frame image, and use the time interval as a video playback start duration for the first video.
[0009] Wherein, obtaining the target recorded video includes:
[0010] After starting screen recording, triggering the playback of the first video;
[0011] When the recording time reaches the preset time, the screen recording stops and the recorded video is saved as the target recorded video.
[0012] The step of dividing the target recorded video into frames to obtain a continuous plurality of frames of images includes:
[0013] Obtaining the screen recording frame rate of the target recorded video;
[0014] The target recorded video is cropped, and the video content in the video playback area is saved as the cropped recorded video;
[0015] The cropped recorded video is divided into frames according to the screen recording frame rate to obtain continuous multiple frame images.
[0016] The step of identifying the first image according to the multiple frames of images includes:
[0017] According to the time sequence in which the multiple frames of images are displayed during video playback, the multiple frames of images are traversed to perform image recognition;
[0018] When it is identified that the current frame image has a preset image feature that triggers the playing of the first video, the current frame image is determined to be the first image.
[0019] Wherein, identifying the first frame image according to the multiple frames of images includes:
[0020] After identifying the first image, traverse the frame images after the first image to extract the brightness component, and obtain the brightness mean value of the i-th frame image and the brightness mean value of the i+1-th frame image in the frame images after the first image, wherein the i+1-th frame image is the current frame image, i≥1, and i is a positive integer;
[0021] Calculating the brightness change amplitude between the i-th frame image and the i+1-th frame image;
[0022] When the brightness change amplitude is less than the preset threshold, after adding 1 to i, return to the step of calculating the brightness change amplitude between the i-th frame image and the i+1-th frame image until the brightness change amplitude is greater than the preset threshold;
[0023] When the brightness change amplitude is greater than a preset threshold, the (i+1)th frame image is determined to be the first frame image.
[0024] Before obtaining the target recorded video, the method further includes:
[0025] The maximum value of the brightness variation between adjacent frames of the multiple loaded images before the first frame of the first video is played is determined as the preset threshold; or
[0026] A preset threshold is obtained according to a correspondence between a video application and a threshold, where the preset threshold corresponds to a video application that plays the first video.
[0027] Wherein, the method further comprises:
[0028] Obtaining a screen recording frame rate of the target recorded video, a frame number corresponding to the first image, and a frame number corresponding to the first frame image;
[0029] The determining the time interval between the first image and the first frame image includes:
[0030] The time interval between the first image and the first frame image is calculated based on the screen recording frame rate, the frame number corresponding to the first image and the frame number corresponding to the first frame image.
[0031] The present invention also provides a video playback detection device, comprising:
[0032] A first acquisition module is used to acquire a target recorded video, where the target recorded video is a target video segment including a first image and a first frame image of a first video, where the first image is a frame image corresponding to when the first video is triggered to play;
[0033] A framing module, used to frame the target recorded video to obtain continuous multi-frame images;
[0034] An image recognition module, configured to recognize the first image and the first frame image according to the multiple frames of images, wherein the first frame image is determined based on a brightness change amplitude between adjacent frames of images of the multiple frames of images;
[0035] The processing module is used to determine the time interval between the first image and the first frame image, and use the time interval as the video playback start duration of the first video.
[0036] Wherein, the first acquisition module includes:
[0037] A first processing unit, configured to trigger the playing of the first video after the screen recording is started;
[0038] The first acquisition unit is used to stop screen recording when the recording time reaches a preset time, and save the recorded video as a target recorded video.
[0039] Wherein, the framing module includes:
[0040] A second acquisition unit is used to acquire the screen recording frame rate of the target recorded video;
[0041] A second processing unit is used to crop the target recorded video and save the video content in the video playback area as the cropped recorded video;
[0042] The frame division unit is used to divide the cropped recorded video into frames according to the screen recording frame rate to obtain continuous multiple frame images.
[0043] Wherein, the image recognition module includes:
[0044] A third processing unit, configured to traverse the multiple frames of images and perform image recognition according to the time sequence in which the multiple frames of images are displayed during video playback;
[0045] The first image recognition unit is used to determine that the current frame image is the first image when recognizing that the current frame image has a preset image feature that triggers the playback of the first video.
[0046] Wherein, the image recognition module includes:
[0047] a fourth processing unit, configured to, after identifying the first image, traverse frame images subsequent to the first image to extract brightness components, and obtain brightness averages of an i-th frame image and an i+1-th frame image in the frame images subsequent to the first image, wherein the i+1-th frame image is a current frame image, i≥1, and i is a positive integer;
[0048] A first calculation unit, used for calculating the brightness change amplitude between the i-th frame image and the i+1-th frame image;
[0049] a fifth processing unit, configured to, when the brightness variation amplitude is less than a preset threshold, add 1 to i and return to the step of calculating the brightness variation amplitude between the i-th frame image and the (i+1)-th frame image until the brightness variation amplitude is greater than the preset threshold;
[0050] The first frame image recognition unit is used to determine that the i+1th frame image is the first frame image when the brightness change amplitude is greater than a preset threshold.
[0051] Wherein, the device further comprises:
[0052] A first threshold value acquisition module is used to determine the maximum value of the brightness change amplitude between adjacent frames of the multiple frames of loaded images before the first frame of the first video is played as the preset threshold; or
[0053] The second threshold acquisition module is used to obtain a preset threshold according to the corresponding relationship between the video application and the threshold, where the preset threshold corresponds to the video application that plays the first video.
[0054] Wherein, the device further comprises:
[0055] A second acquisition module is used to obtain the screen recording frame rate of the target recorded video, the frame number corresponding to the first image, and the frame number corresponding to the first frame image;
[0056] The processing module comprises:
[0057] The second calculation unit is used to calculate the time interval between the first image and the first frame image according to the screen recording frame rate, the frame number corresponding to the first image and the frame number corresponding to the first frame image.
[0058] The present invention also provides an electronic device, comprising a processor and a transceiver, wherein the transceiver receives and sends data under the control of the processor, and is characterized in that the processor is used to perform the following operations:
[0059] Acquire a target recorded video, where the target recorded video is a target video segment including a first image and a first frame image of a first video, where the first image is a frame image corresponding to when the first video is triggered to play;
[0060] Dividing the target recorded video into frames to obtain continuous multiple frame images;
[0061] According to the multiple frames of images, the first image and the first frame of image are identified, wherein the first frame of image is determined based on the brightness change amplitude between adjacent frames of image of the multiple frames of image;
[0062] Determine a time interval between the first image and the first frame image, and use the time interval as a video playback start duration for the first video.
[0063] Wherein, the processor is further used for:
[0064] After starting screen recording, triggering the playback of the first video;
[0065] When the recording time reaches the preset time, the screen recording stops and the recorded video is saved as the target recorded video.
[0066] Wherein, the processor is further used for:
[0067] Obtaining the screen recording frame rate of the target recorded video;
[0068] The target recorded video is cropped, and the video content in the video playback area is saved as the cropped recorded video;
[0069] The cropped recorded video is divided into frames according to the screen recording frame rate to obtain continuous multiple frame images.
[0070] Wherein, the processor is further used for:
[0071] According to the time sequence in which the multiple frames of images are displayed during video playback, the multiple frames of images are traversed to perform image recognition;
[0072] When it is identified that the current frame image has a preset image feature that triggers the playing of the first video, the current frame image is determined to be the first image.
[0073] Wherein, the processor is further used for:
[0074] After identifying the first image, traverse the frame images after the first image to extract the brightness component, and obtain the brightness mean value of the i-th frame image and the brightness mean value of the i+1-th frame image in the frame images after the first image, wherein the i+1-th frame image is the current frame image, i≥1, and i is a positive integer;
[0075] Calculating the brightness change amplitude between the i-th frame image and the i+1-th frame image;
[0076] When the brightness change amplitude is less than the preset threshold, after adding 1 to i, return to the step of calculating the brightness change amplitude between the i-th frame image and the i+1-th frame image until the brightness change amplitude is greater than the preset threshold;
[0077] When the brightness change amplitude is greater than a preset threshold, the (i+1)th frame image is determined to be the first frame image.
[0078] Wherein, the processor is further used for:
[0079] The maximum value of the brightness variation between adjacent frames of the multiple loaded images before the first frame of the first video is played is determined as the preset threshold; or
[0080] A preset threshold is obtained according to a correspondence between a video application and a threshold, where the preset threshold corresponds to a video application that plays the first video.
[0081] Wherein, the processor is further used for:
[0082] Obtaining a screen recording frame rate of the target recorded video, a frame number corresponding to the first image, and a frame number corresponding to the first frame image;
[0083] The time interval between the first image and the first frame image is calculated according to the screen recording frame rate, the frame number corresponding to the first image and the frame number corresponding to the first frame image.
[0084] The present invention also provides an electronic device, comprising a memory, a processor, and a program stored in the memory and executable on the processor; when the processor executes the program, the video playback detection method as described above is implemented.
[0085] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps in the video playback detection method as described above are implemented.
[0086] The above technical solution of the present invention has at least the following beneficial effects:
[0087] In an embodiment of the present invention, a target recorded video is obtained, wherein the target recorded video is a target video clip including a first image and a first frame image of a first video, wherein the first image is a frame image corresponding to triggering the playback of the first video; the target recorded video is framed to obtain continuous multiple frames; the first image and the first frame image are identified based on the multiple frames, wherein the first frame image is determined based on the brightness change amplitude between adjacent frames of the multiple frames; the time interval between the first image and the first frame image is determined, and the time interval is used as the video playback start duration of the first video. In this way, the first frame image is identified by using the brightness feature of the image, thereby reducing the complexity of the first frame image recognition algorithm and improving image recognition efficiency. Moreover, the testing process does not depend on the code of the video application program. Not only is the testing process simple, but non-technical testers can also perform the test, thereby improving testing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0088] Figure 1 A schematic diagram showing a flow chart of a video playback detection method according to an embodiment of the present invention;
[0089] Figure 2 A schematic diagram showing the storage method of YV12;
[0090] Figure 3 A schematic diagram showing the storage method of NV12;
[0091] Figure 4 A schematic diagram showing a module of a video playback detection device according to an embodiment of the present invention;
[0092] Figure 5 A schematic diagram showing the structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0093] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.
[0094] The present invention aims at the problem of low testing efficiency in the existing testing scheme of radio frequency playing performance indicators, and provides a video playing detection method, device and electronic equipment.
[0095] like Figure 1 FIG. 1 is a flow chart of a video playback detection method provided by an embodiment of the present invention. The method specifically includes:
[0096] Step 101, obtaining a target recorded video, wherein the target recorded video is a target video segment including a first image and a first frame image of a first video, wherein the first image is a frame image corresponding to when the first video is triggered to play;
[0097] In this step, during the recording process of the target recorded video, the first video is played through the video application to be tested.
[0098] It should be noted that the target recorded video can be obtained through the screen recording function of the electronic device.
[0099] Step 102, dividing the target recorded video into frames to obtain a continuous multi-frame image;
[0100] In this step, the target recorded video can be framed using a preset frame segmentation tool. Optionally, the preset frame segmentation tool is FFmpeg or OpenCV.
[0101] It should be noted that the color encoding method of the target recorded video is the YUV color encoding method, where Y represents brightness, and U and V represent chrominance.
[0102] Since the video stream of the target recorded video is a YUV stream, the image after framing the target recorded video is also an image in the YUV color space.
[0103] Step 103, identifying the first image and the first frame image according to the multiple frames of images, wherein the first frame image is determined based on the brightness change amplitude between adjacent frames of the multiple frames of images;
[0104] In this step, it can be known from the previous step that the image after the target recorded video is framed is an image in the YUV color space, and the brightness change amplitude between adjacent frame images can be obtained by extracting the brightness Y component of the image. Specifically, the difference between the brightness mean values of adjacent frame images can be determined as the brightness change amplitude between adjacent frame images.
[0105] It should be noted that the human eye is much more sensitive to brightness components than to color components. Video is composed of images that are continuous in time. Since the images in the target recorded video are images in the YUV color space, separating the brightness signal Y and the chrominance signals U and V of the YUV image reduces the bandwidth occupied by the transmission compared to the simultaneous transmission of the three primary colors of RGB encoding. Here, the sequential storage method of the Y component of the YUV image is used to improve the efficiency of the first frame image recognition compared to the complexity of the RGB color value traversal calculation and OCR recognition algorithm.
[0106] Step 104: determine the time interval between the first image and the first frame image, and use the time interval as the video playback start duration of the first video.
[0107] The video playback detection method of the embodiment of the present invention obtains a target recorded video, wherein the target recorded video is a target video clip including a first image and a first frame image of a first video, wherein the first image is a frame image corresponding to triggering the playback of the first video; the target recorded video is framed to obtain continuous multiple frames; the first image and the first frame image are identified based on the multiple frames, wherein the first frame image is determined based on the brightness change amplitude between adjacent frames of the multiple frames; the time interval between the first image and the first frame image is determined, and the time interval is used as the video playback start duration of the first video. In this way, the first frame image is identified by using the brightness feature of the image, thereby reducing the complexity of the first frame image recognition algorithm and improving image recognition efficiency. Moreover, the testing process does not depend on the code of the video application program. Not only is the testing process simple, but non-technical testers can also perform the test, thereby improving testing efficiency.
[0108] The embodiment of the present invention uses an automated script to perform recording of the target recorded video, wherein the automated script can use a user interface UI automated script testing framework, such as UiAutomator, Appium, etc. That is, the target recorded video is obtained through an automated script. As an optional implementation, the method step 101 of the embodiment of the present invention, the said obtaining of the target recorded video includes:
[0109] After starting screen recording, triggering the playback of the first video;
[0110] It should be noted that the electronic device executing the method has a screen recording function.
[0111] When the recording time reaches the preset time, the screen recording stops and the recorded video is saved as the target recorded video.
[0112] Here, the preset duration is a pre-set duration, generally 5 seconds, and can be adjusted according to actual conditions to ensure that the first frame image has been loaded.
[0113] It should be noted that after the electronic device starts screen recording, it records the video at a preset screen recording frame rate, wherein during the recording process, the first image corresponding to the first video that is triggered to play and the first frame image of the first video are both recorded.
[0114] It should be noted that the detection method of this embodiment is driven by automated scripts throughout the process and does not rely on the code of the video application program, so that non-technical testers can also perform the test.
[0115] As an optional implementation, step 102 may include:
[0116] Obtaining the screen recording frame rate of the target recorded video;
[0117] Optionally, when the target recorded video is obtained by screen recording, the screen recording parameters are saved at the same time. Here, the screen recording parameters include but are not limited to: screen recording frame rate and screen recording frame number.
[0118] The target recorded video is cropped, and the video content in the video playback area is saved as the cropped recorded video;
[0119] It should be noted that the purpose of executing this step is to prevent images in other areas of the target recorded video except the video playback area from interfering with the recognition of the first frame image.
[0120] Here, the video playing area is the playing area of the first video. That is, during video recording, the video playing area of the first video is played by the video application to be tested.
[0121] The cropped recorded video is divided into frames according to the screen recording frame rate to obtain continuous multiple frame images.
[0122] Here, the cropped recorded video can be divided into frames according to the screen recording frame rate by using the FFmpeg tool to obtain continuous multiple frame images. Optionally, the multiple frame images are saved in jpg format in chronological order.
[0123] Here, the continuous multiple frame images refer to multiple frame images that are continuous in time.
[0124] As an optional implementation, in step 103, identifying the first image according to the multiple frames of images may include:
[0125] According to the time sequence in which the multiple frames of images are displayed during video playback, the multiple frames of images are traversed to perform image recognition;
[0126] Here, since the multiple frames of images are temporally continuous, they have a temporal sequence.
[0127] When it is identified that the current frame image has a preset image feature that triggers the playing of the first video, the current frame image is determined to be the first image.
[0128] It should be noted that the preset image features are pre-stored image features of images corresponding to the triggered video playback. For example, the state identifier of the play control button is the feature of the play identifier. Specifically, there is no play identifier feature in the image features corresponding to the images before the first image.
[0129] It should be noted that the multiple frames have corresponding frame numbers in time sequence, and when the first image is identified, the frame number corresponding to the first image is obtained. Alternatively, after the first image is identified, the frame number corresponding to the first image is assigned, such as number 1.
[0130] As an optional implementation, in step 103 of the method, identifying the first frame image according to the multiple frames of images may include:
[0131] After identifying the first image, traverse the frame images after the first image to extract the brightness component, and obtain the brightness mean value of the i-th frame image and the brightness mean value of the i+1-th frame image in the frame images after the first image, wherein the i+1-th frame image is the current frame image, i≥1, and i is a positive integer;
[0132] It should be noted that there are three YUV sampling methods, YUV4:4:4, YUV4:2:2, and YUV4:2:0. The storage method of the YUV stream is closely related to the sampling method. The storage methods include YV12, YU12, NV12, and NV21. Figure 2 As shown, it is a schematic diagram of the storage method of YV12, such as Figure 3 As shown in the figure, it is a schematic diagram of NV12 storage. No matter which storage method is used, the brightness Y component is stored continuously from the starting address, so the Y component can be read continuously, which is more efficient. Here, the biggest difference between YUV storage and RGB is that the data of each point of RGB is stored together continuously, while in order to save space, the space of U and V components of YUV will be reduced.
[0133] Calculating the brightness change amplitude between the i-th frame image and the i+1-th frame image;
[0134] Specifically, the difference between the brightness component of the i-th frame image and the brightness component of the i+1-th frame image is calculated to obtain the brightness change amplitude between the i-th frame image and the i+1-th frame image.
[0135] When the brightness change amplitude is less than the preset threshold, after adding 1 to i, return to the step of calculating the brightness change amplitude between the i-th frame image and the i+1-th frame image until the brightness change amplitude is greater than the preset threshold;
[0136] For example, after the first image is recognized, the brightness component of the first frame image after the first image is extracted, the brightness mean of the first frame image is calculated, the brightness component of the second frame image is extracted, and the brightness mean of the second frame image is calculated. After that, the difference between the brightness mean of the first frame image and the brightness mean of the second frame image is calculated to obtain the brightness change amplitude value between the brightness mean of the first frame image and the brightness mean of the second frame image. Then, if the brightness change amplitude value between the brightness mean of the first frame image and the brightness mean of the second frame image is less than the preset threshold, after adding 1 to i, the brightness change amplitude value between the second frame image and the third frame image is calculated, and so on, until the brightness change amplitude value between the current frame image and the previous frame image is greater than the preset threshold.
[0137] It should be noted that after i is added by 1, the brightness component of the third frame image is extracted, the brightness mean of the third frame image is calculated, and then the brightness change amplitude between the second frame image and the third frame image is calculated.
[0138] When the brightness change amplitude is greater than a preset threshold, the (i+1)th frame image is determined to be the first frame image.
[0139] In the present implementation, it should be noted that, before the first frame of the video is played, the video playback area is usually a black screen, advertisement, video logo, etc., and the image changes in this area of the screen are small, so the brightness change amplitude of adjacent frames is also small. The brightness change amplitude between adjacent frame images is compared with the preset threshold value as the judgment method for the appearance of the first frame image.
[0140] Further, in order to solve the problem of how to obtain the preset threshold in this embodiment, as an optional implementation, before obtaining the target recorded video, the method further includes:
[0141] Determine the maximum value of the brightness change amplitude between adjacent frames of the multiple frames of loaded images before the first frame of the first video is played as the preset threshold;
[0142] Specifically, before the test, a screenshot is taken of the first frame of the first video before it is played, and only the image of the video playback area is retained. The Y component of its brightness is extracted, the brightness mean is calculated, and the maximum brightness change amplitude of adjacent frames is taken as the preset threshold.
[0143] Alternatively, a preset threshold is obtained according to a correspondence between a video application and a threshold, where the preset threshold corresponds to a video application that plays the first video.
[0144] Here, in the same video application, the screen before the first frame of the video is played is basically the same, so the same threshold is used to test different video moments. If the screen before the first frame of the video is updated, or the tested video application is changed, the threshold needs to be recalculated. Therefore, users can establish a corresponding relationship between video applications and thresholds according to the needs of various types of video applications being tested, that is, different video applications correspond to different preset thresholds.
[0145] As an optional implementation, the method of the embodiment of the present invention may further include:
[0146] Obtaining a screen recording frame rate of the target recorded video, a frame number corresponding to the first image, and a frame number corresponding to the first frame image;
[0147] It should be noted that multiple frames of images have corresponding frame numbers in chronological order. When the first image is identified, the frame number corresponding to the first image is obtained. When the first frame of image is identified, the frame number corresponding to the first frame of image is obtained.
[0148] Alternatively, after the first image is identified, a frame number corresponding to the first image is assigned, and frame images after the first image are accumulated in chronological order after the first image.
[0149] For example, the frame number assigned to the first image is 1, and the frame numbers of images after the first image are 2, 3, and so on.
[0150] Correspondingly, determining the time interval between the first image and the first frame image includes:
[0151] The time interval between the first image and the first frame image is calculated based on the screen recording frame rate, the frame number corresponding to the first image and the frame number corresponding to the first frame image.
[0152] In this step, the time interval between the first image and the first frame image is calculated according to the formula T=(N2-N1) / FPS.
[0153] Here, N1 represents the frame number corresponding to the first image, N2 represents the frame number corresponding to the first frame image, FPS represents the screen recording frame rate, and T represents the time interval between the first image and the first frame image.
[0154] The video playback detection method of the embodiment of the present invention obtains a target recorded video, wherein the target recorded video is a target video clip including a first image and a first frame image of a first video, wherein the first image is a frame image corresponding to triggering the playback of the first video; the target recorded video is framed to obtain continuous multiple frames; the first image and the first frame image are identified based on the multiple frames, wherein the first frame image is determined based on the brightness change amplitude between adjacent frames of the multiple frames; the time interval between the first image and the first frame image is determined, and the time interval is used as the video playback start duration of the first video. In this way, the first frame image is identified by using the brightness feature of the image, thereby reducing the complexity of the first frame image recognition algorithm and improving image recognition efficiency. Moreover, the testing process does not depend on the code of the video application program. Not only is the testing process simple, but non-technical testers can also perform the test, thereby improving testing efficiency.
[0155] like Figure 4 As shown, an embodiment of the present invention further provides a video playback detection device, the device comprising:
[0156] A first acquisition module 401 is used to acquire a target recorded video, where the target recorded video is a target video segment including a first image and a first frame image of a first video, where the first image is a frame image corresponding to when the first video is triggered to play;
[0157] A frame segmentation module 402 is used to segment the target recorded video into frames to obtain continuous multiple frame images;
[0158] An image recognition module 403 is used to recognize the first image and the first frame image according to the multiple frames of images, wherein the first frame image is determined based on the brightness change amplitude between adjacent frames of the multiple frames of images;
[0159] The processing module 404 is used to determine the time interval between the first image and the first frame image, and use the time interval as the video playback start duration of the first video.
[0160] Optionally, the first acquisition module 401 includes:
[0161] A first processing unit, configured to trigger the playing of the first video after the screen recording is started;
[0162] The first acquisition unit is used to stop screen recording when the recording time reaches a preset time, and save the recorded video as a target recorded video.
[0163] Optionally, the framing module 402 includes:
[0164] A second acquisition unit is used to acquire the screen recording frame rate of the target recorded video;
[0165] A second processing unit is used to crop the target recorded video and save the video content in the video playback area as the cropped recorded video;
[0166] The frame division unit is used to divide the cropped recorded video into frames according to the screen recording frame rate to obtain continuous multiple frame images.
[0167] Optionally, the image recognition module 403 includes:
[0168] A third processing unit, configured to traverse the multiple frames of images and perform image recognition according to the time sequence in which the multiple frames of images are displayed during video playback;
[0169] The first image recognition unit is used to determine that the current frame image is the first image when recognizing that the current frame image has a preset image feature that triggers the playback of the first video.
[0170] Optionally, the image recognition module 403 includes:
[0171] a fourth processing unit, configured to, after identifying the first image, traverse frame images subsequent to the first image to extract brightness components, and obtain brightness averages of an i-th frame image and an i+1-th frame image in the frame images subsequent to the first image, wherein the i+1-th frame image is a current frame image, i≥1, and i is a positive integer;
[0172] A first calculation unit, used for calculating the brightness change amplitude between the i-th frame image and the i+1-th frame image;
[0173] a fifth processing unit, configured to, when the brightness variation amplitude is less than a preset threshold, add 1 to i and return to the step of calculating the brightness variation amplitude between the i-th frame image and the (i+1)-th frame image until the brightness variation amplitude is greater than the preset threshold;
[0174] The first frame image recognition unit is used to determine that the i+1th frame image is the first frame image when the brightness change amplitude is greater than a preset threshold.
[0175] Optionally, the device further comprises:
[0176] A first threshold value acquisition module is used to determine the maximum value of the brightness change amplitude between adjacent frames of the multiple frames of loaded images before the first frame of the first video is played as the preset threshold; or
[0177] The second threshold acquisition module is used to obtain a preset threshold according to the corresponding relationship between the video application and the threshold, where the preset threshold corresponds to the video application that plays the first video.
[0178] Optionally, the device further comprises:
[0179] A second acquisition module is used to obtain the screen recording frame rate of the target recorded video, the frame number corresponding to the first image, and the frame number corresponding to the first frame image;
[0180] The processing module 404 includes:
[0181] The second calculation unit is used to calculate the time interval between the first image and the first frame image according to the screen recording frame rate, the frame number corresponding to the first image and the frame number corresponding to the first frame image.
[0182] The video playback detection device of the embodiment of the present invention obtains a target recorded video, wherein the target recorded video is a target video clip including a first image and a first frame image of a first video, wherein the first image is a frame image corresponding to triggering the playback of the first video; the target recorded video is framed to obtain a continuous multi-frame image; based on the multi-frame image, the first image and the first frame image are identified, wherein the first frame image is determined based on the brightness change amplitude between adjacent frame images of the multi-frame image; the time interval between the first image and the first frame image is determined, and the time interval is used as the video playback start duration of the first video. In this way, the first frame image is identified by using the brightness feature of the image, thereby reducing the complexity of the first frame image recognition algorithm and improving image recognition efficiency. Moreover, the testing process does not depend on the code of the video application program. Not only is the testing process simple, but non-technical testers can also perform the test, thereby improving testing efficiency.
[0183] It should be noted here that the above-mentioned device provided in the embodiment of the present invention can implement all the method steps implemented in the above-mentioned method embodiment, and can achieve the same technical effect. The parts and beneficial effects that are the same as the method embodiment in this embodiment will not be described in detail here.
[0184] In order to better achieve the above goals, Figure 5 As shown, an embodiment of the present invention further provides an electronic device, including a processor 500 and a transceiver 510, wherein the transceiver 510 receives and sends data under the control of the processor, and the processor 500 is used to perform the following process:
[0185] Acquire a target recorded video, where the target recorded video is a target video segment including a first image and a first frame image of a first video, where the first image is a frame image corresponding to when the first video is triggered to play;
[0186] Dividing the target recorded video into frames to obtain continuous multiple frame images;
[0187] According to the multiple frames of images, the first image and the first frame of image are identified, wherein the first frame of image is determined based on the brightness change amplitude between adjacent frames of image of the multiple frames of image;
[0188] Determine a time interval between the first image and the first frame image, and use the time interval as a video playback start duration for the first video.
[0189] Optionally, the processor 500 is further configured to:
[0190] After starting screen recording, triggering the playback of the first video;
[0191] When the recording time reaches the preset time, the screen recording stops and the recorded video is saved as the target recorded video.
[0192] Optionally, the processor 500 is further configured to:
[0193] Obtaining the screen recording frame rate of the target recorded video;
[0194] The target recorded video is cropped, and the video content in the video playback area is saved as the cropped recorded video;
[0195] The cropped recorded video is divided into frames according to the screen recording frame rate to obtain continuous multiple frame images.
[0196] Optionally, the processor 500 is further configured to:
[0197] According to the time sequence in which the multiple frames of images are displayed during video playback, the multiple frames of images are traversed to perform image recognition;
[0198] When it is identified that the current frame image has a preset image feature that triggers the playing of the first video, the current frame image is determined to be the first image.
[0199] Optionally, the processor 500 is further configured to:
[0200] After identifying the first image, traverse the frame images after the first image to extract the brightness component, and obtain the brightness mean value of the i-th frame image and the brightness mean value of the i+1-th frame image in the frame images after the first image, wherein the i+1-th frame image is the current frame image, i≥1, and i is a positive integer;
[0201] Calculating the brightness change amplitude between the i-th frame image and the i+1-th frame image;
[0202] When the brightness change amplitude is less than the preset threshold, after adding 1 to i, return to the step of calculating the brightness change amplitude between the i-th frame image and the i+1-th frame image until the brightness change amplitude is greater than the preset threshold;
[0203] When the brightness change amplitude is greater than a preset threshold, the (i+1)th frame image is determined to be the first frame image.
[0204] Optionally, the processor 500 is further configured to:
[0205] The maximum value of the brightness variation between adjacent frames of the multiple loaded images before the first frame of the first video is played is determined as the preset threshold; or
[0206] A preset threshold is obtained according to a correspondence between a video application and a threshold, where the preset threshold corresponds to a video application that plays the first video.
[0207] Optionally, the processor 500 is further configured to:
[0208] Obtaining a screen recording frame rate of the target recorded video, a frame number corresponding to the first image, and a frame number corresponding to the first frame image;
[0209] The time interval between the first image and the first frame image is calculated based on the screen recording frame rate, the frame number corresponding to the first image and the frame number corresponding to the first frame image.
[0210] The electronic device of the embodiment of the present invention obtains a target recorded video, wherein the target recorded video is a target video clip including a first image and a first frame image of a first video, wherein the first image is a frame image corresponding to triggering the playback of the first video; frames the target recorded video to obtain continuous multiple frames; identifies the first image and the first frame image based on the multiple frames, wherein the first frame image is determined based on the brightness change amplitude between adjacent frames of the multiple frames; determines the time interval between the first image and the first frame image, and uses the time interval as the video playback start duration of the first video. In this way, the first frame image is identified by using the brightness feature of the image, thereby reducing the complexity of the first frame image recognition algorithm and improving image recognition efficiency. Moreover, the testing process does not depend on the code of the video application program. Not only is the testing process simple, but non-technical testers can also perform the test, thereby improving testing efficiency.
[0211] An embodiment of the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, each process in the video playback detection method embodiment described above is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0212] The embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, each process in the video playback detection method embodiment described above is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0213] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.
[0214] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A device that specifies functions in one or more processes and / or one or more blocks.
[0215] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable storage medium produce a paper product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0216] These computer program instructions may also be loaded onto a computer or other programmable data processing device so that the computer or other programmable device executes a series of operating steps to produce a computer-implemented process, thereby providing instructions executed on the computer or other programmable device for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0217] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A video playback detection method, characterized in that: include: Acquire a target recorded video, where the target recorded video is a target video segment including a first image and a first frame image of a first video, where the first image is a frame image corresponding to when the first video is triggered to play; Dividing the target recorded video into frames to obtain continuous multiple frame images; According to the multiple frames of images, the first image and the first frame of image are identified, wherein the first frame of image is determined based on the brightness change amplitude between adjacent frames of image of the multiple frames of image; Determine a time interval between the first image and the first frame image, and use the time interval as a video playback start duration of the first video; The step of identifying the first frame image according to the multiple frames of image comprises: After identifying the first image, traverse the frame images after the first image to extract the brightness component, and obtain the brightness mean value of the i-th frame image and the brightness mean value of the i+1-th frame image in the frame images after the first image, wherein the i+1-th frame image is the current frame image, i≥1, and i is a positive integer; Calculating the brightness change amplitude between the i-th frame image and the i+1-th frame image; When the brightness change amplitude is less than the preset threshold, after adding 1 to i, return to the step of calculating the brightness change amplitude between the i-th frame image and the i+1-th frame image until the brightness change amplitude is greater than the preset threshold; When the brightness change amplitude is greater than a preset threshold, determining the (i+1)th frame image as the first frame image; Identifying the first image according to the multiple frames of images includes: According to the time sequence in which the multiple frames of images are displayed during video playback, the multiple frames of images are traversed to perform image recognition; When it is identified that the current frame image has a preset image feature that triggers the playing of the first video, the current frame image is determined to be the first image.
2. The method according to claim 1, characterized in that: The obtaining of the target recorded video includes: After starting screen recording, triggering the playback of the first video; When the recording time reaches the preset time, the screen recording stops and the recorded video is saved as the target recorded video.
3. The method according to claim 1, characterized in that: The step of dividing the target recorded video into frames to obtain a continuous plurality of frames of images includes: Obtaining the screen recording frame rate of the target recorded video; The target recorded video is cropped, and the video content in the video playback area is saved as the cropped recorded video; The cropped recorded video is divided into frames according to the screen recording frame rate to obtain continuous multiple frame images.
4. The method according to claim 1, characterized in that: Before acquiring the target recorded video, the method further includes: Determine the maximum value of the brightness change amplitude between adjacent frames of the multiple frames of loaded images before the first frame of the first video is played as the preset threshold; or A preset threshold is obtained according to a correspondence between a video application and a threshold, where the preset threshold corresponds to a video application that plays the first video.
5. The method according to claim 1, characterized in that The method further comprises: Obtaining a screen recording frame rate of the target recorded video, a frame number corresponding to the first image, and a frame number corresponding to the first frame image; The determining the time interval between the first image and the first frame image includes: The time interval between the first image and the first frame image is calculated based on the screen recording frame rate, the frame number corresponding to the first image and the frame number corresponding to the first frame image.
6. A video playback detection device, characterized in that: include: A first acquisition module is used to acquire a target recorded video, where the target recorded video is a target video segment including a first image and a first frame image of a first video, where the first image is a frame image corresponding to when the first video is triggered to play; A framing module, used to frame the target recorded video to obtain continuous multi-frame images; An image recognition module, configured to recognize the first image and the first frame image according to the multiple frames of images, wherein the first frame image is determined based on a brightness change amplitude between adjacent frames of images of the multiple frames of images; A processing module, used for determining a time interval between the first image and the first frame image, and using the time interval as a video playback start time length of the first video; The image recognition module comprises: a fourth processing unit, configured to, after identifying the first image, traverse frame images subsequent to the first image to extract brightness components, and obtain brightness averages of an i-th frame image and an i+1-th frame image in the frame images subsequent to the first image, wherein the i+1-th frame image is a current frame image, i≥1, and i is a positive integer; A first calculation unit, used for calculating the brightness change amplitude between the i-th frame image and the i+1-th frame image; a fifth processing unit, configured to, when the brightness variation amplitude is less than a preset threshold, add 1 to i and return to the step of calculating the brightness variation amplitude between the i-th frame image and the (i+1)-th frame image until the brightness variation amplitude is greater than the preset threshold; A first frame image recognition unit, configured to determine that the (i+1)th frame image is the first frame image when the brightness change amplitude is greater than a preset threshold; The image recognition module comprises: A third processing unit, configured to traverse the multiple frames of images and perform image recognition according to the time sequence in which the multiple frames of images are displayed during video playback; The first image recognition unit is used to determine that the current frame image is the first image when recognizing that the current frame image has a preset image feature that triggers the playback of the first video.
7. An electronic device comprising a processor and a transceiver, wherein the transceiver receives and sends data under the control of the processor, characterized in that: The processor is configured to perform the following operations: Acquire a target recorded video, where the target recorded video is a target video segment including a first image and a first frame image of a first video, where the first image is a frame image corresponding to when the first video is triggered to play; Dividing the target recorded video into frames to obtain continuous multiple frame images; According to the multiple frames of images, the first image and the first frame of image are identified, wherein the first frame of image is determined based on the brightness change amplitude between adjacent frames of image of the multiple frames of image; Determine a time interval between the first image and the first frame image, and use the time interval as a video playback start duration of the first video; The processor is further configured to: After identifying the first image, traverse the frame images after the first image to extract the brightness component, and obtain the brightness mean value of the i-th frame image and the brightness mean value of the i+1-th frame image in the frame images after the first image, wherein the i+1-th frame image is the current frame image, i≥1, and i is a positive integer; Calculating the brightness change amplitude between the i-th frame image and the i+1-th frame image; When the brightness change amplitude is less than the preset threshold, after adding 1 to i, return to the step of calculating the brightness change amplitude between the i-th frame image and the i+1-th frame image until the brightness change amplitude is greater than the preset threshold; When the brightness change amplitude is greater than a preset threshold, determining the (i+1)th frame image as the first frame image; The processor is further configured to: According to the time sequence in which the multiple frames of images are displayed during video playback, the multiple frames of images are traversed to perform image recognition; When it is identified that the current frame image has a preset image feature that triggers the playing of the first video, the current frame image is determined to be the first image.
8. The electronic device according to claim 7, characterized in that: The processor is further configured to: After starting screen recording, triggering the playback of the first video; When the recording time reaches the preset time, the screen recording stops and the recorded video is saved as the target recorded video.
9. The electronic device according to claim 7, characterized in that: The processor is further configured to: Obtaining the screen recording frame rate of the target recorded video; The target recorded video is cropped, and the video content in the video playback area is saved as the cropped recorded video; The cropped recorded video is divided into frames according to the screen recording frame rate to obtain continuous multiple frame images.
10. The electronic device according to claim 7, characterized in that: The processor is further configured to: Determine the maximum value of the brightness change amplitude between adjacent frames of the multiple frames of loaded images before the first frame of the first video is played as the preset threshold; or A preset threshold is obtained according to a correspondence between a video application and a threshold, where the preset threshold corresponds to a video application that plays the first video.
11. The electronic device according to claim 7, characterized in that: The processor is further configured to: Obtaining a screen recording frame rate of the target recorded video, a frame number corresponding to the first image, and a frame number corresponding to the first frame image; The time interval between the first image and the first frame image is calculated based on the screen recording frame rate, the frame number corresponding to the first image and the frame number corresponding to the first frame image.
12. An electronic device comprising a memory, a processor, and a program stored in the memory and executable on the processor; characterized in that: When the processor executes the program, the video playback detection method according to any one of claims 1 to 5 is implemented.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the video playback detection method as described in any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Broadcast starting time test method and device and computer readable storage medium
CN111131812A
Method for detecting change points in motion picture images
US5083860A