Peeyush Mishra wrote:
> Hi,
>
> I am trying to encode uncompressed audio data into MP2 codec for further RTP
> streaming , I am able to open /dev/dsp device and read raw data but when I
> pass that data into encoder its not encoding
I think you posted a similar question few days ago, and I explained what was
the problem with the code you posted: after fixing the two bugs I pointed out,
your previous program (test.c) works correctly.
The code you posted now looks like a bad cut'n'paste from ffmpeg.c and other
programs, and does not even compile (for example, AVOutputStream is a structure
defined in ffmpeg.c, not a part of the libav* API).
> the reason I found is out put
> AVCodecContext struct is not initialized , Please can anyone help me ,,,,
This is funny, because in your previous example you managed to initialise
it (AFAIK).
> Why we need any circular buffer sort of mechanism to pass data from device
> to encoder ,,, is that implementation is necessary .
Not necessary, AFAIK.
Summing up, what you need to do is:
1) Open an input AVFormatContext (see tools/pktdumper.c, for
example). The file name should probably be "/dev/dsp", and the
format should be "oss".
2) Open the input codec (it will be some kind of PCM codec,
according to the input format)
3) Open an output AVFormatContext and codec (see output_example.c).
The output format should be "rtp", and the file name should be
something like "rtp://<address>:<port>". The output codec should
be mp2
4) Enter a loop that reads an input packet, decodes it, encodes the
output, and writes it to the output format
Luca
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user