Opened 11 years ago

Closed 9 years ago

Last modified 9 years ago

#2220 closed defect (fixed)

FFMPEG unable to stream copy some wtv H264 into mpegts

Reported by: ramitb Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: wtv h264 av_interleaved_write_frame bounty
Cc: harry.tipper@aol.com, julian@corecode.at Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug:
with some H264 files ffmpeg is able to stream copy the video stream perfectly fine, with other it's not able to.

I've uploaded the file "H264 Copy Remux Fail.wtv" to the FTP server.

How to reproduce:

ffmpeg -i "H264 Copy Remux Fail.wtv" -vcodec copy -an 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
[wtv @ 0033d420] reported file length (0x7d3ab468) exceeds number of available sectors (0x40000000)
[aac_latm @ 0033ee40] initializing latmctx
[aac_latm @ 0033e840] initializing latmctx
[h264 @ 0033f440] mmco: unref short failure
    Last message repeated 2 times
Input #0, wtv, from 'H264 Copy Remux Fail.wtv':
  Metadata:
    WM/MediaClassPrimaryID: db9830bd-3ab3-4fab-8a371a995f7ff74
    WM/MediaClassSecondaryID: ba7f258a-62f7-47a9-b21f4651c42a000
    Title           : Great British Railway Journeys
    WM/SubTitle     : Taunton to Minehead
    WM/SubTitleDescription: Michael Portillo explores a church that moves in mysterious ways and summons all his strengt
h, to move a one hundred and ten tonne steam locomotive.
    genre           : Documentary;Other
    WM/OriginalReleaseTime: 0
    WM/MediaCredits : ;Dave Minchin;Michael Portillo;
    service_provider: BBC HD
    service_name    : BBC HD
    WM/MediaOriginalChannel: 102
    WM/MediaOriginalChannelSubNumber: 0
    WM/MediaOriginalBroadcastDateTime: 2013-01-30T00:00:00Z
    WM/MediaOriginalRunTime: 19711177116
    WM/MediaIsStereo: false
    WM/MediaIsRepeat: false
    WM/MediaIsLive  : false
    WM/MediaIsTape  : false
    WM/MediaIsDelay : false
    WM/MediaIsSubtitled: true
    WM/MediaIsMovie : false
    WM/MediaIsPremiere: false
    WM/MediaIsFinale: false
    WM/MediaIsSAP   : false
    WM/MediaIsSport : false
    WM/Provider     : MediaCenterDefault
    WM/VideoClosedCaptioning: false
    WM/WMRVEncodeTime: 2013-01-30 18:30:08
    WM/WMRVSeriesUID: !GenericSeries!Great British Railway Journeys
    WM/WMRVServiceID: !MCService!755567
    WM/WMRVProgramID: !MCProgram!49381242
    WM/WMRVRequestID: 0
    WM/WMRVScheduleItemID: 0
    WM/WMRVQuality  : 0
    WM/WMRVOriginalSoftPrePadding: 420
    WM/WMRVOriginalSoftPostPadding: 180
    WM/WMRVHardPrePadding: -300
    WM/WMRVHardPostPadding: 0
    WM/WMRVATSCContent: false
    WM/WMRVDTVContent: true
    WM/WMRVHDContent: true
    Duration        : 17918570369
    WM/WMRVEndTime  : 2013-01-30 19:00:00
    WM/WMRVBitrate  : 9.382929
    WM/WMRVKeepUntil: -1
    WM/WMRVActualSoftPrePadding: 291
    WM/WMRVActualSoftPostPadding: 0
    WM/WMRVContentProtected: false
    WM/WMRVContentProtectedPercent: 0
    WM/WMRVExpirationSpan: 9223372036854775807
    WM/WMRVInBandRatingSystem: 255
    WM/WMRVInBandRatingLevel: 255
    WM/WMRVInBandRatingAttributes: 0
    WM/WMRVWatched  : false
    WM/MediaThumbWidth: 0
    WM/MediaThumbHeight: 0
    WM/MediaThumbStride: 0
    WM/MediaThumbRet: 4
    WM/MediaThumbRatingSystem: 255
    WM/MediaThumbRatingLevel: 255
    WM/MediaThumbRatingAttributes: 19243776
    WM/MediaThumbAspectRatioX: 0
    WM/MediaThumbAspectRatioY: 0
    WM/MediaThumbTimeStamp: -4616189618054758400
  Duration: 00:14:59.19, start: 1.691285, bitrate: 2798 kb/s
    Stream #0:0[0x38](eng): Subtitle: dvb_subtitle
    Stream #0:1[0x39](eng): Audio: aac_latm ([2][22][0][0] / 0x1602), 48000 Hz, stereo, fltp (hearing impaired)
    Stream #0:2[0x3a](eng): Audio: aac_latm ([2][22][0][0] / 0x1602), 48000 Hz, stereo, fltp
    Stream #0:3[0x3b]: Video: h264 (High), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 10000k tbn, 50 tbc
Output #0, mpegts, to 'test.ts':
  Metadata:
    WM/MediaClassPrimaryID: db9830bd-3ab3-4fab-8a371a995f7ff74
    WM/MediaClassSecondaryID: ba7f258a-62f7-47a9-b21f4651c42a000
    Title           : Great British Railway Journeys
    WM/SubTitle     : Taunton to Minehead
    WM/SubTitleDescription: Michael Portillo explores a church that moves in mysterious ways and summons all his strengt
h, to move a one hundred and ten tonne steam locomotive.
    genre           : Documentary;Other
    WM/OriginalReleaseTime: 0
    WM/MediaCredits : ;Dave Minchin;Michael Portillo;
    service_provider: BBC HD
    service_name    : BBC HD
    WM/MediaOriginalChannel: 102
    WM/MediaOriginalChannelSubNumber: 0
    WM/MediaOriginalBroadcastDateTime: 2013-01-30T00:00:00Z
    WM/MediaOriginalRunTime: 19711177116
    WM/MediaIsStereo: false
    WM/MediaIsRepeat: false
    WM/MediaIsLive  : false
    WM/MediaIsTape  : false
    WM/MediaIsDelay : false
    WM/MediaIsSubtitled: true
    WM/MediaIsMovie : false
    WM/MediaIsPremiere: false
    WM/MediaIsFinale: false
    WM/MediaIsSAP   : false
    WM/MediaIsSport : false
    WM/Provider     : MediaCenterDefault
    WM/VideoClosedCaptioning: false
    WM/WMRVEncodeTime: 2013-01-30 18:30:08
    WM/WMRVSeriesUID: !GenericSeries!Great British Railway Journeys
    WM/WMRVServiceID: !MCService!755567
    WM/WMRVProgramID: !MCProgram!49381242
    WM/WMRVRequestID: 0
    WM/WMRVScheduleItemID: 0
    WM/WMRVQuality  : 0
    WM/WMRVOriginalSoftPrePadding: 420
    WM/WMRVOriginalSoftPostPadding: 180
    WM/WMRVHardPrePadding: -300
    WM/WMRVHardPostPadding: 0
    WM/WMRVATSCContent: false
    WM/WMRVDTVContent: true
    WM/WMRVHDContent: true
    Duration        : 17918570369
    WM/WMRVEndTime  : 2013-01-30 19:00:00
    WM/WMRVBitrate  : 9.382929
    WM/WMRVKeepUntil: -1
    WM/WMRVActualSoftPrePadding: 291
    WM/WMRVActualSoftPostPadding: 0
    WM/WMRVContentProtected: false
    WM/WMRVContentProtectedPercent: 0
    WM/WMRVExpirationSpan: 9223372036854775807
    WM/WMRVInBandRatingSystem: 255
    WM/WMRVInBandRatingLevel: 255
    WM/WMRVInBandRatingAttributes: 0
    WM/WMRVWatched  : false
    WM/MediaThumbWidth: 0
    WM/MediaThumbHeight: 0
    WM/MediaThumbStride: 0
    WM/MediaThumbRet: 4
    WM/MediaThumbRatingSystem: 255
    WM/MediaThumbRatingLevel: 255
    WM/MediaThumbRatingAttributes: 19243776
    WM/MediaThumbAspectRatioX: 0
    WM/MediaThumbAspectRatioY: 0
    WM/MediaThumbTimeStamp: -4616189618054758400
    encoder         : Lavf54.49.102
    Stream #0:0: Video: h264, yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 90k tbn, 25 tbc
