diff --git a/examples/androidtests/video_quality_loopback_test.py b/examples/androidtests/video_quality_loopback_test.py index 52ae3b1f6f..225f885273 100755 --- a/examples/androidtests/video_quality_loopback_test.py +++ b/examples/androidtests/video_quality_loopback_test.py @@ -165,6 +165,8 @@ def SetUpTools(android_device, temp_dir, processes): def RunTest(android_device, adb_path, build_dir, temp_dir, num_retries, chartjson_result_file): ffmpeg_path = os.path.join(TOOLCHAIN_DIR, 'ffmpeg') + def ConvertVideo(input_video, output_video): + _RunCommand([ffmpeg_path, '-y', '-i', input_video, output_video]) # Start loopback call and record video. test_script = os.path.join( @@ -181,6 +183,13 @@ def RunTest(android_device, adb_path, build_dir, temp_dir, num_retries, reference_video = os.path.join(SRC_DIR, 'resources', 'reference_video_640x360_30fps.y4m') + test_video_yuv = os.path.join(temp_dir, 'test_video.yuv') + reference_video_yuv = os.path.join( + temp_dir, 'reference_video_640x360_30fps.yuv') + + ConvertVideo(test_video, test_video_yuv) + ConvertVideo(reference_video, reference_video_yuv) + # Run comparison script. compare_script = os.path.join(SRC_DIR, 'rtc_tools', 'compare_videos.py') frame_analyzer = os.path.join(TOOLCHAIN_DIR, 'frame_analyzer') @@ -189,8 +198,8 @@ def RunTest(android_device, adb_path, build_dir, temp_dir, num_retries, stats_file_test = os.path.join(temp_dir, 'stats_test.txt') args = [ - '--ref_video', reference_video, - '--test_video', test_video, + '--ref_video', reference_video_yuv, + '--test_video', test_video_yuv, '--yuv_frame_width', '640', '--yuv_frame_height', '360', '--stats_file_ref', stats_file_ref, diff --git a/resources/video_quality_analysis_frame.txt.sha1 b/resources/video_quality_analysis_frame.txt.sha1 new file mode 100644 index 0000000000..e4a7c73280 --- /dev/null +++ b/resources/video_quality_analysis_frame.txt.sha1 @@ -0,0 +1 @@ +4d1ac894f1743af8059e8d8ae2465f6eaa1790b0 \ No newline at end of file diff --git a/rtc_tools/BUILD.gn b/rtc_tools/BUILD.gn index 4eb292aa73..99f1ae6b4f 100644 --- a/rtc_tools/BUILD.gn +++ b/rtc_tools/BUILD.gn @@ -17,7 +17,6 @@ group("rtc_tools") { ":command_line_parser", ":frame_analyzer", ":video_quality_analysis", - ":y4m_file_reader", ] if (!build_with_chromium) { deps += [ @@ -60,34 +59,14 @@ rtc_static_library("command_line_parser") { ] } -rtc_static_library("y4m_file_reader") { - sources = [ - "y4m_file_reader.cc", - "y4m_file_reader.h", - ] - deps = [ - "../api/video:video_frame", - "../api/video:video_frame_i420", - "../rtc_base:rtc_base_approved", - "//third_party/abseil-cpp/absl/types:optional", - ] -} - rtc_static_library("video_quality_analysis") { sources = [ "frame_analyzer/video_quality_analysis.cc", "frame_analyzer/video_quality_analysis.h", - "frame_analyzer/video_temporal_aligner.cc", - "frame_analyzer/video_temporal_aligner.h", ] deps = [ - ":y4m_file_reader", - "../api/video:video_frame_i420", "../common_video", - "../rtc_base:checks", - "../rtc_base:rtc_base_approved", "../test:perf_test", - "//third_party/abseil-cpp/absl/types:optional", "//third_party/libyuv", ] } @@ -101,7 +80,6 @@ rtc_executable("frame_analyzer") { deps = [ ":command_line_parser", ":video_quality_analysis", - ":y4m_file_reader", "../test:perf_test", "//build/win:default_exe_manifest", ] @@ -118,7 +96,6 @@ if (!build_with_chromium) { deps = [ ":command_line_parser", ":video_quality_analysis", - ":y4m_file_reader", "//build/win:default_exe_manifest", ] } @@ -131,7 +108,6 @@ if (!build_with_chromium) { deps = [ ":video_quality_analysis", - ":y4m_file_reader", ] } @@ -312,7 +288,7 @@ if (rtc_include_tests) { tools_unittests_resources = [ "../resources/foreman_cif.yuv", "../resources/reference_less_video_test_file.y4m", - "../resources/reference_video_640x360_30fps.y4m", + "../resources/video_quality_analysis_frame.txt", ] if (is_ios) { @@ -331,11 +307,9 @@ if (rtc_include_tests) { sources = [ "frame_analyzer/reference_less_video_analysis_unittest.cc", "frame_analyzer/video_quality_analysis_unittest.cc", - "frame_analyzer/video_temporal_aligner_unittest.cc", "frame_editing/frame_editing_unittest.cc", "sanitizers_unittest.cc", "simple_command_line_parser_unittest.cc", - "y4m_file_reader_unittest.cc", ] if (!build_with_chromium && is_clang) { @@ -348,7 +322,6 @@ if (rtc_include_tests) { ":frame_editing_lib", ":reference_less_video_analysis_lib", ":video_quality_analysis", - ":y4m_file_reader", "../common_video:common_video", "../rtc_base", "../rtc_base:checks", diff --git a/rtc_tools/barcode_tools/barcode_decoder.py b/rtc_tools/barcode_tools/barcode_decoder.py index 6be0f5d350..2abd677b4b 100755 --- a/rtc_tools/barcode_tools/barcode_decoder.py +++ b/rtc_tools/barcode_tools/barcode_decoder.py @@ -44,13 +44,9 @@ def ConvertYuvToPngFiles(yuv_file_name, yuv_frame_width, yuv_frame_height, output_files_pattern = os.path.join(output_directory, 'frame_%04d.png') if not ffmpeg_path: ffmpeg_path = 'ffmpeg.exe' if sys.platform == 'win32' else 'ffmpeg' - if yuv_file_name.endswith('.yuv'): - command = [ffmpeg_path, '-s', '%s' % size_string, '-i', '%s' - % yuv_file_name, '-f', 'image2', '-vcodec', 'png', - '%s' % output_files_pattern] - else: - command = [ffmpeg_path, '-i', '%s' % yuv_file_name, '-f', 'image2', - '-vcodec', 'png', '%s' % output_files_pattern] + command = [ffmpeg_path, '-s', '%s' % size_string, '-i', '%s' + % yuv_file_name, '-f', 'image2', '-vcodec', 'png', + '%s' % output_files_pattern] try: print 'Converting YUV file to PNG images (may take a while)...' print ' '.join(command) diff --git a/rtc_tools/frame_analyzer/frame_analyzer.cc b/rtc_tools/frame_analyzer/frame_analyzer.cc index 443a8681a7..b3d9b94b0a 100644 --- a/rtc_tools/frame_analyzer/frame_analyzer.cc +++ b/rtc_tools/frame_analyzer/frame_analyzer.cc @@ -16,16 +16,19 @@ #include #include "rtc_tools/frame_analyzer/video_quality_analysis.h" -#include "rtc_tools/frame_analyzer/video_temporal_aligner.h" #include "rtc_tools/simple_command_line_parser.h" -#include "rtc_tools/y4m_file_reader.h" #include "test/testsupport/perf_test.h" /* * A command line tool running PSNR and SSIM on a reference video and a test * video. The test video is a record of the reference video which can start at * an arbitrary point. It is possible that there will be repeated frames or - * skipped frames as well. The video files should be 1420 Y4M videos. + * skipped frames as well. In order to have a way to compare corresponding + * frames from the two videos, two stats files should be provided. One for the + * reference video and one for the test video. The stats file + * is a text file assumed to be in the format: + * frame_xxxx yyyy where xxxx is the frame number in and yyyy is the + * corresponding barcode. The video files should be 1420 YUV videos. * The tool prints the result to standard output in the Chromium perf format: * RESULT :