Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Multimedia
  4. Qt Multimedia 6.7.2 with ffmpeg cannot decode h264 on Pi5
Forum Updated to NodeBB v4.3 + New Features

Qt Multimedia 6.7.2 with ffmpeg cannot decode h264 on Pi5

Scheduled Pinned Locked Moved Unsolved Qt Multimedia
3 Posts 3 Posters 797 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dragoner
    wrote on last edited by
    #1

    I am try to use a QMediaPlayer with QT_MEDIA_BACKEND=ffmpeg to play a video with h264 codec on a Rasperry Pi 5, but failing with the error:

    qt.core.plugin.factoryloader: checking directory path "/opt/Qt6.7.2/plugins/multimedia" ...
    qt.core.plugin.factoryloader: looking at "/opt/Qt6.7.2/plugins/multimedia/libffmpegmediaplugin.so"
    qt.core.plugin.loader: Found metadata in lib /opt/Qt6.7.2/plugins/multimedia/libffmpegmediaplugin.so, metadata=
    {
        "IID": "org.qt-project.Qt.QPlatformMediaPlugin",
        "MetaData": {
            "Keys": [
                "ffmpeg"
            ]
        },
        "archlevel": 0,
        "className": "QFFmpegMediaPlugin",
        "debug": false,
        "version": 395008
    }
    
    
    qt.core.plugin.factoryloader: Got keys from plugin meta data QList("ffmpeg")
    qt.core.plugin.factoryloader: checking directory path "/home/pi/repos/gainbridge-qt672/build/multimedia" ...
    qt.core.library: "/opt/Qt6.7.2/plugins/multimedia/libffmpegmediaplugin.so" loaded library
    [2024-11-28 12:31:58.731] [info] Setting video src=RedLeftToRight.avi
    "FFmpeg log: Opening 'RedLeftToRight.avi' for reading"
    "FFmpeg log: Setting default whitelist 'file,crypto,data'"
    "FFmpeg log: Format avi probed with size=2048 and score=100"
    "FFmpeg log: use odml:1"
    "FFmpeg log: Before avformat_find_stream_info() pos: 5754 bytes read:22652 seeks:0 nb_streams:1"
    "FFmpeg log: nal_unit_type: 7(SPS), nal_ref_idc: 3"
    "FFmpeg log: nal_unit_type: 8(PPS), nal_ref_idc: 3"
    "FFmpeg log: nal_unit_type: 6(SEI), nal_ref_idc: 0"
    "FFmpeg log: nal_unit_type: 5(IDR), nal_ref_idc: 3"
    "FFmpeg log: nal_unit_type: 7(SPS), nal_ref_idc: 3"
    "FFmpeg log: nal_unit_type: 8(PPS), nal_ref_idc: 3"
    "FFmpeg log: nal_unit_type: 6(SEI), nal_ref_idc: 0"
    "FFmpeg log: nal_unit_type: 5(IDR), nal_ref_idc: 3"
    "FFmpeg log: Format yuv422p chosen by get_format()."
    "FFmpeg log: Reinit context to 208x80, pix_fmt: yuv422p"
    "FFmpeg log: no picture "
    "FFmpeg log: All info found"
    "FFmpeg log: rfps: 29.666667 0.016451"
    "FFmpeg log: rfps: 29.666667 0.016451"
    "FFmpeg log: rfps: 29.750000 0.009253"
    "FFmpeg log: rfps: 29.750000 0.009253"
    "FFmpeg log: rfps: 29.833333 0.004113"
    "FFmpeg log: rfps: 29.833333 0.004113"
    "FFmpeg log: rfps: 29.916667 0.001028"
    "FFmpeg log: rfps: 29.916667 0.001028"
    "FFmpeg log: rfps: 30.000000 0.000000"
    "FFmpeg log: rfps: 60.000000 0.000000"
    "FFmpeg log: rfps: 120.000000 0.000000"
    "FFmpeg log: rfps: 240.000000 0.000000"
    "FFmpeg log: rfps: 29.970030 0.000133"
    "FFmpeg log: rfps: 29.970030 0.000133"
    "FFmpeg log: rfps: 59.940060 0.000532"
    "FFmpeg log: rfps: 59.940060 0.000532"
    "FFmpeg log: After avformat_find_stream_info() pos: 7767 bytes read:22652 seeks:0 frames:41"
    "FFmpeg log: The input looks like it is Annex B already"
    "FFmpeg log: nal_unit_type: 7(SPS), nal_ref_idc: 3"
    "FFmpeg log: nal_unit_type: 8(PPS), nal_ref_idc: 3"
    "FFmpeg log: probing device /dev/video20"
    "FFmpeg log: driver 'pispbe' on card 'pispbe' in mplane mode"
    "FFmpeg log: v4l2 output format not supported"
    "FFmpeg log: probing device /dev/video21"
    "FFmpeg log: driver 'pispbe' on card 'pispbe' in mplane mode"
    "FFmpeg log: v4l2 output format not supported"
    "FFmpeg log: probing device /dev/video22"
    "FFmpeg log: driver 'pispbe' on card 'pispbe' in mplane mode"
    "FFmpeg log: v4l2 output format not supported"
    "FFmpeg log: probing device /dev/video19"
    "FFmpeg log: driver 'rpivid' on card 'rpivid' in mplane mode"
    "FFmpeg log: v4l2 output format not supported"
    "FFmpeg log: probing device /dev/video23"
    "FFmpeg log: driver 'pispbe' on card 'pispbe' in mplane mode"
    "FFmpeg log: v4l2 output format not supported"
    "FFmpeg log: probing device /dev/video24"
    "FFmpeg log: driver 'pispbe' on card 'pispbe' in mplane mode"
    "FFmpeg log: v4l2 output format not supported"
    "FFmpeg log: probing device /dev/video25"
    "FFmpeg log: driver 'pispbe' on card 'pispbe' in mplane mode"
    "FFmpeg log: v4l2 output format not supported"
    "FFmpeg log: probing device /dev/video26"
    "FFmpeg log: driver 'pispbe' on card 'pispbe' in mplane mode"
    "FFmpeg log: v4l2 output format not supported"
    "FFmpeg log: probing device /dev/video27"
    "FFmpeg log: driver 'pispbe' on card 'pispbe' in unknown mode"
    "FFmpeg log: probing device /dev/video28"
    "FFmpeg log: driver 'pispbe' on card 'pispbe' in mplane mode"
    "FFmpeg log: v4l2 output format not supported"
    "FFmpeg log: probing device /dev/video29"
    "FFmpeg log: driver 'pispbe' on card 'pispbe' in mplane mode"
    "FFmpeg log: v4l2 output format not supported"
    "FFmpeg log: probing device /dev/video30"
    "FFmpeg log: driver 'pispbe' on card 'pispbe' in mplane mode"
    "FFmpeg log: v4l2 output format not supported"
    "FFmpeg log: probing device /dev/video31"
    "FFmpeg log: driver 'pispbe' on card 'pispbe' in mplane mode"
    "FFmpeg log: v4l2 output format not supported"
    "FFmpeg log: probing device /dev/video32"
    "FFmpeg log: driver 'pispbe' on card 'pispbe' in mplane mode"
    "FFmpeg log: v4l2 output format not supported"
    "FFmpeg log: probing device /dev/video33"
    "FFmpeg log: driver 'pispbe' on card 'pispbe' in mplane mode"
    "FFmpeg log: v4l2 output format not supported"
    "FFmpeg log: probing device /dev/video34"
    "FFmpeg log: driver 'pispbe' on card 'pispbe' in mplane mode"
    "FFmpeg log: v4l2 output format not supported"
    "FFmpeg log: probing device /dev/video35"
    "FFmpeg log: driver 'pispbe' on card 'pispbe' in unknown mode"
    "FFmpeg log: Could not find a valid device"
    "FFmpeg log: can't configure decoder"
    "FFmpeg log: V4L2 Codec end"
    "FFmpeg log: V4L2 Context destroyed"
    

    For me it looks like Qt or ffmpeg tries to use a hardware decoder which is not available on Pi5. I am expecting that ffmpeg/Qt should fall back to software decoding in that case.

    I first thought this might be a bug in ffmpeg, but I am able to convert that video to another codec successfully:

    ffmpeg -i RedLeftToRight.avi -c:v rawvideo raw.avi
    

    So, I assume ffmpeg is able to decode h264 without hardware encoder support.

    How can I get this running?

    1 Reply Last reply
    0
    • Nhan NguyenN Nhan Nguyen moved this topic from General and Desktop on
    • G Offline
      G Offline
      Graullon
      wrote on last edited by
      #2

      There are 2 possible reasons of why is it not working:

      1. Qt code issue, there is not enough checks if initialized v4l2 decoder can do its job properly.
      2. Your FFMPEG build issue. If I remember it right there is no built-in h264 decoder in FFMPEG, you need to built-in some third-party lib yourself. No software impl to fallback on.
      1 Reply Last reply
      0
      • C Offline
        C Offline
        CadErik
        wrote on last edited by
        #3

        I have a similar issue with an opi 5 (rk3588) and I can't get the hardware decoding to work at all. I am guessing that QT is using its own FFMPEG instead of the platform one.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved