HI Andreas,
I try to post the whole code a day before but still it missed the approval because of size anyway wht i mean to say it i hope you need to transcode there is a example code which i got it running in my pc(VC++ using Dll ..) i did some exploring from the below link.. hope it help s http://ffmpeg.arrozcru.org/forum/viewtopic.php?f=8&t=454&p=1236&hilit=transcoding#p1236 if you need more help write me... mukilan S On 4/8/09, Andreas Unterweger <[email protected]> wrote: > > Dear experts, > > I'm currently trying to decode raw H.264 video data from memory but my > application keeps crashing when calling av_decode_video. My code looks > as follows: > > av_register_all(); > > [..] > > AVFormatContext *formatcontext; > AVCodecContext *codeccontext; > AVFormatParameters *ap = > (AVFormatParameters*)malloc(sizeof(AVFormatParameters)); > memset(ap, 0, sizeof(AVFormatParameters)); > ap->width = KnownWidth; > ap->height = KnownHeight; > ap->sample_rate = KnownFrameRate; > AVInputFormat *inputformat = av_find_input_format("h264"); > if (!inputformat) > //(removed) Error handling > inputformat->flags |= AVFMT_NOFILE; > > if (av_open_input_file(&formatcontext, "", inputformat, 0, ap) != 0) > //(removed) Error handling > for (unsigned int i = 0; i < formatcontext->nb_streams; i++) > { > if (formatcontext->streams[i]->codec->codec_id == CODEC_ID_H264) > { > //(removed) Print info about the stream found (this seems to work) > codeccontext = formatcontext->streams[i]->codec; > } > } > > [..] > //At this point, VideoData is a buffer containing VideoSize bytes of > valid H.264 video data (should be exactly one IDR frame on startup) > > int finished = 0; > AVFrame *frame = avcodec_alloc_frame(); > if (!frame) > //(removed) error handling > avcodec_decode_video(codeccontext, frame, &finished, VideoData, > VideoSize); //During this call the application crashes > if (finished) > { > //TODO: do something here > } > > What is wrong with my code so that it causes the function to crash? I > also tried creating a pipe and piping the data into it, using > pipe://<fileno> as file name, but this didn't work out either. Any > ideas? > > Regards, > Andreas > _______________________________________________ > 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
