Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License").
   * You may not use this file except in compliance with the License.
   * A copy of the License is located at
   * 
   *  http://aws.amazon.com/apache2.0
   * 
  * or in the "license" file accompanying this file. This file is distributed
  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  * express or implied. See the License for the specific language governing
  * permissions and limitations under the License.
  */
 package com.amazonaws.services.elastictranscoder.model;
 

The file format of the output captions. If you leave this value blank, Elastic Transcoder returns an error.

 
 public class CaptionFormat implements SerializableCloneable {

    
The format you specify determines whether Elastic Transcoder generates an embedded or sidecar caption for this output.
  • Valid Embedded Caption Formats:

    • For MP3: None

    • For MP4: mov-text

    • For MPEG-TS: None

    • For ogg: None

    • For webm: None

  • Valid Sidecar Caption Formats: Elastic Transcoder supports dfxp (first div element only), scc, srt, and webvtt. If you want ttml or smpte-tt compatible captions, specify dfxp as your output format.

    • For FMP4: dfxp

    • Non-FMP4 outputs: All sidecar types

    fmp4 captions have an extension of .ismt

Constraints:
Pattern: (^mov-text$)|(^srt$)|(^scc$)|(^webvtt$)|(^dfxp$)

 
     private String format;

    
The prefix for caption filenames, in the form description-{language}, where:
  • description is a description of the video.
  • {language} is a literal value that Elastic Transcoder replaces with the two- or three-letter code for the language of the caption in the output file names.

If you don't include {language} in the file name pattern, Elastic Transcoder automatically appends "{language}" to the value that you specify for the description. In addition, Elastic Transcoder automatically appends the count to the end of the segment files.

For example, suppose you're transcoding into srt format. When you enter "Sydney-{language}-sunrise", and the language of the captions is English (en), the name of the first caption file will be Sydney-en-sunrise00000.srt.

Constraints:
Pattern: (^$)|(^.*\{language\}.*$)

 
     private String pattern;

    
The encryption settings, if any, that you want Elastic Transcoder to apply to your caption formats.
 
     private Encryption encryption;

    
The format you specify determines whether Elastic Transcoder generates an embedded or sidecar caption for this output.
  • Valid Embedded Caption Formats:

    • For MP3: None

    • For MP4: mov-text

    • For MPEG-TS: None

    • For ogg: None

    • For webm: None

  • Valid Sidecar Caption Formats: Elastic Transcoder supports dfxp (first div element only), scc, srt, and webvtt. If you want ttml or smpte-tt compatible captions, specify dfxp as your output format.

    • For FMP4: dfxp

    • Non-FMP4 outputs: All sidecar types

    fmp4 captions have an extension of .ismt

Constraints:
Pattern: (^mov-text$)|(^srt$)|(^scc$)|(^webvtt$)|(^dfxp$)

Returns:
The format you specify determines whether Elastic Transcoder generates an embedded or sidecar caption for this output.
  • Valid Embedded Caption Formats:

    • For MP3: None

    • For MP4: mov-text

    • For MPEG-TS: None

    • For ogg: None

    • For webm: None

  • Valid Sidecar Caption Formats: Elastic Transcoder supports dfxp (first div element only), scc, srt, and webvtt. If you want ttml or smpte-tt compatible captions, specify dfxp as your output format.

    • For FMP4: dfxp

    • Non-FMP4 outputs: All sidecar types

    fmp4 captions have an extension of .ismt

    public String getFormat() {
        return ;
    }
    
    
The format you specify determines whether Elastic Transcoder generates an embedded or sidecar caption for this output.
  • Valid Embedded Caption Formats:

    • For MP3: None

    • For MP4: mov-text

    • For MPEG-TS: None

    • For ogg: None

    • For webm: None

  • Valid Sidecar Caption Formats: Elastic Transcoder supports dfxp (first div element only), scc, srt, and webvtt. If you want ttml or smpte-tt compatible captions, specify dfxp as your output format.

    • For FMP4: dfxp

    • Non-FMP4 outputs: All sidecar types

    fmp4 captions have an extension of .ismt

Constraints:
Pattern: (^mov-text$)|(^srt$)|(^scc$)|(^webvtt$)|(^dfxp$)

Parameters:
format The format you specify determines whether Elastic Transcoder generates an embedded or sidecar caption for this output.
  • Valid Embedded Caption Formats:

    • For MP3: None

    • For MP4: mov-text

    • For MPEG-TS: None

    • For ogg: None

    • For webm: None

  • Valid Sidecar Caption Formats: Elastic Transcoder supports dfxp (first div element only), scc, srt, and webvtt. If you want ttml or smpte-tt compatible captions, specify dfxp as your output format.

    • For FMP4: dfxp

    • Non-FMP4 outputs: All sidecar types

    fmp4 captions have an extension of .ismt

    public void setFormat(String format) {
        this. = format;
    }
    
    
The format you specify determines whether Elastic Transcoder generates an embedded or sidecar caption for this output.
  • Valid Embedded Caption Formats:

    • For MP3: None

    • For MP4: mov-text

    • For MPEG-TS: None

    • For ogg: None

    • For webm: None

  • Valid Sidecar Caption Formats: Elastic Transcoder supports dfxp (first div element only), scc, srt, and webvtt. If you want ttml or smpte-tt compatible captions, specify dfxp as your output format.

    • For FMP4: dfxp

    • Non-FMP4 outputs: All sidecar types

    fmp4 captions have an extension of .ismt

Returns a reference to this object so that method calls can be chained together.

Constraints:
Pattern: (^mov-text$)|(^srt$)|(^scc$)|(^webvtt$)|(^dfxp$)

Parameters:
format The format you specify determines whether Elastic Transcoder generates an embedded or sidecar caption for this output.
  • Valid Embedded Caption Formats:

    • For MP3: None

    • For MP4: mov-text

    • For MPEG-TS: None

    • For ogg: None

    • For webm: None

  • Valid Sidecar Caption Formats: Elastic Transcoder supports dfxp (first div element only), scc, srt, and webvtt. If you want ttml or smpte-tt compatible captions, specify dfxp as your output format.

    • For FMP4: dfxp

    • Non-FMP4 outputs: All sidecar types

    fmp4 captions have an extension of .ismt

Returns:
A reference to this updated object so that method calls can be chained together.
    public CaptionFormat withFormat(String format) {
        this. = format;
        return this;
    }

    
The prefix for caption filenames, in the form description-{language}, where:
  • description is a description of the video.
  • {language} is a literal value that Elastic Transcoder replaces with the two- or three-letter code for the language of the caption in the output file names.

If you don't include {language} in the file name pattern, Elastic Transcoder automatically appends "{language}" to the value that you specify for the description. In addition, Elastic Transcoder automatically appends the count to the end of the segment files.

For example, suppose you're transcoding into srt format. When you enter "Sydney-{language}-sunrise", and the language of the captions is English (en), the name of the first caption file will be Sydney-en-sunrise00000.srt.

Constraints:
Pattern: (^$)|(^.*\{language\}.*$)

Returns:
The prefix for caption filenames, in the form description-{language}, where:
  • description is a description of the video.
  • {language} is a literal value that Elastic Transcoder replaces with the two- or three-letter code for the language of the caption in the output file names.

If you don't include {language} in the file name pattern, Elastic Transcoder automatically appends "{language}" to the value that you specify for the description. In addition, Elastic Transcoder automatically appends the count to the end of the segment files.

For example, suppose you're transcoding into srt format. When you enter "Sydney-{language}-sunrise", and the language of the captions is English (en), the name of the first caption file will be Sydney-en-sunrise00000.srt.

    public String getPattern() {
        return ;
    }
    
    
The prefix for caption filenames, in the form description-{language}, where:
  • description is a description of the video.
  • {language} is a literal value that Elastic Transcoder replaces with the two- or three-letter code for the language of the caption in the output file names.

If you don't include {language} in the file name pattern, Elastic Transcoder automatically appends "{language}" to the value that you specify for the description. In addition, Elastic Transcoder automatically appends the count to the end of the segment files.

For example, suppose you're transcoding into srt format. When you enter "Sydney-{language}-sunrise", and the language of the captions is English (en), the name of the first caption file will be Sydney-en-sunrise00000.srt.

Constraints:
Pattern: (^$)|(^.*\{language\}.*$)

Parameters:
pattern The prefix for caption filenames, in the form description-{language}, where:
  • description is a description of the video.
  • {language} is a literal value that Elastic Transcoder replaces with the two- or three-letter code for the language of the caption in the output file names.

If you don't include {language} in the file name pattern, Elastic Transcoder automatically appends "{language}" to the value that you specify for the description. In addition, Elastic Transcoder automatically appends the count to the end of the segment files.

For example, suppose you're transcoding into srt format. When you enter "Sydney-{language}-sunrise", and the language of the captions is English (en), the name of the first caption file will be Sydney-en-sunrise00000.srt.

    public void setPattern(String pattern) {
        this. = pattern;
    }
    
    
The prefix for caption filenames, in the form description-{language}, where:
  • description is a description of the video.
  • {language} is a literal value that Elastic Transcoder replaces with the two- or three-letter code for the language of the caption in the output file names.

If you don't include {language} in the file name pattern, Elastic Transcoder automatically appends "{language}" to the value that you specify for the description. In addition, Elastic Transcoder automatically appends the count to the end of the segment files.

For example, suppose you're transcoding into srt format. When you enter "Sydney-{language}-sunrise", and the language of the captions is English (en), the name of the first caption file will be Sydney-en-sunrise00000.srt.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Pattern: (^$)|(^.*\{language\}.*$)

Parameters:
pattern The prefix for caption filenames, in the form description-{language}, where:
  • description is a description of the video.
  • {language} is a literal value that Elastic Transcoder replaces with the two- or three-letter code for the language of the caption in the output file names.

If you don't include {language} in the file name pattern, Elastic Transcoder automatically appends "{language}" to the value that you specify for the description. In addition, Elastic Transcoder automatically appends the count to the end of the segment files.

For example, suppose you're transcoding into srt format. When you enter "Sydney-{language}-sunrise", and the language of the captions is English (en), the name of the first caption file will be Sydney-en-sunrise00000.srt.

Returns:
A reference to this updated object so that method calls can be chained together.
    public CaptionFormat withPattern(String pattern) {
        this. = pattern;
        return this;
    }

    
The encryption settings, if any, that you want Elastic Transcoder to apply to your caption formats.

Returns:
The encryption settings, if any, that you want Elastic Transcoder to apply to your caption formats.
    public Encryption getEncryption() {
        return ;
    }
    
    
The encryption settings, if any, that you want Elastic Transcoder to apply to your caption formats.

Parameters:
encryption The encryption settings, if any, that you want Elastic Transcoder to apply to your caption formats.
    public void setEncryption(Encryption encryption) {
        this. = encryption;
    }
    
    
The encryption settings, if any, that you want Elastic Transcoder to apply to your caption formats.

Returns a reference to this object so that method calls can be chained together.

Parameters:
encryption The encryption settings, if any, that you want Elastic Transcoder to apply to your caption formats.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CaptionFormat withEncryption(Encryption encryption) {
        this. = encryption;
        return this;
    }

    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getFormat() != nullsb.append("Format: " + getFormat() + ",");
        if (getPattern() != nullsb.append("Pattern: " + getPattern() + ",");
        if (getEncryption() != nullsb.append("Encryption: " + getEncryption() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getFormat() == null) ? 0 : getFormat().hashCode()); 
        hashCode = prime * hashCode + ((getPattern() == null) ? 0 : getPattern().hashCode()); 
        hashCode = prime * hashCode + ((getEncryption() == null) ? 0 : getEncryption().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof CaptionFormat == falsereturn false;
        CaptionFormat other = (CaptionFormat)obj;
        
        if (other.getFormat() == null ^ this.getFormat() == nullreturn false;
        if (other.getFormat() != null && other.getFormat().equals(this.getFormat()) == falsereturn false
        if (other.getPattern() == null ^ this.getPattern() == nullreturn false;
        if (other.getPattern() != null && other.getPattern().equals(this.getPattern()) == falsereturn false
        if (other.getEncryption() == null ^ this.getEncryption() == nullreturn false;
        if (other.getEncryption() != null && other.getEncryption().equals(this.getEncryption()) == falsereturn false
        return true;
    }
    
    @Override
    public CaptionFormat clone() {
        try {
            return (CaptionFormatsuper.clone();
        
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                    + "even though we're Cloneable!",
                    e);
        }
        
    }
}
    
New to GrepCode? Check out our FAQ X