Skip to content

Conversation

@joelmacx
Copy link
Collaborator

@joelmacx joelmacx commented Dec 5, 2025

Description

The old GPAC API usage was sometimes silently corrupting output muxed video files. This seems to have been somewhat dependent on the shape of the input IAMF files.

Although the GPAC CLI uses identical filters as the API here, it split muxing into 2 stages: writing IAMF to the MP4 container via a filter session, then copying video frames to the MP4 container via lower level ISO media APIs. This PR replicates that flow in the API usage. This resolves NAL errors in output MP4s.

Changes

  1. Refactored muxing flow into 2 distinct portions handling audio then video.
  2. Added test coverage using ffprobe to better verify output muxed files.
  3. Added additional video test sources. These include .mp4 and .mov containers with H264, H265, and AV1 encoded video streams.
  4. Bumped GPAC version and made it a dylib.

Validation and Acceptance Criteria

  • Added test coverage and verification methods.
  • Validated export in Pro Tools.
  • Verified YouTube uploads and processes files that have gone through the plugin.

@joelmacx joelmacx self-assigned this Dec 5, 2025
"@loader_path/../Resources/"
"@loader_path/../Resources/third_party/iamftools/lib/"
"@loader_path/../Resources/third_party/obr/lib/"
"@loader_path/../Resources/third_party/gpac/lib/"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found this change that will be required for releasing with a new dylib. But I know I must be missing some other updates for the change from archive to shared lib. I'll look around some more.

@joelmacx
Copy link
Collaborator Author

joelmacx commented Dec 8, 2025

  • GPAC build needs work. Modules aren't being properly bundled.

Copy link
Collaborator

@BrandenAvalonCx BrandenAvalonCx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few minor cleanup things, overall this looks fine.

One thing I was thinking about is if it's worth having a flag that forces the FFMPEG tests even when FFMPEG is not present. We would use this in the CI/CD only, just to prevent the tests from silently failing if our FFMPEG fetch suddenly stopped working. Thoughts?

std::string errStr = "IAMF Muxing: Failed to load audio file: " +
inputAudioFile.toStdString();
LOG_ERROR(0, errStr);
LOG_ERROR(0, "IAMF Audio Muxing: Failed to load audio file.");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's output information here about the file it's failing to load

GF_ISOFile* src_video =
gf_isom_open(inputVideoFile.toRawUTF8(), GF_ISOM_OPEN_READ, NULL);
if (!src_video) {
LOG_ERROR(0, "Video Muxing: Failed to open input video file.");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's output information here about the file it's failing to open

GF_ISOFile* dst_file =
gf_isom_open(outputMuxedFile.toRawUTF8(), GF_ISOM_OPEN_EDIT, NULL);
if (!dst_file) {
LOG_ERROR(0, "Video Muxing: Failed to open output file for editing.");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above

@joelmacx joelmacx merged commit bb4d241 into main Dec 9, 2025
3 checks passed
@joelmacx joelmacx deleted the mux-dbg branch December 9, 2025 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants