File Packager reference

Command-line options to fragment files

You can use the command line to set all the options for the File Packager. Options set at the command line override any options set in the configuration file. The only required option is --input-file.

Option

Description

Required

Default value

--allowed-drift

As the tool rounds off durations, it drifts from the real time. This option specifies how far the tool can vary from the real time, in seconds.

No

1

--bitrate

Specifies the bitrate of the content to fragment and adds it to the manifest file. Use this option to serve files encoded at multiple bitrates. Use this option or manually edit the manifest file to add the bitrate.

No

0

--config-dump

Dumps the configuration settings. This option does not fragment the file.

No

None

--conf-file

The configuration file that contains settings for the packaging process.

You can specify an absolute path or a path relative to the directory containing the tool. You can use the filename f4fpackager_config.xml or any other legal filename.

Suppose the tool is in the c:\media directory and the configuration file is in the c:\media\test directory. Run the following from the command line: f4fpackager --conf-file=test\f4fpackager_config.xml.

No

f4fpackager_config.xml

If the f4fpackager_config.xml file is not in the current directory, the default value is “none”.

--duration-precision

How precise the fragment durations are, in seconds. When using a time-based fragment duration, duration precision controls how much rounding is applied to the fragment durations in the fragment run tables. This prevents small variations in the fragment durations from causing the run tables to grow too large.

No

0.1

--edit-list

If you specify this option, the File Packager follows the edit list in the input file. By default, the packager does not follow the edit list.

No

None

--external-bootstrap

Outputs the bootstrap box to a .bootstrap file. If you omit this option, the information in the bootstrap box is placed in the manifest file (F4M).

Outputs DRM additional header information to a .drmmeta file when a file is encrypted. If you omit this option, the additional header information is included in the manifest file.

No

None

--fragment-duration

The target length of each fragment, in seconds. The actual length of each fragment depends on properties of the input file, such as the keyframe interval.

No

4

--frame-precision

This option is the frame-based equivalent to the --duration-precision option. This value is the number of frames to round to in the fragment run tables.

No

1

--frame-rate

The frame rate of the original content, in frames per second (fps). The value is floating point; for NTSC, use the value 29.97.

No

 

--frames-per-keyframe-interval

The number of frames between each keyframe. For example, 30 fps video with a keyframe every 2 seconds contains 60 frames per keyframe interval.

No

 

--input-file

The path to the source container file. The path can be absolute or relative to the directory containing the File Packager.

If you specify the --conf-file option and the configuration file contains an <input-file> value, you do not need to use the --input-file option.

Yes

None

--inspect-bootstrap

Inspects the bootstrap file. If a .bootstrap file is provided as an input, it inspects the file. If not, it inspects the bootstrap box in an F4F file.

No

None

--inspect-fragments

Inspects the F4F fragments in an F4F file.

No

None

--inspect-index

Inspects the AFRA index file if an AFRA file is provided.

No

None

--keyframe-intervals-per-fragment

The number of keyframe intervals per fragment. The default value is 1 which sets the fragment size to the same size as the keyframe interval.

No

1

--manifest-file

Updates an existing manifest file. Use this option to package a file encoded at multiple bitrates for dynamic streaming. For example, you could package three files (sample_500kpbs.f4v, sample_1000kbps.f4v, and sample_1500kbps.f4v) and add them all to the same manifest file.

If you omit this option, the tool creates a Flash Media Manifest file (F4M).

No

None

--output-manifest-file

Creates a manifest file with the name provided.

No

None

--output-path

The path to the directory to which the packaged files are output. If the directory doesn’t exist, the tool creates it. The path can be absolute or relative to the directory containing the File Packager.

No

Current directory

--sample-dump

Dumps the samples and the fragments they’re set to. This option does not fragment the file.

No

None

--segment-duration

The length, in seconds, of a segment. The default value is 0 which creates 1 segment.

No

0

Setting fragment duration based on frames or time

The File Packager has options that determine the size of fragments. There is a frame-based option, --keyframe-interval-per-fragment, and a time-based option, --fragment-duration. Each option has additional options that refine how the tool creates fragments.

Use the frame-based option when the source media contains video encoded at a constant frame rate. The frame-based option lets you carefully match the fragment size to the video's keyframe interval. Use the time-based option for media that contains audio or data but not video.

Frame-based options: --keyframe-interval-per-fragment, --frames-per-keyframe-interval, --frame-rate, --frame-precision.Time-based options: --fragment-duration, --duration-precision. The frame- based option overrides the time-based option. If you don't provide a --keyframe-interval-per-fragment option, the File Packager uses the --fragment-duration option. If you don't provide values for --keyframe-interval-per-fragment or --fragment-duration, the File Packager uses the default fragment duration, which is 4 seconds.

