blob: f09c117200ed1c355201295eb68cafda510c0c21 [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.
18
19 tast run <host> video.<test_name>
20
21e.g.: `tast run $HOST video.DecodeAccelH264`
22
23Check the
24[tast video folder](https://chromium.googlesource.com/chromiumos/platform/tast-tests/+/refs/heads/master/src/chromiumos/tast/local/bundles/cros/video/)
25for a list of all available tests.
26See the
27[Tast quickstart guide](https://chromium.googlesource.com/chromiumos/platform/tast/+/HEAD/docs/quickstart.md)
28for more information about the Tast framework.
29
30__Note:__ Tast tests are currently being migrated from the
31_video_decode_accelerator_unittest_ to the new _video_decode_accelerator_tests_
32binary. Check the [documentation](vdatest_usage.md) for more info about the old
33video decode accelerator tests.
34
35## Running manually
36To run the video decoder tests manually the _video_decode_accelerator_tests_
37target needs to be built and deployed to the device being tested. Running
38the video decoder tests can be done by executing:
39
40 ./video_decode_accelerator_tests [<video path>] [<video metadata path>]
41
42e.g.: `./video_decode_accelerator_tests test-25fps.h264`
43
44__Test videos:__ Test videos are present for multiple codecs in the
45[_media/test/data_](https://cs.chromium.org/chromium/src/media/test/data/)
46folder in Chromium's source tree (e.g.
47[_test-25fps.vp8_](https://cs.chromium.org/chromium/src/media/test/data/test-25fps.vp8)).
48If no video is specified _test-25fps.h264_ will be used.
49
50__Video Metadata:__ These videos also have an accompanying metadata _.json_ file
51that needs to be deployed alongside the test video. They can also be found in
52the _media/test/data_ folder (e.g.
53[_test-25fps.h264.json_](https://cs.chromium.org/chromium/src/media/test/data/test-25fps.h264.json)).
54If no metadata file is specified _\<video path\>.json_ will be used. The video
55metadata file contains info about the video such as its codec profile,
56dimensions, number of frames and a list of md5 frame checksums to validate
57decoded frames. These frame checksums can be generated using ffmpeg, e.g.:
58`ffmpeg -i test-25fps.h264 -f framemd5 test-25fps.h264.frames.md5`.
59
60## Command line options
61Multiple command line arguments can be given to the command:
62
63 -v enable verbose mode, e.g. -v=2.
64 --vmodule enable verbose mode for the specified module,
65 e.g. --vmodule=*media/gpu*=2.
David Staessens78d7ad31e2019-07-11 01:50:4666 --disable_validator disable frame validation.
David Staessensf3404c12019-04-16 00:12:0567 --output_frames write all decoded video frames to the
David Staessensa3235342019-07-10 02:40:0768 "<testname>" folder.
David Staessens4aeee0362019-06-03 05:41:4769 --output_folder overwrite the default output folder used when
70 "--output_frames" is specified.
David Staessensf3404c12019-04-16 00:12:0571 --use_vd use the new VD-based video decoders, instead of
72 the default VDA-based video decoders.
73 --gtest_help display the gtest help and exit.
74 --help display this help and exit.
75
76## Source code
77See the video decoder tests [source code](https://cs.chromium.org/chromium/src/media/gpu/video_decode_accelerator_tests.cc).
78