SmoothFlow Deployment : Creating Assets Using an SaaS : Initiate Encoding Using an SaaS

Initiate Encoding Using an SaaS
The SFAssetGenerator script works with two XML files, setup.xml and asset.xml and outputs one, jobid.xml. You use this script to provide the chosen encoding service with information for the encoding to generate the multi-bitrate assets. This section describes the three XML files and provides usage options. Initiating the encoding requires these steps:
1.
Create a setup.xml file describing the Website of the encoding service and your login credentials plus where you want the multi-bitrate profiles output to and credentials for that (i.e. FTP site and credentials), and how often you want status polling done.
2.
Create the asset.xml file describing each single-bitrate video and how many multi-bitrate profiles you want created and at what rates; including frames-per-second, container format, and keyframe interval.
3.
Run the SFAssetGenerator.py python script to initiate the encoding of the referenced single-bitrate videos into multi-bitrate (MBR) profiles. This script outputs the jobid.xml file with descriptions of the multi-bitrate profiles created by the SaaS.
Usage Options for SFAssetGenerator.py Script
Use the SFAssetGenerator.py python script by running the python command at the command line and using the following tags. Example follows.
-s—setup.xml
-a—asset.xml
-o—jobid.xml
Example:
python SFAssetGenerator.py -s <setup_xml_file> -a <asset_xml_file> -o <jobid_xml_file>
setup.xml
This file specifies the global setup configuration parameters; variables are shown in curly brackets ({ }). Can be called setup.xml and its location specified via the –s command line parameter. If it is not specified, the script looks in the current folder for a setup.xml file. If the file is absent, the script throws an error and stops. The configurable parameters for setup.xml are described in Table 33, below, followed by an example file.
Table 33 setup.xml File Parameters  
<name> – name of encoding service; i.e. www.encoding.com. The "pre_process=1" corresponds to the encoding service; currently only encoding.com is supported.
<login> – your encoding.com credentials
<ftp_source_location>
<ftp_dest_location>
<username> – the authorized FTP user
<password> – the authorized FTP user password
<server_ip> – FTP server IP address, source and destination, respectively, (if different)
<path> – path in or out, respectively
< ?xml version="1.0"?>
<!—Global Setup Configuration Parameters-->
<setup_info>
<!—Provide URI and login credentials to access encoding service provider-->
<service_provider>
<name pre_process="1"> {name_of_encoding_service} </name>
<login userid={value} userkey={value}> </login>
</service_provider>
<!—Provide the source and destination locations for the FTP folders where the files will be picked up, encoded, and the results transferred to-->
<ftp_source_location>
<username> {username} </username>
<password> {password} </password>
<server_ip> {ftp_source_server_IP} </server_ip>
<path> {/in} </path>
</ftp_source_location>
<ftp_dest_location>
<username> {username} </username>
<password> {password} </password>
<server_ip> {ftp_dest_server_IP} </server_ip>
<path> {/out} </path>
</ftp_dest_location>
<!-- polling interval for status messages at the command line, in seconds-->
<status_polling_duration> {9000} </status_polling_duration>
</setup_info>
asset.xml
This file specifies the encoding configuration parameters for each asset. The name of this XML file is specified via the –a command line parameter. The configurable parameters for asset.xml are described in Table 34, below, followed by an example file.
Table 34 asset.xml File Parameters  
<videoname> – Video name with full path, if not in the current directory of the script
<profile_cnt> – Number of multi bitrate files that need to be generated (default is 3)
<profile_info> — Information regarding the output profiles with following attributes. The 3 default profiles that will be generated will be at a video bitrate of 250kbps,500kbps, 800kbps and audio bitrate 64kbps (constant for all profiles)
p – profile number
ab – audio bitrate for profile
vb – video bitrate for profile
width – pixel width for profile
height – pixel height for profile
deinterlace – option to convert interlaced video, like common analog television signals, into a non-interlaced form (i.e. field to frame conversion)
<fps> – Frames per second of the video
<format> – Container format for the encoded media (either flv, mp4)
<keyframe_interval> – Key frame positions
NOTE: The recommended keyframe interval is two seconds; however, this file specifies the keyframe interval in numbers of frames, not seconds. To have a two second frame interval, make this value double the value entered for <fps> (frames per second).
< ?xml version="1.0"?>
<!—Asset Level Encoding Configuration Parameters-->
<asset_parameters>
<videoname> {video_file_name} </videoname>
<profile_cnt> {number_of_profiles} </profile_cnt>
<profile_info> p= {index} 1 ab= {audio-bitrate in kbps} vb= {video-bitrate in kbps} width={width in pixels} height={height in pixels} deinterlace={true/false , default = true} </profile_info>
<profile_info> p= {index} 1 ab= {audio-bitrate in kbps} vb= {video-bitrate in kbps} width={width in pixels} height={height in pixels} deinterlace={true/false, default = true} </profile_info>
<fps> 25</fps>
<format>flv</format>
<keyframe_interval>50</keyframe_interval>
</asset_parameters>
jobid.xml
The SFAssetGenerator.py script run with the setup.xml and asset.xml files, outputs this file, jobid.xml, listing ID’s provided by encoding.com and used as input to SFSegment.py. It also provides the number of profiles (equals number of job ID’s) and the bitrates of each profile. The parameters for jobid.xml are described in Table 35, below, followed by an example file.
 
Table 35 jobid.xml File Parameters  
<video_details – Video name.
<profile_count> – Number of multi bitrate files that were generated.
<profile_list> — Information regarding the output profiles.
<profile_info> — Information regarding the output profiles with following attributes.
p – profile number
audiobit – audio bitrate for profile
videobit – video bitrate for profile
<?xml version="1.0"?>
<!-- video list -->
<video_list>
<!-- video name -->
<video_details video_name="sf-enc.mp4">
<profile_count>2</profile_count>
<!-- profile info -->
<profile_list>
<profile_info p="1" audiobit="64" videobit="128"></profile_info>
<profile_info p="2" audiobit="64" videobit="256"></profile_info>
</profile_list>
</video_details>
</video_list>

Report an Error
Media Flow Controller Administrator's Guide and CLI Command Reference
Copyright © 2010 Juniper Networks, Inc.