You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/learning-paths/laptops-and-desktops/win-resource-ps1/_index.md
+6-10Lines changed: 6 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,14 @@
1
1
---
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
7
3
8
4
minutes_to_complete: 60
9
5
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.
11
7
12
8
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
16
12
17
13
prerequisites:
18
14
- A Windows on Arm computer such as the Lenovo Thinkpad X13s running Windows 11
Copy file name to clipboardExpand all lines: content/learning-paths/laptops-and-desktops/win-resource-ps1/how-to-1.md
+27-31Lines changed: 27 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,58 +7,52 @@ layout: learningpathall
7
7
---
8
8
9
9
## 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.
11
11
12
12
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.
13
13
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:
16
16
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).
18
19
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
20
21
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.
26
23
27
24
{{% 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.
29
26
{{% /notice %}}
30
27
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
33
31
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).
35
33
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.
38
35
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.
40
38
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:
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.
49
47
{{% /notice %}}
50
48
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`.
52
50
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.
54
52
55
-
The generated file will be at RaceNight_1080p.mp4.
53
+
## View the results
56
54
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`:
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
112
108
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.
Copy file name to clipboardExpand all lines: content/learning-paths/laptops-and-desktops/win-resource-ps1/how-to-2.md
+11-12Lines changed: 11 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,17 @@
1
1
---
2
-
title: Track system resources
2
+
title: Track system resource usage on Windows on Arm with PowerShell
3
3
weight: 3
4
4
5
5
### FIXED, DO NOT MODIFY
6
6
layout: learningpathall
7
7
---
8
8
9
-
## Sample video decoding resource usage
9
+
## Analyze resource usage during sample video decoding
10
10
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.
12
11
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`:
14
15
15
16
```PowerShell { line_numbers = true }
16
17
param (
@@ -114,24 +115,23 @@ Run the script:
114
115
Set-ExecutionPolicy -Scope Process RemoteSigned
115
116
.\sample_decoding.ps1
116
117
```
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.
119
119
120
120
{{% 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.
122
122
{{% /notice %}}
123
123
124
-
### Script explanation
124
+
##Understand what the script does
125
125
126
126
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.
127
127
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 15–26 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.
129
129
130
130
Line 41 retrieves all child processes of the main process. The statistical data includes resources used by all processes spawned by the main process.
131
131
132
132
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.
133
133
134
-
### View results
134
+
### View the results
135
135
136
136
The output below shows the results from running the x86_64 version of `ffplay.exe`:
137
137
@@ -150,5 +150,4 @@ Timestamp,CPU Sum (s),Memory Sum (MB),Memory Private Sum (MB),CPU0 (s),Memory0 (
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.
Copy file name to clipboardExpand all lines: content/learning-paths/laptops-and-desktops/win-resource-ps1/how-to-3.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
---
2
-
title: Measure power usage
2
+
title: Measure power usage on Windows on Arm with PowerShell
3
3
weight: 4
4
4
5
5
### FIXED, DO NOT MODIFY
6
6
layout: learningpathall
7
7
---
8
8
9
-
## Sampling battery status
9
+
## Sample the battery status
10
10
11
11
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.
12
12
@@ -77,7 +77,7 @@ A video starts playing and completes in 30 minutes. When finished, you can find
77
77
78
78
The script collects remaining battery capacity and discharge rate periodically. You can track the battery remaining capacity to understand the power consumption patterns.
79
79
80
-
### View results
80
+
### View the results
81
81
82
82
The output below shows the results from running the x86_64 version of `ffplay.exe`:
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.
101
101
102
102
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