id	summary	reporter	owner	description	type	status	priority	component	version	resolution	keywords	cc	blockedby	blocking	reproduced	analyzed
1801	muxing.c example code fails for most formats	AztecC		"Summary of the bug: The muxing.c example in doc/examples only seems to work for a few formats like .avi. Some formats seem to work like .flv, but it produces way too many frames. Anything involving H264 generates a pts(0) < dts(0) error. The fix is fairly simple. Add:

    if (pkt.pts != AV_NOPTS_VALUE)
        pkt.pts = av_rescale_q( pkt.pts, c->time_base, st->time_base );
    if (pkt.dts != AV_NOPTS_VALUE)
        pkt.dts = av_rescale_q( pkt.dts, c->time_base, st->time_base );

after the call to avcodec_encode_video2 inside the test for 'got_output'. It can also be added after the call to avcodec_encode_audio2 as well for completeness.
"	defect	closed	normal	documentation	git-master	fixed					1	0
