Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grab bag of incomplete features/fixes #1

Open
wants to merge 81 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
060595f
bunch o stuff (document in pr please)
andykais Sep 30, 2021
65ff32e
typescript assert function
andykais Oct 1, 2021
68044ae
dedupe parsers
andykais Oct 1, 2021
2fdef32
fully declare new schema in zod
andykais Oct 1, 2021
8dccb0f
add easy-win transformations
andykais Oct 1, 2021
771f14f
refactoring cli, render refactor in progress
andykais Oct 1, 2021
535277a
cli impl complete
andykais Oct 26, 2021
7f85ab2
file watcher handle weird neovim saving
andykais Oct 27, 2021
da7e378
probe.zod.ts complete
andykais Oct 28, 2021
17932b5
refactor geometry background size
andykais Oct 28, 2021
9ad9ec9
captions can draw accurate background colors
andykais Oct 30, 2021
0d75be3
output to cwd
andykais Nov 1, 2021
e611185
always set 'relative_to'
andykais Nov 2, 2021
6d2ec11
watch command handles written removed files
andykais Nov 28, 2021
b9aa4ef
max width/height logic
andykais Nov 30, 2021
2788745
temp padding, font backgrounds
andykais Feb 2, 2022
8ced04c
font logic implemented!
andykais Feb 16, 2022
c1706ee
temp geometry commit
andykais Feb 16, 2022
761e01c
fix padding centering
andykais Feb 16, 2022
644d9c3
temp ffmpeg builder classes
andykais Feb 17, 2022
59f29d8
temp perf logging & caption caching
andykais Feb 17, 2022
a34fe60
impl crop, clip builder (crop needs to influence scale)
andykais Feb 18, 2022
e9ec4fb
crop & layout work well in tandem
andykais Feb 18, 2022
87dd2e7
impl timeline
andykais Feb 19, 2022
d125e4f
fix issue where crop & scale could not be used on the same clip
andykais Feb 22, 2022
f6916ce
temp timeline recursion
andykais Mar 6, 2022
2b9970e
impl timeline logic
andykais Mar 8, 2022
d5baa09
fix timeline 'stop' logic, fix rotated aspect ratio logic
andykais Mar 8, 2022
0b4694f
fix keypoints, add ffmpeg progress bar, add keypoint allow_* constraints
andykais Mar 15, 2022
fc5a3b6
impl keypoints for trim.stop & timeline offsets
andykais Mar 15, 2022
982b290
impl audio on video
andykais Mar 16, 2022
7451161
impl framerate, fix sample frame on image clips
andykais Mar 16, 2022
8fa359c
fix image timelines & keypoints
andykais Mar 31, 2022
ce7b917
support keypoint offsets
andykais Mar 31, 2022
9987811
fix caption duration not carrying over
andykais Apr 20, 2022
b554f45
fix stop keypoint
andykais May 3, 2022
655b8ba
temp commit
andykais Nov 1, 2022
ee33698
impl: (temp) text outline, size.background_color, dot notation
andykais Jul 1, 2023
a7a42e2
impl: chromakey, refactor builders
andykais Jul 1, 2023
fe662a8
button up tests, fix timeline bug
andykais Jul 12, 2023
c9862d5
http -> https dependency
andykais Jul 12, 2023
ce50911
strip path resolution out of template parser
andykais Jul 12, 2023
c3fba25
clip.file -> clip.source
andykais Jul 12, 2023
c9c1cf2
clips input is a map
andykais Jul 12, 2023
5a93c4a
captions input is a map
andykais Jul 12, 2023
816e65f
fix small caption bug
andykais Jul 13, 2023
7b7d997
remove console.log
andykais Jul 13, 2023
2422430
add min/max width & height to layouts
andykais Jul 13, 2023
73fe41e
add border radius to clips
andykais Jul 14, 2023
1ea1d4e
fix bug in text generation layout
andykais Jul 14, 2023
04bf3f5
fix small caption bug
andykais Jul 14, 2023
7f50791
remove log lines, added transform instruction
andykais Mar 8, 2024
3a502ae
reorg keypoints
andykais Mar 19, 2024
049c53f
attempt to create rounded border _after_ cropping
andykais Oct 22, 2024
c51d19e
refactor: fix up for deno 2 (pt 1)
andykais Dec 11, 2024
05a8c49
refactor: fix up for deno 2 (pt 2), template clips should support arrays
andykais Jan 6, 2025
e816eb0
Merge branch 'temp-work-branch' of github.com:andykais/ffmpeg-templat…
andykais Jan 6, 2025
c075334
refactor: fix cli tests pt 1
andykais Jan 8, 2025
877e4cb
refactor: all tests passing
andykais Jan 8, 2025
49214d6
refactor: move all imports to import maps
andykais Jan 8, 2025
cb366ac
add ci tests
andykais Jan 8, 2025
5227644
fix(ci): include ffmpeg package
andykais Jan 8, 2025
f2b1d0e
debug(ci): log memory
andykais Jan 8, 2025
b7a6978
debug(ci): log memory usage between ci steps
andykais Jan 8, 2025
8900723
fix(ci): fix free command
andykais Jan 8, 2025
b9e7811
debug(ci): log file size
andykais Jan 8, 2025
32109dc
fix(ci): implement file assertions manually
andykais Jan 8, 2025
7adfcf2
debug(ci): add uterm session for ssh'ing
andykais Jan 8, 2025
be76289
debug(ci): add tmate session becaues upterm seems to suck
andykais Jan 8, 2025
3844d7b
refactor: drop deprecated historical implementations
andykais Jan 9, 2025
0bce29f
refactor: rename new implementation (drop .zod)
andykais Jan 9, 2025
8fddb8b
refactor: rename new implementation (drop .zod) pt 2
andykais Jan 9, 2025
89f2aa5
debug(ci): artifact upload
andykais Jan 9, 2025
2650605
debug: test ffmpeg -bitexact
andykais Jan 29, 2025
235a35e
debug: only run one test
andykais Jan 29, 2025
3b498af
debug: artifact upload
andykais Jan 29, 2025
72c2e50
debug: try a few more options for consistency
andykais Jan 29, 2025
6c264a2
debug: temp log ffmpeg output
andykais Jan 29, 2025
65319ce
debug: try again
andykais Jan 29, 2025
d7825fa
attempt to keep pixel formats consistent
andykais Jan 30, 2025
5d7f762
attempt to keep scale algo consistent
andykais Jan 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: CI


