CN112637583A - Method and system for testing video resolution - Google Patents

Method and system for testing video resolution Download PDF

Info

Publication number
CN112637583A
CN112637583A CN201910950763.5A CN201910950763A CN112637583A CN 112637583 A CN112637583 A CN 112637583A CN 201910950763 A CN201910950763 A CN 201910950763A CN 112637583 A CN112637583 A CN 112637583A
Authority
CN
China
Prior art keywords
picture
video
pictures
transcoding
format
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910950763.5A
Other languages
Chinese (zh)
Other versions
CN112637583B (en
Inventor
刘德建
黄斌
游友旗
王柟
吴倡
谢姝丽
黄毓婷
王春兰
陈婷
蒋依依
林琛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujian Tianquan Educational Technology Ltd
Original Assignee
Fujian Tianquan Educational Technology Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujian Tianquan Educational Technology Ltd filed Critical Fujian Tianquan Educational Technology Ltd
Priority to CN201910950763.5A priority Critical patent/CN112637583B/en
Publication of CN112637583A publication Critical patent/CN112637583A/en
Application granted granted Critical
Publication of CN112637583B publication Critical patent/CN112637583B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N17/00Diagnosis, testing or measuring for television systems or their details
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/40Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using video transcoding, i.e. partial or full decoding of a coded input stream followed by re-encoding of the decoded output stream

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • General Health & Medical Sciences (AREA)
  • Testing, Inspecting, Measuring Of Stereoscopic Televisions And Televisions (AREA)

Abstract

The invention provides a method for testing video resolution, which comprises the following steps: converting an original video C into a picture set F, converting a transcoded video E into a picture set G, compressing the picture set F to the same size as the picture set G to form a picture set L, then comparing a random picture of the picture set L with the picture set G to judge the similarity of the pictures, and judging that the contents of the two videos are the same when N pictures have similar pictures with the threshold value B and the similarity of the similar pictures reaches the threshold value A; the invention also provides a video resolution ratio test system; the invention can carry out automatic test, reduces labor force and improves working efficiency.

Description

Method and system for testing video resolution
Technical Field
The invention relates to the technical field of video conversion, in particular to a method and a system for testing video conversion resolution.
Background
Transcoding techniques convert files from one format to another. It has two important functions facing different fields. The method mainly supports transcoding among most video types, transcoding among most audio types, transcoding among picture types, transcoding html of document transcoding, transcoding jpg of document, transcoding pdf of document (documents contain common office software such as word, excel, ppt and the like), transcoding jpg of pdf, transcoding html of pdf and the like.
The purpose of video resolution conversion is mainly to solve some experience scenes, for example, a PC display has high resolution, a wired network can accept high-quality videos above ultra-definition (720P), the user experiences well when watching, and the user who adopts high-definition (540P) feels poor image blurring experience when watching. The mobile terminal user adopts a wireless network, so that the effect of ultra-definition (720P) can be already experienced by adopting high-definition resolution (540P). The difference between the experience high-definition effect and the super-definition effect on the mobile phone is not obvious, and the mobile terminal user saves a lot of flow cost by adopting high-definition 540P compared with super-definition 720P. Therefore, in order to enhance the experience of video products, there is a need for video resolution.
Example 1: the network dragon company is an IT enterprise of globalization internet education, has many video teaching resources, automatically selects the video of super clear resolution to play when the PC end software product plays this teaching resource, automatically selects the video of high definition resolution to play when the mobile terminal software product plays this teaching resource, and as long as convert the video from super clear to high definition in advance and guarantee that the video after the conversion can be used, IT is the same content that the video of assurance super clear and high definition plays.
Example 2: the tourists upload ultra-clear (720P) high-resolution videos to a high-definition network, the high-definition network converts the videos into high-definition (540P) medium-resolution videos and smooth (360P) low-resolution videos, so that the tourists with the quality of the videos not being concerned about can select a smooth mode to watch the videos, and the tourists with the quality of the videos not being concerned about can select a mode higher than high definition to watch the videos.
The conventional method for testing whether the file is transcoded successfully or not generally comprises the steps of manually downloading the transcoded file, then opening the file by double-click to judge whether the file is available or not, and whether the file is the same as the content of the original file or not.
Disclosure of Invention
In order to overcome the problems, the invention aims to provide a video resolution ratio testing method, which can perform automatic picture comparison and identification, break through the bottleneck of the existing manual testing technology, realize automatic testing and reduce the cost of manual verification.
The invention is realized by adopting the following scheme: a test method for converting video into resolution, comprising the following steps:
step S1, submitting a video C needing resolution conversion, and selecting a resolution D needing conversion to a transcoding system;
step S2, acquiring a transcoding task API of the transcoding system, inquiring whether the submitted transcoding task is finished or not, if the transcoding task API is not finished, continuously inquiring the transcoding task API, and if the transcoding is failed, directly generating a transcoding failure report and pushing the transcoding failure report to an operator, and ending the test; if the transcoding is successful, the step 3 is entered,
step S3, after the transcoding task is completed, acquiring a video E of which the resolution D is converted by the video C;
step S4, judging the sizes of the two video files, wherein the size of the converted video E file is smaller than that of the video C file before conversion because the resolution ratio is converted to be smaller, if the size of the video E file is larger than or equal to that of the video C file, the problem of conversion is shown, a transcoding error report is directly generated and pushed to an operator, and the test is finished; if the video E file size is smaller than the video C file size, the step S5 is entered;
s5, acquiring the playing time lengths of the video C and the video E, judging whether the playing time lengths of the video C and the video E are equal, and if the playing time lengths of the video C and the video E are equal, entering the step S6; if the transcoding errors are not equal, directly generating a transcoding error report, pushing the transcoding error report to an operator, and ending the test;
step S6, converting the video C before transcoding into pictures according to frames, converting the pictures into a plurality of pictures according to the sequence of frames, and representing the pictures by using a picture set F;
step S7, converting the transcoded video E into pictures according to frames, converting the pictures into a plurality of pictures according to the sequence of the frames, and representing the pictures by using a picture set G; if the video E fails to convert the picture, directly generating a transcoding error report, pushing the transcoding error report to an operator, and ending the test;
step S8, after the picture set F is compressed, comparing random N pictures in the compressed picture set with pictures in the picture set B, and when the N pictures have similar pictures with the threshold value B or more and the similarity of the similar pictures reaches the threshold value A or more, judging that the contents of the two videos are the same;
and step S9, forming a report by the result of the video comparison and displaying the report.
Further, the threshold value A is 50-60%, the threshold value B is 70-90%, the number of N pictures is 10-20, and N is a natural number.
Further, between the step S7 and the step S8, the method further includes: and step S70, randomly extracting a picture in the picture set G, obtaining the size H of the picture, judging whether the size H is equal to the target resolution D, if not, directly generating a transcoding error report, and ending the test process, if so, compressing all pictures in the picture set F, compressing the sizes of all pictures into the size of the size H, and representing all compressed pictures by the picture set L.
Further, the step S8 is specifically: randomly extracting N pictures from the picture set L, wherein each picture needs to be compared with the pictures in the picture set G, the comparison is a group, and the N pictures are N groups; selecting a picture in the picture set L, recording the position number M, and comparing the selected picture with (M-50) th to (M +50) th pictures in the picture set G, wherein if one picture has the picture similarity > -threshold A, namely the picture similarity > -threshold A of the comparison result, if M-50<, then calculating from the first picture.
Further, the comparing of the pictures specifically comprises: assuming that the picture X and the picture Y are compared, and the resolution of both pictures is pxq, the picture is composed of pxq pixels, that is, the picture is divided into p columns and q rows, each column has q rows, the first column and the first row are represented by (1,1), the last column and the last row are represented by (1, q), the last column and the first row are represented by (p,1), and the last column and the last row are represented by (p, q); the picture comparison is to compare pxq pixel points one by one, namely (1,1) of the picture X and (1,1) of the picture Y are compared, and (1,2) of the picture X and (1,2) of the picture Y are compared until (p, q) of the picture X and (p, q) of the picture Y are compared, RGB of each pixel point of the picture is compared, the value error range of the RGB is judged to be within 5, the picture is similar to +1, the error is beyond 5, the picture is dissimilar to +1, until pxq pixel points are compared, and then the total number of the similar pixel points/(the total number of the similar pixel points + the total number of the dissimilar pixel points), and the proportion > is a threshold A, the picture is judged to be similar.
Further, the video format of the video C includes: a flv format, mp4 format, mov format, rmvb format, rm format, avi format, wmv format, asf format, mpg format, mkv format, 3gp format, m4v format, m4a format, vob format, ts format, ogv format, or ogv format.
In addition, the invention also provides a test system for converting video into resolution, which comprises: the device comprises a submitting module, a query module, an acquisition module, a video file size judgment module, a video playing time judgment module, a first video-to-picture module, a second video-to-picture module, a comparison module and a report display module;
the submitting module is used for submitting the video C with the resolution required to be converted and selecting the resolution D required to be converted to the transcoding system;
the query module is used for acquiring a transcoding task API of the transcoding system, querying whether the submitted transcoding task is completed or not, if the transcoding task is not completed, continuing to query the transcoding task API, and if the transcoding is failed, directly generating a transcoding failure report and pushing the transcoding failure report to an operator, and ending the test; if the transcoding is successful, the system enters an acquisition module,
the acquisition module is used for acquiring a video E with a resolution D converted by a video C after the transcoding task is finished;
the video file size judging module is used for judging the sizes of the two video files, the size of the converted video E file is smaller than that of the video C file before conversion because the resolution ratio is converted to be smaller, if the size of the video E file is larger than or equal to that of the video C file, the problem of conversion is shown, a transcoding error report is directly generated and pushed to an operator, and the test is finished; if the size of the video E file is smaller than that of the video C file, entering a video playing time length judging module;
the video playing time length judging module is used for acquiring the playing time lengths of the video C and the video E, judging whether the playing time lengths of the video C and the video E are equal, and entering the first video-to-picture module if the playing time lengths of the video C and the video E are equal; if the transcoding errors are not equal, directly generating a transcoding error report, pushing the transcoding error report to an operator, and ending the test;
the first video-to-picture module is used for converting a video C before transcoding into pictures according to frames, converting the pictures into a plurality of pictures according to the sequence of the frames and representing the pictures by a picture set F;
the second video-to-picture module is used for converting the transcoded video E into pictures according to frames, converting the pictures into a plurality of pictures according to the sequence of the frames and representing the pictures by a picture set G; if the video E fails to convert the picture, directly generating a transcoding error report, pushing the transcoding error report to an operator, and ending the test;
the comparison module is used for compressing the picture set F, comparing random N pictures in the compressed picture set with pictures in the picture set B, and judging that the contents of the two videos are the same when the N pictures have similar pictures with the threshold value of more than B and the similarity of the similar pictures reaches the threshold value of more than A;
and the report display module is used for forming a report for displaying the result of the video comparison.
Further, the threshold value A is 50-60%, the threshold value B is 70-90%, the number of N pictures is 10-20, and N is a natural number.
Further, the test system further comprises a picture compression processing module, wherein the picture compression processing module is used for randomly extracting a picture in the picture set G, obtaining the size H of the picture, judging whether the size H is equal to the target resolution D, if not, directly generating a transcoding error report, and ending the test process, if so, compressing all pictures in the picture set F, compressing the sizes of all pictures into the size of the size H, and expressing all the compressed pictures by the picture set L.
Further, the comparing module is further specifically: randomly extracting N pictures from the picture set L, wherein each picture needs to be compared with the pictures in the picture set G, the comparison is a group, and the N pictures are N groups; selecting a picture in the picture set L, recording the position number M, and comparing the selected picture with (M-50) th to (M +50) th pictures in the picture set G, wherein if one picture has the picture similarity > -threshold A, namely the picture similarity > -threshold A of the comparison result, if M-50<, then calculating from the first picture.
Further, the comparing of the pictures specifically comprises: assuming that the picture X and the picture Y are compared, and the resolution of both pictures is pxq, the picture is composed of pxq pixels, that is, the picture is divided into p columns and q rows, each column has q rows, the first column and the first row are represented by (1,1), the last column and the last row are represented by (1, q), the last column and the first row are represented by (p,1), and the last column and the last row are represented by (p, q); the picture comparison is to compare pxq pixel points one by one, namely (1,1) of the picture X and (1,1) of the picture Y are compared, and (1,2) of the picture X and (1,2) of the picture Y are compared until (p, q) of the picture X and (p, q) of the picture Y are compared, RGB of each pixel point of the picture is compared, the value error range of the RGB is judged to be within 5, the picture is similar to +1, the error is beyond 5, the picture is dissimilar to +1, until pxq pixel points are compared, and then the total number of the similar pixel points/(the total number of the similar pixel points + the total number of the dissimilar pixel points), and the proportion > is a threshold A, the picture is judged to be similar.
Further, the video format of the video C includes: a flv format, mp4 format, mov format, rmvb format, rm format, avi format, wmv format, asf format, mpg format, mkv format, 3gp format, m4v format, m4a format, vob format, ts format, ogv format, or ogv format.
The invention has the beneficial effects that: 1. the image comparison and identification of the invention breaks through the bottleneck of the existing manual testing technology, realizes automatic testing and reduces the cost of manual verification.
2. The application scenes are many, the application is wide, and the coverage area is large.
3. The automatic test ensures that video resources are available, and avoids the online problem from generating company negative influence.
4. Can be extended in the aspect of yellow identification.
Drawings
FIG. 1 is a flow chart of the testing method of the present invention.
FIG. 2 is a block diagram of the test system architecture of the present invention.
Detailed Description
The invention is further described below with reference to the accompanying drawings.
The case where the conversion of video in the present invention exists: 1. the resolution of the video can only be changed from high resolution to low resolution, so that the definition of the video can be ensured, and if the low resolution video is changed from high resolution, the video can only be blurred. 2. The high resolution video to low resolution video may verify the following:
file size of low resolution video < file size of high resolution video
The playing time length of the low-resolution video is equal to the playing time length of the high-resolution video
High-resolution video can be converted into pictures on a frame-by-frame basis,
the low resolution video can be converted into pictures according to frames, and the resolution of the pictures is equal to the target resolution
And converting the high-resolution video into pictures according to a frame, taking out a picture set in the high-resolution video according to a rule, compressing the pictures at a low resolution, comparing the compressed picture set with the picture set of the low-resolution video converted into pictures according to the frame, and judging that the contents of the two videos are the same if the similarity of more than 80% of the pictures is greater than 50%.
The content is automatically verified, if the content passes through, the high-resolution video is judged to be successfully converted into the low-resolution video, and the low-resolution video is available and has the same content as the high-resolution video.
Therefore, the present invention provides a method for testing resolution of video, please refer to fig. 1, which includes the following steps:
step S1, submitting a video C needing resolution conversion, and selecting a resolution D needing conversion to a transcoding system;
step S2, acquiring a transcoding task API of the transcoding system, inquiring whether the submitted transcoding task is finished or not, if the transcoding task API is not finished, continuously inquiring the transcoding task API, and if the transcoding is failed, directly generating a transcoding failure report and pushing the transcoding failure report to an operator, and ending the test; if the transcoding is successful, the step 3 is entered,
step S3, after the transcoding task is completed, acquiring a video E of which the resolution D is converted by the video C;
step S4, judging the sizes of the two video files, wherein the size of the converted video E file is smaller than that of the video C file before conversion because the resolution ratio is converted to be smaller, if the size of the video E file is larger than or equal to that of the video C file, the problem of conversion is shown, a transcoding error report is directly generated and pushed to an operator, and the test is finished; if the video E file size is smaller than the video C file size, the step S5 is entered;
s5, acquiring the playing time lengths of the video C and the video E, judging whether the playing time lengths of the video C and the video E are equal, and if the playing time lengths of the video C and the video E are equal, entering the step S6; if the transcoding errors are not equal, directly generating a transcoding error report, pushing the transcoding error report to an operator, and ending the test;
step S6, converting the video C before transcoding into pictures according to frames, converting the pictures into a plurality of pictures according to the sequence of frames, and representing the pictures by using a picture set F;
step S7, converting the transcoded video E into pictures according to frames, converting the pictures into a plurality of pictures according to the sequence of the frames, and representing the pictures by using a picture set G; if the video E fails to convert the picture, directly generating a transcoding error report, pushing the transcoding error report to an operator, and ending the test;
and step S70, randomly extracting a picture in the picture set G, obtaining the size H of the picture, judging whether the size H is equal to the target resolution D, if not, directly generating a transcoding error report, and ending the test process, if so, compressing all pictures in the picture set F, compressing the sizes of all pictures into the size of the size H, and representing all compressed pictures by the picture set L.
Step S8, after the picture set F is compressed, comparing random N pictures in the compressed picture set with pictures in the picture set B, and when the N pictures have similar pictures with the threshold value B or more and the similarity of the similar pictures reaches the threshold value A or more, judging that the contents of the two videos are the same;
and step S9, forming a report by the result of the video comparison and displaying the report.
Wherein the threshold A is 50-60%, the threshold B is 70-90%, the number of N pictures is 10-20, and N is a natural number.
The step S8 specifically includes: randomly extracting N pictures from the picture set L, wherein each picture needs to be compared with the pictures in the picture set G, the comparison is a group, and the N pictures are N groups; selecting a picture in the picture set L, recording the position number M, and comparing the selected picture with (M-50) th to (M +50) th pictures in the picture set G, wherein if one picture has the picture similarity > -threshold A, namely the picture similarity > -threshold A of the comparison result, if M-50<, then calculating from the first picture.
The comparison of the pictures specifically comprises the following steps: assuming that the picture X and the picture Y are compared, and the resolution of both pictures is pxq, the picture is composed of pxq pixels, that is, the picture is divided into p columns and q rows, each column has q rows, the first column and the first row are represented by (1,1), the last column and the last row are represented by (1, q), the last column and the first row are represented by (p,1), and the last column and the last row are represented by (p, q); the picture comparison is to compare pxq pixel points one by one, namely (1,1) of the picture X and (1,1) of the picture Y are compared, and (1,2) of the picture X and (1,2) of the picture Y are compared until (p, q) of the picture X and (p, q) of the picture Y are compared, RGB of each pixel point of the picture is compared, the value error range of the RGB is judged to be within 5, the picture is similar to +1, the error is beyond 5, the picture is dissimilar to +1, until pxq pixel points are compared, and then the total number of the similar pixel points/(the total number of the similar pixel points + the total number of the dissimilar pixel points), and the proportion > is a threshold A, the picture is judged to be similar.
In addition, in the present invention, the video format of the video C includes: a flv format, mp4 format, mov format, rmvb format, rm format, avi format, wmv format, asf format, mpg format, mkv format, 3gp format, m4v format, m4a format, vob format, ts format, ogv format, or ogv format.
The invention is further illustrated below with reference to a specific embodiment:
1. three values are set:
a threshold a, which is determined to be the same when the similarity > of two pictures is equal to the threshold a, for example, the threshold a is set to be 50%, and is determined to be the same when the similarity > of two pictures is equal to 50%;
when there are multiple groups of pictures that need to be judged for similarity, if the group pictures with > being the threshold B are the same, the contents of the two videos are judged to be the same, for example, the threshold B is set to be 80%, 10 groups of pictures need to be judged for similarity, and if > being 80%, the contents of the two videos are judged to be the same.
The number of groups of picture comparison N, the number of groups of pictures to be compared, will be explained in detail in step 11.
2. Submitting a video C needing to be converted in resolution, and selecting a resolution D needing to be converted to a transcoding system, for example, converting an ultra-clear video C (720P, with a resolution of 1280x720) into a target high-clear video (540P, with a resolution of 960x540), wherein 960x540 is our target resolution D.
Specifically, the following description is provided: the judgment of converting the high resolution into the low resolution or the higher resolution is made by a transcoding system of the tested service, and the judgment is made by the transcoding system since the testing system does not do so, so that the resolution 1280x720 is converted into the video with the resolution 1920x1080, which is not allowed, and the judgment is made by the transcoding system. The transcoding system comprises: multimedia video processing tools FFmpeg, kuku video transcoding service, ali video transcoding service; the FFmpeg has very powerful functions including a video acquisition function, video format conversion, video capture, video watermarking and the like, and can also output a large-resolution video with reduced resolution.
3. And acquiring a transcoding task API of the transcoding system to inquire whether the submitted transcoding task is completed or not, if the transcoding task is not completed, continuously inquiring the transcoding task API, if the transcoding is completed, entering the fourth step, and if the transcoding is failed, directly generating a transcoding failure report because of transcoding failure information returned by the transcoding task API of the transcoding system.
4. And after the transcoding task is finished, acquiring the video E of which the resolution is converted by the video C.
5. Judging the sizes of the two video files, wherein the size of the converted video E file is smaller than that of the video C file before conversion because the resolution ratio is smaller, if the size of the video E file is larger than or equal to that of the video C file, the problem of conversion is shown, a transcoding error report is directly generated, and the reason is that the size of the transcoded video file is larger than or equal to that of the video file before transcoding, and the transcoding error is judged.
6. Acquiring the playing time lengths of the video C and the video E, judging whether the playing time lengths of the video C and the video E are equal, and entering the next step if the playing time lengths of the video C and the video E are equal; and if the transcoding error is not equal, directly generating a transcoding error report, wherein the transcoding error is judged because the video playing time after transcoding is not equal to the video playing time before transcoding.
7. Converting the original video C before transcoding into pictures according to frames, so that the original video C is converted into a plurality of pictures according to the frame sequence, wherein the plurality of pictures are represented by a picture set F;
specifically, the following description is provided: if the original video C fails to convert the picture, the video file cannot be played, and the unplayable transcoding fails, and the transcoding failure is indicated in the information returned by the transcoding task API of the transcoding system obtained in the step 3.
8. Converting the transcoded video E into pictures according to frames, so that the transcoded video E is converted into a plurality of pictures in a frame sequence, wherein the pictures are represented by a picture set G; and if the video E fails to convert the picture, directly generating a transcoding error report, wherein the transcoding error is judged because the video fails to convert the picture according to the frame.
9. Randomly extracting a picture in the picture set G, obtaining the size H of the picture, judging whether the size H is equal to the target resolution D, if so, entering the next step, and if not, directly generating a transcoding error report, wherein the transcoding error is judged because the resolution of the transcoded video is not equal to the resolution of the transcoding target.
10. The pictures in the picture set F are compressed, the size of the pictures is compressed to the size of the size H, and all the compressed pictures are represented by the picture set L.
11. Randomly extracting N pictures in the picture set L (N is set when the threshold value is set in the step 1), wherein each picture needs to be compared with the pictures in the picture set G, the comparison is a group, and the N pictures are N groups;
examples are: step 1, setting that 10 groups of pictures need to be compared, randomly extracting 10 pictures from a picture set L, and recording the positions of the pictures, for example, extracting the (1,21,62,72,83,95,102,77,97,134) th pictures from the picture set L, selecting the 1 st picture from the picture set L and the 1 st to 51 st pictures from the picture set G for comparison, and calculating the comparison result > as 50% as long as one similarity > is 50%;
comparing the 21 st picture of the picture set L with the 1 st to 71 th pictures of the picture set G, … …
Comparing the 62 th picture of the picture set L with the 12 th to 112 th pictures of the picture set G, … …
The number of positions M is recorded in the selected picture in the picture set L, and then the selected picture is compared with the (M-50) th to (M +50) th pictures in the picture set G, if there is a similarity > -50%, the comparison result > -50%, and if M-50< -0, the comparison result is calculated from the first picture.
The principle of picture comparison: assuming that the pictures X and Y are compared, the resolution of both pictures is 960X540, i.e. consisting of 960X540 pixels, 960X540 equals 518400 pixels, and the following figures are divided into 960 columns and 540 rows, each column has 540 rows, the first column and the first row are represented by (1,1), the last column and the last row are represented by (1,540), the last column and the first row are represented by (960,1), and the last column and the last row are represented by (960,540). Comparing the 518400 pixels one by one, namely comparing (1,1) of the picture X with (1,1) of the picture Y, comparing (1,2) of the picture X with (1,2) of the picture Y until (960,540) of the picture X is compared with (960,540) of the picture Y, comparing the RGB of the pixel, judging that the value error range of the RGB is within 5, the picture is similar to +1, and the error is dissimilar to +1 beyond 5 until 518400 pixels are compared, namely the comparison of the last pixel is completed, namely (960,540) of the picture X is compared with (960,540) of the picture Y, and then judging that the picture is similar when the ratio is equal to 50% (namely the threshold value a set in the front).
And (5) completing comparison of all the groups of pictures, and entering the next step.
12. According to a set format of yield reports, some of the reports for yield are shown in table 1 below.
TABLE 1
Figure BDA0002225591900000111
Referring to fig. 2, a testing system for converting video to resolution according to the present invention includes: the device comprises a submitting module, a query module, an acquisition module, a video file size judgment module, a video playing time judgment module, a first video-to-picture module, a second video-to-picture module, a comparison module and a report display module;
the submitting module is used for submitting the video C with the resolution required to be converted and selecting the resolution D required to be converted to the transcoding system;
the query module is used for acquiring a transcoding task API of the transcoding system, querying whether the submitted transcoding task is completed or not, if the transcoding task is not completed, continuing to query the transcoding task API, and if the transcoding is failed, directly generating a transcoding failure report and pushing the transcoding failure report to an operator, and ending the test; if the transcoding is successful, the system enters an acquisition module,
the acquisition module is used for acquiring a video E with a resolution D converted by a video C after the transcoding task is finished;
the video file size judging module is used for judging the sizes of the two video files, the size of the converted video E file is smaller than that of the video C file before conversion because the resolution ratio is converted to be smaller, if the size of the video E file is larger than or equal to that of the video C file, the problem of conversion is shown, a transcoding error report is directly generated and pushed to an operator, and the test is finished; if the size of the video E file is smaller than that of the video C file, entering a video playing time length judging module;
the video playing time length judging module is used for acquiring the playing time lengths of the video C and the video E, judging whether the playing time lengths of the video C and the video E are equal, and entering the first video-to-picture module if the playing time lengths of the video C and the video E are equal; if the transcoding errors are not equal, directly generating a transcoding error report, pushing the transcoding error report to an operator, and ending the test;
the first video-to-picture module is used for converting a video C before transcoding into pictures according to frames, converting the pictures into a plurality of pictures according to the sequence of the frames and representing the pictures by a picture set F;
the second video-to-picture module is used for converting the transcoded video E into pictures according to frames, converting the pictures into a plurality of pictures according to the sequence of the frames and representing the pictures by a picture set G; if the video E fails to convert the picture, directly generating a transcoding error report, pushing the transcoding error report to an operator, and ending the test;
the test system also comprises a picture compression processing module, wherein the picture compression processing module is used for randomly extracting a picture in the picture set G, obtaining the size H of the picture, judging whether the size H is equal to the target resolution D or not, directly generating a transcoding error report if the size H is not equal to the target resolution D, ending the test process, compressing all pictures in the picture set F if the size H is equal to the target resolution D, compressing the sizes of all pictures into the size of the size H, and expressing all the compressed pictures by using the picture set L.
The comparison module is used for compressing the picture set F, comparing random N pictures in the compressed picture set with pictures in the picture set B, and judging that the contents of the two videos are the same when the N pictures have similar pictures with the threshold value of more than B and the similarity of the similar pictures reaches the threshold value of more than A;
and the report display module is used for forming a report for displaying the result of the video comparison.
The threshold value A is 50-60%, the threshold value B is 70-90%, the number of N pictures is 10-20, and N is a natural number.
The comparison module is further specifically: randomly extracting N pictures from the picture set L, wherein each picture needs to be compared with the pictures in the picture set G, the comparison is a group, and the N pictures are N groups; selecting a picture in the picture set L, recording the position number M, and comparing the selected picture with (M-50) th to (M +50) th pictures in the picture set G, wherein if one picture has the picture similarity > -threshold A, namely the picture similarity > -threshold A of the comparison result, if M-50<, then calculating from the first picture.
Further, the comparing of the pictures specifically comprises: assuming that the picture X and the picture Y are compared, and the resolution of both pictures is pxq, the picture is composed of pxq pixels, that is, the picture is divided into p columns and q rows, each column has q rows, the first column and the first row are represented by (1,1), the last column and the last row are represented by (1, q), the last column and the first row are represented by (p,1), and the last column and the last row are represented by (p, q); the picture comparison is to compare pxq pixel points one by one, namely (1,1) of the picture X and (1,1) of the picture Y are compared, and (1,2) of the picture X and (1,2) of the picture Y are compared until (p, q) of the picture X and (p, q) of the picture Y are compared, RGB of each pixel point of the picture is compared, the value error range of the RGB is judged to be within 5, the picture is similar to +1, the error is beyond 5, the picture is dissimilar to +1, until pxq pixel points are compared, and then the total number of the similar pixel points/(the total number of the similar pixel points + the total number of the dissimilar pixel points), and the proportion > is a threshold A, the picture is judged to be similar.
In the present invention, the video format of the video C includes: a flv format, mp4 format, mov format, rmvb format, rm format, avi format, wmv format, asf format, mpg format, mkv format, 3gp format, m4v format, m4a format, vob format, ts format, ogv format, or ogv format.
In a word, the original video C is converted into a picture set F, the transcoded video E is converted into a picture set G, the picture set F is compressed to the size same as that of the picture set G and is converted into a picture set L, then the random picture of the picture set L is compared with the picture set G to judge the similarity of the pictures, and when N pictures have similar pictures with the threshold value of B or more and the similarity of the similar pictures reaches the threshold value of A or more, the contents of the two videos are judged to be the same; the invention can carry out automatic test, reduces labor force and improves working efficiency.
The above description is only a preferred embodiment of the present invention, and all equivalent changes and modifications made in accordance with the claims of the present invention should be covered by the present invention.

Claims (12)

1. A video resolution test method is characterized in that: the test method comprises the following steps:
step S1, submitting a video C needing resolution conversion, and selecting a resolution D needing conversion to a transcoding system;
step S2, acquiring a transcoding task API of the transcoding system, inquiring whether the submitted transcoding task is finished or not, if the transcoding task API is not finished, continuously inquiring the transcoding task API, and if the transcoding is failed, directly generating a transcoding failure report and pushing the transcoding failure report to an operator, and ending the test; if the transcoding is successful, the step 3 is entered,
step S3, after the transcoding task is completed, acquiring a video E of which the resolution D is converted by the video C;
step S4, judging the sizes of the two video files, wherein the size of the converted video E file is smaller than that of the video C file before conversion because the resolution ratio is converted to be smaller, if the size of the video E file is larger than or equal to that of the video C file, the problem of conversion is shown, a transcoding error report is directly generated and pushed to an operator, and the test is finished; if the video E file size is smaller than the video C file size, the step S5 is entered;
s5, acquiring the playing time lengths of the video C and the video E, judging whether the playing time lengths of the video C and the video E are equal, and if the playing time lengths of the video C and the video E are equal, entering the step S6; if the transcoding errors are not equal, directly generating a transcoding error report, pushing the transcoding error report to an operator, and ending the test;
step S6, converting the video C before transcoding into pictures according to frames, converting the pictures into a plurality of pictures according to the sequence of frames, and representing the pictures by using a picture set F;
step S7, converting the transcoded video E into pictures according to frames, converting the pictures into a plurality of pictures according to the sequence of the frames, and representing the pictures by using a picture set G; if the video E fails to convert the picture, directly generating a transcoding error report, pushing the transcoding error report to an operator, and ending the test;
step S8, after the picture set F is compressed, comparing random N pictures in the compressed picture set with pictures in the picture set B, and when the N pictures have similar pictures with the threshold value B or more and the similarity of the similar pictures reaches the threshold value A or more, judging that the contents of the two videos are the same;
and step S9, forming a report by the result of the video comparison and displaying the report.
2. A method for testing video resolution according to claim 1, wherein: the threshold value A is 50-60%, the threshold value B is 70-90%, the number of N pictures is 10-20, and N is a natural number.
3. A method for testing video resolution according to claim 1, wherein: between the step S7 and the step S8, the method further comprises: and step S70, randomly extracting a picture in the picture set G, obtaining the size H of the picture, judging whether the size H is equal to the target resolution D, if not, directly generating a transcoding error report, and ending the test process, if so, compressing all pictures in the picture set F, compressing the sizes of all pictures into the size of the size H, and representing all compressed pictures by the picture set L.
4. A method for testing video resolution according to claim 3, wherein: the step S8 specifically includes: randomly extracting N pictures from the picture set L, wherein each picture needs to be compared with the pictures in the picture set G, the comparison is a group, and the N pictures are N groups; selecting a picture in the picture set L, recording the position number M, and comparing the selected picture with (M-50) th to (M +50) th pictures in the picture set G, wherein if one picture similarity > = threshold A, namely the picture similarity > = threshold A of the comparison result, if M-50< =0, the comparison result is calculated from the first picture.
5. A method for testing video resolution according to claim 4, wherein: the comparison of the pictures specifically comprises the following steps: assuming that the picture X and the picture Y are compared, and the resolution of both pictures is pxq, the picture is composed of pxq pixels, that is, the picture is divided into p columns and q rows, each column has q rows, the first column and the first row are represented by (1,1), the last column and the last row are represented by (1, q), the last column and the first row are represented by (p,1), and the last column and the last row are represented by (p, q); the picture comparison is to compare pxq pixel points one by one, namely comparing (1,1) of the picture X with (1,1) of the picture Y, comparing (1,2) of the picture X with (1,2) of the picture Y until (p, q) of the picture X is compared with (p, q) of the picture Y, comparing RGB of each pixel point of the picture, judging that the value error range of the RGB is within 5, if the picture is similar to +1, if the error is beyond 5, the picture is dissimilar to +1, until pxq pixel points are compared, and then judging that the picture is similar if the total number of similar pixel points/(total number of similar pixel points + total number of dissimilar pixel points), and if the ratio > = threshold A.
6. A method for testing video resolution according to claim 1, wherein: the video format of the video C comprises: a flv format, mp4 format, mov format, rmvb format, rm format, avi format, wmv format, asf format, mpg format, mkv format, 3gp format, m4v format, m4a format, vob format, ts format, ogv format, or ogv format.
7. A video resolution test system, comprising: the test system comprises: the device comprises a submitting module, a query module, an acquisition module, a video file size judgment module, a video playing time judgment module, a first video-to-picture module, a second video-to-picture module, a comparison module and a report display module;
the submitting module is used for submitting the video C with the resolution required to be converted and selecting the resolution D required to be converted to the transcoding system;
the query module is used for acquiring a transcoding task API of the transcoding system, querying whether the submitted transcoding task is completed or not, if the transcoding task is not completed, continuing to query the transcoding task API, and if the transcoding is failed, directly generating a transcoding failure report and pushing the transcoding failure report to an operator, and ending the test; if the transcoding is successful, the system enters an acquisition module,
the acquisition module is used for acquiring a video E with a resolution D converted by a video C after the transcoding task is finished;
the video file size judging module is used for judging the sizes of the two video files, the size of the converted video E file is smaller than that of the video C file before conversion because the resolution ratio is converted to be smaller, if the size of the video E file is larger than or equal to that of the video C file, the problem of conversion is shown, a transcoding error report is directly generated and pushed to an operator, and the test is finished; if the size of the video E file is smaller than that of the video C file, entering a video playing time length judging module;
the video playing time length judging module is used for acquiring the playing time lengths of the video C and the video E, judging whether the playing time lengths of the video C and the video E are equal, and entering the first video-to-picture module if the playing time lengths of the video C and the video E are equal; if the transcoding errors are not equal, directly generating a transcoding error report, pushing the transcoding error report to an operator, and ending the test;
the first video-to-picture module is used for converting a video C before transcoding into pictures according to frames, converting the pictures into a plurality of pictures according to the sequence of the frames and representing the pictures by a picture set F;
the second video-to-picture module is used for converting the transcoded video E into pictures according to frames, converting the pictures into a plurality of pictures according to the sequence of the frames and representing the pictures by a picture set G; if the video E fails to convert the picture, directly generating a transcoding error report, pushing the transcoding error report to an operator, and ending the test;
the comparison module is used for compressing the picture set F, comparing random N pictures in the compressed picture set with pictures in the picture set B, and judging that the contents of the two videos are the same when the N pictures have similar pictures with the threshold value of more than B and the similarity of the similar pictures reaches the threshold value of more than A;
and the report display module is used for forming a report for displaying the result of the video comparison.
8. A video resolution test system according to claim 7, wherein: the threshold value A is 50-60%, the threshold value B is 70-90%, the number of N pictures is 10-20, and N is a natural number.
9. A video resolution test system according to claim 7, wherein: the test system also comprises a picture compression processing module, wherein the picture compression processing module is used for randomly extracting a picture in the picture set G, obtaining the size H of the picture, judging whether the size H is equal to the target resolution D or not, directly generating a transcoding error report if the size H is not equal to the target resolution D, ending the test process, compressing all pictures in the picture set F if the size H is equal to the target resolution D, compressing the sizes of all pictures into the size of the size H, and expressing all the compressed pictures by using the picture set L.
10. A video resolution test system according to claim 9, wherein: the comparison module is further specifically: randomly extracting N pictures from the picture set L, wherein each picture needs to be compared with the pictures in the picture set G, the comparison is a group, and the N pictures are N groups; selecting a picture in the picture set L, recording the position number M, and comparing the selected picture with (M-50) th to (M +50) th pictures in the picture set G, wherein if one picture similarity > = threshold A, namely the picture similarity > = threshold A of the comparison result, if M-50< =0, the comparison result is calculated from the first picture.
11. A video resolution test system according to claim 10, wherein: the comparison of the pictures specifically comprises the following steps: assuming that the picture X and the picture Y are compared, and the resolution of both pictures is pxq, the picture is composed of pxq pixels, that is, the picture is divided into p columns and q rows, each column has q rows, the first column and the first row are represented by (1,1), the last column and the last row are represented by (1, q), the last column and the first row are represented by (p,1), and the last column and the last row are represented by (p, q); the picture comparison is to compare pxq pixel points one by one, namely comparing (1,1) of the picture X with (1,1) of the picture Y, comparing (1,2) of the picture X with (1,2) of the picture Y until (p, q) of the picture X is compared with (p, q) of the picture Y, comparing RGB of each pixel point of the picture, judging that the value error range of the RGB is within 5, if the picture is similar to +1, if the error is beyond 5, the picture is dissimilar to +1, until pxq pixel points are compared, and then judging that the picture is similar if the total number of similar pixel points/(total number of similar pixel points + total number of dissimilar pixel points), and if the ratio > = threshold A.
12. A video resolution test system according to claim 7, wherein: the video format of the video C comprises: a flv format, mp4 format, mov format, rmvb format, rm format, avi format, wmv format, asf format, mpg format, mkv format, 3gp format, m4v format, m4a format, vob format, ts format, ogv format, or ogv format.
CN201910950763.5A 2019-10-08 2019-10-08 Method and system for testing resolution conversion of video Active CN112637583B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910950763.5A CN112637583B (en) 2019-10-08 2019-10-08 Method and system for testing resolution conversion of video

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910950763.5A CN112637583B (en) 2019-10-08 2019-10-08 Method and system for testing resolution conversion of video

Publications (2)

Publication Number Publication Date
CN112637583A true CN112637583A (en) 2021-04-09
CN112637583B CN112637583B (en) 2022-11-08

Family

ID=75283418

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910950763.5A Active CN112637583B (en) 2019-10-08 2019-10-08 Method and system for testing resolution conversion of video

Country Status (1)

Country Link
CN (1) CN112637583B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104540000A (en) * 2014-12-04 2015-04-22 广东欧珀移动通信有限公司 Method for generating dynamic thumbnail and terminal
CN105681898A (en) * 2015-12-31 2016-06-15 北京奇艺世纪科技有限公司 Similar video and pirated video detection method and device
CN110049313A (en) * 2019-04-17 2019-07-23 微梦创科网络科技(中国)有限公司 A kind of video measurement method and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104540000A (en) * 2014-12-04 2015-04-22 广东欧珀移动通信有限公司 Method for generating dynamic thumbnail and terminal
CN105681898A (en) * 2015-12-31 2016-06-15 北京奇艺世纪科技有限公司 Similar video and pirated video detection method and device
CN110049313A (en) * 2019-04-17 2019-07-23 微梦创科网络科技(中国)有限公司 A kind of video measurement method and system

Also Published As

Publication number Publication date
CN112637583B (en) 2022-11-08

Similar Documents

Publication Publication Date Title
US10522049B2 (en) Image synchronous display method and device
CN102026017B (en) Efficient test method for video decoding
CN110868625A (en) Video playing method and device, electronic equipment and storage medium
US10602203B2 (en) Adaptive bit rate mobile video objective testing
CN108235055B (en) Method and device for realizing transparent video in AR scene
CN105704508A (en) Video merging method and device
CN106303634A (en) A kind of TV equipment barrage sends system and method
CN110662086A (en) 5G high-definition live broadcast system and video processing method
US8810725B2 (en) Process for digitizing video over analog component video cables
US8873642B2 (en) Video content analysis methods and systems
CN112637583B (en) Method and system for testing resolution conversion of video
CN102769732A (en) Method for converting video fields
US20150373301A1 (en) Input file transformer
US8855444B2 (en) Method for partitioning and processing a digital image
CN111818338B (en) Abnormal display detection method, device, equipment and medium
JP5808485B2 (en) Mobile terminal recording method, related apparatus and system
CN111757142B (en) Video playing system based on picture cutting of cloud streaming media
US20070127846A1 (en) Apparatus and method for sub-picture processing by performing at least scaling and pixel data encoding
CN101159840A (en) Method and device of adding advertisement data to digital television data
WO2019196573A1 (en) Streaming media transcoding method and apparatus, and computer device and readable medium
CN106954073B (en) Video data input and output method, device and system
CN115225928B (en) Multi-type audio and video mixed broadcasting system and method
US20220191522A1 (en) Video processing method and device
CN112584156B (en) Transcoding 4K video algorithm based on 2K video data deep learning
CN101652989B (en) Method and apparatus of referring to stream included in other saf session for light application scene representation (LASeR) service and apparatus and method for providing light application scene representation (LASeR) service

Legal Events

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