1) How many frames you want to capture and store in a file?
2) What is the problem that you are facing in streamer? if you are requesting for 4 MB data in every BeginDataXfer(), you will get every odd packets with 4 MB and even packets with 1 MB (assuming your image data size is 5 MB).
1）The Sensor is continuous to output image with speed 14 fps, and the PC just to receive the image data and copy to another memory and in another thread to display in monitor. not store in a file.
2) You mean that i could set QueueSize = 2, and index = 0 to receive 4MB data,index = 1 to receive 1MB data ,but when index = 1,the len in FinishDataXfer(buf1[i]len1) still set to 4MB ?
When Index = 1, the len in the FinishDataXfer will return the number of bytes transferred. So, even if you request 4 MB in the BeginDataXfer for Index=1, you will get 1 MB of data back and the transfer will end. the len field in the FinishDataXfer() will return 1 MB.