id	summary	reporter	owner	description	type	status	priority	component	version	resolution	keywords	cc	blockedby	blocking	reproduced	analyzed
1732	avienc: inserts too many (>90%) empty packets	Andrew		"Summary of the bug:
avienc insert 99% empty packets.

What for a strange code below?
How it is possible to compare the (pkt->dts) to the (avist->)packet_count?

{{{
avi_write_packet()
    while(enc->block_align==0 && \
          pkt->dts != AV_NOPTS_VALUE && \
          pkt->dts > avist->packet_count && \
          enc->codec_id != AV_CODEC_ID_XSUB){
        AVPacket empty_packet;

        if( pkt->dts - avist->packet_count > 60000){
}}}

How to reproduce:
Apply avienc_show_emtied.diff patch (see attachment).

{{{
% ./ffmpeg -rtsp_transport tcp -i 'rtsp://axis1031/axis-media/media.amp?videocodec=mpeg4&audio=0&video=1' -vcodec copy -acodec copy -y /var/tmp/a.avi
ffmpeg version N-44432-g59db014 Copyright (c) 2000-2012 the FFmpeg developers
  built on Sep 13 2012 19:13:56 with gcc 4.4.5 (Debian 4.4.5-8)
  configuration: --enable-version3 --enable-runtime-cpudetect
  libavutil      51. 73.100 / 51. 73.100
  libavcodec     54. 55.100 / 54. 55.100
  libavformat    54. 27.100 / 54. 27.100
  libavdevice    54.  2.100 / 54.  2.100
  libavfilter     3. 16.103 /  3. 16.103
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
[rtsp @ 0x996c5e0] Estimating duration from bitrate, this may be inaccurate
Input #0, rtsp, from 'rtsp://axis1031/axis-media/media.amp?videocodec=mpeg4&audio=0&video=1':
  Metadata:
    title           : Media Presentation
  Duration: N/A, start: 0.131567, bitrate: N/A
    Stream #0:0: Video: mpeg4 (Advanced Simple Profile), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 30.08 tbr, 90k tbn, 1k tbc
Output #0, avi, to '/var/tmp/a.avi':
  Metadata:
    INAM            : Media Presentation
    ISFT            : Lavf54.27.100
    Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=2-31, 2k tbn, 2k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[avi @ 0x997f780] V: insert 198 empty pkt, total empty 198 from 200, 99%
[avi @ 0x997f780] V: insert 199 empty pkt, total empty 397 from 400, 99%
[avi @ 0x997f780] V: insert 199 empty pkt, total empty 596 from 600, 99%
[avi @ 0x997f780] V: insert 198 empty pkt, total empty 794 from 799, 99%
[avi @ 0x997f780] V: insert 199 empty pkt, total empty 993 from 999, 99%
[avi @ 0x997f780] V: insert 199 empty pkt, total empty 1192 from 1199, 99%
[avi @ 0x997f780] V: insert 199 empty pkt, total empty 1391 from 1399, 99%
[avi @ 0x997f780] V: insert 199 empty pkt, total empty 1590 from 1599, 99%
[avi @ 0x997f780] V: insert 199 empty pkt, total empty 1789 from 1799, 99%
[avi @ 0x997f780] V: insert 62 empty pkt, total empty 1851 from 1862, 99%
[avi @ 0x997f780] V: insert 62 empty pkt, total empty 1913 from 1925, 99%
[avi @ 0x997f780] V: insert 72 empty pkt, total empty 1985 from 1998, 99%
[avi @ 0x997f780] V: insert 63 empty pkt, total empty 2048 from 2062, 99%
[avi @ 0x997f780] V: insert 62 empty pkt, total empty 2110 from 2125, 99%
[avi @ 0x997f780] V: insert 72 empty pkt, total empty 2182 from 2198, 99%
[avi @ 0x997f780] V: insert 63 empty pkt, total empty 2245 from 2262, 99%
[avi @ 0x997f780] V: insert 62 empty pkt, total empty 2307 from 2325, 99%
[avi @ 0x997f780] V: insert 72 empty pkt, total empty 2379 from 2398, 99%
[avi @ 0x997f780] V: insert 62 empty pkt, total empty 2441 from 2461, 99%
[avi @ 0x997f780] V: insert 63 empty pkt, total empty 2504 from 2525, 99%
[avi @ 0x997f780] V: insert 62 empty pkt, total empty 2566 from 2588, 99%
[avi @ 0x997f780] V: insert 72 empty pkt, total empty 2638 from 2661, 99%
[avi @ 0x997f780] V: insert 63 empty pkt, total empty 2701 from 2725, 99%
[avi @ 0x997f780] V: insert 62 empty pkt, total empty 2763 from 2788, 99%
[avi @ 0x997f780] V: insert 72 empty pkt, total empty 2835 from 2861, 99%
[avi @ 0x997f780] V: insert 62 empty pkt, total empty 2897 from 2924, 99%
[avi @ 0x997f780] V: insert 63 empty pkt, total empty 2960 from 2988, 99%
[avi @ 0x997f780] V: insert 72 empty pkt, total empty 3032 from 3061, 99%
[avi @ 0x997f780] V: insert 62 empty pkt, total empty 3094 from 3124, 99%
[avi @ 0x997f780] V: insert 63 empty pkt, total empty 3157 from 3188, 99%
[avi @ 0x997f780] V: insert 72 empty pkt, total empty 3229 from 3261, 99%
[avi @ 0x997f780] V: insert 62 empty pkt, total empty 3291 from 3324, 99%
[avi @ 0x997f780] V: insert 62 empty pkt, total empty 3353 from 3387, 98%
[avi @ 0x997f780] V: insert 73 empty pkt, total empty 3426 from 3461, 98%
[avi @ 0x997f780] V: insert 62 empty pkt, total empty 3488 from 3524, 98%
[avi @ 0x997f780] V: insert 62 empty pkt, total empty 3550 from 3587, 98%
[avi @ 0x997f780] V: insert 72 empty pkt, total empty 3622 from 3660, 98%
[avi @ 0x997f780] V: insert 63 empty pkt, total empty 3685 from 3724, 98%
V: insert 62 empty pkt, total empty 3747 from 3787, 98%1.86 bitrate=1210.7kbits/s    
[avi @ 0x997f780] V: insert 72 empty pkt, total empty 3819 from 3860, 98%
[avi @ 0x997f780] V: insert 63 empty pkt, total empty 3882 from 3924, 98%
[avi @ 0x997f780] V: insert 62 empty pkt, total empty 3944 from 3987, 98%
[avi @ 0x997f780] V: insert 72 empty pkt, total empty 4016 from 4060, 98%
[avi @ 0x997f780] V: insert 62 empty pkt, total empty 4078 from 4123, 98%
[avi @ 0x997f780] V: insert 63 empty pkt, total empty 4141 from 4187, 98%
[avi @ 0x997f780] V: insert 72 empty pkt, total empty 4213 from 4260, 98%
[avi @ 0x997f780] V: insert 62 empty pkt, total empty 4275 from 4323, 98%
[avi @ 0x997f780] V: insert 63 empty pkt, total empty 4338 from 4387, 98%
[avi @ 0x997f780] V: insert 72 empty pkt, total empty 4410 from 4460, 98%
[avi @ 0x997f780] V: insert 62 empty pkt, total empty 4472 from 4523, 98%
[avi @ 0x997f780] V: insert 62 empty pkt, total empty 4534 from 4586, 98%
[avi @ 0x997f780] V: insert 73 empty pkt, total empty 4607 from 4660, 98%
[avi @ 0x997f780] V: insert 62 empty pkt, total empty 4669 from 4723, 98%
[avi @ 0x997f780] V: insert 62 empty pkt, total empty 4731 from 4786, 98%
V: insert 73 empty pkt, total empty 4804 from 4860, 98%2.39 bitrate=1236.6kbits/s    
frame=   57 fps= 51 q=-1.0 Lsize=     443kB time=00:00:02.43 bitrate=1492.0kbits/s    
video:323kB audio:0kB subtitle:0 global headers:0kB muxing overhead 37.036578%

}}}"	defect	closed	normal	avformat	git-master	invalid	avi				0	0