Stream mapping:
  Stream #0:3 -> #0:0 (copy)
Press [q] to stop, [?] for help
[mpegts @ 03cb2720] H.264 bitstream malformed, no startcode found, use the h264_mp4toannexb bitstream filter (-bsf h264_
mp4toannexb)
av_interleaved_write_frame(): Invalid argument
ffmpeg -i "H264 Copy Remux Fail.wtv" -vcodec copy -an -bsf:v h264_mp4toannexb 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
[wtv @ 01f3d4e0] reported file length (0x7d3ab468) exceeds number of available sectors (0x40000000)
[aac_latm @ 01f3eee0] initializing latmctx
[aac_latm @ 01f3e8e0] initializing latmctx
[h264 @ 01f3f4c0] mmco: unref short failure
    Last message repeated 2 times
Input #0, wtv, from 'H264 Copy Remux Fail.wtv':
  Metadata:
    WM/MediaClassPrimaryID: db9830bd-3ab3-4fab-8a371a995f7ff74
    WM/MediaClassSecondaryID: ba7f258a-62f7-47a9-b21f4651c42a000
    Title           : Great British Railway Journeys
    WM/SubTitle     : Taunton to Minehead
    WM/SubTitleDescription: Michael Portillo explores a church that moves in mysterious ways and summons all his strengt
h, to move a one hundred and ten tonne steam locomotive.
    genre           : Documentary;Other
    WM/OriginalReleaseTime: 0
    WM/MediaCredits : ;Dave Minchin;Michael Portillo;
    service_provider: BBC HD
    service_name    : BBC HD
    WM/MediaOriginalChannel: 102
    WM/MediaOriginalChannelSubNumber: 0
    WM/MediaOriginalBroadcastDateTime: 2013-01-30T00:00:00Z
    WM/MediaOriginalRunTime: 19711177116
    WM/MediaIsStereo: false
    WM/MediaIsRepeat: false
    WM/MediaIsLive  : false
    WM/MediaIsTape  : false
    WM/MediaIsDelay : false
    WM/MediaIsSubtitled: true
    WM/MediaIsMovie : false
    WM/MediaIsPremiere: false
    WM/MediaIsFinale: false
    WM/MediaIsSAP   : false
    WM/MediaIsSport : false
    WM/Provider     : MediaCenterDefault
    WM/VideoClosedCaptioning: false
    WM/WMRVEncodeTime: 2013-01-30 18:30:08
    WM/WMRVSeriesUID: !GenericSeries!Great British Railway Journeys
    WM/WMRVServiceID: !MCService!755567
    WM/WMRVProgramID: !MCProgram!49381242
    WM/WMRVRequestID: 0
    WM/WMRVScheduleItemID: 0
    WM/WMRVQuality  : 0
    WM/WMRVOriginalSoftPrePadding: 420
    WM/WMRVOriginalSoftPostPadding: 180
    WM/WMRVHardPrePadding: -300
    WM/WMRVHardPostPadding: 0
    WM/WMRVATSCContent: false
    WM/WMRVDTVContent: true
    WM/WMRVHDContent: true
    Duration        : 17918570369
    WM/WMRVEndTime  : 2013-01-30 19:00:00
    WM/WMRVBitrate  : 9.382929
    WM/WMRVKeepUntil: -1
    WM/WMRVActualSoftPrePadding: 291
    WM/WMRVActualSoftPostPadding: 0
    WM/WMRVContentProtected: false
    WM/WMRVContentProtectedPercent: 0
    WM/WMRVExpirationSpan: 9223372036854775807
    WM/WMRVInBandRatingSystem: 255
    WM/WMRVInBandRatingLevel: 255
    WM/WMRVInBandRatingAttributes: 0
    WM/WMRVWatched  : false
    WM/MediaThumbWidth: 0
    WM/MediaThumbHeight: 0
    WM/MediaThumbStride: 0
    WM/MediaThumbRet: 4
    WM/MediaThumbRatingSystem: 255
    WM/MediaThumbRatingLevel: 255
    WM/MediaThumbRatingAttributes: 19243776
    WM/MediaThumbAspectRatioX: 0
    WM/MediaThumbAspectRatioY: 0
    WM/MediaThumbTimeStamp: -4616189618054758400
  Duration: 00:14:59.19, start: 1.691285, bitrate: 2798 kb/s
    Stream #0:0[0x38](eng): Subtitle: dvb_subtitle
    Stream #0:1[0x39](eng): Audio: aac_latm ([2][22][0][0] / 0x1602), 48000 Hz, stereo, fltp (hearing impaired)
    Stream #0:2[0x3a](eng): Audio: aac_latm ([2][22][0][0] / 0x1602), 48000 Hz, stereo, fltp
    Stream #0:3[0x3b]: Video: h264 (High), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 10000k tbn, 50 tbc
File 'test.ts' already exists. Overwrite ? [y/N] y
Output #0, mpegts, to 'test.ts':
  Metadata:
    WM/MediaClassPrimaryID: db9830bd-3ab3-4fab-8a371a995f7ff74
    WM/MediaClassSecondaryID: ba7f258a-62f7-47a9-b21f4651c42a000
    Title           : Great British Railway Journeys
    WM/SubTitle     : Taunton to Minehead
    WM/SubTitleDescription: Michael Portillo explores a church that moves in mysterious ways and summons all his strengt
