I was using screen record functionality of ADB to record video of my application. It is very convenient and useful. Only issue I found is maximum time limit of 3 minutes (180 seconds).
Is there any way or workaround or way by which we can increase this time limit?
Key features include: There's no time limit on recordings, so record as long as you want. Record as many videos as you want. You can record audio narration to go along with your screen recording.
Open Quick Settings: The Screen Recorder tool is located in the Quick Settings menu. To open this menu, swipe down from the top of your screen. Tap the Screen Recorder icon: Your Quick Settings tab contains a grid of settings that you can adjust with a tap of a button.
There is no limit on screen recording, other than how much space is available on your drive. Did the device ever go to sleep while recording?
#!/bin/bash
screenStream() {
while true
do
adb exec-out screenrecord --output-format=h264 --size 1024x768 -
done
}
SecondString=$(date +%s)
screenStream | ffplay -framerate 30 -framedrop -bufsize 16M -
screenStream | ffmpeg -i - -s 1024x768 -framerate 30 -bufsize 16M $SecondString.mp4
#Ctrl+C to exit.
Here's how I solved it. Make sure you backup screenrecorder some place before you go messing with it. I know that the max time is 180 seconds, and is stored in a 32-bit integer. In hex, this would be B4 00 00 00. So I loaded up screenrecorder into ghex, (my hex editor), and searched for B4 00 00 00. There were only a few candidates. On the 6th try, I found the location where the constant was stored. In my version it was at offset 0001B008. I changed the B4 to D4, which is 212 decimal, and screenrecorder ran for 3 min 32 sec. So then I changed it to 10 02 00 00, which would be 210 hex, which is 528 dec, and it ran for 8 min 48 sec. So I changed it to 10 00 01 00, which would be 10010 hex, which is 65552, and it ran... well, it's still running.
I didn't want to mess with recompiling my OS, I just wanted to change this one constant in the screenrecorder program. So I did. You have to have root permissions to overwrite the screenrecorder, and I had to remount my system folder because it was mounted as read-only. I did that with the command: mount -o rw,remount /system
It would have been awesome if the developers had written screenrecorder to default to 180 seconds, but allowed you to set whatever max timeout you wanted. It's an open source project. I should probably figure out how to submit a patch.
Cheers
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With