AVFrame *avFrame;
char *pName = "/Users/mac/myfiles2/test_30.yuv";
FILE *ff = fopen(pName, "wb");//????
int pic;
avcodec_decode_video2(avCodecContext, avFrame, &pic, &avPacket);
NSLog(@"...decode finished<<<");
//width: 352
//height: 288
if (pic != 0) {
for(int i=0; i<288; i++)
fwrite(avFrame->data[0] + i * avFrame->linesize[0], 1, 352, ff);
for(int i=0; i<288/2; i++)
fwrite(avFrame->data[1] + i * avFrame->linesize[1], 1, 352/2, ff);
for(int i=0; i<288/2; i++)
fwrite(avFrame->data[2] + i * avFrame->linesize[2], 1, 352/2, ff);
}