Opened 5 years ago

Closed 5 years ago

#2530 closed defect (needs_more_info)

Seeking in transport stream spams decoder error messages

Reported by: gjdfgh Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords: mpegts h264
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

Seeking in a transport stream (taken from a bluray) causes the h264 decoder to spam error messages.

How to reproduce:

Download the x264 demo disk http://x264.nl/x264_Demo_Blu-ray.torrent
Mount the iso, mount x264\ Blu-ray.iso /mnt/temp should be enough.
Run ffplay on one of the m2ts files, and seek in the file.
Example:

% ffplay /mnt/temp/BDMV/STREAM/00000.m2ts 
ffplay version 1.0.6 Copyright (c) 2003-2013 the FFmpeg developers
  built on Mar 25 2013 16:52:47 with gcc 4.7 (Debian 4.7.2-5)
  configuration: --prefix=/usr --extra-cflags='-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security ' --extra-ldflags='-Wl,-z,relro' --cc='ccache cc' --enable-shared --enable-libmp3lame --enable-gpl --enable-nonfree --enable-libvorbis --enable-pthreads --enable-libfaac --enable-libxvid --enable-postproc --enable-x11grab --enable-libgsm --enable-libtheora --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libspeex --enable-nonfree --disable-stripping --enable-libvpx --enable-libschroedinger --disable-encoder=libschroedinger --enable-version3 --enable-libopenjpeg --enable-librtmp --enable-avfilter --enable-libfreetype --enable-libvo-aacenc --disable-decoder=amrnb --enable-libvo-amrwbenc --enable-libaacplus --libdir=/usr/lib/i386-linux-gnu --disable-vda --enable-libbluray --enable-libcdio --enable-gnutls --enable-frei0r --enable-openssl --enable-libass --enable-libopus --enable-fontconfig --enable-libdc1394 --enable-libfdk-aac --disable-altivec --disab  libavutil      51. 73.101 / 51. 73.101
  libavcodec     54. 59.100 / 54. 59.100
  libavformat    54. 29.104 / 54. 29.104
  libavdevice    54.  2.101 / 54.  2.101
  libavfilter     3. 17.100 /  3. 17.100
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, mpegts, from '/mnt/temp/BDMV/STREAM/00000.m2ts':
  Duration: 00:05:43.90, start: 599.966656, bitrate: 14462 kb/s
  Program 1 
    Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 59.94 fps, 59.94 tbr, 90k tbn, 119.88 tbc
    Stream #0:1[0x1100]: Audio: dts (DTS-HD MA) ([134][0][0][0] / 0x0086), 48000 Hz, 5.1(side), s16, 1536 kb/s
Frame changed from size:0x0 to size:1280x720KB vq=    0KB sq=    0B f=0/0   
[dca @ 0x80e6540] Not a valid DCA framevq=    0KB sq=    0B f=0/0   f=0/0   
[h264 @ 0x80e57a0] Missing reference picture, default is 0
[h264 @ 0x80e57a0] decode_slice_header error
[h264 @ 0x80e57a0] Missing reference picture, default is 0
[h264 @ 0x80e57a0] decode_slice_header error
[h264 @ 0x80e57a0] Missing reference picture, default is 0
[h264 @ 0x80e57a0] decode_slice_header error
[h264 @ 0x80e57a0] Missing reference picture, default is 0
[h264 @ 0x80e57a0] decode_slice_header error
[h264 @ 0x80e9d20] Missing reference picture, default is 65684
    Last message repeated 2 times
[h264 @ 0x80ea0e0] reference picture missing during reorder
    Last message repeated 3 times
[h264 @ 0x80ea0e0] Missing reference picture, default is 65684
    Last message repeated 3 times
[h264 @ 0x80e57a0] Missing reference picture, default is 65692
    Last message repeated 2 times
[h264 @ 0x80ea0e0] reference picture missing during reorder
    Last message repeated 3 times
