Opened 12 years ago

Closed 8 years ago

#2058 closed defect (fixed)

FFMPEG sometimes not able to stream copy mpeg2video files, error with pts < dts

Reported by: ramitb Owned by:
Priority: normal Component: ffmpeg
Version: git-master Keywords: av_interleaved_write_frame mpegts mpeg2video
Cc: ramitbhalla@gmail.com Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

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

Attachments (1)

csi.ts (1.3 MB ) - added by ramitb 12 years ago.

Download all attachments as: .zip

Change History (19)

comment:1 by Carl Eugen Hoyos, 12 years ago

Keywords: av_interleaved_write_frame added

Is this problem also reproducible with the following command line?
$ ffmpeg -i SirDave\ US\ The\ Firm_WNBCDT_2012_02_18_21_34_17.wtv -an -vcodec copy out.ts
If yes, please provide complete, uncut console output.

comment:2 by ramitb, 12 years ago

Yes:

ffmpeg  -i "SirDave US The Firm_WNBCDT_2012_02_18_21_34_17.wtv" -an -vcodec copy out.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 @ 002ee8a0] 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
Output #0, mpegts, to 'out.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: 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:1 -> #0:0 (copy)
Press [q] to stop, [?] for help
pts (147120491) < dts (147120742) in stream 0me=00:27:02.62 bitrate=15010.4kbits/s
av_interleaved_write_frame(): Invalid argument

comment:3 by Carl Eugen Hoyos, 12 years ago

Keywords: wtv mpeg2video added
Status: newopen
Version: unspecifiedgit-master

comment:4 by ramitb, 12 years ago

I'm facing similar issues (same error messagE) with some TS files also. Should I tag those to this ticket also or should I open a new ticket for them?

ffmpeg  -y -threads 0 -i "CSI- Crime Scene Investigation_WVLTDT_22_02_2012_21_58_01.ts" -ss 23.19 -t 233.4 -map 0:a -map 0:v -vcodec copy -acodec copy "CSI- Crime Scene Investigation_WVLTDT_22_02_2012_21_58_01_23_256.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-helpers/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-libtheora --enable-libspeex --enable-libopenjpeg --enable-gnutls --enable-libgsm --enable-libfreetype --enable-fontconfig --enable-libass --enable-libutvideo --enable-libopus --disable-w32threads --enable-frei0r --enable-filter=frei0r --enable-libvo-aacenc --enable-bzlib --enable-libxavs --extra-cflags=-DPTW32_STATIC_LIB --enable-libopencore-amrnb --enable-libopencore-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
--> Input #0, mpegts, from 'CSI- Crime Scene Investigation_WVLTDT_22_02_2012_21_58_01.ts':
-->   Duration: 01:04:58.13, start: 1.269000, bitrate: 10817 kb/s
--> Video duration=3898.13
-->   Program 1 
-->     Metadata:
-->       service_name    : Service01
-->       service_provider: FFmpeg
-->     Stream #0:0[0x100]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 59.94 fps, 59.94 tbr, 90k tbn, 119.88 tbc
-->     Stream #0:1[0x101]: Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 192 kb/s
--> Output #0, mpegts, to 'CSI- Crime Scene Investigation_WVLTDT_22_02_2012_21_58_01_23_256.ts':
-->   Metadata:
-->     encoder         : Lavf54.49.102
-->     Stream #0:0: Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, 192 kb/s
-->     Stream #0:1: Video: mpeg2video ([2][0][0][0] / 0x0002), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 59.94 fps, 90k tbn, 59.94 tbc
--> Stream mapping:
-->   Stream #0:1 -> #0:0 (copy)
-->   Stream #0:0 -> #0:1 (copy)
--> Press [q] to stop, [?] for help
--> frame=    0 fps=0.0 q=-1.0 size=       0kB time=00:00:00.00 bitrate=   0.0kbits/s    
--> frame=    0 fps=0.0 q=-1.0 size=       0kB time=00:00:00.00 bitrate=   0.0kbits/s    
--> frame=    0 fps=0.0 q=-1.0 size=       0kB time=00:00:00.00 bitrate=   0.0kbits/s    
--> frame=    0 fps=0.0 q=-1.0 size=       0kB time=00:00:00.00 bitrate=   0.0kbits/s    
--> pts (22590) < dts (24120) in stream 1
--> av_interleaved_write_frame(): Invalid argument

