A]Below are the streams in the file: read_packet_loop.m2ts File PID Type Codec Lang ------------------------------------------------------------------------------- read_packet_loop.M2TS 4113 (0x1011) 0x1B AVC read_packet_loop.M2TS 4352 (0x1100) 0x83 TrueHD eng read_packet_loop.M2TS 4353 (0x1101) 0x86 DTS-HD MA eng read_packet_loop.M2TS 4354 (0x1102) 0x80 LPCM eng read_packet_loop.M2TS 4608 (0x1200) 0x90 PGS eng read_packet_loop.M2TS 4609 (0x1201) 0x90 PGS eng read_packet_loop.M2TS 4610 (0x1202) 0x90 PGS fra read_packet_loop.M2TS 4611 (0x1203) 0x90 PGS spa B]For the full size file, below is the only output from ffmpeg: ./ffmpeg -i read_packet_loop.m2ts FFmpeg version SVN-r15845, Copyright (c) 2000-2008 Fabrice Bellard, et al. configuration: libavutil 49.12. 0 / 49.12. 0 libavcodec 52. 3. 0 / 52. 3. 0 libavformat 52.23. 1 / 52.23. 1 libavdevice 52. 1. 0 / 52. 1. 0 built on Nov 16 2008 19:32:31, gcc: 4.3.0 20080428 (Red Hat 4.3.0-8) ffmpeg seems to be reading to the EOF, which would take a very long time. C]As a matter of fact, when the statement below is commented out of the av_read_packet routine in libavformat/utils.c: // for(;;){ then, for the full size file, this is the output: ./ffmpeg -i read_packet_loop.m2ts FFmpeg version SVN-r15845, Copyright (c) 2000-2008 Fabrice Bellard, et al. configuration: libavutil 49.12. 0 / 49.12. 0 libavcodec 52. 3. 0 / 52. 3. 0 libavformat 52.23. 1 / 52.23. 1 libavdevice 52. 1. 0 / 52. 1. 0 built on Nov 16 2008 19:32:31, gcc: 4.3.0 20080428 (Red Hat 4.3.0-8) Seems stream 1 codec frame rate differs from container frame rate: inf (1/0) ->90000.00 (90000/1) Seems stream 2 codec frame rate differs from container frame rate: inf (1/0) ->90000.00 (90000/1) Input #0, mpegts, from 'read_packet_loop.m2ts': Duration: N/A, start: 11.650667, bitrate: N/A Program 1 Stream #0.0[0x1011]: Video: h264, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 23.98 tb(r) Must supply at least one output file D] Now if the file is truncated, we get similar output regardless of whether the for loop is removed, because it reaches the EOF so much sooner. And, this is the output ./ffmpeg -i trunc_read_packet_loop.m2ts FFmpeg version SVN-r15845, Copyright (c) 2000-2008 Fabrice Bellard, et al. configuration: libavutil 49.12. 0 / 49.12. 0 libavcodec 52. 3. 0 / 52. 3. 0 libavformat 52.23. 1 / 52.23. 1 libavdevice 52. 1. 0 / 52. 1. 0 built on Nov 16 2008 19:32:31, gcc: 4.3.0 20080428 (Red Hat 4.3.0-8) [mpegts @ 0x9e9d240]Could not find codec parameters (Video: 0x0000) [mpegts @ 0x9e9d240]Could not find codec parameters (Video: 0x0000) [mpegts @ 0x9e9d240]Could not find codec parameters (Audio: 0x0000, 0 channels,s16) Seems stream 1 codec frame rate differs from container frame rate: inf (1/0) ->90000.00 (90000/1) Seems stream 2 codec frame rate differs from container frame rate: inf (1/0) ->90000.00 (90000/1) Input #0, mpegts, from 'trunc_read_packet_loop.m2ts': Duration: N/A, start: 11.650667, bitrate: N/A Program 1 Stream #0.0[0x1011]: Video: h264, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 23.98 tb(r) Must supply at least one output file