on:
push:
branches: ["main"]
pull_request:
branches: ["main"]


permissions:
contents: read


env:
DENO_DIR: deno_dependency_cache
DENO_LOCKFILE: ${{ github.workspace }}/deno.lock


jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Setup Repo
uses: actions/checkout@v3

- name: Setup FFMPEG
uses: FedericoCarboni/setup-ffmpeg@v3
id: setup-ffmpeg
with:
ffmpeg-version: 7.0.1

- name: Setup Deno
uses: denoland/setup-deno@v2

- name: Cache Deno dependencies
uses: actions/cache@v4
with:
path: ${{ env.DENO_DIR }}
key: ${{ hashFiles(env.DENO_LOCKFILE) }}

# SSH into github machine for quick iterative debugging (note that this sort of sucks if you want to retrieve a file via ssh)
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3

- name: Test
run: deno task test

- name: run ffmpeg debug
if: always()
run: "./test/artifacts/render\\ image\\ with\\ zero\\ duration/ffmpeg.sh"

- uses: actions/upload-artifact@v4
if: always()
with:
path: "./test/artifacts/render image with zero duration/preview.jpg"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
ffmpeg-templates-projects
test/artifacts
samples
.vim
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
## Installation
Requires [ffmpeg](https://ffmpeg.org/download.html) and [deno](https://deno.land) >= 1.5.0
```bash
deno install --allow-read --allow-run --unstable -f https://raw.githubusercontent.com/andykais/ffmpeg-templates/main/ffmpeg-templates.ts
deno install --allow-read --allow-run=ffmpeg,ffprobe --unstable -f https://raw.githubusercontent.com/andykais/ffmpeg-templates/main/ffmpeg-templates.ts
```


Expand Down Expand Up @@ -192,3 +192,15 @@ ffmpeg-music-video <audio_file>
- audio visualizations to help with previews? https://www.youtube.com/watch?v=M58rc7cxl_s
- template.layers or template.stack or template.order to separate the vertical ordering from the timeline? Not necessary, but possibly more clear
- add CI testing (install ffmpeg via apt, or use a cache: https://stackoverflow.com/questions/59269850/caching-apt-packages-in-github-actions-workflow)
- make timeline a sort of query language, and give the clips a tag array field. timeline can have things like `:DIALOG` to string together a ton of font clips. This might also be solveable by using the "sub template" idea
- display tiny timeline strip in console reflecting timeline configuration. E.g.
```
____________________
| VIDEO_LEFT |
____________________
| VIDEO_RIGHT |
__________ ________
| TEXT_1 || TEXT_2 |
________
| TEXT_3 |
```
24 changes: 24 additions & 0 deletions deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"tasks": {
"test:watch": "deno test --watch --fail-fast --unstable-ffi --allow-read --allow-write --allow-run=ffprobe,ffmpeg --allow-env=DENO_SKIA_LOCAL,DENO_SKIA_PATH,DENO_DIR,XDG_CACHE_HOME,HOME,CANVAS_DISABLE_SYSTEM_FONTS --allow-ffi --allow-net=github.com,objects.githubusercontent.com"
"test": "deno test --fail-fast --unstable-ffi --allow-read --allow-write --allow-run=ffprobe,ffmpeg --allow-env=DENO_SKIA_LOCAL,DENO_SKIA_PATH,DENO_DIR,XDG_CACHE_HOME,HOME,CANVAS_DISABLE_SYSTEM_FONTS --allow-ffi --allow-net=github.com,objects.githubusercontent.com ./test/mod.test.ts"
},
"imports": {
"@detachhead/ts-helpers": "npm:@detachhead/[email protected]",
"@gfx/canvas": "jsr:@gfx/canvas@^0.5.8",
"@gfx/canvas-wasm": "jsr:@gfx/canvas-wasm@^0.4.2",
"@opensrc/deno-open": "jsr:@opensrc/deno-open@^1.0.0",
"@std/assert": "jsr:@std/assert@^1.0.11",
"@std/crypto": "jsr:@std/crypto@^1.0.3",
"@std/encoding": "jsr:@std/encoding@^1.0.6",
"@std/flags": "jsr:@std/flags@^0.224.0",
"@std/fs": "jsr:@std/fs@^1.0.8",
"@std/io": "jsr:@std/io@^0.225.0",
"@std/path": "jsr:@std/path@^1.0.8",
"@std/streams": "jsr:@std/streams@^1.0.8",
"@std/yaml": "jsr:@std/yaml@^1.0.5",
"@types/culori": "npm:@types/culori@^2.1.1",
"culori": "npm:culori@^4.0.1",
"zod": "npm:zod@^3.24.1",
}
}
Loading
Loading