comment:5 by Carl Eugen Hoyos, 12 years ago

Please provide a sample.

comment:6 by ramitb, 12 years ago

I'm attaching a small sample. Here is the command (simplified) to reproduce the issue:

ffmpeg -threads 0 -i csi.ts -map 0:a -map 0:v -vcodec copy -acodec copy "csi-test.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
Input #0, mpegts, from 'csi.ts':
  Duration: 00:00:01.44, start: 1.269000, bitrate: 7733 kb/s
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 59.94 fp
s, 59.92 tbr, 90k tbn, 119.88 tbc
    Stream #0:1[0x101]: Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 192 kb/s
File 'csi-test.ts' already exists. Overwrite ? [y/N] y
Output #0, mpegts, to 'csi-test.ts':
  Metadata:
    encoder         : Lavf54.49.102
    Stream #0:0: Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, 192 kb/s
    Stream #0:1: Video: mpeg2video ([2][0][0][0] / 0x0002), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 59.94 fps, 90k
 tbn, 59.94 tbc
Stream mapping:
  Stream #0:1 -> #0:0 (copy)
  Stream #0:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
[mpegts @ 03630060] st:0 PTS: 43650 DTS: 39150 < 39151 invalid, clipping
[mpegts @ 03630060] pts (42120) < dts (43650) in stream 1
av_interleaved_write_frame(): Invalid argument

by ramitb, 12 years ago

Attachment: csi.ts added

comment:7 by Carl Eugen Hoyos, 12 years ago

Isn't this also reproducible with the following command line?
$ ffmpeg -i csi.ts -an -vcodec copy csi-test.ts

comment:8 by ramitb, 12 years ago

Yes

ffmpeg.2311.exe -i csi.ts -vcodec copy -an "csi-test.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
Input #0, mpegts, from 'csi.ts':
  Duration: 00:00:01.44, start: 1.269000, bitrate: 7733 kb/s
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 59.94 fp
s, 59.92 tbr, 90k tbn, 119.88 tbc
    Stream #0:1[0x101]: Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 192 kb/s
File 'csi-test.ts' already exists. Overwrite ? [y/N] y
Output #0, mpegts, to 'csi-test.ts':
  Metadata:
    encoder         : Lavf54.49.102
    Stream #0:0: Video: mpeg2video ([2][0][0][0] / 0x0002), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 59.94 fps, 90k
 tbn, 59.94 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[mpegts @ 035d0060] st:0 PTS: 0 DTS: -4500 < -4499 invalid, clipping
[mpegts @ 035d0060] pts (-1530) < dts (0) in stream 0
av_interleaved_write_frame(): Invalid argument

comment:9 by Carl Eugen Hoyos, 12 years ago

Keywords: mpegts added; wtv removed
Reproduced by developer: set
Summary: FFMPEG sometimes not able to stream copy WTV files, error with pts < dtsFFMPEG sometimes not able to stream copy mpeg2video files, error with pts < dts

The file you originally uploaded does not work here:

$ ls -l SirDave\ US\ The\ Firm_WNBCDT_2012_02_18_21_34_17.wtv
-rw-r--r-- 1 cehoyos users 3104090772 Dec 23 21:23 SirDave US The Firm_WNBCDT_2012_02_18_21_34_17.wtv
$ md5sum SirDave\ US\ The\ Firm_WNBCDT_2012_02_18_21_34_17.wtv
09b8b98c24a739c04078ba21b956aaed  SirDave US The Firm_WNBCDT_2012_02_18_21_34_17.wtv
$ ffmpeg -i SirDave\ US\ The\ Firm_WNBCDT_2012_02_18_21_34_17.wtv
ffmpeg version N-48238-g10a3fa8 Copyright (c) 2000-2012 the FFmpeg developers
  built on Dec 27 2012 21:51:00 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl --disable-indev=jack
  libavutil      52. 12.100 / 52. 12.100
  libavcodec     54. 81.100 / 54. 81.100
  libavformat    54. 50.102 / 54. 50.102
  libavdevice    54.  3.102 / 54.  3.102
  libavfilter     3. 30.101 /  3. 30.101
  libswscale      2.  1.103 /  2.  1.103
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
[wtv @ 0x2fc0500] unknown guid 704488df063b82cc213dc80000000000, expected dir_entry_guid; remaining directory entries ignored
[wtv @ 0x2fc0500] timeline data missing
SirDave US The Firm_WNBCDT_2012_02_18_21_34_17.wtv: Invalid data found when processing input

