The encoded buffer is size 2053. It's working right. Stick that fool into a packet and enjoy!
Yeah, the docs aren't great, but the joy of open source software is you can see the code. For your use case, I recommend looking at output_example.c then move onto ffmpeg.c Sent via BlackBerry from T-Mobile -----Original Message----- From: Scott Zhang <[email protected]> Date: Tue, 21 Jul 2009 16:30:19 To: <[email protected]> Subject: [libav-user] About avcodec_encode_audio function Hi. Greeting to all friends. I am working on a directshow program. What I need is to capture the audio sample and save it into a flv. Now I captured the sample from directshow capturebuilder, and I saw the sample is using CODEC_ID_PCM which defined in mmreg.h. One sample has about 11042 size. My problem is when I try to encode it using avcodec_encode_audio function directly. I always get the return code 2053. By check the comment of avcodec_encode_audio, it says. " * @return On error a negative value is returned, on success zero or the number * of bytes used to encode the data read from the input buffer. */ " So each time I got 2053. I am not sure what exactly it mean. Does it mean I get an encoded buffer whose size is 2053 or it only used 2053 bytes from my sample? Does anyone know where can I get a document of this function? Thanks. Regards. Scott Zhang _______________________________________________ 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
