Example #1
0
  /** Example utility method to tidy up the making of a WAVE PCM descriptor. */
  public static final WAVEPCMDescriptor makeWAVEPCMDescriptor(
      long essenceLength, int linledTrackID) {

    return Forge.make(
        WAVEPCMDescriptor.class,
        "SampleRate",
        "25/1",
        "ContainerFormat",
        "MXFGC_Clipwrapped_Broadcast_Wave_audio_data",
        "EssenceLength",
        essenceLength,
        "AudioSampleRate",
        Forge.makeRational(48000, 1),
        "QuantizationBits",
        16,
        "ChannelCount",
        1,
        "Locked",
        true,
        "AverageBytesPerSecond",
        96000,
        "BlockAlign",
        2,
        "ChannelAssignment",
        "urn:uuid:4b7093c0-c8d2-4f9a-aadc-c1a8d556d3e3",
        "LinkedTrackID",
        3);
  }
Example #2
0
  /** Example utility method to tidy up making an IMX50 picture descriptor. */
  public static final CDCIDescriptor makeIMX50VideoDescriptor(
      long essenceLength, int linkedTrackID) {

    return Forge.make(
        CDCIDescriptor.class,
        "SampleRate",
        "25/1",
        "ContainerFormat",
        "MXFGC_Framewrapped_SMPTE_D10_625x50I_50Mbps_DefinedTemplate",
        "EssenceLength",
        essenceLength,
        "PictureCompression",
        "urn:smpte:ul:060e2b34.04010101.04010202.01020101",
        "FrameLayout",
        LayoutType.SeparateFields,
        "VideoLineMap",
        new int[] {7, 320},
        "ImageAspectRatio",
        Forge.makeRational(16, 9),
        "AlphaTransparency",
        AlphaTransparencyType.MinValueTransparent,
        "ImageAlignmentFactor",
        0,
        "TransferCharacteristic",
        TransferCharacteristicType.ITU470_PAL,
        "ImageStartOffset",
        0,
        "ImageEndOffset",
        0,
        "FieldDominance",
        FieldNumber.One,
        "DisplayF2Offset",
        0,
        "StoredF2Offset",
        0,
        "SignalStandard",
        SignalStandardType.ITU601,
        "DisplayHeight",
        288,
        "DisplayWidth",
        720,
        "DisplayXOffset",
        0,
        "DisplayYOffset",
        16,
        "SampledHeight",
        304,
        "SampledWidth",
        720,
        "SampledXOffset",
        0,
        "SampledYOffset",
        0,
        "StoredHeight",
        304,
        "StoredWidth",
        720,
        "AlphaSampleDepth",
        0,
        "BlackRefLevel",
        16,
        "ColorRange",
        225,
        "ColorSiting",
        ColorSitingType.Rec601,
        "ComponentDepth",
        8,
        "HorizontalSubsampling",
        2,
        "PaddingBits",
        0,
        "ReversedByteOrder",
        false,
        "VerticalSubsampling",
        1,
        "WhiteRefLevel",
        235,
        "LinkedTrackID",
        linkedTrackID);
  }
