{"id":13908598,"url":"https://github.com/IORoot/Video_FFMPEG-Scriptflow","last_synced_at":"2025-07-18T07:31:46.775Z","repository":{"id":94752841,"uuid":"598991805","full_name":"IORoot/Video_FFMPEG-Scriptflow","owner":"IORoot","description":"🎞 FFMPEG Utility scripts and JSON scripter. 💡Run multi-stage ffmpeg workflows using a JSON config.","archived":false,"fork":false,"pushed_at":"2024-09-22T14:36:39.000Z","size":109410,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-25T17:46:24.537Z","etag":null,"topics":["automation","bash","ffmpeg","ffmpeg-script","ffmpeg-wrapper","json","runner"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IORoot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-08T08:18:45.000Z","updated_at":"2024-11-06T08:37:39.000Z","dependencies_parsed_at":"2024-07-07T09:22:07.348Z","dependency_job_id":"e7744fe2-9faf-4073-b959-2c313c0900b2","html_url":"https://github.com/IORoot/Video_FFMPEG-Scriptflow","commit_stats":null,"previous_names":["ioroot/video_ffmpeg-scriptflow"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/IORoot/Video_FFMPEG-Scriptflow","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IORoot%2FVideo_FFMPEG-Scriptflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IORoot%2FVideo_FFMPEG-Scriptflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IORoot%2FVideo_FFMPEG-Scriptflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IORoot%2FVideo_FFMPEG-Scriptflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IORoot","download_url":"https://codeload.github.com/IORoot/Video_FFMPEG-Scriptflow/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IORoot%2FVideo_FFMPEG-Scriptflow/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265720605,"owners_count":23817270,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","bash","ffmpeg","ffmpeg-script","ffmpeg-wrapper","json","runner"],"created_at":"2024-08-06T23:02:51.291Z","updated_at":"2025-07-18T07:31:46.122Z","avatar_url":"https://github.com/IORoot.png","language":"Shell","funding_links":[],"categories":["HarmonyOS"],"sub_categories":["Windows Manager"],"readme":"\u003cdiv id=\"top\"\u003e\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"https://svg-rewriter.sachinraja.workers.dev/?url=https%3A%2F%2Fcdn.jsdelivr.net%2Fnpm%2F%40mdi%2Fsvg%406.7.96%2Fsvg%2Fvideo-box.svg\u0026fill=%234cae4c\u0026width=200px\u0026height=200px\" style=\"width:200px;\"/\u003e\n\n\u003ch3 align=\"center\"\u003eFFMPEG Util scripts and Templates\u003c/h3\u003e\n\u003c/div\u003e\n\nFFMPEG wrapper scripts and a script runner that reads JSON configuration files. \nThe wrapper scripts provide an interface for executing specific tasks, while the script runner allows users to define a series of tasks to be performed on a set of media files. \nThis automation pipeline saves time and effort, enabling users to execute multiple tasks on numerous media files with a single command.\n\n\n# Highlights\n\n- 🏃‍♂️ Automate FFMPEG steps using a JSON file\n- 💡 Simple independent scripts for specific ffmpeg tasks.\n- 🏗️ Build videos in a pipeline automatically\n- 📲 Download from external sources\n- 📦 Run bulk tasks on folders of video files\n- 🎨 Built-in variables for randomness, folders, colour and tailwindcss palettes\n\n# Scripts\n\n| Script               | Description                                                      |\n| -------------------- | ---------------------------------------------------------------- |\n| `ff_append.sh`       | This will concatenate two videos together and re-encode them     |\n| `ff_aspect_ratio.sh` | Changes the container metadata's Display Aspect Ratio (DAR)      |\n| `ff_audio.sh`        | Overlay audio onto video track                                   |\n| `ff_blur.sh`         | Simple blur function using an unsharp mask                       |\n| `ff_colour.sh`       | Change brightness, contrast, gamma, saturation of video          |\n| `ff_concat.sh`       | Concatenate multiple videos together                             |\n| `ff_convert.sh`      | Convert an apple quicktime MOV to MP4 file                        |\n| `ff_crop.sh`         | Crop video to specific size                                       |\n| `ff_cut.sh`          | Cut video from start time to end time.                           |\n| `ff_download.sh`     | Use CURL to download multiple files. Useful for scriptflow.        |\n| `ff_flip.sh`          | Horizontally and/or vertically flip the video                     |\n| `ff_fps.sh`          | Alter the FPS without changing length of video                   |\n| `ff_grouptime.sh`    | Proportionally trims and concats videos to target video duration |\n| `ff_image.sh`        | Make a video from a looped image                                 |\n| `ff_kenburns.sh`     | Generate a video from an image with a zoom-pan effect            |\n| `ff_lut.sh`          | Apply a 3DL/Cube LUT file to a video                              |\n| `ff_middle.sh`       | Remove equal number of seconds from start and end of video       |\n| `ff_overlay.sh`      | Overlay an image or video on top of another video                |\n| `ff_pad.sh`          | Add a background padding around the video                        |\n| `ff_proxy.sh`        | Create a down-scaled,res,fps,crf proxy file for a video           |\n| `ff_rotate.sh`       | Rotate a video in 90 degree increments                           |\n| `ff_scale.sh`        | Change the width and height of the video                         |\n| `ff_sh_runner.sh`    | Run any shell command (dangerous!)                               |\n| `ff_sharpen.sh`      | Simple sharpen function using an unsharp mask                    |\n| `ff_social_media.sh` | Converts the video, ready for various social platforms           |\n| `ff_stack.sh`        | Align two videos vertically, horizontally or in a 2x2 grid.      |\n| `ff_subtitles.sh`    | Use SRT File to overlay hard-embedded subtitles                  |\n| `ff_text.sh`         | Add text (with background box) on top of the video               |\n| `ff_thumbnail.sh`    | Create thumbnail(s) from the video                               |\n| `ff_to_landscape.sh` | Rotate a portrait video to landscape                             |\n| `ff_to_portrait.sh`  | Rotate a landscape video to portrait                             |\n| `ff_transcode.sh`    | Bulk Convert videos to specific file format and specs              |\n| `ff_transition.sh`   | Concatenate multiple videos with transition effects              |\n| `ff_unsharp.sh`      | Use an unsharp mask to blur/sharpen luma,gamma,alpha             |\n| `ff_watermark.sh`    | Overlay a watermark image/video                                  |\n\n\n# Table of Contents\n\u003c!-- TOC --\u003e\n\n- [Highlights](#highlights)\n- [Scripts](#scripts)\n- [Table of Contents](#table-of-contents)\n    - [About The Project](#about-the-project)\n        - [Built With](#built-with)\n        - [Installation](#installation)\n    - [Configs](#configs)\n    - [Script Details](#script-details)\n        - [ff_append.sh](#ff_appendsh)\n            - [Description](#description)\n            - [Flags](#flags)\n            - [Example](#example)\n        - [ff_aspect_ratio.sh](#ff_aspect_ratiosh)\n            - [Description](#description)\n            - [Flags](#flags)\n        - [ff_audio.sh](#ff_audiosh)\n            - [Description](#description)\n            - [Flags](#flags)\n        - [ff_blur.sh](#ff_blursh)\n            - [Description](#description)\n            - [Flags](#flags)\n        - [ff_colour.sh](#ff_coloursh)\n            - [Description](#description)\n            - [Flags](#flags)\n        - [ff_concat.sh](#ff_concatsh)\n            - [Description](#description)\n            - [Flags](#flags)\n        - [ff_crop.sh](#ff_cropsh)\n            - [Description](#description)\n            - [Flags](#flags)\n        - [ff_cut.sh](#ff_cutsh)\n            - [Description](#description)\n            - [Flags](#flags)\n        - [ff_download.sh](#ff_downloadsh)\n            - [Flags](#flags)\n            - [Examples](#examples)\n                - [Single Download](#single-download)\n                - [Multiple Downloads](#multiple-downloads)\n                - [Using a URL Source.](#using-a-url-source)\n                - [URL Source randomised strategy.](#url-source-randomised-strategy)\n        - [ff_flip.sh](#ff_flipsh)\n            - [Description](#description)\n            - [Flags](#flags)\n        - [ff_fps.sh](#ff_fpssh)\n            - [Description](#description)\n            - [Flags](#flags)\n        - [ff_grouptime.sh](#ff_grouptimesh)\n            - [Description](#description)\n            - [Flags](#flags)\n        - [ff_image.sh](#ff_imagesh)\n            - [Description](#description)\n            - [Flags](#flags)\n        - [ff_kenburns.sh](#ff_kenburnssh)\n            - [Description](#description)\n            - [Flags](#flags)\n        - [ff_lut.sh](#ff_lutsh)\n            - [Description](#description)\n            - [Flags](#flags)\n        - [ff_middle.sh](#ff_middlesh)\n            - [Description](#description)\n            - [Flags](#flags)\n        - [ff_mov_to_mp4.sh](#ff_mov_to_mp4sh)\n            - [Description](#description)\n            - [Flags](#flags)\n        - [ff_pad.sh](#ff_padsh)\n            - [Description](#description)\n            - [Flags](#flags)\n            - [Examples](#examples)\n        - [ff_proxy.sh](#ff_proxysh)\n            - [Flags](#flags)\n        - [ff_rotate.sh](#ff_rotatesh)\n            - [Description](#description)\n            - [Flags](#flags)\n        - [ff_scale.sh](#ff_scalesh)\n            - [Description](#description)\n            - [Flags](#flags)\n        - [ff_sh_runner.sh](#ff_sh_runnersh)\n            - [Description](#description)\n            - [Flags](#flags)\n        - [ff_sharpen.sh](#ff_sharpensh)\n            - [Description](#description)\n            - [Flags](#flags)\n        - [ff_social_media.sh](#ff_social_mediash)\n            - [Description](#description)\n            - [Flags](#flags)\n        - [ff_stack.sh](#ff_stacksh)\n            - [Description](#description)\n            - [Flags](#flags)\n        - [ff_subtitles.sh](#ff_subtitlessh)\n            - [Description](#description)\n        - [Forced Styles:](#forced-styles)\n            - [Flags](#flags)\n        - [ff_text.sh](#ff_textsh)\n            - [Description](#description)\n            - [Flags](#flags)\n        - [ff_thumbnail.sh](#ff_thumbnailsh)\n            - [Description](#description)\n            - [Flags](#flags)\n        - [ff_to_landscape.sh](#ff_to_landscapesh)\n            - [Description](#description)\n            - [Flags](#flags)\n        - [ff_to_portrait.sh](#ff_to_portraitsh)\n            - [Description](#description)\n            - [Flags](#flags)\n        - [ff_transcode.sh](#ff_transcodesh)\n            - [Description](#description)\n            - [Flags](#flags)\n        - [ff_transition.sh](#ff_transitionsh)\n            - [Description](#description)\n            - [Flags](#flags)\n        - [ff_unsharp.sh](#ff_unsharpsh)\n            - [Description](#description)\n            - [Flags](#flags)\n        - [ff_watermark.sh](#ff_watermarksh)\n            - [Description](#description)\n            - [Flags](#flags)\n            - [Examples](#examples)\n    - [ScriptFlow](#scriptflow)\n        - [Blank flags](#blank-flags)\n        - [nulls](#nulls)\n        - [Multiple duplicate scripts](#multiple-duplicate-scripts)\n        - [Scripts with multiple inputs](#scripts-with-multiple-inputs)\n        - [Keyword Replacements](#keyword-replacements)\n            - [\u003cENV\\_\\*\u003e](#env%5C_%5C)\n            - [\u003cFOLDER_NAME\u003e](#folder_name)\n            - [\u003cFOLDER_TITLE\u003e](#folder_title)\n            - [\u003cDATE_format\u003e](#date_format)\n            - [\u003cRANDOM_VIDEO\u003e](#random_video)\n            - [\u003cRANDOM_VIDEO_FILTER_string\u003e](#random_video_filter_string)\n            - [\u003cRANDOM_COLOUR\u003e](#random_colour)\n            - [\u003cRANDOM_CONTRAST_COLOUR\u003e](#random_contrast_colour)\n            - [\u003cCONSTANT_RANDOM_COLOUR\u003e](#constant_random_colour)\n            - [\u003cCONSTANT_CONTRAST_COLOUR\u003e](#constant_contrast_colour)\n        - [Output \u0026 Cleanup](#output--cleanup)\n        - [pwd and file references](#pwd-and-file-references)\n        - [descriptions](#descriptions)\n    - [Customising](#customising)\n    - [Troubleshooting](#troubleshooting)\n        - [Output Files.](#output-files)\n    - [Contributing](#contributing)\n    - [License](#license)\n    - [Contact](#contact)\n    - [Changelog](#changelog)\n        - [Version 1.10](#version-110)\n        - [Version 1.9](#version-19)\n        - [Version 1.8](#version-18)\n        - [Version 1.7](#version-17)\n        - [Version 1.6](#version-16)\n        - [Version 1.5](#version-15)\n        - [Version 1.4](#version-14)\n        - [Version 1.3](#version-13)\n        - [Version 1.2](#version-12)\n        - [Version 1.1](#version-11)\n        - [Version 1.0](#version-10)\n\n\u003c!-- /TOC --\u003e\n\n## 2. About The Project\n\nThis is a collection of scripts to automate simple video editing tasks.\n\nThey can be easily chained together for more complex video effects and tasks by simply using a JSON configuration file.\n\nThese are all based on BASH and FFMPEG.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n### 2.1. Built With\n\nThis project was built with the following frameworks, technologies and software.\n\n-   [JQ](https://stedolan.github.io/jq/)\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n### 2.2. Installation\n\nThese are the steps to get up and running with this theme.\n\n1. Clone the repo\n\n```sh\ngit clone https://github.com/IORoot/ffmpeg__bash-scripts\n```\n\n2. Either update your $PATH to include this folder or create a link in `/usr/local/bin` to each script.\n\n```\nPATH=$PATH:$(pwd)\n```\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\nAdditionally:\n\n| Script          | Description                                                          |\n| --------------- | -------------------------------------------------------------------- |\n| `scriptflow.sh` | Reads a JSON configuration file a runs the ff\\_ scripts sequentially |\n\n## Configs\n\nYou can provide any of the scripts a configuration JSON file with the `-C|--config` flag.\nThis JSON file should contain an object with the keys as the flags to the script and the values as the values you would pass on the command line.\n\nFor instance, the following command:\n\n```bash\n./ff_scale.sh -i input_video.mp4 -o output_video.mp4 -w 1920 -h 1080 -l debug\n```\n\nCan have a config.json file that would do the same thing:\n\n```json\n{\n\t\"input\": \"input_video.mp4\",\n\t\"output\": \"output_video.mp4\",\n\t\"width\": \"1920\",\n\t\"height\": \"1080\",\n\t\"loglevel\": \"debug\"\n}\n```\n\nAnd run like this:\n\n```bash\n./ff_scale.sh -c config.json\n```\n\nFor scripts that require multiple inputs, you can use `input1`, `input2`, etc... Suffix 1 or 2 digits.\n\n## Script Details\n\n### `ff_append.sh`\n\n#### Description\n\nThis will append two files together while re-encoding them to be the same codec. Good if you need to change the codec of the video by transcoding them. Note the `ff_concat.sh` script is better if you do not need to transcode.\n\n![append](https://raw.githubusercontent.com/IORoot/ffmpeg__bash-scripts/master/lib/images/append.svg)\n\n#### Flags\n\n```bash\nFlags:\n-f | --first \u003cFIRST_INPUT_FILE\u003e\n    The name of the first input file.\n\n-s | --second \u003cSECOND_INPUT_FILE\u003e\n    The name of the second input file.\n\n-o | --output \u003cOUTPUT_FILE\u003e\n    Default is output_appended.mp4\n    The name of the output file.\n\n-l | --loglevel \u003cLOGLEVEL\u003e\n    The FFMPEG loglevel to use. Default is 'error' only.\n    Options: quiet,panic,fatal,error,warning,info,verbose,debug,trace\n```\n\n#### Example\n\n```bash\n./ff_append.sh -f landscape2.mp4 -s landscape.mp4 -o out.mp4\n```\n\n---\n\n### `ff_aspect_ratio.sh`\n\n#### Description\n\nThis will alter the container metadata (DAR) of the video to the new aspect ratio.\n\n![aspect_ratio](https://raw.githubusercontent.com/IORoot/ffmpeg__bash-scripts/master/lib/images/aspect_ratio.svg)\n\n#### Flags\n\n```\n-i | --input \u003cINPUT_FILE\u003e\n    The name of an input file.\n\n-o | --output \u003cOUTPUT_FILE\u003e\n    Default is output_aspect_ratio.mp4\n    The name of the output file.\n\n-a | --aspect \u003cASPECTRATIO\u003e\n    Target aspect ratio should be expressed as X:Y\n    Default is 1:1\n\n-c | --config \u003cCONFIG_FILE\u003e\n    The name of an input config file.\n\n-l | --loglevel \u003cLOGLEVEL\u003e\n    The FFMPEG loglevel to use. Default is 'error' only.\n    Options: quiet,panic,fatal,error,warning,info,verbose,debug,trace\n```\n\n---\n\n\n### `ff_audio.sh`\n\n#### Description\n\nThis will overlay audio on top of the video.\n\n#### Flags\n\n```\n-i | --input \u003cINPUT_FILE\u003e\n    The name of an input file.\n\n-a | --audio \u003cINPUT_FILE\u003e\n    The name of an audio file.\n\n-o | --output \u003cOUTPUT_FILE\u003e\n    Default is %s \"${OUTPUT_FILENAME}\"\n    The name of the output file.\n\n-s | --start \u003cSECONDS\u003e\n    Start time in seconds of when to play audio.\n\n-p | --speed \u003cSPEED\u003e\n    Playback speed of the audio.\n\n-r | --remove\n    tRemove the audio.\n    \n-c | --config \u003cCONFIG_FILE\u003e\n    The name of an input config file.\n\n-l | --loglevel \u003cLOGLEVEL\u003e\n    The FFMPEG loglevel to use. Default is 'error' only.\n    Options: quiet,panic,fatal,error,warning,info,verbose,debug,trace\n```\n\n---\n\n### `ff_blur.sh`\n\n#### Description\n\nSimple version of unsharp mask.\n\n```mermaid\n\ngraph LR\n    input[\"-i input.mp4\"]\n    pixels[\"--pixels 7\u003c/br\u003e(Use a 7x7 pixel square for detection)\"]\n    sharpen[\"--sharpen 3.2\u003c/br\u003e(Using the 7x7 grid, sharpen by 3.2)\"]\n    output[\"output.mp4\"]\n\n    input--\u003epixels--\u003esharpen--\u003eoutput\n```\n\n#### Flags\n\n```\n-i | --input \u003cINPUT_FILE\u003e\n    The name of an input file.\n\n-o | --output \u003cOUTPUT_FILE\u003e\n    Default is output_sharpen.mp4\n    The name of the output file.\n\n-p | --pixels \u003cAMOUNT\u003e\n    Both the X and Y matrix horizontal size. It must be an odd integer between 3 and 23. The default value is 5.\n\n-s | --sharpen \u003cAMOUNT\u003e\n    Set the sharpen strength. It must be a floating point number. -2.0 to 5.0. Default value is 1.0.\n    Negative values will blur the input video, while positive values will sharpen it, a value of zero will disable the effect.\n\n-c | --config \u003cCONFIG_FILE\u003e\n    The name of an input config file.\n\n-l | --loglevel \u003cLOGLEVEL\u003e\n    The FFMPEG loglevel to use. Default is 'error' only.\n    Options: quiet,panic,fatal,error,warning,info,verbose,debug,trace\n```\n\n---\n\n### `ff_colour.sh`\n\n#### Description\n\nChange the Brightness, Contrast, Gamma, Gamma-Weight and Saturation of a video.\n\n```mermaid\n\ngraph LR\n\tinput[\"-i input.mp4\"]\n\tbrightness[\"--brightness 0.33\u003c/br\u003e(Increase brightness by 33%)\"]\n\tcontrast[\"--contrast 40\u003c/br\u003e(Increase contrast by 4%)\"]\n\tgamma[\"--gamma 5.0\u003c/br\u003e(Increase gamma by 50%)\"]\n\tweight[\"--weight 0.2\u003c/br\u003e(Increase gamma weight by 20%)\"]\n\tsaturation[\"--saturation 1.0\u003c/br\u003e(Increase saturation by 0.33%)\"]\n\toutput[\"output.mp4\"]\n\n\tinput--\u003ebrightness--\u003econtrast--\u003egamma--\u003eweight--\u003esaturation--\u003eoutput\n```\n\n#### Flags\n\n```\n-i | --input \u003cINPUT_FILE\u003e\n    The name of an input file.\n\n-o | --output \u003cOUTPUT_FILE\u003e\n    Default is output_colour.mp4\n    The name of the output file.\n\n-b | --brightness \u003cBRIGHTNESS\u003e\n    Change the brightness value from -1.0 to 1.0.\n\n-c | --contrast \u003cCONTRAST\u003e\n    Change the contrast value from -1000.0 to 1000.0.\n\n-g | --gamma \u003cGAMMA\u003e\n    Change the gamma value from 0.1 to 10.0.\n\n-s | --saturation \u003cSATURATION\u003e\n    Change the saturation value from 0.0 to 3.0.\n\n-w | --weight \u003cGAMMAWEIGHT\u003e\n    Change the gamma weight value from 0.0 to 1.0.\n\n-c | --config \u003cCONFIG_FILE\u003e\n    The name of an input config file.\n\n-l | --loglevel \u003cLOGLEVEL\u003e\n    The FFMPEG loglevel to use. Default is 'error' only.\n    Options: quiet,panic,fatal,error,warning,info,verbose,debug,trace\n```\n\n---\n\n### `ff_concat.sh`\n\n#### Description\n\nConcatenate multiple videos into one output video.\n\nThe first video will set the FPS and dimensions, so make sure all videos are the same otherwise you'll get slow-motion.\n\n![concat](https://raw.githubusercontent.com/IORoot/ffmpeg__bash-scripts/master/lib/images/concat.svg)\n\n#### Flags\n\n```\n-o | --output \u003cOUTPUT_FILE\u003e\n    The name of the output file. Specify only one.\n\n-i | --input \u003cINPUT_FILE\u003e\n    The name of an input file (or folder). Specify as many as you wish.\n\n-c | --config \u003cCONFIG_FILE\u003e\n    The name of an input config file.\n\n-l | --loglevel \u003cLOGLEVEL\u003e\n    The FFMPEG loglevel to use. Default is 'error' only.\n    Options: quiet,panic,fatal,error,warning,info,verbose,debug,trace\n```\n\n---\n\n### `ff_crop.sh`\n\n#### Description\n\nCrop video to specific size\n\n```mermaid\n\ngraph LR\n\tinput[\"-i input.mp4\u003cbr/\u003e(1920x1080)\"]\n\twidth[\"-w 720\u003cbr/\u003eWidth of new frame\"]\n\theight[\"-h 720\u003cbr/\u003eHeight of new frame\"]\n\txpixels[\"-x (iw-ow)/2\u003cbr/\u003ePut video horizontally in center of frame\"]\n\typixels[\"-y (ih-oh)/2\u003cbr/\u003ePut video vertically in center of frame\"]\n\toutput[\"output.mp4\"]\n\n\tinput--\u003ewidth--\u003eheight--\u003expixels--\u003eypixels--\u003eoutput\n```\n\n![crop](https://raw.githubusercontent.com/IORoot/ffmpeg__bash-scripts/master/lib/images/crop.svg)\n\n#### Flags\n\n```\n-i | --input \u003cINPUT_FILE\u003e\n    The name of an input file.\n\n-o | --output \u003cOUTPUT_FILE\u003e\n    Default is output_crop.mp4\n    The name of the output file.\n\n-w | --width \u003cWIDTH\u003e\n    Width of the output video. Default: 600px.\n\n-h | --height \u003cHEIGHT\u003e\n    Height of the output video. Default: 600px.\n\n-x | --xpixels \u003cPIXELS\u003e\n    Where to position the video in the frame on X-Axis from left. Default center: (iw-ow)/2\n\n-y | --ypixels \u003cPIXELS\u003e\n    Where to position the video in the frame on Y-Axis from top. Default center: (ih-oh)/2\n\n    The width, height, x and y parameters also have access to the following variables:\n    - iw : The input video's width.\n    - ih : The input video's height.\n    - ow : The output video's width.\n    - oh : The output video's height.\n    These can be used to calculate areas of the screen. For example:\n    The center of the screen on x-axis is 'x=(ow-iw)/2\n\n-c | --config \u003cCONFIG_FILE\u003e\n    The name of an input config file.\n\n-l | --loglevel \u003cLOGLEVEL\u003e\n    The FFMPEG loglevel to use. Default is 'error' only.\n    Options: quiet,panic,fatal,error,warning,info,verbose,debug,trace\n```\n\n---\n\n### `ff_cut.sh`\n\n#### Description\n\nChange the length of the video.\n\n![cut](https://raw.githubusercontent.com/IORoot/ffmpeg__bash-scripts/master/lib/images/cut.svg)\n\n#### Flags\n\n```\n-i | --input \u003cINPUT_FILE\u003e\n    The name of an input file.\n\n-o | --output \u003cOUTPUT_FILE\u003e\n    Default is output_cut.mp4\n    The name of the output file.\n\n-s | --start \u003cTIMESTAMP\u003e\n    When to start the cut. Format is HH:MM:SS. Default is the beginning of the video. 00:00:00.\n\n-e | --end \u003cTIMESTAMP\u003e\n    When to finish the cut. Format is HH:MM:SS. Default is 10 seconds into the video. 00:00:10.\n\n-c | --config \u003cCONFIG_FILE\u003e\n    The name of an input config file.\n\n-l | --loglevel \u003cLOGLEVEL\u003e\n    The FFMPEG loglevel to use. Default is 'error' only.\n    Options: quiet,panic,fatal,error,warning,info,verbose,debug,trace\n```\n\n---\n\n### `ff_download.sh`\n\nDownload a video or file to use in the scriptflow. Uses CURL.\n\nVery handy to get a remote file(s) images/videos to then use in your video.\n\n#### Flags\n\n```\n-i | --input \u003cINPUT_URL\u003e\n    The input url to download.\n\n-o | --output \u003cOUTPUT_FILE\u003e\n    Default is %s \"${OUTPUT_FILENAME}\"\n    The name of the output file.\n\n-u | --urlsource \u003cFILE_WITH_LIST\u003e\n    A URL of a txt file with a list of all files to use as inputs. Separated one per line.\n\n-s | --strategy \u003cSTRATEGY\u003e\n    5 A number. First 5 videos from inputs. Prefix number on output filename. Default 1.\n    ~5 Tilde(~) followed by a number. Random 5 videos from inputs. Prefix number on output filename.\n\n-C | --config \u003cCONFIG_FILE\u003e\n    Supply a config.json file with settings instead of command-line. Requires JQ installed.\n\n-l | --loglevel \u003cLOGLEVEL\u003e\n    The FFMPEG loglevel to use. Default is 'error' only.\n    Options: quiet,panic,fatal,error,warning,info,verbose,debug,trace\n\n```\n\n#### Examples\n\nThe download script is quite a powerful tool to auto-generate your videos. It can incorporate randomness if needed.\n\nHere are some examples using the `scriptflow` tool and the JSON input format:\n\n---\n\n##### Single Download\n\nThis example will just download a single file from a URL.\n\n```json\n{\n\t\"ff_download\": {\n\t\t\"description\": \"Download the my watermark image\",\n\t\t\"input\": \"http://mywebsite.com/logos/logo_white_solid.jpg\",\n\t\t\"output\": \"logo_white_solid.jpg\"\n\t}\n}\n```\n\n---\n\n##### Multiple Downloads\n\nThis time we will download two images that will be output as `1_logo_solid.jpg` and `2_logo_solid.jpg`.\n\n```json\n{\n\t\"ff_download\": {\n\t\t\"description\": \"Download the my watermark image\",\n\t\t\"input1\": \"http://mywebsite.com/logos/logo_white_solid.jpg\",\n\t\t\"input2\": \"http://mywebsite.com/logos/logo_blue_solid.jpg\",\n\t\t\"output\": \"logo_solid.jpg\",\n\t\t\"strategy\": \"2\"\n\t}\n}\n```\n\n---\n\n##### Using a URL Source.\n\nYou can provide a URL of a text file listing all of the available files and download some from that list.\nFor example, you provide the following file:\n\n`filelist.txt`\n\n```text\nmy_video_01.mp4\nmy_video_02.mp4\nmy_video_03.mp4\nmy_video_04.mp4\nmy_video_05.mp4\n```\n\nAnd host that file (and those video files) at: `http://mywebsite.com/filelist.txt`\n\nNow, you can use that text file as a reference and use the `strategy` field to download the first 2.\n\n```json\n{\n\t\"ff_download\": {\n\t\t\"description\": \"Download the my watermark image\",\n\t\t\"urlsource\": \"http://mywebsite.com/filelist.txt\",\n\t\t\"output\": \"ff_download.mp4\",\n\t\t\"strategy\": \"2\"\n\t}\n}\n```\n\nThis will download files `my_video_01.mp4` and `my_video_02.mp4`. These will be output as `1_ff_download.mp4` and `2_ff_download.mp4`.\n\n---\n\n##### URL Source randomised strategy.\n\nThe true power is found with the randomised strategy. Using the tilde `~` symbol as a prefix on the strategy you can specify how many _random_ files to download.\n\n```json\n{\n\t\"ff_download\": {\n\t\t\"description\": \"Download the my watermark image\",\n\t\t\"urlsource\": \"http://mywebsite.com/filelist.txt\",\n\t\t\"output\": \"ff_download.mp4\",\n\t\t\"strategy\": \"~2\"\n\t}\n}\n```\n\nThis will download two random files `my_video_03.mp4` and `my_video_05.mp4`. These will be output as `1_ff_download.mp4` and `2_ff_download.mp4`.\n\n---\n\n### `ff_flip.sh`\n\n#### Description\n\nFlip video horizontally and/or vertically.\n\n![flip](https://raw.githubusercontent.com/IORoot/ffmpeg__bash-scripts/master/lib/images/flip.svg)\n\n#### Flags\n\n```\n-i | --input \u003cINPUT_FILE\u003e\n    The name of an input file.\n\n-o | --output \u003cOUTPUT_FILE\u003e\n    Default is output_flipped.mp4\n    The name of the output file.\n\n-h | --horizontal\n    Flip video horizontally.\n\n-v | --vertical\n    Flip video vertically.\n\n-c | --config \u003cCONFIG_FILE\u003e\n    The name of an input config file.\n\n-l | --loglevel \u003cLOGLEVEL\u003e\n    The FFMPEG loglevel to use. Default is 'error' only.\n    Options: quiet,panic,fatal,error,warning,info,verbose,debug,trace\n```\n\n---\n\n### `ff_fps.sh`\n\n#### Description\n\nChange the FPS of a video without changing the length.\n\n![fps](https://raw.githubusercontent.com/IORoot/ffmpeg__bash-scripts/master/lib/images/fps.svg)\n\n#### Flags\n\n```\n-i | --input \u003cINPUT_FILE\u003e\n    The name of an input file.\n\n-o | --output \u003cOUTPUT_FILE\u003e\n    Default is output_fps.mp4\n    The name of the output file.\n\n-f | --fps \u003cFPS\u003e\n    The frames per second the video should be converted to. The default value is 30.\n    The length of the video will not change, but frames will either be added or removed.\n\n-c | --config \u003cCONFIG_FILE\u003e\n    The name of an input config file.\n\n-l | --loglevel \u003cLOGLEVEL\u003e\n    The FFMPEG loglevel to use. Default is 'error' only.\n    Options: quiet,panic,fatal,error,warning,info,verbose,debug,trace\n```\n\n---\n\n### `ff_grouptime.sh`\n\n#### Description\n\nTrim input videos by a percentage on start and end to get output video to correct duration.\n\n![grouptime](https://raw.githubusercontent.com/IORoot/ffmpeg__bash-scripts/master/lib/images/grouptime.svg)\n\n#### Flags\n\n```\n-i | --input \u003cINPUT_FILE\u003e\n    The name of an input file.\n\n-o | --output \u003cOUTPUT_FILE\u003e\n    Default is ff_grouptime.mp4\n    The name of the output file.\n\n-d | --duration \u003cDURATION\u003e\n    The final duration of the output file in seconds. Default is 60.\n\n-c | --config \u003cCONFIG_FILE\u003e\n    The name of an input config file.\n\n-l | --loglevel \u003cLOGLEVEL\u003e\n    The FFMPEG loglevel to use. Default is 'error' only.\n    Options: quiet,panic,fatal,error,warning,info,verbose,debug,trace\n```\n\n---\n\n### `ff_image.sh`\n\n#### Description\n\nCreate a video from an image\n\n#### Flags\n\n```\n-i | --input \u003cINPUT_FILE\u003e\n    The name of an input file.\n\n-o | --output \u003cOUTPUT_FILE\u003e\n    Default is ff_image.mp4\n    The name of the output file.\n\n-d | --duration \u003cDURATION\u003e\n    The final duration of the output file in seconds. Default is 60.\n\n-c | --config \u003cCONFIG_FILE\u003e\n    The name of an input config file.\n\n-l | --loglevel \u003cLOGLEVEL\u003e\n    The FFMPEG loglevel to use. Default is 'error' only.\n    Options: quiet,panic,fatal,error,warning,info,verbose,debug,trace\n```\n\n---\n\n\n### `ff_kenburns.sh`\n\n#### Description\n\nCreate a video from an image with a zoom-pan effect.\n\n#### Flags\n\n```\n -i | --input \u003cINPUT_FILE\u003e\n    The name of the input file or folder\n\n -g | --grep \u003cSTRING\u003e\n    The filter to apply to the folder\n\n -t | --target \u003cTARGET\u003e\n    The target of the zoom.\n    TopLeft    | TopRight.\n    BottomLeft | BottomRight.\n    Random\n\n -f | --fps \u003cFPS\u003e\n    Default is 30\n    The Output Frames Per Second.\n\n -w | --width \u003cPIXELS\u003e\n    Default is 1024\n    The output width.\n\n -h | --height \u003cPIXELS\u003e\n    Default is 720\n    The output height.\n\n -d | --duration \u003cSECS\u003e\n    Default is 10\n    The output duration in seconds.\n\n -s | --speed \u003cFLOAT\u003e\n    Default is 0.003\n    The speed of the zoom.\n\n -b | --bitrate \u003cBITRATE\u003e\n    Default is 5000k\n    The bitrate of the output file.\n\n -o | --output \u003cOUTPUT_FILE\u003e\n    Default is ff_kenburns.mp4\n    The name of the output file.\n\n-c | --config \u003cCONFIG_FILE\u003e\n    The name of an input config file.\n\n-l | --loglevel \u003cLOGLEVEL\u003e\n    The FFMPEG loglevel to use. Default is 'error' only.\n    Options: quiet,panic,fatal,error,warning,info,verbose,debug,trace\n\n```\n\n---\n\n\n\n### `ff_lut.sh`\n\n#### Description\n\nApply a 3DL/Cube Look-Up Table (LUT) file to a video.\n\n#### Flags\n\n```\n-i | --input \u003cINPUT_FILE\u003e\n    The name of an input file.\n\n-o | --output \u003cOUTPUT_FILE\u003e\n    Default is output_lut.mp4\n    The name of the output file.\n\n-t | --lut \u003cLUT_FILE\u003e\n    The Look-Up-Table (LUT) should be in a 3DL/Cube format.\n    there is no default, so must be supplied.\n\n-c | --config \u003cCONFIG_FILE\u003e\n    The name of an input config file.\n\n-l | --loglevel \u003cLOGLEVEL\u003e\n    The FFMPEG loglevel to use. Default is 'error' only.\n    Options: quiet,panic,fatal,error,warning,info,verbose,debug,trace\n```\n\n---\n\n### `ff_middle.sh`\n\n#### Description\n\nTrim input video from start and end by a number of seconds.\n\n![middle](https://raw.githubusercontent.com/IORoot/ffmpeg__bash-scripts/master/lib/images/middle.svg)\n\n#### Flags\n\n```\n-i | --input \u003cINPUT_FILE\u003e\n    The name of an input file.\n\n-o | --output \u003cOUTPUT_FILE\u003e\n    Default is output_middle.mp4\n    The name of the output file.\n\n-t | --trim \u003cTRIM\u003e\n    Number of seconds to remove from the start and end of video. Default is 1 second. (1)\n\n-c | --config \u003cCONFIG_FILE\u003e\n    The name of an input config file.\n\n-l | --loglevel \u003cLOGLEVEL\u003e\n    The FFMPEG loglevel to use. Default is 'error' only.\n    Options: quiet,panic,fatal,error,warning,info,verbose,debug,trace\n```\n\n---\n\n### `ff_mov_to_mp4.sh`\n\n#### Description\n\nConvert an Apple Quicktime MOV file into an H264 MP4 file. Useful when grouping/appending/concating multiple files.\n\n```mermaid\n\ngraph LR\n\tinput[\"-i input.mov\"]\n\toutput[\"output.mp4\"]\n\n\tinput--\u003eoutput\n```\n\n#### Flags\n\n```\n-i | --input \u003cINPUT_FILE\u003e\n    The name of an input file.\n\n-o | --output \u003cOUTPUT_FILE\u003e\n    Default is output_mov.mp4\n    The name of the output file.\n\n-c | --config \u003cCONFIG_FILE\u003e\n    The name of an input config file.\n\n-l | --loglevel \u003cLOGLEVEL\u003e\n    The FFMPEG loglevel to use. Default is 'error' only.\n    Options: quiet,panic,fatal,error,warning,info,verbose,debug,trace\n```\n\n---\n\n### `ff_pad.sh`\n\n#### Description\n\nCreate padding around the edges of the video.\n\n![pad](https://raw.githubusercontent.com/IORoot/ffmpeg__bash-scripts/master/lib/images/pad.svg)\n\n#### Flags\n\n```\n-i | --input \u003cINPUT_FILE\u003e\n    The name of an input file.\n\n-o | --output \u003cOUTPUT_FILE\u003e\n    Default is output_pad.mp4\n    The name of the output file.\n\n-w | --width \u003cWIDTH\u003e\n    Width of the output video. Default: Same as input video.\n\n-h | --height \u003cHEIGHT\u003e\n    Height of the output video. Default: 2x input video height.\n\n-x | --xpixels \u003cPIXELS\u003e\n    Where to position the video in the frame on X-Axis from left.\n\n-y | --ypixels \u003cPIXELS\u003e\n    Where to position the video in the frame on Y-Axis from top.\n\n    The width, height, x and y parameters also have access to the following variables:\n    - iw : The input video's width.\n    - ih : The input video's height.\n    - ow : The output video's width.\n    - oh : The output video's height.\n    These can be used to calculate areas of the screen. For example:\n    The center of the screen on x-axis is 'x=(ow-iw)/2\n\n-c | --colour \u003cCOLOUR\u003e\n    Colour to use for the padding. See https://ffmpeg.org/ffmpeg-utils.html#color-syntax\n    Can use a word 'Aqua, Beige, Cyan, etc...', the word 'random' or hex code : RRGGBB[AA]\n\n-C | --config \u003cCONFIG_FILE\u003e\n    The name of an input config file.\n\n-l | --loglevel \u003cLOGLEVEL\u003e\n    The FFMPEG loglevel to use. Default is 'error' only.\n    Options: quiet,panic,fatal,error,warning,info,verbose,debug,trace\n```\n\n#### Examples\n\nPadding all around the video.\n\n    ./ff_pad.sh -i input.mp4 -h 'ih*2' -w 'iw*2'\n\nVideo Pad white background.\n\n    ./ff_pad.sh -i input.mp4 -h 'ih*2' -c white\n\nMake black bars..\n\n    /ff_pad.sh -i input.mp4 -w iw -h ih+100 -y '(oh-ih)/2' -x '(ow-iw)/2' -c #000000\n\n---\n\n### `ff_proxy.sh`\n\nDowngrade large videos to a more manageable file size\n\n#### Flags\n\n```\n-i | --input \u003cINPUT_FILE / INPUT_FOLDER\u003e\n    The name of an input file.\n    If a FOLDER, then it is recursive.\n\n-o | --output \u003cOUTPUT_FILE\u003e\n    Default is %s \"${OUTPUT_FILENAME}\"\n    The name of the output file.\n\n-r | --recursive\n    If a FOLDER, then recurse to deeper folders.\n\n-x | --scalex\n    Width of the output proxy. can use -2 to keep aspect ratio to scaley. Default 1280.\n\n-y | --scaley\n    Height of the output proxy. can use -2 to keep aspect ratio to scalex. Default -2.\n\n-f | --fps\n    Frames Per Second to reduce the proxy down to. Default 30.\n\n-c | --CRF\n    Constant Rate Factor. 0-51. Controls the quality of the output. Default 25.\n\n-d | --codec\n    Codec library to use. libxwebp / libx264 / libx265 /etc... Default libx264.\n\n-g | --grep \u003cSTRING\u003e\n    Supply a grep string for filtering the inputs if a folder is specified.\n\n-C | --config \u003cCONFIG_FILE\u003e\n    Supply a config.json file with settings instead of command-line. Requires JQ installed.\n\n-l | --loglevel \u003cLOGLEVEL\u003e\n    The FFMPEG loglevel to use. Default is 'error' only.\n    Options: quiet,panic,fatal,error,warning,info,verbose,debug,trace\n```\n\n---\n\n### `ff_rotate.sh`\n\n#### Description\n\nRotate a video.\n\n![rotate](https://raw.githubusercontent.com/IORoot/ffmpeg__bash-scripts/master/lib/images/rotate.svg)\n\n#### Flags\n\n```\nUsage: ./ff_rotate.sh FILE [ROTATION] [OUTPUT_FILE]\n\n[rotation]\n0 = 180 Degrees\n1 = 90 Degrees Clockwise\n2 = 90 Degrees Counter Clockwise (default)\n\n[output file]\noutput_rotate.mp4 (default)\n```\n\n---\n\n### `ff_scale.sh`\n\n#### Description\n\nChange the scale (Width/Height) of a video.\n\n![scale](https://raw.githubusercontent.com/IORoot/ffmpeg__bash-scripts/master/lib/images/scale.svg)\n\n#### Flags\n\n```\n-i | --input \u003cINPUT_FILE\u003e\n    The name of an input file.\n\n-o | --output \u003cOUTPUT_FILE\u003e\n    Default is output_scale.mp4\n    The name of the output file.\n\n-w | --width \u003cPIXELS\u003e\n    The width of the video. The default value is 1920.\n\n-h | --height \u003cPIXELS\u003e\n    The height of the video. The default value is 1920.\n\n-c | --config \u003cCONFIG_FILE\u003e\n    The name of an input config file.\n\n-l | --loglevel \u003cLOGLEVEL\u003e\n    The FFMPEG loglevel to use. Default is 'error' only.\n    Options: quiet,panic,fatal,error,warning,info,verbose,debug,trace\n```\n\n---\n\n\n### `ff_sh_runner.sh`\n\n#### Description\n\nWARNING! This is dangerous to have on a machine! Gives access to the shell to run\nany command. If in doubt, remove this script.\n\nThis is only available through the scriptflow runner to enable running commands\nthrough a JSON object.\n\n#### Flags\n\n```\n-c | --config \u003cCONFIG_FILE\u003e\n    The name of an input config file.\n```\n\n\n---\n\n### `ff_sharpen.sh`\n\n#### Description\n\nSimple version of unsharp mask.\n\n#### Flags\n\n```\n-i | --input \u003cINPUT_FILE\u003e\n    The name of an input file.\n\n-o | --output \u003cOUTPUT_FILE\u003e\n    Default is output_sharpen.mp4\n    The name of the output file.\n\n-p | --pixels \u003cAMOUNT\u003e\n    Both the X and Y matrix horizontal size. It must be an odd integer between 3 and 23. The default value is 5.\n\n-s | --sharpen \u003cAMOUNT\u003e\n    Set the sharpen strength. It must be a floating point number. -2.0 to 5.0. Default value is 1.0.\n    Negative values will blur the input video, while positive values will sharpen it, a value of zero will disable the effect.\n\n-c | --config \u003cCONFIG_FILE\u003e\n    The name of an input config file.\n\n-l | --loglevel \u003cLOGLEVEL\u003e\n    The FFMPEG loglevel to use. Default is 'error' only.\n    Options: quiet,panic,fatal,error,warning,info,verbose,debug,trace\n```\n\n---\n\n\n### `ff_social_media.sh`\n\n#### Description\n\nConverts the video, ready for various social platforms\n\n#### Flags\n\n```\n-i | --input \u003cINPUT_FILE\u003e\n    The name of an input file.\n\n-o | --output \u003cOUTPUT_FILE\u003e\n    Default is output_sharpen.mp4\n    The name of the output file.\n\n-ig | --instagram \n    Convert ready for Instagram.\n\n-c | --config \u003cCONFIG_FILE\u003e\n    The name of an input config file.\n\n-l | --loglevel \u003cLOGLEVEL\u003e\n    The FFMPEG loglevel to use. Default is 'error' only.\n    Options: quiet,panic,fatal,error,warning,info,verbose,debug,trace\n```\n\n---\n\n### `ff_stack.sh`\n\n#### Description\n\nStack multiple videos. Either two vertically, two horizontally or four in a 2x2 grid.\n\n![stack](https://raw.githubusercontent.com/IORoot/ffmpeg__bash-scripts/master/lib/images/stack.svg)\n\n#### Flags\n\n```\n-i | --input \u003cINPUT_FILE\u003e\n    The name of an input file.\n\n-o | --output \u003cOUTPUT_FILE\u003e\n    Default is output_sharpen.mp4\n    The name of the output file.\n\n-h | --horizontal\n\n-v | --vertical\n\n-g | --grid\n\n-c | --config \u003cCONFIG_FILE\u003e\n    The name of an input config file.\n\n-l | --loglevel \u003cLOGLEVEL\u003e\n    The FFMPEG loglevel to use. Default is 'error' only.\n    Options: quiet,panic,fatal,error,warning,info,verbose,debug,trace\n```\n\n---\n\n### `ff_subtitles.sh`\n\n#### Description\n\nOverlay an audio file on the video using an .SRT file\n\n### Forced Styles:\nMore information : https://aegisub.org/docs/3.2/ASS_Tags/\n\nFontName: Specifies the font name or family for the subtitles.\n`force_style='FontName=Arial'`\n\nFontSize: Sets the font size for the subtitles.\n`force_style='FontSize=24'`\n\nPrimaryColour: Specifies the color of the subtitles' text.\n`force_style='PrimaryColour=\u0026H00FF00' # Green color`\n\nSecondaryColour: Specifies the color of the subtitles' secondary text.\n`force_style='SecondaryColour=\u0026HFFFF00' # Yellow color`\n\nOutlineColour: Specifies the color of the outline of the subtitles' text.\n`force_style='OutlineColour=\u0026H55000000' # Semi-transparent black outline`\n\nBackColour: Specifies the background color behind the subtitles' text.\n`force_style='BackColour=\u0026H55000000' # Semi-transparent black background`\n\nBold: Enables or disables bold text style for the subtitles.\n`force_style='Bold=1' # Enable bold`\n\nItalic: Enables or disables italic text style for the subtitles.\n`force_style='Italic=1' # Enable italic`\n\nUnderline: Enables or disables underline text style for the subtitles.\n`force_style='Underline=1' # Enable underline`\n\nStrikeOut: Enables or disables strikeout text style for the subtitles.\n`force_style='StrikeOut=1' # Enable strikeout`\n\nScaleX: Scales the width of the subtitles' text.\n`force_style='ScaleX=1.5' # Scale width by 1.5`\n\nScaleY: Scales the height of the subtitles' text.\n`force_style='ScaleY=1.5' # Scale height by 1.5`\n\nSpacing: Adjusts the spacing between characters in the subtitles.\n`force_style='Spacing=2' # Increase spacing by 2 pixels`\n\nAngle: Specifies the angle of rotation for the subtitles' text.\n`force_style='Angle=45' # Rotate text by 45 degrees`\n\nBorderStyle: Sets the style of the border around the subtitles' text.\n`force_style='BorderStyle=3' # Drop shadow border style`\n\nOutline: Sets the width of the outline around the subtitles' text.\n`force_style='Outline=2' # Set outline width to 2 pixels`\n\nShadow: Sets the distance and angle of shadow for the subtitles' text.\n`force_style='Shadow=2,2,black' # Shadow offset (2 pixels horizontal, 2 pixels vertical) and color (black)`\n\nAlignment: Specifies the alignment of the subtitles within their bounding box.\n`force_style='Alignment=6' # Middle center alignment`\n\nMarginL: Sets the left margin for the subtitles.\n`force_style='MarginL=10' # Set left margin to 10 pixels`\n\nMarginR: Sets the right margin for the subtitles.\n`force_style='MarginR=10' # Set right margin to 10 pixels`\n\nMarginV: Sets the vertical margin for the subtitles.\n`force_style='MarginV=10' # Set vertical margin to 10 pixels`\n\nAlphaLevel: Sets the transparency level for the subtitles' text.\n`force_style='AlphaLevel=50' # Set transparency to 50%`\n\nEncoding: Specifies the character encoding used for the subtitles.\n`force_style='Encoding=1' # Set character encoding to Unicode (UTF-16LE)`\n\n#### Flags\n\n```\n-i | --input \u003cINPUT_FILE\u003e\n    The name of an input file.\n\n-s | --subtitles \u003cINPUT_FILE\u003e\n    The name of an subtitle SRT file.\n\n-f | --styles \u003cFORCE_STYLE\u003e\n    The Forced Style for the subtitles.\n\n-o | --output \u003cOUTPUT_FILE\u003e\n    Default is ff_subtitle.mp4\n    The name of the output file.\n\n-c | --config \u003cCONFIG_FILE\u003e\n    The name of an input config file.\n\n-l | --loglevel \u003cLOGLEVEL\u003e\n    The FFMPEG loglevel to use. Default is 'error' only.\n    Options: quiet,panic,fatal,error,warning,info,verbose,debug,trace\n```\n\n---\n\n### `ff_text.sh`\n\n#### Description\n\nAdd text (with background box) on top of the video.\n\n![text](https://raw.githubusercontent.com/IORoot/ffmpeg__bash-scripts/master/lib/images/text.svg)\n\n#### Flags\n\n```\n-i | --input \u003cINPUT_FILE\u003e\n    The name of an input file.\n\n-o | --output \u003cOUTPUT_FILE\u003e\n    Default is output_text.mp4\n    The name of the output file.\n\n-t | --text \u003cTEXT\u003e\n    Text to write over video. Default: EXAMPLE.\n\n-f | --font \u003cFONT\u003e\n    Path to font file to use. Default: /System/Library/Fonts/HelveticaNeue.ttc\n\n-c | --color \u003cFONTCOLOUR\u003e\n    The font colour to use. Can be Hex RRGGBB or name and include alpha with '@0.5' after. Default: white.\n\n-s | --size \u003cFONTSIZE\u003e\n    The font size to use. Default: 24.\n\n-b | --box \u003cBOX\u003e\n    Show the background box. Boolean. 1 or 0. Default: 1.\n\n-p | --boxcolour \u003cPAINTCOLOUR\u003e\n    The background paint colour to use. Can be Hex RRGGBB or name and include alpha with '@0.5' after. Default: black.\n\n-r | --boxborder \u003cBOXBORDER\u003e\n    Width of the border on the background box around the text. Default: 5.\n\n-x | --xpixels \u003cPIXELS\u003e\n    Where to position the text in the frame on X-Axis from left. Default center: (w-tw)/2\n\n-y | --ypixels \u003cPIXELS\u003e\n    Where to position the text in the frame on Y-Axis from top. Default center: (h-th)/2\n\n    The x and y parameters also have access to the following variables:\n    - w : The input video's width.\n    - h : The input video's height.\n    - tw : The rendered text width.\n    - th : The rendered text height.\n    - lh : The line height.\n    These can be used to calculate areas of the screen. For example:\n    The center of the screen on x-axis is 'x=(ow-iw)/2\n\n-c | --config \u003cCONFIG_FILE\u003e\n    The name of an input config file.\n\n-l | --loglevel \u003cLOGLEVEL\u003e\n    The FFMPEG loglevel to use. Default is 'error' only.\n    Options: quiet,panic,fatal,error,warning,info,verbose,debug,trace\n```\n\n---\n\n### `ff_thumbnail.sh`\n\n#### Description\n\nCreate thumbnails representative of the video.\n\n#### Flags\n\n```\n-i | --input \u003cINPUT_FILE\u003e\n    The name of an input file.\n\n-o | --output \u003cOUTPUT_FILE\u003e\n    Default is output_thumbnail.png\n    The name of the output image file.\n\n-c | --count \u003cCOUNT\u003e\n    The number of thumbnails to create. The default value is 1.\n    Uses a batch sample size of 300 frames. If there are less frames than the count, you will get less thumbnails.\n\n-s | --sample \u003cSAMPLE\u003e\n    The batch sample sizee. The default value is 300.\n    Size of the number of frames to analyse to create a thumbnail from. Each thumbnail will use the next batch.\n\n\n-C | --config \u003cCONFIG_FILE\u003e\n    The name of an input config file.\n\n-l | --loglevel \u003cLOGLEVEL\u003e\n    The FFMPEG loglevel to use. Default is 'error' only.\n    Options: quiet,panic,fatal,error,warning,info,verbose,debug,trace\n```\n\n---\n\n### `ff_to_landscape.sh`\n\n#### Description\n\nConvert a portrait video to landscape.\n\n![to_landscape](https://raw.githubusercontent.com/IORoot/ffmpeg__bash-scripts/master/lib/images/to_landscape.svg)\n\n#### Flags\n\n```\n\n-i | --input \u003cINPUT_FILE\u003e\n    The name of an input file.\n\n-o | --output \u003cOUTPUT_FILE\u003e\n    Default is output_landscape.mp4\n    The name of the output file.\n\n-r | --rotation \u003cROTATION\u003e\n    0 = 90CounterCLockwise and Vertical Flip\n    1 = 90Clockwise\n    2 = 90CounterClockwise (default)\n    3 = 90Clockwise and Vertical Flip\n\n-c | --config \u003cCONFIG_FILE\u003e\n    The name of an input config file.\n\n-l | --loglevel \u003cLOGLEVEL\u003e\n    The FFMPEG loglevel to use. Default is 'error' only.\n    Options: quiet,panic,fatal,error,warning,info,verbose,debug,trace\n```\n\n---\n\n### `ff_to_portrait.sh`\n\n#### Description\n\nConvert a landscape video to portrait.\n\n![to_portrait](https://raw.githubusercontent.com/IORoot/ffmpeg__bash-scripts/master/lib/images/to_portrait.svg)\n\n#### Flags\n\n```\n-i | --input \u003cINPUT_FILE\u003e\n    The name of an input file.\n\n-o | --output \u003cOUTPUT_FILE\u003e\n    Default is output_portrait.mp4\n    The name of the output file.\n\n-r | --rotation \u003cROTATION\u003e\n    0 = 90CounterCLockwise and Vertical Flip\n    1 = 90Clockwise (default)\n    2 = 90CounterClockwise\n    3 = 90Clockwise and Vertical Flip\n\n-c | --config \u003cCONFIG_FILE\u003e\n    The name of an input config file.\n\n-l | --loglevel \u003cLOGLEVEL\u003e\n    The FFMPEG loglevel to use. Default is 'error' only.\n    Options: quiet,panic,fatal,error,warning,info,verbose,debug,trace\n```\n\n---\n\n\n### `ff_transcode.sh`\n\n#### Description\n\nConvert a file to a common format.\n\n#### Flags\n\n```\n    -o | --output \u003cOUTPUT_FILE\u003e\n        The name of the output file. Specify only one.\n\n    -i | --input \u003cINPUT_FILE\u003e\n        The name of an input file or folder.\n\n    -g | --grep \u003cGREP\u003e\n        Supply a grep string for filtering the inputs if a folder is specified.\n\n    -v | --video \u003cVIDEO_CODEC\u003e\n        The video codec to convert all files to. [default libx264]\n\n    -a | --audio \u003cAUDIO_CODEC\u003e\n        The audio codec to convert all files to. [default aac]\n\n    -f | --fps \u003cFPS\u003e\n        The Frames Per Second to convert all files to. [default 30]\n\n    -s | --sar \u003cSAR\u003e\n        The Sample Aspect Ratio to convert all files to.\n\n    -d | --dar \u003cDAR\u003e\n        The Display Aspect Ratio to convert all files to.\n\n    -w | --width \u003cWIDTH\u003e\n        The width to convert all files to. [default 1920]\n\n    -h | --height \u003cHEIGHT\u003e\n        The height to convert all files to. [default 1080]\n\n    -C | --config \u003cCONFIG_FILE\u003e\n        Supply a config.json file with settings instead of command-line. Requires JQ installed.\n\n    -l | --loglevel \u003cLOGLEVEL\u003e\n        The FFMPEG loglevel to use. Default is 'error' only.\n        Options: quiet,panic,fatal,error,warning,info,verbose,debug,trace\n```\n\n\n---\n\n\n### `ff_transition.sh`\n\n#### Description\n\nConcats files together but adds a XFade transition between them. You can use any\nof the effects defined here: https://trac.ffmpeg.org/wiki/Xfade\n\nYou can specify the duration of the effect also.\n\nNote. You must have all files the same type. Use `ff_transcode` for a common format.\n\n#### Flags\n\n```\n    -o | --output \u003cOUTPUT_FILE\u003e\n        The name of the output file. Specify only one.\n\n    -i | --input \u003cINPUT_FILE\u003e\n        The name of an input file or folder.\n\n    -g | --grep \u003cGREP\u003e\n        Supply a grep string for filtering the inputs if a folder is specified.\n\n    -s | --sort \u003cSORT_FLAG\u003e\n        Allow the files to be sorted in different orders.\n\n    -e | --effects \u003cCSV_STRING\u003e\"\n        A csv string of each effect to use. If the effect list is shorter than\"\n        video list, then the effects will be repeated. [default 'fade'] (https://trac.ffmpeg.org/wiki/Xfade)\"\n\n    -d | --duration \u003cSTRING\u003e\"\n        How long each transition should take.\"\n\n    -C | --config \u003cCONFIG_FILE\u003e\n        Supply a config.json file with settings instead of command-line. Requires JQ installed.\n\n    -l | --loglevel \u003cLOGLEVEL\u003e\n        The FFMPEG loglevel to use. Default is 'error' only.\n        Options: quiet,panic,fatal,error,warning,info,verbose,debug,trace\n```\n\n---\n\n### `ff_unsharp.sh`\n\n#### Description\n\nUses an unsharp mask to alter the luma,chroma and alpha of a video.\n\n#### Flags\n\n```\n-i | --input \u003cINPUT_FILE\u003e\n    The name of an input file.\n\n-o | --output \u003cOUTPUT_FILE\u003e\n    Default is output_unsharp.mp4\n    The name of the output file.\n\n-lx | --luma_x \u003cSIZE\u003e\n    Set the luma matrix horizontal size. It must be an odd integer between 3 and 23. The default value is 5.\n\n-ly | --luma_y \u003cSIZE\u003e\n    Set the luma matrix vertical size. It must be an odd integer between 3 and 23. The default value is 5.\n\n-la | --luma_amount \u003cAMOUNT\u003e\n    Set the luma effect strength. It must be a floating point number. -2.0 to 5.0. Default value is 1.0.\n    Negative values will blur the input video, while positive values will sharpen it, a value of zero will disable the effect.\n\n-cx | --chroma_x \u003cSIZE\u003e\n    Set the chroma matrix horizontal size. It must be an odd integer between 3 and 23. The default value is 5.\n\n-cy | --chroma_y \u003cSIZE\u003e\n    Set the chroma matrix vertical size. It must be an odd integer between 3 and 23. The default value is 5.\n\n-ca | --chroma_amount \u003cAMOUNT\u003e\n    Set the chroma effect strength. It must be a floating point number. Default value is 0.0.\n    Negative values will blur the input video, while positive values will sharpen it, a value of zero will disable the effect.\n\n-ax | --alpha_x \u003cSIZE\u003e\n    Set the alpha matrix horizontal size. It must be an odd integer between 3 and 23. The default value is 5.\n\n-ay | --alpha_y \u003cSIZE\u003e\n    Set the alpha matrix vertical size. It must be an odd integer between 3 and 23. The default value is 5.\n\n-aa | --alpha_amount \u003cAMOUNT\u003e\n    Set the alpha effect strength. It must be a floating point number. Default value is 0.0.\n    Negative values will blur the input video, while positive values will sharpen it, a value of zero will disable the effect.\n\n    All parameters are optional and default to the equivalent of the string '5:5:1.0:5:5:0.0'.\n\n-c | --config \u003cCONFIG_FILE\u003e\n    The name of an input config file.\n\n-l | --loglevel \u003cLOGLEVEL\u003e\n    The FFMPEG loglevel to use. Default is 'error' only.\n    Options: quiet,panic,fatal,error,warning,info,verbose,debug,trace\n```\n\n---\n\n### `ff_watermark.sh`\n\n#### Description\n\nOverlay a watermark on the video.\n\n![watermark](https://raw.githubusercontent.com/IORoot/ffmpeg__bash-scripts/master/lib/images/watermark.svg)\n\n#### Flags\n\n```\n-i | --input \u003cINPUT_FILE\u003e\n    The name of an input file.\n\n-o | --output \u003cOUTPUT_FILE\u003e\n    Default is output_watermarked.mp4\n    The name of the output file.\n\n-w | --watermark \u003cWATERMARK_FILE\u003e\n    Note that you CAN use videos as the watermark.\n    Image to use for the watermark.\n\n-x | --xpixels \u003cPIXELS\u003e\n    Position of the watermark. Number of pixels on X-Axis. Default 10.\n    There are variables that also can be used:\n    - (W) is the width of the video\n    - (H) is the height of the video\n    - (w) is the width of the watermark\n    - (h) is the height of the watermark\n    The following example will center the watermark:\n    ff_watermark -i input.mp4 -w watermark.png -x \"(W-w)/2\" -y \"(H-h)/2\"\n\n-y | --ypixels \u003cPIXELS\u003e\n    Position of the watermark. Number of pixels on Y-Axis. Default 10.\n\n-s | --scale \u003cSCALE\u003e\n    Size of the watermark in relation to the height of the video. Default is 0.2 (1/5th height)\n\n-a | --alpha \u003cALPHA\u003e\n    Transparency (alpha channel) of the watermark. From 0 to 1. Default is 1.\n\n-c | --config \u003cCONFIG_FILE\u003e\n    The name of an input config file.\n\n-l | --loglevel \u003cLOGLEVEL\u003e\n    The FFMPEG loglevel to use. Default is 'error' only.\n    Options: quiet,panic,fatal,error,warning,info,verbose,debug,trace\n```\n\n#### Examples\n\nCenter large watermark:\n\n       ff_watermark -i input.mp4 -w watermark.png -s 0.4 -x \"(W-w)/2\" -y \"(H-h)/2\"\n\nSmall bottom right watermark:\n\n       ff_watermark -i input.mp4 -w watermark.png -s 0.1 -x \"(W-w)\" -y \"(H-h)\"\n\nFull-size watermark:\n\n       ff_watermark -i input.mp4 -w watermark.png -s 1\n\nFull-size semi-transparent watermark:\n\n       ff_watermark -i input.mp4 -w watermark.png -s 1 -a 0.5\n\nSmall, transparent bottom-right positioned Video as a watermark:\n\n       ff_watermark -i input.mp4 -w watermark_video.mp4 -s 0.3 -x \"(W-w)\" -y \"(H-h)\" -a 0.5\n\n---\n\n## 4. ScriptFlow\n\nThe `scriptflow.sh` script takes a single argument - a config.json file that describes all steps to take.\n\nThis configuration JSON file will built up of a chain of scripts you wish to run. Each key has the name of the script, like `ff_lut` and then an object with each key and value.\n\nFor example, to run the `ff_lut` script followed by the `ff_thumbnail` script, you can use the following file:\n\n```json\n{\n\t\"ff_lut\": {\n\t\t\"input\": \"movie.mp4\",\n\t\t\"lut\": \"Lundmark.cube\"\n\t},\n\n\t\"ff_thumbnail\": {\n\t\t\"input\": \"ff_lut.mp4\",\n\t\t\"count\": \"2\"\n\t}\n}\n```\n\nDefaults will be used for any flag not specified. Every script has a default `output` of it's own script name. This is why the `ff_thumbnail` script can take in the `ff_lut.mp4` file.\n\n### 4.1 Blank flags\n\nIf you need to use a flag without a value, simple use an empty string.\n\n```json\n{\n\t\"ff_flip\": {\n\t\t\"input\": \"movie.mp4\",\n\t\t\"horizontal\": \"\"\n\t}\n}\n```\n\n### 4.2 nulls\n\n`null` values can also be used to just act as a reminder of what keys are available. Any key with a `null` value will be stripped out when run and the default value of the script will be used.\n\n```json\n{\n\t\"ff_flip\": {\n\t\t\"input\": null,\n\t\t\"horizontal\": null,\n\t\t\"vertical\": null,\n\t\t\"output\": null,\n\t\t\"loglevel\": null\n\t}\n}\n```\n\n\u003e Note : The github action requires `schedule` and `category`. These are not needed other than for my pipelines.\n\n### 4.3 Multiple duplicate scripts\n\nIf you have multiple stages with the same name, like `ff_scale`, Then use a counter digit as a suffix. So, `ff_scale1` and `ff_scale2`...\n\n```json\n{\n\t\"ff_proxy1\": {\n\t\t\"input\": \"video1.mp4\",\n\t\t\"output\": \"proxy1.mp4\"\n\t},\n\n\t\"ff_proxy2\": {\n\t\t\"input\": \"videoB.mp4\",\n\t\t\"output\": \"proxy2.mp4\"\n\t}\n}\n```\n\n### 4.4 Scripts with multiple inputs\n\nInputs can be `input1`, `input2`, etc... for scripts that require multiple inputs (like `ff_concat.sh`)\n\n```json\n{\n\t\"ff_concat\": {\n\t\t\"input1\": \"video1.mp4\",\n\t\t\"input2\": \"videoB.mp4\",\n\t\t\"input3\": \"charlie.mp4\"\n\t}\n}\n```\n\n### 4.5 Keyword Replacements\n\n#### \u003cENV\\_\\*\u003e\n\nYou can use the `\u003cENV_VARIABLENAME\u003e` keyword variable to replace with the any environment variable.\nSet an environment variable by:\n\n```bash\nexport MYVARIABLE=\"Helloo there\"\n```\n\nand then including the tag `\u003cENV_MYVARIABLE\u003e` into the code.\n\n```json\n{\n\t\"ff_text\": {\n\t\t\"input\": \"input.mp4\",\n\t\t\"text\": \"Test of variable - \u003cENV_MYVARIABLE\u003e\",\n\t\t\"size\": \"36\",\n\t\t\"reduction\": \"10\",\n\t\t\"xpixels\": \"(w-tw)/2\",\n\t\t\"ypixels\": \"(h-th)-100\",\n\t\t\"colour\": \"#FFFFFF\",\n\t\t\"boxcolour\": \"#262626\"\n\t}\n}\n```\n\nYou can also prepend the variable to the front of the script so you don't need to set it as an environment variable:\n\n```bash\nMYVARIABLE=\"Helloo there\" ./scriptflow.sh\n```\n\n---\n\n#### \u003cFOLDER_NAME\u003e\n\nYou can use the `\u003cFOLDER_NAME\u003e` keyword variable to replace with the ACTUAL name of the folder the config file is located.\n\n```json\n{\n\t\"ff_to_landscape\": {\n\t\t\"input\": \"\u003cFOLDER_NAME\u003e\"\n\t}\n}\n```\n\nThis will translate to something equivalent to:\n\n```json\n{\n\t\"ff_to_landscape\": {\n\t\t\"input\": \"/Users/me/myfolder/\"\n\t}\n}\n```\n\n---\n\n#### \u003cFOLDER_TITLE\u003e\n\nThe `\u003cFOLDER_TITLE\u003e` is very similar to the `\u003cFOLDER_NAME\u003e` except it replaces underscores for spaces.\nThis is useful for adding text relevant to the folder.\nFor example:\n\n```json\n{\n\t\"ff_text\": {\n\t\t\"input\": \"/tmp/Youth_Classes/video.mp4\",\n\t\t\"text\": \"Every Sunday!\\n\u003cFOLDER_TITLE\u003e!\"\n\t}\n}\n```\n\nwill translate to:\n\n```json\n{\n\t\"ff_text\": {\n\t\t\"input\": \"/tmp/Youth_Classes/video.mp4\",\n\t\t\"text\": \"Every Sunday!\\nYouth Classes!\"\n\t}\n}\n```\n\n---\n\n#### \u003cDATE_format\u003e\n\nThe `\u003cDATE_format\u003e` keyword, as the word implies, allows you to add the current date as per the bash formatting. (see https://man7.org/linux/man-pages/man1/date.1.html)\n\n```json\n{\n\t\"ff_text\": {\n\t\t\"input\": \"video.mp4\",\n\t\t\"text\": \"Video created on\\n\u003cDATE_%A %d %B. %Y\u003e\"\n\t}\n}\n```\n\nBecomes:\n\n```json\n{\n\t\"ff_text\": {\n\t\t\"input\": \"video.mp4\",\n\t\t\"text\": \"Video created on\\nFriday 31 March. 2023\"\n\t}\n}\n```\n\n---\n\n#### \u003cRANDOM_VIDEO\u003e\n\nIf you wish to pick a random video from a folder, you can use this `\u003cRANDOM_VIDEO\u003e` variable.\n\n```json\n{\n\t\"ff_pad\": {\n\t\t\"input\": \"/Videos/\u003cRANDOM_VIDEO\u003e\",\n\t\t\"width\": \"800\",\n\t\t\"height\": \"800\"\n\t}\n}\n```\n\nThis will search all `*.mov` and `*.mp4` videos in that folder and randomise the output.\n\n---\n\n#### \u003cRANDOM_VIDEO_FILTER_string\u003e\n\nFor a little more control over the randomised selection of videos, the `\u003cRANDOM_VIDEO_FILTER_string\u003e` keyword allows you to supply a string that must be contained in the video name.\nSay you have the following videos:\n\n```bash\n/videos/video01.mp4\n/videos/landscape_holiday.mp4\n/videos/sea_holiday.mp4\n/videos/sportsday.mp4\n/videos/presentation.mp4\n```\n\nIf you wanted a random selection from only the `holiday` videos, you can supply the following config:\n\n```json\n{\n\t\"ff_sharpen\": {\n\t\t\"input\": \"/Videos/\u003cRANDOM_VIDEO_FILTER_holiday\u003e\",\n\t\t\"strength\": \"3.2\"\n\t}\n}\n```\n\nThis will randomly pick ONLY a holiday video and sharpen it.\n\n---\n\n#### \u003cRANDOM_COLOUR\u003e\n\nThis uses the tailwind CSS palette for a nicer curated list of colours to use. See https://tailwindcss.com/docs/customizing-colors\n\nThis keyword will just randomly pick a new colour from the tailwind array and replace it with the hex code.\n\n```json\n{\n\t\"ff_text\": {\n\t\t\"input\": \"video.mp4\",\n\t\t\"text\": \"Hello!\",\n\t\t\"colour\": \"\u003cRANDOM_COLOUR\u003e\"\n\t}\n}\n```\n\nThis will become:\n\n```json\n{\n\t\"ff_text\": {\n\t\t\"input\": \"video.mp4\",\n\t\t\"text\": \"Hello!\",\n\t\t\"colour\": \"#c2410c\"\n\t}\n}\n```\n\nNote that a key point to remember is that subsequent stages of the JSON file will be also be random values and will keep changing.\n\n---\n\n#### \u003cRANDOM_CONTRAST_COLOUR\u003e\n\nThis is based on the `\u003cRANDOM_COLOUR\u003e` tag and will determine if the generated value is 'light' or 'dark'. It will then set this `\u003cRANDOM_CONTRAST_COLOUR\u003e` tag to be a contrasting white or black colour.\nFor instance, if the `\u003cRANDOM_COLOUR\u003e` is #365314 (a dark green) then the `\u003cRANDOM_CONTRAST_COLOUR\u003e` will be set to white to contrast it. This is useful for text over background colours.\n\n```json\n    \"ff_text\": {\n        \"input\": \"input.mp4\",\n        \"text\": \"The background is random, the foreground is contrasting.\",\n        \"colour\": \"\u003cRANDOM_CONTRAST_COLOUR\u003e\",\n        \"boxcolour\": \"\u003cRANDOM_COLOUR\u003e\"\n    },\n```\n\nThis will change to:\n\n```json\n    \"ff_text\": {\n        \"input\": \"input.mp4\",\n        \"text\": \"The background is random, the foreground is white or black.\",\n        \"colour\": \"#fafafa\",\n        \"boxcolour\": \"#365314\"\n    },\n```\n\n---\n\n#### \u003cCONSTANT_RANDOM_COLOUR\u003e\n\nOne issue is that the `\u003cRANDOM_COLOUR\u003e` and `\u003cRANDOM_CONTRAST_COLOUR\u003e` tags will keep changing across each JSON step. It can therefore be tricky to reuse and match colours across multiple steps. This is where the `\u003cCONSTANT_RANDOM_COLOUR\u003e` comes in.\n\nThis will be randomised once at the beginning of the script run and then never changed. This way, the same colour can be reused.\n\nThe below example adds a pad around a landscape video to make it the same height as it's width. Then text is overlayed on the padding area.\n\n```json\n    \"ff_pad\": {\n        \"input\": \"input.mp4\",\n        \"height\": \"iw\",\n        \"colour\": \"\u003cCONSTANT_RANDOM_COLOUR\u003e\"\n    },\n\n    \"ff_text1\": {\n        \"input\": \"ff_pad.mp4\",\n        \"text\": \"Top test\",\n        \"colour\": \"\u003cRANDOM_COLOUR\u003e\",\n        \"boxcolour\": \"\u003cCONSTANT_RANDOM_COLOUR\u003e\",\n        \"ypixels\": \"70\"\n    },\n```\n\nHere, both steps will now have the same colour for the padding and the text box background (#a5f3fc), with the text being a random different colour.\n\n```json\n    \"ff_pad\": {\n        \"input\": \"input.mp4\",\n        \"height\": \"iw\",\n        \"colour\": \"#a5f3fc\"\n    },\n\n    \"ff_text1\": {\n        \"input\": \"ff_pad.mp4\",\n        \"text\": \"Top test\",\n        \"colour\": \"#2e1065\",\n        \"boxcolour\": \"#a5f3fc\",\n        \"ypixels\": \"70\"\n    },\n```\n\n---\n\n#### \u003cCONSTANT_CONTRAST_COLOUR\u003e\n\nThis tag will contrast the `\u003cCONSTANT_RANDOM_COLOUR\u003e` colour and will only be randomised once on the start of the script flow. Therefore maintaining a constant light or dark colour until the script is finished.\nUseful for maintaining across multiple JSON steps.\n\n```json\n    \"ff_text1\": {\n       \"input\": \"input.mp4\",\n       \"output\": \"ff_text1.mp4\",\n       \"text\": \"First Line\",\n       \"colour\": \"\u003cCONSTANT_CONTRAST_COLOUR\u003e\",\n       \"boxcolour\": \"\u003cCONSTANT_RANDOM_COLOUR\u003e\",\n       \"ypixels\": \"70\"\n    },\n\n    \"ff_text1\": {\n       \"input\": \"ff_text1.mp4\",\n       \"output\": \"ff_text2.mp4\",\n       \"text\": \"Second Line\",\n       \"colour\": \"\u003cCONSTANT_CONTRAST_COLOUR\u003e\",\n       \"boxcolour\": \"\u003cCONSTANT_RANDOM_COLOUR\u003e\",\n       \"ypixels\": \"120\"\n    },\n\n```\n\nThe substituted scripts will now have the same colours across each step. Here you have a dark red text box background (#83184) and white contrasting text (#ffffff)\n\n```json\n    \"ff_text1\": {\n       \"input\": \"input.mp4\",\n       \"output\": \"ff_text1.mp4\",\n       \"text\": \"First Line\",\n       \"colour\": \"#ffffff\",\n       \"boxcolour\": \"#83184\",\n       \"ypixels\": \"70\"\n    },\n\n    \"ff_text1\": {\n       \"input\": \"ff_text1.mp4\",\n       \"output\": \"ff_text2.mp4\",\n       \"text\": \"Second Line\",\n       \"colour\": \"#ffffff\",\n       \"boxcolour\": \"#83184\",\n       \"ypixels\": \"120\"\n    },\n\n```\n\n### 4.5. Output \u0026 Cleanup\n\nOnce the `scriptflow` has finished, it will output to a file called `output.mp4` and all other `ff_?????.mp4` intermediate movie files will be removed.\n\n### 4.6 pwd and file references\n\nWhen `scriptflow` runs, it will move into the folder that the `config.json` file sits in. All file references should be relative to the `config.json` file.\nThe script will finish by move back to when you first were in the filesystem.\n\n### 4.7 descriptions\n\nYou can now add a `description` field into your JSON for each step. This is ignored by all scripts and allows you to keep track of what each step is doing.\n\n```json\n    \"ff_text1\": {\n       \"description\": \"Add some text 70px from the top, middle (default) of the frame\",\n       \"input\": \"input.mp4\",\n       \"output\": \"ff_text1.mp4\",\n       \"text\": \"First Line\",\n       \"colour\": \"#ffffff\",\n       \"boxcolour\": \"#83184\",\n       \"ypixels\": \"70\"\n    },\n\n    \"ff_text1\": {\n       \"description\": \"Then add a second line 120px from the top, middles of the frame\",\n       \"input\": \"ff_text1.mp4\",\n       \"output\": \"ff_text2.mp4\",\n       \"text\": \"Second Line\",\n       \"colour\": \"#ffffff\",\n       \"boxcolour\": \"#83184\",\n       \"ypixels\": \"120\"\n    },\n\n```\n\n---\n\n## 5. Customising\n\nFork and use Pull Requests.\n\n---\n\n## 6. Troubleshooting\n\n### Output Files.\n\nDo not start the name of the output file ff*.mp4 because the cleanup script will delete it.\n\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n---\n\n## 7. Contributing\n\nContributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.\n\nIf you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue.\nDon't forget to give the project a star! Thanks again!\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n---\n\n## 8. License\n\nDistributed under the MIT License.\n\nMIT License\n\nCopyright (c) 2022 Andy Pearson\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n---\n\n## 9. Contact\n\nAuthor Link: [https://github.com/IORoot](https://github.com/IORoot)\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n---\n\n## 10. Changelog\n\n### Version 1.10\n\n- Added ff_subtitles.sh to add embed subtitles to video\n- Added ff_kenburns.sh to convert images to video with zoom-pan effect\n- Added ff_transcode.sh to bulk convert videos to common format and specs.\n\n### Version 1.9\n\n- Renamed to Video_FFMPEG-Scriptflow to be housed under the video umbrella.\n\n### Version 1.8\n\n- ff_concat can now reformat files first.\n- added ff_transcode.sh to format files into a common format.\n- ff_audio can remove audio from video.\n- ff_transition added. You can use XFade effects to concat files together.\n- ff_transition test added.\n\n### Version 1.7\n\n- Upgraded output messages\n- fixed ff_flip\n- Added tests for all scripts\n\n### Version 1.6\n\n-   Added 'description' fields\n-   Updated configs\n-   Better log outputs and spacing\n\n### Version 1.5\n\n-   Added ff_download.sh\n-   removed templates for configs and scriptflow.sh\n\n### Version 1.4\n\n-   Keywords for Random tailwind colours.\n\n### Version 1.3\n\n-   Folder handling in many scripts.\n-   Keywords in JSON\n\n### Version 1.2\n\n-   Added scriptflow. Run any script with a JSON config file.\n\n### Version 1.1\n\n-   Added config-file abilities. Used by templates.\n\n### Version 1.0\n\n-   Initial\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIORoot%2FVideo_FFMPEG-Scriptflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FIORoot%2FVideo_FFMPEG-Scriptflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIORoot%2FVideo_FFMPEG-Scriptflow/lists"}