org.alembik.util
Class TranscodingUtils

java.lang.Object
  extended by org.alembik.util.OMAUtils
      extended by org.alembik.util.TranscodingUtils

public final class TranscodingUtils
extends OMAUtils

The class provides various utility methods for handling TranscodingRequest and TranscodingResponse objects.

It offers a convenient access to most service features, including predefined transformations and file content handling.

Since:
1.0-beta1

Nested Class Summary
static class TranscodingUtils.Coordinates
          The holder class for the transformation content's position and duration segment of visibility.
static class TranscodingUtils.CSSVersion
          The possible types of CSS support in a web document transcoded by the web rendering engine.
static class TranscodingUtils.DetectionLevel
          The possible levels of automatic detection of mobile-enabled sites.
static class TranscodingUtils.FileInfo
          The types of information properties returned to the client on source and transcoded files processed by Alembik.
static class TranscodingUtils.ImageRendering
          The possible options of handling images embedded in a web document transcoded by the web rendering engine.
static class TranscodingUtils.MarkupLanguage
          The mark-up languages supported by the web rendering engine.
static class TranscodingUtils.NavigationBarAttr
          The NavigBar transformation attributes.
static class TranscodingUtils.OverlayLogoAttr
          OverlayLogo transformation attributes.
static class TranscodingUtils.OverlayLogoColor
          The acceptable values of the TranscodingUtils.OverlayLogoAttr.TRANSPARENT_COLOR attribute of the OverlayLogo transformation.
static class TranscodingUtils.PageSizeEval
          The possible algorithms to evaluate the size of a web document transcoded by the web rendering engine.
static class TranscodingUtils.ReloadPolicy
          The possible values for policies used for reloading a source file.
static class TranscodingUtils.SourceProtocol
          The possible values of protocols used to load a source file into the storage.
static class TranscodingUtils.TextOverlayAttr
          The TextOverlay transformation attributes.
static class TranscodingUtils.TextOverlayColor
          The acceptable values of the TranscodingUtils.TextOverlayAttr.COLOR attribute of the TextOverlay transformation.
static class TranscodingUtils.TextOverlayEffect
          The acceptable values of the TranscodingUtils.TextOverlayAttr.EFFECT attribute of the TextOverlay transformation.
static class TranscodingUtils.TextOverlayFamily
          The acceptable values of the TranscodingUtils.TextOverlayAttr.FAMILY attribute of the TextOverlay transformation.
static class TranscodingUtils.TextOverlayFont
          The holder class for the font-related attributes of the TextOverlay transformation.
static class TranscodingUtils.TextOverlayOrientation
          The acceptable values of the TranscodingUtils.TextOverlayAttr.ORIENTATION attribute of the TextOverlay transformation.
static class TranscodingUtils.TextOverlayStyle
          The acceptable values of the TranscodingUtils.TextOverlayAttr.STYLE attribute of the TextOverlay transformation.
 
Field Summary
static java.lang.String CSS_VERSION
          The name of the Text's Property, which defines the TranscodingUtils.CSSVersion value supported by the device.
static java.lang.String IDENTITY_URL
          The name of the TranscodingJob.Source's Property, whose value specifies the identity URL for the source location.
static java.lang.String MARKUP_LANGUAGE
          The name of the Text's Property, which defines the TranscodingUtils.MarkupLanguage value supported by the device.
static java.lang.String MATCHED_ID
          The name of the TranscodingParams' or MediaProperties' Property, by which Alembik returns the proprietary ID (predefined profile, WURFL) of a transcoding profile resolved for the given job.
static java.lang.String MATCHED_QUALITY
          The name of the Property, which carries the quality name of a transcoding profile selected from the predefined profiles list with the "best matching" strategy.
static java.lang.String MOBILE_HTML_SUPPORT
          The name of the Text's Property, whose true value makes Alembik check whether the device can handle a web page without any transcoding.
static java.lang.String MOBILE_IMAGE_RENDERING
          The name of the Text's Property, which defines the TranscodingUtils.ImageRendering policy value for a transcoded web page.
static java.lang.String MOBILE_PAGE_SIZE_EVAL
          The name of the Text's Property, which selects the size evaluation algorithm of a transcoded web page.
static java.lang.String MOBILE_WEB_DETECTION
          The name of the Text's Property, which changes the level of mobile-enabled sites detection.
static java.lang.String NO_COPY_SOURCE_FILE
          The name of the TranscodingJob.Source's Property, whose true value prevents Alembik from copying a source file into its storage folder.
static java.lang.String NO_TRANSCODING
          The name of the TranscodingJob.Target's Property, which makes Alembik load a source file without any transcoding.
static java.lang.String PRESERVE_METADATA
          The name of the Media's Property, whose true value makes Alembik preserve meta-data information in a transcoded file.
static java.lang.String RESIZE_RELATIVE_HEIGHT
          The name of the Media's Property, which specifies the height relative to a device screen height (in percents).
static java.lang.String RESIZE_RELATIVE_WIDTH
          The name of the Media's Property, which specifies the width relative to a device screen width (in percents).
static java.lang.String RESIZE_WEB_RENDER
          The value defining the resize directive for web rendering engine.
static java.lang.String SCREEN_HEIGHT
          The name of the Text's Property, which defines the text height (in pixels).
static java.lang.String SCREEN_WIDTH
          The name of the Text's Property, which defines the text width (in pixels).
static java.lang.String SOURCE_LOC_ESCAPED
          The name of the TranscodingJob.Source's Property, whose true value prevents Alembik from "escaping" the source location.
static java.lang.String SOURCE_OLDER_THAN_TIME
          The name of the TranscodingJob.Source's Property, which prevents Alembik from reloading a source file before the given number of minutes (passed in the property's value) have not elapsed.
static java.lang.String SOURCE_PATH_PREFIX
          The name of the TranscodingJob.Target's Property, which makes Alembik storage add a prefix to its regular path for the source file.
static java.lang.String SOURCE_PROTOCOL_PARAM
          The name of the TranscodingJob.Source's Property, which specifies the TranscodingUtils.SourceProtocol value for fetching a source file.
static java.lang.String SOURCE_RELOAD_POLICY
          The name of the TranscodingJob.Source's Property, which specifies the TranscodingUtils.ReloadPolicy value for handling a source file.
static java.lang.String STATE_PERCENTAGE
          The name of the Property, which defines the progress percentage of a transcoding process.
static java.lang.String STATE_PHASE
          The name of the Property, which defines the Phase value of a transcoding process.
static java.lang.String TARGET_PATH_PREFIX
          The name of the TranscodingJob.Target's Property, which makes Alembik storage add a prefix to its regular path for the transcoded file.
static java.lang.String TO_CACHE_ID
          The name of the TranscodingJob.Source's Property, which defines the cache ID of a content stored in memory.
static java.lang.String TO_CACHE_TIME
          The name of the TranscodingJob.Source's Property, which defines the amount of time (in millis) for which the content should be stored in memory.
static java.lang.String TRANSCODING_HINTABLE
          The name of the TranscodingJob.Target's Property, which specifies if the possible requirement for video hinting should be taken into account when evaluating a transcoding profile out of the list of predefined ones with the "best matching" strategy.
static java.lang.String TRANSCODING_QUALITY
          The name of the TranscodingJob.Target's Property, which defines the desired quality of a transcoding profile chosen from the predefined profiles list with the "best matching" strategy.
static java.lang.String TRANSFORMATION_ADVERTISEMENT_VIDEO
          The type value for the Transformation that inserts a video advertisement before a target video.
static java.lang.String TRANSFORMATION_ADVERTISEMENT_VIDEO_URL
          The Advertisement transformation attribute defining a url of the video advertisement.
static java.lang.String TRANSFORMATION_AGC
          The type value for the Transformation that performs Automatic Gain Control;
static java.lang.String TRANSFORMATION_ANIMATED_TO_STATIC
          The type value for the Transformation that converts an animated image to a static one.
static java.lang.String TRANSFORMATION_BRIGHTNESS
          The type value for the Transformation that performs brightness correction by a declared level.
static java.lang.String TRANSFORMATION_COLOR
          The type value for the Transformation that performs color correction by a declared level.
static java.lang.String TRANSFORMATION_CONTRAST
          The type value for the Transformation that performs contrast correction by a declared level.
static java.lang.String TRANSFORMATION_CROPPING
          The type value for the Transformation that crops an image to a declared area.
static java.lang.String TRANSFORMATION_DOWNLOAD_LIMIT
          The type value for the Transformation that controls the download of a source file.
static java.lang.String TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_DURATION
          The DownloadLimit transformation attribute defining a duration limit (in seconds).
static java.lang.String TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_MAX_COUNT
          The DownloadLimit transformation attribute defining a maximum number of parts for the "progressive segmentation" by size or duration.
static java.lang.String TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_MIN_DURATION
          The DownloadLimit transformation attribute defining the minimum duration of a last source file part obtained through "progressive segmentation" (repeat flag); if it happens to be shorter it will be concatenated with the previous part.
static java.lang.String TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_OFFSET
          The DownloadLimit transformation attribute defining a duration offset (in seconds).
static java.lang.String TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_REPEAT
          The DownloadLimit transformation attribute that activates the "progressive segmentation" of subsequent source file parts of a specified size or duration limit.
static java.lang.String TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_SIZE
          The DownloadLimit transformation attribute defining a size limit (in bytes).
static java.lang.String TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_START
          The DownloadLimit transformation attribute defining a size offset (in bytes).
static java.lang.String TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_TREAT_COMPLETE
          The DownloadLimit transformation attribute that makes the part truncated by size or duration limit be treated like a complete source file.
static java.lang.String TRANSFORMATION_DURATION_LIMIT
          The type value for the Transformation that extracts an audio/video part of a declared duration.
static java.lang.String TRANSFORMATION_DURATION_LIMIT_ATTR_LIMIT
          The DurationLimit transformation attribute defining the duration time (in milliseconds).
static java.lang.String TRANSFORMATION_EXTRACT_FRAME
          The type value for the Transformation that extracts an image from a video.
static java.lang.String TRANSFORMATION_EXTRACT_FRAME_ATTR_SEC
          The ExtractFrame transformation attribute defining the second at which the image frame should be extracted.
static java.lang.String TRANSFORMATION_FRAME_FILL
          The type value for the Transformation that fills the image frame with a specified color.
static java.lang.String TRANSFORMATION_FRAME_RATE_OUTPUT
          The type value for the Transformation that determines the time interval for each frame.
static java.lang.String TRANSFORMATION_FRAME_RATE_SAMPLE
          The type value for the Transformation that changes the number of frames/slides.
static java.lang.String TRANSFORMATION_GIF_PREVIEW
          The type value for the Transformation that extracts an animated GIF image with a video preview.
static java.lang.String TRANSFORMATION_HINTING
          The type value for the Transformation that hints videos after their adaptation.
static java.lang.String TRANSFORMATION_LEVEL_CORRECTION
          The type value for the Transformation realizing image gamma correction.
static java.lang.String TRANSFORMATION_MIRROR
          The type value for the Transformation that performs image mirroring around a specified axis.
static java.lang.String TRANSFORMATION_NAVIGATION_BAR
          The type value for the Transformation that adjusts the default navigition panel appended to a web content by the web rendering processor.
static java.lang.String TRANSFORMATION_NO_LINKS
          The type value for the Transformation that makes web rendering processor remove all hyperlinks from a web content.
static java.lang.String TRANSFORMATION_NOISE_REDUCTION
          The type value for the Transformation that reduces noise of an image.
static java.lang.String TRANSFORMATION_NUMBER_OF_FRAMES
          The type value for the Transformation that changes the number of frames/slides in the output.
static java.lang.String TRANSFORMATION_OFFSET
          The type value for the Transformation that extracts an audio/video part starting from a declared offset.
static java.lang.String TRANSFORMATION_OFFSET_ATTR_START
          The Offset transformation attribute defining starting moment (in milliseconds).
static java.lang.String TRANSFORMATION_ONLY_TEXT
          The type value for the Transformation that makes web rendering processor extract the pure text content from a web content.
static java.lang.String TRANSFORMATION_ORGANIZE_TEXT
          The type value for the Transformation that makes web rendering processor organize a web content.
static java.lang.String TRANSFORMATION_OVERLAY_LOGO
          The type value for the Transformation that overlays a logo (image) on an image or a video.
static java.lang.String TRANSFORMATION_ROTATION
          The type value for the Transformation that rotates an image by a declared angle.
static java.lang.String TRANSFORMATION_SHARPEN
          The type value for the Transformation that performs image sharpening.
static java.lang.String TRANSFORMATION_STREAMING
          The type value for the Transformation that makes the video output be streamed.
static java.lang.String TRANSFORMATION_TEXT_OVERLAY
          The type value for the Transformation that overlays text on an image or a video.
 
Fields inherited from class org.alembik.util.OMAUtils
CHANNEL_MONO, CHANNEL_STEREO, COLOR_SCHEME_PALETTE_COLOR, COLOR_SCHEME_PALETTE_GREY, COLOR_SCHEME_TRUE, RESIZE_ASPECT_RATIO, RESIZE_CROP, RESIZE_STRETCH
 
Constructor Summary
TranscodingUtils()
           
 
Method Summary
static void addRelativeResize(Media media, java.lang.Integer widthPercent, java.lang.Integer heightPercent, java.lang.String resizeDirective)
          Sets desired content dimensions relative to a target device screen.
static void addResize(Media media, java.lang.Integer width, java.lang.Integer height, java.lang.String resizeDirective)
          Sets desired dimensions for a transcoded content, which will be resized according to the passed resizeDirective argument.
static TranscodingJob createNewJob(java.lang.String jobID, java.lang.String url, java.lang.String contentType)
          Creates a basic transcoding job instance.
static TranscodingRequest createRequest(java.lang.String originatorID, java.lang.String sourceUrl, java.lang.String profileID)
          Creates a single-job transcoding request instance with basic transcoding parameters.
static TranscodingRequest createRequest(java.lang.String originatorID, java.lang.String sourceUrl, java.lang.String profileID, java.lang.String contentType)
          Creates a single-job transcoding request instance with basic transcoding parameters.
static void disableNoTranscoding(TranscodingJob job)
          Removes the "no transcoding" flag from the given transcoding job.
static java.lang.String getAdverstisementVideo(TranscodingJob job)
          Returns the location of a video to be inserted in front of the video of the given transcoding job as specified by the Advertisement transformation.
static Quality getBestMatchingQuality(TranscodingJob job)
          Returns the quality set for the given transcoding job, which defines the expected quality level of the matching profile.
static java.lang.String getCacheId(TranscodingJob job)
          Returns the key, under which the content of the given transcoding job is to be stored in a memory-based cache.
static java.lang.Long getCacheTime(TranscodingJob job)
          Returns the period of time, for which the content of the given transcoding job will be stored in a memory-based cache.
static TranscodingUtils.CSSVersion getCSSVersion(Text text)
          Returns the CSS support type of a transcoded page.
static java.lang.Integer getDownloadDuration(TranscodingJob job)
          Returns the duration limit of a source file of the given transcoding job specified by the DownloadLimit transformation.
static java.lang.Integer getDownloadMaxCount(TranscodingJob job)
          Returns the maximum number of parts of a source file to be produced by the "progressive segmentation" process requested by the DownloadLimit transformation in the given transcoding job.
static java.lang.Integer getDownloadMinDuration(TranscodingJob job)
          Returns the required minimum duration of the last part of a source file to be produced by the "progressive segmentation" process requested by the DownloadLimit transformation in the given transcoding job.
static java.lang.Integer getDownloadOffset(TranscodingJob job)
          Returns the duration offset of a source file of the given transcoding job specified by the DownloadLimit transformation.
static java.lang.Long getDownloadSize(TranscodingJob job)
          Returns the size limit of a source file of the given transcoding job specified by the DownloadLimit transformation.
static java.lang.Long getDownloadStart(TranscodingJob job)
          Returns the size offset of a source file of the given transcoding job specified by the DownloadLimit transformation.
static java.lang.Integer getDuration(TranscodingJob job)
          Returns the duration length of the given transcoding job specified by the Offset transformation.
static java.lang.Integer getExtractFrameSecond(TranscodingJob job)
          Returns the second at which the frame will be extracted from a video of the given transcoding job as specified by the ExtractFrame transformation.
static java.lang.String getIdentityUrl(TranscodingJob job)
          Returns the identity URL of the given transcoding job.
static long getIfOlderThanTime(TranscodingJob job)
          Returns the number of minutes specified for TranscodingUtils.ReloadPolicy.IF_OLDER_THAN policy.
static TranscodingUtils.ImageRendering getImageRendering(Text text)
          Returns the image rendering option selected for a transcoded page.
static java.lang.String getInternalSourcePathPrefix(TranscodingJob job)
          Gets the path prefix (i.e. folder name) of a storage folder where a source file will be placed.
static java.lang.String getInternalTargetPathPrefix(TranscodingJob job)
          Gets the path prefix (i.e. folder name) of a storage folder where a transcoded file will be placed.
static TranscodingUtils.MarkupLanguage getMarkupLanguage(Text text)
          Returns the markup language set for a transcoded page.
static java.lang.String getMatchedId(JobResult result)
          Returns the proprietary identifier of a transcoding profile resolved by Alembik.
static java.lang.String getMatchedId(TranscodingParams profile)
          Returns the proprietary identifier of a transcoding profile resolved by Alembik.
static TranscodingUtils.DetectionLevel getMobileWebDetectionLevel(TranscodingJob job)
          Returns the mobile page detection level of the given transcoding job.
static java.util.Map<TranscodingUtils.NavigationBarAttr,java.lang.String> getNavigationBarAttrs(TranscodingJob job)
          Returns the map of the NavigBar transformation attributes, which have been set for the given transcoding job.
static java.lang.Integer getOffset(TranscodingJob job)
          Returns the duration offset of the given transcoding job specified by the Offset transformation.
static java.util.Map<TranscodingUtils.OverlayLogoAttr,java.lang.String> getOverlayLogoAttrs(TranscodingJob job)
          Returns the map of the OverlayLogo transformation attributes, which have been set for the given transcoding job.
static TranscodingUtils.PageSizeEval getPageSizeEval(Text text)
          Returns the page size evaluation algorithm of a transcoded page.
static TranscodingUtils.SourceProtocol getProtocol(TranscodingJob job)
          Returns the protocol specified for fetching a source file of the given transcoding job.
static java.lang.Integer getRelativeHeight(Media media)
          Returns the height percentage requested for the resize relative to the device screen height.
static java.lang.Integer getRelativeWidth(Media media)
          Returns the width percentage requested for the resize relative to the device screen width.
static TranscodingUtils.ReloadPolicy getReloadPolicy(TranscodingJob job)
          Returns the policy of reloading of a source file of the given transcoding job.
static java.lang.String getResultInfo(JobResult result, TranscodingUtils.FileInfo key)
          Returns the value of the given information property.
static Quality getResultQuality(JobResult result)
          Returns the quality of the profile selected by the "best matching" strategy.
static TranscodingState getResultState(JobResult result)
          Returns the information about the state of a transcoding process.
static java.lang.Integer getScreenHeight(Text text)
          Returns the height requested for a text document transcoded by the web rendering engine.
static java.lang.Integer getScreenWidth(Text text)
          Returns the width requested for a text document transcoded by the web rendering engine.
static java.util.Map<TranscodingUtils.TextOverlayAttr,java.lang.String> getTextOverlayAttrs(TranscodingJob job)
          Returns the map of the TextOverlay transformation attributes, which have been set for the given transcoding job.
static boolean isBestMatchingHintable(TranscodingJob job)
          Checks whether the "best matching" strategy should take into account the devices, which require hinted video files.
static boolean isBestMatchingRequested(TranscodingJob job)
          Checks whether the given transcoding job has the "best matching" strategy applied.
static boolean isDownloadRepeat(TranscodingJob job)
          Checks whether the "progressive segmentation" has been requested in the DownloadLimit transformation for the given transcoding job.
static boolean isDownloadTreatedAsComplete(TranscodingJob job)
          Checks whether a source file truncated by the DownloadLimit transformation should be treated as the complete file when processing subsequent transcoding jobs.
static boolean isHinting(Media media)
          Checks whether the given video job is to be hinted.
static boolean isHinting(TranscodingJob job)
          Checks whether the given video is to be hinted.
static boolean isHTMLDetection(Media media)
          Checks whether the HTML support detection has been enabled; by default it is disabled.
static boolean isHTMLDetection(TranscodingJob job)
          Checks whether the HTML support detection has been enabled; by default it is disabled.
static boolean isNotCopySource(TranscodingJob job)
          Checks whether the source file will not be loaded into storage.
static boolean isNoTranscodingSet(TranscodingJob job)
          Checks whether a content of the given transcoding job is to be transcoded.
static boolean isPreserveMetadata(Media media)
          Checks whether the media content's meta-data is to be retained in a transcoded file.
static boolean isSourceLocationEscaped(TranscodingJob job)
          Checks whether the source location of the given transcoding job is already escaped.
static boolean isStreaming(Media media)
          Checks whether the given video job is to be streamed.
static boolean isStreaming(TranscodingJob job)
          Checks whether the given video job is to be streamed.
static void removeIdentityUrl(TranscodingJob job)
          Removes the identity URL parameter from the given transcoding job.
static void removePreserveMetadata(Media media)
          Disables the meta-data preserving request for a media object representing a file to be transcoded.
static void removeRelativeDimensions(Media media)
          Removes relative dimension values if set.
static void setAdvertisementVideo(TranscodingJob job, java.lang.String videoURL)
          Applies Advertisement transformation, which makes Alembik insert another video at the start of a video of the given video transcoding job.
static void setBestMatchingQuality(TranscodingJob job, Quality quality)
          Applies the "best matching" strategy for the given transcoding job and quality.
static void setBestMatchingQuality(TranscodingJob job, Quality quality, boolean hintable)
          Applies the "best matching" strategy for the given transcoding job.
static void setCSSVersion(Text text, TranscodingUtils.CSSVersion cssVersion)
          Sets the desired CSS support for a page to be transcoded.
static void setDimensions(Media media, java.lang.Integer width, java.lang.Integer height)
          Sets the desired width and height for a transcoded content.
static void setDownloadApproxDuration(TranscodingJob job, int approxDuration)
          Deprecated. use setDownloadDurationLimit(TranscodingJob, int) instead
static void setDownloadApproxDuration(TranscodingJob job, int approxDuration, boolean treatAsComplete)
          Deprecated. use setDownloadDurationLimit(TranscodingJob, int, boolean) instead
static void setDownloadDurationLimit(TranscodingJob job, int duration)
          Applies DownloadLimit transformation for the given transcoding job, which will make Alembik media loader truncate a source file after reaching (approximately) the given number of seconds.
static void setDownloadDurationLimit(TranscodingJob job, int duration, boolean treatAsComplete)
          Applies DownloadLimit transformation for the given transcoding job, which will make Alembik media loader truncate a source file after reaching (approximately) the given number of seconds.