I suggest we concentrate on the transport stream sample until you find a shorter wtv sample to reproduce.

comment:10 by Carl Eugen Hoyos, 12 years ago

$ ffmpeg -i csi.ts -an -vcodec copy -f null -
ffmpeg version N-48238-g10a3fa8 Copyright (c) 2000-2012 the FFmpeg developers
  built on Dec 27 2012 21:51:00 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl --disable-indev=jack
  libavutil      52. 12.100 / 52. 12.100
  libavcodec     54. 81.100 / 54. 81.100
  libavformat    54. 50.102 / 54. 50.102
  libavdevice    54.  3.102 / 54.  3.102
  libavfilter     3. 30.101 /  3. 30.101
  libswscale      2.  1.103 /  2.  1.103
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Input #0, mpegts, from 'csi.ts':
  Duration: 00:00:01.44, start: 1.269000, bitrate: 7733 kb/s
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 59.94 fps, 59.92 tbr, 90k tbn, 119.88 tbc
    Stream #0:1[0x101]: Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 192 kb/s
Output #0, null, to 'pipe:':
  Metadata:
    encoder         : Lavf54.50.102
    Stream #0:0: Video: mpeg2video ([2][0][0][0] / 0x0002), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 59.94 fps, 90k tbn, 59.94 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[null @ 0x200d800] st:0 PTS: 0 DTS: -4500 < -4499 invalid, clipping
[null @ 0x200d800] pts (-1530) < dts (0) in stream 0
[null @ 0x200d800] pts (3060) < dts (4500) in stream 0
[null @ 0x200d800] pts (7560) < dts (9000) in stream 0
[null @ 0x200d800] pts (12060) < dts (13500) in stream 0
[null @ 0x200d800] pts (16560) < dts (18000) in stream 0
[null @ 0x200d800] pts (21060) < dts (22500) in stream 0
[null @ 0x200d800] pts (25560) < dts (27000) in stream 0
[null @ 0x200d800] pts (30060) < dts (31500) in stream 0
[null @ 0x200d800] pts (34560) < dts (36090) in stream 0
[null @ 0x200d800] pts (39060) < dts (40590) in stream 0
[null @ 0x200d800] pts (43560) < dts (45090) in stream 0
[null @ 0x200d800] pts (48060) < dts (49590) in stream 0
[null @ 0x200d800] pts (52560) < dts (54090) in stream 0
[null @ 0x200d800] pts (57060) < dts (58590) in stream 0
[null @ 0x200d800] pts (61560) < dts (63090) in stream 0
[null @ 0x200d800] pts (66060) < dts (67590) in stream 0
[null @ 0x200d800] pts (70560) < dts (72090) in stream 0
[null @ 0x200d800] pts (75060) < dts (76590) in stream 0
[null @ 0x200d800] pts (79560) < dts (81090) in stream 0
frame=   60 fps=0.0 q=-1.0 Lsize=N/A time=00:00:00.93 bitrate=N/A
video:1213kB audio:0kB subtitle:0 global headers:0kB muxing overhead -100.001771%

comment:11 by ramitb, 12 years ago

Please delete the file, I'll try upload it again with a another ftp client and see if it works.

Version 0, edited 12 years ago by ramitb (next)

comment:12 by Harry Tipper, 12 years ago

Any info on this? Getting a lot of these errors with my mpeg2 files.

comment:13 by Mista_D, 11 years ago

One more sample that fails to "-codec copy", but decodes fine.
http://www.mediafire.com/watch/7h8ckfwftmxjh3t/test.mpg

