I'm trying to generate MP4 files containing audio from various files, such as 
MP3, WAV, OGG, but I'm having some troubles (I'm also putting video in there, 
but for simplicity's sake I'm omitting that for this question, since I've got 
that working). My current code opens an audio file, decodes the content and 
converts it into the MP4 container and finally writes it into the destination 
file as interleaved frames.It works perfectly for most MP3 files, but when 
inputting WAV or OGG, the audio in the resulting MP4 is slightly distorted and 
often plays at the wrong speed (up to many times faster or slower).I've looked 
at countless of examples of using the converting functions (swr_convert), but I 
can't seem to get rid of the noise in the exported audio.
Code (for decoding, converting and encoding): http://pastebin.com/ENzeaHpU
I have also tried setting appropriate pts values for outgoing frames, but that 
doesn't seem to affect the sound quality at all.I'm also unsure how/if I should 
be allocating the converted data, can av_samples_alloc be used for this? What 
about avcodec_fill_audio_frame? Am I on the right track?


/David
                                          
_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to