charujain | 0f01c7f | 2016-12-02 13:00:00 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license |
| 5 | * that can be found in the LICENSE file in the root of the source |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | #include <stdio.h> |
| 11 | #include <stdlib.h> |
charujain | 0f01c7f | 2016-12-02 13:00:00 | [diff] [blame] | 12 | |
Mirko Bonadei | 6d6b0fb | 2019-06-25 06:49:03 | [diff] [blame] | 13 | #include <string> |
| 14 | |
| 15 | #include "absl/flags/flag.h" |
| 16 | #include "absl/flags/parse.h" |
Mirko Bonadei | 7ddca16 | 2019-07-19 08:32:16 | [diff] [blame] | 17 | #include "absl/flags/usage.h" |
Mirko Bonadei | 92ea95e | 2017-09-15 04:47:31 | [diff] [blame] | 18 | #include "rtc_tools/frame_analyzer/reference_less_video_analysis_lib.h" |
Mirko Bonadei | 6d6b0fb | 2019-06-25 06:49:03 | [diff] [blame] | 19 | |
| 20 | ABSL_FLAG(std::string, |
| 21 | video_file, |
| 22 | "", |
| 23 | "Path of the video file to be analyzed, only y4m file format is " |
| 24 | "supported"); |
charujain | 0f01c7f | 2016-12-02 13:00:00 | [diff] [blame] | 25 | |
Robin Raymond | 1c62ffa | 2017-12-03 21:45:56 | [diff] [blame] | 26 | int main(int argc, char* argv[]) { |
Mirko Bonadei | 7ddca16 | 2019-07-19 08:32:16 | [diff] [blame] | 27 | absl::SetProgramUsageMessage( |
| 28 | "Outputs the freezing score by comparing " |
| 29 | "current frame with the previous frame.\n" |
| 30 | "Example usage:\n" |
| 31 | "./reference_less_video_analysis " |
| 32 | "--video_file=video_file.y4m\n"); |
Mirko Bonadei | 6d6b0fb | 2019-06-25 06:49:03 | [diff] [blame] | 33 | absl::ParseCommandLine(argc, argv); |
charujain | 0f01c7f | 2016-12-02 13:00:00 | [diff] [blame] | 34 | |
Mirko Bonadei | 6d6b0fb | 2019-06-25 06:49:03 | [diff] [blame] | 35 | std::string video_file = absl::GetFlag(FLAGS_video_file); |
| 36 | if (video_file.empty()) { |
| 37 | exit(EXIT_FAILURE); |
charujain | 0f01c7f | 2016-12-02 13:00:00 | [diff] [blame] | 38 | } |
charujain | 0f01c7f | 2016-12-02 13:00:00 | [diff] [blame] | 39 | |
| 40 | return run_analysis(video_file); |
| 41 | } |