Hi again developers, I've been trying all your suggestions very carefully to try to solve my problems decoding. First, thanks wl2776 for your helps. Secondly, I have the same problems now. I tried this possibilities:
1 - *av_guess_format* asking with "video/mp4" and "h264" or "mpeg" like output_example.c. In all cases the function returns NULL. 2 - *ByteIOContext* but when I arrive to the function av_open_input_stream this crash with an *Access Violation*. I think I init in a good way the ByteIOContext and AVFormatContext but I'm not sure about the initialitation of AVInputFormat and the AVFormatParameters. Then maybe I probably do wrong anything and make my call to the av_open_input_stream crash. 3 - I tried to understand AVPacket, after call decode, because for example the parameters pts, dts and convergence_duration every execution have wrong values, I think, because have this: -9223372036854775808. I continue recieveving -1 every execution of decode I don't know more options to try. I tried execute my file in VLC an the execution is Ok...then what is the reason that in my code doesn't run Ok... Thanks ind advance. PD: Which NAL Unit of H264 contain the information to know if the data is I-frame?? Any knows? I parse all the packets and I don't know where is that information. 2010/2/7 Shmulik <[email protected]> > hello, > > i want to know if the program support this files type: > > Video: > 3gp - 3GPP Multimedia File > aac - Advanced Audio Coding File > ac3 - AC3 Audio File > avi - Windows video file > flac - Free Lossless Audio Codec > flv - Flash Video > ipod - MPEG-4 Video File > mov - Apple QuickTime Movie > mp3 - Compressed audio file > mp4 - MPEG-4 Video File > mpg - Moving Picture Experts Group File > ogg - Ogg Vorbis Compressed Audio File > wav - Windows audio file > wmv - Windows M > > Audio: > ac3 - AC3 Audio File > flac - Free Lossless Audio Codec > m4a - MPEG-4 Video File > mp3 - Compressed audio file > mp4 - MPEG-4 Video File > ogg - Ogg Vorbis Compressed Audio File > wav - Windows audio file > wma - Windows media file ac3 - AC3 Audio File aac - Advanced Audio Coding > File > > 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 > > > _______________________________________________ > 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
