blob: 8afe55968577b00e6b3953b9c760e3c3bc807bf1 [file] [log] [blame] [view]
David Staessensf3404c12019-04-16 00:12:051# Video Decoder tests
2
3The video decoder tests are a set of tests used to validate various video
4decoder implementations. Multiple scenarios are tested, and the resulting
5decoded frames are validated against known checksums. These tests run directly
6on top of the video decoder implementation, and don't require the full Chrome
7browser stack. They can be very useful when adding support for a new codec or
8platform, or to make sure code changes don't break existing functionality. They
9are build on top of the
10[GoogleTest](https://github.com/google/googletest/blob/master/README.md)
11framework.
12
13[TOC]
14
15## Running from Tast
16The Tast framework provides an easy way to run the video decoder tests from a
17ChromeOS chroot. Test data is automatically deployed to the device being tested.
David Staessensa3d4a642019-08-27 08:20:4518To run all video decoder tests use:
David Staessensf3404c12019-04-16 00:12:0519
David Staessensa3d4a642019-08-27 08:20:4520 tast run $HOST video.DecodeAccelH264* video.DecodeAccelVP*
David Staessensf3404c12019-04-16 00:12:0521
David Staessensa3d4a642019-08-27 08:20:4522Wildcards 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 Staessensf3404c12019-04-16 00:12:0525
26Check the
John Palmer046f9872021-05-24 01:24:5627[tast video folder](https://chromium.googlesource.com/chromiumos/platform/tast-tests/+/refs/heads/main/src/chromiumos/tast/local/bundles/cros/video/)
David Staessensf3404c12019-04-16 00:12:0528for a list of all available tests.
29See the
30[Tast quickstart guide](https://chromium.googlesource.com/chromiumos/platform/tast/+/HEAD/docs/quickstart.md)
31for more information about the Tast framework.
32
David Staessensf3404c12019-04-16 00:12:0533## Running manually
34To run the video decoder tests manually the _video_decode_accelerator_tests_
35target needs to be built and deployed to the device being tested. Running
36the video decoder tests can be done by executing:
37
38 ./video_decode_accelerator_tests [<video path>] [<video metadata path>]
39
40e.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/)
44folder in Chromium's source tree (e.g.
45[_test-25fps.vp8_](https://cs.chromium.org/chromium/src/media/test/data/test-25fps.vp8)).
46If no video is specified _test-25fps.h264_ will be used.
47
48__Video Metadata:__ These videos also have an accompanying metadata _.json_ file
49that needs to be deployed alongside the test video. They can also be found in
50the _media/test/data_ folder (e.g.
51[_test-25fps.h264.json_](https://cs.chromium.org/chromium/src/media/test/data/test-25fps.h264.json)).
52If no metadata file is specified _\<video path\>.json_ will be used. The video
53metadata file contains info about the video such as its codec profile,
54dimensions, number of frames and a list of md5 frame checksums to validate
55decoded 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
59Multiple command line arguments can be given to the command:
60
Jeff Chen72246b32022-01-05 01:05:0661 -v enable verbose mode, e.g. -v=2.
Jeff Chene124dead2021-12-22 22:13:4162 --vmodule enable verbose mode for the specified module,
63 e.g. --vmodule=*media/gpu*=2.
David Staessensd59cd9c2019-10-04 04:48:3964
Jeff Chen72246b32022-01-05 01:05:0665 --validator_type validate decoded frames, possible values are
Jeff Chene124dead2021-12-22 22:13:4166 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.
71 --use_vd use the new VD-based video decoders.
72 (enabled by default)
73 --use_vd_vda use the new VD-based video decoders with a
74 wrapper that translates to the VDA interface,
75 used to test interaction with older components
76 --linear_output use linear buffers as the final output of the
77 decoder which may require the use of an image
78 processor internally. This flag only works in
79 conjunction with --use_vd_vda.
80 Disabled by default.
81 --output_frames write the selected video frames to disk, possible
82 values are "all|corrupt".
83 --output_format set the format of frames saved to disk, supported
84 formats are "png" (default) and "yuv".
85 --output_limit limit the number of frames saved to disk.
86 --output_folder set the folder used to store frames, defaults to
87 "<testname>".
88 --disable_vaapi_lock disable the global VA-API lock if applicable,
89 i.e., only on devices that use the VA-API with a libva
90 backend that's known to be thread-safe and only in
91 portions of the Chrome stack that should be able to
92 deal with the absence of the lock
93 (not the VaapiVideoDecodeAccelerator).
David Staessensd59cd9c2019-10-04 04:48:3994
Jeff Chene124dead2021-12-22 22:13:4195 --gtest_help display the gtest help and exit.
96 --help display this help and exit.
David Staessensf3404c12019-04-16 00:12:0597
98## Source code
99See the video decoder tests [source code](https://cs.chromium.org/chromium/src/media/gpu/video_decode_accelerator_tests.cc).