[FFmpeg-user] FFmpeg on Raspberry pi

Simon Brown simon.k.brown at gmail.com
Thu Jan 14 18:36:49 EET 2021


Hi,
I'm trying to decode video using the libav libraries.  To test I'm running
ffmpeg with some options to see if it can run fast enough.

I was advised that the h264_v4l2m2m decoder would be faster on the
raspberry pi compared to the h264_mmal decoder because it needed less
memory copying between CPU and GPU.  So I have tried this command:
ffmpeg -c:v h264_v4l2m2m -i Omniseq4.ts -f rawvideo dump.raw
with output:
ffmpeg version 4.1.6-1~deb10u1+rpt1 Copyright (c) 2000-2020 the FFmpeg
developers
  built with gcc 8 (Raspbian 8.3.0-6+rpi1)
  configuration: --prefix=/usr --extra-version='1~deb10u1+rpt1'
--toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl
--disable-stripping --enable-avresample --disable-filter=resample
--enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom
--enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca
--enable-libcdio --enable-libcodec2 --enable-libflite
--enable-libfontconfig --enable-libfreetype --enable-libfribidi
--enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame
--enable-libmysofa --enable-libopenjpeg --enable-libopenmpt
--enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband
--enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex
--enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp
--enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq
--enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl
--enable-sdl2 --enable-omx-rpi --enable-mmal --enable-neon --enable-rpi
--enable-libdc1394 --enable-libdrm --enable-libiec61883
--enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
--libdir=/usr/lib/arm-linux-gnueabihf --cpu=arm1176jzf-s --arch=arm
  WARNING: library configuration mismatch
  avutil      configuration: --prefix=/usr --extra-version='1~deb10u1+rpt1'
--toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl
--disable-stripping --enable-avresample --disable-filter=resample
--enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom
--enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca
--enable-libcdio --enable-libcodec2 --enable-libflite
--enable-libfontconfig --enable-libfreetype --enable-libfribidi
--enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame
--enable-libmysofa --enable-libopenjpeg --enable-libopenmpt
--enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband
--enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex
--enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp
--enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq
--enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl
--enable-sdl2 --enable-omx-rpi --enable-mmal --enable-neon --enable-rpi
--enable-libdc1394 --enable-libdrm --enable-libiec61883
--enable-chromaprint --enable-frei0r --enable-libx264
--libdir=/usr/lib/arm-linux-gnueabihf/neon/vfp --cpu=cortex-a7
--arch=armv6t2 --disable-thumb --enable-shared --disable-doc
--disable-programs
  avcodec     configuration: --prefix=/usr --extra-version='1~deb10u1+rpt1'
--toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl
--disable-stripping --enable-avresample --disable-filter=resample
--enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom
--enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca
--enable-libcdio --enable-libcodec2 --enable-libflite
--enable-libfontconfig --enable-libfreetype --enable-libfribidi
--enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame
--enable-libmysofa --enable-libopenjpeg --enable-libopenmpt
--enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband
--enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex
--enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp
--enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq
--enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl
--enable-sdl2 --enable-omx-rpi --enable-mmal --enable-neon --enable-rpi
--enable-libdc1394 --enable-libdrm --enable-libiec61883
--enable-chromaprint --enable-frei0r --enable-libx264
--libdir=/usr/lib/arm-linux-gnueabihf/neon/vfp --cpu=cortex-a7
--arch=armv6t2 --disable-thumb --enable-shared --disable-doc
--disable-programs
  avformat    configuration: --prefix=/usr --extra-version='1~deb10u1+rpt1'
--toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl
--disable-stripping --enable-avresample --disable-filter=resample
--enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom
--enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca
--enable-libcdio --enable-libcodec2 --enable-libflite
--enable-libfontconfig --enable-libfreetype --enable-libfribidi
--enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame
--enable-libmysofa --enable-libopenjpeg --enable-libopenmpt
--enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband
--enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex
--enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp
--enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq
--enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl
--enable-sdl2 --enable-omx-rpi --enable-mmal --enable-neon --enable-rpi
--enable-libdc1394 --enable-libdrm --enable-libiec61883
--enable-chromaprint --enable-frei0r --enable-libx264
--libdir=/usr/lib/arm-linux-gnueabihf/neon/vfp --cpu=cortex-a7
--arch=armv6t2 --disable-thumb --enable-shared --disable-doc
--disable-programs
  avdevice    configuration: --prefix=/usr --extra-version='1~deb10u1+rpt1'
--toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl
--disable-stripping --enable-avresample --disable-filter=resample
--enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom
--enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca
--enable-libcdio --enable-libcodec2 --enable-libflite
--enable-libfontconfig --enable-libfreetype --enable-libfribidi
--enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame
--enable-libmysofa --enable-libopenjpeg --enable-libopenmpt
--enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband
--enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex
--enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp
--enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq
--enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl
--enable-sdl2 --enable-omx-rpi --enable-mmal --enable-neon --enable-rpi
--enable-libdc1394 --enable-libdrm --enable-libiec61883
--enable-chromaprint --enable-frei0r --enable-libx264
--libdir=/usr/lib/arm-linux-gnueabihf/neon/vfp --cpu=cortex-a7
--arch=armv6t2 --disable-thumb --enable-shared --disable-doc
--disable-programs
  avfilter    configuration: --prefix=/usr --extra-version='1~deb10u1+rpt1'
--toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl
--disable-stripping --enable-avresample --disable-filter=resample
--enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom
--enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca
--enable-libcdio --enable-libcodec2 --enable-libflite
--enable-libfontconfig --enable-libfreetype --enable-libfribidi
--enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame
--enable-libmysofa --enable-libopenjpeg --enable-libopenmpt
--enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband
--enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex
--enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp
--enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq
--enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl
--enable-sdl2 --enable-omx-rpi --enable-mmal --enable-neon --enable-rpi
--enable-libdc1394 --enable-libdrm --enable-libiec61883
--enable-chromaprint --enable-frei0r --enable-libx264
--libdir=/usr/lib/arm-linux-gnueabihf/neon/vfp --cpu=cortex-a7
--arch=armv6t2 --disable-thumb --enable-shared --disable-doc
--disable-programs
  avresample  configuration: --prefix=/usr --extra-version='1~deb10u1+rpt1'
--toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl
--disable-stripping --enable-avresample --disable-filter=resample
--enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom
--enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca
--enable-libcdio --enable-libcodec2 --enable-libflite
--enable-libfontconfig --enable-libfreetype --enable-libfribidi
--enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame
--enable-libmysofa --enable-libopenjpeg --enable-libopenmpt
--enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband
--enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex
--enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp
--enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq
--enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl
--enable-sdl2 --enable-omx-rpi --enable-mmal --enable-neon --enable-rpi
--enable-libdc1394 --enable-libdrm --enable-libiec61883
--enable-chromaprint --enable-frei0r --enable-libx264
--libdir=/usr/lib/arm-linux-gnueabihf/neon/vfp --cpu=cortex-a7
--arch=armv6t2 --disable-thumb --enable-shared --disable-doc
--disable-programs
  swscale     configuration: --prefix=/usr --extra-version='1~deb10u1+rpt1'
--toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl
--disable-stripping --enable-avresample --disable-filter=resample
--enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom
--enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca
--enable-libcdio --enable-libcodec2 --enable-libflite
--enable-libfontconfig --enable-libfreetype --enable-libfribidi
--enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame
--enable-libmysofa --enable-libopenjpeg --enable-libopenmpt
--enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband
--enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex
--enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp
--enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq
--enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl
--enable-sdl2 --enable-omx-rpi --enable-mmal --enable-neon --enable-rpi
--enable-libdc1394 --enable-libdrm --enable-libiec61883
--enable-chromaprint --enable-frei0r --enable-libx264
--libdir=/usr/lib/arm-linux-gnueabihf/neon/vfp --cpu=cortex-a7
--arch=armv6t2 --disable-thumb --enable-shared --disable-doc
--disable-programs
  swresample  configuration: --prefix=/usr --extra-version='1~deb10u1+rpt1'
--toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl
--disable-stripping --enable-avresample --disable-filter=resample
--enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom
--enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca
--enable-libcdio --enable-libcodec2 --enable-libflite
--enable-libfontconfig --enable-libfreetype --enable-libfribidi
--enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame
--enable-libmysofa --enable-libopenjpeg --enable-libopenmpt
--enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband
--enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex
--enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp
--enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq
--enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl
--enable-sdl2 --enable-omx-rpi --enable-mmal --enable-neon --enable-rpi
--enable-libdc1394 --enable-libdrm --enable-libiec61883
--enable-chromaprint --enable-frei0r --enable-libx264
--libdir=/usr/lib/arm-linux-gnueabihf/neon/vfp --cpu=cortex-a7
--arch=armv6t2 --disable-thumb --enable-shared --disable-doc
--disable-programs
  postproc    configuration: --prefix=/usr --extra-version='1~deb10u1+rpt1'
--toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl
--disable-stripping --enable-avresample --disable-filter=resample
--enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom
--enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca
--enable-libcdio --enable-libcodec2 --enable-libflite
--enable-libfontconfig --enable-libfreetype --enable-libfribidi
--enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame
--enable-libmysofa --enable-libopenjpeg --enable-libopenmpt
--enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband
--enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex
--enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp
--enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq
--enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl
--enable-sdl2 --enable-omx-rpi --enable-mmal --enable-neon --enable-rpi
--enable-libdc1394 --enable-libdrm --enable-libiec61883
--enable-chromaprint --enable-frei0r --enable-libx264
--libdir=/usr/lib/arm-linux-gnueabihf/neon/vfp --cpu=cortex-a7
--arch=armv6t2 --disable-thumb --enable-shared --disable-doc
--disable-programs
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
Input #0, mpegts, from 'Omniseq4.ts':
  Duration: 00:02:14.40, start: 1.433333, bitrate: 1283 kb/s
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: h264 (Main) ([27][0][0][0] / 0x001B),
yuv420p(progressive), 1920x1080, 60 fps, 60 tbr, 90k tbn, 120 tbc
[h264_v4l2m2m @ 0xecc620] driver 'bcm2835-isp' on card 'bcm2835-isp'
    Last message repeated 3 times
[h264_v4l2m2m @ 0xecc620] driver 'bcm2835-codec' on card 'bcm2835-codec-isp'
[h264_v4l2m2m @ 0xecc620] driver 'bcm2835-codec' on card
'bcm2835-codec-encode'
[h264_v4l2m2m @ 0xecc620] driver 'bcm2835-codec' on card
'bcm2835-codec-decode'
[h264_v4l2m2m @ 0xecc620] Using device /dev/video10
[h264_v4l2m2m @ 0xecc620] driver 'bcm2835-codec' on card
'bcm2835-codec-decode'
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (h264_v4l2m2m) -> rawvideo (native))
Press [q] to stop, [?] for help
Output #0, rawvideo, to 'dump.raw':
  Metadata:
    encoder         : Lavf58.20.100
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1920x1080,
q=2-31, 1492992 kb/s, 60 fps, 60 tbn, 60 tbc
    Metadata:
      encoder         : Lavc58.35.100 rawvideo
Segmentation fault

If I run the same video with h264_mmal decoder it decodes fine.  I can play
it (albeit too slowly) with ffplay and at the right speed with omxplayer.

Can anyone suggest what I do to determine what is causing the segmentation
fault?

Regards
Simon


More information about the ffmpeg-user mailing list