A registered sex offender has been sentenced to more than 20 years’ jail for raping a child and making her film indecent videos for him.