请问下,使用MP4v2读取h264文件时,如下的buf和size应该如何取啊
if (mp4File==MP4_INVALID_FILE_HANDLE)
exit(1);
MP4SetTimeScale(mp4File, 90000);
MP4TrackId video = MP4AddH264VideoTrack(mp4File, 90000,MP4_INVALID_DURATION, width, height,
0x4D, //sps[1] AVCProfileIndication
0x40, //sps[2] profile_compat
0x28, //sps[3] AVCLevelIndication
3); // 4 bytes length before each NAL unit
//MP4TrackId audio = MP4AddAudioTrack(mp4File,16000, 1024,MP4_MPEG2_AAC_LC_AUDIO_TYPE);
if (video == MP4_INVALID_TRACK_ID)
{
perror("add video track fialed.\n");
return 1;
}
MP4AddH264SequenceParameterSet(mp4File, video, sps_pps, 48);
MP4AddH264PictureParameterSet(mp4File, video, sps_pps + 48, 4);
MP4SetVideoProfileLevel(mp4File, 0x7F);
// MP4SetAudioProfileLevel(mp4File, 0x02);
// MP4SetTrackESConfiguration(mp4File, audio, &ubuffer[0], 2);
while(!(read_h264data(fd,buf,&size)<1))