h, to move a one hundred and ten tonne steam locomotive.
    genre           : Documentary;Other
    WM/OriginalReleaseTime: 0
    WM/MediaCredits : ;Dave Minchin;Michael Portillo;
    service_provider: BBC HD
    service_name    : BBC HD
    WM/MediaOriginalChannel: 102
    WM/MediaOriginalChannelSubNumber: 0
    WM/MediaOriginalBroadcastDateTime: 2013-01-30T00:00:00Z
    WM/MediaOriginalRunTime: 19711177116
    WM/MediaIsStereo: false
    WM/MediaIsRepeat: false
    WM/MediaIsLive  : false
    WM/MediaIsTape  : false
    WM/MediaIsDelay : false
    WM/MediaIsSubtitled: true
    WM/MediaIsMovie : false
    WM/MediaIsPremiere: false
    WM/MediaIsFinale: false
    WM/MediaIsSAP   : false
    WM/MediaIsSport : false
    WM/Provider     : MediaCenterDefault
    WM/VideoClosedCaptioning: false
    WM/WMRVEncodeTime: 2013-01-30 18:30:08
    WM/WMRVSeriesUID: !GenericSeries!Great British Railway Journeys
    WM/WMRVServiceID: !MCService!755567
    WM/WMRVProgramID: !MCProgram!49381242
    WM/WMRVRequestID: 0
    WM/WMRVScheduleItemID: 0
    WM/WMRVQuality  : 0
    WM/WMRVOriginalSoftPrePadding: 420
    WM/WMRVOriginalSoftPostPadding: 180
    WM/WMRVHardPrePadding: -300
    WM/WMRVHardPostPadding: 0
    WM/WMRVATSCContent: false
    WM/WMRVDTVContent: true
    WM/WMRVHDContent: true
    Duration        : 17918570369
    WM/WMRVEndTime  : 2013-01-30 19:00:00
    WM/WMRVBitrate  : 9.382929
    WM/WMRVKeepUntil: -1
    WM/WMRVActualSoftPrePadding: 291
    WM/WMRVActualSoftPostPadding: 0
    WM/WMRVContentProtected: false
    WM/WMRVContentProtectedPercent: 0
    WM/WMRVExpirationSpan: 9223372036854775807
    WM/WMRVInBandRatingSystem: 255
    WM/WMRVInBandRatingLevel: 255
    WM/WMRVInBandRatingAttributes: 0
    WM/WMRVWatched  : false
    WM/MediaThumbWidth: 0
    WM/MediaThumbHeight: 0
    WM/MediaThumbStride: 0
    WM/MediaThumbRet: 4
    WM/MediaThumbRatingSystem: 255
    WM/MediaThumbRatingLevel: 255
    WM/MediaThumbRatingAttributes: 19243776
    WM/MediaThumbAspectRatioX: 0
    WM/MediaThumbAspectRatioY: 0
    WM/MediaThumbTimeStamp: -4616189618054758400
    encoder         : Lavf54.49.102
    Stream #0:0: Video: h264, yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 90k tbn, 25 tbc
Stream mapping:
  Stream #0:3 -> #0:0 (copy)
Press [q] to stop, [?] for help
[NULL @ 03b21d80] Warning: SPS NALU missing or invalid. The resulting stream may not play.
[NULL @ 03b21d80] Warning: PPS NALU missing or invalid. The resulting stream may not play.
Failed to open bitstream filter h264_mp4toannexb for stream 0 with codec copy: Invalid argument
[mpegts @ 03d18a40] H.264 bitstream malformed, no startcode found, use the h264_mp4toannexb bitstream filter (-bsf h264_
mp4toannexb)
av_interleaved_write_frame(): Invalid argument

Attachments (1)

H264 Copy Remux Fail_cut.wtv (2.4 MB ) - added by Carl Eugen Hoyos 11 years ago.

Change History (28)

by Carl Eugen Hoyos, 11 years ago

comment:1 by Carl Eugen Hoyos, 11 years ago

Keywords: wtv h264 added
Reproduced by developer: set
Status: newopen
Version: unspecifiedgit-master
$ ffmpeg -i H264\ Copy\ Remux\ Fail_cut.wtv -vcodec copy -an out.ts
ffmpeg version N-49518-g911e270 Copyright (c) 2000-2013 the FFmpeg developers
  built on Feb  1 2013 15:31:55 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl --disable-indev=jack
  libavutil      52. 17.100 / 52. 17.100
  libavcodec     54. 91.100 / 54. 91.100
  libavformat    54. 61.104 / 54. 61.104
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 35.100 /  3. 35.100
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
[wtv @ 0x2efd000] truncated file
[wtv @ 0x2efd000] reported file length (0x7d3ab468) exceeds number of available sectors (0x40000000)
[wtv @ 0x2efd000] truncated file
    Last message repeated 1 times
[h264 @ 0x2f04da0] mmco: unref short failure
    Last message repeated 2 times
Input #0, wtv, from 'H264 Copy Remux Fail_cut.wtv':
  Metadata:
    WM/MediaClassPrimaryID: db9830bd-3ab3-4fab-8a371a995f7ff74
    WM/MediaClassSecondaryID: ba7f258a-62f7-47a9-b21f4651c42a000
    Title           : Great British Railway Journeys
    WM/SubTitle     : Taunton to Minehead
    WM/SubTitleDescription: Michael Portillo explores a church that moves in mysterious ways and summons all his strength, to move a one hundred and ten tonne steam locomotive.
    genre           : Documentary;Other
    WM/OriginalReleaseTime: 0
    WM/MediaCredits : ;Dave Minchin;Michael Portillo;
    service_provider: BBC HD
    service_name    : BBC HD
    WM/MediaOriginalChannel: 102
    WM/MediaOriginalChannelSubNumber: 0
    WM/MediaOriginalBroadcastDateTime: 2013-01-30T00:00:00Z
    WM/MediaOriginalRunTime: 19711177116
    WM/MediaIsStereo: false
    WM/MediaIsRepeat: false
    WM/MediaIsLive  : false
    WM/MediaIsTape  : false
    WM/MediaIsDelay : false
    WM/MediaIsSubtitled: true
    WM/MediaIsMovie : false
    WM/MediaIsPremiere: false
    WM/MediaIsFinale: false
    WM/MediaIsSAP   : false
    WM/MediaIsSport : false
    WM/Provider     : MediaCenterDefault
    WM/VideoClosedCaptioning: false
    WM/WMRVEncodeTime: 2013-01-30 18:30:08
    WM/WMRVSeriesUID: !GenericSeries!Great British Railway Journeys
    WM/WMRVServiceID: !MCService!755567
    WM/WMRVProgramID: !MCProgram!49381242
    WM/WMRVRequestID: 0
    WM/WMRVScheduleItemID: 0
    WM/WMRVQuality  : 0
    WM/WMRVOriginalSoftPrePadding: 420
    WM/WMRVOriginalSoftPostPadding: 180
    WM/WMRVHardPrePadding: -300
    WM/WMRVHardPostPadding: 0
    WM/WMRVATSCContent: false
    WM/WMRVDTVContent: true
    WM/WMRVHDContent: true
    Duration        : 17918570369
    WM/WMRVEndTime  : 2013-01-30 19:00:00
    WM/WMRVBitrate  : 9.382929
    WM/WMRVKeepUntil: -1
    WM/WMRVActualSoftPrePadding: 291
    WM/WMRVActualSoftPostPadding: 0
    WM/WMRVContentProtected: false
    WM/WMRVContentProtectedPercent: 0
    WM/WMRVExpirationDate: 9999-12-31 23:59:59
    WM/WMRVExpirationSpan: 9223372036854775807
    WM/WMRVInBandRatingSystem: 255
    WM/WMRVInBandRatingLevel: 255
    WM/WMRVInBandRatingAttributes: 0
    WM/WMRVWatched  : false
    WM/MediaThumbWidth: 0
    WM/MediaThumbHeight: 0
    WM/MediaThumbStride: 0
    WM/MediaThumbRet: 4
    WM/MediaThumbRatingSystem: 255
    WM/MediaThumbRatingLevel: 255
    WM/MediaThumbRatingAttributes: 19243776
    WM/MediaThumbAspectRatioX: 0
    WM/MediaThumbAspectRatioY: 0
    WM/MediaThumbTimeStamp: -4616189618054758400
  Duration: 00:14:59.19, start: 1.691285, bitrate: 22 kb/s
    Stream #0:0[0x38](eng): Subtitle: dvb_subtitle
    Stream #0:1[0x39](eng): Audio: aac_latm ([2][22][0][0] / 0x1602), 48000 Hz, stereo, fltp (hearing impaired)
    Stream #0:2[0x3a](eng): Audio: aac_latm ([2][22][0][0] / 0x1602), 48000 Hz, stereo, fltp
    Stream #0:3[0x3b]: Video: h264 (High), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 10000k tbn, 50 tbc
