Hi, I am rewriting some messy FFMPEG code I wrote a while ago. My reference is muxing.c The difference I have is that my audio stream comes from file (AAC) ,while video packets come from generated pixel frame.
I mostly have it working,but my problem is interleaved packets write.If I do it like the example,that's : int cc = av_compare_ts(mVideoOutStream.next_pts, mVideoOutStream.enc->time_base, mAudioOutStream.next_pts, mAudioOutStream.enc->time_base); if (mAudioOutStream.st == NULL || cc <= 0) { //write video } else { //write audo. } I am not getting correct results. The only way it looks fine is if I do it like this: //Write video frame first ,always! Then: if(cc > 0) { //write audio packets. } I don't understand why it works only in this case. From what I understood av_interleaved_write_frame() should take care of the correct interleaving. But I see that I must write video frames always,and audio packets only when av_compare_ts is greater than zero. Thanks!
_______________________________________________ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user