Attached is a sample .bat file (renamed as txt as groups will not allow bat files) containing an example of how to add jobs to the render queue and start rendering them. For the moment command line support is limited to Windows only, if there are enough requests I will add this feature to the OSX version.
------------------------------------------------------------------------------------------------------------------------
-- Add a Render Job
------------------------------------------------------------------------------------------------------------------------
Command: render
Example:
start SWFRenderer.exe command=render file=C:\anim.swf exportPath=C:\exports\ fileName=anim exportFormat=MP4Exporter
start SWFRenderer.exe command=render flashVars="varA=10&varB=test" file=C:\anim.swf exportPath=C:\exports\ fileName=URLVars exportFormat=PNGExporter
Required Parameters:
"fileName" , Path to SWF file
"file" , Name of export file / image sequence
"exportPath" , Path to export file / image sequence
Optional Parameters:
"filePadding", Default: 000000
"frameRate", Default: 24
"backgroundColor", Default: 0x000000
"transparent", Default: true
"startFrame", Default: 1
"captureStep", Default: 1
"scale", Default: 1
"stopMode", Default: 0
Stop after time elapsed, value = 0
Stop at frame, value = 1
Stop at last frame, value = 2
"stopTime", Default: 5
"stopAtFrame", Default: 120
"createSubFolderFromFileName", Default: true
"startFrameEnable", Default: false
"captureStepEnabled", Default: false
"useAppContext", Default: false
"exportFormat", Default: PNGExporter
Export JPEG sequences: exportFormat=JPEGExporter
Export PNG sequences: exportFormat=PNGExporter
Export MP4 video: exportFormat=MP4Exporter
Note: The options for this are case sensitive, make sure you use the right camel casing ( i.e. PNGExporter )
"autoStartRender", Default: false
"quitOnComplete", Default: false
"flashVars", Send flash variables to a loaded SWF ( new in 2.086 ) this needs to follow general URL query string value paid format:
flashVars="varA=10&varB=test"
Note that on the windows CLI this will need to be wrapped in quotes (like above example).
------------------------------------------------------------------------------------------------------------------------
-- Start the render queue
------------------------------------------------------------------------------------------------------------------------
Description: start the render queue
Command: startRender
Example: start SWFRenderer.exe command=startRender
------------------------------------------------------------------------------------------------------------------------
-- Exit the application
------------------------------------------------------------------------------------------------------------------------
Description: exit the application
Command: exit
Example: start SWFRenderer.exe command=exit
------------------------------------------------------------------------------------------------------------------------
-- Quit on complete ( global flag )
------------------------------------------------------------------------------------------------------------------------
Description: Toggle global quit on complete flag (persistent between sessions)
Command: quitOnComplete
Example: start SWFRenderer.exe command=quitOnComplete enable=true
------------------------------------------------------------------------------------------------------------------------
-- Job notification callback
------------------------------------------------------------------------------------------------------------------------
Version 2.08 of SWFRenderer lets users specify a callback URL to post job reports
to a server side script. This can be changed using the command line, or the UI.
Description: Enable / Disable job report/callback URL
Command: callbackURL
Required Parameters:
"enable", Default: true ( enable / disable job notification callback)
Optional; Parameters:
"url", Default: '' ( set the full URL to a script to call when a SWF is finished processing )
------------------------------------------------------------------------------------------------------------------------
-- Set a timeout
------------------------------------------------------------------------------------------------------------------------
Added in version Version 2.082 of SWFRenderer
Description: Set a timeout that stops a render job after a specified number of seconds of footage has been exported.
Command: timeout
Required Parameters:
"enable" - true | false
Optional Parameters:
"time", Default: 60 (seconds)
Example: start SWFRenderer.exe command=timeout enable=true time=120
------------------------------------------------------------------------------------------------------------------------
-- Opening the application and setting the port number
------------------------------------------------------------------------------------------------------------------------
Command: setPort
Required Parameters: port, Default:8888
Example: SWFRenderer.exe command=setPort port=8889
------------------------------------------------------------------------------------------------------------------------
-- Check / enable autoupdate notification on startup
------------------------------------------------------------------------------------------------------------------------
Added in version Version 2.082 of SWFRenderer
Description: Check for updates on startup
Command: autoupdate
Required Parameters:
"enable" - true | false
Example: start SWFRenderer.exe command=autoupdate enable=true
------------------------------------------------------------------------------------------------------------------------
-- Continue rendering on sandbox violation security errors
------------------------------------------------------------------------------------------------------------------------
Added in version Version 2.085 of SWF Renderer
Description: Continue rendering if loaded SWF encounters a sandbox violation security error
normally rendering stops on all errors and moves to the next item in queue. This continues rendering
on these errors ( Error #2070: Security sandbox violation ).
Command: continueRenderOnSandboxViolations
Required Parameters:
"enable" - true | false
Example: start SWFRenderer.exe command=continueRenderOnSandboxViolations enable=true
------------------------------------------------------------------------------------------------------------------------
-- Multiple commands in one CLI Call
------------------------------------------------------------------------------------------------------------------------
Added in version Version 2.084 of SWFRenderer
Description: This is an aggregation of multiple commands that can be sent in a single CLI call. As long as each command starts with ‘command’ users can chain multiple commands in one CLI entry. Example below hi-lights each command in bold.
Example: start SWFRenderer.exe
command=render file=C:\anim.swf exportPath=C:\exports\ fileName=anim command=render file=C:\anim2.swf exportPath=C:\exports\ fileName=anim2 useAppContext=true stopTime=20 command=render file=C:\anim3.swf exportPath=C:\exports\ fileName=anim3 useAppContext=true stopTime=20 exportFormat=MP4Exporter
command=quitOnComplete enable=true command=timeout enable=true time=5
command=callbackURL enable=true url=http://swfr:8087/job.php command=autoupdate enable=false
command=startRender
------------------------------------------------------------------------------------------------------------------------
-- Customising FFMPEG command strings
------------------------------------------------------------------------------------------------------------------------
Added in version 2.087 of SWFRenderer
Description: a mechanism to customize the FFMPEG encoding process from the CLI. This requires some knowledge of FFMPEG's CLI operations and settings.
Command: enableCustomFFMPEGSettings
Required Parameters:
"enable" - true | false, enable or disable custom FFMPEG settings
Optional Parameters:
"settings" - CLI string with dynamic variables that SWF Renderer uses to run FFMPEG processes
- the default settings string:
$FPS -i $IMAGE_SEQUENCE -c:v libx264 -preset ultrafast -qp 0 $OUTPUT_FILE -y
You can replace that with your encode string provided you keep the three dynamic fields, SWF Renderer requires for this to work.
These are:
$FPS - Frames Per Second from SWF Renderer
$IMAGE_SEQUENCE - Path to image sequence generated from SWF Renderer
$OUTPUT_FILE - Path to output file
Failure to include ALL of these in your custom command will cause SWF Renderer to revert to the default command.
Example: start SWFRenderer.exe command=enableCustomFFMPEGSettings enable=true settings="-r $FPS -i $IMAGE_SEQUENCE -c:v libx264 -preset veryslow -qp 0 $OUTPUT_FILE -y"
Note: In the windows CLI you have to wrap the settings string in quotations - otherwise it will be treated as multiple flags / parameters.