David Staessens | 38dba3c | 2020-05-26 08:56:27 | [diff] [blame] | 1 | # Video Encoder tests |
| 2 | The video encoder tests are a set of tests that validate various video encoding |
David Staessens | a3ed4f2 | 2020-05-29 05:20:50 | [diff] [blame] | 3 | scenarios. They are accompanied by the video encoder performance tests that can |
| 4 | be used to measure a video encoder's performance. |
| 5 | |
| 6 | These tests run directly on top of the video encoder implementation, and |
David Staessens | 38dba3c | 2020-05-26 08:56:27 | [diff] [blame] | 7 | don't require the full Chrome browser stack. They are built on top of the |
| 8 | [GoogleTest](https://github.com/google/googletest/blob/master/README.md) |
| 9 | framework. |
| 10 | |
| 11 | __Note:__ Currently these tests are under development and functionality is still |
| 12 | limited. |
| 13 | |
| 14 | [TOC] |
| 15 | |
| 16 | ## Running from Tast |
| 17 | Running these tests from Tast is not supported yet. |
| 18 | |
| 19 | ## Running manually |
| 20 | To run the video encoder tests manually the _video_encode_accelerator_tests_ |
| 21 | target needs to be built and deployed to the device being tested. Running |
| 22 | the video encoder tests can be done by executing: |
| 23 | |
| 24 | ./video_encode_accelerator_tests [<video path>] [<video metadata path>] |
| 25 | |
| 26 | e.g.: `./video_encode_accelerator_tests bear_320x192_40frames.yuv.webm` |
| 27 | |
David Staessens | a3ed4f2 | 2020-05-29 05:20:50 | [diff] [blame] | 28 | Running the video encoder performance tests can be done in a smilar way by |
| 29 | building, deploying and executing the _video_encode_accelerator_perf_tests_ |
| 30 | target. |
| 31 | |
| 32 | ./video_encode_accelerator_perf_tests [<video path>] [<video metadata path>] |
| 33 | |
| 34 | e.g.: `./video_encode_accelerator_perf_tests bear_320x192_40frames.yuv.webm` |
| 35 | |
David Staessens | 38dba3c | 2020-05-26 08:56:27 | [diff] [blame] | 36 | __Test videos:__ Various test videos are present in the |
| 37 | [_media/test/data_](https://cs.chromium.org/chromium/src/media/test/data/) |
| 38 | folder in Chromium's source tree (e.g. |
| 39 | [_bear_320x192_40frames.yuv.webm_](https://cs.chromium.org/chromium/src/media/test/data/bear_320x192_40frames.yuv.webm)). |
| 40 | These videos are stored in compressed format and extracted at the start of each |
| 41 | test run, as storing uncompressed videos requires a lot of disk space. Currently |
| 42 | only VP9 or uncompressed videos are supported as test input. If no video is |
| 43 | specified _bear_320x192_40frames.yuv.webm_ will be used. |
| 44 | |
| 45 | __Video Metadata:__ These videos also have an accompanying metadata _.json_ file |
| 46 | that needs to be deployed alongside the test video. The video metadata file is a |
| 47 | simple json file that contains info about the video such as its pixel format, |
| 48 | dimensions, framerate and number of frames. These can also be found in the |
| 49 | _media/test/data_ folder (e.g. |
| 50 | [_bear_320x192_40frames.yuv.webm.json_](https://cs.chromium.org/chromium/src/media/test/data/bear_320x192_40frames.yuv.webm.json)). |
| 51 | If no metadata file is specified _\<video path\>.json_ will be used. |
| 52 | |
| 53 | ## Command line options |
| 54 | Multiple command line arguments can be given to the command: |
| 55 | |
David Staessens | 96a0008 | 2020-06-01 01:46:36 | [diff] [blame] | 56 | --codec codec profile to encode, "h264 (baseline)", |
| 57 | "h264main, "h264high", "vp8" and "vp9" |
David Staessens | b0a9528 | 2020-06-11 00:46:33 | [diff] [blame^] | 58 | |
David Staessens | 38dba3c | 2020-05-26 08:56:27 | [diff] [blame] | 59 | -v enable verbose mode, e.g. -v=2. |
| 60 | --vmodule enable verbose mode for the specified module, |
| 61 | e.g. --vmodule=*media/gpu*=2. |
David Staessens | b0a9528 | 2020-06-11 00:46:33 | [diff] [blame^] | 62 | |
David Staessens | 38dba3c | 2020-05-26 08:56:27 | [diff] [blame] | 63 | --gtest_help display the gtest help and exit. |
| 64 | --help display this help and exit. |
| 65 | |
David Staessens | b0a9528 | 2020-06-11 00:46:33 | [diff] [blame^] | 66 | Non-performance tests only: |
| 67 | |
| 68 | --disable_validator disable validation of encoded bitstream. |
| 69 | |
David Staessens | 38dba3c | 2020-05-26 08:56:27 | [diff] [blame] | 70 | ## Source code |
| 71 | See the video encoder tests [source code](https://cs.chromium.org/chromium/src/media/gpu/video_encode_accelerator_tests.cc). |
David Staessens | a3ed4f2 | 2020-05-29 05:20:50 | [diff] [blame] | 72 | See the video encoder performance tests [source code](https://cs.chromium.org/chromium/src/media/gpu/video_encode_accelerator_perf_tests.cc). |
David Staessens | 38dba3c | 2020-05-26 08:56:27 | [diff] [blame] | 73 | |