Ivans Chou skrev 2010-09-01 20:00:
I have an application that uses the libavcodec API to write video files. It
allows me to use all the various encoders that libavcodec supports using a
single code base and all I have to do is change the codec and the codec's
parameters. I also need to write out AVI's encoded with cinepak using the
iccvid.dll codec.
My code currently uses...
pCodec = avcodec_find_encoder( selected_codec );
avcodec_encode_video( pCodecCtx, buffer, numBytes, pFrame );
av_write_frame( pFormatCtx,&pkt );
To select an encoder, encode, and write frames, which works great. Can I use
this same code to encode using iccvid.dll or must I use completely reimplement
this to encode with that codec? If so, would someone happen to have some sample
code that shows how to accomplish this?
Thanks,
Since VFW and libavcodec are two completely different API:s, you most
certainly can't use the same code. You can write a small wrapper codec
for the cinepak encoder and register it at runtime though. Look at how
some of the simpler encoders are implemented (libavcodec/*enc.c). Then
use avcodec_register() to register your wrapper. That way you don't have
to recompile libavcodec.
Oh, and a side note: I wrote a cinepak encoder for libavcodec a few
months ago. Works with both 4:2:0 and grayscale. I might post it on the
list some day. I haven't compared it to the one that Windows comes with
though, so I'm not sure how they compare.
/Tomas
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user