This commit is contained in:
gilesb
2025-10-25 18:17:56 +01:00
parent d5fa0bcb12
commit 9e7672c05a
39 changed files with 689 additions and 0 deletions

BIN
5th-step/5th-A3-1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

BIN
5th-step/5th-final.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 449 KiB

37
5th-step/5th-step.sh Normal file
View File

@@ -0,0 +1,37 @@
ffmpeg -y -i 5th-A3-1.jpg \
-vf "drawbox=3000:2240:1480:120:color=red:t=6" \
-frames:v 1 preview.jpg
#ffmpeg -y -i 5th-A3-1.jpg -vf "delogo=x=3000:y=2200:w=1600:h=150:show=1" -frames:v 1 preview.jpg
ffmpeg -y -i 5th-A3-1.jpg -vf "delogo=x=3000:y=2240:w=1480:h=120:show=0" -frames:v 1 output.jpg
ffmpeg -y -i output.jpg -vf "drawtext=fontfile='../fonts/Bebas_Neue/BebasNeue-Regular.ttf':\
text='ROSE ASH VILLAGE HALL':fontcolor=white:fontsize=250:x=2850:y=2000:\
borderw=2:bordercolor=white@0.25" -frames:v 1 a3-out.jpg
ffmpeg -y -i a3-out.jpg -vf "drawtext=fontfile='../fonts/Nuninto/static/Nunito-Bold.ttf':\
text='Friday 28th November 2025':fontcolor=white:fontsize=120:x=2900:y=2250:\
borderw=2:bordercolor=white@0.25" -frames:v 1 a3-out-1.jpg
ffmpeg -y -i a3-out-1.jpg -vf "drawtext=fontfile='../fonts/Nuninto/static/Nunito-Bold.ttf':\
text='£10 on the door or in advance':fontcolor=white:fontsize=75:x=3200:y=2450:\
borderw=2:bordercolor=white@0.25" -frames:v 1 a3-out-2.jpg
ffmpeg -y -i a3-out-2.jpg -vf "drawtext=fontfile='../fonts/Nuninto/static/Nunito-Bold.ttf':\
text='Doors open 7pm; play starts 7.30':fontcolor=white:fontsize=50:x=3350:y=3100:\
borderw=2:bordercolor=white@0.25" -frames:v 1 a3-out-3.jpg
ffmpeg -y -i a3-out-3.jpg -vf "drawtext=fontfile='../fonts/Nuninto/static/Nunito-Bold.ttf':\
text='https\://rose-ash.com':fontcolor=white:fontsize=90:x=100:y=3300:\
borderw=2:bordercolor=white@0.25" -frames:v 1 5th-final.jpg
rm a3-out*.jpg
rm preview.jpg
rm output.jpg

24
5th-step/README.md Normal file
View File

