[FFmpeg-user] h264_mmal decoder doesn't detect correct frame rate

Simon Brown simon.k.brown at gmail.com
Fri Nov 15 16:21:34 EET 2019


I have a transport stream arriving at my Raspberry Pi 4, and the h264_mmal
decoder picks it up and decodes it, however although I'm sending
1280x720p50 to it, the decoder reports that it's getting 1280x720p23.98,

ffmpeg -i udp://127.0.0.1:10020 -codec copy -f mpegts output.avi

ffmpeg version N-95725-g45f03cdd20 Copyright (c) 2000-2019 the FFmpeg
developers
  built with gcc 8 (Raspbian 8.3.0-6+rpi1)
  configuration: --prefix=/usr --arch=armel --target-os=linux --enable-gpl
--enable-omx --enable-omx-rpi --enable-nonfree --enable-mmal
--enable-decoder=h264_mmal --disable-decoder=h264 --enable-shared
  WARNING: library configuration mismatch
  postproc    configuration: --arch=armel --target-os=linux --enable-gpl
--enable-mmal --enable-omx --enable-omx-rpi --enable-nonfree
--enable-decoder=h264_mmal --enable-encoder=h264_omx --enable-libx265
--enable-shared
  libavutil      56. 35.101 / 56. 35.101
  libavcodec     58. 62.100 / 58. 62.100
  libavformat    58. 35.100 / 58. 35.100
  libavdevice    58.  9.100 / 58.  9.100
  libavfilter     7. 66.100 /  7. 66.100
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
[h264_mmal @ 0x1100e30] non-existing PPS 0 referenced
    Last message repeated 42 times
[h264_mmal @ 0x1100e30] Changing output format.
Input #0, mpegts, from 'udp://127.0.0.1:10020':
  Duration: N/A, start: 80175.851422, bitrate: N/A
  Program 1
    Stream #0:0[0x1100]: Video: h264 (Main) ([27][0][0][0] / 0x001B),
yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], 23.98 fps, 50 tbr, 90k
tbn, 23.98 tbc
    Stream #0:1[0x1110]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000
Hz, stereo, fltp, 192 kb/s
Output #0, mpegts, to 'output.avi':
  Metadata:
    encoder         : Lavf58.35.100
    Stream #0:0: Video: h264 (Main) ([27][0][0][0] / 0x001B),
yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 23.98 fps, 50
tbr, 90k tbn, 90k tbc
    Stream #0:1: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz,
stereo, fltp, 192 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=   99 fps=0.0 q=-1.0 size=     256kB time=00:00:02.85 bitrate=
733.6kbits/
frame=  125 fps=123 q=-1.0 size=     256kB time=00:00:03.37 bitrate=
622.2kbits/
frame=  150 fps= 98 q=-1.0 size=     256kB time=00:00:03.88 bitrate=
540.1kbits/
frame=  176 fps= 86 q=-1.0 size=     256kB time=00:00:04.39 bitrate=
477.2kbits/
frame=  202 fps= 79 q=-1.0 size=     256kB time=00:00:04.90 bitrate=
427.4kbits/
frame=  227 fps= 74 q=-1.0 size=     512kB time=00:00:05.41 bitrate=
774.0kbits/
frame=  253 fps= 71 q=-1.0 size=     512kB time=00:00:05.93 bitrate=
707.2kbits/
frame=  278 fps= 68 q=-1.0 size=     512kB time=00:00:06.44 bitrate=
651.0kbits/
frame=  304 fps= 66 q=-1.0 size=     512kB time=00:00:06.95 bitrate=
603.1kbits/
frame=  329 fps= 64 q=-1.0 size=     768kB time=00:00:07.46 bitrate=
842.6kbits/
frame=  354 fps= 63 q=-1.0 size=     768kB time=00:00:07.95 bitrate=
790.6kbits/
frame=  380 fps= 62 q=-1.0 size=     768kB time=00:00:08.46 bitrate=
742.8kbits/
frame=  405 fps= 61 q=-1.0 size=     768kB time=00:00:08.98 bitrate=
700.5kbits/
frame=  431 fps= 60 q=-1.0 size=     768kB time=00:00:09.47 bitrate=
663.8kbits/
frame=  455 fps= 60 q=-1.0 size=    1024kB time=00:00:09.98 bitrate=
840.2kbits/
frame=  481 fps= 59 q=-1.0 size=    1024kB time=00:00:10.49 bitrate=
799.2kbits/
frame=  506 fps= 59 q=-1.0 size=    1024kB time=00:00:11.00 bitrate=
762.0kbits/
frame=  531 fps= 58 q=-1.0 size=    1024kB time=00:00:11.49 bitrate=
729.5kbits/
frame=  557 fps= 58 q=-1.0 size=    1280kB time=00:00:12.01 bitrate=
873.0kbits/
frame=  567 fps= 57 q=-1.0 Lsize=    1319kB time=00:00:12.20 bitrate=
885.8kbits/s speed=1.24x
video:887kB audio:286kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 12.458385%

If I play the file with VLC it reports (as does every other tool) that the
frame rate is 1280x720 50fps.

Is there a way of forcing h264_mmal to pick up the frame rate correctly?

Regards,
Simon


More information about the ffmpeg-user mailing list