Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-128336

Camera widget example does not record audio with default AAC format

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • None
    • 6.8.0 FF
    • Multimedia
    • None
    • macOS, Windows
    • 97099557e (dev), cdbf540a4 (6.8), 116785341 (6.7), 8fa80cde3 (tqtc/lts-6.5)
    • Multimedia wk 35-38

    Description

      When I record video with the widget camera example, no audio is recorded when using built-in microphone (4 channel sound). With external camera (2 channel sound), it works.

      With internal microphone, the resulting media has an audio stream, but bits per sample is zero:

                  "codec_name": "aac",
                  "codec_long_name": "AAC (Advanced Audio Coding)",
                  "profile": "-1",
                  "codec_type": "audio",
                  "codec_tag_string": "mp4a",
                  "codec_tag": "0x6134706d",
                  "sample_fmt": "fltp",
                  "sample_rate": "48000",
                  "channels": 4,
                  "channel_layout": "4.0",
                  "bits_per_sample": 0,
                  "initial_padding": 0,
                  "id": "0x1",
                  "r_frame_rate": "0/0",
                  "avg_frame_rate": "0/0",
                  "time_base": "1/48000",
                  "start_pts": 0,
                  "start_time": "0.000000",
                  "duration_ts": 102384,
                  "duration": "2.133000",
                  "bit_rate": "265269",
                  "nb_frames": "101",
      

      FFmplay complains that

      [aac @ 000001985320ec40] channel element 1.0 is not allocated
      [aac @ 000001985320ec40] channel element 1.0 is not allocated
      

      Errors on macOS recorded with minimal-audio-recorder

      ➜  qtbase git:(d2ed6a3d73) /Users/tim/build/qt-dev-xc15-Debug/qtmultimedia/tests/manual/minimal-audio-recorder/minimal-audio-recorder.app/Contents/MacOS/minimal-audio-recorder tst.aac
      Available HW decoding frameworks:
           videotoolbox
      Available HW encoding frameworks:
           videotoolbox
      Available audio devices:
      ID "BuiltInMicrophoneDevice" Description "MacBook Pro Microphone"
      ID "EQMDevice" Description "eqMac"
      ID "MSLoopbackDriverDevice_UID" Description "Microsoft Teams Audio"
      Using default device
      qt.multimedia.ffmpeg.audioencoder: AudioEncoder QMediaFormat::AudioCodec::AAC
      Recording 5 seconds of audio to "/Users/tim/Music/tst.aac"
      qt.multimedia.ffmpeg.audioencoder: set stream time_base 1 / 48000
      qt.multimedia.ffmpeg.audioencoder: audio codec params: fmt= 8 rate= 48000
      qt.multimedia.ffmpeg.audioencoder: found audio codec aac
      qt.multimedia.ffmpeg.audioencoder: Created resampler with audio formats conversion
       [ sample format: flt , sample rate: 48000 , channel layout: [ nb_channels: 1 , order: 1 , mask: 100 ] ] -> [ sample format: fltp , sample rate: 48000 , channel layout: [ nb_channels: 1 , order: 1 , mask: 100 ] ]
      Recording completed
      [aac @ 0x7fce5e20fc40] Qavg: 120.107
      ➜  qtbase git:(d2ed6a3d73) ffprobe /Users/tim/Music/tst.aac
      ffprobe version 7.0.2 Copyright (c) 2007-2024 the FFmpeg developers
        built with Apple clang version 15.0.0 (clang-1500.3.9.4)
        configuration: --prefix=/usr/local/Cellar/ffmpeg/7.0.2 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags='-Wl,-ld_classic' --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libharfbuzz --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox
        libavutil      59.  8.100 / 59.  8.100
        libavcodec     61.  3.100 / 61.  3.100
        libavformat    61.  1.100 / 61.  1.100
        libavdevice    61.  1.100 / 61.  1.100
        libavfilter    10.  1.100 / 10.  1.100
        libswscale      8.  1.100 /  8.  1.100
        libswresample   5.  1.100 /  5.  1.100
        libpostproc    58.  1.100 / 58.  1.100
      [aac @ 0x7fba55b04100] Format aac detected only with low score of 1, misdetection possible!
      [aac @ 0x7fba55b04c00] More than one AAC RDB per ADTS frame is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
      [aac @ 0x7fba55b04c00] Reserved bit set.
      [aac @ 0x7fba55b04c00] Number of bands (10) exceeds limit (6).
      [aac @ 0x7fba55b04c00] channel element 1.14 is not allocated
      [aac @ 0x7fba55b04c00] channel element 2.11 is not allocated
      [aac @ 0x7fba55b04c00] channel element 3.5 is not allocated
      [aac @ 0x7fba55b04100] Estimating duration from bitrate, this may be inaccurate
      [aac @ 0x7fba55b04100] Could not find codec parameters for stream 0 (Audio: aac (LTP), mono, fltp, 418 kb/s): unspecified sample rate
      Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
      Input #0, aac, from '/Users/tim/Music/tst.aac':
        Duration: 00:00:00.73, bitrate: 436 kb/s
        Stream #0:0: Audio: aac (LTP), mono, fltp, 418 kb/s
      

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-128336
          # Subject Branch Project Status CR V

          Activity

            People

              timblechmann tim blechmann
              johanseg Jøger Hansegård
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes