Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm used to record non-HD TV-shows, use DGIndex to convert the resulting ts-file and continue to remove commercials, transcode to mp4, ...

Now I recorded a TV-show in 1080p. Since DGIndex doesn't work on those and DGAVCIndex's DLL DGAVCDecode.dll causes lots of blocks I need to find a new way to do things. What I'm curious about is how DGIndex/DGAVCIndex detect the audio delay. I thought that ffmpeg is more sophisticated and it shouldn't be a problem to see it there, but I can't.

Here's the output of ffmpeg:

V:\>ffmpeg -i "20130327 0108.ts"
ffmpeg version N-50911-g9efcfbe Copyright (c) 2000-2013 the FFmpeg developers
  built on Mar 13 2013 21:26:48 with gcc 4.7.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      52. 19.100 / 52. 19.100
  libavcodec     55.  0.100 / 55.  0.100
  libavformat    55.  0.100 / 55.  0.100
  libavdevice    54.  4.100 / 54.  4.100
  libavfilter     3. 45.103 /  3. 45.103
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
[h264 @ 0255cfe0] non-existing PPS referenced
[h264 @ 0255cfe0] non-existing PPS 0 referenced
[h264 @ 0255cfe0] decode_slice_header error
[h264 @ 0255cfe0] no frame!
[h264 @ 0255cfe0] non-existing PPS referenced
[h264 @ 0255cfe0] non-existing PPS 0 referenced
[h264 @ 0255cfe0] decode_slice_header error
[h264 @ 0255cfe0] no frame!
[h264 @ 0255cfe0] non-existing PPS referenced
[h264 @ 0255cfe0] non-existing PPS 0 referenced
[h264 @ 0255cfe0] decode_slice_header error
[h264 @ 0255cfe0] no frame!
[h264 @ 0255cfe0] non-existing PPS referenced
[h264 @ 0255cfe0] non-existing PPS 0 referenced
[h264 @ 0255cfe0] decode_slice_header error
[h264 @ 0255cfe0] no frame!
[h264 @ 0255cfe0] non-existing PPS referenced
[h264 @ 0255cfe0] non-existing PPS 0 referenced
[h264 @ 0255cfe0] decode_slice_header error
[h264 @ 0255cfe0] no frame!
[h264 @ 0255cfe0] non-existing PPS referenced
[h264 @ 0255cfe0] non-existing PPS 0 referenced
[h264 @ 0255cfe0] decode_slice_header error
[h264 @ 0255cfe0] no frame!
[h264 @ 0255cfe0] non-existing PPS referenced
[h264 @ 0255cfe0] non-existing PPS 0 referenced
[h264 @ 0255cfe0] decode_slice_header error
[h264 @ 0255cfe0] no frame!
[h264 @ 0255cfe0] non-existing PPS referenced
[h264 @ 0255cfe0] non-existing PPS 0 referenced
[h264 @ 0255cfe0] decode_slice_header error
[h264 @ 0255cfe0] no frame!
[h264 @ 0255cfe0] non-existing PPS referenced
[h264 @ 0255cfe0] non-existing PPS 0 referenced
[h264 @ 0255cfe0] decode_slice_header error
[h264 @ 0255cfe0] no frame!
[h264 @ 0255cfe0] non-existing PPS referenced
[h264 @ 0255cfe0] non-existing PPS 0 referenced
[h264 @ 0255cfe0] decode_slice_header error
[h264 @ 0255cfe0] no frame!
[h264 @ 0255cfe0] non-existing PPS referenced
[h264 @ 0255cfe0] non-existing PPS 0 referenced
[h264 @ 0255cfe0] decode_slice_header error
[h264 @ 0255cfe0] no frame!
[h264 @ 0255cfe0] non-existing PPS referenced
[h264 @ 0255cfe0] non-existing PPS 0 referenced
[h264 @ 0255cfe0] decode_slice_header error
[h264 @ 0255cfe0] no frame!
[h264 @ 0255cfe0] non-existing PPS referenced
[h264 @ 0255cfe0] non-existing PPS 0 referenced
[h264 @ 0255cfe0] decode_slice_header error
[h264 @ 0255cfe0] no frame!
[h264 @ 0255cfe0] non-existing PPS referenced
[h264 @ 0255cfe0] non-existing PPS 0 referenced
[h264 @ 0255cfe0] decode_slice_header error
[h264 @ 0255cfe0] no frame!
[h264 @ 0255cfe0] non-existing PPS referenced
[h264 @ 0255cfe0] non-existing PPS 0 referenced
[h264 @ 0255cfe0] decode_slice_header error
[h264 @ 0255cfe0] no frame!
[h264 @ 0255cfe0] non-existing PPS referenced
[h264 @ 0255cfe0] non-existing PPS 0 referenced
[h264 @ 0255cfe0] decode_slice_header error
[h264 @ 0255cfe0] no frame!
[h264 @ 0255cfe0] non-existing PPS referenced
[h264 @ 0255cfe0] non-existing PPS 0 referenced
[h264 @ 0255cfe0] decode_slice_header error
[h264 @ 0255cfe0] no frame!
[h264 @ 0255cfe0] non-existing PPS referenced
[h264 @ 0255cfe0] non-existing PPS 0 referenced
[h264 @ 0255cfe0] decode_slice_header error
[h264 @ 0255cfe0] no frame!
[h264 @ 0255cfe0] mmco: unref short failure
    Last message repeated 5 times
