Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#11328 closed Bug Report - General (fixed)

HD-PVR recordings can have a long initial sequence with no keyframes, confusing ffmpeg

Reported by: mythwiki@… Owned by: jpoet
Priority: minor Milestone: 0.27
Component: MythTV - Recording Version: Master Head
Severity: low Keywords: hd-pvr, ffmpeg, scripts
Cc: Ticket locked: no

Description

I'm speculating a bit about the cause of the problem, but it seems likely to be due to a recording having a long time before the first keyframe is encountered. The HD-PVR issues a keyframe every 3 or 4 seconds. On some, but not all recordings, ffmpeg has difficulty reading the file. This manifests itself in two ways:

  • ffprobe returns nonsensical bitrates, causing it to believe that the recording is about 1/4 the true length, which leads to problems with scripts that use ffprobe to determine the total length of a recording
  • ffmpeg decides that the file doesn't contain pts values, so it makes up its own. However, when ffmpeg creates its own pts for output, it starts at a time of 1.0 seconds, rather than the 0.0 seconds that the HD-PVR produces in its pts values. For scripts that need precise control over time, this leads to an uncertainty of 1 second in the position of frames.

I suspect these problems would go away if the HD-PVR recording loop discarded frames before the first keyframe. I don't know if this is a practical solution, but it might be helpful to try.

Attachments (7)

bad-hdpvr-recording-initial-1MB.mpg (1.0 MB) - added by mythwiki@… 11 years ago.
First 1MB of a typical HD-PVR recording
H264-keep-first-keyframe.patch (3.8 KB) - added by jpoet 11 years ago.
First cut
keep-first-keyframe-v2.patch (8.3 KB) - added by jpoet 11 years ago.
This version will handle the first packet being audio instead of video.
keep-first-keyframe-v3.patch (18.8 KB) - added by jpoet 11 years ago.
Should work with back-to-back recordings without frame loss
keep-first-keyframe-v3-v0.25-fixes.patch (18.6 KB) - added by tralph 11 years ago.
v3 patch for 0.25-fixes.
keep-first-keyframe-v4.patch (36.5 KB) - added by jpoet 11 years ago.
Insert PAT/PMT at the front of each back-to-back recording
keep-first-keyframe-v4-v0.25.patch (36.8 KB) - added by jpoet 11 years ago.

Download all attachments as: .zip

Change History (24)

comment:1 Changed 11 years ago by danielk

Status: newinfoneeded_new

MPEGRecorder already discards all data before the first keyframe by default.

Can you describe the actual problem and steps to reproduce along with a short sample?

Changed 11 years ago by mythwiki@…

First 1MB of a typical HD-PVR recording

comment:2 Changed 11 years ago by mythwiki@…

I've attached the first 1MB of a typical HD-PVR recording, extracted with 'dd'. When ffprobe runs on this, or just about any HD-PVR recording, it produces output like this:

ffprobe version 1.0 Copyright (c) 2007-2012 the FFmpeg developers
  built on Oct 21 2012 22:33:24 with gcc 4.6.3 (GCC)
  configuration: --prefix=/usr --enable-nonfree --enable-gpl --enable-libtheora --enable-libvorbis --enable-libmp3lame --enable-libx264 --enable-avresample --enable-libfaac --enable-libfreetype --enable-libpulse --enable-libspeex
  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
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 15 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 15 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 15 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 15 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 15 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 15 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 15 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 15 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 15 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 15 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 15 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 15 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 15 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 15 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 15 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 15 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 15 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 15 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 15 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 15 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 15 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 15 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 15 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 15 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 15 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 15 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 15 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 15 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS referenced
[h264 @ 0x151e2c0] sps_id out of range
[h264 @ 0x151e2c0] non-existing SPS 32 referenced in buffering period
[h264 @ 0x151e2c0] non-existing PPS 0 referenced
[h264 @ 0x151e2c0] decode_slice_header error
[h264 @ 0x151e2c0] no frame!
[h264 @ 0x151e2c0] mmco: unref short failure
    Last message repeated 3 times
