Capturing a clean, high‑resolution screen video that includes the device’s own audio (music, game sound, video playback, etc.) normally requires a rooted phone or a third‑party recorder that may add watermarks. Using the built‑in screenrecord command together with ADB gives you a pure, lossless file, and FFmpeg lets you re‑encode or trim it without leaving the computer. The workflow works on any Android 10 (API 29) or newer device that supports the --audio flag – a feature Google added to the system recorder in 2020.
What you’ll need:
adb installed and added to the system PATH.--audio option is ignored on older releases.C:\adb on Windows or ~/adb on macOS/Linux).PATH so you can run adb from any terminal.
# Windows (PowerShell)
$env:Path += ";C:\adb"
# macOS/Linux (bash)
export PATH="$PATH:$HOME/adb"
adb version. You should see something like Android Debug Bridge version 1.0.41.adb devices. The device should appear as device (not unauthorized). If a dialog pops up on the phone, tap **Allow**.Starting with Android 10, the system recorder needs an explicit permission to capture the device’s own audio stream. Some OEM skins hide this toggle, but the generic path works on stock Android and most recent manufacturer skins.
adb shell appops set com.android.systemui PROJECT_MEDIA_RECORD_AUDIO allow
The screenrecord command lives on the device itself. By invoking it through ADB you keep the phone’s UI free for the content you want to capture.
--size WIDTHxHEIGHT and --bit-rate BITRATE.
# Example: 1080x1920 at 8 Mbps
adb shell screenrecord --size 1080x1920 --bit-rate 8000000 --output-format=mpeg4 --audio /sdcard/rec.mp4
What you should see: a file /sdcard/rec.mp4 on the device, roughly the length you recorded. The video includes everything displayed on the screen **and** the internal audio stream (music, game sounds, etc.).
adb pull /sdcard/rec.mp4 ./rec.mp4
ls -lh rec.mp4
FFmpeg lets you cut out unwanted sections, change the container, or compress the video without losing the original quality.
ffmpeg -i rec.mp4 -ss 00:00:05 -c copy trimmed.mp4
ffmpeg -i rec.mp4 -c:v libx264 -b:v 4M -c:a aac -b:a 128k final.mp4
-c copy mode copies streams without re‑encoding, preserving the original quality and making the operation almost instant.Open the file with your favourite media player (VLC, MPV, Windows Media Player, etc.). You should hear the exact audio that was playing on the phone during the capture – no microphone hiss, no missing sound.
--audio is unavailableSome OEMs disable the internal‑audio flag even on Android 10+. If the command returns error: device does not support audio capture, try one of these work‑arounds:
--audio and instead place the phone near a speaker. Not ideal, but works for short demos.
screenrecord binary with a version that forces audio capture. This guide does not cover rooting.
| Problem | Possible cause | Fix |
|---|---|---|
| ADB reports “device unauthorized” | USB debugging not approved | Reconnect cable, accept the RSA key dialog on the phone. |
| Screenrecord fails with “error: device does not support audio capture” | Device runs Android 9 or OEM disabled the flag | Check Android version, try a different device, or use the microphone workaround. |
| File size grows rapidly, storage runs out | Bitrate too high or recording too long | Reduce --bit-rate (e.g., 2 Mbps) or record in shorter segments. |
| Audio is silent after pulling the file | Permission not granted in Step 3 | Re‑grant the screen‑recording audio permission and retry. |
With these steps you now have a reliable, root‑free way to capture exactly what you see on your Android device, complete with the original system audio. Whether you’re making a tutorial, preserving a game highlight, or documenting a bug, the ADB + FFmpeg workflow gives you full control over quality and file size.