@@ -0,0 +1,24 @@
# The Fifth Step
[rose-ash.com](https://rose-ash.com/nt-live-the-fifth-step/)
All NT marketing materials are available [here](https://nationaltheatrelive.egnyte.com/fl/6dMyp6wjkmfV)
## [rose ash poster(5th-final.jpg)](5th-final.jpg)
![poster](5th-final.jpg)
```bash
bash 5th-step.sh
```
## trailer
[original](https://nationaltheatrelive.egnyte.com/fl/xwH93vMf7yBm#folder-link/NTL%202026%20-%20Hamlet/Online%20Content/Teaser%20Trailer?p=e2888687-20fb-4dfb-b6c2-6182291e2e4e)
```bash
bash trailer.sh
```
[rose ash version](https://www.youtube.com/watch?v=e3mMD0MJj94)

4
5th-step/trailer.sh Normal file
View File

@@ -0,0 +1,4 @@
bash ../text.sh -i trailer.mp4 -o trailer-1.mp4 --start 71 --end 79 --fs 120 --dy -400 --text "ROSE ASH VILLAGE HALL" --fontfile "../fonts/BebasNeue/BebasNeue-Regular.ttf"
bash ../text.sh -i trailer-1.mp4 -o 5th-trailer.mp4 --start 72 --end 79 --fs 100 --dy 250 --text "Friday, November 28th" --fontfile "../fonts/BebasNeue/BebasNeue-Regular.ttf"
rm trailer-1.mp4

Binary file not shown.

93
fonts/Bebas_Neue/OFL.txt Normal file
View File

@@ -0,0 +1,93 @@
Copyright © 2010 by Dharma Type.
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
https://openfontlicense.org
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

Binary file not shown.

Binary file not shown.

93
fonts/Nunito/OFL.txt Normal file
View File

@@ -0,0 +1,93 @@
Copyright 2014 The Nunito Project Authors (https://github.com/googlefonts/nunito)
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
https://openfontlicense.org
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

79
fonts/Nunito/README.txt Normal file
View File

@@ -0,0 +1,79 @@
Nunito Variable Font
====================
This download contains Nunito as both variable fonts and static fonts.
Nunito is a variable font with this axis:
wght
This means all the styles are contained in these files:
Nunito/Nunito-VariableFont_wght.ttf
Nunito/Nunito-Italic-VariableFont_wght.ttf
If your app fully supports variable fonts, you can now pick intermediate styles
that arent available as static fonts. Not all apps support variable fonts, and
in those cases you can use the static font files for Nunito:
Nunito/static/Nunito-ExtraLight.ttf
Nunito/static/Nunito-Light.ttf
Nunito/static/Nunito-Regular.ttf
Nunito/static/Nunito-Medium.ttf
Nunito/static/Nunito-SemiBold.ttf
Nunito/static/Nunito-Bold.ttf
Nunito/static/Nunito-ExtraBold.ttf
Nunito/static/Nunito-Black.ttf
Nunito/static/Nunito-ExtraLightItalic.ttf
Nunito/static/Nunito-LightItalic.ttf
Nunito/static/Nunito-Italic.ttf
Nunito/static/Nunito-MediumItalic.ttf
Nunito/static/Nunito-SemiBoldItalic.ttf
Nunito/static/Nunito-BoldItalic.ttf
Nunito/static/Nunito-ExtraBoldItalic.ttf
Nunito/static/Nunito-BlackItalic.ttf
Get started
-----------
1. Install the font files you want to use
2. Use your app's font picker to view the font family and all the
available styles
Learn more about variable fonts
-------------------------------
https://developers.google.com/web/fundamentals/design-and-ux/typography/variable-fonts
https://variablefonts.typenetwork.com
https://medium.com/variable-fonts
In desktop apps
https://theblog.adobe.com/can-variable-fonts-illustrator-cc
https://helpx.adobe.com/nz/photoshop/using/fonts.html#variable_fonts
Online
https://developers.google.com/fonts/docs/getting_started
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts/Variable_Fonts_Guide
https://developer.microsoft.com/en-us/microsoft-edge/testdrive/demos/variable-fonts
Installing fonts
MacOS: https://support.apple.com/en-us/HT201749
Linux: https://www.google.com/search?q=how+to+install+a+font+on+gnu%2Blinux
Windows: https://support.microsoft.com/en-us/help/314960/how-to-install-or-remove-a-font-in-windows
Android Apps
https://developers.google.com/fonts/docs/android
https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fonts
License
-------
Please read the full license text (OFL.txt) to understand the permissions,
restrictions and requirements for usage, redistribution, and modification.
You can use them in your products & projects print or digital,
commercial or otherwise.
This isn't legal advice, please consider consulting a lawyer and see the full
license for all details.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

24
hamlet/README.md Normal file
View File

@@ -0,0 +1,24 @@
# Hamlet
[rose-ash.com](https://rose-ash.com/nt-live-hamlet/)
All NT marketing materials are available [here](https://nationaltheatrelive.egnyte.com/fl/xwH93vMf7yBm)
## [rose ash poster(hamlet-final.jpg)](hamlet-final.jpg)
![poster](hamlet-final.jpg)
```bash
bash hamlet.sh
```
## trailer
[original](https://nationaltheatrelive.egnyte.com/fl/xwH93vMf7yBm#folder-link/NTL%202026%20-%20Hamlet/Online%20Content/Teaser%20Trailer?p=e2888687-20fb-4dfb-b6c2-6182291e2e4e)
```bash
bash hamlet-teaser.sh
```
[rose ash version](https://www.youtube.com/watch?v=X8rO2932m8o)

BIN
hamlet/hamlet-final.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

BIN
hamlet/hamlet-landscape.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

6
hamlet/hamlet-teaser.sh Normal file
View File

@@ -0,0 +1,6 @@
bash ../remove-text.sh -i hamlet-teaser.mp4 -o hamlet-1.mp4 --x 650 --y 480 --w 650 --h 200 --start 45.1 #--preview
bash ../text.sh -i hamlet-1.mp4 -o hamlet-2.mp4 --start 45.1 --end 48.5 --fs 150 --dy 0 --text "ROSE ASH VILLAGE HALL" --fontfile "./BebasNeue-Regular.ttf"
bash ../text.sh -i hamlet-2.mp4 -o hamlet-output.mp4 --start 46 --end 49 --fs 100 --dy 250 --text "Friday, January 30th 2026" --fontfile "./BebasNeue-Regular.ttf"
rm hamlet-1.mp4
rm hamlet-2.mp4

19
hamlet/hamlet.sh Normal file
View File

@@ -0,0 +1,19 @@
ffmpeg -y -i hamlet-landscape.png -vf "drawtext=fontfile='../Nuninto/static/Nunito-Bold.ttf':\
text='ROSE ASH VILLAGE HALL':fontcolor=white:fontsize=30:x=740:y=570:" -frames:v 1 out.jpg
ffmpeg -y -i out.jpg -vf "drawtext=fontfile='../Nuninto/static/Nunito-Bold.ttf':\
text='Friday 30th January':fontcolor=white:fontsize=35:x=765:y=610" -frames:v 1 out-1.jpg
ffmpeg -y -i out-1.jpg -vf "drawtext=fontfile='../Nuninto/static/Nunito-Bold.ttf':\
text='£10 on the door or in advance':fontcolor=white:fontsize=15:x=815:y=660" -frames:v 1 out-2.jpg
ffmpeg -y -i out-2.jpg -vf "drawtext=fontfile='../Nuninto/static/Nunito-Bold.ttf':\
text='Doors open 7pm; play starts 7.30':fontcolor=white:fontsize=15:x=800:y=825" -frames:v 1 out-3.jpg
ffmpeg -y -i out-3.jpg -vf "drawtext=fontfile='../Nuninto/static/Nunito-Bold.ttf':\
text='https\://rose-ash.com':fontcolor=white:fontsize=20:x=10:y=830" -frames:v 1 hamlet-final.jpg
rm out*.jpg

18
mr-burton/README.md Normal file
View File

@@ -0,0 +1,18 @@
# Mr Burton
[rose-ash.com](https://rose-ash.com/mr-burton/)
## [rose ash poster(burton.jpg)](burton.jpg)
![poster](burton.jpg)
```bash
bash burton.sh
```
## [rose ash trailer(hamlet_output.mp4)](hamlet_output.mp4)
```bash
bash hamlet-teaser.sh
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 KiB

BIN
mr-burton/burton.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

26
mr-burton/burton.sh Normal file
View File

@@ -0,0 +1,26 @@
ffmpeg -y -i burton-original.jpeg -vf "drawtext=fontfile='../Nunito/static/Nunito-Bold.ttf':\
text='ROSE ASH VILLAGE HALL':fontcolor=orange:fontsize=60:x=590:y=875" -frames:v 1 1.jpg
ffmpeg -y -i 1.jpg -vf "drawtext=fontfile='../Nunito/static/Nunito-Bold.ttf':\
text='Friday, 14th November':fontcolor=red:fontsize=40:x=750:y=930" -frames:v 1 2.jpg
ffmpeg -y -i 2.jpg -vf "drawtext=fontfile='../Nunito/static/Nunito-Bold.ttf':\
text='£6':fontcolor=black:fontsize=40:x=925:y=975" -frames:v 1 3.jpg
ffmpeg -y -i 3.jpg -vf "drawtext=fontfile='../Nunito/static/Nunito-Bold.ttf':\
text='Doors open 7pm; film starts 7.30':fontcolor=black:fontsize=20:x=800:y=1020" -frames:v 1 4.jpg
ffmpeg -y -i 4.jpg -vf "drawtext=fontfile='../Nuninto/static/Nunito-Bold.ttf':\
text='https\://rose-ash.com':fontcolor=black:fontsize=35:x=10:y=1025" -frames:v 1 5.jpg
ffmpeg -y -i 5.jpg -vf "drawtext=fontfile='../Nunito/static/Nunito-Bold.ttf':\
text='Bar':fontcolor=black:fontsize=20:x=934:y=1050" -frames:v 1 burton.jpg
rm 1.jpg
rm 2.jpg
rm 3.jpg
rm 4.jpg
rm 5.jpg

19
poster.sh Normal file
View File

@@ -0,0 +1,19 @@
ffmpeg -y -i page-1.jpg -vf "drawtext=fontfile='Nuninto/static/Nunito-Bold.ttf':\
text='ROSE ASH VILLAGE HALL':fontcolor=brown:fontsize=72:x=1350:y=1020:\
borderw=2:bordercolor=brown@0.25" -frames:v 1 page-1-out.jpg
ffmpeg -y -i page-1-out.jpg -vf "drawtext=fontfile='Nuninto/static/Nunito-Bold.ttf':\
text='Friday, 26th September':fontcolor=red:fontsize=80:x=1324:y=1120:\
borderw=2:bordercolor=red@0.25" -frames:v 1 page-1-out-1.jpg
ffmpeg -y -i inter-alia-poster.jpg -vf "drawtext=fontfile='Nuninto/static/Nunito-SemiBold.ttf':\
text='Doors open 7pm, Play starts 7.30, Bar':fontcolor=brown:fontsize=50:x=1320:y=1240:\
borderw=2:bordercolor=brown@0.25" -frames:v 1 page-1-out-2.jpg
ffmpeg -y -i page-1-out-2.jpg -vf "drawtext=fontfile='Nuninto/static/Nunito-SemiBold.ttf':\
text='£9':fontcolor=brown:fontsize=50:x=1740:y=1340:\
borderw=2:bordercolor=brown@0.25" -frames:v 1 page-1-out-3.jpg
ffmpeg -y -i page-1-out-3.jpg -vf "drawtext=fontfile='Nuninto/static/Nunito-SemiBold.ttf':\
text='rose-ash.com/inter-alia':fontcolor=brown:fontsize=50:x=1470:y=1440:\
borderw=2:bordercolor=brown@0.25" -frames:v 1 page-1-out-4.jpg

124
remove-text.sh Normal file
View File

@@ -0,0 +1,124 @@
#!/usr/bin/env bash
set -euo pipefail
# remove_text.sh — conceal on-screen text in a rectangular area for a chosen time window.
# Requires: ffmpeg (with delogo filter)
show_help() {
cat <<'EOF'
Usage:
remove_text.sh -i INPUT -o OUTPUT --x X --y Y --w W --h H [--start SEC] [--end SEC] [--feather PX] [--preview] [--dry-run]
Params:
-i, --input Input video file
-o, --output Output video file
--x Left coordinate of the box (pixels)
--y Top coordinate of the box (pixels)
--w Box width (pixels)
--h Box height (pixels)
--start Start time in seconds (e.g. 12 or 12.5). If omitted, applies from t=0.
--end End time in seconds (exclusive). If omitted, applies to end of video.
--feather Feather thickness for delogo (default: 8). Higher = softer edge.
--preview Instead of removing, draw a red box to help align the area.
--dry-run Print the ffmpeg command but don't execute it.
-h, --help Show this help
Examples:
Preview the area (draws box only):
remove_text.sh -i in.mp4 -o preview.mp4 --x 120 --y 940 --w 680 --h 60 --start 12.5 --end 28.3 --preview
Remove text in that area/time range:
remove_text.sh -i in.mp4 -o out.mp4 --x 120 --y 940 --w 680 --h 60 --start 12.5 --end 28.3
EOF
}
# ---- defaults ----
INPUT=""
OUTPUT=""
X=""
Y=""
W=""
H=""
START=""
END=""
FEATHER="8"
PREVIEW="0"
DRYRUN="0"
# ---- parse args ----
if [[ $# -eq 0 ]]; then show_help; exit 1; fi
while [[ $# -gt 0 ]]; do
case "$1" in
-i|--input) INPUT="${2:-}"; shift 2;;
-o|--output) OUTPUT="${2:-}"; shift 2;;
--x) X="${2:-}"; shift 2;;
--y) Y="${2:-}"; shift 2;;
--w) W="${2:-}"; shift 2;;
--h) H="${2:-}"; shift 2;;
--start) START="${2:-}"; shift 2;;
--end) END="${2:-}"; shift 2;;
--feather) FEATHER="${2:-}"; shift 2;;
--preview) PREVIEW="1"; shift;;
--dry-run) DRYRUN="1"; shift;;
-h|--help) show_help; exit 0;;
*) echo "Unknown argument: $1"; echo; show_help; exit 1;;
esac
done
# ---- validation ----
if [[ -z "$INPUT" || -z "$OUTPUT" || -z "$X" || -z "$Y" || -z "$W" || -z "$H" ]]; then
echo "Error: Missing required arguments."; echo
show_help; exit 1
fi
if ! command -v ffmpeg >/dev/null 2>&1; then
echo "Error: ffmpeg not found in PATH."; exit 1
fi
# Build enable expression based on start/end
ENABLE_EXPR=""
if [[ -n "$START" && -n "$END" ]]; then
ENABLE_EXPR="between(t\,${START}\,${END})"
elif [[ -n "$START" ]]; then
ENABLE_EXPR="gte(t\,${START})"
elif [[ -n "$END" ]]; then
ENABLE_EXPR="lte(t\,${END})"
else
ENABLE_EXPR="" # apply for whole video
fi
# Build filter chain
if [[ "$PREVIEW" == "1" ]]; then
if [[ -n "$ENABLE_EXPR" ]]; then
VFILTER="drawbox=x=${X}:y=${Y}:w=${W}:h=${H}:color=red@0.5:thickness=2:enable='${ENABLE_EXPR}'"
else
VFILTER="drawbox=x=${X}:y=${Y}:w=${W}:h=${H}:color=red@0.5:thickness=2"
fi
else
# delogo: x, y, w, h, t = feather thickness; show=0 (no outline)
# delogo: x, y, w, h, band = feather thickness; show=0 (no outline)
if [[ -n "$ENABLE_EXPR" ]]; then
VFILTER="delogo=x=${X}:y=${Y}:w=${W}:h=${H}:show=0:enable='${ENABLE_EXPR}'"
else
VFILTER="delogo=x=${X}:y=${Y}:w=${W}:h=${H}:show=0"
fi
fi
# Assemble ffmpeg command
# -c:v libx264 -crf 18: quality/size balance; adjust as needed
# -preset medium: speed/efficiency tradeoff
# -c:a copy: keep original audio
CMD=(ffmpeg -hide_banner -y -i "$INPUT" -vf "$VFILTER" -c:v libx264 -crf 18 -preset medium -c:a copy "$OUTPUT")
echo "Running:"
printf ' %q' "${CMD[@]}"; echo
if [[ "$DRYRUN" == "1" ]]; then
exit 0
fi
"${CMD[@]}"
echo "Done: $OUTPUT"

123
text.sh Normal file
View File

@@ -0,0 +1,123 @@
#!/usr/bin/env bash
set -euo pipefail
# title_one_line.sh — one centered line with fade in/out in a time window
# Requires: ffmpeg with libfreetype
show_help() {
cat <<'EOF'
Usage:
title_one_line.sh -i INPUT -o OUTPUT --text "YOUR TEXT" [options]
Required:
-i, --input Input video
-o, --output Output video
--text Text to display (one line)
Timing:
--start Start time seconds (default: 30)
--end End time seconds (default: 34)
--fade-in Fade-in seconds (default: 0.6)
--fade-out Fade-out seconds (default: 0.6)
Style:
--fs Font size (default: 78)
--dy Vertical nudge in px (default: 0) # negative = up
--font Font family (FontConfig), e.g. "DejaVu Sans"
--fontfile Path to TTF/OTF (overrides --font)
--shadow 1 to add shadow, 0 to disable (default: 1)
--color Text color (default: white)
Encoding:
--crf x264 CRF (default: 18)
--preset x264 preset (default: medium)
Examples:
title_one_line.sh -i in.mp4 -o out.mp4 --text "ROSE ASH VILLAGE HALL presents"
title_one_line.sh -i in.mp4 -o out.mp4 --text "Summer Fête" --start 12 --end 18 --fs 90 --dy -30
EOF
}
# --- defaults ---
INPUT=""
OUTPUT=""
TEXT=""
START="30"
END="34"
FADEIN="0.6"
FADEOUT="0.6"
FS="78"
DY="0"
FONT=""
FONTFILE=""
SHADOW="1"
COLOR="white"
CRF="18"
PRESET="medium"
# --- parse args ---
[[ $# -eq 0 ]] && { show_help; exit 1; }
while [[ $# -gt 0 ]]; do
case "$1" in
-i|--input) INPUT="${2:-}"; shift 2;;
-o|--output) OUTPUT="${2:-}"; shift 2;;
--text) TEXT="${2:-}"; shift 2;;
--start) START="${2:-}"; shift 2;;
--end) END="${2:-}"; shift 2;;
--fade-in) FADEIN="${2:-}"; shift 2;;
--fade-out) FADEOUT="${2:-}"; shift 2;;
--fs) FS="${2:-}"; shift 2;;
--dy) DY="${2:-}"; shift 2;;
--font) FONT="${2:-}"; shift 2;;
--fontfile) FONTFILE="${2:-}"; shift 2;;
--shadow) SHADOW="${2:-}"; shift 2;;
--color) COLOR="${2:-}"; shift 2;;
--crf) CRF="${2:-}"; shift 2;;
--preset) PRESET="${2:-}"; shift 2;;
-h|--help) show_help; exit 0;;
*) echo "Unknown arg: $1"; echo; show_help; exit 1;;
esac
done
[[ -z "$INPUT" || -z "$OUTPUT" || -z "$TEXT" ]] && { echo "Error: -i, -o and --text are required."; exit 1; }
command -v ffmpeg >/dev/null 2>&1 || { echo "Error: ffmpeg not found."; exit 1; }
# Escape text for drawtext (backslash, colon, percent, and single quote)
esc() {
local s="$1"
s="${s//\\/\\\\}" # backslashes
s="${s//:/\\:}" # colons
s="${s//%/\\%}" # percent
s="${s//\'/\\\'}" # single quotes
echo "$s"
}
ETEXT="$(esc "$TEXT")"
# Font options: prefer fontfile, else family, else default
FONT_OPTS=""
if [[ -n "$FONTFILE" ]]; then
FONT_OPTS="fontfile='${FONTFILE}'"
elif [[ -n "$FONT" ]]; then
FONT_OPTS="font='${FONT}'"
fi
# Optional shadow for contrast
SHADOW_OPTS=""
if [[ "$SHADOW" == "1" ]]; then
SHADOW_OPTS=":shadowcolor=black@0.6:shadowx=2:shadowy=2"
fi
# Alpha expression: fade in, hold, fade out (commas escaped)
ALPHA="if(lt(t\\,${START})\\,0\\,if(lt(t\\,${START}+${FADEIN})\\,(t-${START})/${FADEIN}\\,if(lt(t\\,${END}-${FADEOUT})\\,1\\,if(lt(t\\,${END})\\,(${END}-t)/${FADEOUT}\\,0))))"
DT="drawtext=${FONT_OPTS}:text='${ETEXT}':fontcolor=${COLOR}:fontsize=${FS}${SHADOW_OPTS}:x=(w-text_w)/2:y=(h-text_h)/2+${DY}:alpha='${ALPHA}'"
VF="${DT}"
echo "Running:"
echo " ffmpeg -hide_banner -y -i '$INPUT' -vf \"$VF\" -c:v libx264 -crf $CRF -preset $PRESET -c:a copy '$OUTPUT'"
ffmpeg -hide_banner -y -i "$INPUT" -vf "$VF" -c:v libx264 -crf "$CRF" -preset "$PRESET" -c:a copy "$OUTPUT"
echo "Done: $OUTPUT"