Use the pack functions of the video library to construct the target image. Remove redundant functions.