Skip to content

Commit dc1e4ff

Browse files
Merge pull request #2454 from madeline-underwood/tracking
Tracking_JA to review
2 parents 2b30581 + 69ec63f commit dc1e4ff

File tree

4 files changed

+51
-56
lines changed

4 files changed

+51
-56
lines changed

content/learning-paths/laptops-and-desktops/win-resource-ps1/_index.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
---
2-
title: Track resource usage of applications on Windows on Arm
3-
4-
draft: true
5-
cascade:
6-
draft: true
2+
title: Measure application resource and power usage on Windows on Arm with FFmpeg and PowerShell
73

84
minutes_to_complete: 60
95

10-
who_is_this_for: This is an introductory topic for developers who want to measure resource usage of applications on Windows on Arm devices.
6+
who_is_this_for: This is an introductory topic for developers who want to measure resource usage of applications on Windows on Arm devices using FFmpeg.
117

128
learning_objectives:
13-
- Run video encode and decode tasks by using FFmpeg
14-
- Benchmark the video encode task
15-
- Sample CPU, memory, and power usage for the video decode task
9+
- Measure application resource usage using FFmpeg and PowerShell
10+
- Benchmark a video encoding task
11+
- Monitor CPU, memory, and power consumption during a video decode task
1612

1713
prerequisites:
1814
- A Windows on Arm computer such as the Lenovo Thinkpad X13s running Windows 11
@@ -35,7 +31,7 @@ operatingsystems:
3531

3632
further_reading:
3733
- resource:
38-
title: Recording for Resource-based Analysis
34+
title: Recording for resource-based analysis
3935
link: https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-8.1-and-8/hh448202(v=win.10)
4036
type: documentation
4137
- resource:

content/learning-paths/laptops-and-desktops/win-resource-ps1/how-to-1.md

Lines changed: 27 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,58 +7,52 @@ layout: learningpathall
77
---
88

99
## Overview
10-
System resource usage provides an approach to understand the performance of an application as a black box. This Learning Path demonstrates how to sample system resource usage using a script.
10+
To understand how well your application performs, you can measure its system resource usage (such as CPU time and memory) without needing to look inside the code. In this Learning Path, you'll learn how to collect resource usage data using a simple script. This helps you compare performance between different builds and see how efficiently your system runs each version.
1111

1212
The example application you will use is FFmpeg, a tool set that performs video encode and decode tasks. You will run the same tests with both the x86_64 binary (using Windows instruction emulation) and the Arm64 native binary on a Windows on Arm computer.
1313

14-
## Application
15-
Binary builds of FFmpeg are available, so you don't need to build them from source.
14+
## Download the packages
15+
You don't need to compile FFmpeg from source. You can download the pre-built binaries to begin your testing:
1616

17-
To get started:
17+
- First, download the [FFmpeg x86_64 package](https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2025-07-31-14-15/ffmpeg-n7.1.1-56-gc2184b65d2-win64-gpl-7.1.zip).
18+
- Next, download the [FFmpeg Arm64 native package](https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2025-07-31-14-15/ffmpeg-n7.1.1-56-gc2184b65d2-winarm64-gpl-7.1.zip).
1819

19-
1. Download the [FFmpeg x86_64 package](https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2025-07-31-14-15/ffmpeg-n7.1.1-56-gc2184b65d2-win64-gpl-7.1.zip).
20+
## Unzip the downloaded packages
2021

21-
2. Download the [FFmpeg Arm64 native package](https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2025-07-31-14-15/ffmpeg-n7.1.1-56-gc2184b65d2-winarm64-gpl-7.1.zip).
22-
23-
3. Unzip the downloaded packages.
24-
25-
You can find the binaries in the `bin` folder.
22+
Once you've downloaded both packages, unzip them. You'll find the binaries in the `bin` folder inside each package. The x86_64 version is for emulation, while the Arm64 version runs natively on your Windows on Arm device. Double-check the folder names so you don't mix them up.
2623

2724
{{% notice Note %}}
28-
Make note of the paths to both versions of `ffmpeg.exe` and `ffplay.exe`, so you can run each one and compare the results.
25+
It's a good idea to create a separate folder for each version. Make a note of where you put both `ffmpeg.exe` and `ffplay.exe` for each version as you'll need these paths soon to run your tests and compare results.
2926
{{% /notice %}}
3027