Command-line options to encrypt files

Use the File Packager to encrypt files for use with Flash Access 2.0. Some of the following options require digital certificates. To obtain digital certificates, see the Flash Access Certificate Enrollment Site.

Option

Description

Required

Default

--transport-cert

The DER encoded transport certificate file.

Yes

None

--license-server-url

The URL of the license server that handles license acquisition for this content.

Yes

None

--license-server-cert

The DER encoded license server certificate file used for content protection.

Yes

None

--packager-credential

The PFX file containing the packager's protection credentials.

Yes

None

--credential-pwd

The password string used to secure the packager credentials.

Yes

None

--common-key

A file containing the common key. The common key is used with the content ID to generate the content encryption key. The common key must be randomly generated and 128 bytes. Although the common key is 128 bytes, only the first 128 bits (16 bytes) are used to generate the key.

For information about generating a common key file, see Generate a common key.

For dynamic streaming, use the same common key and content ID for an entire set of content. Using the same key and id allows a single license to decrypt a set of content.

Yes

None

--content-id

The content ID used with the common key to generate the content encryption key.

Yes

None

--policy-file

The file containing the policy for this content. Currently only a single policy can be applied to content packaged with this tool.

Yes

None

--encrypt-audio

Specifies whether to encrypt the audio in the file.

No

true

--encrypt-video

Specifies whether to encrypt the video in the file.

No

true

--encrypt-data

Specifies whether to encrypt the data in the file. This option supports both FLV and F4V/MP4 formats.

No

true

--ms-unencrypted

The number of milliseconds at the beginning of the content that remains unencrypted. Use this option to improve stream start times because it allows the client to acquire the license asynchronously as playback begins.

No

0

--video-encrypt-level

The level of encryption for H.264 content. Possible values are 0 (low), 1(medium), and 2 (high). The default value is 2.

Note: Using this option on non-H.264 content won’t generate an error, but it won’t change the encryption level.

The values “0” and “1” mean “partial encryption”; only important samples like video keframes are encrypted. This setting creates fewer frames to decrypt. Use this setting to improve playback performance on the client.

The value "2", encrypts all video samples (after --ms-unencrypted, if specified)..

No

2

File Packager configuration file

The File Packager uses an XML configuration file to read values for command-line options. The default configuration file, f4fpackager_config.xml, is located in the same directory as the File Packager. It is often easier to specify options in a text file that you can reuse than it is to enter options at the command line.

Options you set at the command line override options set in the configuration file. This feature lets you create a configuration file for a set of content but edit a few settings for individual files.

Note: You do not need to use the configuration file to run the tool.

Enter the --conf-file option at the command line to pass the name and location of a configuration file. If you don’t enter the --conf-file option, the tool checks for a file called f4fpackager_config.xml file in the same directory as the tool.

You can enter all the options for packaging and encrypting, including the input file, in the configuration file.

The following is the format of the configuration file:

<offline> 
    <input-file>/media/input-file.f4v</input-file> 
    <output-path>/media/http</output-path> 
    <fragment-duration></fragment-duration> 
   ... You can set as many options as you want ... 
</offline>

For options that take a path, you can specify absolute paths or paths relative to the directory containing the tool.

Errors

The File Packager outputs the following errors:

Error code

Error message

Description

1

File not found

The input file, the manifest file or the configuration file could not be found.

2

Input File not given

No input file has been specified. To run the File Packager, you must specify a path to a supported file type. See Input file formats and output file formats.

3

Invalid input file

The input file, manifest file, or configuration file is an invalid input file.

4

Can’t access file

The input file, manifest file, or configuration file cannot be accessed.

5

Unsupported codec

The input file contains unsupported codecs.

6

No supported tracks

The input file doesn’t contain any supported tracks.

7

Write error

A write error occurred. Verify that the input file is structured correctly and that there is enough memory to run the File Packager.

8

XML library error

An error occur ed when parsing the configuration file. Verify that the XML is structured correctly.

9

Program Options error

The program options library failed. Verify that the command line arguments are structured correctly.

10

Offline Encryption info error

The File Packager doesn’t have enough information to encrypt the file. Verify that there aren’t any missing inputs.

11

Encryption library error

The encryption library threw an error while encrypting the content.

12

Standard error

A Standard Exception has occur ed. Verify that there is enough memory to run the File Packager.

13

Invalid Bootstrap error

The bootstrap file is corrupt and cannot be parsed.

14

FLV Error

The FLV file cannot be read.

999

Internal error

There has been an internal error in the File Packager.

1000

Invalid Input file warning

Invalid input file warning.

2000

Invalid Error code

The error code is invalid.