the only way to do that is with a rooted device.
try reading this answer: Programmatic screencapture on mobile device
EDIT 1:
screen capture as video is the same is screen capture of only one image.
EDIT 2:
there are different apps that record video from screen such as Screencast and ShootMe. you can call them from within the app using the startActivity(new Intent(String action));
with their action names.
for more read this: Open third party app