Here is mine to parse the file video file
int parsingmain1(char *Filepath){
FILE* infile;
uint8_t* buf = (uint8_t*)malloc(BUFSIZE );
h264_stream_t* h = h264_new();
infile = fopen(Filepath, "rb");
if (infile == NULL) { fprintf( stderr, "!! Error: could not open file: %s \n", strerror(errno)); exit(EXIT_FAILURE); }
h264_dbgfile = fopen ("C:\\myfile.txt","w");
int opt_verbose = 1;
int opt_probe = 0;
size_t rsz = 0;
size_t sz = 0;
int64_t off = 0;
uint8_t* p = buf;
int nal_start, nal_end;
while (1)
{
rsz = fread(buf + sz, 1, BUFSIZE - sz, infile);
if (rsz == 0)
{
if (ferror(infile)) { fprintf( stderr, "!! Error: read failed: %s \n", strerror(errno)); break; }
break; }
sz += rsz;
while (find_nal_unit(p, sz, &nal_start, &nal_end) > 0)
{
}
}
return 0;
}
Please provide the pseudo code