ffmpeg213 -y -i test.mpg -c copy -v 99 -fdebug ts -debug_ts t.ts
ffmpeg version 2.1.3 Copyright (c) 2000-2013 the FFmpeg developers

built on Jan 21 2014 18:05:50 with gcc 4.1.2 (GCC) 20080704 (Red Hat 4.1.2-52)
configuration: --enable-static --enable-postproc --enable-gpl --enable-avfilter --enable-libx264 --enable-libxvid --enable-libmp3lame --enable-libfaac --enable-pthreads --enable-swscale --enable-runtime-cpudetect --disable-devices --disable-avdevice --extra-ldflags=-static --disable-shared --enable-bzlib --enable-zlib --extra-libs='-lx264 -lxvidcore -lmp3lame -lpthread -lm -lbz2 -lz -lpthread -lvpx -lass -lfontconfig -lexpat -lfreetype -lfaac' --disable-encoder=libgsm --disable-decoder=libgsm --disable-doc --enable-libvpx --enable-libass --enable-version3 --enable-nonfree --enable-libfreetype
libavutil 52. 48.101 / 52. 48.101
libavcodec 55. 39.101 / 55. 39.101
libavformat 55. 19.104 / 55. 19.104
libavfilter 3. 90.100 / 3. 90.100
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 17.104 / 0. 17.104
libpostproc 52. 3.100 / 52. 3.100

Splitting the commandline.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '-i' ... matched as input file with argument 'test.mpg'.
Reading option '-c' ... matched as option 'c' (codec name) with argument 'copy'.
Reading option '-v' ... matched as option 'v' (set logging level) with argument '99'.
Reading option '-fdebug' ... matched as AVOption 'fdebug' with argument 'ts'.
Reading option '-debug_ts' ... matched as option 'debug_ts' (print timestamp debugging info) with argument '1'.
Reading option 't.ts' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option y (overwrite output files) with argument 1.
Applying option v (set logging level) with argument 99.
Applying option debug_ts (print timestamp debugging info) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input file test.mpg.
Successfully parsed a group of options.
Opening an input file: test.mpg.
[mpeg @ 0x1429df60] Format mpeg probed with size=8192 and score=52
[mpeg @ 0x1429df60] File position before avformat_find_stream_info() is 0
[mpeg @ 0x1429df60] invalid dts/pts combination 22413
[mpeg @ 0x1429df60] first_dts 22413 not matching first dts 29460 (pts 29460, duration 783) in the queue

Last message repeated 8 times

[mpeg @ 0x1429df60] first_dts 22413 not matching first dts 37297 (pts 37297, duration 783) in the queue

Last message repeated 8 times

[mpeg @ 0x1429df60] first_dts 22413 not matching first dts 45133 (pts 45133, duration 783) in the queue

Last message repeated 7 times

[mpeg @ 0x1429df60] first_dts 22413 not matching first dts 52187 (pts 52187, duration 783) in the queue

Last message repeated 8 times

[mpeg @ 0x1429df60] first_dts 22413 not matching first dts 60023 (pts 60023, duration 783) in the queue

Last message repeated 8 times

[mpeg @ 0x1429df60] first_dts 22413 not matching first dts 67860 (pts 67860, duration 783) in the queue

Last message repeated 8 times

[mpeg @ 0x1429df60] first_dts 22413 not matching first dts 75697 (pts 75697, duration 783) in the queue

Last message repeated 7 times

[mpeg @ 0x1429df60] first_dts 22413 not matching first dts 82750 (pts 82750, duration 783) in the queue

Last message repeated 8 times

[mpeg @ 0x1429df60] first_dts 22413 not matching first dts 90586 (pts 90586, duration 783) in the queue

Last message repeated 8 times

[mpeg @ 0x1429df60] first_dts 22413 not matching first dts 98423 (pts 98423, duration 783) in the queue

Last message repeated 8 times

[mpeg @ 0x1429df60] first_dts 22413 not matching first dts 106260 (pts 106260, duration 783) in the queue

Last message repeated 7 times

[mpeg @ 0x1429df60] first_dts 22413 not matching first dts 113314 (pts 113314, duration 783) in the queue

Last message repeated 8 times

[mpeg @ 0x1429df60] first_dts 22413 not matching first dts 121150 (pts 121150, duration 783) in the queue

Last message repeated 8 times

[mpeg @ 0x1429df60] first_dts 22413 not matching first dts 128986 (pts 128986, duration 783) in the queue

Last message repeated 7 times

[mpeg @ 0x1429df60] first_dts 22413 not matching first dts 136040 (pts 136040, duration 783) in the queue

Last message repeated 8 times

[mpeg @ 0x1429df60] first_dts 22413 not matching first dts 143876 (pts 143876, duration 783) in the queue

Last message repeated 8 times

[mpeg @ 0x1429df60] first_dts 22413 not matching first dts 151713 (pts 151713, duration 783) in the queue

Last message repeated 8 times

[mpeg @ 0x1429df60] first_dts 22413 not matching first dts 159550 (pts 159550, duration 783) in the queue

Last message repeated 7 times

[mpeg @ 0x1429df60] first_dts 22413 not matching first dts 166603 (pts 166603, duration 783) in the queue

Last message repeated 8 times

[mpeg @ 0x1429df60] first_dts 22413 not matching first dts 174439 (pts 174439, duration 783) in the queue

Last message repeated 8 times

[mpeg @ 0x1429df60] first_dts 22413 not matching first dts 182276 (pts 182276, duration 783) in the queue

Last message repeated 8 times

[mpeg @ 0x1429df60] first_dts 22413 not matching first dts 190113 (pts 190113, duration 783) in the queue

Last message repeated 7 times

[mpeg @ 0x1429df60] first_dts 22413 not matching first dts 197167 (pts 197167, duration 783) in the queue

Last message repeated 8 times

[mpeg @ 0x1429df60] first_dts 22413 not matching first dts 205003 (pts 205003, duration 783) in the queue

Last message repeated 8 times

[mpeg @ 0x1429df60] first_dts 22413 not matching first dts 212839 (pts 212839, duration 783) in the queue

Last message repeated 8 times

[mpeg @ 0x1429df60] first_dts 22413 not matching first dts 220676 (pts 220676, duration 783) in the queue

Last message repeated 7 times

[mpeg @ 0x1429df60] first_dts 22413 not matching first dts 227730 (pts 227730, duration 783) in the queue

Last message repeated 8 times

[mpeg @ 0x1429df60] first_dts 22413 not matching first dts 235566 (pts 235566, duration 783) in the queue

Last message repeated 8 times

[mpeg @ 0x1429df60] first_dts 22413 not matching first dts 243403 (pts 243403, duration 783) in the queue

Last message repeated 8 times

[mpeg @ 0x1429df60] first_dts 22413 not matching first dts 251239 (pts 251239, duration 783) in the queue

Last message repeated 7 times

[mpeg @ 0x1429df60] first_dts 22413 not matching first dts 258286 (pts 258286, duration 783) in the queue

Last message repeated 8 times

[mpeg @ 0x1429df60] first_dts 22413 not matching first dts 266129 (pts 266129, duration 783) in the queue

Last message repeated 8 times

[mpeg @ 0x1429df60] first_dts 22413 not matching first dts 273966 (pts 273966, duration 783) in the queue

Last message repeated 7 times

[mpeg @ 0x1429df60] first_dts 22413 not matching first dts 281020 (pts 281020, duration 783) in the queue

Last message repeated 8 times

[mpeg @ 0x1429df60] first_dts 22413 not matching first dts 288856 (pts 288856, duration 783) in the queue

Last message repeated 8 times

rfps: 23.833333 0.015297

Last message repeated 1 times

rfps: 23.916667 0.002647

Last message repeated 1 times

rfps: 24.000000 0.000432
rfps: 24.083333 0.008653

Last message repeated 1 times

rfps: 47.833333 0.010587

Last message repeated 1 times

rfps: 47.916667 0.000940

Last message repeated 1 times

rfps: 48.000000 0.001728
rfps: 48.083333 0.012952
rfps: 23.976024 0.000000

Last message repeated 1 times