Output #0, mpegts, to 'out.ts':
  Metadata:
    WM/MediaClassPrimaryID: db9830bd-3ab3-4fab-8a371a995f7ff74
    WM/MediaClassSecondaryID: ba7f258a-62f7-47a9-b21f4651c42a000
    Title           : Great British Railway Journeys
    WM/SubTitle     : Taunton to Minehead
    WM/SubTitleDescription: Michael Portillo explores a church that moves in mysterious ways and summons all his strength, to move a one hundred and ten tonne steam locomotive.
    genre           : Documentary;Other
    WM/OriginalReleaseTime: 0
    WM/MediaCredits : ;Dave Minchin;Michael Portillo;
    service_provider: BBC HD
    service_name    : BBC HD
    WM/MediaOriginalChannel: 102
    WM/MediaOriginalChannelSubNumber: 0
    WM/MediaOriginalBroadcastDateTime: 2013-01-30T00:00:00Z
    WM/MediaOriginalRunTime: 19711177116
    WM/MediaIsStereo: false
    WM/MediaIsRepeat: false
    WM/MediaIsLive  : false
    WM/MediaIsTape  : false
    WM/MediaIsDelay : false
    WM/MediaIsSubtitled: true
    WM/MediaIsMovie : false
    WM/MediaIsPremiere: false
    WM/MediaIsFinale: false
    WM/MediaIsSAP   : false
    WM/MediaIsSport : false
    WM/Provider     : MediaCenterDefault
    WM/VideoClosedCaptioning: false
    WM/WMRVEncodeTime: 2013-01-30 18:30:08
    WM/WMRVSeriesUID: !GenericSeries!Great British Railway Journeys
    WM/WMRVServiceID: !MCService!755567
    WM/WMRVProgramID: !MCProgram!49381242
    WM/WMRVRequestID: 0
    WM/WMRVScheduleItemID: 0
    WM/WMRVQuality  : 0
    WM/WMRVOriginalSoftPrePadding: 420
    WM/WMRVOriginalSoftPostPadding: 180
    WM/WMRVHardPrePadding: -300
    WM/WMRVHardPostPadding: 0
    WM/WMRVATSCContent: false
    WM/WMRVDTVContent: true
    WM/WMRVHDContent: true
    Duration        : 17918570369
    WM/WMRVEndTime  : 2013-01-30 19:00:00
    WM/WMRVBitrate  : 9.382929
    WM/WMRVKeepUntil: -1
    WM/WMRVActualSoftPrePadding: 291
    WM/WMRVActualSoftPostPadding: 0
    WM/WMRVContentProtected: false
    WM/WMRVContentProtectedPercent: 0
    WM/WMRVExpirationDate: 9999-12-31 23:59:59
    WM/WMRVExpirationSpan: 9223372036854775807
    WM/WMRVInBandRatingSystem: 255
    WM/WMRVInBandRatingLevel: 255
    WM/WMRVInBandRatingAttributes: 0
    WM/WMRVWatched  : false
    WM/MediaThumbWidth: 0
    WM/MediaThumbHeight: 0
    WM/MediaThumbStride: 0
    WM/MediaThumbRet: 4
    WM/MediaThumbRatingSystem: 255
    WM/MediaThumbRatingLevel: 255
    WM/MediaThumbRatingAttributes: 19243776
    WM/MediaThumbAspectRatioX: 0
    WM/MediaThumbAspectRatioY: 0
    WM/MediaThumbTimeStamp: -4616189618054758400
    encoder         : Lavf54.61.104
    Stream #0:0: Video: h264, yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 90k tbn, 25 tbc
Stream mapping:
  Stream #0:3 -> #0:0 (copy)
Press [q] to stop, [?] for help
[mpegts @ 0x2fbca80] H.264 bitstream malformed, no startcode found, use the h264_mp4toannexb bitstream filter (-bsf h264_mp4toannexb)
av_interleaved_write_frame(): Invalid argument

comment:2 by Carl Eugen Hoyos, 11 years ago

Keywords: av_interleaved_write_frame added
Summary: FFMPEG unable to stream copy come H264 into mpegtsFFMPEG unable to stream copy some wtv H264 into mpegts

comment:3 by ramitb, 11 years ago

Anyone any thoughts on this?

comment:4 by Harry Tipper, 11 years ago

I get this problem with 30 percent of my h264 recordings and other converters seem to handle these fine. Perhaps specific to ffmpeg but would lovely to get fixed.

comment:5 by Harry Tipper, 11 years ago

@cehoyos

Adding -ss 1 to the command fixes this, but why?

Not working:

ffmpeg -i input.wtv -vcodec copy -acodec copy -map 0:a -map 0:v -f mpegts output.ts
O:\ffmpegtest>ffmpeg -i broken.wtv -vcodec copy -acodec copy -map 0:a -map 0:v -
f mpegts broken.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-mi
ngw32- --pkg-config=pkg-config --enable-gpl --enable-libx264 --enable-avisynth -
-enable-libxvid --enable-libmp3lame --enable-version3 --enable-zlib --enable-lib
rtmp --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libopenjpe
g --enable-gnutls --enable-libgsm --enable-libfreetype --enable-fontconfig --ena
ble-libass --enable-libutvideo --enable-libopus --disable-w32threads --enable-fr
ei0r --enable-filter=frei0r --enable-libvo-aacenc --enable-bzlib --enable-libxav
s --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
[aac_latm @ 0039f820] initializing latmctx
[aac_latm @ 0039ec40] initializing latmctx
[h264 @ 0039f220] mmco: unref short failure
    Last message repeated 2 times
Input #0, wtv, from 'broken.wtv':
  Metadata:
    WM/MediaClassPrimaryID: db9830bd-3ab3-4fab-8a371a995f7ff74
    WM/MediaClassSecondaryID: ba7f258a-62f7-47a9-b21f4651c42a000
    Title           : The Graham Norton Show
    WM/SubTitleDescription: The award-winning host continues his talk show. Grah
am is joined by Sherlock Holmes star Jude Law, Ted and Family Guy actress Mila K
unis, Spiderman and 127 Hours star James Franco, and the legendary Dame Judi Den
ch. With music from Olly Murs.
    genre           : Shows;Talk Show
    WM/OriginalReleaseTime: 0
    WM/MediaCredits : ;Steve Smith;Graham Norton;
    service_provider: BBC One HD
    service_name    : BBC One HD
    WM/MediaOriginalChannel: 101
    WM/MediaOriginalChannelSubNumber: 0
    WM/MediaOriginalBroadcastDateTime: 2013-03-01T00:00:00Z
    WM/MediaOriginalRunTime: 29912779688
    WM/MediaIsStereo: false
    WM/MediaIsRepeat: false
    WM/MediaIsLive  : false
    WM/MediaIsTape  : false
    WM/MediaIsDelay : false
    WM/MediaIsSubtitled: true
    WM/MediaIsMovie : false
    WM/MediaIsPremiere: false
    WM/MediaIsFinale: false
    WM/MediaIsSAP   : false
    WM/MediaIsSport : false
    WM/Provider     : MediaCenterDefault
    WM/VideoClosedCaptioning: false
    WM/WMRVEncodeTime: 2013-03-01 22:33:08
    WM/WMRVSeriesUID: !GenericSeries!The Graham Norton Show
    WM/WMRVServiceID: !MCService!759242
    WM/WMRVProgramID: !MCProgram!49925152
    WM/WMRVRequestID: 0
    WM/WMRVScheduleItemID: 0
    WM/WMRVQuality  : 0
    WM/WMRVOriginalSoftPrePadding: 420
    WM/WMRVOriginalSoftPostPadding: 180
    WM/WMRVHardPrePadding: -300
    WM/WMRVHardPostPadding: 0
    WM/WMRVATSCContent: false
    WM/WMRVDTVContent: true
    WM/WMRVHDContent: true
    Duration        : 29918791257
    WM/WMRVEndTime  : 2013-03-01 23:23:00
    WM/WMRVBitrate  : 8.018846
    WM/WMRVKeepUntil: -1
    WM/WMRVActualSoftPrePadding: 411
    WM/WMRVActualSoftPostPadding: 180
    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: 255
    WM/MediaThumbRatingLevel: 255
    WM/MediaThumbRatingAttributes: 0
    WM/MediaThumbAspectRatioX: 1920
    WM/MediaThumbAspectRatioY: 1080
    WM/MediaThumbTimeStamp: -4616189618054758400
    WM/MediaThumbType: 2
  Duration: 00:49:50.88, start: 1.659108, bitrate: 8021 kb/s
    Stream #0:0[0x77](eng): Subtitle: dvb_subtitle
    Stream #0:1[0x78](eng): Audio: aac_latm ([2][22][0][0] / 0x1602), 48000 Hz,
stereo, fltp (hearing impaired)
    Stream #0:2[0x79]: Video: h264 (High), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9]
, 25 fps, 25 tbr, 10000k tbn, 50 tbc
    Stream #0:3[0x7a](eng): Audio: aac_latm ([2][22][0][0] / 0x1602), 48000 Hz,
5.1, fltp
    Stream #0:4[0x0]: Attachment: mjpeg
    Metadata:
      title           : TV Thumbnail
Output #0, mpegts, to 'broken.ts':
  Metadata:
    WM/MediaClassPrimaryID: db9830bd-3ab3-4fab-8a371a995f7ff74
    WM/MediaClassSecondaryID: ba7f258a-62f7-47a9-b21f4651c42a000
    Title           : The Graham Norton Show
    WM/SubTitleDescription: The award-winning host continues his talk show. Grah
am is joined by Sherlock Holmes star Jude Law, Ted and Family Guy actress Mila K
unis, Spiderman and 127 Hours star James Franco, and the legendary Dame Judi Den
ch. With music from Olly Murs.
    genre           : Shows;Talk Show
    WM/OriginalReleaseTime: 0
    WM/MediaCredits : ;Steve Smith;Graham Norton;
    service_provider: BBC One HD
    service_name    : BBC One HD
    WM/MediaOriginalChannel: 101
    WM/MediaOriginalChannelSubNumber: 0
    WM/MediaOriginalBroadcastDateTime: 2013-03-01T00:00:00Z
    WM/MediaOriginalRunTime: 29912779688
    WM/MediaIsStereo: false
    WM/MediaIsRepeat: false
    WM/MediaIsLive  : false
    WM/MediaIsTape  : false
    WM/MediaIsDelay : false
    WM/MediaIsSubtitled: true
    WM/MediaIsMovie : false
    WM/MediaIsPremiere: false
    WM/MediaIsFinale: false
    WM/MediaIsSAP   : false
    WM/MediaIsSport : false
    WM/Provider     : MediaCenterDefault
    WM/VideoClosedCaptioning: false
    WM/WMRVEncodeTime: 2013-03-01 22:33:08
    WM/WMRVSeriesUID: !GenericSeries!The Graham Norton Show
    WM/WMRVServiceID: !MCService!759242
    WM/WMRVProgramID: !MCProgram!49925152
    WM/WMRVRequestID: 0
    WM/WMRVScheduleItemID: 0
    WM/WMRVQuality  : 0
    WM/WMRVOriginalSoftPrePadding: 420
    WM/WMRVOriginalSoftPostPadding: 180
    WM/WMRVHardPrePadding: -300
    WM/WMRVHardPostPadding: 0
    WM/WMRVATSCContent: false
    WM/WMRVDTVContent: true
    WM/WMRVHDContent: true
    Duration        : 29918791257
    WM/WMRVEndTime  : 2013-03-01 23:23:00
    WM/WMRVBitrate  : 8.018846
    WM/WMRVKeepUntil: -1
    WM/WMRVActualSoftPrePadding: 411
    WM/WMRVActualSoftPostPadding: 180
    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: 255
    WM/MediaThumbRatingLevel: 255
    WM/MediaThumbRatingAttributes: 0
    WM/MediaThumbAspectRatioX: 1920
    WM/MediaThumbAspectRatioY: 1080
    WM/MediaThumbTimeStamp: -4616189618054758400
    WM/MediaThumbType: 2
    encoder         : Lavf54.49.102
    Stream #0:0(eng): Audio: aac_latm ([2][22][0][0] / 0x1602), 48000 Hz, stereo
 (hearing impaired)
    Stream #0:1(eng): Audio: aac_latm ([2][22][0][0] / 0x1602), 48000 Hz, 5.1
    Stream #0:2: Video: h264, yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25
fps, 90k tbn, 25 tbc
Stream mapping:
  Stream #0:1 -> #0:0 (copy)
  Stream #0:3 -> #0:1 (copy)
  Stream #0:2 -> #0:2 (copy)
Press [q] to stop, [?] for help
[mpegts @ 03c607e0] pts (103514) < dts (110714) in stream 2
av_interleaved_write_frame(): Invalid argument

Working:

ffmpeg -ss 1 -i input.wtv -vcodec copy -acodec copy -map 0:a -map 0:v -f mpegts output.ts

Console output: http://www.datafilehost.com/download-8501f315.html (too large to copy and paste from cmd window due to excessive warnings)

Last edited 11 years ago by Harry Tipper (previous) (diff)

in reply to:  5 comment:6 by Carl Eugen Hoyos, 11 years ago

Replying to dodgexander:

@cehoyos

Adding -ss 1 to the command fixes this, but why?

Does it really? It does not fix the problem here afaict.

comment:7 by Harry Tipper, 11 years ago

With the sample attached, you are correct. With samples I have -ss 1 does fix the problem, but this may be due to the small sample size?

Any way to get this fixed?


Using the sample attached:

ffmpeg -i input.wtv -vcodec copy -acodec copy -map 0:a -map 0:v -f mpegts output.ts

Gives:

O:\ffmpegtest>ffmpeg -i H264_Copy_Remux_Fail_cut.wtv -vcodec copy -acodec copy -
map 0:a -map 0:v -f mpegts H264_Copy_Remux_Fail_cut.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-mi
ngw32- --pkg-config=pkg-config --enable-gpl --enable-libx264 --enable-avisynth -
-enable-libxvid --enable-libmp3lame --enable-version3 --enable-zlib --enable-lib
rtmp --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libopenjpe
g --enable-gnutls --enable-libgsm --enable-libfreetype --enable-fontconfig --ena
ble-libass --enable-libutvideo --enable-libopus --disable-w32threads --enable-fr
ei0r --enable-filter=frei0r --enable-libvo-aacenc --enable-bzlib --enable-libxav
s --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
[wtv @ 002cd3c0] reported file length (0x7d3ab468) exceeds number of available s
ectors (0x40000000)
[aac_latm @ 002cece0] initializing latmctx
[aac_latm @ 002ce6e0] initializing latmctx
[h264 @ 002cf2e0] mmco: unref short failure
    Last message repeated 2 times
Input #0, wtv, from 'H264_Copy_Remux_Fail_cut.wtv':
  Metadata:
    WM/MediaClassPrimaryID: db9830bd-3ab3-4fab-8a371a995f7ff74
    WM/MediaClassSecondaryID: ba7f258a-62f7-47a9-b21f4651c42a000
    Title           : Great British Railway Journeys
    WM/SubTitle     : Taunton to Minehead
    WM/SubTitleDescription: Michael Portillo explores a church that moves in mys
terious ways and summons all his strength, to move a one hundred and ten tonne s
team locomotive.
    genre           : Documentary;Other
    WM/OriginalReleaseTime: 0
    WM/MediaCredits : ;Dave Minchin;Michael Portillo;
    service_provider: BBC HD
    service_name    : BBC HD
    WM/MediaOriginalChannel: 102
    WM/MediaOriginalChannelSubNumber: 0
    WM/MediaOriginalBroadcastDateTime: 2013-01-30T00:00:00Z
    WM/MediaOriginalRunTime: 19711177116
    WM/MediaIsStereo: false
    WM/MediaIsRepeat: false
    WM/MediaIsLive  : false
    WM/MediaIsTape  : false
    WM/MediaIsDelay : false
    WM/MediaIsSubtitled: true
    WM/MediaIsMovie : false
    WM/MediaIsPremiere: false
    WM/MediaIsFinale: false
    WM/MediaIsSAP   : false
    WM/MediaIsSport : false
    WM/Provider     : MediaCenterDefault
    WM/VideoClosedCaptioning: false
    WM/WMRVEncodeTime: 2013-01-30 18:30:08
    WM/WMRVSeriesUID: !GenericSeries!Great British Railway Journeys
    WM/WMRVServiceID: !MCService!755567
    WM/WMRVProgramID: !MCProgram!49381242
    WM/WMRVRequestID: 0
    WM/WMRVScheduleItemID: 0
    WM/WMRVQuality  : 0
    WM/WMRVOriginalSoftPrePadding: 420
    WM/WMRVOriginalSoftPostPadding: 180
    WM/WMRVHardPrePadding: -300
    WM/WMRVHardPostPadding: 0
    WM/WMRVATSCContent: false
    WM/WMRVDTVContent: true
    WM/WMRVHDContent: true
    Duration        : 17918570369
    WM/WMRVEndTime  : 2013-01-30 19:00:00
    WM/WMRVBitrate  : 9.382929
    WM/WMRVKeepUntil: -1
    WM/WMRVActualSoftPrePadding: 291
    WM/WMRVActualSoftPostPadding: 0
    WM/WMRVContentProtected: false
    WM/WMRVContentProtectedPercent: 0
    WM/WMRVExpirationSpan: 9223372036854775807
    WM/WMRVInBandRatingSystem: 255
    WM/WMRVInBandRatingLevel: 255
    WM/WMRVInBandRatingAttributes: 0
    WM/WMRVWatched  : false
    WM/MediaThumbWidth: 0
    WM/MediaThumbHeight: 0
    WM/MediaThumbStride: 0
    WM/MediaThumbRet: 4
    WM/MediaThumbRatingSystem: 255
    WM/MediaThumbRatingLevel: 255
    WM/MediaThumbRatingAttributes: 19243776
    WM/MediaThumbAspectRatioX: 0
    WM/MediaThumbAspectRatioY: 0
    WM/MediaThumbTimeStamp: -4616189618054758400
  Duration: 00:14:59.19, start: 1.691285, bitrate: 22 kb/s
    Stream #0:0[0x38](eng): Subtitle: dvb_subtitle
    Stream #0:1[0x39](eng): Audio: aac_latm ([2][22][0][0] / 0x1602), 48000 Hz,
stereo, fltp (hearing impaired)
    Stream #0:2[0x3a](eng): Audio: aac_latm ([2][22][0][0] / 0x1602), 48000 Hz,
stereo, fltp
    Stream #0:3[0x3b]: Video: h264 (High), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9]
, 25 fps, 25 tbr, 10000k tbn, 50 tbc
File 'H264_Copy_Remux_Fail_cut.ts' already exists. Overwrite ? [y/N] y
Output #0, mpegts, to 'H264_Copy_Remux_Fail_cut.ts':
  Metadata:
    WM/MediaClassPrimaryID: db9830bd-3ab3-4fab-8a371a995f7ff74
    WM/MediaClassSecondaryID: ba7f258a-62f7-47a9-b21f4651c42a000
    Title           : Great British Railway Journeys
    WM/SubTitle     : Taunton to Minehead
    WM/SubTitleDescription: Michael Portillo explores a church that moves in mys
terious ways and summons all his strength, to move a one hundred and ten tonne s
team locomotive.
    genre           : Documentary;Other
    WM/OriginalReleaseTime: 0
    WM/MediaCredits : ;Dave Minchin;Michael Portillo;
    service_provider: BBC HD
    service_name    : BBC HD
    WM/MediaOriginalChannel: 102
    WM/MediaOriginalChannelSubNumber: 0
    WM/MediaOriginalBroadcastDateTime: 2013-01-30T00:00:00Z
    WM/MediaOriginalRunTime: 19711177116
    WM/MediaIsStereo: false
    WM/MediaIsRepeat: false
    WM/MediaIsLive  : false
    WM/MediaIsTape  : false
    WM/MediaIsDelay : false
    WM/MediaIsSubtitled: true
    WM/MediaIsMovie : false
    WM/MediaIsPremiere: false
    WM/MediaIsFinale: false
    WM/MediaIsSAP   : false
    WM/MediaIsSport : false
    WM/Provider     : MediaCenterDefault
    WM/VideoClosedCaptioning: false
    WM/WMRVEncodeTime: 2013-01-30 18:30:08
    WM/WMRVSeriesUID: !GenericSeries!Great British Railway Journeys
    WM/WMRVServiceID: !MCService!755567
    WM/WMRVProgramID: !MCProgram!49381242
    WM/WMRVRequestID: 0
    WM/WMRVScheduleItemID: 0
    WM/WMRVQuality  : 0
    WM/WMRVOriginalSoftPrePadding: 420
    WM/WMRVOriginalSoftPostPadding: 180
    WM/WMRVHardPrePadding: -300
    WM/WMRVHardPostPadding: 0
    WM/WMRVATSCContent: false
    WM/WMRVDTVContent: true
    WM/WMRVHDContent: true
    Duration        : 17918570369
    WM/WMRVEndTime  : 2013-01-30 19:00:00
    WM/WMRVBitrate  : 9.382929
    WM/WMRVKeepUntil: -1
    WM/WMRVActualSoftPrePadding: 291
    WM/WMRVActualSoftPostPadding: 0
    WM/WMRVContentProtected: false
    WM/WMRVContentProtectedPercent: 0
    WM/WMRVExpirationSpan: 9223372036854775807
    WM/WMRVInBandRatingSystem: 255
    WM/WMRVInBandRatingLevel: 255
    WM/WMRVInBandRatingAttributes: 0
    WM/WMRVWatched  : false
    WM/MediaThumbWidth: 0
    WM/MediaThumbHeight: 0
    WM/MediaThumbStride: 0
    WM/MediaThumbRet: 4
    WM/MediaThumbRatingSystem: 255
    WM/MediaThumbRatingLevel: 255
    WM/MediaThumbRatingAttributes: 19243776
    WM/MediaThumbAspectRatioX: 0
    WM/MediaThumbAspectRatioY: 0
    WM/MediaThumbTimeStamp: -4616189618054758400
    encoder         : Lavf54.49.102
    Stream #0:0(eng): Audio: aac_latm ([2][22][0][0] / 0x1602), 48000 Hz, stereo
 (hearing impaired)
    Stream #0:1(eng): Audio: aac_latm ([2][22][0][0] / 0x1602), 48000 Hz, stereo

    Stream #0:2: Video: h264, yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25
fps, 90k tbn, 25 tbc
Stream mapping:
  Stream #0:1 -> #0:0 (copy)
  Stream #0:2 -> #0:1 (copy)
  Stream #0:3 -> #0:2 (copy)
Press [q] to stop, [?] for help
[mpegts @ 03eefd60] pts (98593) < dts (105793) in stream 2
av_interleaved_write_frame(): Invalid argument

Using the sample attached:

ffmpeg - ss 1 -i input.wtv -vcodec copy -acodec copy -map 0:a -map 0:v -f mpegts output.ts
O:\ffmpegtest>ffmpeg -ss 1 -i H264_Copy_Remux_Fail_cut.wtv -vcodec copy -acodec
copy -map 0:a -map 0:v -f mpegts H264_Copy_Remux_Fail_cut.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-mi
ngw32- --pkg-config=pkg-config --enable-gpl --enable-libx264 --enable-avisynth -
-enable-libxvid --enable-libmp3lame --enable-version3 --enable-zlib --enable-lib
rtmp --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libopenjpe
g --enable-gnutls --enable-libgsm --enable-libfreetype --enable-fontconfig --ena
ble-libass --enable-libutvideo --enable-libopus --disable-w32threads --enable-fr
ei0r --enable-filter=frei0r --enable-libvo-aacenc --enable-bzlib --enable-libxav
s --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
[wtv @ 01f9c2a0] reported file length (0x7d3ab468) exceeds number of available s
ectors (0x40000000)
[aac_latm @ 01f9d2e0] initializing latmctx
[aac_latm @ 01f9ed20] initializing latmctx
[h264 @ 01f9d8e0] mmco: unref short failure
    Last message repeated 2 times
Input #0, wtv, from 'H264_Copy_Remux_Fail_cut.wtv':
  Metadata:
    WM/MediaClassPrimaryID: db9830bd-3ab3-4fab-8a371a995f7ff74
    WM/MediaClassSecondaryID: ba7f258a-62f7-47a9-b21f4651c42a000
    Title           : Great British Railway Journeys
    WM/SubTitle     : Taunton to Minehead
    WM/SubTitleDescription: Michael Portillo explores a church that moves in mys
terious ways and summons all his strength, to move a one hundred and ten tonne s
team locomotive.
    genre           : Documentary;Other
    WM/OriginalReleaseTime: 0
    WM/MediaCredits : ;Dave Minchin;Michael Portillo;
    service_provider: BBC HD
    service_name    : BBC HD
    WM/MediaOriginalChannel: 102
    WM/MediaOriginalChannelSubNumber: 0
    WM/MediaOriginalBroadcastDateTime: 2013-01-30T00:00:00Z
    WM/MediaOriginalRunTime: 19711177116
    WM/MediaIsStereo: false
    WM/MediaIsRepeat: false
    WM/MediaIsLive  : false
    WM/MediaIsTape  : false
    WM/MediaIsDelay : false
    WM/MediaIsSubtitled: true
    WM/MediaIsMovie : false
    WM/MediaIsPremiere: false
    WM/MediaIsFinale: false
    WM/MediaIsSAP   : false
    WM/MediaIsSport : false
    WM/Provider     : MediaCenterDefault
    WM/VideoClosedCaptioning: false
    WM/WMRVEncodeTime: 2013-01-30 18:30:08
    WM/WMRVSeriesUID: !GenericSeries!Great British Railway Journeys
    WM/WMRVServiceID: !MCService!755567
    WM/WMRVProgramID: !MCProgram!49381242
    WM/WMRVRequestID: 0
    WM/WMRVScheduleItemID: 0
    WM/WMRVQuality  : 0
    WM/WMRVOriginalSoftPrePadding: 420
    WM/WMRVOriginalSoftPostPadding: 180
    WM/WMRVHardPrePadding: -300
    WM/WMRVHardPostPadding: 0
    WM/WMRVATSCContent: false
    WM/WMRVDTVContent: true
    WM/WMRVHDContent: true
    Duration        : 17918570369
    WM/WMRVEndTime  : 2013-01-30 19:00:00
    WM/WMRVBitrate  : 9.382929
    WM/WMRVKeepUntil: -1
    WM/WMRVActualSoftPrePadding: 291
    WM/WMRVActualSoftPostPadding: 0
    WM/WMRVContentProtected: false
    WM/WMRVContentProtectedPercent: 0
    WM/WMRVExpirationSpan: 9223372036854775807
    WM/WMRVInBandRatingSystem: 255
    WM/WMRVInBandRatingLevel: 255
    WM/WMRVInBandRatingAttributes: 0
    WM/WMRVWatched  : false
    WM/MediaThumbWidth: 0
    WM/MediaThumbHeight: 0
    WM/MediaThumbStride: 0
    WM/MediaThumbRet: 4
    WM/MediaThumbRatingSystem: 255
    WM/MediaThumbRatingLevel: 255
    WM/MediaThumbRatingAttributes: 19243776
    WM/MediaThumbAspectRatioX: 0
    WM/MediaThumbAspectRatioY: 0
    WM/MediaThumbTimeStamp: -4616189618054758400
  Duration: 00:14:59.19, start: 1.691285, bitrate: 22 kb/s
    Stream #0:0[0x38](eng): Subtitle: dvb_subtitle
    Stream #0:1[0x39](eng): Audio: aac_latm ([2][22][0][0] / 0x1602), 48000 Hz,
stereo, fltp (hearing impaired)
    Stream #0:2[0x3a](eng): Audio: aac_latm ([2][22][0][0] / 0x1602), 48000 Hz,
stereo, fltp
    Stream #0:3[0x3b]: Video: h264 (High), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9]
, 25 fps, 25 tbr, 10000k tbn, 50 tbc
File 'H264_Copy_Remux_Fail_cut.ts' already exists. Overwrite ? [y/N] y
Output #0, mpegts, to 'H264_Copy_Remux_Fail_cut.ts':
  Metadata:
    WM/MediaClassPrimaryID: db9830bd-3ab3-4fab-8a371a995f7ff74
    WM/MediaClassSecondaryID: ba7f258a-62f7-47a9-b21f4651c42a000
    Title           : Great British Railway Journeys
    WM/SubTitle     : Taunton to Minehead
    WM/SubTitleDescription: Michael Portillo explores a church that moves in mys
terious ways and summons all his strength, to move a one hundred and ten tonne s
team locomotive.
    genre           : Documentary;Other
    WM/OriginalReleaseTime: 0
    WM/MediaCredits : ;Dave Minchin;Michael Portillo;
    service_provider: BBC HD
    service_name    : BBC HD
    WM/MediaOriginalChannel: 102
    WM/MediaOriginalChannelSubNumber: 0
    WM/MediaOriginalBroadcastDateTime: 2013-01-30T00:00:00Z
    WM/MediaOriginalRunTime: 19711177116
    WM/MediaIsStereo: false
    WM/MediaIsRepeat: false
    WM/MediaIsLive  : false
    WM/MediaIsTape  : false
    WM/MediaIsDelay : false
    WM/MediaIsSubtitled: true
    WM/MediaIsMovie : false
    WM/MediaIsPremiere: false
    WM/MediaIsFinale: false
    WM/MediaIsSAP   : false
    WM/MediaIsSport : false
    WM/Provider     : MediaCenterDefault
    WM/VideoClosedCaptioning: false
    WM/WMRVEncodeTime: 2013-01-30 18:30:08
    WM/WMRVSeriesUID: !GenericSeries!Great British Railway Journeys
    WM/WMRVServiceID: !MCService!755567
    WM/WMRVProgramID: !MCProgram!49381242
    WM/WMRVRequestID: 0
    WM/WMRVScheduleItemID: 0
    WM/WMRVQuality  : 0
    WM/WMRVOriginalSoftPrePadding: 420
    WM/WMRVOriginalSoftPostPadding: 180
    WM/WMRVHardPrePadding: -300
    WM/WMRVHardPostPadding: 0
    WM/WMRVATSCContent: false
    WM/WMRVDTVContent: true
    WM/WMRVHDContent: true
    Duration        : 17918570369
    WM/WMRVEndTime  : 2013-01-30 19:00:00
    WM/WMRVBitrate  : 9.382929
    WM/WMRVKeepUntil: -1
    WM/WMRVActualSoftPrePadding: 291
    WM/WMRVActualSoftPostPadding: 0
    WM/WMRVContentProtected: false
    WM/WMRVContentProtectedPercent: 0
    WM/WMRVExpirationSpan: 9223372036854775807
    WM/WMRVInBandRatingSystem: 255
    WM/WMRVInBandRatingLevel: 255
    WM/WMRVInBandRatingAttributes: 0
    WM/WMRVWatched  : false
    WM/MediaThumbWidth: 0
    WM/MediaThumbHeight: 0
    WM/MediaThumbStride: 0
    WM/MediaThumbRet: 4
    WM/MediaThumbRatingSystem: 255
    WM/MediaThumbRatingLevel: 255
    WM/MediaThumbRatingAttributes: 19243776
    WM/MediaThumbAspectRatioX: 0
    WM/MediaThumbAspectRatioY: 0
    WM/MediaThumbTimeStamp: -4616189618054758400
    encoder         : Lavf54.49.102
    Stream #0:0(eng): Audio: aac_latm ([2][22][0][0] / 0x1602), 48000 Hz, stereo
 (hearing impaired)
    Stream #0:1(eng): Audio: aac_latm ([2][22][0][0] / 0x1602), 48000 Hz, stereo

    Stream #0:2: Video: h264, yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25
fps, 90k tbn, 25 tbc
Stream mapping:
  Stream #0:1 -> #0:0 (copy)
  Stream #0:2 -> #0:1 (copy)
  Stream #0:3 -> #0:2 (copy)
Press [q] to stop, [?] for help
[mpegts @ 035222c0] H.264 bitstream malformed, no startcode found, use the h264_
mp4toannexb bitstream filter (-bsf h264_mp4toannexb)
av_interleaved_write_frame(): Invalid argument

comment:8 by Harry Tipper, 11 years ago

Do I need to open another ticket for the samples I have where -ss 1 works? They both return the

av_interleaved_write_frame(): Invalid argument

comment:9 by Harry Tipper, 11 years ago

Cc: harry.tipper@aol.com added

comment:10 by ramitb, 11 years ago

anyone any thoughts on why this is happening?

comment:11 by Carl Eugen Hoyos, 11 years ago

FFmpeg does not implement all possible ways of decoding timestamps from h264 streams, this is not necessarily the reason for this problem though.

comment:12 by ramitb, 11 years ago

understood - so what is the problem for this issue here?

comment:13 by Harry Tipper, 11 years ago

Any info on this problem?

comment:14 by Carl Eugen Hoyos, 11 years ago

Apart from the same timestamp problem that (all?) h264 wtv sample have (workaround is to use -ss 1), on stream copying the first h264 frame that begins with "00 00 01 09 10 00 00 00 00 00 01 67 64" (instead of "00 00 00 01 09 10 ...") arrives in the muxer and leads to the failure. In the input file, there are many 0's before the frame (at position 525d7) so this may be a demuxer or parser problem.

comment:15 by Harry Tipper, 11 years ago

But -ss 1 only fixes certain examples, not all examples. For instance the sample provided in this ticket by Ramit is not fixed by -ss 1.

comment:16 by julian, 10 years ago

Cc: julian@corecode.at added

comment:17 by julian, 10 years ago

i have a bunch of more files that all exhibit the "pts (xx) < dts (yy) av_interleaved_write_frame(): Invalid argument" failure when trying to convert them to mp4

https://dl.dropboxusercontent.com/u/7221986/av_interleaved_write_frame.zip

any progress on this matter?

comment:18 by ramitb, 10 years ago

Any update on this?

comment:19 by julian, 10 years ago

happens also for common files like this one: http://goo.gl/eiLqjU

ffmpeg -i Trust.Me.2013.1080p.WEB-DL.H264-RARBG.mkv -acodec copy -vcodec copy  Trust.Me.2013.1080p.WEB-DL.H264-RARBG.mp4

=>

[mp4 @ 0x7fd0f281ce00] pts (49376) < dts (50064) in stream 0
av_interleaved_write_frame(): Invalid argument

comment:20 by julian, 10 years ago

can i make a "bounty" for fixing this bug?

comment:21 by julian, 10 years ago

another affected file: http://www.tpb-proxy.com/torrent/10612775/Divergent.2014.RETAIL.1080p.WEB-DL.H264.AC3-EVO

how large a bounty would be needed to get a fix?

in reply to:  20 comment:22 by llogan, 9 years ago

Replying to julian:

can i make a "bounty" for fixing this bug?

You can place a bounty here:
https://www.bountysource.com/issues/1414464-ffmpeg-unable-to-stream-copy-some-wtv-h264-into-mpegts

comment:23 by julian, 9 years ago

i've pledged a 100$ bounty on bountysource

comment:24 by llogan, 9 years ago

Keywords: bounty added

comment:25 by Carl Eugen Hoyos, 9 years ago

Component: undeterminedavformat
Resolution: fixed
Status: openclosed

comment:26 by julian, 9 years ago

thanks. actually it seems the problem with files av_interleaved_write_frame.zip, Trust.Me.2013.1080p.WEB-DL.H264-RARBG.mkv and Divergent.2014.RETAIL.1080p.WEB-DL.H264.AC3-EVO has already been fixed previously somewhere between 2.3 and 2.5.3.

anyway you can claim the bounty on bountysource.com

comment:27 by julian, 9 years ago

i had to change the location of the uploaded file to reproduce the issue:

http://www.filehosting.org/file/details/501422/ffmpeg_2220_av_interleaved_write_frame.zip

Note: See TracTickets for help on using tickets.