For my application is essential use the callbacks. I have understood how to use callback on decoding but not on encoding.
If is right, on order to obtain an encoded file from a sequence of images the steps are: 1) initialize AVOutputFormat 2) initialize AVFormatContext and referred it to AVOutputFormat 3) use avio_open for open the output file 4) initialize AVStream 5) initialize AVCodec 6) using avcodec_encode_video, AVPacket and av_interleaved_write_frame is possible to store the inage into the output file. That works. I can produce webm, mp4 and mpg file. But now the goal is to modify the sequence in order to use callback on write event. I have modified the sequence like this 0) AVIOContext= avio_alloc_context(pBuffer, BUFFERSIZE, 0, this, NULL, WritePacket, NULL); 1) initialize AVOutputFormat 2) initialize AVFormatContext and referred it to AVOutputFormat and AVIOContext "pAVFormatContext->oformat= pAVOutputFormat;" "pAVFormatContext->pb= pAVIOContext;" 3) remove avio_open for open the output file 4) initialize AVStream 5) initialize AVCodec 6) using avcodec_encode_video, AVPacket and av_interleaved_write_frame. but does not work with all codecs. For example works using mpeg or webm but not with mp4 (x264) The WritePacket callback is always called but the produced mp4 file is not readable from mplayer or cvlc. The webm or mpg files work well instead. Can you help me? I cannot find the solution or an example. Please, help me! If you want I have write an example using qt libraries. -- www.denisgottardello.it Skype: mrdebug Videosurveillance and home automation! http://www.denisgottardello.it/DomusBoss/DomusBossIndice.php
_______________________________________________ Libav-user mailing list [email protected] http://ffmpeg.org/mailman/listinfo/libav-user
