Formats and Presets 1.1:Special Flags

From Aviberry API

Jump to: navigation, search

Contents
Still have a question?



Special flags are not included into preset settings, but you can add them to preset_data to get the desired result.

Contents

GenerateFLV

GenerateFLV - special flag used for changing MPEG-4 container to FLV without reencoding. The input file should be in MPEG-4 format with H.264 video codec and AAC audio codec.
Type: boolean.
Default value - false.

Can possess the following values:

Value Description
false Use standard file transcoding
true Change container from MPEG-4 to FLV without reencoding


This flag can be used:

  • When encoding to FLV if the input file is in MPEG-4 format with H.264 video codec and AAC audio codec.
  • When encoding to MPEG-4 with H.264 video codec and AAC audio codec. There will be two output files: MPEG-4 file is created first, and then FLV file is created based on it without reencoding. To ensure correct work, set target_filename_policy parameter equal to OVERWRITE_EXTENSION.

Usage Examples (XML-RPC)


<member>
    <name>format_id</name>
    <value><string>16505</string></value>
</member>
<member>
    <name>preset_id</name>
    <value><string>-2</string></value>
</member>
<member>
    <name>preset_data</name>
    <value><string>
        {"VideoCodec":"avc1","AudioCodec":"mp4a","Width":"320","Height":"180","FrameRate":"25",
        "VideoSAsInput":false,"PSPMode":false,"ProgressiveDownload":true,"ResizeMethod":"1","ResizeQuality":"1",
        "Frequency":"48000","Channels":"2",
        "VParams":{"H264":{"Profile":4,"Quality":2,"MaxIFrameInterval":25,"MaxBFrameSequence":0,"VBR":true,"AspectRatio":0}},
        "AParams":{"AAC":{"Profile":"2","Bitrate":"192000","Quality":"100"}},
        "GenerateFLV":true}
    </string></value>
</member>


<member>
    <name>format_id</name>
    <value><string>16509</string></value>
</member>
<member>
    <name>preset_id</name>
    <value><string>-2</string></value>
</member>
<member>
    <name>preset_data</name>
    <value><string>
        {"VideoCodec":"avc1","Width":320,"Height":240,"FrameRate":"25","VideoSAsInput":true,"ResizeMethod":1,"ResizeQuality":1,
        "IsSound":true,"AudioBitrate":128,"Frequency":44100,"Channels":2
        "VParams":{"H264":{"AvcC":true,"Profile":2,"Bitrate":-1,"Quality":0,"MaxIFrameInterval":125,"MaxBFrameSequence":0,"AspectRatio":0}},
        "GenerateFLV":true}
    </string></value>
</member>

SkipIfFileMatchesPreset

SkipIfFileMatchesPreset - special flag used for checking if file conversion is required. If input file characteristics are close to specified preset settings, the file is not converted, and is simply returned to the user.
Type: boolean.
Currently, this flag can be used only when converting to MPEG-4.
Default value - false.

Can possess the following values:

Value Description
false Allways convert files
true Skip conversion if input file characteristics are close to specified preset settings


The following characteristics are compared to check if conversion is required:

  • Video:
    • If VideoSAsInput = false
      • Width
      • Height
      • FrameRate, accurate within 0,01
    • Video codec (4CC signature)
    • For MPEG-4 codec
      • Profile
      • Bitrate (if Bitrate !=-1, i.e. automatic bitrate selection is not used), the default discrepancy may be up to 100 kbit/s
      • AspectRatio, accurate within 0,01
    • For H.263 codec
      • Using VBR or CBR
      • Bitrate (if VBR=false)
    • For H.264 codec
      • Profile
      • Bitrate (if Bitrate !=-1, i.e. automatic bitrate selection is not used), the default discrepancy may be up to 100 kbit/s
      • AspectRatio, accurate within 0,01
  • Audio
    • Channels
    • Frequency
    • Audio codec (4CC signature)
    • for AAC codec
      • Profile
      • Bitrate, the default discrepancy may be up to 10 kbit/s
    • for AMR codec
      • Bitrate, the default discrepancy may be up to 10 kbit/s
    • for MP3 codec
      • Bitrate, the default discrepancy may be up to 10 kbit/s


