Opened 11 years ago

Closed 10 years ago

#3658 closed defect (fixed)

pts < dts av_interleaved_write_frame(): Invalid argument

Reported by: Andrei Sedoi Owned by:
Priority: important Component: avformat
Version: git-master Keywords: mpegts h264 regression
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug: http://s3.amazonaws.com/simpletv/streams/shared/tv.800000.100.tar.gz
How to reproduce:

% ffmpeg -i tv.800000.100 -codec copy -bsf:a aac_adtstoasc 1.mp4
ffmpeg version 2.2.2
built on May 15 2014 14:56:19 with gcc 4.3.3 (Sourcery G++ Lite 4.3-154)
configuration: --prefix=/usr --enable-cross-compile --cross-prefix=mips-linux-gnu- --arch=mips --target-os=linux --extra-cflags=' -EL -msoft-float -funit-at-a-time ' --extra-cxxflags=' -EL -msoft-float -funit-at-a-time ' --extra-ldflags=' -EL -msoft-float ' --disable-ffplay --disable-ffprobe --disable-ffserver --disable-debug --disable-mipsdspr1 --disable-mipsdspr2 --disable-mipsfpu --enable-hardcoded-tables --disable-iconv --disable-doc --disable-everything --enable-decoder=aac --enable-decoder=h264 --enable-muxer=mp4 --enable-demuxer=mov --enable-demuxer=mpegts --enable-parser=aac --enable-parser=h264 --enable-bsf=aac_adtstoasc --enable-protocol=file

Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.

Attachments (2)

ffmpeg_failure.txt (10.4 KB ) - added by Andrei Sedoi 11 years ago.
output
tv.800000.100_cut.ts (2.4 MB ) - added by Carl Eugen Hoyos 11 years ago.

Change History (8)

by Andrei Sedoi, 11 years ago

Attachment: ffmpeg_failure.txt added

output

comment:1 by Carl Eugen Hoyos, 11 years ago

Priority: importantnormal

Could you elaborate on what your problem with remuxing your input file is?

Is the problem reproducible with current FFmpeg git head?

comment:2 by Andrei Sedoi, 11 years ago

I've tried with current FFmpeg git HEAD (2491579) and x86 build using this file http://s3.amazonaws.com/simpletv/streams/shared/tv.800000.100 . Same problem, conversion is failing:


[bsnote@bsnotefedora19 ffmpeg (master)]$ ./ffmpeg -i tv.800000.100 -codec copy -bsf:a aac_adtstoasc 1.mp4
ffmpeg version N-63346-g2491579 Copyright (c) 2000-2014 the FFmpeg developers

built on May 20 2014 22:21:19 with gcc 4.8.2 (GCC) 20131212 (Red Hat 4.8.2-7)
configuration: --disable-ffplay --disable-ffprobe --disable-ffserver --disable-debug --enable-hardcoded-tables --disable-iconv --disable-doc --disable-everything --enable-decoder=aac --enable-decoder=h264 --enable-muxer=mp4 --enable-demuxer=mov --enable-demuxer=mpegts --enable-parser=aac --enable-parser=h264 --enable-bsf=aac_adtstoasc --enable-protocol=file
libavutil 52. 86.100 / 52. 86.100
libavcodec 55. 63.100 / 55. 63.100
libavformat 55. 39.100 / 55. 39.100
libavdevice 55. 13.101 / 55. 13.101
libavfilter 4. 5.100 / 4. 5.100
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 19.100 / 0. 19.100

Input #0, mpegts, from 'tv.800000.100':

Duration: 00:30:45.42, start: 24293.446211, bitrate: 884 kb/s
Program 1

Stream #0:0[0x1011]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p, 360x270 [SAR 1:1 DAR 4:3], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
Stream #0:1[0x44]: Audio: aac ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 131 kb/s

Output #0, mp4, to '1.mp4':

Metadata:

encoder : Lavf55.39.100
Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 360x270 [SAR 1:1 DAR 4:3], q=2-31, 29.97 fps, 90k tbn, 90k tbc
Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo, 131 kb/s

Stream mapping:

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

Press [q] to stop, ? for help
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 13781987, current: 13781987; changing to 13781988. This may result in incorrect timestamps in the output file.
[mpegts @ 0x996b860] DTS 2205360310 < 2205366316 out of orderitrate= 793.9kbits/s
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 20025225, current: 20025225; changing to 20025226. This may result in incorrect timestamps in the output file.
[mpegts @ 0x996b860] DTS 2210387332 < 2210393338 out of order
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 24061257, current: 24061257; changing to 24061258. This may result in incorrect timestamps in the output file.
[mpegts @ 0x996b860] DTS 2211909853 < 2211915859 out of order
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 25526721, current: 25526721; changing to 25526722. This may result in incorrect timestamps in the output file.
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 25682877, current: 25682877; changing to 25682878. This may result in incorrect timestamps in the output file.
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 26202396, current: 26202396; changing to 26202397. This may result in incorrect timestamps in the output file.
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 28340532, current: 28340532; changing to 28340533. This may result in incorrect timestamps in the output file.
[mpegts @ 0x996b860] DTS 2215026967 < 2215032973 out of order
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 29382573, current: 29382573; changing to 29382574. This may result in incorrect timestamps in the output file.
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 32304492, current: 32304492; changing to 32304493. This may result in incorrect timestamps in the output file.
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 32385573, current: 32385573; changing to 32385574. This may result in incorrect timestamps in the output file.
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 32553741, current: 32553741; changing to 32553742. This may result in incorrect timestamps in the output file.
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 32790978, current: 32790978; changing to 32790979. This may result in incorrect timestamps in the output file.
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 34112298, current: 34112298; changing to 34112299. This may result in incorrect timestamps in the output file.
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 34310496, current: 34310496; changing to 34310497. This may result in incorrect timestamps in the output file.
[mpegts @ 0x996b860] DTS 2221198132 < 2221204138 out of order
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 35286471, current: 35286471; changing to 35286472. This may result in incorrect timestamps in the output file.
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 37787970, current: 37787970; changing to 37787971. This may result in incorrect timestamps in the output file.
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 38613795, current: 38613795; changing to 38613796. This may result in incorrect timestamps in the output file.
[mpegts @ 0x996b860] DTS 2226041971 < 2226047977 out of order
[mpegts @ 0x996b860] DTS 2226978907 < 2226984913 out of order
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 40697877, current: 40697877; changing to 40697878. This may result in incorrect timestamps in the output file.
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 61778937, current: 61778937; changing to 61778938. This may result in incorrect timestamps in the output file.
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 63460617, current: 63460617; changing to 63460618. This may result in incorrect timestamps in the output file.
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 65932086, current: 65932086; changing to 65932087. This may result in incorrect timestamps in the output file.
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 66082236, current: 66082236; changing to 66082237. This may result in incorrect timestamps in the output file.
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 69418569, current: 69418569; changing to 69418570. This may result in incorrect timestamps in the output file.
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 72139287, current: 72139287; changing to 72139288. This may result in incorrect timestamps in the output file.
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 80875014, current: 80875014; changing to 80875015. This may result in incorrect timestamps in the output file.
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 80884023, current: 80884023; changing to 80884024. This may result in incorrect timestamps in the output file.
[mpegts @ 0x996b860] DTS 2274348229 < 2274354235 out of order
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 87974106, current: 87974106; changing to 87974107. This may result in incorrect timestamps in the output file.
[mpegts @ 0x996b860] DTS 2278312189 < 2278318195 out of order
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 91920048, current: 91920048; changing to 91920049. This may result in incorrect timestamps in the output file.
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 96103228, current: 96103228; changing to 96103229. This may result in incorrect timestamps in the output file.
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 97586710, current: 97586710; changing to 97586711. This may result in incorrect timestamps in the output file.
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 102550669, current: 102550669; changing to 102550670. This may result in incorrect timestamps in the output file.
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 110481592, current: 110481592; changing to 110481593. This may result in incorrect timestamps in the output file.
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 129643735, current: 129643735; changing to 129643736. This may result in incorrect timestamps in the output file.
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 134004091, current: 134004091; changing to 134004092. This may result in incorrect timestamps in the output file.
[mpegts @ 0x996b860] DTS 2323321154 < 2323327160 out of order
[mpegts @ 0x996b860] DTS 2323843676 < 2323849682 out of order
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 137562646, current: 137562646; changing to 137562647. This may result in incorrect timestamps in the output file.
[mpegts @ 0x996b860] DTS 2326681511 < 2326687517 out of order
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 148427500, current: 148427500; changing to 148427501. This may result in incorrect timestamps in the output file.
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 149947018, current: 149947018; changing to 149947019. This may result in incorrect timestamps in the output file.
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 151100170, current: 151100170; changing to 151100171. This may result in incorrect timestamps in the output file.
[mpegts @ 0x996b860] DTS 2347861670 < 2347867676 out of orderbitrate= 749.3kbits/s
[mp4 @ 0x99707c0] Non-monotonous DTS in output stream 0:0; previous: 161868928, current: 161868928; changing to 161868929. This may result in incorrect timestamps in the output file.
[mpegts @ 0x996b860] Invalid timestamps stream=0, pts=2348294102, dts=2348300108, size=11255
[mpegts @ 0x996b860] Invalid timestamps stream=0, pts=2348297105, dts=2348300108, size=3393
[mp4 @ 0x99707c0] pts (161883943) < dts (161889949) in stream 0
av_interleaved_write_frame(): Invalid argument
frame=51091 fps=9982 q=-1.0 Lsize= 167061kB time=00:29:58.81 bitrate= 760.8kbits/s
video:138629kB audio:26630kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.090201%
Conversion failed!
[bsnote@bsnotefedora19 ffmpeg (master)]$


Is there anything else I can do to help debug this?

in reply to:  2 comment:3 by Carl Eugen Hoyos, 11 years ago

Version: 2.2.1git-master

Replying to bsnote:

I've tried with current FFmpeg git HEAD (2491579) and x86 build using this file http://s3.amazonaws.com/simpletv/streams/shared/tv.800000.100 . Same problem, conversion is failing:

Is there anything else I can do to help debug this?

Yes: Please explain what you mean with conversion is failing: I tested your sample and command line and approximately 30 minutes are remuxed and the output file seems to play in-sync, what do I miss?

comment:4 by Andrei Sedoi, 11 years ago

I mean FFmpeg stops remuxing at 29:58 (duration of input file is 30:44), prints "Conversion failed!" message and exits with code 1.

I expect it to complete remuxing and exit with code 0.

comment:5 by Carl Eugen Hoyos, 11 years ago

Component: undeterminedavformat
Keywords: mpegts h264 regression added
Priority: normalimportant
Reproduced by developer: set
Status: newopen

Regression since 1e5271a9 - related to ticket #2143.

$ ffmpeg -i tv.800000.100_cut.ts -an -vcodec copy out.mov
ffmpeg version N-63349-gca2fd25 Copyright (c) 2000-2014 the FFmpeg developers
  built on May 20 2014 23:26:41 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl
  libavutil      52. 86.100 / 52. 86.100
  libavcodec     55. 63.100 / 55. 63.100
  libavformat    55. 39.100 / 55. 39.100
  libavdevice    55. 13.101 / 55. 13.101
  libavfilter     4.  5.100 /  4.  5.100
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
[h264 @ 0x1d35900] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x1d35900] decode_slice_header error
[h264 @ 0x1d35900] no frame!
[h264 @ 0x1d35900] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x1d35900] decode_slice_header error
[h264 @ 0x1d35900] no frame!
[h264 @ 0x1d35900] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x1d35900] decode_slice_header error
[h264 @ 0x1d35900] no frame!
[h264 @ 0x1d35900] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x1d35900] decode_slice_header error
[h264 @ 0x1d35900] no frame!
[h264 @ 0x1d35900] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x1d35900] decode_slice_header error
[h264 @ 0x1d35900] no frame!
[h264 @ 0x1d35900] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x1d35900] decode_slice_header error
[h264 @ 0x1d35900] no frame!
[h264 @ 0x1d35900] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x1d35900] decode_slice_header error
[h264 @ 0x1d35900] no frame!
[h264 @ 0x1d35900] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x1d35900] decode_slice_header error
[h264 @ 0x1d35900] no frame!
[h264 @ 0x1d35900] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x1d35900] decode_slice_header error
[h264 @ 0x1d35900] no frame!
[h264 @ 0x1d35900] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x1d35900] decode_slice_header error
[h264 @ 0x1d35900] no frame!
[h264 @ 0x1d35900] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x1d35900] decode_slice_header error
[h264 @ 0x1d35900] no frame!
[h264 @ 0x1d35900] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x1d35900] decode_slice_header error
[h264 @ 0x1d35900] no frame!
[h264 @ 0x1d35900] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x1d35900] decode_slice_header error
[h264 @ 0x1d35900] no frame!
[h264 @ 0x1d35900] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x1d35900] decode_slice_header error
[h264 @ 0x1d35900] no frame!
[h264 @ 0x1d35900] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x1d35900] decode_slice_header error
[h264 @ 0x1d35900] no frame!
[h264 @ 0x1d35900] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x1d35900] decode_slice_header error
[h264 @ 0x1d35900] no frame!
[h264 @ 0x1d35900] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x1d35900] decode_slice_header error
[h264 @ 0x1d35900] no frame!
[h264 @ 0x1d35900] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x1d35900] decode_slice_header error
[h264 @ 0x1d35900] no frame!
[h264 @ 0x1d35900] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x1d35900] decode_slice_header error
[h264 @ 0x1d35900] no frame!
[h264 @ 0x1d35900] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x1d35900] decode_slice_header error
[h264 @ 0x1d35900] no frame!
[h264 @ 0x1d35900] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x1d35900] decode_slice_header error
Input #0, mpegts, from 'tv.800000.100_cut.ts':
  Duration: 00:00:27.19, start: 26081.946278, bitrate: 753 kb/s
  Program 1
    Stream #0:0[0x1011]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p, 360x270 [SAR 1:1 DAR 4:3], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x44]: Audio: aac ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 101 kb/s
Output #0, mov, to 'out.mov':
  Metadata:
    encoder         : Lavf55.39.100
    Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p, 360x270 [SAR 1:1 DAR 4:3], q=2-31, 29.97 fps, 90k tbn, 90k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[mpegts @ 0x1d31c20] DTS 2347861670 < 2347867676 out of order
[mov @ 0x1d37000] Non-monotonous DTS in output stream 0:0; previous: 807807, current: 807807; changing to 807808. This may result in incorrect timestamps in the output file.
[mpegts @ 0x1d31c20] Invalid timestamps stream=0, pts=2348294102, dts=2348300108, size=11255
[mpegts @ 0x1d31c20] Invalid timestamps stream=0, pts=2348297105, dts=2348300108, size=3393
[mov @ 0x1d37000] pts (822822) < dts (828828) in stream 0
av_interleaved_write_frame(): Invalid argument
frame=  232 fps=0.0 q=-1.0 Lsize=     687kB time=00:00:09.24 bitrate= 609.2kbits/s
video:695kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Conversion failed!

by Carl Eugen Hoyos, 11 years ago

Attachment: tv.800000.100_cut.ts added

comment:6 by Michael Niedermayer, 10 years ago

Resolution: fixed
Status: openclosed
Note: See TracTickets for help on using tickets.