[mpegts @ 0x151a3e0] PES packet size mismatch
[mpegts @ 0x151a3e0] decoding for stream 0 failed
[mpegts @ 0x151a3e0] PES packet size mismatch
Input #0, mpegts, from 'bad-hdpvr-recording-initial-1MB.mpg':
  Duration: 00:00:02.07, start: 0.419044, bitrate: 4052 kb/s
  Program 1 
    Stream #0:0[0x1011]: Video: h264 (Main) (HDMV / 0x564D4448), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 117.82 fps, 59.94 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), s16, 384 kb/s

That initial error sequence is not present when run on transcoded H.264 recordings, or transport streams that I generate locally. It suggests to me that the file started in mid-frame.

comment:3 Changed 11 years ago by blm-ubunet@…

recordings from 0.24+fixes/0/25+fixes/0.26+fixes.. All my dvb-t recordings (H264) have beginning corrupt/missing to "next" keyframe. My recordings are set to start on SEQ. (All==every file checked so far) ffprobe reports there are NO "coded_picture_number" from 0 to about 24. I expect the "next" keyframe is about 25.

If I make a test file from recording (ffmpeg) I get "coded_picture_numbers" from zero..

comment:4 Changed 11 years ago by blm-ubunet@…

A recording from 2009 (dvb-t h264) has coded picture_number 0 (pict_type=I) but is missing coded_pict 1 to 7..

Later recordings are using B frames as ref frames. Recording from 2010 has coded_pict_num 1-3 missing. Later recordings have first coded_pict_num of value 24 but have 25-27 missing.. (ffprobe N-47402-g5e2be27 03-Dec 2012)

comment:5 Changed 11 years ago by jpoet

Owner: changed from danielk to jpoet
Status: infoneeded_newassigned

We wait for a keyframe before we start writing to the file. However for H.264 (at least) we do not discover that the current AU (frame) is a keyframe until several packets into the AU. We are supposed to buffer all the packets of the AU, but that is not working, so the file ends up missing the first part of the AU, rendering that keyframe as undecodable.

Changed 11 years ago by jpoet

First cut

comment:6 Changed 11 years ago by blm-ubunet@…

Applied patch to 0.26+fixes.. dvbsnoop reports 1 continuity counter error in first 500 packets & 2 errors in first 1500 packets. ffprobe now reports coded_pict_num 0, but 1-3 are still missing.

That's much better than previous.

The cutlist editor behaves better at recording start but can still get stuck at frame 1 & can't navigate away by frames or keyframes. Keyframe indexing appears to render a sequence of frames (GOP).

comment:7 Changed 11 years ago by blm-ubunet@…

The odd/incorrect keyframe navigation (group frames rendering) only occurs after attempting to navigate from frame 1 by frame increment & getting stuck: i.e.

  1. go frame 1
  2. set frame indexing/increment
  3. navigate ++frame until stuck
  4. set keyframe indexing/increment
  5. navigate +/- & observe..

Changed 11 years ago by jpoet

This version will handle the first packet being audio instead of video.

comment:8 Changed 11 years ago by jpoet

Added new patch that deals with audio packets showing up before video packets.

comment:9 Changed 11 years ago by jpoet

I am uploading a new version of the patch. I believe this one works well enough, that I am installing it on my production machine. If I don't discover any problems, I will likely commit it early next week.

Changed 11 years ago by jpoet

Should work with back-to-back recordings without frame loss

Changed 11 years ago by tralph

v3 patch for 0.25-fixes.

comment:10 Changed 11 years ago by jpoet

Attaching v4 of the patch. For back-to-back recordings, this one makes sure that each one starts with a PAT/PMT when appropriate.

Changed 11 years ago by jpoet

Insert PAT/PMT at the front of each back-to-back recording

Changed 11 years ago by jpoet

comment:11 Changed 11 years ago by mythwiki@…

I tried the v4-v0.25 patch. It doesn't seem to solve my issue. Running ffprobe on a generated file (5 minute recording) produces the following output. Note the incorrect duration and bitrate.

ffprobe /myth/tv1/2555_20130211203500.mpg
avprobe version 0.8.4-4:0.8.4-0ubuntu0.12.04.1, Copyright (c) 2007-2012 the Libav developers
  built on Nov  6 2012 16:51:33 with gcc 4.6.3
[mpegts @ 0x17367a0] Continuity check failed for pid 4113 expected 5 got 13
[mpegts @ 0x17367a0] Continuity check failed for pid 4352 expected 1 got 0
[mpegts @ 0x17367a0] Continuity check failed for pid 4113 expected 2 got 0
[mpegts @ 0x17367a0] Continuity check failed for pid 4352 expected 8 got 0
[mpegts @ 0x17367a0] Continuity check failed for pid 4113 expected 11 got 0
[mpegts @ 0x17367a0] Continuity check failed for pid 4352 expected 5 got 0
[mpegts @ 0x17367a0] Continuity check failed for pid 4113 expected 14 got 0
[mpegts @ 0x17367a0] Continuity check failed for pid 4352 expected 14 got 0
[mpegts @ 0x17367a0] Continuity check failed for pid 4113 expected 5 got 0
[mpegts @ 0x17367a0] Continuity check failed for pid 4352 expected 12 got 0
[mpegts @ 0x17367a0] Continuity check failed for pid 4113 expected 10 got 0
[mpegts @ 0x17367a0] Continuity check failed for pid 4352 expected 6 got 0
[mpegts @ 0x17367a0] Continuity check failed for pid 4113 expected 4 got 0
[mpegts @ 0x17367a0] Continuity check failed for pid 4352 expected 1 got 0
[mpegts @ 0x17367a0] Continuity check failed for pid 4113 expected 15 got 0
[mpegts @ 0x17367a0] Continuity check failed for pid 4352 expected 12 got 0
[mpegts @ 0x17367a0] Continuity check failed for pid 4113 expected 10 got 0
[mpegts @ 0x17367a0] Continuity check failed for pid 4352 expected 11 got 0
[mpegts @ 0x17367a0] PES packet size mismatch
[mpegts @ 0x17367a0] Continuity check failed for pid 4113 expected 11 got 0
Input #0, mpegts, from '/myth/tv1/2555_20130211203500.mpg':
  Duration: 00:00:00.76, start: 0.387044, bitrate: 246032 kb/s
  Program 1 
    Stream #0.0[0x1011]: Video: h264 (Main), yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 59.96 fps, 59.94 tbr, 90k tbn, 59.94 tbc
    Stream #0.1[0x1100]: Audio: ac3, 48000 Hz, 5.1, s16, 384 kb/s

I applied the patch and installed new versions only of libmythtv and mythbackend.

comment:12 Changed 11 years ago by mythwiki@…

Disregard comment #11, my HD-PVR glitched shortly after startup, which was likely the cause of the errors. I'll follow up with more testing soon.

comment:13 Changed 11 years ago by mythwiki@…

Applied the v4-v0.25 patch successfully against tag v0.25.2. The bug appears fixed for single and back-to-back recordings. ffprobe no longer complains about missing initial keyframes, duration and bitrates look correct.

comment:14 Changed 11 years ago by John Poet <jpoet@…>

Resolution: fixed
Status: assignedclosed

In efc1e46a8a2d913a8070483178ca46293f0a4423/mythtv:

Cleanup some useless "discontinuity detected" messages following 87a15e1ce

Closes #11328

comment:15 Changed 11 years ago by Raymond Wagner

Milestone: unknown0.27
Version: UnspecifiedMaster Head

comment:16 Changed 11 years ago by John Poet <jpoet@…>

In 3944ca9ad0f8df1a0240c5812e5b3b04431e7eac/mythtv:

Cleanup some useless "discontinuity detected" messages following 87a15e1ce

Closes #11328
(cherry picked from commit efc1e46a8a2d913a8070483178ca46293f0a4423)

comment:17 Changed 11 years ago by John Poet <jpoet@…>

In 5f5e5f70b16f3733764a70c4767c2d4ebdd3a915/mythtv:

Cleanup some useless "discontinuity detected" messages following 87a15e1ce

Closes #11328
(cherry picked from commit efc1e46a8a2d913a8070483178ca46293f0a4423)

Signed-off-by: Taylor Ralph <tralph@…>

Note: See TracTickets for help on using tickets.