Hi, I've been thinking in your options and suggestions but I have a problem with all this. I obtain frame data from a file, then RTSP://... not is an option, but this file not is standard h264. My file container have special headers an then I parse every part of the file to obtain the frame buffer. I have the frame buffer then I can't use av_open_input_file with file name or "rtsp://" command.
av_read_frame is possible in my situation? I don't see how because I have the buffer only and I need to use without av_open_input_file or av_read_frame I think. In other hand, I've been looking output_example.c and I tried to do the next: av_guess_format(NULL,NULL,"video/mp4") but this cause an Access Violation... I'm very confused and need more suggestions to continue. PD: The file contain data from an IP Camera with special headers of my company. Thanks in advance. 2010/2/4 sateesh babu <[email protected]> > well, you can open a rtsp stream from ip camera using av_open_input_file. > just pass the url as rtsp:/IP:PORT//mpeg4/media.amp > and you can use av_read_frame afterwards using the Format context of opened > stream. > > On Thu, Feb 4, 2010 at 2:17 PM, Miguel Angel Arcos <[email protected] > >wrote: > > > But I've been reading about the av_read_frame and I understand, maybe > > wrong, > > that this function is when you read from a file. You need pass to this > > function an AVFormatContext an that structure is init when you read from > a > > file with av_open_input_file. I don't understand where I need to init > this > > if I recieve the data from an IP Camera, using RTSP. > > > > 2010/2/4 sateesh babu <[email protected]> > > > > > Looks like you are not using av_read_frame to read a packet from the > > stream > > > coming from IP camera. > > > > > > On Thu, Feb 4, 2010 at 12:49 PM, Miguel Angel Arcos > > > <[email protected]>wrote: > > > > > > > Hi developers, > > > > > > > > I'm working with avcodec and I'm having some troubles to decode frame > > > data > > > > from an IP Camera. First, after init the library correctly I do the > > next: > > > > > > > > /* My Code */ > > > > avcodec_init(); > > > > avcodec_register_all(); > > > > pCodec = avcodec_find_decoder(CODEC_ID_H264); > > > > > > > > if pCodec is OK > > > > avcodec_alloc_context(MyContext) > > > > avcodec_get_context_defaults(MyContext) > > > > MyContext->width = CamWidth > > > > MyContext->height = CamHeight > > > > MyContext->pix_fmt = PIX_FMT_RGB32; /*/ I'm not completely sure > about > > > it* > > > > avcodec_open(MyContext,pCodec) > > > > > > > > if avcodec_open(MyContext,pCodec) is OK > > > > avcodec_alloc_frame(MyAVFrame) > > > > avcodec_get_frame_defaults(MyAVFrame) > > > > av_init_packet(MyAVPacket) > > > > MyAVPacket->size = CamSizeImage; > > > > MyAVPacket->data= CompressedBuffer; > > > > *ret = > > > avcodec_decode_video2(MyContext,MyAVFrame,got_picture,MyAVPacket) > > > > * //* Problem!!* > > > > > > > > The last line return -1 and got_picture 0. I revised all the > parameters > > > in > > > > MyContext and I can't see where is the problem. Any suggestions? > > > > > > > > Thanks in advance. > > > > > > > > -- > > > > Miguel Angel Arcos > > > > _______________________________________________ > > > > libav-user mailing list > > > > [email protected] > > > > https://lists.mplayerhq.hu/mailman/listinfo/libav-user > > > > > > > > > > > > > > > > -- > > > Sateesh > > > _______________________________________________ > > > libav-user mailing list > > > [email protected] > > > https://lists.mplayerhq.hu/mailman/listinfo/libav-user > > > > > > > > > > > -- > > Miguel Angel Arcos > > _______________________________________________ > > libav-user mailing list > > [email protected] > > https://lists.mplayerhq.hu/mailman/listinfo/libav-user > > > > > > -- > Sateesh > _______________________________________________ > libav-user mailing list > [email protected] > https://lists.mplayerhq.hu/mailman/listinfo/libav-user > -- Miguel Angel Arcos _______________________________________________ libav-user mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/libav-user
