[Libav-user] Live video decoding with h264_mmal decoder

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Libav-user] Live video decoding with h264_mmal decoder

Simon Brown
I am trying to decode a live h264 stream on a raspberry Pi.  I have built ffmpeg with the latest git head, and configured it to run the h264_mmal decoder.  However, if I feed it with a live stream at 1280x720p50 it says it's receiving 1280x720p23.98.  If I do the same with the standard h264 codec rather than the h264_mmal codec then it finds the frame rate correctly.  Is there anything in the mmal codec that would stop it finding the frame rate?

I know the example below is using ffmpeg, not the libav libraries, but the ultimate goal is to use the libav libraries, but running ffmpeg is just a quicker way of testing initially.

pi@raspberrypi:~/FFmpeg $ ffmpeg -c:v h264_mmal -i udp://@:10020 -c:a copy -f rawvideo 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 @ 0x1c6f690] non-existing PPS 0 referenced
    Last message repeated 24 times
[h264_mmal @ 0x1c6f690] Changing output format.
Input #0, mpegts, from 'udp://@:10020':
  Duration: N/A, start: 71908.828644, 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
File 'output.avi' already exists. Overwrite? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (h264_mmal) -> rawvideo (native))
Press [q] to stop, [?] for help
[h264_mmal @ 0x1c71610] Did not get output frame from MMAL.
Error while decoding stream #0:0: Unknown error occurred
[h264_mmal @ 0x1c71610] Did not get output frame from MMAL.
Error while decoding stream #0:0: Unknown error occurred
Output #0, rawvideo, to 'output.avi':
  Metadata:
    encoder         : Lavf58.35.100
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 552960 kb/s, 50 fps, 50 tbn, 50 tbc
    Metadata:
      encoder         : Lavc58.62.100 rawvideo
frame=   28 fps=0.0 q=-0.0 size=   37632kB time=00:00:00.56 bitrate=550502.4kbit
frame=   61 fps= 58 q=-0.0 size=   82176kB time=00:00:01.22 bitrate=551791.6kbitframe=   93 fps= 54 q=-0.0 size=  125440kB time=00:00:01.86 bitrate=552475.5kbit
frame=   95 fps= 42 q=-0.0 size=  128000kB time=00:00:01.90 bitrate=551882.1kbit
frame=  111 fps= 39 q=-0.0 size=  149760kB time=00:00:02.22 bitrate=552627.9kbit
frame=  118 fps= 35 q=-0.0 size=  159232kB time=00:00:02.36 bitrate=552724.0kbit
frame=  125 fps= 32 q=-0.0 size=  168704kB time=00:00:02.50 bitrate=552809.3kbit
frame=  131 fps= 30 q=-0.0 size=  176640kB time=00:00:02.62 bitrate=552303.4kbit
frame=  149 fps= 13 q=-0.0 size=  200960kB time=00:00:02.98 bitrate=552437.7kbit
frame=  180 fps= 15 q=-0.0 size=  242944kB time=00:00:03.60 bitrate=552832.6kbit
frame=  218 fps= 18 q=-0.0 size=  294144kB time=00:00:04.36 bitrate=552666.9kbit
frame=  239 fps= 19 q=-0.0 size=  322560kB time=00:00:04.78 bitrate=552805.8kbit
frame=  242 fps= 19 q=-0.0 Lsize=  326700kB time=00:00:04.84 bitrate=552960.0kbits/s dup=54 drop=0 speed=0.373x
video:326700kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%

Regards,
Simon Brown

_______________________________________________
Libav-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".