mltframework / mlt

MLT Multimedia Framework
https://www.mltframework.org
GNU Lesser General Public License v2.1
1.47k stars 313 forks source link

Seeking DVB-S2 recording backwards frame-by-frame displays wrong frames #154

Open 7Z0t99 opened 7 years ago

7Z0t99 commented 7 years ago

I've got various DVB-S2 recordings (H.264, 720p50) which I wanted to cut in kdenlive but there is one issue with the seeking (KDE Bug 361966). Since melt shows the same behavior, we suspect it's either a melt or ffmpeg issue.

Seeking forward frame-by-frame is fine, but seeking backward frame-by-frame often shows the same picture for several frames and then skips a few and also prints "co located POCs unavailable". My initial guess is that the rendering is messed up for non-I(DR) frames when seeking backwards, because when I convert the recording into H.264 with keyint=1 in advance, everything works perfectly.

I'm running melt 6.4.1 on debian stretch.

walterav1984 commented 7 years ago

I'm having the same reverse playback frame jump issue using native DVB-S "transportstreams" with H264, 720p50,mp2&ac3 audio and dvb_teletext&subtitle streams using todays gitbuild melt version.

Running 'ffprobe' shows the contents of the TS.

ffprobe daheim-unterwegs-WDR-HD-Koln.ts
ffprobe version 2.8.10-0ubuntu0.16.04.1 Copyright (c) 2007-2016 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
  configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
[h264 @ 0x17f5760] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x17f5760] decode_slice_header error
[h264 @ 0x17f5760] no frame!
[NULL @ 0x17f9180] start time for stream 5 is not set in estimate_timings_from_pts
[mpegts @ 0x17f1440] PES packet size mismatch
    Last message repeated 3 times
Input #0, mpegts, from 'daheim-+-unterwegs-WDR-HD-Koln.ts':
  Duration: 00:05:49.20, start: 33102.559989, bitrate: 7858 kb/s
  Program 28325 
    Metadata:
      service_name    : ?WDR HD K�ln
      service_provider: ARD
    Stream #0:0[0x157d]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 100 tbc
    Stream #0:1[0x157e](deu): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s
    Stream #0:2[0x157f](mis): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s
    Stream #0:3[0x1580](deu): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006), 492x250
    Stream #0:4[0x1582](deu): Audio: ac3 ([6][0][0][0] / 0x0006), 48000 Hz, stereo, fltp, 448 kb/s
    Stream #0:5[0x1581](deu): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006) (hearing impaired)

However remuxing the video and audio stream with "ffmpeg" to matroska "mkv" container instead of "mpegts" fixes reverse playback frame jump for me! :+1:

ffmpeg -i daheim-unterwegs-WDR-HD-Koln.ts -map 0:0 -c:v copy -map 0:1 -c:a copy -f matroska daheim.mkv

When remuxing to a "mpegts" in ffmpeg with or without dvb_teletext/subtitle or extra audio channels will lead to a transportstream expressing the reverse playback frame jump stutter again!

This might be is not fixed with a newer ffmpeg version but I don't know yet how to build melt with latest ffmpeg instead of ubuntu repo one... tested using the buildscript from:

https://raw.githubusercontent.com/mltframework/mlt-scripts/master/build/build-melt.sh