Hi to everyone. i'll repost my question that was hijacked before.
I'm compiling a minimal configuration of ffmpeg library (I disabled
almost everything on configure, except for avi format, rawvideo encoder,
mpeg4video parser and file protocol).
The target on which I compile is a Texas Instruments DaVinci DM355
board, with an ARM9 processor and Montavista Linux (kernel 2.6.10).
First question: What --arch option should I give to the configure
program? I use --arch=arm but I wonder if there's a better architecture
option for the ARM9.
Second question: I have an hardware encoder on-board. It means I'm not
using ffmpeg for encoding. The hw encoder nicely gives me an array
containig a raw MPEG4 frames, one at a time, an I want to mux this video
stream into an AVI file.
I'd like to use ffmpeg to do this.
Is it ok to allocate an AVFormatContext, set its oformat to "avi",
url_fopen a file, associate it with the context, use av_write_header,
wrap the raw mpeg4 frame into an AVPacket and finally do an
av_write_frame to write the packet on the avi file?
Schematically, I'd like to do something like that:
/*****************************************************************************************/
AVFormatContext* context =
(AVFormatContext*)av_mallocz(sizeof(AVFormatContext));
context->oformat = guess_format(format, NULL, NULL); /* (format contains
"avi") */
AVStream* stream = av_new_stream(context, 0);
if (url_fopen(&context->pb, filename, URL_WRONLY) < 0)
return ERROR;
av_write_header(context);
[Get the buffer from the hardware encoder, it's placed in outbuf and its
size in bytes is out_size]
AVPacket pkt;
av_init_packet(&pkt);
pkt.stream_index = stream->index;
pkt.data = outbuf;
pkt.size = out_size;
av_write_frame(context, &pkt);
/*****************************************************************************************/
Will it work? Am I missing something? Is it the correct way to do that?
Many thanks,
Regards,
Cristiano.
--
--
Belloni Cristiano
Imavis Srl.
www.imavis.com <http://www.imavis.com>
[EMAIL PROTECTED] <mailto://[EMAIL PROTECTED]>
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user