hello list

I am trying to make an mp4 video from png images and then adding sound to
its audio stream. I have compiled the video and it plays fine but when it
comes to adding audio to it, it fails. Here are some steps for audio. I have
installed ffmpeg with libfaac, libfaad, and libmp3lame enabled.

 what I am doing is:

I read a wav file
get its audio stream
get a decoder for it
decode this video ( returns me the value "1" as output)
resample it (still the value of output is 1)

then I am trying to encode it to aac because mp4 container by default take
aac audio in its audio stream. then

pkt.size   = avcodec_encode_audio ( pAudioCodec, audioBuffer,
AUDIO_BUF_SIZE, Samples ); //samples contain the value 1 which I dont what
it is.


when this statement executes pkt.size becomes 0 and the audioBuffer contains
nothing in it.


After this I do:

pkt.pts    = av_rescale_q ( audioCodec->coded_frame->pts,
audioCodec->time_base, audioStream->time_base );

here it fails because audioCodec->coded_frame is null.

I have initalized all the codecs, buffers etc. but it fails over here. dont
know whether there is some problem with decoded packet or with this encode
function.

And one another confusion, can we combine mp4 video and mp3 or wav audio in
an mp4 container so that there should be no encoding required for audio
part.

I have asked dumb questions because i am a newbie.

Regards,
Shujaat




.
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to