hi all,
i'am unable to read x264 packets from mp4 file. Audio packets could read
successfull but no video Packets.
All Video Packets have a size at round about 2kb but the data pointer have
only a \0 value data, can someone have a look at my code please.
Thanks Jan
int main(int argc, char ** argv){
av_register_all();
if(argc==1){
return 0;
}
AVFormatContext * formatCtx= av_alloc_format_context();
AVInputFormat *file_iformat = av_find_input_format("mp4");
AVFormatParameters params, *ap = ¶ms;
memset(ap, 0, sizeof(*ap));
ap->prealloced_context = 1;
char * filename=argv[1];
if (av_open_input_file(&formatCtx, filename, file_iformat, 0, ap) != 0)
{
std::cout<<"could not open file" << filename <<std::endl;
return 0;
}
if (av_find_stream_info(formatCtx) < 0) {
std::cout<<"could not read stream info " << filename <<std::endl;
return 0;
}
while(true){
AVPacket pkt;
int ret= av_read_frame(formatCtx, &pkt);
}
}
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user