31-
## Video source
32-
Download the test video [RaceNight](https://ultravideo.fi/video/RaceNight_3840x2160_50fps_420_8bit_YUV_RAW.7z) from a public dataset.
28+
Now you're set up with both versions of FFmpeg. Next, you'll use these binaries to encode a video and see how each one performs.
29+
30+
## Download the video source
3331

34-
Unzip the package and note the path to the uncompressed `.yuv` file.
32+
For this test, you'll use a sample video called RaceNight. Download it from this [RaceNight public dataset](https://ultravideo.fi/video/RaceNight_3840x2160_50fps_420_8bit_YUV_RAW.7z).
3533

36-
## Video encoding
37-
The downloaded video file is in YUV raw format, which means playback of the video file involves no decoding effort. You need to encode the raw video with compression algorithms to add computation pressure during playback.
34+
Unzip the package and make a note of the path to the `.yuv` file inside.
3835

39-
Use `ffmpeg.exe` to compress the YUV raw video with the x265 encoder and convert the file format to `.mp4`.
36+
## Encode the video
37+
The video you downloaded is in `.yuv` raw format. This means it's uncompressed and ready for processing, so no decoding step is needed. To test your system's performance, you'll use FFmpeg to compress the video with the x265 encoder and convert it to an `.mp4` file. This workflow lets you measure how efficiently each FFmpeg binary handles video encoding on your Windows on Arm device.
4038

41-
Assuming you downloaded the files and extracted them in the current directory, open a terminal and run the following command:
39+
Assuming everything is in your current directory, open a terminal and run this command:
4240

4341
```console
44-
ffmpeg-n7.1.1-56-gc2184b65d2-win64-gpl-7.1\ffmpeg-n7.1.1-56-gc2184b65d2-win64-gpl-7.1\bin\ffmpeg.exe -f rawvideo -pix_fmt yuv420p -s 3840x2160 -r 50 -i RaceNight_3840x2160_50fps_420_8bit_YUV_RAW\RaceNight_3840x2160_50fps_8bit.yuv -vf scale=1920:1080 -c:v libx265 -preset medium -crf 20 RaceNight_1080p.mp4 -benchmark -stats -report
42+
ffmpeg-n7.1.1-56-gc2184b65d2-win64-gpl-7.1\ffmpeg-n7.1.1-56-gc2184b65d2-win64-gpl-7.1\bin\ffmpeg.exe -f rawvideo -pix_fmt yuv420p -s 3840x2160 -r 50 -i RaceNight_3840x2160_50fps_420_8bit_YUV_RAW\RaceNight_3840x2160_50fps_8bit.yuv -vf scale=1920:1080 -c:v libx265 -preset medium -crf 20 RaceNight_1080p.mp4 -benchmark -stats -report
4543
```
4644

4745
{{% notice Note %}}
48-
Modify the paths to `ffmpeg.exe` and the YUV raw video file to match your locations.
46+
Make sure to update the paths to `ffmpeg.exe` and the `yuv.` video file to match where you saved them.
4947
{{% /notice %}}
5048

51-
The command transforms the video size and compresses the video into an MP4 file using H.265 encoding (via the x265 encoder).
49+
This command resizes the video and compresses it into an MP4 file using H.265 encoding (using the x265 encoder). The `-benchmark` option shows performance stats while the encoding runs. When it's done, you'll have a new file called `RaceNight_1080p.mp4`.
5250

53-
The `benchmark` option is turned on to show performance data at the same time.
51+
Try running the command with both the x86_64 and Arm64 versions of FFmpeg. Then, compare the results to see which one is faster.
5452

55-
The generated file will be at RaceNight_1080p.mp4.
53+
## View the results
5654

57-
Run the command with both the x86_64 and the Arm64 versions of FFmpeg and compare the output.
58-
59-
### View results
60-
61-
The output below is from the x86_64 version of `ffmpeg.exe`:
55+
Here's what the output looks like for the x86_64 version of `ffmpeg.exe`:
6256

6357
```output
6458
x265 [info]: tools: rd=3 psy-rd=2.00 early-skip rskip mode=1 signhide tmvp
@@ -83,7 +77,7 @@ x265 [info]: Weighted P-Frames: Y:0.0% UV:0.0%
8377
encoded 600 frames in 71.51s (8.39 fps), 9075.96 kb/s, Avg QP:27.27
8478
```
8579

86-
The output below is from the Arm64 native compiled `ffmpeg.exe`:
80+
And here's the output from the Arm64 native version:
8781

8882
```output
8983
x265 [info]: tools: rd=3 psy-rd=2.00 early-skip rskip mode=1 signhide tmvp
@@ -108,6 +102,8 @@ x265 [info]: Weighted P-Frames: Y:0.0% UV:0.0%
108102
encoded 600 frames in 26.20s (22.90 fps), 9110.78 kb/s, Avg QP:27.23
109103
```
110104

111-
The last line of each output shows the run time and the frames per second for each build of FFmpeg.
105+
Check out the last line in each output. The run time and frames per second show how each build performed. The Arm64 version is much faster, thanks to running natively on your hardware.
106+
107+
## Review your progress and compare performance
112108

113-
Continue to learn how to track resource usage and compare each version.
109+
You've successfully set up both x86_64 and Arm64 versions of FFmpeg, downloaded a sample video, and encoded it using each binary on your Windows on Arm device. By comparing the output, you've seen firsthand how native Arm64 performance outpaces emulated x86_64. This gives you a solid foundation for deeper resource usage analysis in the next section.

content/learning-paths/laptops-and-desktops/win-resource-ps1/how-to-2.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
---
2-
title: Track system resources
2+
title: Track system resource usage on Windows on Arm with PowerShell
33
weight: 3
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
88

9-
## Sample video decoding resource usage
9+
## Analyze resource usage during sample video decoding
1010

11-
To monitor resource usage during video decoding, use the following PowerShell script. This script starts the decoding process, periodically records CPU and memory statistics, and saves the results to a CSV file for analysis.
1211

13-
Open your code editor, copy the content below, and save it as `sample_decoding.ps1`.
12+
To monitor resource usage during video decoding, use the following PowerShell script. This script starts the decoding process, periodically records CPU and memory statistics, and then saves the results to a CSV file for analysis.
13+
14+
Open your code editor, copy the content below, and save it as `sample_decoding.ps1`:
1415

1516
```PowerShell { line_numbers = true }
1617
param (
@@ -114,24 +115,23 @@ Run the script:
114115
Set-ExecutionPolicy -Scope Process RemoteSigned
115116
.\sample_decoding.ps1
116117
```
117-
118-
A video starts playing and completes in 3 minutes. When finished, you can find the results file `usage_log.csv` in the current directory.
118+
When you run the script, the video plays for about three minutes. After playback finishes, you'll find the results file named `usage_log.csv` in your current directory. Open this file with a spreadsheet application to review and analyze the recorded resource usage data.
119119

120120
{{% notice Note %}}
121-
Script execution may be blocked due to security policy configuration. The `Set-ExecutionPolicy` command allows local scripts to run during this session.
121+
Script execution might be blocked due to security policy configuration. The `Set-ExecutionPolicy` command allows local scripts to run during this session.
122122
{{% /notice %}}
123123

124-
### Script explanation
124+
## Understand what the script does
125125

126126
The `param` section defines variables including the binary path, video playback arguments, sampling interval, and result file path. You can modify these values as needed.
127127

128-
Lines 15-26 check and modify the binary file attributes. The binaries in use are downloaded from the web and may be blocked from running due to lack of digital signature. These lines unlock the binaries.
128+
Lines 1526 check whether the binary file is blocked by Windows security settings. When you download executables from the web, Windows may prevent them from running if they lack a digital signature. This section attempts to unlock the binary using the `Unblock-File` command, allowing the script to run the application without security restrictions.
129129

130130
Line 41 retrieves all child processes of the main process. The statistical data includes resources used by all processes spawned by the main process.
131131

132132
The `while` section collects CPU and memory usage periodically until the application exits. The CPU usage represents accumulated time that the process runs on the CPU. The memory usage shows the size of memory occupation with or without shared spaces accounted for.
133133

134-
### View results
134+
### View the results
135135

136136
The output below shows the results from running the x86_64 version of `ffplay.exe`:
137137

@@ -150,5 +150,4 @@ Timestamp,CPU Sum (s),Memory Sum (MB),Memory Private Sum (MB),CPU0 (s),Memory0 (
150150
......
151151
2025-08-18T10:39:01.7856168+08:00,329.109375,352.53,339.96,329.09375,340.23046875,338.20703125,0.015625,12.30078125,1.75390625
152152
```
153-
154-
The sample result file uses CSV (comma-separated values) format. You can open it with spreadsheet applications like Microsoft Excel for better visualization and create charts for data analysis.
153+
The sample result file is in CSV (comma-separated values) format. Open it with a spreadsheet application such as Microsoft Excel to view the data in a table. You can use built-in chart tools to visualize CPU and memory usage over time, making it easier to spot trends and compare performance between Arm64 and x86_64 versions.

content/learning-paths/laptops-and-desktops/win-resource-ps1/how-to-3.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
title: Measure power usage
2+
title: Measure power usage on Windows on Arm with PowerShell
33
weight: 4
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
88

9-
## Sampling battery status
9+
## Sample the battery status
1010

1111
Querying battery status provides a way to measure power usage without an external power meter. Battery monitoring is also convenient because data collection and logging can be automated.
1212

@@ -77,7 +77,7 @@ A video starts playing and completes in 30 minutes. When finished, you can find
7777

7878
The script collects remaining battery capacity and discharge rate periodically. You can track the battery remaining capacity to understand the power consumption patterns.
7979

80-
### View results
80+
### View the results
8181

8282
The output below shows the results from running the x86_64 version of `ffplay.exe`:
8383

@@ -100,3 +100,7 @@ Timestamp,RemainingCapacity(mWh),DischargeRate(mW)
100100
The sample results file is in CSV format. You can open it with spreadsheet applications like Microsoft Excel for better visualization and to plot data analysis charts.
101101

102102
Battery monitoring provides an effective way to measure power consumption differences between x86_64 and native Arm64 applications. By comparing discharge rates, you can quantify the power efficiency advantages that Arm processors typically demonstrate for video decoding workloads.
103+
104+
## Wrapping up and next steps
105+
106+
You’ve measured power usage on your Windows on Arm device and can now compare results across builds to see how native Arm64 performance affects battery life. Sharing your findings with the Arm developer community helps others optimize applications for Windows on Arm.

0 commit comments

Comments
 (0)