rfps: 47.952048 0.000000

Last message repeated 1 times

[mpeg @ 0x1429df60] File position after avformat_find_stream_info() is 0
Input #0, mpeg, from 'test.mpg':

Duration: 00:00:03.17, start: 0.249033, bitrate: 7803 kb/s

Stream #0:0[0x1e0], 74, 1/90000: Video: mpeg2video (Main), yuv420p(tv), 1920x1080 [SAR 1:1 DAR 16:9], 1001/48000, max. 7500 kb/s, 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
Stream #0:1[0x1c0], 351, 1/90000: Audio: mp1, 44100 Hz, stereo, s16p, 192 kb/s

Successfully opened the file.
Parsing a group of options: output file t.ts.
Applying option c (codec name) with argument copy.
Successfully parsed a group of options.
Opening an output file: t.ts.
Successfully opened the file.
[mpegts @ 0x1429fda0] muxrate VBR, pcr every 2 pkts, sdt every 200, pat/pmt every 40 pkts
Output #0, mpegts, to 't.ts':

Metadata:

encoder : Lavf55.19.104
Stream #0:0, 0, 1/90000: Video: mpeg2video, yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 1001/24000, q=2-31, max. 7500 kb/s, 23.98 fps, 90k tbn, 23.98 tbc
Stream #0:1, 0, 1/90000: Audio: mp1, 44100 Hz, stereo, 192 kb/s

Stream mapping:

Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)

Press [q] to stop, ? for help
[mpeg @ 0x1429df60] invalid dts/pts combination 22413
demuxer -> ist_index:0 type:video next_dts:NOPTS next_dts_time:NOPTS next_pts:NOPTS next_pts_time:NOPTS pkt_pts:22413 pkt_pts_time:0.249033 pkt_dts:22414 pkt_dts_time:0.249044 off:-249033 off_time:-0.249033
demuxer+ffmpeg -> ist_index:0 type:video pkt_pts:0 pkt_pts_time:0 pkt_dts:1 pkt_dts_time:1.11111e-05 off:-249033 off_time:-0.249033
muxer <- type:video pkt_pts:0 pkt_pts_time:0 pkt_dts:1 pkt_dts_time:1.11111e-05 size:64149
[mpegts @ 0x1429fda0] pts (0) < dts (1) in stream 0
av_interleaved_write_frame(): Invalid argument
[AVIOContext @ 0x142a13a0] Statistics: 0 seeks, 0 writeouts
[AVIOContext @ 0x142a6620] Statistics: 3440304 bytes read, 2 seeks

comment:14 by ramitb, 11 years ago

I've found some more WTV files with mpeg2 video that exhibit the same issue, do you want me to upload a sample?

comment:15 by ramitb, 10 years ago

Any update on this? I'm seeing this error on more wtv files.
Anyone have any idea why this is happening or if there is some flag we can use to ignore the issue and continue? (or what part of the code is causing the issue?)

comment:16 by ramitb, 10 years ago

A potential hack for fixing this issue (thought it may created non compliant video if this error is ignored)

remove the line:

return AVERROR(EINVAL);

Complete code:

--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -486,7 +486,6 @@ static int compute_pkt_fields2(AVFormatContext *s, AVStream *st, AVPacket *pkt)
     if (pkt->dts != AV_NOPTS_VALUE && pkt->pts != AV_NOPTS_VALUE && pkt->pts < pkt->dts) {
         av_log(s, AV_LOG_ERROR, "pts (%s) < dts (%s) in stream %d\n",
                av_ts2str(pkt->pts), av_ts2str(pkt->dts), st->index);
-        return AVERROR(EINVAL);
     }

     av_dlog(s, "av_write_frame: pts2:%s dts2:%s\n",

comment:17 by ramitb, 10 years ago

Cc: ramitbhalla@gmail.com added

comment:18 by Carl Eugen Hoyos, 8 years ago

Component: undeterminedffmpeg
Resolution: fixed
Status: openclosed

Fixed by Michael in 22844132069ebd2c0b2ac4e7b41c93c33890bfb9 / since FFmpeg 2.5.

Note: See TracTickets for help on using tickets.