testscripts: optimize code

1.optimize code
2.convert the input path to absolute path
3.test h264 encode with h264 folder. test 10 specific h264 files, if there is no these files, select 10 random h264 files.