Creating H.264 AAC MP4 output

Following composition will create H.264 and AAC audio in MP4 container, with following properties:

  • 23.976 framerate
  • 8-bit depth
  • progressive field order
  • 1920 x 1080 image size
  • 30000 bits/s bitrate
  • square pixels aspect ratio
  • profile Main and 5.1 level
  • Adaptive Quantisation strength 1.0 (a value between 0.0 to 2.0 for H.264)
  • Closed GOP set to false (determines if B and P frames can reference frames located outside their GOP)

Audio stream in this case will be AAC LC, 44.1 kHz and 96 kbit/s bitrate.

{
  "input": {
    "container": [
      {
        "properties": {
          "Timebase": "zero"
        },
        "settings": {
          "kind": "media"
        },
        "name": "input-container",
        "audio": [
          {
            "name": "Audio Stream 1",
            "select": {
              "track": 1
            }
          }
        ],
        "subtitle": [],
        "video": [
          {
            "name": "Video Stream 1",
            "select": {
              "track": 1
            }
          }
        ]
      }
    ],
    "reference": "input-container"
  },
  "output": {
    "container": [
      {
        "type": "mp4 ",
        "name": "mp4-output",
        "path": "output.mp4",
        "audio": [
          {
            "name": "Audio Output 1",
            "properties": {
              "Format": "aac"
            },
            "sample_rate": {
              "denominator": 1000,
              "numerator": 44100
            },
            "encode": {
              "properties": {
                "BitRate": 96000,
                "MpegVersion": 1,
                "Profile": "lc"
              }
            },
            "route": {
              "name": "Audio Stream 1"
            }
          }
        ],
        "subtitle": [],
        "video": [
          {
            "name": "Video Output 1",
            "properties": {
              "Format": "h264"
            },
            "sample_rate": {
              "denominator": 1001,
              "numerator": 24000
            },
            "bit_depth": 8,
            "field_order": "progressive",
            "height": 1080,
            "pixel_aspect_ratio": {
              "denominator": 1,
              "numerator": 1
            },
            "width": 1920,
            "encode": {
              "properties": {
                "AQStrength": 1,
                "BitRate": 30000,
                "ClosedGOP": false,
                "Level": "5.1",
                "Profile": "main"
              }
            },
            "route": {
              "name": "Video Stream 1"
            }
          }
        ]
      }
    ]
  }
}