Opened 11 years ago
Closed 11 years ago
#3197 closed defect (fixed)
Assertion nus->keyframe_pts[k] > last_pts failed when using "-f segment"
Reported by: | ob | Owned by: | |
---|---|---|---|
Priority: | important | Component: | avformat |
Version: | git-master | Keywords: | nut crash abort regression |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | yes | |
Analyzed by developer: | no |
Description
Summary of the bug:
Hi,
I'm trying to split VOB files cleanly with ffmpeg-2.1.1/Linux (32bit), using -f segment
. My goal is to encode the resulting files in parallel on a cluster of machines, before merging everything back.
My understanding is that -f segment
should create a new output file every time there's a key frame in the stream. However, I'm getting:
Assertion nus->keyframe_pts[k] > last_pts failed at libavformat/nutenc.c:596
The failed assertion is there:
ff_put_v(bc, 1 + 2*flag + 4*n); for (k= j - n; k<=j && k<nut->sp_count; k++) { if (nus->keyframe_pts[k] == AV_NOPTS_VALUE) continue; => av_assert0(nus->keyframe_pts[k] > last_pts); ff_put_v(bc, nus->keyframe_pts[k] - last_pts); last_pts = nus->keyframe_pts[k]; }
The command I ran was:
ffmpeg -report -i concat:$(echo VTS_01*.VOB | tr ' ' \|) -map 0:1 -map 0:13 -codec copy -f segment output-%08d.nut
Full report attached.
Attachments (4)
Change History (22)
by , 11 years ago
Attachment: | ffmpeg-20131205-003008.log added |
---|
comment:1 by , 11 years ago
Component: | FFmpeg → avformat |
---|---|
Keywords: | nut crash abort added |
Priority: | normal → important |
Is the problem also reproducible with current FFmpeg git head?
by , 11 years ago
Attachment: | ffmpeg-20131205-185637.log added |
---|
Full Report (with binary compiled from head)
comment:3 by , 11 years ago
Is the concat filter required to reproduce the problem? Does it also happen if you only copy audio or only video (with -an or -vn)? Are specific samples needed?
comment:4 by , 11 years ago
Apparently it all works fine if I try without concat.
-an
and -vn
stop on the first file with this message:
Output file #0 does not contain any stream
The stream ids are changing between VOBs, which is likely an issue. Here's ffprobe
output for all of them:
VTS_01_0.VOB ffprobe version N-58754-ge2bf00c Copyright (c) 2007-2013 the FFmpeg developers built on Dec 5 2013 18:55:53 with gcc 4.8 (Ubuntu/Linaro 4.8.1-10ubuntu9) configuration: --disable-stripping libavutil 52. 56.100 / 52. 56.100 libavcodec 55. 45.100 / 55. 45.100 libavformat 55. 22.100 / 55. 22.100 libavdevice 55. 5.102 / 55. 5.102 libavfilter 3. 91.100 / 3. 91.100 libswscale 2. 5.101 / 2. 5.101 libswresample 0. 17.104 / 0. 17.104 Input #0, mpeg, from 'VTS_01_0.VOB': Duration: 00:00:02.40, start: 0.128389, bitrate: 3618 kb/s Stream #0:0[0x1bf]: Data: dvd_nav_packet Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, bt470bg), 720x576 [SAR 64:45 DAR 16:9], max. 9800 kb/s, 25 fps, 4.17 tbr, 90k tbn, 50 tbc Stream #0:2[0x21]: Subtitle: dvd_subtitle Stream #0:3[0x20]: Subtitle: dvd_subtitle Unsupported codec with id 1145979222 for input stream 0 =============== VTS_01_1.VOB ffprobe version N-58754-ge2bf00c Copyright (c) 2007-2013 the FFmpeg developers built on Dec 5 2013 18:55:53 with gcc 4.8 (Ubuntu/Linaro 4.8.1-10ubuntu9) configuration: --disable-stripping libavutil 52. 56.100 / 52. 56.100 libavcodec 55. 45.100 / 55. 45.100 libavformat 55. 22.100 / 55. 22.100 libavdevice 55. 5.102 / 55. 5.102 libavfilter 3. 91.100 / 3. 91.100 libswscale 2. 5.101 / 2. 5.101 libswresample 0. 17.104 / 0. 17.104 Input #0, mpeg, from 'VTS_01_1.VOB': Duration: 00:21:40.12, start: 0.053622, bitrate: 6607 kb/s Stream #0:0[0x1bf]: Data: dvd_nav_packet Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv), 720x576 [SAR 64:45 DAR 16:9], max. 7500 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc Stream #0:2[0x2a]: Subtitle: dvd_subtitle Stream #0:3[0x29]: Subtitle: dvd_subtitle Stream #0:4[0x28]: Subtitle: dvd_subtitle Stream #0:5[0x27]: Subtitle: dvd_subtitle Stream #0:6[0x26]: Subtitle: dvd_subtitle Stream #0:7[0x25]: Subtitle: dvd_subtitle Stream #0:8[0x24]: Subtitle: dvd_subtitle Stream #0:9[0x23]: Subtitle: dvd_subtitle Stream #0:10[0x22]: Subtitle: dvd_subtitle Stream #0:11[0x21]: Subtitle: dvd_subtitle Stream #0:12[0x20]: Subtitle: dvd_subtitle Stream #0:13[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s Unsupported codec with id 1145979222 for input stream 0 =============== VTS_01_2.VOB ffprobe version N-58754-ge2bf00c Copyright (c) 2007-2013 the FFmpeg developers built on Dec 5 2013 18:55:53 with gcc 4.8 (Ubuntu/Linaro 4.8.1-10ubuntu9) configuration: --disable-stripping libavutil 52. 56.100 / 52. 56.100 libavcodec 55. 45.100 / 55. 45.100 libavformat 55. 22.100 / 55. 22.100 libavdevice 55. 5.102 / 55. 5.102 libavfilter 3. 91.100 / 3. 91.100 libswscale 2. 5.101 / 2. 5.101 libswresample 0. 17.104 / 0. 17.104 [mpeg2video @ 0xa3cb440] Invalid frame dimensions 0x0. Last message repeated 7 times Input #0, mpeg, from 'VTS_01_2.VOB': Duration: 00:21:41.98, start: 1300.273300, bitrate: 6597 kb/s Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv), 720x576 [SAR 64:45 DAR 16:9], max. 7500 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc Stream #0:1[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s Stream #0:2[0x1bf]: Data: dvd_nav_packet Stream #0:3[0x2a]: Subtitle: dvd_subtitle Stream #0:4[0x29]: Subtitle: dvd_subtitle Stream #0:5[0x28]: Subtitle: dvd_subtitle Stream #0:6[0x27]: Subtitle: dvd_subtitle Stream #0:7[0x26]: Subtitle: dvd_subtitle Stream #0:8[0x25]: Subtitle: dvd_subtitle Stream #0:9[0x24]: Subtitle: dvd_subtitle Stream #0:10[0x23]: Subtitle: dvd_subtitle Stream #0:11[0x22]: Subtitle: dvd_subtitle Stream #0:12[0x21]: Subtitle: dvd_subtitle Stream #0:13[0x20]: Subtitle: dvd_subtitle Unsupported codec with id 1145979222 for input stream 2 =============== VTS_01_3.VOB ffprobe version N-58754-ge2bf00c Copyright (c) 2007-2013 the FFmpeg developers built on Dec 5 2013 18:55:53 with gcc 4.8 (Ubuntu/Linaro 4.8.1-10ubuntu9) configuration: --disable-stripping libavutil 52. 56.100 / 52. 56.100 libavcodec 55. 45.100 / 55. 45.100 libavformat 55. 22.100 / 55. 22.100 libavdevice 55. 5.102 / 55. 5.102 libavfilter 3. 91.100 / 3. 91.100 libswscale 2. 5.101 / 2. 5.101 libswresample 0. 17.104 / 0. 17.104 [mpeg2video @ 0xa723440] Invalid frame dimensions 0x0. Last message repeated 1 times Input #0, mpeg, from 'VTS_01_3.VOB': Duration: 00:22:44.42, start: 2602.353300, bitrate: 6295 kb/s Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv), 720x576 [SAR 64:45 DAR 16:9], max. 7500 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc Stream #0:1[0x1bf]: Data: dvd_nav_packet Stream #0:2[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s Unsupported codec with id 1145979222 for input stream 1 =============== VTS_01_4.VOB ffprobe version N-58754-ge2bf00c Copyright (c) 2007-2013 the FFmpeg developers built on Dec 5 2013 18:55:53 with gcc 4.8 (Ubuntu/Linaro 4.8.1-10ubuntu9) configuration: --disable-stripping libavutil 52. 56.100 / 52. 56.100 libavcodec 55. 45.100 / 55. 45.100 libavformat 55. 22.100 / 55. 22.100 libavdevice 55. 5.102 / 55. 5.102 libavfilter 3. 91.100 / 3. 91.100 libswscale 2. 5.101 / 2. 5.101 libswresample 0. 17.104 / 0. 17.104 [mpeg2video @ 0xad6d440] Invalid frame dimensions 0x0. Input #0, mpeg, from 'VTS_01_4.VOB': Duration: 00:19:27.43, start: 3966.865300, bitrate: 6561 kb/s Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv), 720x576 [SAR 64:45 DAR 16:9], max. 7500 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc Stream #0:1[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s Stream #0:2[0x1bf]: Data: dvd_nav_packet Unsupported codec with id 1145979222 for input stream 2 ===============
Using the original command but with concat:$(echo VTS_01_[1234].VOB | tr ' ' \|)
and -map 0
fails with:
$ ~/git/ffmpeg/ffmpeg -i concat:$(echo VTS_01_[1234].VOB | tr ' ' \|) -vn -codec copy -f segment output-%08d.nut ffmpeg version N-58754-ge2bf00c Copyright (c) 2000-2013 the FFmpeg developers built on Dec 5 2013 18:55:53 with gcc 4.8 (Ubuntu/Linaro 4.8.1-10ubuntu9) configuration: --disable-stripping libavutil 52. 56.100 / 52. 56.100 libavcodec 55. 45.100 / 55. 45.100 libavformat 55. 22.100 / 55. 22.100 libavdevice 55. 5.102 / 55. 5.102 libavfilter 3. 91.100 / 3. 91.100 libswscale 2. 5.101 / 2. 5.101 libswresample 0. 17.104 / 0. 17.104 Input #0, mpeg, from 'concat:VTS_01_1.VOB|VTS_01_2.VOB|VTS_01_3.VOB|VTS_01_4.VOB': Duration: 01:25:34.24, start: 0.053622, bitrate: 6511 kb/s Stream #0:0[0x1bf]: Data: dvd_nav_packet Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv), 720x576 [SAR 64:45 DAR 16:9], max. 7500 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc Stream #0:2[0x2a]: Subtitle: dvd_subtitle Stream #0:3[0x29]: Subtitle: dvd_subtitle Stream #0:4[0x28]: Subtitle: dvd_subtitle Stream #0:5[0x27]: Subtitle: dvd_subtitle Stream #0:6[0x26]: Subtitle: dvd_subtitle Stream #0:7[0x25]: Subtitle: dvd_subtitle Stream #0:8[0x24]: Subtitle: dvd_subtitle Stream #0:9[0x23]: Subtitle: dvd_subtitle Stream #0:10[0x22]: Subtitle: dvd_subtitle Stream #0:11[0x21]: Subtitle: dvd_subtitle Stream #0:12[0x20]: Subtitle: dvd_subtitle Stream #0:13[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s Output #0, segment, to 'output-%08d.nut': Output file #0 does not contain any stream
As for the samples, I'm not legally allowed to share them (I guess that's a common issue for you guys). Are some test samples available somewhere so I can reproduce with something you can use too?
I suspect that's all because of the changing stream ids but I'm not sure how to work around this. If I process each VOB separately without concat
, will I lose audio and/or video continuity?
follow-ups: 6 17 comment:5 by , 11 years ago
Actually, interestingly enough, it fails if I specify only the first VOB file and the video stream:
$ ~/git/ffmpeg/ffmpeg -i VTS_01_1.VOB -map 0:1 -codec copy -f segment output/output-1-%08d.nut ffmpeg version N-58754-ge2bf00c Copyright (c) 2000-2013 the FFmpeg developers built on Dec 5 2013 18:55:53 with gcc 4.8 (Ubuntu/Linaro 4.8.1-10ubuntu9) configuration: --disable-stripping libavutil 52. 56.100 / 52. 56.100 libavcodec 55. 45.100 / 55. 45.100 libavformat 55. 22.100 / 55. 22.100 libavdevice 55. 5.102 / 55. 5.102 libavfilter 3. 91.100 / 3. 91.100 libswscale 2. 5.101 / 2. 5.101 libswresample 0. 17.104 / 0. 17.104 Input #0, mpeg, from 'VTS_01_1.VOB': Duration: 00:21:40.12, start: 0.053622, bitrate: 6607 kb/s Stream #0:0[0x1bf]: Data: dvd_nav_packet Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv), 720x576 [SAR 64:45 DAR 16:9], max. 7500 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc Stream #0:2[0x2a]: Subtitle: dvd_subtitle Stream #0:3[0x29]: Subtitle: dvd_subtitle Stream #0:4[0x28]: Subtitle: dvd_subtitle Stream #0:5[0x27]: Subtitle: dvd_subtitle Stream #0:6[0x26]: Subtitle: dvd_subtitle Stream #0:7[0x25]: Subtitle: dvd_subtitle Stream #0:8[0x24]: Subtitle: dvd_subtitle Stream #0:9[0x23]: Subtitle: dvd_subtitle Stream #0:10[0x22]: Subtitle: dvd_subtitle Stream #0:11[0x21]: Subtitle: dvd_subtitle Stream #0:12[0x20]: Subtitle: dvd_subtitle Stream #0:13[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s Output #0, segment, to 'output/output-1-%08d.nut': Metadata: encoder : Lavf55.22.100 Stream #0:0: Video: mpeg2video, yuv420p, 720x576 [SAR 64:45 DAR 16:9], q=2-31, max. 7500 kb/s, 25 fps, 90k tbn, 25 tbc Stream mapping: Stream #0:1 -> #0:0 (copy) Press [q] to stop, [?] for help [nut @ 0x9a05820] Negative pts not supported stream 0, pts -9223372036854775808 av_interleaved_write_frame(): Invalid argument
comment:6 by , 11 years ago
Version: | unspecified → git-master |
---|
Replying to ob:
Actually, interestingly enough, it fails if I specify only the first VOB file and the video stream:
Please cut the sample as small as possible to still reproduce the issue and upload it.
comment:7 by , 11 years ago
What method do you prefer for me to cut it? dd with a block size of 2048?
comment:8 by , 11 years ago
dd is the recommended method but any other method that produces an output file that allows to reproduce the problem is also fine.
comment:10 by , 11 years ago
I am unable to reproduce the assertion failure with the sample and command line you provided:
$ ffmpeg -i bad_chunk.vob -map 0:1 -codec copy -f segment output-1-%08d.nut ffmpeg version N-58799-g5ac5581 Copyright (c) 2000-2013 the FFmpeg developers built on Dec 6 2013 11:02:07 with gcc 4.7 (SUSE Linux) configuration: --enable-gpl libavutil 52. 56.100 / 52. 56.100 libavcodec 55. 46.100 / 55. 46.100 libavformat 55. 22.101 / 55. 22.101 libavdevice 55. 5.102 / 55. 5.102 libavfilter 3. 91.100 / 3. 91.100 libswscale 2. 5.101 / 2. 5.101 libswresample 0. 17.104 / 0. 17.104 libpostproc 52. 3.100 / 52. 3.100 Input #0, mpeg, from 'bad_chunk.vob': Duration: N/A, start: 0.053622, bitrate: N/A Stream #0:0[0x1bf]: Data: dvd_nav_packet Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv), 720x576 [SAR 64:45 DAR 16:9], max. 7500 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc Stream #0:2[0x2a]: Subtitle: dvd_subtitle Stream #0:3[0x29]: Subtitle: dvd_subtitle Stream #0:4[0x28]: Subtitle: dvd_subtitle Stream #0:5[0x27]: Subtitle: dvd_subtitle Stream #0:6[0x26]: Subtitle: dvd_subtitle Stream #0:7[0x25]: Subtitle: dvd_subtitle Stream #0:8[0x24]: Subtitle: dvd_subtitle Stream #0:9[0x23]: Subtitle: dvd_subtitle Stream #0:10[0x22]: Subtitle: dvd_subtitle Stream #0:11[0x21]: Subtitle: dvd_subtitle Stream #0:12[0x20]: Subtitle: dvd_subtitle Output #0, segment, to 'output-1-%08d.nut': Metadata: encoder : Lavf55.22.101 Stream #0:0: Video: mpeg2video, yuv420p, 720x576 [SAR 64:45 DAR 16:9], q=2-31, max. 7500 kb/s, 25 fps, 90k tbn, 25 tbc Stream mapping: Stream #0:1 -> #0:0 (copy) Press [q] to stop, [?] for help [nut @ 0x22fd960] Negative pts not supported stream 0, pts -9223372036854775808 av_interleaved_write_frame(): Invalid argument
comment:11 by , 11 years ago
I guess the error you got before you edited your post was because the output directory didn't exist, which you apparently fixed. The new error does look like the last one I'm getting.
comment:12 by , 11 years ago
But your original report was about an assertion failure (which is an important crash), how can I reproduce it?
comment:13 by , 11 years ago
Yes, this bug drifted a little bit from the original report. I'll try to cut samples from the other VOB files to try and reproduce with concat
and content I can upload. I'll update this when I'm done.
comment:14 by , 11 years ago
~/git/ffmpeg/ffmpeg -i new_bad.vob -map 0:1 -map 0:13 -codec copy -f segment output-%08d.nut
seems to reproduce the problem consistently. It's crafted from the 298 first blocks of both VTS_01_0.VOB and VTS_01_1.VOB (each block being 2048 bytes). Hopefully this doesn't reproduce the problem for completely different reasons.
new_bad.vob
attached.
$ ~/git/ffmpeg/ffmpeg -i new_bad.vob -map 0:1 -map 0:13 -codec copy -f segment output-%08d.nut ffmpeg version N-58754-ge2bf00c Copyright (c) 2000-2013 the FFmpeg developers built on Dec 5 2013 18:55:53 with gcc 4.8 (Ubuntu/Linaro 4.8.1-10ubuntu9) configuration: --disable-stripping libavutil 52. 56.100 / 52. 56.100 libavcodec 55. 45.100 / 55. 45.100 libavformat 55. 22.100 / 55. 22.100 libavdevice 55. 5.102 / 55. 5.102 libavfilter 3. 91.100 / 3. 91.100 libswscale 2. 5.101 / 2. 5.101 libswresample 0. 17.104 / 0. 17.104 Input #0, mpeg, from 'new_bad.vob': Duration: 00:00:02.01, start: 0.053622, bitrate: 3033 kb/s Stream #0:0[0x1bf]: Data: dvd_nav_packet Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, bt470bg), 720x576 [SAR 64:45 DAR 16:9], max. 7500 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc Stream #0:2[0x21]: Subtitle: dvd_subtitle Stream #0:3[0x20]: Subtitle: dvd_subtitle Stream #0:4[0x2a]: Subtitle: dvd_subtitle Stream #0:5[0x29]: Subtitle: dvd_subtitle Stream #0:6[0x28]: Subtitle: dvd_subtitle Stream #0:7[0x27]: Subtitle: dvd_subtitle Stream #0:8[0x26]: Subtitle: dvd_subtitle Stream #0:9[0x25]: Subtitle: dvd_subtitle Stream #0:10[0x24]: Subtitle: dvd_subtitle Stream #0:11[0x23]: Subtitle: dvd_subtitle Stream #0:12[0x22]: Subtitle: dvd_subtitle Stream #0:13[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s Output #0, segment, to 'output-%08d.nut': Metadata: encoder : Lavf55.22.100 Stream #0:0: Video: mpeg2video, yuv420p, 720x576 [SAR 64:45 DAR 16:9], q=2-31, max. 7500 kb/s, 25 fps, 90k tbn, 25 tbc Stream #0:1: Audio: ac3, 48000 Hz, stereo, 192 kb/s Stream mapping: Stream #0:1 -> #0:0 (copy) Stream #0:13 -> #0:1 (copy) Press [q] to stop, [?] for help [segment @ 0x9703540] Non-monotonous DTS in output stream 0:0; previous: -3600, current: -3600; changing to -3599. This may result in incorrect timestamps in the output file. Assertion nus->keyframe_pts[k] > last_pts failed at libavformat/nutenc.c:598 Aborted
by , 11 years ago
Attachment: | new_bad.vob added |
---|
comment:15 by , 11 years ago
Keywords: | regression added |
---|---|
Reproduced by developer: | set |
Status: | new → open |
comment:17 by , 11 years ago
Replying to ob:
$ ~/git/ffmpeg/ffmpeg -i VTS_01_1.VOB -map 0:1 -codec copy -f segment output/output-1-%08d.nut ... [nut @ 0x9a05820] Negative pts not supported stream 0, pts -9223372036854775808 av_interleaved_write_frame(): Invalid argument
You might be able to fix this with -fflags +genpts
comment:18 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | open → closed |
The assertion failure was fixed by Michael in de2a2caf
Full Report