[h264 @ 0x80ea0e0] Missing reference picture, default is 65684
    Last message repeated 3 times
[h264 @ 0x80e57a0] Missing reference picture, default is 65692
    Last message repeated 2 times
[h264 @ 0x80ea0e0] reference picture missing during reorder
    Last message repeated 3 times
[h264 @ 0x80ea0e0] Missing reference picture, default is 65684
[h264 @ 0x80ea0e0] Missing reference picture, default is 65684
[h264 @ 0x80e9d20] Missing reference picture, default is 65684
    Last message repeated 2 times
[h264 @ 0x80e9d20] Missing reference picture, default is 65684
    Last message repeated 1 times  8KB vq=    0KB sq=    0B f=0/0   
[h264 @ 0x80e57a0] Missing reference picture, default is 65692
    Last message repeated 2 times
[h264 @ 0x80e9d20] Missing reference picture, default is 65684
    Last message repeated 5 times
[h264 @ 0x80ea0e0] reference picture missing during reorder
...

I cut the ffplay output at a random point. At least in this case, decoding quickly resumes and you never see a broken picture. But it looks suspicious anyway. Normal decoding (without doing any seeking) never prints error messages in this case.

Change History (13)

comment:1 Changed 5 years ago by cehoyos

  • Component changed from avformat to undetermined
  • Keywords mpegts h264 added

To the best of my knowledge, you describe the expected behaviour: Why do you think there is a bug?

In any case: Please test current git head and clarify if the issue is reproducible with ffmpeg (the application) to make this a valid ticket.

comment:2 follow-up: Changed 5 years ago by gjdfgh

To the best of my knowledge, you describe the expected behaviour: Why do you think there is a bug?

How are tons of error messages "expected behavior"? It feels like it should be silent as long as no bug is hit and the TS is not broken.

Please test current git head

Broken as well with git from 5 days ago.

clarify if the issue is reproducible with ffmpeg (the application) to make this a valid ticket.

I don't know how to seek with ffmpeg. And how is ffplay not enough?

But I tested with mplayer (svn from a few days ago). With -demuxer lavf it's even worse (shows gray garbage right after seek), with the default demuxer it works perfectly fine and no error messages are shown.

comment:3 in reply to: ↑ 2 ; follow-up: Changed 5 years ago by cehoyos

Replying to gjdfgh:

To the best of my knowledge, you describe the expected behaviour: Why do you think there is a bug?

How are tons of error messages "expected behavior"?

libavformat seeks to the intended position and libavcodec drops the frames until the next recovery point.

It feels like it should be silent as long as no bug is hit and the TS is not broken.

If you don't like the warnings, turn them off. (honestly!)

Please test current git head

Broken as well with git from 5 days ago.

clarify if the issue is reproducible with ffmpeg (the application) to make this a valid ticket.

I don't know how to seek with ffmpeg.

$ ffmpeg -ss x -i input

And how is ffplay not enough?

It depends on an external library (that is known to be buggy) and it is generally much harder to reproduce issues with ffplay than ffmpeg.

But I tested with mplayer (svn from a few days ago). With -demuxer lavf it's even worse (shows gray garbage right after seek)

Use $ mplayer -demuxer lavf -lavdopts wait_keyframe to get the same behaviour as FFmpeg. (Reimar prefers the MPlayer behaviour which you can get with FFmpeg using -flags2 showall.)

with the default demuxer it works perfectly fine and no error messages are shown.

I wonder if the MPlayer demuxer also works if the stream does not contain I-frames...
(I never tested.)

comment:4 in reply to: ↑ 3 ; follow-up: Changed 5 years ago by gjdfgh

Replying to cehoyos:

libavformat seeks to the intended position and libavcodec drops the frames until the next recovery point.

And it spams errors like mad.

It feels like it should be silent as long as no bug is hit and the TS is not broken.

If you don't like the warnings, turn them off. (honestly!)

