Using h264_mmal decoder on Raspberry Pi 4

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Using h264_mmal decoder on Raspberry Pi 4

Simon Brown
Hi,
I've built ffmpeg from the latest Git head and enabled the hardware
acceleration for decode and encode on the raspberry pi 4.  If I run ffmpeg
-decoders | grep h264 it responds with:
h264
h264_v4l2m2m
h264_mmal

However, if I try and run ffmpeg on a stream and ask it to decode with
h264_mmal I get "Did not get output frame from MMAL." errors.

Command and console output:
pi@raspberrypi:~ $ sudo ffmpeg -c:v h264_mmal -i udp://@:10020 -f avi -c:v
rawvideo output.avi
ffmpeg version N-95607-gb414cff630 Copyright (c) 2000-2019 the FFmpeg
developers
  built with gcc 8 (Raspbian 8.3.0-6+rpi1)
  configuration: --prefix=/usr --enable-mmal --enable-omx --enable-omx-rpi
--enable-decoder=h264_mmal --enable-encoder=h264_omx --enable-libx265
--enable-shared --enable-gpl
  libavutil      56. 35.101 / 56. 35.101
  libavcodec     58. 60.100 / 58. 60.100
  libavformat    58. 33.100 / 58. 33.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 @ 0x2a75b0] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x2a75b0] decode_slice_header error
[h264 @ 0x2a75b0] no frame!
[h264 @ 0x2a75b0] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x2a75b0] decode_slice_header error
[h264 @ 0x2a75b0] no frame!
[h264 @ 0x2a75b0] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x2a75b0] decode_slice_header error
[h264 @ 0x2a75b0] no frame!
[h264 @ 0x2a75b0] Missing reference picture, default is 65536
Input #0, mpegts, from 'udp://@:10020':
  Duration: N/A, start: 60833.199278, bitrate: N/A
  Program 1
    Stream #0:0[0x1100]: Video: h264 (Main) ([27][0][0][0] / 0x001B),
yuv420p(tv, progressive), 1280x720 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k
tbn, 100 tbc
    Stream #0:1[0x1110]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000
Hz, stereo, fltp, 192 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (h264_mmal) -> rawvideo (native))
  Stream #0:1 -> #0:1 (aac (native) -> ac3 (native))
Press [q] to stop, [?] for help
[h264_mmal @ 0x2c1940] MMAL error 9 on control port
[h264_mmal @ 0x2c1940] Did not get output frame from MMAL.
Error while decoding stream #0:0: Unknown error occurred
[h264_mmal @ 0x2c1940] Did not get output frame from MMAL.
Error while decoding stream #0:0: Unknown error occurred
[h264_mmal @ 0x2c1940] Did not get output frame from MMAL.
Error while decoding stream #0:0: Unknown error occurred
[h264_mmal @ 0x2c1940] Did not get output frame from MMAL.
Error while decoding stream #0:0: Unknown error occurred
[h264_mmal @ 0x2c1940] Did not get output frame from MMAL.
Error while decoding stream #0:0: Unknown error occurred
frame=    0 fps=0.0 q=0.0 size=       0kB time=-577014:32:22.77 bitrate=
 -0.0kb[h264_mmal @ 0x2c1940] Did not get output frame from MMAL.
Error while decoding stream #0:0: Unknown error occurred
[h264_mmal @ 0x2c1940] Did not get output frame from MMAL.
Error while decoding stream #0:0: Unknown error occurred
[h264_mmal @ 0x2c1940] Did not get output frame from MMAL.
Error while decoding stream #0:0: Unknown error occurred
[h264_mmal @ 0x2c1940] Did not get output frame from MMAL.
Error while decoding stream #0:0: Unknown error occurred
[h264_mmal @ 0x2c1940] Did not get output frame from MMAL.
Error while decoding stream #0:0: Unknown error occurred
frame=    0 fps=0.0 q=0.0 size=       0kB time=-577014:32:22.77 bitrate=
 -0.0kb[h264_mmal @ 0x2c1940] Did not get output frame from MMAL.
Error while decoding stream #0:0: Unknown error occurred
[h264_mmal @ 0x2c1940] Did not get output frame from MMAL.
Error while decoding stream #0:0: Unknown error occurred
[h264_mmal @ 0x2c1940] Did not get output frame from MMAL.
Error while decoding stream #0:0: Unknown error occurred
[h264_mmal @ 0x2c1940] Did not get output frame from MMAL.
Error while decoding stream #0:0: Unknown error occurred
[h264_mmal @ 0x2c1940] Did not get output frame from MMAL.
Error while decoding stream #0:0: Unknown error occurred
Finishing stream 0:0 without any data written to it.
Output #0, avi, to 'output.avi':
  Metadata:
    ISFT            : Lavf58.33.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.60.100 rawvideo
    Stream #0:1: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, stereo, fltp,
192 kb/s
    Metadata:
      encoder         : Lavc58.60.100 ac3
frame=    0 fps=0.0 q=0.0 Lsize=      96kB time=00:00:00.60
bitrate=1296.2kbits/s speed=0.394x
video:0kB audio:14kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 575.109619%
Exiting normally, received signal 2.

Any help gratefully received,
Cheers
Simon
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Using h264_mmal decoder on Raspberry Pi 4

Verachten Bruno
Simon,

there is a script there:
https://www.raspberrypi.org/forums/viewtopic.php?t=199775 that could
help you entering the right parameters to compile ffmpeg for the
Raspberry Pi. Yes, it's a bit dated (ffmpeg 4.0.2 and Debian Stretch)
but it worked for me.
I did not say your parameters are not the right ones, I honestly have
no idea, that's just in case...
As for what ffmpeg says about hardware encoders/decoders, I think I
understood that it will list what has been compiled, and not what is
available on this particular machine.

Bruno (who is fighting on a daily basis with the compilation of ffmpeg
on another ARM machine)
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

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