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 |
Eric Willigers | c2e3d881 | 2022-01-17 01:59:37 | [diff] [blame] | 10 | [GoogleTest](https://github.com/google/googletest/blob/main/README.md) |
David Staessens | f3404c1 | 2019-04-16 00:12:05 | [diff] [blame] | 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 | |
Fei Shao | d8c7371 | 2023-09-12 04:46:30 | [diff] [blame] | 20 | tast run $HOST video.ChromeStackDecoder* |
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: |
Fei Shao | d8c7371 | 2023-09-12 04:46:30 | [diff] [blame] | 23 | * Run all VP8 tests: `tast run $HOST video.ChromeStackDecoder.vp8*` |
| 24 | * Run all VP9 profile 2 tests: `tast run $HOST video.ChromeStackDecoder.vp9_2*` |
David Staessens | f3404c1 | 2019-04-16 00:12:05 | [diff] [blame] | 25 | |
| 26 | Check the |
Fei Shao | d8c7371 | 2023-09-12 04:46:30 | [diff] [blame] | 27 | [tast video folder](https://chromium.googlesource.com/chromiumos/platform/tast-tests/+/refs/heads/main/src/go.chromium.org/tast-tests/cros/local/bundles/cros/video/) |
David Staessens | f3404c1 | 2019-04-16 00:12:05 | [diff] [blame] | 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 | |
David Staessens | f3404c1 | 2019-04-16 00:12:05 | [diff] [blame] | 33 | ## Running manually |
| 34 | To run the video decoder tests manually the _video_decode_accelerator_tests_ |
| 35 | target needs to be built and deployed to the device being tested. Running |
| 36 | the video decoder tests can be done by executing: |
| 37 | |
| 38 | ./video_decode_accelerator_tests [<video path>] [<video metadata path>] |
| 39 | |
| 40 | e.g.: `./video_decode_accelerator_tests test-25fps.h264` |
| 41 | |
| 42 | __Test videos:__ Test videos are present for multiple codecs in the |
| 43 | [_media/test/data_](https://cs.chromium.org/chromium/src/media/test/data/) |
| 44 | folder in Chromium's source tree (e.g. |
| 45 | [_test-25fps.vp8_](https://cs.chromium.org/chromium/src/media/test/data/test-25fps.vp8)). |
| 46 | If no video is specified _test-25fps.h264_ will be used. |
| 47 | |
| 48 | __Video Metadata:__ These videos also have an accompanying metadata _.json_ file |
| 49 | that needs to be deployed alongside the test video. They can also be found in |
| 50 | the _media/test/data_ folder (e.g. |
| 51 | [_test-25fps.h264.json_](https://cs.chromium.org/chromium/src/media/test/data/test-25fps.h264.json)). |
| 52 | If no metadata file is specified _\<video path\>.json_ will be used. The video |
| 53 | metadata file contains info about the video such as its codec profile, |
| 54 | dimensions, number of frames and a list of md5 frame checksums to validate |
| 55 | decoded frames. These frame checksums can be generated using ffmpeg, e.g.: |
| 56 | `ffmpeg -i test-25fps.h264 -f framemd5 test-25fps.h264.frames.md5`. |
| 57 | |
| 58 | ## Command line options |
| 59 | Multiple command line arguments can be given to the command: |
| 60 | |
Jeff Chen | 72246b3 | 2022-01-05 01:05:06 | [diff] [blame] | 61 | -v enable verbose mode, e.g. -v=2. |
Jeff Chen | e124dead | 2021-12-22 22:13:41 | [diff] [blame] | 62 | --vmodule enable verbose mode for the specified module, |
| 63 | e.g. --vmodule=*media/gpu*=2. |
David Staessens | d59cd9c | 2019-10-04 04:48:39 | [diff] [blame] | 64 | |
Jeff Chen | 72246b3 | 2022-01-05 01:05:06 | [diff] [blame] | 65 | --validator_type validate decoded frames, possible values are |
Jeff Chen | e124dead | 2021-12-22 22:13:41 | [diff] [blame] | 66 | md5 (default, compare against md5hash of expected |
| 67 | frames), ssim (compute SSIM against expected |
| 68 | frames, currently allowed for AV1 streams only) |
| 69 | and none (disable frame validation). |
| 70 | --use-legacy use the legacy VDA-based video decoders. |
Jeff Chen | e124dead | 2021-12-22 22:13:41 | [diff] [blame] | 71 | --use_vd_vda use the new VD-based video decoders with a |
| 72 | wrapper that translates to the VDA interface, |
| 73 | used to test interaction with older components |
| 74 | --linear_output use linear buffers as the final output of the |
| 75 | decoder which may require the use of an image |
| 76 | processor internally. This flag only works in |
| 77 | conjunction with --use_vd_vda. |
| 78 | Disabled by default. |
| 79 | --output_frames write the selected video frames to disk, possible |
| 80 | values are "all|corrupt". |
| 81 | --output_format set the format of frames saved to disk, supported |
| 82 | formats are "png" (default) and "yuv". |
| 83 | --output_limit limit the number of frames saved to disk. |
| 84 | --output_folder set the folder used to store frames, defaults to |
| 85 | "<testname>". |
Chen-Yu Tsai | 0cc7e91 | 2022-11-29 18:54:40 | [diff] [blame] | 86 | --use-gl specify which GPU backend to use, possible values |
| 87 | include desktop (GLX), egl (GLES w/ ANGLE), and |
| 88 | swiftshader (software rendering) |
| 89 | --ozone-platform specify which Ozone platform to use, possible values |
| 90 | depend on build configuration but normally include |
| 91 | x11, drm, wayland, and headless |
David Staessens | d59cd9c | 2019-10-04 04:48:39 | [diff] [blame] | 92 | |
Jeff Chen | e124dead | 2021-12-22 22:13:41 | [diff] [blame] | 93 | --gtest_help display the gtest help and exit. |
| 94 | --help display this help and exit. |
David Staessens | f3404c1 | 2019-04-16 00:12:05 | [diff] [blame] | 95 | |
| 96 | ## Source code |
Hang Nguyen | e703182 | 2024-06-21 02:12:07 | [diff] [blame] | 97 | See the video decoder tests [source code](https://cs.chromium.org/chromium/src/media/gpu/test/video_decode_accelerator_tests.cc). |