improved ./relax r to make it capture events and handle frames duration