They are errors (AV_LOG_ERROR), not warnings. Are you seriously asking users to filter out error messages to paint over a symptom of a possible problem in ffmpeg? And all that with the risk that users would filter out errors due to unrelated important issues too? Am I here really on the ffmpeg bug tracker... I mean, the purpose of a bug tracker is to report and analyze bugs in ffmpeg, isn't it? Filtering warnings by text can't really be the correct way of using ffmpeg as library either.

Besides, the fact that mplayer's internal ts demuxer is much faster at seeking is what is actually important to me. As I already said, it doesn't cause the decoder to vomit all over the place as well. This makes me think that there's definitely something wrong with the libavformat demuxer. I don't know what would cause the perceived speed issue, and I don't know how to prove that it exists, so the error messages are all what I have. In any case, user experience is much better with the mplayer demuxer. And this stuff does matter, because it happens when doing playback via libbluray too.

$ ffmpeg -ss x -i input

Exactly the same result.

And how is ffplay not enough?

It depends on an external library (that is known to be buggy) and it is generally much harder to reproduce issues with ffplay than ffmpeg.

$ ldd which ffmpeg|wc -l
100

....................

But I tested with mplayer (svn from a few days ago). With -demuxer lavf it's even worse (shows gray garbage right after seek)

Use $ mplayer -demuxer lavf -lavdopts wait_keyframe to get the same behaviour as FFmpeg. (Reimar prefers the MPlayer behaviour which you can get with FFmpeg using -flags2 showall.)

Output corruption goes away, error messages and slowness stay.

comment:5 in reply to: ↑ 4 Changed 5 years ago by cehoyos

Replying to gjdfgh:

$ ffmpeg -ss x -i input

Exactly the same result.

Then please provide a reproducible test case with ffmpeg.

comment:6 Changed 5 years ago by gjdfgh

I already did. Or are you unable to reproduce?

comment:7 Changed 5 years ago by cehoyos

I am unable to find it.

comment:8 follow-up: Changed 5 years ago by gjdfgh

Here is it again: http://x264.nl/x264_Demo_Blu-ray.torrent

Let me stress that even though torrents of multimedia tend to be shady, this is 100% legal. You can read about it here: http://x264dev.multimedia.cx/archives/328

I could understand if you complained that the sample is too big, but this is just... whatever.

comment:9 Changed 5 years ago by cehoyos

To make this a valid ticket, please provide the failing (slow, spamming) ffmpeg command line together with the complete, uncut console output.

comment:10 in reply to: ↑ 8 Changed 5 years ago by cehoyos

Replying to gjdfgh:

Let me stress that even though torrents of multimedia tend to be shady, this is 100% legal.

Unrelated: Do you have the impression that FFmpeg developers only work on issues that are reported against "legal" (whatever that word means in this context) samples?
(Actually: Yes, we would certainly immediately delete all reference to an actually illegal sample but I do not remember that such a sample was ever provided nor did I want to imply that I assume x264 torrents could be illegal.)

comment:11 follow-up: Changed 5 years ago by gjdfgh

No, I could only assume that the fact that it's a torrent link was causing an issue.