Example #3
0
  /** Create all the AAF objects required to represent the example top level composition. */
  public static final Preface makeExamplePreface() throws Exception {

    // Start at the top ... a top-level composition
    CompositionPackage rootComposition =
        Forge.make(
            CompositionPackage.class,
            "PackageName",
            "RootPackage",
            "PackageID",
            Forge.dCinemaUMID(),
            "PackageUsage",
            UsageType.TopLevel);

    int sourceVideoTrackID = 2;
    int sourceAudioTrackID = 3;
    int sourceEssenceLength = 5 * 25; // Five seconds of material at 25 fps

    TapeDescriptor tapeDescription = Forge.make(TapeDescriptor.class);
    tapeDescription.setSignalType(VideoSignalType.PALSignal);
    tapeDescription.setTapeBatchNumber("PL/1234/12");
    tapeDescription.setTapeManufacturer("Sony");
    tapeDescription.setTapeFormulation("Digibeta");
    tapeDescription.setTapeFormat(TapeFormatType.BetacamFormat);
    tapeDescription.setTapeCapacity(30);

    SourcePackage sourceTape =
        Forge.make(
            SourcePackage.class,
            "PackageName",
            "SourceTape",
            "PackageID",
            Forge.randomUMID(),
            "PackageTracks",
            new Track[] {
              makeTimelineTrack("Picture", null, 0, 0l, 1, 30 * 60 * 60 * 25), // 30 minute tape
              makeTimelineTrack("Sound", null, 0, 0l, 2, 30 * 60 * 60 * 25)
            },
            "EssenceDescription",
            tapeDescription);

    // To be made from the following source file - external essence so no essence data
    SourcePackage sourceFile =
        Forge.makeAAF(
            "SourceMob", // Can use AAF names with the factory
            "PackageName",
            "SourceFile",
            "PackageID",
            Forge.randomUMID(),
            "PackageTracks",
            new Track[] {
              makeTimelineTrack("Picture", sourceTape, 1, 36000l * 25l, sourceVideoTrackID, 125l),
              makeTimelineTrack("Sound", sourceTape, 2, 36000l * 25l, sourceAudioTrackID, 125l)
            },
            "EssenceDescription",
            Forge.make(
                MultipleDescriptor.class,
                "FileDescriptors",
                new AAFFileDescriptor[] {
                  makeIMX50VideoDescriptor(sourceEssenceLength, sourceVideoTrackID),
                  makeWAVEPCMDescriptor(sourceEssenceLength, sourceAudioTrackID)
                },
                "Locators",
                new Locator[] {
                  Forge.make(NetworkLocator.class, "URL", "file://library/media/imx50-example.mxf")
                }));

    MaterialPackage masterPackage =
        Forge.make(
            MaterialPackage.class,
            "PackageName",
            "MasterMaterial",
            "PackageID",
            Forge.randomUMID(),
            "PackageTracks",
            new Track[] {
              makeTimelineTrack(
                  "Picture", sourceFile, sourceVideoTrackID, 0l, sourceVideoTrackID, 125l),
              makeTimelineTrack(
                  "Sound", sourceFile, sourceAudioTrackID, 0l, sourceAudioTrackID, 125)
            });

    Sequence videoSequence = Forge.make(Sequence.class, "ComponentDataDefinition", "Picture");
    Sequence audioSequence = Forge.make(Sequence.class, "ComponentDataDefinition", "Sound");

    OperationGroup videoDissolve =
        Forge.make(
            OperationGroup.class, "ComponentDataDefinition", "Picture", "ComponentLength", 12);
    videoDissolve.setOperationDefinition(
        Warehouse.lookup(OperationDefinition.class, OperationConstant.VideoDissolve));
    Parameter parameter =
        Forge.make(
            ConstantValue.class,
            "ParameterDefinitionReference",
            ParameterConstant.Level,
            "Value",
            Forge.makeRational(1, 2));
    videoDissolve.addParameter(parameter);

    Transition videoTranstion =
        Forge.make(
            Transition.class,
            "ComponentDataDefinition",
            "Picture",
            "ComponentLength",
            12,
            "TransitionOperation",
            videoDissolve);

    OperationGroup audioDissolve =
        Forge.make(
            OperationGroup.class,
            "ComponentDataDefinition",
            "Sound",
            "ComponentLength",
            12,
            "Operation",
            "MonoAudioDissolve",
            "Parameters",
            new Parameter[] {
              Forge.make(
                  ConstantValue.class,
                  "ParameterDefinitionReference",
                  ParameterConstant.Level,
                  "Value",
                  Forge.makeRational(1, 2))
            });

    Transition audioTransition =
        Forge.make(
            Transition.class,
            "ComponentDataDefinition",
            "Sound",
            "ComponentLength",
            12,
            "TransitionOperation",
            audioDissolve);

    videoSequence.appendComponentObject(
        makeSourceClip("Picture", masterPackage, sourceVideoTrackID, 0, 50));
    videoSequence.appendComponentObject(videoTranstion);
    videoSequence.appendComponentObject(
        makeSourceClip("Picture", masterPackage, sourceVideoTrackID, 75, 50));

    audioSequence.appendComponentObject(
        makeSourceClip("Sound", masterPackage, sourceAudioTrackID, 0, 50));
    audioSequence.appendComponentObject(audioTransition);
    audioSequence.appendComponentObject(
        makeSourceClip("Sound", masterPackage, sourceAudioTrackID, 75, 50));

    rootComposition.appendNewTimelineTrack(
        Forge.makeRational(25, 1), videoSequence, sourceVideoTrackID, "VideoTrack", 0);
    rootComposition.appendNewTimelineTrack(
        Forge.makeRational(25, 1), audioSequence, sourceAudioTrackID, "AudioTrack", 0);

    return Forge.make(
        Preface.class,
        "ContentStorageObject",
        Forge.make(
            ContentStorage.class,
            "Packages",
            new Package[] {sourceTape, sourceFile, rootComposition, masterPackage}));
  }