Am 10.10.2011 08:54, schrieb wl2776:
Thank you for the answer, but you've misunderstood me. My problem is that functions avformat_open_input() and avformat_find_stream_info() incorrectly determine frame rate, incorrectly assign values to AVFormatContext/AVStream members (time_base, what else, I don't know) and, since that, av_read_frame returns frames having incorrect PTS/DTS. I tried using av_rescale_q() to recalculate timestamps, but the resulting value are like the following (dts, pts): (0, 0), (0, 0), (0, 0), (1, 1), (1, 1). And when I pass the last AVPacket, having pts = dts = 1, to the av_interleaved_write_frame(), it complains that "application has provided non-monotonically increasing timestamps".

Sry, excuse me.
Now your problem is clear. You write that the timestamps of the mjpeg frames are stored separately? That means libav don't see them? I think his is the reason for the wrong entries in avstream/ Fomartcontext. In this situation the best way i think, ist to manage the pts/dts values by your self. for mpeg-ts 25fps the right pts are 3600, 7200, ... , because the time_base is 90000 and the delay is 40 ms.

Steffen

--
Dipl.-Ing.(FH) Steffen Ebersbach
Hochschule Mittweida (FH)
University of Applied Sciences
Forschungsgruppe Optronik
Technikumplatz 17
09648 Mittweida

e-mail [email protected]
Telefon 03727 58-1113

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

Reply via email to