$ ffmpeg -ss 10 -i /mnt/temp/BDMV/STREAM/00000.m2ts out.avi
ffmpeg version 1.0.6 Copyright (c) 2000-2013 the FFmpeg developers
  built on Mar 25 2013 16:52:47 with gcc 4.7 (Debian 4.7.2-5)
  configuration: --prefix=/usr --extra-cflags='-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security ' --extra-ldflags='-Wl,-z,relro' --cc='ccache cc' --enable-shared --enable-libmp3lame --enable-gpl --enable-nonfree --enable-libvorbis --enable-pthreads --enable-libfaac --enable-libxvid --enable-postproc --enable-x11grab --enable-libgsm --enable-libtheora --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libspeex --enable-nonfree --disable-stripping --enable-libvpx --enable-libschroedinger --disable-encoder=libschroedinger --enable-version3 --enable-libopenjpeg --enable-librtmp --enable-avfilter --enable-libfreetype --enable-libvo-aacenc --disable-decoder=amrnb --enable-libvo-amrwbenc --enable-libaacplus --libdir=/usr/lib/i386-linux-gnu --disable-vda --enable-libbluray --enable-libcdio --enable-gnutls --enable-frei0r --enable-openssl --enable-libass --enable-libopus --enable-fontconfig --enable-libdc1394 --enable-libfdk-aac --disable-altivec --disab  libavutil      51. 73.101 / 51. 73.101
  libavcodec     54. 59.100 / 54. 59.100
  libavformat    54. 29.104 / 54. 29.104
  libavdevice    54.  2.101 / 54.  2.101
  libavfilter     3. 17.100 /  3. 17.100
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, mpegts, from '/mnt/temp/BDMV/STREAM/00000.m2ts':
  Duration: 00:05:43.90, start: 599.966656, bitrate: 14462 kb/s
  Program 1 
    Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 59.94 fps, 59.94 tbr, 90k tbn, 119.88 tbc
    Stream #0:1[0x1100]: Audio: dts (DTS-HD MA) ([134][0][0][0] / 0x0086), 48000 Hz, 5.1(side), s16, 1536 kb/s
Output #0, avi, to 'out.avi':
  Metadata:
    ISFT            : Lavf54.29.104
    Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 59.94 tbn, 59.94 tbc
    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, s16
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> mpeg4)
  Stream #0:1 -> #0:1 (dca -> libmp3lame)
Press [q] to stop, [?] for help
[dca @ 0x8090bc0] Not a valid DCA frame
Error while decoding stream #0:1: Invalid data found when processing input
[h264 @ 0x8353820] reference picture missing during reorder
    Last message repeated 3 times
[h264 @ 0x8353820] Missing reference picture, default is 0
[h264 @ 0x8353820] decode_slice_header error
[h264 @ 0x8353820] reference picture missing during reorder
    Last message repeated 3 times
[h264 @ 0x8353820] Missing reference picture, default is 0
[h264 @ 0x8353820] decode_slice_header error
[h264 @ 0x8353820] reference picture missing during reorder
    Last message repeated 3 times
[h264 @ 0x8353820] Missing reference picture, default is 0
[h264 @ 0x8353820] decode_slice_header error
[h264 @ 0x8353820] reference picture missing during reorder
    Last message repeated 3 times
[h264 @ 0x8353820] Missing reference picture, default is 0
[h264 @ 0x8353820] decode_slice_header error
[h264 @ 0x83983e0] Missing reference picture, default is 65574
    Last message repeated 5 times
[h264 @ 0x83f69a0] mmco: unref short failure
[h264 @ 0x83983e0] Missing reference picture, default is 65574
    Last message repeated 2 times
[h264 @ 0x83f69a0] Missing reference picture, default is 65572
[h264 @ 0x83983e0] Missing reference picture, default is 65574
    Last message repeated 2 times
[h264 @ 0x83f69a0] Missing reference picture, default is 65572
    Last message repeated 2 times
[h264 @ 0x8353820] reference picture missing during reorder
    Last message repeated 2 times
[h264 @ 0x8353820] Missing reference picture, default is 65572
    Last message repeated 2 times
[h264 @ 0x83983e0] Missing reference picture, default is 65576
    Last message repeated 2 times
[h264 @ 0x83f69a0] mmco: unref short failure
[h264 @ 0x8353820] reference picture missing during reorder
    Last message repeated 2 times
[h264 @ 0x8353820] Missing reference picture, default is 65572
    Last message repeated 2 times
[h264 @ 0x83983e0] Missing reference picture, default is 65576
    Last message repeated 2 times
[h264 @ 0x8353820] reference picture missing during reorder
    Last message repeated 2 times
[h264 @ 0x8353820] Missing reference picture, default is 65572
    Last message repeated 2 times
[h264 @ 0x83f69a0] Missing reference picture, default is 65576
    Last message repeated 1 times
[h264 @ 0x83983e0] Missing reference picture, default is 65576
    Last message repeated 2 times
[h264 @ 0x8353820] reference picture missing during reorder
    Last message repeated 2 times
[h264 @ 0x8353820] Missing reference picture, default is 65572
    Last message repeated 2 times
[h264 @ 0x83983e0] Missing reference picture, default is 65576
    Last message repeated 2 times
[h264 @ 0x83f69a0] Missing reference picture, default is 65576
[h264 @ 0x8353820] mmco: unref short failure
[h264 @ 0x83f69a0] Missing reference picture, default is 65576
[h264 @ 0x83983e0] reference picture missing during reorder
[h264 @ 0x83983e0] Missing reference picture, default is 65580
[h264 @ 0x83f69a0] Missing reference picture, default is 65584
[h264 @ 0x83983e0] reference picture missing during reorder
[h264 @ 0x83983e0] Missing reference picture, default is 65580
[h264 @ 0x83f69a0] Missing reference picture, default is 65584
[h264 @ 0x83983e0] reference picture missing during reorder
[h264 @ 0x83983e0] Missing reference picture, default is 65580
[h264 @ 0x8353820] mmco: unref short failure
[h264 @ 0x83983e0] reference picture missing during reorder
[h264 @ 0x83983e0] Missing reference picture, default is 65580
[h264 @ 0x83f69a0] Missing reference picture, default is 65584
    Last message repeated 1 times
frame=    0 fps=0.0 q=0.0 size=      10kB time=00:00:00.62 bitrate= 128.1kbits/s    
frame=   23 fps= 23 q=31.0 size=      37kB time=00:00:02.13 bitrate= 143.2kbits/s    
frame=   63 fps= 41 q=31.0 size=     406kB time=00:00:02.80 bitrate=1185.6kbits/s    
frame=  105 fps= 52 q=31.0 size=     688kB time=00:00:03.50 bitrate=1609.0kbits/s    
frame=  144 fps= 57 q=31.0 size=    1010kB time=00:00:04.15 bitrate=1991.3kbits/s    
frame=  184 fps= 61 q=31.0 size=    1288kB time=00:00:04.82 bitrate=2188.2kbits/s    
frame=  225 fps= 64 q=31.0 size=    1631kB time=00:00:05.50 bitrate=2426.8kbits/s    
frame=  269 fps= 66 q=31.0 size=    1782kB time=00:00:06.23 bitrate=2339.3kbits/s    
frame=  311 fps= 68 q=31.0 size=    1948kB time=00:00:06.94 bitrate=2298.9kbits/s    
frame=  352 fps= 70 q=31.0 size=    2111kB time=00:00:07.62 bitrate=2268.4kbits/s    
frame=  393 fps= 71 q=31.0 size=    2252kB time=00:00:08.30 bitrate=2220.9kbits/s    
frame=  433 fps= 71 q=31.0 size=    2390kB time=00:00:08.97 bitrate=2181.8kbits/s    
frame=  461 fps= 72 q=31.0 Lsize=    2692kB time=00:00:09.44 bitrate=2335.8kbits/s    
video:2517kB audio:143kB subtitle:0 global headers:0kB muxing overhead 1.209477%
Received signal 2: terminating.

As you can see, this is virtually exactly the same as the ffplay output. Did you expect anything else?

comment:12 in reply to: ↑ 11 Changed 5 years ago by cehoyos

Replying to gjdfgh:

ffmpeg version 1.0.6 Copyright (c) 2000-2013 the FFmpeg developers

This is around seven months old, is the problem also reproducible with current git head?

comment:13 Changed 5 years ago by cehoyos

  • Resolution set to needs_more_info
  • Status changed from new to closed

Please reopen this ticket if it is reproducible with current git head and if you can provide command line and console output.

Note: See TracTickets for help on using tickets.