v4l2: use fewer pixmap to reduce memory footprinter
v4l2: work around a strange x11 exception during XFreePixmap

terminate vaapi before XFreePixmap work around the exception;
otherwise there is "BadDrawable" exception though the Pixmap is valid.

maybe driver 'lock' the Pixmap at that time, or dri protocol issue.
add encode test. add recursion test, you can test h264,vp8,jpg decode and h264 encode one time.
testscripts:
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.