[FFmpeg-devel] fix for multiplexing avi with mp3

Víctor Paesa wzrlpy
Fri Oct 24 20:20:57 CEST 2008


Hi,

said Robert Bacs:
> Hi,
>
> I'm using ffmpeg to multiplex an avi file (only video stream) and an mp3
> into an avi file, they have the same length, but after some time I've
> got the following error:
>
> [NULL @ 02512E70]error, non monotone timestamps 57600 >= 57600
> av_interleaved_write_frame(): Error while opening file
>
> The source avi file is encoded with ffmpeg and the mp3 is encoded using
> lame encoder from the same source file and here is the command line:
>
> ffmpeg.exe -i video.avi -i audio.mp3 -acodec copy -vcodec copy -y
> out.avi
>
> Also I've made some changes in libavformat/utils.c, see attached patch
> file. I'm wondering if someone can confirm that this patch is ok, or
> suggest another solution to solve this issue ?

> -    if(st->cur_dts && st->cur_dts != AV_NOPTS_VALUE && st->cur_dts >=
pkt->dts){
> +    if(st->cur_dts && st->cur_dts != AV_NOPTS_VALUE && st->cur_dts >
pkt->dts){

What your patch does is to remove the warning, it does not solve the issue.
Notice that if two frames have exactly the same timestamp, you cannot
decide which one to show first, hence the error message.
You will need to investigate more why the timestamps are equal.

Regards,
V?ctor






More information about the ffmpeg-devel mailing list