Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#1171 closed defect (wontfix)

h264 to VP8: "non monotonically increasing dts" with 2 pass and vp8flags altref

Reported by: temporary Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: webm libvpx
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

vopts="-c:v libvpx -vp8flags altref -rc_lookahead 5"
ffmpeg -pass 1 -i testv.mkv -f rawvideo $vopts -y /dev/null
ffmpeg -pass 2 -i testv.mkv $vopts -y testout.mkv
ffmpeg version git-2012-04-05-c99bdd5 Copyright (c) 2000-2012 the FFmpeg developers
  built on Apr  5 2012 17:19:33 with gcc 4.6.3
  configuration: --prefix=/usr --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-postproc --enable-x11grab --enable-shared
  libavutil      51. 44.100 / 51. 44.100
  libavcodec     54. 12.100 / 54. 12.100
  libavformat    54.  3.100 / 54.  3.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 66.101 /  2. 66.101
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 10.100 /  0. 10.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, matroska,webm, from 'testv.mkv':
  Metadata:
    AACAOT          : 2
    AUDIOCHANNELS   : 2
    AVCLEVEL        : 32
    AVCPROFILE      : 77
    MOOVPOSITION    : 28
    VIDEOFRAMERATE  : 25
    ENCODER         : Lavf54.3.100
  Duration: 00:00:01.04, start: 0.000000, bitrate: 2331 kb/s
    Stream #0:0: Video: h264 (Main), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1k fps, 25 tbr, 1k tbn, 50 tbc (default)
[buffer @ 0x2639d40] w:1280 h:720 pixfmt:yuv420p tb:1/1000000 sar:1/1 sws_param:flags=2
[libvpx @ 0x26403e0] v1.0.0
Output #0, rawvideo, to '/dev/null':
  Metadata:
    AACAOT          : 2
    AUDIOCHANNELS   : 2
    AVCLEVEL        : 32
    AVCPROFILE      : 77
    MOOVPOSITION    : 28
    VIDEOFRAMERATE  : 25
    encoder         : Lavf54.3.100
    Stream #0:0: Video: vp8, yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, pass 1, 200 kb/s, 90k tbn, 25 tbc (default)
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> libvpx)
Press [q] to stop, [?] for help
frame=   12 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=   0.0kbits/sframe=   26 fps= 20 q=0.0 Lsize=       0kB time=00:00:00.00 bitrate=   0.0kbits/s dup=1 drop=0    
video:0kB audio:0kB global headers:0kB muxing overhead -nan%
Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)
ffmpeg version git-2012-04-05-c99bdd5 Copyright (c) 2000-2012 the FFmpeg developers
  built on Apr  5 2012 17:19:33 with gcc 4.6.3
  configuration: --prefix=/usr --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-postproc --enable-x11grab --enable-shared
  libavutil      51. 44.100 / 51. 44.100
  libavcodec     54. 12.100 / 54. 12.100
  libavformat    54.  3.100 / 54.  3.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 66.101 /  2. 66.101
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 10.100 /  0. 10.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, matroska,webm, from 'testv.mkv':
  Metadata:
    AACAOT          : 2
    AUDIOCHANNELS   : 2
    AVCLEVEL        : 32
    AVCPROFILE      : 77
    MOOVPOSITION    : 28
    VIDEOFRAMERATE  : 25
    ENCODER         : Lavf54.3.100
  Duration: 00:00:01.04, start: 0.000000, bitrate: 2331 kb/s
    Stream #0:0: Video: h264 (Main), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1k fps, 25 tbr, 1k tbn, 50 tbc (default)
[buffer @ 0x1af4d40] w:1280 h:720 pixfmt:yuv420p tb:1/1000000 sar:1/1 sws_param:flags=2
[libvpx @ 0x1afb3e0] v1.0.0
Output #0, matroska, to 'testout.mkv':
  Metadata:
    AACAOT          : 2
    AUDIOCHANNELS   : 2
    AVCLEVEL        : 32
    AVCPROFILE      : 77
    MOOVPOSITION    : 28
    VIDEOFRAMERATE  : 25
    encoder         : Lavf54.3.100
    Stream #0:0: Video: vp8, yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, pass 2, 200 kb/s, 1k tbn, 25 tbc (default)
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> libvpx)
Press [q] to stop, [?] for help
[matroska @ 0x1afaca0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 80 >= 80
av_interleaved_write_frame(): Invalid argument

I get no error in 1 pass mode, when I remove "-vp8flags altref", or with "-rc_lookahead" < 5.

The source file was in flv format and was converted to mkv with ffmpeg (a simple copy), but the error also happens with the source flv.

Attachments (1)

testv.mkv (295.9 KB ) - added by temporary 12 years ago.

Download all attachments as: .zip

Change History (7)

by temporary, 12 years ago

Attachment: testv.mkv added

comment:1 by temporary, 12 years ago

I forgot: this is with libvpx 1.0.0

comment:2 by reimar, 12 years ago

Despite several people (including me) pointing out the issues, VP8 went with this idiotic design for altref.
This means that you can't really mux stuff encoded with altref in any other format that webm without creating invalid files.
So either
1) do not use altref
2) use webm as container

comment:3 by temporary, 12 years ago

Thanks reimar but I haven’t been able to find any explanation about this invalid mkv files problem on the web. I thought webm was supposed to be a subset of mkv? Also I have already encoded such a file and it was playable by VLC and mplayer.

However I can confirm that changing “testout.mkv” into “testout.webm” does remove the error!

Last edited 12 years ago by temporary (previous) (diff)

comment:4 by Carl Eugen Hoyos, 12 years ago

Keywords: webm libvpx added
Resolution: wontfix
Status: newclosed

Afaiu, this is not a bug in FFmpeg, if somebody disagrees, please reopen the ticket.

comment:5 by temporary, 12 years ago

Shouldn’t ffmpeg at least provide a more understandable error message, such as “altref requires webm output format (and 2 pass)”?

comment:6 by reimar, 12 years ago

First about matroska: it is possible altref is supported in that too, but if so it is a rather new feature and might break things on older players.
Worse, at least so far it is not possible to enable that feature only for VP8, so that might lead to silently creating broken files.
A better error message would be nice, but I do not know how to reliably detect that situation, the error message can be caused by altref but it can be an FFmpeg bug just as well.

Note: See TracTickets for help on using tickets.