id	summary	reporter	owner	description	type	status	priority	component	version	resolution	keywords	cc	blockedby	blocking	reproduced	analyzed
2058	FFMPEG sometimes not able to stream copy mpeg2video files, error with pts < dts	ramitbhalla		"Summary of the bug: FFMPEG not able to stream copy some WTV files, even with -fflags +genpts in the command.

I've uploaded the original file and a text file to the FFMPEG ftp server.
Filename is SirDave US The Firm_WNBCDT_2012_02_18_21_34_17.wtv and SirDave US The Firm_WNBCDT_2012_02_18_21_34_17.txt

How to reproduce:
{{{
OUTPUT:
ffmpeg -fflags +genpts -i ""..\SirDave US The Firm_WNBCDT_2012_02_18_21_34_17.wtv"" -vcodec copy -acodec copy -map 0:a -map 0:v test-temp.ts

ffmpeg version N-48065-g6375318 Copyright (c) 2000-2012 the FFmpeg developers
  built on Dec 21 2012 09:06:30 with gcc 4.7.2 (GCC)
  configuration: --enable-static --arch=x86 --target-os=mingw32 --cross-prefix=/home/rdp/dev/ffmpeg-windows-build-helper
s/sandbox/mingw-w64-i686/bin/i686-w64-mingw32- --pkg-config=pkg-config --enable-gpl --enable-libx264 --enable-avisynth -
-enable-libxvid --enable-libmp3lame --enable-version3 --enable-zlib --enable-librtmp --enable-libvorbis --enable-libtheo
ra --enable-libspeex --enable-libopenjpeg --enable-gnutls --enable-libgsm --enable-libfreetype --enable-fontconfig --ena
ble-libass --enable-libutvideo --enable-libopus --disable-w32threads --enable-frei0r --enable-filter=frei0r --enable-lib
vo-aacenc --enable-bzlib --enable-libxavs --extra-cflags=-DPTW32_STATIC_LIB --enable-libopencore-amrnb --enable-libopenc
ore-amrwb --enable-libvo-amrwbenc --enable-libschroedinger --enable-libbluray --enable-libvpx --enable-runtime-cpudetect

  libavutil      52. 12.100 / 52. 12.100
  libavcodec     54. 81.100 / 54. 81.100
  libavformat    54. 49.102 / 54. 49.102
  libavdevice    54.  3.102 / 54.  3.102
  libavfilter     3. 29.100 /  3. 29.100
  libswscale      2.  1.103 /  2.  1.103
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
[mpeg2video @ 020cebc0] mpeg_decode_postinit() failure
    Last message repeated 33 times
Input #0, wtv, from '..\SirDave US The Firm_WNBCDT_2012_02_18_21_34_17.wtv':
  Metadata:
    WM/MediaClassPrimaryID: db9830bd-3ab3-4fab-8a371a995f7ff74
    WM/MediaClassSecondaryID: ba7f258a-62f7-47a9-b21f4651c42a000
    Title           : The Firm
    WM/SubTitle     : Chapter Seven
    WM/SubTitleDescription: Mitch's attempts to help a new client, Nate, are complicated when Nate's brother is named as
 a co-defendant; Tammy pressures a potential ally into explaining a cryptic clue.
    genre           : Drama;General;Series
    WM/OriginalReleaseTime: 0
    WM/MediaCredits : Josh Lucas/Callum Keith Rennie/Molly Parker/Natasha Calis/Juliette Lewis;;;Andrew Jenkins/Stuart H
ughes/Tricia Helfer
    service_provider: WNBCDT
    service_name    : WNBCDT (WNBC-DT)
    WM/MediaNetworkAffiliation: NBC Affiliate
    WM/MediaOriginalChannel: 4
    WM/MediaOriginalChannelSubNumber: 1
    WM/MediaOriginalBroadcastDateTime: 0001-01-01T00:00:00Z
    WM/MediaOriginalRunTime: 17215789295
    WM/MediaIsStereo: true
    WM/MediaIsRepeat: false
    WM/MediaIsLive  : false
    WM/MediaIsTape  : false
    WM/MediaIsDelay : false
    WM/MediaIsSubtitled: false
    WM/MediaIsMovie : false
    WM/MediaIsPremiere: false
    WM/MediaIsFinale: false
    WM/MediaIsSAP   : false
    WM/MediaIsSport : false
    WM/ParentalRating: TV-14
    WM/Provider     : MediaCenterDefault
    WM/VideoClosedCaptioning: true
    WM/WMRVEncodeTime: 2012-02-19 02:34:18
    WM/WMRVSeriesUID: !MCSeries!01419020
    WM/WMRVServiceID: !MCService!28459780
    WM/WMRVProgramID: !MCProgram!269627380
    WM/WMRVRequestID: 0
    WM/WMRVScheduleItemID: 0
    WM/WMRVQuality  : 3
    WM/WMRVOriginalSoftPrePadding: 2176
    WM/WMRVOriginalSoftPostPadding: 180
    WM/WMRVHardPrePadding: -2056
    WM/WMRVHardPostPadding: 0
    WM/WMRVATSCContent: true
    WM/WMRVDTVContent: true
    WM/WMRVHDContent: true
    Duration        : 16944809188
    WM/WMRVEndTime  : 2012-02-19 03:02:32
    WM/WMRVBitrate  : 14.730353
    WM/WMRVKeepUntil: -1
    WM/WMRVActualSoftPrePadding: -1
    WM/WMRVActualSoftPostPadding: 152
    WM/WMRVContentProtected: false
    WM/WMRVContentProtectedPercent: 0
    WM/WMRVExpirationSpan: 9223372036854775807
    WM/WMRVInBandRatingSystem: 255
    WM/WMRVInBandRatingLevel: 255
    WM/WMRVInBandRatingAttributes: 0
    WM/WMRVWatched  : false
    WM/MediaThumbWidth: 352
    WM/MediaThumbHeight: 198
    WM/MediaThumbStride: 1056
    WM/MediaThumbRet: 0
    WM/MediaThumbRatingSystem: 9
    WM/MediaThumbRatingLevel: 14
    WM/MediaThumbRatingAttributes: 0
    WM/MediaThumbAspectRatioX: 16
    WM/MediaThumbAspectRatioY: 9
    WM/MediaThumbTimeStamp: -4616189618054758400
    WM/MediaThumbType: 2
  Duration: 00:28:13.87, start: 44.031933, bitrate: 14735 kb/s
    Stream #0:0[0x2a](eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s
    Stream #0:1[0x2b]: Video: mpeg2video (Main), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 59.94 tbr, 10000k tbn
, 59.94 tbc
    Stream #0:2[0x2c](spa): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
    Stream #0:3[0x2d]: Subtitle: eia_608
    Stream #0:4[0x0]: Attachment: mjpeg
    Metadata:
      title           : TV Thumbnail
File 'test-temp.ts' already exists. Overwrite ? [y/N] y
Output #0, mpegts, to 'test-temp.ts':
  Metadata:
    WM/MediaClassPrimaryID: db9830bd-3ab3-4fab-8a371a995f7ff74
    WM/MediaClassSecondaryID: ba7f258a-62f7-47a9-b21f4651c42a000
    Title           : The Firm
    WM/SubTitle     : Chapter Seven
    WM/SubTitleDescription: Mitch's attempts to help a new client, Nate, are complicated when Nate's brother is named as
 a co-defendant; Tammy pressures a potential ally into explaining a cryptic clue.
    genre           : Drama;General;Series
    WM/OriginalReleaseTime: 0
    WM/MediaCredits : Josh Lucas/Callum Keith Rennie/Molly Parker/Natasha Calis/Juliette Lewis;;;Andrew Jenkins/Stuart H
ughes/Tricia Helfer
    service_provider: WNBCDT
    service_name    : WNBCDT (WNBC-DT)
    WM/MediaNetworkAffiliation: NBC Affiliate
    WM/MediaOriginalChannel: 4
    WM/MediaOriginalChannelSubNumber: 1
    WM/MediaOriginalBroadcastDateTime: 0001-01-01T00:00:00Z
    WM/MediaOriginalRunTime: 17215789295
    WM/MediaIsStereo: true
    WM/MediaIsRepeat: false
    WM/MediaIsLive  : false
    WM/MediaIsTape  : false
    WM/MediaIsDelay : false
    WM/MediaIsSubtitled: false
    WM/MediaIsMovie : false
    WM/MediaIsPremiere: false
    WM/MediaIsFinale: false
    WM/MediaIsSAP   : false
    WM/MediaIsSport : false
    WM/ParentalRating: TV-14
    WM/Provider     : MediaCenterDefault
    WM/VideoClosedCaptioning: true
    WM/WMRVEncodeTime: 2012-02-19 02:34:18
    WM/WMRVSeriesUID: !MCSeries!01419020
    WM/WMRVServiceID: !MCService!28459780
    WM/WMRVProgramID: !MCProgram!269627380
    WM/WMRVRequestID: 0
    WM/WMRVScheduleItemID: 0
    WM/WMRVQuality  : 3
    WM/WMRVOriginalSoftPrePadding: 2176
    WM/WMRVOriginalSoftPostPadding: 180
    WM/WMRVHardPrePadding: -2056
    WM/WMRVHardPostPadding: 0
    WM/WMRVATSCContent: true
    WM/WMRVDTVContent: true
    WM/WMRVHDContent: true
    Duration        : 16944809188
    WM/WMRVEndTime  : 2012-02-19 03:02:32
    WM/WMRVBitrate  : 14.730353
    WM/WMRVKeepUntil: -1
    WM/WMRVActualSoftPrePadding: -1
    WM/WMRVActualSoftPostPadding: 152
    WM/WMRVContentProtected: false
    WM/WMRVContentProtectedPercent: 0
    WM/WMRVExpirationSpan: 9223372036854775807
    WM/WMRVInBandRatingSystem: 255
    WM/WMRVInBandRatingLevel: 255
    WM/WMRVInBandRatingAttributes: 0
    WM/WMRVWatched  : false
    WM/MediaThumbWidth: 352
    WM/MediaThumbHeight: 198
    WM/MediaThumbStride: 1056
    WM/MediaThumbRet: 0
    WM/MediaThumbRatingSystem: 9
    WM/MediaThumbRatingLevel: 14
    WM/MediaThumbRatingAttributes: 0
    WM/MediaThumbAspectRatioX: 16
    WM/MediaThumbAspectRatioY: 9
    WM/MediaThumbTimeStamp: -4616189618054758400
    WM/MediaThumbType: 2
    encoder         : Lavf54.49.102
    Stream #0:0(eng): Audio: ac3, 48000 Hz, 5.1(side), 384 kb/s
    Stream #0:1(spa): Audio: ac3, 48000 Hz, stereo, 192 kb/s
    Stream #0:2: Video: mpeg2video, yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 29.97 fps, 90k tbn, 29.97 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:2 -> #0:1 (copy)
  Stream #0:1 -> #0:2 (copy)
Press [q] to stop, [?] for help
pts (147120491) < dts (147120742) in stream 2me=00:26:52.25 bitrate=15661.8kbits/s
av_interleaved_write_frame(): Invalid argument
}}}"	defect	open	normal	undetermined	git-master		av_interleaved_write_frame mpegts mpeg2video				1	0
