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

Recording video and audio with AAC audio codec don't play back correctly in Windows Media Player or Quicktime on macOS

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.8.3, 6.9.0 Beta2, 6.10.0 FF
    • 6.7.3, 6.8.1
    • Multimedia
    • Windows 10, Windows 11, macOS 15.1
    • macOS, Windows
    • afbb68f9d (dev), 2b741f30f (6.9), 79c76f961 (6.8)
    • Multimedia wk 51-2

    Description

      How to reproduce

      • Build and run the "Camera Example" on Windows (or on macOS)
      • Switch to "Video" mode
      • Settings: Either keep the "Default audio codec" or set to "Advanced Audio Codec (AAC)" - both create the same file format.
      • Record a video file and make some noise.
      • Play back the video in Windows Media Player (without any additional codecs/packs installed) or with Quicktime on macOS
      • There is no audio!

      ffprobe the video

      ffprobe of the generated file results in:

      Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video_0004.mp4':
      [...]
        Duration: 00:00:04.35, start: 0.000000, bitrate: 3924 kb/s
        Stream #0:0[0x1](und): Audio: aac (mp4a / 0x6134706D), 16000 Hz, mono, fltp, 54 kb/s (default)
      [...]
        Stream #0:1[0x2](und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(progressive), 1280x720, 3905 kb/s, SAR 1:1 DAR 16:9, 30.20 fps, 60 tbr, 30k tbn [...]

      Reencoding audio using ffmpeg works

      Interestingly, reencoding the audio of the generated file using ffmpeg.exe -i video_0004.mp4 -acodec aac -vcodec copy video_0004_reencoded.mp4 results in a file that plays back correctly in Windows Media Player and Quicktime on macOS.

      The reencoded file's ffprobe output is:

      Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Users\ChristophNiederberge\Videos\video_0004_reencoded.mp4':
      [...]
        Duration: 00:00:04.35, start: 0.000000, bitrate: 3924 kb/s
        Stream #0:0[0x1](und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(progressive), 1280x720, 3875 kb/s, SAR 1:1 DAR 16:9, 29.97 fps, 60 tbr, 30k tbn 
      [...]
        Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 16000 Hz, mono, fltp, 54 kb/s (default)
      [...]

      With the subtle but important difference of having a `aac (LC)` instead of the `aac` as audio codec information.

      Attachments

      • video_0004.mp4 is the original recording
      • video_0004_reencoded.mp4 is the video reencoded with ffmpeg

      Notes

      • Playback of the videos works correctly in VLC both on Windows and macOS
      • This is independent of the container format
      • This is independent of the video codec
      • This is independent of the video resolution
      • This is independent of the encoding quality or bitrate settings
      • This seems to be independent of the audio sample rate

      Attachments

        1. video_0004_reencoded.mp4
          2.04 MB
        2. video_0004.mp4
          2.04 MB

        Issue Links

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

          Activity

            People

              timblechmann tim blechmann
              chris_4000 Christoph Niederberger
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There is 1 open Gerrit change