Opened 5 days ago

Last modified 2 days ago

#11192 new defect

Raw H264 stream has incorrect frame rate

Reported by: ariley Owned by:
Priority: important Component: avformat
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

ffmpeg incorrectly decides that the frame rate for the certain H264 streams is 25fps, rather than 29.97fps:

$ ./ffprobe regression_ba4b73c977.h264 
ffprobe version N-110262-gba4b73c977 Copyright (c) 2007-2023 the FFmpeg developers
  built with gcc 12 (Debian 12.2.0-14)
  configuration: --extra-cflags=-g --extra-cxxflags=-g --optflags=-O0
  libavutil      58.  6.100 / 58.  6.100
  libavcodec     60.  9.100 / 60.  9.100
  libavformat    60.  4.101 / 60.  4.101
  libavdevice    60.  2.100 / 60.  2.100
  libavfilter     9.  5.100 /  9.  5.100
  libswscale      7.  2.100 /  7.  2.100
  libswresample   4. 11.100 /  4. 11.100
[h264 @ 0x564e43afcdc0] Stream #0: not enough frames to estimate rate; consider increasing probesize
Input #0, h264, from 'regression_ba4b73c977.h264':
  Duration: N/A, bitrate: N/A
  Stream #0:0: Video: h264 (High 4:2:2), yuv422p10le(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 29.97 tbr, 1200k tbn

This is a regression -- prior to ba4b73c977, the FPS value was correctly detected as 29.97:

$ ./ffprobe incorrect_fps.h264 
ffprobe version N-110261-gd56652fdc8 Copyright (c) 2007-2023 the FFmpeg developers
  built with gcc 12 (Debian 12.2.0-14)
  configuration: --extra-cflags=-g --extra-cxxflags=-g --optflags=-O0
  libavutil      58.  6.100 / 58.  6.100
  libavcodec     60.  9.100 / 60.  9.100
  libavformat    60.  4.101 / 60.  4.101
  libavdevice    60.  2.100 / 60.  2.100
  libavfilter     9.  5.100 /  9.  5.100
  libswscale      7.  2.100 /  7.  2.100
  libswresample   4. 11.100 /  4. 11.100
[h264 @ 0x556699756dc0] Stream #0: not enough frames to estimate rate; consider increasing probesize
Input #0, h264, from 'regression_ba4b73c977.h264':
  Duration: N/A, bitrate: N/A
  Stream #0:0: Video: h264 (High 4:2:2), yuv422p10le(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 1200k tbn

Increasing the probe size does not help.

Change History (4)

comment:1 by Balling, 5 days ago

You did not test master. That has a bug that it recogizes all Annex B as 25 fps

comment:2 by ariley, 3 days ago

Not quite sure how you can make the assertion that I didn't test master?

$ git branch
* master
$ ./ffprobe regression_ba4b73c977.h264 
ffprobe version N-117011-gbb91425eb8 Copyright (c) 2007-2024 the FFmpeg developers
  built with gcc 12 (Debian 12.2.0-14)
  configuration: --extra-cflags=-g --extra-cxxflags=-g --optflags=-O0
  libavutil      59. 36.100 / 59. 36.100
  libavcodec     61. 13.100 / 61. 13.100
  libavformat    61.  5.101 / 61.  5.101
  libavdevice    61.  2.101 / 61.  2.101
  libavfilter    10.  2.102 / 10.  2.102
  libswscale      8.  2.100 /  8.  2.100
  libswresample   5.  2.100 /  5.  2.100
[h264 @ 0x555f4b2ef640] Stream #0: not enough frames to estimate rate; consider increasing probesize
Input #0, h264, from 'regression_ba4b73c977.h264':
  Duration: N/A, bitrate: N/A
  Stream #0:0: Video: h264 (High 4:2:2), yuv422p10le(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 59.94 tbr, 1200k tbn
$ git log --pretty=oneline | perl -pe'exit if (/ba4b73c977/)' | wc -l
6749

The results in my initial report are from doing a git-bisect on the master branch. It may be 6750 commits back in history, but I'm pretty sure I'm still on the master branch.

If this is a known bug, then I'm happy to have it closed as a duplicate, but I wasn't able to find any mention of it in trac -- perhaps I'm not using the correct search terms.

comment:3 by Balling, 3 days ago

#9814 there the bug is that the file is tagged 30/1.001 but the result is 30/1.000... Nowadays it is 25 fps, which is wrong.

Last edited 3 days ago by Balling (previous) (diff)

comment:4 by ariley, 2 days ago

Thanks. IMO, I think it's better to leave these as two distinct issues. #9814 is filed as a "wish" request for better precision in reporting the frame rate. The brokenness of ffmpeg suddenly returning 25fps for 29.97fps essence is orthogonal (but confounding) to the original request. This latter certainly needs fixing, and is (I suspect) likely to be overlooked if the only report of it is in the midst of comments on a wish list issue.

Note: See TracTickets for help on using tickets.