David Staessens | f3404c1 | 2019-04-16 00:12:05 | [diff] [blame] | 1 | # Video Decoder tests |
| 2 | |
| 3 | The video decoder tests are a set of tests used to validate various video |
| 4 | decoder implementations. Multiple scenarios are tested, and the resulting |
| 5 | decoded frames are validated against known checksums. These tests run directly |
| 6 | on top of the video decoder implementation, and don't require the full Chrome |
| 7 | browser stack. They can be very useful when adding support for a new codec or |
| 8 | platform, or to make sure code changes don't break existing functionality. They |
| 9 | are build on top of the |
| 10 | [GoogleTest](https://github.com/google/googletest/blob/master/README.md) |
| 11 | framework. |
| 12 | |
| 13 | [TOC] |
| 14 | |
| 15 | ## Running from Tast |
| 16 | The Tast framework provides an easy way to run the video decoder tests from a |
| 17 | ChromeOS chroot. Test data is automatically deployed to the device being tested. |
David Staessens | a3d4a64 | 2019-08-27 08:20:45 | [diff] [blame] | 18 | To run all video decoder tests use: |
David Staessens | f3404c1 | 2019-04-16 00:12:05 | [diff] [blame] | 19 | |
David Staessens | a3d4a64 | 2019-08-27 08:20:45 | [diff] [blame] | 20 | tast run $HOST video.DecodeAccelH264* video.DecodeAccelVP* |
David Staessens | f3404c1 | 2019-04-16 00:12:05 | [diff] [blame] | 21 | |
David Staessens | a3d4a64 | 2019-08-27 08:20:45 | [diff] [blame] | 22 | Wildcards can be used to run specific sets of tests: |
| 23 | * Run all VP8 tests: `tast run $HOST video.DecodeAccelVP8*` |
| 24 | * Run all VP9 profile 2 tests: `tast run $HOST video.DecodeAccelVP92*` |
David Staessens | f3404c1 | 2019-04-16 00:12:05 | [diff] [blame] | 25 | |
| 26 | Check the |
| 27 | [tast video folder](https://chromium.googlesource.com/chromiumos/platform/tast-tests/+/refs/heads/master/src/chromiumos/tast/local/bundles/cros/video/) |
| 28 | for a list of all available tests. |
| 29 | See the |
| 30 | [Tast quickstart guide](https://chromium.googlesource.com/chromiumos/platform/tast/+/HEAD/docs/quickstart.md) |
| 31 | for more information about the Tast framework. |
| 32 | |
| 33 | __Note:__ Tast tests are currently being migrated from the |
| 34 | _video_decode_accelerator_unittest_ to the new _video_decode_accelerator_tests_ |
| 35 | binary. Check the [documentation](vdatest_usage.md) for more info about the old |
| 36 | video decode accelerator tests. |
| 37 | |
| 38 | ## Running manually |
| 39 | To run the video decoder tests manually the _video_decode_accelerator_tests_ |
| 40 | target needs to be built and deployed to the device being tested. Running |
| 41 | the video decoder tests can be done by executing: |
| 42 | |
| 43 | ./video_decode_accelerator_tests [<video path>] [<video metadata path>] |
| 44 | |
| 45 | e.g.: `./video_decode_accelerator_tests test-25fps.h264` |
| 46 | |
| 47 | __Test videos:__ Test videos are present for multiple codecs in the |
| 48 | [_media/test/data_](https://cs.chromium.org/chromium/src/media/test/data/) |
| 49 | folder in Chromium's source tree (e.g. |
| 50 | [_test-25fps.vp8_](https://cs.chromium.org/chromium/src/media/test/data/test-25fps.vp8)). |
| 51 | If no video is specified _test-25fps.h264_ will be used. |
| 52 | |
| 53 | __Video Metadata:__ These videos also have an accompanying metadata _.json_ file |
| 54 | that needs to be deployed alongside the test video. They can also be found in |
| 55 | the _media/test/data_ folder (e.g. |
| 56 | [_test-25fps.h264.json_](https://cs.chromium.org/chromium/src/media/test/data/test-25fps.h264.json)). |
| 57 | If no metadata file is specified _\<video path\>.json_ will be used. The video |
| 58 | metadata file contains info about the video such as its codec profile, |
| 59 | dimensions, number of frames and a list of md5 frame checksums to validate |
| 60 | decoded frames. These frame checksums can be generated using ffmpeg, e.g.: |
| 61 | `ffmpeg -i test-25fps.h264 -f framemd5 test-25fps.h264.frames.md5`. |
| 62 | |
| 63 | ## Command line options |
| 64 | Multiple command line arguments can be given to the command: |
| 65 | |
| 66 | -v enable verbose mode, e.g. -v=2. |
| 67 | --vmodule enable verbose mode for the specified module, |
| 68 | e.g. --vmodule=*media/gpu*=2. |
David Staessens | d59cd9c | 2019-10-04 04:48:39 | [diff] [blame^] | 69 | |
David Staessens | 78d7ad31e | 2019-07-11 01:50:46 | [diff] [blame] | 70 | --disable_validator disable frame validation. |
David Staessens | f3404c1 | 2019-04-16 00:12:05 | [diff] [blame] | 71 | --use_vd use the new VD-based video decoders, instead of |
| 72 | the default VDA-based video decoders. |
David Staessens | d59cd9c | 2019-10-04 04:48:39 | [diff] [blame^] | 73 | |
| 74 | --output_frames write the selected video frames to disk, possible |
| 75 | values are "all|corrupt". |
| 76 | --output_format set the format of frames saved to disk, supported |
| 77 | formats are "png" (default) and "yuv". |
| 78 | --output_limit limit the number of frames saved to disk. |
| 79 | --output_folder set the folder used to store frames, defaults to |
| 80 | "<testname>" |
| 81 | |
David Staessens | f3404c1 | 2019-04-16 00:12:05 | [diff] [blame] | 82 | --gtest_help display the gtest help and exit. |
| 83 | --help display this help and exit. |
| 84 | |
| 85 | ## Source code |
| 86 | See the video decoder tests [source code](https://cs.chromium.org/chromium/src/media/gpu/video_decode_accelerator_tests.cc). |
| 87 | |