static void setDownloadDurationSegment(TranscodingJob job, int offset, int duration)
          Applies DownloadLimit transformation for the given transcoding job, which is usually used to reference a particular source file part from the "progressive segmentation" (see setProgressiveDownloadByDuration(TranscodingJob, int).
static void setDownloadLimit(TranscodingJob job, long downloadLimit)
          Deprecated. use setDownloadSizeLimit(TranscodingJob, long) instead
static void setDownloadLimit(TranscodingJob job, long downloadLimit, boolean treatAsComplete)
          Deprecated. use setDownloadSizeLimit(TranscodingJob, long, boolean) instead
static void setDownloadSizeAndDurationLimit(TranscodingJob job, int duration, long size)
          Applies DownloadLimit transformation for the given transcoding job, which will make Alembik media loader truncate a source file after reaching first of the specified limits: the given number of seconds (approximately) or the given number of bytes.
static void setDownloadSizeLimit(TranscodingJob job, long size)
          Applies DownloadLimit transformation for the given transcoding job, which will make Alembik media loader truncate a source file after reaching the given size limit.
static void setDownloadSizeLimit(TranscodingJob job, long size, boolean treatAsComplete)
          Applies DownloadLimit transformation for the given transcoding job, which will make Alembik media loader truncate a source file after reaching the given size limit.
static void setDownloadSizeSegment(TranscodingJob job, long start, long size)
          Applies DownloadLimit transformation for the given transcoding job, which is usually used to reference a particular source file part from the "progressive segmentation" (see setProgressiveDownloadBySize(TranscodingJob, long).
static void setExtractFrame(TranscodingJob job, java.lang.String contentType, int second)
          Applies ExtractFrame transformation for the given video transcoding job, which makes Alembik extract an image frame at the specified second.
static void setExtractGifPreview(TranscodingJob job)
          Applies GifPreview transformation for the given video transcoding job, which makes Alembik generate an animated GIF.
static void setHinting(Media media)
          Requests video hinting for the given video job.
static void setHTMLDetection(TranscodingJob job, boolean enable)
          Enables or disables the HTML support detection for the given transcoding job.
static void setIdentityUrl(TranscodingJob job, java.lang.String identityUrl)
          Declares the identity URL for the given transcoding job.
static void setIfOlderThanTime(TranscodingJob job, long minutes)
          Sets the number of minutes that must elapse before Alembik checks if the file is actual.
static void setImageOverlayLogo(TranscodingJob job, java.lang.String location, TranscodingUtils.OverlayLogoColor transparentColor, java.lang.Integer imageWidth)
          Applies OverlayLogo transformation, which will make Alembik lay a logo (image) over the image of the given transcoding job.
static void setImageRendering(Text text, TranscodingUtils.ImageRendering option)
          Requests the specified image rendering option for a page to be transcoded.
static void setImageTextOverlay(TranscodingJob job, java.lang.String message, TranscodingUtils.TextOverlayFont font)
          Applies TextOverlay transformation, which will make Alembik lay a text (message) over an image of the given transcoding job.
static void setInternalPathPrefix(TranscodingJob job, java.lang.String prefix)
          Imposes a special prefix (i.e. extra folder) in the storage path where both source and transcoded files are to be placed.
static void setInternalSourcePathPrefix(TranscodingJob job, java.lang.String prefix)
          Imposes a special prefix (i.e. extra folder) in the storage path where a source file is to be placed.
static void setInternalTargetPathPrefix(TranscodingJob job, java.lang.String prefix)
          Imposes a special prefix (i.e. extra folder) in the storage path where a transcoded file is to be placed.
static void setMarkupLanguage(Text text, TranscodingUtils.MarkupLanguage markupLanguage)
          Sets the desired markup language for a page to be transcoded.
static void setMobileWebDetectionLevel(TranscodingJob job, TranscodingUtils.DetectionLevel level)
          Requests the specified mobile page detection level for a web document of the given transcoding job.
static void setNavigationBarAttrs(TranscodingJob job, java.util.Map<TranscodingUtils.NavigationBarAttr,java.lang.String> attrsMap)
          Sets a desired set of NavigBar transformation attributes, which will adjust look and behaviour of the navigation panel displayed within transcoded web documents.
static void setNoLinks(TranscodingJob job)
          Applies NoLinks transformation, which makes Alembik remove all hyperlinks from of a web document of the given transcoding job.
static void setNoTranscoding(TranscodingJob job)
          Prevents Alembik from performing any transcoding for the given transcoding job; only the source file will be loaded into the storage.
static void setOnlyText(TranscodingJob job)
          Applies OnlyText transformation, which makes Alembik remove all hyperlinks and embedded content (images, videos, etc) from of a web document of the given transcoding job.
static void setOrganizeText(TranscodingJob job)
          Applies OrganizeText transformation, which makes Alembik re-organize the logical blocks of a web document of the given transcoding job.
static void setPageSizeEval(Text text, TranscodingUtils.PageSizeEval eval)
          Requests the specified algorithm evaluating the size of a transcoded page.
static void setPreserveMetadata(Media media)
          Requests Alembik to retain the media content's meta-data in a transcoded file.
static void setProgressiveDownloadByDuration(TranscodingJob job, int segmentDuration)
          Applies DownloadLimit transformation for the given transcoding job, which makes Alembik perform the "progressive segmentation" of a source file while loading it.
static void setProgressiveDownloadByDuration(TranscodingJob job, int segmentDuration, java.lang.Integer minDuration, java.lang.Integer maxCount)
          Applies DownloadLimit transformation for the given transcoding job, which makes Alembik perform the "progressive segmentation" of a source file while loading it.
static void setProgressiveDownloadBySize(TranscodingJob job, long segmentSize)
          Applies DownloadLimit transformation for the given transcoding job, which makes Alembik perform the "progressive segmentation" of a source file while loading it.
static void setProgressiveDownloadBySize(TranscodingJob job, long segmentSize, int maxCount)
          Applies DownloadLimit transformation for the given transcoding job, which makes Alembik perform the "progressive segmentation" of a source file while loading it.
static void setProtocol(TranscodingJob job, TranscodingUtils.SourceProtocol protocol)
          Sets the protocol to be used to load a source content into the storage.
static void setProtocol(TranscodingJob job, TranscodingUtils.SourceProtocol protocol, boolean noCopy)
          Sets the TranscodingUtils.SourceProtocol to be used to load a source content.
static void setReloadPolicy(TranscodingJob job, TranscodingUtils.ReloadPolicy reloadPolicy)
          Sets the required policy of reloading of a source file of the given transcoding job.
static void setSegmentBoundaries(TranscodingJob job, java.lang.Integer offset, java.lang.Integer duration)
          Specifies the desired duration segment of the given audio or video job to transcode.
static void setSourceLocationEscaped(TranscodingJob job, boolean escaped)
          Sets the flag indicating that the source location of the given transcoding job is already prepared for HTTP manipulations and does not need to be preprocessed (escaped) again.
static void setToCache(TranscodingJob job, java.lang.String cacheId, long cacheTime)
          Defines the key and expiry time for storing the content in a memory-based cache.
static void setVideoOverlayLogo(TranscodingJob job, java.lang.String location, TranscodingUtils.Coordinates coordinates, java.lang.Integer imageWidth)
          Applies OverlayLogo transformation, which will make Alembik lay a logo (image) over the video of the given transcoding job.
static void setVideoTextOverlay(TranscodingJob job, java.lang.String message, TranscodingUtils.TextOverlayFont font, TranscodingUtils.Coordinates coordinates)
          Applies TextOverlay transformation, which will make Alembik lay a static text (message) over a video of the given transcoding job.
static void setVideoTextScrollOverlay(TranscodingJob job, java.lang.String message, TranscodingUtils.TextOverlayFont font, TranscodingUtils.Coordinates coordinates)
          Applies TextOverlay transformation, which will make Alembik lay a scrolling text (message) over a video of the given transcoding job.
 
Methods inherited from class org.alembik.util.OMAUtils
addReturnResult, addReturnResult, createProperty, createReturnResult, findProperty, findTransformation, getAttributeProperties, getExtensionProperties, getExtensionProperties, getExtensionProperties, getExtensionProperties, getExtensionProperties, getExtensionProperties, getExtensionProperties, getExtensionProperties, getExtensionProperties, getMedia, getOutputMediaProperties, getPropertiesMap, getPropertiesMap, getPropertyValue, getReturnResults, getReturnResults, getSizeLimit, getTransformations, removeTransformation, removeTransformation, setMedia, setProperty, setResizeDirective, setTransformation
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESIZE_WEB_RENDER

public static final java.lang.String RESIZE_WEB_RENDER
The value defining the resize directive for web rendering engine. NOTE: the value is for internal only.

See Also:
OMAUtils.setResizeDirective(Media, String), Image.setResizeDirective(String), Video.VideoVisual.setResizeDirective(String), Constant Field Values

RESIZE_RELATIVE_WIDTH

public static final java.lang.String RESIZE_RELATIVE_WIDTH
The name of the Media's Property, which specifies the width relative to a device screen width (in percents).

See Also:
addRelativeResize(Media, Integer, Integer, String), getRelativeWidth(Media), Media.getExtensionData(), Constant Field Values

RESIZE_RELATIVE_HEIGHT

public static final java.lang.String RESIZE_RELATIVE_HEIGHT
The name of the Media's Property, which specifies the height relative to a device screen height (in percents).

See Also:
addRelativeResize(Media, Integer, Integer, String), getRelativeHeight(Media), Media.getExtensionData(), Constant Field Values

SOURCE_PROTOCOL_PARAM

public static final java.lang.String SOURCE_PROTOCOL_PARAM
The name of the TranscodingJob.Source's Property, which specifies the TranscodingUtils.SourceProtocol value for fetching a source file.

See Also:
setProtocol(TranscodingJob, org.alembik.util.TranscodingUtils.SourceProtocol), getProtocol(TranscodingJob), TranscodingJob.Source.getExtensionData(), Constant Field Values

NO_COPY_SOURCE_FILE

public static final java.lang.String NO_COPY_SOURCE_FILE
The name of the TranscodingJob.Source's Property, whose true value prevents Alembik from copying a source file into its storage folder.

See Also:
setProtocol(TranscodingJob, org.alembik.util.TranscodingUtils.SourceProtocol, boolean), isNotCopySource(TranscodingJob), TranscodingJob.Source.getExtensionData(), Constant Field Values

SOURCE_RELOAD_POLICY

public static final java.lang.String SOURCE_RELOAD_POLICY
The name of the TranscodingJob.Source's Property, which specifies the TranscodingUtils.ReloadPolicy value for handling a source file.

See Also:
setReloadPolicy(TranscodingJob, org.alembik.util.TranscodingUtils.ReloadPolicy), getReloadPolicy(TranscodingJob), TranscodingJob.Source.getExtensionData(), Constant Field Values

SOURCE_OLDER_THAN_TIME

public static final java.lang.String SOURCE_OLDER_THAN_TIME
The name of the TranscodingJob.Source's Property, which prevents Alembik from reloading a source file before the given number of minutes (passed in the property's value) have not elapsed. This property works only in conjunction with TranscodingUtils.ReloadPolicy.IF_OLDER_THAN policy.

See Also:
setIfOlderThanTime(TranscodingJob, long), getIfOlderThanTime(TranscodingJob), TranscodingJob.Source.getExtensionData(), Constant Field Values

NO_TRANSCODING

public static final java.lang.String NO_TRANSCODING
The name of the TranscodingJob.Target's Property, which makes Alembik load a source file without any transcoding.

See Also:
setNoTranscoding(TranscodingJob), isNoTranscodingSet(TranscodingJob), TranscodingJob.Target.getExtensionData(), Constant Field Values

SOURCE_PATH_PREFIX

public static final java.lang.String SOURCE_PATH_PREFIX
The name of the TranscodingJob.Target's Property, which makes Alembik storage add a prefix to its regular path for the file. The prefix is actually resolved to an extra folder inserted at the storage root, whose name is specified by the property's value.

See Also:
setInternalSourcePathPrefix(TranscodingJob, String), getInternalSourcePathPrefix(TranscodingJob), TranscodingJob.Target.getExtensionData(), Constant Field Values

TARGET_PATH_PREFIX

public static final java.lang.String TARGET_PATH_PREFIX
The name of the TranscodingJob.Target's Property, which makes Alembik storage add a prefix to its regular path for the file. The prefix is actually resolved to an extra folder inserted at the storage root, whose name is specified by the property's value.

See Also:
setInternalTargetPathPrefix(TranscodingJob, String), getInternalTargetPathPrefix(TranscodingJob), TranscodingJob.Target.getExtensionData(), Constant Field Values

IDENTITY_URL

public static final java.lang.String IDENTITY_URL
The name of the TranscodingJob.Source's Property, whose value specifies the identity URL for the source location.

See Also:
setIdentityUrl(TranscodingJob, String), getIdentityUrl(TranscodingJob), TranscodingJob.Source.getExtensionData(), Constant Field Values

SOURCE_LOC_ESCAPED

public static final java.lang.String SOURCE_LOC_ESCAPED
The name of the TranscodingJob.Source's Property, whose true value prevents Alembik from "escaping" the source location.

See Also:
setSourceLocationEscaped(TranscodingJob, boolean), isSourceLocationEscaped(TranscodingJob), TranscodingJob.Source.getExtensionData(), Constant Field Values

PRESERVE_METADATA

public static final java.lang.String PRESERVE_METADATA
The name of the Media's Property, whose true value makes Alembik preserve meta-data information in a transcoded file.

See Also:
setPreserveMetadata(Media), isPreserveMetadata(Media), Media.getExtensionData(), Constant Field Values

MARKUP_LANGUAGE

public static final java.lang.String MARKUP_LANGUAGE
The name of the Text's Property, which defines the TranscodingUtils.MarkupLanguage value supported by the device.

See Also:
setMarkupLanguage(Text, org.alembik.util.TranscodingUtils.MarkupLanguage), getMarkupLanguage(Text), Media.getExtensionData(), Constant Field Values

CSS_VERSION

public static final java.lang.String CSS_VERSION
The name of the Text's Property, which defines the TranscodingUtils.CSSVersion value supported by the device.

See Also:
setCSSVersion(Text, org.alembik.util.TranscodingUtils.CSSVersion), getCSSVersion(Text), Media.getExtensionData(), Constant Field Values

SCREEN_WIDTH

public static final java.lang.String SCREEN_WIDTH
The name of the Text's Property, which defines the text width (in pixels). This property is used in web rendering for declaring the actual screen width of a device.

See Also:
setDimensions(Media, Integer, Integer), Media.getExtensionData(), Constant Field Values

SCREEN_HEIGHT

public static final java.lang.String SCREEN_HEIGHT
The name of the Text's Property, which defines the text height (in pixels). This property is used in web rendering for declaring the actual screen height of a device.

See Also:
setDimensions(Media, Integer, Integer), Media.getExtensionData(), Constant Field Values

MOBILE_PAGE_SIZE_EVAL

public static final java.lang.String MOBILE_PAGE_SIZE_EVAL
The name of the Text's Property, which selects the size evaluation algorithm of a transcoded web page. The acceptable values for this property are defined in TranscodingUtils.PageSizeEval enumeration.

See Also:
setPageSizeEval(Text, org.alembik.util.TranscodingUtils.PageSizeEval), getPageSizeEval(Text), Media.getExtensionData(), Constant Field Values

MOBILE_WEB_DETECTION

public static final java.lang.String MOBILE_WEB_DETECTION
The name of the Text's Property, which changes the level of mobile-enabled sites detection. The acceptable values for this property are defined in TranscodingUtils.DetectionLevel enumeration.

See Also:
setMobileWebDetectionLevel(TranscodingJob, org.alembik.util.TranscodingUtils.DetectionLevel), getMobileWebDetectionLevel(TranscodingJob), Media.getExtensionData(), Constant Field Values

MOBILE_IMAGE_RENDERING

public static final java.lang.String MOBILE_IMAGE_RENDERING
The name of the Text's Property, which defines the TranscodingUtils.ImageRendering policy value for a transcoded web page.

See Also:
setImageRendering(Text, org.alembik.util.TranscodingUtils.ImageRendering), getImageRendering(Text), Media.getExtensionData(), Constant Field Values

MOBILE_HTML_SUPPORT

public static final java.lang.String MOBILE_HTML_SUPPORT
The name of the Text's Property, whose true value makes Alembik check whether the device can handle a web page without any transcoding.

See Also:
setHTMLDetection(TranscodingJob, boolean), isHTMLDetection(Media), Media.getExtensionData(), Constant Field Values

STATE_PHASE

public static final java.lang.String STATE_PHASE
The name of the Property, which defines the Phase value of a transcoding process. This property is returned by Alembik within a JobResult's MediaProperties object.

See Also:
TranscodingService.getTranscodingInfo(TranscodingRequest, String), getResultState(JobResult), MediaProperties.getExtensionData(), Constant Field Values

STATE_PERCENTAGE

public static final java.lang.String STATE_PERCENTAGE
The name of the Property, which defines the progress percentage of a transcoding process. This property is returned by Alembik within a JobResult's MediaProperties object.

See Also:
TranscodingService.getTranscodingInfo(TranscodingRequest, String), getResultState(JobResult), MediaProperties.getExtensionData(), Constant Field Values

TRANSCODING_QUALITY

public static final java.lang.String TRANSCODING_QUALITY
The name of the TranscodingJob.Target's Property, which defines the desired quality of a transcoding profile chosen from the predefined profiles list with the "best matching" strategy.

See Also:
setBestMatchingQuality(TranscodingJob, Quality, boolean), getBestMatchingQuality(TranscodingJob), TranscodingJob.Target.getExtensionData(), Constant Field Values

TRANSCODING_HINTABLE

public static final java.lang.String TRANSCODING_HINTABLE
The name of the TranscodingJob.Target's Property, which specifies if the possible requirement for video hinting should be taken into account when evaluating a transcoding profile out of the list of predefined ones with the "best matching" strategy.

See Also:
setBestMatchingQuality(TranscodingJob, Quality, boolean), getBestMatchingQuality(TranscodingJob), TranscodingJob.Target.getExtensionData(), Constant Field Values

MATCHED_QUALITY

public static final java.lang.String MATCHED_QUALITY
The name of the Property, which carries the quality name of a transcoding profile selected from the predefined profiles list with the "best matching" strategy. This property is returned by Alembik within a JobResult's MediaProperties object.

See Also:
TranscodingService.processSync(TranscodingRequest), TranscodingService.getTranscodingInfo(TranscodingRequest, String), setBestMatchingQuality(TranscodingJob, Quality), MediaProperties.getExtensionData(), Constant Field Values

MATCHED_ID

public static final java.lang.String MATCHED_ID
The name of the TranscodingParams' or MediaProperties' Property, by which Alembik returns the proprietary ID (predefined profile, WURFL) of a transcoding profile resolved for the given job.

See Also:
TranscodingService.getTranscodingProfile(TranscodingJob), getMatchedId(TranscodingParams), TranscodingParams.getExtensionData(), TranscodingService.processSync(TranscodingRequest), getMatchedId(JobResult), MediaProperties.getExtensionData(), Constant Field Values

TO_CACHE_ID

public static final java.lang.String TO_CACHE_ID
The name of the TranscodingJob.Source's Property, which defines the cache ID of a content stored in memory.

See Also:
setToCache(TranscodingJob, String, long), getCacheId(TranscodingJob), TranscodingJob.Source.getExtensionData(), Constant Field Values

TO_CACHE_TIME

public static final java.lang.String TO_CACHE_TIME
The name of the TranscodingJob.Source's Property, which defines the amount of time (in millis) for which the content should be stored in memory.

See Also:
setToCache(TranscodingJob, String, long), getCacheTime(TranscodingJob), TranscodingJob.Source.getExtensionData(), Constant Field Values

TRANSFORMATION_LEVEL_CORRECTION

public static final java.lang.String TRANSFORMATION_LEVEL_CORRECTION
The type value for the Transformation realizing image gamma correction.

See Also:
Constant Field Values

TRANSFORMATION_MIRROR

public static final java.lang.String TRANSFORMATION_MIRROR
The type value for the Transformation that performs image mirroring around a specified axis.

See Also:
Constant Field Values

TRANSFORMATION_NOISE_REDUCTION

public static final java.lang.String TRANSFORMATION_NOISE_REDUCTION
The type value for the Transformation that reduces noise of an image.

See Also:
Constant Field Values

TRANSFORMATION_ROTATION

public static final java.lang.String TRANSFORMATION_ROTATION
The type value for the Transformation that rotates an image by a declared angle.

See Also:
Constant Field Values

TRANSFORMATION_SHARPEN

public static final java.lang.String TRANSFORMATION_SHARPEN
The type value for the Transformation that performs image sharpening.

See Also:
Constant Field Values

TRANSFORMATION_CROPPING

public static final java.lang.String TRANSFORMATION_CROPPING
The type value for the Transformation that crops an image to a declared area.

See Also:
Constant Field Values

TRANSFORMATION_FRAME_FILL

public static final java.lang.String TRANSFORMATION_FRAME_FILL
The type value for the Transformation that fills the image frame with a specified color.

See Also:
Constant Field Values

TRANSFORMATION_FRAME_RATE_SAMPLE

public static final java.lang.String TRANSFORMATION_FRAME_RATE_SAMPLE
The type value for the Transformation that changes the number of frames/slides.

See Also:
Constant Field Values

TRANSFORMATION_FRAME_RATE_OUTPUT

public static final java.lang.String TRANSFORMATION_FRAME_RATE_OUTPUT
The type value for the Transformation that determines the time interval for each frame.

See Also:
Constant Field Values

TRANSFORMATION_NUMBER_OF_FRAMES

public static final java.lang.String TRANSFORMATION_NUMBER_OF_FRAMES
The type value for the Transformation that changes the number of frames/slides in the output.

See Also:
Constant Field Values

TRANSFORMATION_BRIGHTNESS

public static final java.lang.String TRANSFORMATION_BRIGHTNESS
The type value for the Transformation that performs brightness correction by a declared level.

See Also:
Constant Field Values

TRANSFORMATION_CONTRAST

public static final java.lang.String TRANSFORMATION_CONTRAST
The type value for the Transformation that performs contrast correction by a declared level.

See Also:
Constant Field Values

TRANSFORMATION_COLOR

public static final java.lang.String TRANSFORMATION_COLOR
The type value for the Transformation that performs color correction by a declared level.

See Also:
Constant Field Values

TRANSFORMATION_ANIMATED_TO_STATIC

public static final java.lang.String TRANSFORMATION_ANIMATED_TO_STATIC
The type value for the Transformation that converts an animated image to a static one.

See Also:
Constant Field Values

TRANSFORMATION_AGC

public static final java.lang.String TRANSFORMATION_AGC
The type value for the Transformation that performs Automatic Gain Control;

See Also:
Constant Field Values

TRANSFORMATION_OVERLAY_LOGO

public static final java.lang.String TRANSFORMATION_OVERLAY_LOGO
The type value for the Transformation that overlays a logo (image) on an image or a video.

See Also:
TranscodingUtils.OverlayLogoAttr, setImageOverlayLogo(TranscodingJob, String, org.alembik.util.TranscodingUtils.OverlayLogoColor, Integer), setVideoOverlayLogo(TranscodingJob, String, org.alembik.util.TranscodingUtils.Coordinates, Integer), Constant Field Values

TRANSFORMATION_TEXT_OVERLAY

public static final java.lang.String TRANSFORMATION_TEXT_OVERLAY
The type value for the Transformation that overlays text on an image or a video.

See Also:
TranscodingUtils.TextOverlayAttr, setImageTextOverlay(TranscodingJob, String, org.alembik.util.TranscodingUtils.TextOverlayFont), setVideoTextOverlay(TranscodingJob, String, org.alembik.util.TranscodingUtils.TextOverlayFont, org.alembik.util.TranscodingUtils.Coordinates), setVideoTextScrollOverlay(TranscodingJob, String, org.alembik.util.TranscodingUtils.TextOverlayFont, org.alembik.util.TranscodingUtils.Coordinates), Constant Field Values

TRANSFORMATION_STREAMING

public static final java.lang.String TRANSFORMATION_STREAMING
The type value for the Transformation that makes the video output be streamed.

See Also:
isStreaming(Media), isStreaming(TranscodingJob), Constant Field Values

TRANSFORMATION_HINTING

public static final java.lang.String TRANSFORMATION_HINTING
The type value for the Transformation that hints videos after their adaptation.

See Also:
isHinting(Media), isHinting(TranscodingJob), setHinting(Media), Constant Field Values

TRANSFORMATION_OFFSET

public static final java.lang.String TRANSFORMATION_OFFSET
The type value for the Transformation that extracts an audio/video part starting from a declared offset.

See Also:
TRANSFORMATION_OFFSET_ATTR_START, setSegmentBoundaries(TranscodingJob, Integer, Integer), Constant Field Values

TRANSFORMATION_OFFSET_ATTR_START

public static final java.lang.String TRANSFORMATION_OFFSET_ATTR_START
The Offset transformation attribute defining starting moment (in milliseconds).

See Also:
TRANSFORMATION_OFFSET, setSegmentBoundaries(TranscodingJob, Integer, Integer), getOffset(TranscodingJob), Constant Field Values

TRANSFORMATION_DURATION_LIMIT

public static final java.lang.String TRANSFORMATION_DURATION_LIMIT
The type value for the Transformation that extracts an audio/video part of a declared duration.

See Also:
TRANSFORMATION_DURATION_LIMIT_ATTR_LIMIT, setSegmentBoundaries(TranscodingJob, Integer, Integer), Constant Field Values

TRANSFORMATION_DURATION_LIMIT_ATTR_LIMIT

public static final java.lang.String TRANSFORMATION_DURATION_LIMIT_ATTR_LIMIT
The DurationLimit transformation attribute defining the duration time (in milliseconds).

See Also:
TRANSFORMATION_DURATION_LIMIT, setSegmentBoundaries(TranscodingJob, Integer, Integer), getDuration(TranscodingJob), Constant Field Values

TRANSFORMATION_EXTRACT_FRAME

public static final java.lang.String TRANSFORMATION_EXTRACT_FRAME
The type value for the Transformation that extracts an image from a video.

See Also:
TRANSFORMATION_EXTRACT_FRAME_ATTR_SEC, setExtractFrame(TranscodingJob, String, int), Constant Field Values

TRANSFORMATION_EXTRACT_FRAME_ATTR_SEC

public static final java.lang.String TRANSFORMATION_EXTRACT_FRAME_ATTR_SEC
The ExtractFrame transformation attribute defining the second at which the image frame should be extracted.

See Also:
TRANSFORMATION_EXTRACT_FRAME, setExtractFrame(TranscodingJob, String, int), getExtractFrameSecond(TranscodingJob), Constant Field Values

TRANSFORMATION_GIF_PREVIEW

public static final java.lang.String TRANSFORMATION_GIF_PREVIEW
The type value for the Transformation that extracts an animated GIF image with a video preview.

See Also:
setExtractGifPreview(TranscodingJob), Constant Field Values

TRANSFORMATION_DOWNLOAD_LIMIT

public static final java.lang.String TRANSFORMATION_DOWNLOAD_LIMIT
The type value for the Transformation that controls the download of a source file.

See Also:
TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_SIZE, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_START, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_DURATION, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_OFFSET, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_REPEAT, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_TREAT_COMPLETE, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_MIN_DURATION, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_MAX_COUNT, setDownloadSizeLimit(TranscodingJob, long), setDownloadSizeSegment(TranscodingJob, long, long), setDownloadDurationLimit(TranscodingJob, int), setDownloadDurationSegment(TranscodingJob, int, int), setDownloadSizeAndDurationLimit(TranscodingJob, int, long), setProgressiveDownloadBySize(TranscodingJob, long), setDownloadSizeSegment(TranscodingJob, long, long), setProgressiveDownloadByDuration(TranscodingJob, int), setDownloadDurationSegment(TranscodingJob, int, int), Constant Field Values

TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_SIZE

public static final java.lang.String TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_SIZE
The DownloadLimit transformation attribute defining a size limit (in bytes).

See Also:
TRANSFORMATION_DOWNLOAD_LIMIT, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_TREAT_COMPLETE, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_START, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_REPEAT, setDownloadSizeLimit(TranscodingJob, long), setDownloadSizeLimit(TranscodingJob, long, boolean), setDownloadSizeAndDurationLimit(TranscodingJob, int, long), setProgressiveDownloadBySize(TranscodingJob, long), setProgressiveDownloadBySize(TranscodingJob, long, int), setDownloadSizeSegment(TranscodingJob, long, long), getDownloadSize(TranscodingJob), Constant Field Values

TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_START

public static final java.lang.String TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_START
The DownloadLimit transformation attribute defining a size offset (in bytes).

See Also:
TRANSFORMATION_DOWNLOAD_LIMIT, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_SIZE, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_REPEAT, setProgressiveDownloadBySize(TranscodingJob, long), setProgressiveDownloadBySize(TranscodingJob, long, int), setDownloadSizeSegment(TranscodingJob, long, long), getDownloadStart(TranscodingJob), Constant Field Values

TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_DURATION

public static final java.lang.String TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_DURATION
The DownloadLimit transformation attribute defining a duration limit (in seconds).

See Also:
TRANSFORMATION_DOWNLOAD_LIMIT, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_TREAT_COMPLETE, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_OFFSET, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_REPEAT, setDownloadDurationLimit(TranscodingJob, int), setDownloadDurationLimit(TranscodingJob, int, boolean), setDownloadSizeAndDurationLimit(TranscodingJob, int, long), setProgressiveDownloadByDuration(TranscodingJob, int), setProgressiveDownloadByDuration(TranscodingJob, int, Integer, Integer), getDownloadDuration(TranscodingJob), Constant Field Values

TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_OFFSET

public static final java.lang.String TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_OFFSET
The DownloadLimit transformation attribute defining a duration offset (in seconds).

See Also:
TRANSFORMATION_DOWNLOAD_LIMIT, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_DURATION, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_REPEAT, setProgressiveDownloadByDuration(TranscodingJob, int), setProgressiveDownloadByDuration(TranscodingJob, int, Integer, Integer), setDownloadDurationSegment(TranscodingJob, int, int), getDownloadOffset(TranscodingJob), Constant Field Values

TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_TREAT_COMPLETE

public static final java.lang.String TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_TREAT_COMPLETE
The DownloadLimit transformation attribute that makes the part truncated by size or duration limit be treated like a complete source file.

See Also:
TRANSFORMATION_DOWNLOAD_LIMIT, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_SIZE, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_DURATION, setDownloadSizeLimit(TranscodingJob, long, boolean), setDownloadDurationLimit(TranscodingJob, int, boolean), setDownloadSizeAndDurationLimit(TranscodingJob, int, long), isDownloadTreatedAsComplete(TranscodingJob), Constant Field Values

TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_REPEAT

public static final java.lang.String TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_REPEAT
The DownloadLimit transformation attribute that activates the "progressive segmentation" of subsequent source file parts of a specified size or duration limit.

See Also:
TRANSFORMATION_DOWNLOAD_LIMIT, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_SIZE, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_DURATION, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_MIN_DURATION, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_MAX_COUNT, setProgressiveDownloadBySize(TranscodingJob, long), setProgressiveDownloadBySize(TranscodingJob, long, int), setProgressiveDownloadByDuration(TranscodingJob, int), setProgressiveDownloadByDuration(TranscodingJob, int, Integer, Integer), isDownloadRepeat(TranscodingJob), Constant Field Values

TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_MIN_DURATION

public static final java.lang.String TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_MIN_DURATION
The DownloadLimit transformation attribute defining the minimum duration of a last source file part obtained through "progressive segmentation" (repeat flag); if it happens to be shorter it will be concatenated with the previous part.

See Also:
TRANSFORMATION_DOWNLOAD_LIMIT, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_REPEAT, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_DURATION, setProgressiveDownloadByDuration(TranscodingJob, int, Integer, Integer), getDownloadMinDuration(TranscodingJob), Constant Field Values

TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_MAX_COUNT

public static final java.lang.String TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_MAX_COUNT
The DownloadLimit transformation attribute defining a maximum number of parts for the "progressive segmentation" by size or duration.

See Also:
TRANSFORMATION_DOWNLOAD_LIMIT, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_REPEAT, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_SIZE, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_DURATION, setProgressiveDownloadBySize(TranscodingJob, long, int), setProgressiveDownloadByDuration(TranscodingJob, int, Integer, Integer), getDownloadMaxCount(TranscodingJob), Constant Field Values

TRANSFORMATION_ADVERTISEMENT_VIDEO

public static final java.lang.String TRANSFORMATION_ADVERTISEMENT_VIDEO
The type value for the Transformation that inserts a video advertisement before a target video.

See Also:
TRANSFORMATION_ADVERTISEMENT_VIDEO_URL, setAdvertisementVideo(TranscodingJob, String), Constant Field Values

TRANSFORMATION_ADVERTISEMENT_VIDEO_URL

public static final java.lang.String TRANSFORMATION_ADVERTISEMENT_VIDEO_URL
The Advertisement transformation attribute defining a url of the video advertisement.

See Also:
TRANSFORMATION_ADVERTISEMENT_VIDEO, setAdvertisementVideo(TranscodingJob, String), getAdverstisementVideo(TranscodingJob), Constant Field Values

TRANSFORMATION_ORGANIZE_TEXT

public static final java.lang.String TRANSFORMATION_ORGANIZE_TEXT
The type value for the Transformation that makes web rendering processor organize a web content.

See Also:
setOrganizeText(TranscodingJob), Constant Field Values

TRANSFORMATION_ONLY_TEXT

public static final java.lang.String TRANSFORMATION_ONLY_TEXT
The type value for the Transformation that makes web rendering processor extract the pure text content from a web content.

See Also:
setOnlyText(TranscodingJob), Constant Field Values

TRANSFORMATION_NO_LINKS

public static final java.lang.String TRANSFORMATION_NO_LINKS
The type value for the Transformation that makes web rendering processor remove all hyperlinks from a web content.

See Also:
setNoLinks(TranscodingJob), Constant Field Values

TRANSFORMATION_NAVIGATION_BAR

public static final java.lang.String TRANSFORMATION_NAVIGATION_BAR
The type value for the Transformation that adjusts the default navigition panel appended to a web content by the web rendering processor.

See Also:
TranscodingUtils.NavigationBarAttr, setNavigationBarAttrs(TranscodingJob, Map), Constant Field Values
Constructor Detail

TranscodingUtils

public TranscodingUtils()
Method Detail

createRequest

public static TranscodingRequest createRequest(java.lang.String originatorID,
                                               java.lang.String sourceUrl,
                                               java.lang.String profileID)
Creates a single-job transcoding request instance with basic transcoding parameters.

Parameters:
originatorID - the request originator identifier
sourceUrl - the location of a source content to be transcoded
profileID - the device User-Agent or the predefined profile ID
Returns:
the new request instance

createRequest

public static TranscodingRequest createRequest(java.lang.String originatorID,
                                               java.lang.String sourceUrl,
                                               java.lang.String profileID,
                                               java.lang.String contentType)
Creates a single-job transcoding request instance with basic transcoding parameters.

Parameters:
originatorID - the request originator identifier
sourceUrl - the location of a source content to be transcoded
profileID - the device User-Agent or the predefined profile ID
contentType - the content type of the source file
Returns:
the new request instance

createNewJob

public static TranscodingJob createNewJob(java.lang.String jobID,
                                          java.lang.String url,
                                          java.lang.String contentType)
Creates a basic transcoding job instance.

Parameters:
jobID - the ID of the job
url - the location of a source content to be transcoded
contentType - the content type of the source file (may be null)
Returns:
the new job instance

setDimensions

public static void setDimensions(Media media,
                                 java.lang.Integer width,
                                 java.lang.Integer height)
Sets the desired width and height for a transcoded content.

Parameters:
media - Image, Video or Text object
width - transcoded content width (may be null)
height - transcoded content height (may be null)
See Also:
Image.setWidth(Integer), Image.setHeight(Integer), Video.VideoVisual.setWidth(Integer), Video.VideoVisual.setHeight(Integer), SCREEN_WIDTH, getScreenWidth(Text), SCREEN_HEIGHT, getScreenHeight(Text)

getScreenWidth

public static java.lang.Integer getScreenWidth(Text text)
Returns the width requested for a text document transcoded by the web rendering engine. Usually it is the actual width of a device screen.

Parameters:
text - media object
Returns:
desired text width

getScreenHeight

public static java.lang.Integer getScreenHeight(Text text)
Returns the height requested for a text document transcoded by the web rendering engine. Usually it is the actual height of a device screen.

Parameters:
text - media object
Returns:
desired text height

addRelativeResize

public static void addRelativeResize(Media media,
                                     java.lang.Integer widthPercent,
                                     java.lang.Integer heightPercent,
                                     java.lang.String resizeDirective)
Sets desired content dimensions relative to a target device screen. The transcoded content will be resized according to the passed resizeDirective argument.

Parameters:
media - Image or Video object
widthPercent - relative width in percents (may be null)
heightPercent - relative height in percents (may be null)
resizeDirective - resize directive
See Also:
OMAUtils.setResizeDirective(Media, String), RESIZE_RELATIVE_WIDTH, getRelativeWidth(Media), RESIZE_RELATIVE_HEIGHT, getRelativeHeight(Media)

getRelativeWidth

public static java.lang.Integer getRelativeWidth(Media media)
Returns the width percentage requested for the resize relative to the device screen width.

Parameters:
media - Image or Video object
Returns:
width in percents if set; otherwise null.
See Also:
RESIZE_RELATIVE_WIDTH, addRelativeResize(Media, Integer, Integer, String)

getRelativeHeight

public static java.lang.Integer getRelativeHeight(Media media)
Returns the height percentage requested for the resize relative to the device screen height.

Parameters:
media - Image or Video object
Returns:
height in percents if set; otherwise null.
See Also:
RESIZE_RELATIVE_HEIGHT, addRelativeResize(Media, Integer, Integer, String)

removeRelativeDimensions

public static void removeRelativeDimensions(Media media)

Removes relative dimension values if set.

NOTE: it does not affect the resize directive.

Parameters:
media - Image or Video object
See Also:
addRelativeResize(Media, Integer, Integer, String)

addResize

public static void addResize(Media media,
                             java.lang.Integer width,
                             java.lang.Integer height,
                             java.lang.String resizeDirective)
Sets desired dimensions for a transcoded content, which will be resized according to the passed resizeDirective argument.

Parameters:
media - Image or Video object
width - transcoded content width
height - transcoded content height
resizeDirective - resize directive
See Also:
setDimensions(Media, Integer, Integer), OMAUtils.setResizeDirective(Media, String)

setProtocol

public static void setProtocol(TranscodingJob job,
                               TranscodingUtils.SourceProtocol protocol)
Sets the protocol to be used to load a source content into the storage.

Parameters:
job - transcoding job
protocol - source protocol
See Also:
SOURCE_PROTOCOL_PARAM, getProtocol(TranscodingJob), setProtocol(TranscodingJob, org.alembik.util.TranscodingUtils.SourceProtocol, boolean)

setProtocol

public static void setProtocol(TranscodingJob job,
                               TranscodingUtils.SourceProtocol protocol,
                               boolean noCopy)

Sets the TranscodingUtils.SourceProtocol to be used to load a source content.

If noCopy arguments is true, the source content will not be copied/held in the storage. Thus if protocol is TranscodingUtils.SourceProtocol.FILE, the source file will be accessed directly (no copying). In case of TranscodingUtils.SourceProtocol.HTTP protocol and "progressive segmentation" applied, the complete source file will not be held in the storage.

Parameters:
job - transcoding job
protocol - source protocol
noCopy - apply "no-copy" strategy?
See Also:
SOURCE_PROTOCOL_PARAM, getProtocol(TranscodingJob), NO_COPY_SOURCE_FILE, isNotCopySource(TranscodingJob), setProgressiveDownloadBySize(TranscodingJob, long), setProgressiveDownloadByDuration(TranscodingJob, int)

getProtocol

public static TranscodingUtils.SourceProtocol getProtocol(TranscodingJob job)

Returns the protocol specified for fetching a source file of the given transcoding job.

If none has been set, it defaults to TranscodingUtils.SourceProtocol.HTTP.

Parameters:
job - transcoding job
Returns:
source protocol
See Also:
SOURCE_PROTOCOL_PARAM, setProtocol(TranscodingJob, org.alembik.util.TranscodingUtils.SourceProtocol)

isNotCopySource

public static boolean isNotCopySource(TranscodingJob job)
Checks whether the source file will not be loaded into storage. By default the source files are always loaded.

Parameters:
job - transcoding job
Returns:
true if the "no-copy" strategy has been requested; otherwise false
See Also:
NO_COPY_SOURCE_FILE, setProtocol(TranscodingJob, org.alembik.util.TranscodingUtils.SourceProtocol, boolean)

setReloadPolicy

public static void setReloadPolicy(TranscodingJob job,
                                   TranscodingUtils.ReloadPolicy reloadPolicy)
Sets the required policy of reloading of a source file of the given transcoding job.

Parameters:
job - transcoding job
reloadPolicy - reload policy
See Also:
SOURCE_RELOAD_POLICY, getReloadPolicy(TranscodingJob)

getReloadPolicy

public static TranscodingUtils.ReloadPolicy getReloadPolicy(TranscodingJob job)

Returns the policy of reloading of a source file of the given transcoding job.

If none has been previously set, it defaults to TranscodingUtils.ReloadPolicy.IF_OLDER_THAN.

Parameters:
job - transcoding job
Returns:
reload policy
See Also:
SOURCE_RELOAD_POLICY, setReloadPolicy(TranscodingJob, org.alembik.util.TranscodingUtils.ReloadPolicy)

setIfOlderThanTime

public static void setIfOlderThanTime(TranscodingJob job,
                                      long minutes)
Sets the number of minutes that must elapse before Alembik checks if the file is actual. This parameter works in conjunction with TranscodingUtils.ReloadPolicy.IF_OLDER_THAN policy.

Parameters:
job - transcoding job
minutes - number of minutes
See Also:
SOURCE_OLDER_THAN_TIME, getIfOlderThanTime(TranscodingJob), setReloadPolicy(TranscodingJob, org.alembik.util.TranscodingUtils.ReloadPolicy)

getIfOlderThanTime

public static long getIfOlderThanTime(TranscodingJob job)
Returns the number of minutes specified for TranscodingUtils.ReloadPolicy.IF_OLDER_THAN policy. If not set it defaults to 15 minutes.

Parameters:
job - transcoding job
Returns:
number of minutes
See Also:
SOURCE_OLDER_THAN_TIME, setIfOlderThanTime(TranscodingJob, long)

setIdentityUrl

public static void setIdentityUrl(TranscodingJob job,
                                  java.lang.String identityUrl)
Declares the identity URL for the given transcoding job. If set the URL will be used to calculated storage paths instead of standard source location. This value will be used to create storage folders.

Parameters:
job - transcoding job
identityUrl - the identity URL value
See Also:
IDENTITY_URL, getIdentityUrl(TranscodingJob), TranscodingJob.Source.setLocation(String)

removeIdentityUrl

public static void removeIdentityUrl(TranscodingJob job)
Removes the identity URL parameter from the given transcoding job.

Parameters:
job - transcoding job
See Also:
setIdentityUrl(TranscodingJob, String)

getIdentityUrl

public static java.lang.String getIdentityUrl(TranscodingJob job)
Returns the identity URL of the given transcoding job.

Parameters:
job - transcoding job
Returns:
identity URL value if set; otherwise null.
See Also:
IDENTITY_URL, setIdentityUrl(TranscodingJob, String)

setSourceLocationEscaped

public static void setSourceLocationEscaped(TranscodingJob job,
                                            boolean escaped)
Sets the flag indicating that the source location of the given transcoding job is already prepared for HTTP manipulations and does not need to be preprocessed (escaped) again.

Parameters:
job - transcoding job
escaped - is location escaped?
See Also:
SOURCE_LOC_ESCAPED, isSourceLocationEscaped(TranscodingJob)

isSourceLocationEscaped

public static boolean isSourceLocationEscaped(TranscodingJob job)
Checks whether the source location of the given transcoding job is already escaped. By default, if the client has not stated otherwise, it returns false.

Parameters:
job - transcoding job
Returns:
true if the source location has been escaped; otherwise false.
See Also:
SOURCE_LOC_ESCAPED, setSourceLocationEscaped(TranscodingJob, boolean)

setInternalPathPrefix

public static void setInternalPathPrefix(TranscodingJob job,
                                         java.lang.String prefix)

Imposes a special prefix (i.e. extra folder) in the storage path where both source and transcoded files are to be placed.

NOTE: This feature is not applicable for text media (web rendering).

Parameters:
job - trancoding job
prefix - folder name
See Also:
SOURCE_PATH_PREFIX, setInternalSourcePathPrefix(TranscodingJob, String), getInternalSourcePathPrefix(TranscodingJob), TARGET_PATH_PREFIX, setInternalTargetPathPrefix(TranscodingJob, String), getInternalTargetPathPrefix(TranscodingJob)

setInternalSourcePathPrefix

public static void setInternalSourcePathPrefix(TranscodingJob job,
                                               java.lang.String prefix)

Imposes a special prefix (i.e. extra folder) in the storage path where a source file is to be placed.

NOTE: This feature is not applicable for text media (web rendering).

Parameters:
job - trancoding job
prefix - folder name
See Also:
SOURCE_PATH_PREFIX, getInternalSourcePathPrefix(TranscodingJob), setInternalPathPrefix(TranscodingJob, String), setInternalTargetPathPrefix(TranscodingJob, String)

getInternalSourcePathPrefix

public static java.lang.String getInternalSourcePathPrefix(TranscodingJob job)

Gets the path prefix (i.e. folder name) of a storage folder where a source file will be placed.

Parameters:
job - transcoding job
Returns:
folder name
See Also:
SOURCE_PATH_PREFIX, setInternalSourcePathPrefix(TranscodingJob, String)

setInternalTargetPathPrefix

public static void setInternalTargetPathPrefix(TranscodingJob job,
                                               java.lang.String prefix)

Imposes a special prefix (i.e. extra folder) in the storage path where a transcoded file is to be placed.

NOTE: This feature is not applicable for text media (web rendering).

Parameters:
job - trancoding job
prefix - folder name
See Also:
TARGET_PATH_PREFIX, getInternalTargetPathPrefix(TranscodingJob), setInternalPathPrefix(TranscodingJob, String), setInternalSourcePathPrefix(TranscodingJob, String)

getInternalTargetPathPrefix

public static java.lang.String getInternalTargetPathPrefix(TranscodingJob job)

Gets the path prefix (i.e. folder name) of a storage folder where a transcoded file will be placed.

Parameters:
job - transcoding job
Returns:
folder name
See Also:
TARGET_PATH_PREFIX, setInternalTargetPathPrefix(TranscodingJob, String)

setNoTranscoding

public static void setNoTranscoding(TranscodingJob job)

Prevents Alembik from performing any transcoding for the given transcoding job; only the source file will be loaded into the storage.

Parameters:
job - trancoding job
See Also:
NO_TRANSCODING, isNoTranscodingSet(TranscodingJob), setProgressiveDownloadBySize(TranscodingJob, long), setProgressiveDownloadByDuration(TranscodingJob, int)

disableNoTranscoding

public static void disableNoTranscoding(TranscodingJob job)
Removes the "no transcoding" flag from the given transcoding job.

Parameters:
job - trancoding job
See Also:
setNoTranscoding(TranscodingJob)

isNoTranscodingSet

public static boolean isNoTranscodingSet(TranscodingJob job)
Checks whether a content of the given transcoding job is to be transcoded.

Parameters:
job - transcoding job
Returns:
true if no transcoding has been requested; otherwise false.
See Also:
NO_TRANSCODING, setNoTranscoding(TranscodingJob)

isStreaming

public static boolean isStreaming(TranscodingJob job)
Checks whether the given video job is to be streamed.

Parameters:
job - transcoding job
Returns:
true if the streaming output has been requested; otherwise false.

isStreaming

public static boolean isStreaming(Media media)
Checks whether the given video job is to be streamed.

Parameters:
media - Video object
Returns:
true if the streaming output has been requested; otherwise false.

setHinting

public static void setHinting(Media media)
Requests video hinting for the given video job.

Parameters:
media - Video object

isHinting

public static boolean isHinting(TranscodingJob job)
Checks whether the given video is to be hinted.

Parameters:
job - transcoding job
Returns:
true if the hinted output has been requested; otherwise false.

isHinting

public static boolean isHinting(Media media)
Checks whether the given video job is to be hinted.

Parameters:
media - Video object
Returns:
true if the hinted output has been requested; otherwise false.

getDownloadSize

public static java.lang.Long getDownloadSize(TranscodingJob job)
Returns the size limit of a source file of the given transcoding job specified by the DownloadLimit transformation.

Parameters:
job - transcoding job
Returns:
number of bytes if the size limit is set; otherwise null.
See Also:
TRANSFORMATION_DOWNLOAD_LIMIT, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_SIZE, setDownloadSizeLimit(TranscodingJob, long), setDownloadSizeAndDurationLimit(TranscodingJob, int, long), setProgressiveDownloadBySize(TranscodingJob, long)

getDownloadStart

public static java.lang.Long getDownloadStart(TranscodingJob job)
Returns the size offset of a source file of the given transcoding job specified by the DownloadLimit transformation.

Parameters:
job - transcoding job
Returns:
number of bytes if the size offset is set; otherwise null.
See Also:
TRANSFORMATION_DOWNLOAD_LIMIT, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_START, setProgressiveDownloadBySize(TranscodingJob, long), setDownloadSizeSegment(TranscodingJob, long, long)

getDownloadDuration

public static java.lang.Integer getDownloadDuration(TranscodingJob job)
Returns the duration limit of a source file of the given transcoding job specified by the DownloadLimit transformation.

Parameters:
job - transcoding job
Returns:
number of seconds if the duration limit is set; otherwise null.
See Also:
TRANSFORMATION_DOWNLOAD_LIMIT, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_DURATION, setDownloadDurationLimit(TranscodingJob, int), setDownloadSizeAndDurationLimit(TranscodingJob, int, long), setProgressiveDownloadByDuration(TranscodingJob, int)

getDownloadOffset

public static java.lang.Integer getDownloadOffset(TranscodingJob job)
Returns the duration offset of a source file of the given transcoding job specified by the DownloadLimit transformation.

Parameters:
job - transcoding job
Returns:
number of seconds if the duration offset is set; otherwise null.
See Also:
TRANSFORMATION_DOWNLOAD_LIMIT, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_OFFSET, setProgressiveDownloadByDuration(TranscodingJob, int), setDownloadDurationSegment(TranscodingJob, int, int)

isDownloadTreatedAsComplete

public static boolean isDownloadTreatedAsComplete(TranscodingJob job)
Checks whether a source file truncated by the DownloadLimit transformation should be treated as the complete file when processing subsequent transcoding jobs.

Parameters:
job - transcoding job
Returns:
true if the truncated source file is to be regarded as complete; otherwise false.
See Also:
TRANSFORMATION_DOWNLOAD_LIMIT, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_TREAT_COMPLETE, setDownloadSizeLimit(TranscodingJob, long, boolean), setDownloadDurationLimit(TranscodingJob, int, boolean)

isDownloadRepeat

public static boolean isDownloadRepeat(TranscodingJob job)
Checks whether the "progressive segmentation" has been requested in the DownloadLimit transformation for the given transcoding job.

Parameters:
job - transcoding job
Returns:
true if the download must be progressive; otherwise false.
See Also:
TRANSFORMATION_DOWNLOAD_LIMIT, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_REPEAT, setProgressiveDownloadBySize(TranscodingJob, long), setProgressiveDownloadBySize(TranscodingJob, long, int), setProgressiveDownloadByDuration(TranscodingJob, int), setProgressiveDownloadByDuration(TranscodingJob, int, Integer, Integer)

getDownloadMinDuration

public static java.lang.Integer getDownloadMinDuration(TranscodingJob job)
Returns the required minimum duration of the last part of a source file to be produced by the "progressive segmentation" process requested by the DownloadLimit transformation in the given transcoding job.

Parameters:
job - transcoding job
Returns:
number of seconds if the minimum duration is set; otherwise null.
See Also:
TRANSFORMATION_DOWNLOAD_LIMIT, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_MIN_DURATION, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_REPEAT, setProgressiveDownloadByDuration(TranscodingJob, int, Integer, Integer)

getDownloadMaxCount

public static java.lang.Integer getDownloadMaxCount(TranscodingJob job)
Returns the maximum number of parts of a source file to be produced by the "progressive segmentation" process requested by the DownloadLimit transformation in the given transcoding job.

Parameters:
job - transcoding job
Returns:
maximum number of file parts if it is set; otherwise null.
See Also:
TRANSFORMATION_DOWNLOAD_LIMIT, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_MAX_COUNT, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_REPEAT, setProgressiveDownloadBySize(TranscodingJob, long, int), setProgressiveDownloadByDuration(TranscodingJob, int, Integer, Integer)

setDownloadLimit

public static void setDownloadLimit(TranscodingJob job,
                                    long downloadLimit)
Deprecated. use setDownloadSizeLimit(TranscodingJob, long) instead


setDownloadLimit

public static void setDownloadLimit(TranscodingJob job,
                                    long downloadLimit,
                                    boolean treatAsComplete)
Deprecated. use setDownloadSizeLimit(TranscodingJob, long, boolean) instead


setDownloadSizeLimit

public static void setDownloadSizeLimit(TranscodingJob job,
                                        long size)

Applies DownloadLimit transformation for the given transcoding job, which will make Alembik media loader truncate a source file after reaching the given size limit.

If the loaded file is larger than the specified limit, it will be treated as a truncated one (i.e. stored in a folder with a special suffix).

Parameters:
job - transcoding job
size - size limit in bytes
See Also:
TRANSFORMATION_DOWNLOAD_LIMIT, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_SIZE, setDownloadSizeLimit(TranscodingJob, long, boolean), getDownloadSize(TranscodingJob)

setDownloadSizeLimit

public static void setDownloadSizeLimit(TranscodingJob job,
                                        long size,
                                        boolean treatAsComplete)

Applies DownloadLimit transformation for the given transcoding job, which will make Alembik media loader truncate a source file after reaching the given size limit.

If the treatAsComplete argument is true the loaded file will be treated as complete, regardless of its actual size. Otherwise, if it needs to be truncated, it will be stored in a folder with a special suffix.

Parameters:
job - transcoding job
size - size limit in bytes
treatAsComplete - treat the loaded file as complete?
See Also:
TRANSFORMATION_DOWNLOAD_LIMIT, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_SIZE, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_TREAT_COMPLETE, getDownloadSize(TranscodingJob), isDownloadTreatedAsComplete(TranscodingJob)

setDownloadApproxDuration

public static void setDownloadApproxDuration(TranscodingJob job,
                                             int approxDuration)
Deprecated. use setDownloadDurationLimit(TranscodingJob, int) instead


setDownloadApproxDuration

public static void setDownloadApproxDuration(TranscodingJob job,
                                             int approxDuration,
                                             boolean treatAsComplete)
Deprecated. use setDownloadDurationLimit(TranscodingJob, int, boolean) instead


setDownloadDurationLimit

public static void setDownloadDurationLimit(TranscodingJob job,
                                            int duration)

Applies DownloadLimit transformation for the given transcoding job, which will make Alembik media loader truncate a source file after reaching (approximately) the given number of seconds.

If the loaded file is longer than the specified limit, it will be treated as a truncated one (i.e. stored in a folder with a special suffix).

This transformation can be applied only to audio and video content.

Parameters:
job - transcoding job
duration - number of seconds
See Also:
TRANSFORMATION_DOWNLOAD_LIMIT, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_DURATION, setDownloadDurationLimit(TranscodingJob, int, boolean), getDownloadDuration(TranscodingJob)

setDownloadDurationLimit

public static void setDownloadDurationLimit(TranscodingJob job,
                                            int duration,
                                            boolean treatAsComplete)

Applies DownloadLimit transformation for the given transcoding job, which will make Alembik media loader truncate a source file after reaching (approximately) the given number of seconds.

If the treatAsComplete argument is true the loaded file will be treated as complete, regardless of its actual duration length. Otherwise, if it needs to be truncated, it will be stored in a folder with a special suffix.

This transformation can be applied only to audio and video content.

Parameters:
job - transcoding job
duration - number of seconds
treatAsComplete - treat the loaded file as complete?
See Also:
TRANSFORMATION_DOWNLOAD_LIMIT, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_DURATION, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_TREAT_COMPLETE, getDownloadDuration(TranscodingJob), isDownloadTreatedAsComplete(TranscodingJob)

setDownloadSizeAndDurationLimit

public static void setDownloadSizeAndDurationLimit(TranscodingJob job,
                                                   int duration,
                                                   long size)

Applies DownloadLimit transformation for the given transcoding job, which will make Alembik media loader truncate a source file after reaching first of the specified limits: the given number of seconds (approximately) or the given number of bytes.

Mind that the loaded file will be always treated as complete, regardless of its actual size and duration length.

This transformation can be applied only to audio and video content.

Parameters:
job - transcoding job
duration - number of seconds
size - number of bytes
See Also:
TRANSFORMATION_DOWNLOAD_LIMIT, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_SIZE, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_DURATION, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_TREAT_COMPLETE, setDownloadSizeLimit(TranscodingJob, long, boolean), setDownloadDurationLimit(TranscodingJob, int, boolean)

setDownloadSizeSegment

public static void setDownloadSizeSegment(TranscodingJob job,
                                          long start,
                                          long size)

Applies DownloadLimit transformation for the given transcoding job, which is usually used to reference a particular source file part from the "progressive segmentation" (see setProgressiveDownloadBySize(TranscodingJob, long). Here the start argument must be multiplication of size, while the latter has to match the one from a previous progressive download job.

In case when there has been no previous "progressive segmentation" made Alembik will implicitly request one until the referenced part is not reached.

Parameters:
job - transcoding job
start - size offset in bytes
size - size of each part (in bytes)
See Also:
TRANSFORMATION_DOWNLOAD_LIMIT, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_SIZE, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_START, setProgressiveDownloadBySize(TranscodingJob, long), getDownloadSize(TranscodingJob), getDownloadStart(TranscodingJob)

setDownloadDurationSegment

public static void setDownloadDurationSegment(TranscodingJob job,
                                              int offset,
                                              int duration)

Applies DownloadLimit transformation for the given transcoding job, which is usually used to reference a particular source file part from the "progressive segmentation" (see setProgressiveDownloadByDuration(TranscodingJob, int). Here the offset argument must be multiplication of duration, while the latter has to match the one from a previous progressive download job.

In case when there has been no previous "progressive segmentation" made Alembik will implicitly request one until the referenced part is not reached.

Parameters:
job - transcoding job
offset - duration offset in seconds
duration - duration of each part (in seconds)
See Also:
TRANSFORMATION_DOWNLOAD_LIMIT, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_DURATION, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_OFFSET, setProgressiveDownloadByDuration(TranscodingJob, int), getDownloadDuration(TranscodingJob), getDownloadOffset(TranscodingJob)

setProgressiveDownloadBySize

public static void setProgressiveDownloadBySize(TranscodingJob job,
                                                long segmentSize)

Applies DownloadLimit transformation for the given transcoding job, which makes Alembik perform the "progressive segmentation" of a source file while loading it. That is the whole file will get partitioned into a parts of equal segmentSize, each stored in a separate folder with a special suffix. The whole source file will also be retained, providing that the NO_COPY_SOURCE_FILE option is off.

Since the repeated loading excludes any transcoding, the method implicitly sets NO_TRANSCODING flag on.

Parameters:
job - transcoding job
segmentSize - number of bytes
See Also:
TRANSFORMATION_DOWNLOAD_LIMIT, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_REPEAT, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_SIZE, setProgressiveDownloadBySize(TranscodingJob, long, int), getDownloadSize(TranscodingJob), isDownloadRepeat(TranscodingJob)

setProgressiveDownloadBySize

public static void setProgressiveDownloadBySize(TranscodingJob job,
                                                long segmentSize,
                                                int maxCount)

Applies DownloadLimit transformation for the given transcoding job, which makes Alembik perform the "progressive segmentation" of a source file while loading it. That is the loaded file will get partitioned into pieces of equal segmentSize, until either the end of file or the specified maximum number of parts (maxCount) is reached. Each file part will be stored in a separate folder with a special suffix.

The source file made of all loaded parts will also be retained, providing that the NO_COPY_SOURCE_FILE option is off. Moreover, it will always be treated as complete, no matter if maxCount limit has made it truncated or not.

Since the repeated loading excludes any transcoding, the method implicitly sets NO_TRANSCODING flag on.

Parameters:
job - transcoding job
segmentSize - number of bytes
maxCount - maximum number of parts (0 - no maximum number imposed)
See Also:
TRANSFORMATION_DOWNLOAD_LIMIT, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_REPEAT, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_SIZE, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_MAX_COUNT, getDownloadSize(TranscodingJob), getDownloadMaxCount(TranscodingJob), isDownloadRepeat(TranscodingJob)

setProgressiveDownloadByDuration

public static void setProgressiveDownloadByDuration(TranscodingJob job,
                                                    int segmentDuration)

Applies DownloadLimit transformation for the given transcoding job, which makes Alembik perform the "progressive segmentation" of a source file while loading it. That is the whole file will get partitioned into a parts of equal segmentDuration, each stored in a separate folder with a special suffix. The whole source file will also be retained, providing that the NO_COPY_SOURCE_FILE option is off.

Since the repeated loading excludes any transcoding, the method implicitly sets NO_TRANSCODING flag on.

Parameters:
job - transcoding job
segmentDuration - number of seconds
See Also:
TRANSFORMATION_DOWNLOAD_LIMIT, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_REPEAT, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_DURATION, setProgressiveDownloadByDuration(TranscodingJob, int, Integer, Integer), getDownloadDuration(TranscodingJob), isDownloadRepeat(TranscodingJob)

setProgressiveDownloadByDuration

public static void setProgressiveDownloadByDuration(TranscodingJob job,
                                                    int segmentDuration,
                                                    java.lang.Integer minDuration,
                                                    java.lang.Integer maxCount)

Applies DownloadLimit transformation for the given transcoding job, which makes Alembik perform the "progressive segmentation" of a source file while loading it. That is the loaded file will get partitioned into pieces of equal segmentDuration, until either the end of file or the specified maximum number of parts (maxCount) is reached. Each file part will be stored in a separate folder with a special suffix.

The minDuration attribute requests the last part not to be shorter than the declared number of seconds. Thus if it happens to be shorter, it will be appended to the previous part.

The source file made of all loaded parts will also be retained, providing that the NO_COPY_SOURCE_FILE option is off. Moreover, it will always be treated as complete, no matter if maxCount limit has made it truncated or not.

Since the repeated loading excludes any transcoding, the method implicitly sets NO_TRANSCODING flag on.

Parameters:
job - transcoding job
segmentDuration - number of seconds
maxCount - maximum number of parts (null - no maximum number imposed)
minDuration - minimum duration of the last part (null - no minimum limit imposed)
See Also:
TRANSFORMATION_DOWNLOAD_LIMIT, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_REPEAT, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_DURATION, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_MIN_DURATION, TRANSFORMATION_DOWNLOAD_LIMIT_ATTR_MAX_COUNT, getDownloadDuration(TranscodingJob), getDownloadMinDuration(TranscodingJob), getDownloadMaxCount(TranscodingJob), isDownloadRepeat(TranscodingJob)

getOffset

public static java.lang.Integer getOffset(TranscodingJob job)
Returns the duration offset of the given transcoding job specified by the Offset transformation.

Parameters:
job - transcoding job
Returns:
number of milliseconds if the offset is set; otherwise null.
See Also:
TRANSFORMATION_OFFSET, TRANSFORMATION_OFFSET_ATTR_START, setSegmentBoundaries(TranscodingJob, Integer, Integer)

getDuration

public static java.lang.Integer getDuration(TranscodingJob job)
Returns the duration length of the given transcoding job specified by the Offset transformation.

Parameters:
job - transcoding job
Returns:
number of milliseconds if the duration is set; otherwise null.
See Also:
TRANSFORMATION_DURATION_LIMIT, TRANSFORMATION_DURATION_LIMIT_ATTR_LIMIT, setSegmentBoundaries(TranscodingJob, Integer, Integer)

setSegmentBoundaries

public static void setSegmentBoundaries(TranscodingJob job,
                                        java.lang.Integer offset,
                                        java.lang.Integer duration)
Specifies the desired duration segment of the given audio or video job to transcode. The segment is made with the following duration range: [offset, offset+duration].

Parameters:
job - transcoding job
offset - duration offset in millis (if null - the file beginning will be the segment's start)
duration - duration length in millis (if null - the end of file will be the segment's end)
See Also:
TRANSFORMATION_OFFSET, TRANSFORMATION_OFFSET_ATTR_START, getOffset(TranscodingJob), TRANSFORMATION_DURATION_LIMIT, TRANSFORMATION_DURATION_LIMIT_ATTR_LIMIT, getDuration(TranscodingJob)

setExtractGifPreview

public static void setExtractGifPreview(TranscodingJob job)
Applies GifPreview transformation for the given video transcoding job, which makes Alembik generate an animated GIF. This animation represents a video preview, which constists of 15 frames chosen from the 20 first seconds of the video.

Parameters:
job - transcoding job
See Also:
TRANSFORMATION_GIF_PREVIEW

getExtractFrameSecond

public static java.lang.Integer getExtractFrameSecond(TranscodingJob job)
Returns the second at which the frame will be extracted from a video of the given transcoding job as specified by the ExtractFrame transformation.

Parameters:
job - transcoding job
Returns:
second at which the frame is to be extracted
See Also:
TRANSFORMATION_EXTRACT_FRAME, TRANSFORMATION_EXTRACT_FRAME_ATTR_SEC, setExtractFrame(TranscodingJob, String, int)

setExtractFrame

public static void setExtractFrame(TranscodingJob job,
                                   java.lang.String contentType,
                                   int second)

Applies ExtractFrame transformation for the given video transcoding job, which makes Alembik extract an image frame at the specified second. The extracted image will be of the declared contentType mime format.

Note that the transcoding job's target media instance must be of Image type.

Parameters:
job - transcoding job
contentType - mime-type of the extracted image
second - frame position (in seconds)
See Also:
TRANSFORMATION_EXTRACT_FRAME, TRANSFORMATION_EXTRACT_FRAME_ATTR_SEC, Media.setContentType(String), getExtractFrameSecond(TranscodingJob)

getAdverstisementVideo

public static java.lang.String getAdverstisementVideo(TranscodingJob job)
Returns the location of a video to be inserted in front of the video of the given transcoding job as specified by the Advertisement transformation.

Parameters:
job - transcoding job
Returns:
videoURL URL of the video
See Also:
TRANSFORMATION_ADVERTISEMENT_VIDEO, TRANSFORMATION_ADVERTISEMENT_VIDEO_URL, setAdvertisementVideo(TranscodingJob, String)

setAdvertisementVideo

public static void setAdvertisementVideo(TranscodingJob job,
                                         java.lang.String videoURL)
Applies Advertisement transformation, which makes Alembik insert another video at the start of a video of the given video transcoding job. The location of the "advert" video is specified by the videoURL argument.

Parameters:
job - transcoding job
videoURL - URL of the video to be inserted
See Also:
TRANSFORMATION_ADVERTISEMENT_VIDEO, TRANSFORMATION_ADVERTISEMENT_VIDEO_URL, getAdverstisementVideo(TranscodingJob)

setImageOverlayLogo

public static void setImageOverlayLogo(TranscodingJob job,
                                       java.lang.String location,
                                       TranscodingUtils.OverlayLogoColor transparentColor,
                                       java.lang.Integer imageWidth)

Applies OverlayLogo transformation, which will make Alembik lay a logo (image) over the image of the given transcoding job. The logo will be retrieved from the provided location and, optionally, filled with transparentColor and resized to the given imageWidth.

Moreover, the method implicitly fills the TranscodingUtils.OverlayLogoAttr.PROTOCOL attribute by analyzing the logo location. If it starts with '/' TranscodingUtils.SourceProtocol.FILE is used; otherwise, if it begins with 'http' string the method assumes TranscodingUtils.SourceProtocol.HTTP.

Parameters:
job - image transcoding job
location - logo location
transparentColor - desired logo background color; may be null
imageWidth - desired logo width; may be null
See Also:
TRANSFORMATION_OVERLAY_LOGO, TranscodingUtils.OverlayLogoAttr, getOverlayLogoAttrs(TranscodingJob)

setVideoOverlayLogo

public static void setVideoOverlayLogo(TranscodingJob job,
                                       java.lang.String location,
                                       TranscodingUtils.Coordinates coordinates,
                                       java.lang.Integer imageWidth)

Applies OverlayLogo transformation, which will make Alembik lay a logo (image) over the video of the given transcoding job. The logo will be retrieved from the provided location and, optionally, resized to the given imageWidth.

The transformation will locate the logo's upper-left corner at the [posX, posY] position of the video picture and display it within the [offset, offset+duration] period of video duration (see TranscodingUtils.Coordinates class). For the default values refer to the getOverlayLogoAttrs(TranscodingJob) method.

Moreover, the method implicitly fills the TranscodingUtils.OverlayLogoAttr.PROTOCOL attribute by analyzing the logo location. If it starts with '/' TranscodingUtils.SourceProtocol.FILE is used; otherwise, if it begins with 'http' string the method assumes TranscodingUtils.SourceProtocol.HTTP.

Parameters:
job - video transcoding job
location - logo location
coordinates - desired logo position and visibility period; may be null
imageWidth - desired logo width; may be null
See Also:
TRANSFORMATION_OVERLAY_LOGO, TranscodingUtils.OverlayLogoAttr, TranscodingUtils.Coordinates, getOverlayLogoAttrs(TranscodingJob)

getOverlayLogoAttrs

public static java.util.Map<TranscodingUtils.OverlayLogoAttr,java.lang.String> getOverlayLogoAttrs(TranscodingJob job)

Returns the map of the OverlayLogo transformation attributes, which have been set for the given transcoding job.

Certain attributes default to fixed values if missing:

Parameters:
job - transcoding job.
Returns:
transformation attributes map
See Also:
TRANSFORMATION_OVERLAY_LOGO, TranscodingUtils.OverlayLogoAttr, setImageOverlayLogo(TranscodingJob, String, org.alembik.util.TranscodingUtils.OverlayLogoColor, Integer), setVideoOverlayLogo(TranscodingJob, String, org.alembik.util.TranscodingUtils.Coordinates, Integer)

setImageTextOverlay

public static void setImageTextOverlay(TranscodingJob job,
                                       java.lang.String message,
                                       TranscodingUtils.TextOverlayFont font)

Applies TextOverlay transformation, which will make Alembik lay a text (message) over an image of the given transcoding job.

Parameters:
job - image transcoding job
message - text to be overlayed
font - desired font attributes; may be null
See Also:
TRANSFORMATION_TEXT_OVERLAY, TranscodingUtils.TextOverlayAttr, getTextOverlayAttrs(TranscodingJob)

setVideoTextScrollOverlay

public static void setVideoTextScrollOverlay(TranscodingJob job,
                                             java.lang.String message,
                                             TranscodingUtils.TextOverlayFont font,
                                             TranscodingUtils.Coordinates coordinates)

Applies TextOverlay transformation, which will make Alembik lay a scrolling text (message) over a video of the given transcoding job.

The transformation will vertically align the text upper margin to the posY position of the video picture and display it within the [offset, offset+duration] period of video duration (see TranscodingUtils.Coordinates class). For the default values refer to the getTextOverlayAttrs(TranscodingJob) method.

Parameters:
job - video transcoding job
message - text to be overlayed
font - desired font attributes; may be null
coordinates - desired text position and visibility period; may be null
See Also:
TRANSFORMATION_TEXT_OVERLAY, TranscodingUtils.TextOverlayAttr, TranscodingUtils.Coordinates, getTextOverlayAttrs(TranscodingJob)

setVideoTextOverlay

public static void setVideoTextOverlay(TranscodingJob job,
                                       java.lang.String message,
                                       TranscodingUtils.TextOverlayFont font,
                                       TranscodingUtils.Coordinates coordinates)

Applies TextOverlay transformation, which will make Alembik lay a static text (message) over a video of the given transcoding job.

The transformation will locate the text's upper-left corner at the [posX, posY] position of the video picture and display it within the [offset, offset+duration] period of video duration (see TranscodingUtils.Coordinates class). For the default values refer to the getTextOverlayAttrs(TranscodingJob) method.

Parameters:
job - video transcoding job
message - text to be overlayed
font - desired font attributes; may be null
coordinates - desired text position and visibility period; may be null
See Also:
TRANSFORMATION_TEXT_OVERLAY, TranscodingUtils.TextOverlayAttr, TranscodingUtils.Coordinates, getTextOverlayAttrs(TranscodingJob)

getTextOverlayAttrs

public static java.util.Map<TranscodingUtils.TextOverlayAttr,java.lang.String> getTextOverlayAttrs(TranscodingJob job)

Returns the map of the TextOverlay transformation attributes, which have been set for the given transcoding job.

Certain attributes default to fixed values if missing:

Parameters:
job - transcoding job.
Returns:
transformation attributes map
See Also:
TRANSFORMATION_TEXT_OVERLAY, TranscodingUtils.TextOverlayAttr, setImageTextOverlay(TranscodingJob, String, org.alembik.util.TranscodingUtils.TextOverlayFont), setVideoTextOverlay(TranscodingJob, String, org.alembik.util.TranscodingUtils.TextOverlayFont, org.alembik.util.TranscodingUtils.Coordinates), setVideoTextScrollOverlay(TranscodingJob, String, org.alembik.util.TranscodingUtils.TextOverlayFont, org.alembik.util.TranscodingUtils.Coordinates)

setNoLinks

public static void setNoLinks(TranscodingJob job)
Applies NoLinks transformation, which makes Alembik remove all hyperlinks from of a web document of the given transcoding job.

Parameters:
job - text transcoding job
See Also:
TRANSFORMATION_NO_LINKS

setOrganizeText

public static void setOrganizeText(TranscodingJob job)
Applies OrganizeText transformation, which makes Alembik re-organize the logical blocks of a web document of the given transcoding job. It will usually push a principal block of the document to the fore.

Parameters:
job - text transcoding job
See Also:
TRANSFORMATION_ORGANIZE_TEXT

setOnlyText

public static void setOnlyText(TranscodingJob job)
Applies OnlyText transformation, which makes Alembik remove all hyperlinks and embedded content (images, videos, etc) from of a web document of the given transcoding job.

Parameters:
job - text transcoding job

getNavigationBarAttrs

public static java.util.Map<TranscodingUtils.NavigationBarAttr,java.lang.String> getNavigationBarAttrs(TranscodingJob job)
Returns the map of the NavigBar transformation attributes, which have been set for the given transcoding job.

Parameters:
job - text transcoding job
Returns:
transformation attributes map
See Also:
TRANSFORMATION_NAVIGATION_BAR, TranscodingUtils.NavigationBarAttr

setNavigationBarAttrs

public static void setNavigationBarAttrs(TranscodingJob job,
                                         java.util.Map<TranscodingUtils.NavigationBarAttr,java.lang.String> attrsMap)
Sets a desired set of NavigBar transformation attributes, which will adjust look and behaviour of the navigation panel displayed within transcoded web documents.

Parameters:
job - text transcoding jobs
attrsMap - map of the desired attributes with their values
See Also:
TRANSFORMATION_NAVIGATION_BAR, TranscodingUtils.NavigationBarAttr

setMarkupLanguage

public static void setMarkupLanguage(Text text,
                                     TranscodingUtils.MarkupLanguage markupLanguage)
Sets the desired markup language for a page to be transcoded.

Parameters:
text - media object representing the transcoding job of a web document
markupLanguage - desired markup language
See Also:
MARKUP_LANGUAGE, TranscodingUtils.MarkupLanguage, getMarkupLanguage(Text)

getMarkupLanguage

public static TranscodingUtils.MarkupLanguage getMarkupLanguage(Text text)
Returns the markup language set for a transcoded page.

Parameters:
text - media object representing the transcoding job of a web document
Returns:
desired markup language
See Also:
MARKUP_LANGUAGE, TranscodingUtils.MarkupLanguage, setMarkupLanguage(Text, org.alembik.util.TranscodingUtils.MarkupLanguage)

setCSSVersion

public static void setCSSVersion(Text text,
                                 TranscodingUtils.CSSVersion cssVersion)
Sets the desired CSS support for a page to be transcoded.

Parameters:
text - media object representing the transcoding job of a web document
cssVersion - CSS support type
See Also:
CSS_VERSION, TranscodingUtils.CSSVersion, getCSSVersion(Text)

getCSSVersion

public static TranscodingUtils.CSSVersion getCSSVersion(Text text)
Returns the CSS support type of a transcoded page.

Parameters:
text - media object representing the transcoding job of a web document
Returns:
CSS support type
See Also:
CSS_VERSION, TranscodingUtils.CSSVersion, setCSSVersion(Text, org.alembik.util.TranscodingUtils.CSSVersion)

setPageSizeEval

public static void setPageSizeEval(Text text,
                                   TranscodingUtils.PageSizeEval eval)
Requests the specified algorithm evaluating the size of a transcoded page.

Parameters:
text - media object representing the transcoding job of a web document
eval - size evaluation algorithm
See Also:
MOBILE_PAGE_SIZE_EVAL, TranscodingUtils.PageSizeEval, getPageSizeEval(Text)

getPageSizeEval

public static TranscodingUtils.PageSizeEval getPageSizeEval(Text text)
Returns the page size evaluation algorithm of a transcoded page.

Parameters:
text - media object of a transcoding job
Returns:
size evaluation algorithm if set; otherwise the default one - TranscodingUtils.PageSizeEval.TEXT_ONLY
See Also:
MOBILE_PAGE_SIZE_EVAL, TranscodingUtils.PageSizeEval, setPageSizeEval(Text, org.alembik.util.TranscodingUtils.PageSizeEval)

setImageRendering

public static void setImageRendering(Text text,
                                     TranscodingUtils.ImageRendering option)
Requests the specified image rendering option for a page to be transcoded.

Parameters:
text - media object representing the transcoding job of a web document
option - image rendering option
See Also:
MOBILE_IMAGE_RENDERING, TranscodingUtils.ImageRendering, getImageRendering(Text)

getImageRendering

public static TranscodingUtils.ImageRendering getImageRendering(Text text)
Returns the image rendering option selected for a transcoded page.

Parameters:
text - media object representing the transcoding job of a web document
Returns:
image rendering option if set; otherwise the default one - TranscodingUtils.ImageRendering.CLIENT_PROCESSING
See Also:
MOBILE_IMAGE_RENDERING, TranscodingUtils.ImageRendering, setImageRendering(Text, org.alembik.util.TranscodingUtils.ImageRendering)

getMobileWebDetectionLevel

public static TranscodingUtils.DetectionLevel getMobileWebDetectionLevel(TranscodingJob job)

Returns the mobile page detection level of the given transcoding job. If it has not been explicitly set, the TranscodingUtils.DetectionLevel.ACTIVE level is returned by default for any Text media.

Note that for any non-text content the level is invariably set to TranscodingUtils.DetectionLevel.NONE.

Parameters:
job - transcoding job
Returns:
detection level
See Also:
MOBILE_WEB_DETECTION, TranscodingUtils.DetectionLevel, setMobileWebDetectionLevel(TranscodingJob, org.alembik.util.TranscodingUtils.DetectionLevel)

setMobileWebDetectionLevel

public static void setMobileWebDetectionLevel(TranscodingJob job,
                                              TranscodingUtils.DetectionLevel level)

Requests the specified mobile page detection level for a web document of the given transcoding job.

Note that the level can be adjusted only for the Text content.

Parameters:
job - transcoding job
level - desired detection level
See Also:
MOBILE_WEB_DETECTION, TranscodingUtils.DetectionLevel, getMobileWebDetectionLevel(TranscodingJob)

isHTMLDetection

public static boolean isHTMLDetection(Media media)
Checks whether the HTML support detection has been enabled; by default it is disabled.

Parameters:
media - media object representing the transcoding job of a web document
Returns:
true if HTML detection has been explicitly enabled; otherwise false.
See Also:
MOBILE_HTML_SUPPORT, setHTMLDetection(TranscodingJob, boolean), isHTMLDetection(TranscodingJob)

isHTMLDetection

public static boolean isHTMLDetection(TranscodingJob job)
Checks whether the HTML support detection has been enabled; by default it is disabled.

Parameters:
job - transcoding job
Returns:
true if HTML detection has been explicitly enabled; otherwise false.
See Also:
MOBILE_HTML_SUPPORT, setHTMLDetection(TranscodingJob, boolean), isHTMLDetection(Media)

setHTMLDetection

public static void setHTMLDetection(TranscodingJob job,
                                    boolean enable)

Enables or disables the HTML support detection for the given transcoding job.

If enabled the capabilities of a requesting client (device) will be analyzed to figure out whether the device is capable of HTML rendering; if so the page will not be transcoded and its original location will be returned instead.

The device will be considered as HTML-capable, if it supports either HTML, advanced XHTML (level 4 in WURFL) or JavaScript.

Parameters:
job - transcoding job
enable - true to enable HTML support, false to disable it
See Also:
MOBILE_HTML_SUPPORT, isHTMLDetection(Media), isHTMLDetection(TranscodingJob)

isPreserveMetadata

public static boolean isPreserveMetadata(Media media)
Checks whether the media content's meta-data is to be retained in a transcoded file. By default media processors are free to remove it during transcoding process.

Parameters:
media - media object of a transcoding job
Returns:
true if preserving of meta-data has been requested; otherwise false.
See Also:
PRESERVE_METADATA, setPreserveMetadata(Media)

setPreserveMetadata

public static void setPreserveMetadata(Media media)
Requests Alembik to retain the media content's meta-data in a transcoded file.

Parameters:
media - media object of a transcoding job
See Also:
PRESERVE_METADATA, isPreserveMetadata(Media), removePreserveMetadata(Media)

removePreserveMetadata

public static void removePreserveMetadata(Media media)
Disables the meta-data preserving request for a media object representing a file to be transcoded.

Parameters:
media - media object of a transcoding job
See Also:
PRESERVE_METADATA, setPreserveMetadata(Media)

setToCache

public static void setToCache(TranscodingJob job,
                              java.lang.String cacheId,
                              long cacheTime)
Defines the key and expiry time for storing the content in a memory-based cache.

Parameters:
job - transcoding job
cacheId - cache unique key
cacheTime - caching expiry time (in milliseconds)
See Also:
TO_CACHE_ID, TO_CACHE_TIME, getCacheId(TranscodingJob), getCacheTime(TranscodingJob)

getCacheId

public static java.lang.String getCacheId(TranscodingJob job)
Returns the key, under which the content of the given transcoding job is to be stored in a memory-based cache.

Parameters:
job - transcoding job
Returns:
cache key if defined; otherwise null
See Also:
TO_CACHE_ID, setToCache(TranscodingJob, String, long)

getCacheTime

public static java.lang.Long getCacheTime(TranscodingJob job)
Returns the period of time, for which the content of the given transcoding job will be stored in a memory-based cache.

Parameters:
job - transcoding job
Returns:
expiry time in millis
See Also:
TO_CACHE_TIME, setToCache(TranscodingJob, String, long)

setBestMatchingQuality

public static void setBestMatchingQuality(TranscodingJob job,
                                          Quality quality)
Applies the "best matching" strategy for the given transcoding job and quality. The hinting requirement will not be taken into consideration. Please refer to the setBestMatchingQuality(TranscodingJob, Quality, boolean) method for the detailed information.

Parameters:
job - transcoding job
quality - desired quality of the matching profile
See Also:
setBestMatchingQuality(TranscodingJob, Quality, boolean)

setBestMatchingQuality

public static void setBestMatchingQuality(TranscodingJob job,
                                          Quality quality,
                                          boolean hintable)

Applies the "best matching" strategy for the given transcoding job.

The strategy will force Alembik to match the capabilities of a requesting device (resolved using its User-Agent string) against the list of profiles predefined at the server side. Then the profile of the parameters closest to the resolved ones will be used for subsequent transcoding.

Actually the parameters being matched are:

In case of predefined video profiles with the TRANSFORMATION_STREAMING transformation declared, they are considered only for the job with the same transformation applied.

In case of Quality.HIGH, Quality.MEDIUM or Quality.LOW quality passed the screen dimensions are excluded from the comparison and the first matching profile of a given quality is selected. If none fits Alembik picks the first defined profile of the Quality.ANY quality and of the relevant media type (and with Streaming declared if applicable).

In case of Quality.ANY quality, all the levels are analyzed and the first encountered profile of the highest possible quality is selected.

The additional hintable parameter applies to video jobs only and, if set to true, tells the server to check, whether the device requires hinted files for playback (i.e. progressive download). If it is so, only the "hintable" predefined profiles will be taken into account and the eventual transcoding parameters set will contain the TRANSFORMATION_HINTING.

Parameters:
job - transcoding job
quality - desired quality of the matching profile
hintable - does the video hinting requirement need to be considered?
See Also:
TRANSCODING_QUALITY, TRANSCODING_HINTABLE, Quality, isBestMatchingRequested(TranscodingJob), getBestMatchingQuality(TranscodingJob), isBestMatchingHintable(TranscodingJob)

getBestMatchingQuality

public static Quality getBestMatchingQuality(TranscodingJob job)
Returns the quality set for the given transcoding job, which defines the expected quality level of the matching profile.

Parameters:
job - transcoding job
Returns:
desired quality of the matching profile if requested; otherwise null
See Also:
TRANSCODING_QUALITY, Quality, setBestMatchingQuality(TranscodingJob, Quality, boolean), isBestMatchingRequested(TranscodingJob)

isBestMatchingHintable

public static boolean isBestMatchingHintable(TranscodingJob job)
Checks whether the "best matching" strategy should take into account the devices, which require hinted video files.

Parameters:
job - transcoding job
Returns:
true if the video hinting requirement needs to be considered; otherwise false
See Also:
TRANSCODING_HINTABLE, TRANSFORMATION_HINTING, setBestMatchingQuality(TranscodingJob, Quality, boolean)

isBestMatchingRequested

public static boolean isBestMatchingRequested(TranscodingJob job)
Checks whether the given transcoding job has the "best matching" strategy applied.

Parameters:
job - transcoding job
Returns:
true if the profile matching has been requested; otherwise false
See Also:
TRANSCODING_QUALITY, Quality, setBestMatchingQuality(TranscodingJob, Quality, boolean)

getResultInfo

public static java.lang.String getResultInfo(JobResult result,
                                             TranscodingUtils.FileInfo key)
Returns the value of the given information property.

Parameters:
result - job result returned by the server
key - information property
Returns:
value of the property if provided by the server; otherwise null
See Also:
TranscodingUtils.FileInfo, TranscodingService.processSync(TranscodingRequest), TranscodingService.getTranscodingInfo(TranscodingRequest, String)

getResultState

public static TranscodingState getResultState(JobResult result)
Returns the information about the state of a transcoding process.

Parameters:
result - job result returned by the server
Returns:
state of the transcoding process
See Also:
TranscodingState, TranscodingService.processSync(TranscodingRequest), TranscodingService.getTranscodingInfo(TranscodingRequest, String)

getResultQuality

public static Quality getResultQuality(JobResult result)
Returns the quality of the profile selected by the "best matching" strategy.

Parameters:
result - job result returned by the server
Returns:
quality of the selected predefined profile, if any; otherwise null
See Also:
MATCHED_QUALITY, TranscodingService.processSync(TranscodingRequest), TranscodingService.getTranscodingInfo(TranscodingRequest, String), setBestMatchingQuality(TranscodingJob, Quality)

getMatchedId

public static java.lang.String getMatchedId(TranscodingParams profile)

Returns the proprietary identifier of a transcoding profile resolved by Alembik. The value may come from one of the following sources:

Parameters:
profile - transcoding profile returned by the server
Returns:
matched id, if any; otherwise null
See Also:
MATCHED_ID, TranscodingService.getTranscodingProfile(TranscodingJob)

getMatchedId

public static java.lang.String getMatchedId(JobResult result)

Returns the proprietary identifier of a transcoding profile resolved by Alembik. The value may come from one of the following sources:

Parameters:
result - job result returned by the server
Returns:
matched id, if any; otherwise null
See Also:
MATCHED_ID, TranscodingService.processSync(TranscodingRequest), TranscodingService.getTranscodingInfo(TranscodingRequest, String)