[mpegts @ 025597e0] Stream #0: not enough frames to estimate rate; consider increasing probesize
[NULL @ 03f019a0] start time is not set in estimate_timings_from_pts
[mpegts @ 025597e0] PES packet size mismatch
    Last message repeated 2 times
Input #0, mpegts, from '20130327 0108.ts':
  Duration: 01:51:59.74, start: 12467.588567, bitrate: 9273 kb/s
  Program 105
  Program 106
    Stream #0:0[0x20](deu): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
    Stream #0:1[0x1ff]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 50 tbr, 90k tbn, 50 tbc
    Stream #0:2[0x203](deu): Audio: ac3 ([6][0][0][0] / 0x0006), 48000 Hz, stereo, fltp, 384 kb/s (clean effects)
    Stream #0:3[0x204](eng): Audio: ac3 ([6][0][0][0] / 0x0006), 48000 Hz, stereo, fltp, 384 kb/s (clean effects)
  Program 107
  Program 108
  Program 242
  Program 3997
  Program 3998
  Program 4017
  Program 4028
  Program 4035
At least one output file must be specified

V:\>

Note: despite the h264-lines the video plays fine.

After throwing VirtualDub's frame serving, AviSynth and ffmpeg at the video my eyes and ears tell me that in the resulting file the audio is off by roughly -350ms according to VLC. In other words I thought I could find something in ffmpeg's output that would lead me to those 350ms.

I also used ffmpeg's switch -debug_ts and get lines like:

demuxer -> ist_index:1 type:video next_dts:NOPTS next_dts_time:NOPTS next_pts:NOPTS next_pts_time:NOPTS pkt_pts:1122126141 pkt_pts_time:12468.1 pkt_dts:1122122541 pkt_dts_time:12468 off:-12467588567 off_time:-12467.6
demuxer+ffmpeg -> ist_index:1 type:video pkt_pts:42135 pkt_pts_time:0.468167 pkt_dts:38535 pkt_dts_time:0.428167 off:-12467600067 off_time:-12467.6
demuxer -> ist_index:1 type:video next_dts:448167 next_dts_time:0.448167 next_pts:0 next_pts_time:0 pkt_pts:1122127941 pkt_pts_time:12468.1 pkt_dts:1122124341 pkt_dts_time:12468 off:-12467600067 off_time:-12467.6
demuxer+ffmpeg -> ist_index:1 type:video pkt_pts:43935 pkt_pts_time:0.488167 pkt_dts:40335 pkt_dts_time:0.448167 off:-12467600067 off_time:-12467.6

With ffmpeg's -fdebug ts I get lines like:

first_dts 1122082971 not matching first dts 1122097371
first_dts 1122084006 not matching first dts 1122098406 
first_dts 1122082971 not matching first dts 1122111771
first_dts 1122084006 not matching first dts 1122112806
first_dts 1122082971 not matching first dts 1122126171
first_dts 1122084006 not matching first dts 1122127206

The only close number I could get is using the numbers from the first line of the above output:

1122097371 - 1122082971 = 14400
14400 / 48000 (the samplerate) = 0.3

But I have absolutely no idea what I'm doing there or if that is supposed to make sense... ;)

Does anyone have experience with this and can help me to calculate the delay?

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.