Usage Example (XML-RPC)


<member>
    <name>format_id</name>
    <value><string>16505</string></value>
</member>
<member>
    <name>preset_id</name>
    <value><string>-2</string></value>
</member>
<member>
    <name>preset_data</name>
    <value><string>
        {"VideoCodec":"avc1","AudioCodec":"mp4a","Width":"320","Height":"180","FrameRate":"25",
        "VideoSAsInput":false,"PSPMode":false,"ProgressiveDownload":true,"ResizeMethod":"1","ResizeQuality":"1",
        "Frequency":"48000","Channels":"2",
        "VParams":{"H264":{"Profile":4,"Quality":2,"MaxIFrameInterval":25,"MaxBFrameSequence":0,"VBR":true,"AspectRatio":0}},
        "AParams":{"AAC":{"Profile":"2","Bitrate":"192000","Quality":"100"}},
        "SkipIfFileMatchesPreset":true}
    </string></value>
</member>

PreviewOffset

PreviewOffset - special parameter allowing to set a time shift for a snapshot.
Type: integer.
The measurement unit is ms.
The special value -1 is used to get a snapshot from a middle of a video file. If PreviewOffset value is higher than video duration, than snapshot will be taken from a middle of a video file. This parameter can be used for all output formats.

Usage Example (XML-RPC)


<member>
    <name>format_id</name>
    <value><string>16505</string></value>
</member>
<member>
    <name>preset_id</name>
    <value><string>-2</string></value>
</member>
<member>
    <name>preset_data</name>
    <value><string>
        {"VideoCodec":"avc1","AudioCodec":"mp4a","Width":"320","Height":"180","FrameRate":"25",
        "VideoSAsInput":false,"PSPMode":false,"ProgressiveDownload":true,"ResizeMethod":"1","ResizeQuality":"1",
        "Frequency":"48000","Channels":"2",
        "VParams":{"H264":{"Profile":4,"Quality":2,"MaxIFrameInterval":25,"MaxBFrameSequence":0,"VBR":true,"AspectRatio":0}},
        "AParams":{"AAC":{"Profile":"2","Bitrate":"192000","Quality":"100"}},
        "PreviewOffset":15000,
        "FormatId":"16505"}
    </string></value>
</member>

GetMediaInfo

GetMediaInfo - special parameter allowing to obtain information about converted file.
Type: string.
Is set as a JSON string containing a set of characteristics you want to get.
The special value GetMediaInfo=COMPLETE is used to get all data.
The result can be viewed after the conversion is finished using getConversion method.

Example of specifying a set of parameters:

"GetMediaInfo":{"General":"VideoCount, Video_Format_List, AudioCount, Audio_Format_List","Video":"Width, Height","Audio":"Format, SamplingRate"} 
You can find the full list of parameters here. Parameter names are case-sensitive.

This parameter can be used for all output formats.

Usage Example (XML-RPC)


<member>
    <name>format_id</name>
    <value><string>16505</string></value>
</member>
<member>
    <name>preset_id</name>
    <value><string>-2</string></value>
</member>
<member>
    <name>preset_data</name>
    <value><string>
        {"VideoCodec":"avc1","AudioCodec":"mp4a","Width":"320","Height":"180","FrameRate":"25",
        "VideoSAsInput":false,"PSPMode":false,"ProgressiveDownload":true,"ResizeMethod":"1","ResizeQuality":"1",
        "Frequency":"48000","Channels":"2",
        "VParams":{"H264":{"Profile":4,"Quality":2,"MaxIFrameInterval":25,"MaxBFrameSequence":0,"VBR":true,"AspectRatio":0}},
        "AParams":{"AAC":{"Profile":"2","Bitrate":"192000","Quality":"100"}},
        "GetMediaInfo":"COMPLETE"}
    </string></value>
</member>



Contents
Still have a question?

Views
Personal tools