Many Android users need a reliable way to capture on‑screen actions – whether it’s a bug demo, a tutorial, or a gameplay highlight. The built‑in screenrecord command, available through ADB, can record without any third‑party app or root access. However, the raw MP4 file is often limited in resolution, bitrate, or length. By pulling the file to a PC and running it through ffmpeg, you can raise the quality, trim unwanted sections, and convert to formats that are easier to edit.
brew install ffmpeg on macOS) provide a recent build.adb devices
You should see your device’s serial number followed by device. If it shows unauthorized, tap the confirmation dialog on the phone.The screenrecord tool accepts several flags. The most useful are:
--size WIDTHxHEIGHT – forces a specific resolution (e.g., 1280x720). If omitted, the device uses its native screen size.--bit-rate BITRATE – sets the video bitrate in bits per second (default ~4 Mbps). Higher values improve quality but increase file size.--time-limit SECONDS – caps the recording length (max 180 seconds on Android 10 and earlier; newer versions allow longer).--rotate – rotates the output if you record in landscape on a portrait‑only device.Example command that records a 1080p video at 8 Mbps for up to 5 minutes:
adb shell screenrecord --size 1920x1080 --bit-rate 8000000 --time-limit 300 /sdcard/record.mp4
screenrecord command from the PC terminal./sdcard/record.mp4).After the command ends, you’ll see a summary like Recorded 0.0 seconds (0.0 MB). If the file size is zero, the recording likely failed – see the troubleshooting section.
adb pull /sdcard/record.mp4 ./record_raw.mp4
This copies the video to the current working directory. Verify the file exists:
ls -lh record_raw.mp4
If the file size is unexpectedly small, re‑run the recording with a lower resolution or longer time limit.
Android’s built‑in encoder is efficient but not always optimal for editing. FFmpeg can:
webm or mov for compatibility with editing suites.Example: increase bitrate to 12 Mbps and output an mp4 that works well in most editors:
ffmpeg -i record_raw.mp4 -c:v libx264 -b:v 12M -preset veryslow -c:a copy record_high.mp4
Explanation:
-c:v libx264 selects the H.264 encoder.-b:v 12M sets the target video bitrate.-preset veryslow trades encoding time for better compression efficiency.-c:a copy copies the audio stream unchanged (the original recording includes a mono audio track).If you only need a short clip, trim without re‑encoding:
ffmpeg -ss 00:00:05 -to 00:00:20 -i record_raw.mp4 -c copy clip.mp4
This extracts the segment from 5 seconds to 20 seconds.
Play the video on your computer or Android device to ensure the quality meets your expectations. If you notice pixelation, increase the --bit-rate value in step 2 and re‑record. Remember that higher bitrates consume more storage and may cause occasional frame drops on older hardware.
adb devicesadb kill-server && adb start-server.screenrecord to system apps. In that case, use a third‑party app from the Play Store or a rooted method.screenrecord at 180 seconds on older releases. Split longer captures into multiple segments by running the command again.--size 1280x720) to reduce CPU load.adb shell am kill-all to free CPU cycles.scrcpy (which streams the device screen to the PC) and record the PC window with a desktop screen‑capture tool.The ADB method shines for quick, on‑the‑fly captures and for developers who already have a PC nearby. If you need features like live annotation, multi‑window recording, or unlimited duration on older Android releases, a dedicated screen‑recording app from the Play Store (e.g., AZ Screen Recorder) may be more convenient.
With these steps you can reliably capture high‑quality Android screen video, fine‑tune the output with FFmpeg, and avoid the pitfalls that often trip up first‑time users.









