blob: e9a3974c908681e3211510d7151a1d41c4f8a92d [file] [log] [blame] [view]
David Staessens38dba3c2020-05-26 08:56:271# Video Encoder tests
2The video encoder tests are a set of tests that validate various video encoding
David Staessensa3ed4f22020-05-29 05:20:503scenarios. They are accompanied by the video encoder performance tests that can
4be used to measure a video encoder's performance.
5
6These tests run directly on top of the video encoder implementation, and
David Staessens38dba3c2020-05-26 08:56:277don't require the full Chrome browser stack. They are built on top of the
Eric Willigersc2e3d8812022-01-17 01:59:378[GoogleTest](https://github.com/google/googletest/blob/main/README.md)
David Staessens38dba3c2020-05-26 08:56:279framework.
10
David Staessens38dba3c2020-05-26 08:56:2711[TOC]
12
13## Running from Tast
Hirokazu Hondabf36605b2021-02-24 07:45:4114The Tast framework provides an easy way to run the video encoder tests from a
15ChromeOS chroot. Test data is automatically deployed to the device being tested.
16To run all video encoder tests use:
17
18 tast run $HOST video.EncodeAccel.*
19
20Wildcards can be used to run specific sets of tests:
21* Run all VP8 tests: `tast run $HOST video.EncodeAccel.vp8*`
22
23Check the
Fei Shaod8c73712023-09-12 04:46:3024[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/)
Hirokazu Hondabf36605b2021-02-24 07:45:4125for 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.
David Staessens38dba3c2020-05-26 08:56:2729
30## Running manually
31To run the video encoder tests manually the _video_encode_accelerator_tests_
32target needs to be built and deployed to the device being tested. Running
33the video encoder tests can be done by executing:
34
Hirokazu Hondabf36605b2021-02-24 07:45:4135 ./video_encode_accelerator_tests [<video path>]
David Staessens38dba3c2020-05-26 08:56:2736
37e.g.: `./video_encode_accelerator_tests bear_320x192_40frames.yuv.webm`
38
David Staessensa3ed4f22020-05-29 05:20:5039Running the video encoder performance tests can be done in a smilar way by
40building, deploying and executing the _video_encode_accelerator_perf_tests_
41target.
42
Hirokazu Hondabf36605b2021-02-24 07:45:4143 ./video_encode_accelerator_perf_tests [<video path>]
David Staessensa3ed4f22020-05-29 05:20:5044
45e.g.: `./video_encode_accelerator_perf_tests bear_320x192_40frames.yuv.webm`
46
David Staessens38dba3c2020-05-26 08:56:2747__Test videos:__ Various test videos are present in the
48[_media/test/data_](https://cs.chromium.org/chromium/src/media/test/data/)
49folder in Chromium's source tree (e.g.
50[_bear_320x192_40frames.yuv.webm_](https://cs.chromium.org/chromium/src/media/test/data/bear_320x192_40frames.yuv.webm)).
51These videos are stored in compressed format and extracted at the start of each
52test run, as storing uncompressed videos requires a lot of disk space. Currently
53only VP9 or uncompressed videos are supported as test input. If no video is
54specified _bear_320x192_40frames.yuv.webm_ will be used.
55
56__Video Metadata:__ These videos also have an accompanying metadata _.json_ file
57that needs to be deployed alongside the test video. The video metadata file is a
58simple json file that contains info about the video such as its pixel format,
59dimensions, framerate and number of frames. These can also be found in the
60_media/test/data_ folder (e.g.
61[_bear_320x192_40frames.yuv.webm.json_](https://cs.chromium.org/chromium/src/media/test/data/bear_320x192_40frames.yuv.webm.json)).
Hirokazu Hondabf36605b2021-02-24 07:45:4162The metadata file must be _\<video path\>.json_ in the same directory.
David Staessens38dba3c2020-05-26 08:56:2763
64## Command line options
65Multiple command line arguments can be given to the command:
66
David Staessens96a00082020-06-01 01:46:3667 --codec codec profile to encode, "h264 (baseline)",
68 "h264main, "h264high", "vp8" and "vp9"
Hirokazu Hondabf36605b2021-02-24 07:45:4169 --output_folder overwrite the output folder used to store
70 performance metrics, if not specified results
71 will be stored in the current working directory.
David Staessensb0a95282020-06-11 00:46:3372
David Staessens38dba3c2020-05-26 08:56:2773 -v enable verbose mode, e.g. -v=2.
74 --vmodule enable verbose mode for the specified module,
75 e.g. --vmodule=*media/gpu*=2.
David Staessensb0a95282020-06-11 00:46:3376
David Staessens38dba3c2020-05-26 08:56:2777 --gtest_help display the gtest help and exit.
78 --help display this help and exit.
79
David Staessensb0a95282020-06-11 00:46:3380Non-performance tests only:
81
Hirokazu Hondabf36605b2021-02-24 07:45:4182 --num_temporal_layers the number of temporal layers of the encoded
83 bitstream. Only used in --codec=vp9 currently.
84 --disable_validator disable validation of encoded bitstream.
85 --output_bitstream save the output bitstream in either H264 AnnexB
86 format (for H264) or IVF format (for vp8 and
87 vp9) to <output_folder>/<testname>.
88 --output_images in addition to saving the full encoded,
89 bitstream it's also possible to dump individual
90 frames to <output_folder>/<testname>, possible
91 values are \"all|corrupt\"
92 --output_format set the format of images saved to disk,
93 supported formats are \"png\" (default) and
94 \"yuv\".
95 --output_limit limit the number of images saved to disk.
David Staessensb0a95282020-06-11 00:46:3396
David Staessens38dba3c2020-05-26 08:56:2797## Source code
Hang Nguyene7031822024-06-21 02:12:0798See the video encoder tests [source code](https://cs.chromium.org/chromium/src/media/gpu/test/video_encode_accelerator_tests.cc).
99See the video encoder performance tests [source code](https://cs.chromium.org/chromium/src/media/gpu/test/video_encode_accelerator_perf_tests.cc).