Hi to all,
I have a problem that I can not solve.
In my encoder I'm encoding video and audio, the problem comes with the audio
part.
My original audio raw samples are pcm float  -1/+1 stereo. So I have 4 bytes
(2 for the L channel and 2 for the R channel TOTAL = 4 bytes).
To encode an audio frame and use the avcodec_encode_audio ffmpeg need the
samples to be
signed short (2 bytes - 1 for the L channel and 1 for the R channel TOTAL =
2 bytes) so to use this routine I need to convert my original raw samples
from float to signed short.
I use this simple algorithm

sample_signed_short = (signed short) sample_float * 32767; // this for every
sample I have

Doing this I'm sure I loose lots of quality because 1 byte can not store the
information that 2 bytes contains right? In fact the quality of the audio of
my produced mpeg is very bad.

What can I do? Where are my mistakes?
Please I need some help.
Regards,
Franco
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to