I encounter the same problem.
Here is my solution. Briefly speaking, it can be solved by recompiling the android source. Patients are needed.
1, Following the instruction here https://source.android.com/source/initializing.html to initialize a build environment.
2, Download the source code from git (Take about 1 hour with 10 M bandwidth).
3, Modify the path_to_working_directory/frameworks/av/cmds/screenrecord/screenrecord.cpp by changing the kMaxTimeLimitSec to 7200 (means 2 hours).