diff options
author | EuAndreh <eu@euandre.org> | 2025-03-07 08:47:50 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2025-03-07 08:47:50 -0300 |
commit | 4de91fd04e4194e014c77cd9d1956bc5e7cfdab5 (patch) | |
tree | df70124d92762df63941b9e279bbc1a3b280f5fd | |
parent | bin/{live,process}: Assume we're already inside live/ (diff) | |
download | dotfiles-4de91fd04e4194e014c77cd9d1956bc5e7cfdab5.tar.gz dotfiles-4de91fd04e4194e014c77cd9d1956bc5e7cfdab5.tar.xz |
bin/process: Fix combined.webm by using "-f concat"
-rwxr-xr-x | bin/process | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/bin/process b/bin/process index fa96ef5..3fbcf81 100755 --- a/bin/process +++ b/bin/process @@ -9,12 +9,18 @@ FFMFLAGS = -y -hide_banner -loglevel warning .SUFFIXES: -.SUFFIXES: .mpd .webmx +.SUFFIXES: .mpd .webmx .txt .mpd.webmx: cd $(?D) && ffmpeg $(FFMFLAGS) -i $(<F) $(*F).webm touch $@ +.txt.webmx: + ffmpeg $(FFMFLAGS) -f concat -i $< -c copy $*.webm + mkdir -p processed/"`basename $(*D)`" + ln -f $*.webm processed/"`basename $(*D)`"/ + touch $@ + all: EOF @@ -23,15 +29,14 @@ EOF makefile_post() { cat <<'EOF' -sources.webmx = $(sources.mpd:.mpd=.webmx) +sources.webmx = $(sources.mpd:.mpd=.webmx) +combined.webmx = $(combined.txt:.txt=.webmx) -all: $(sources.webmx) $(combined.webmx) +all: $(sources.webmx) $(combined.txt) $(combined.webmx) -$(combined.webmx): - ffmpeg $(FFMFLAGS) `printf ' -i %s' $?` -c copy $*.webm - mkdir -p processed/"`basename $(*D)`" - ln -f $*.webm processed/"`basename $(*D)`"/ - touch $@ +$(combined.txt): + cd $(@D) && find */live.webm | LANG=POSIX.UTF-8 sort | \ + sed 's|^|file |' > $(@F) EOF } @@ -41,8 +46,8 @@ mpds() { mkdeps() { mpds | varlist 'sources.mpd' - mpds | cut -d/ -f1-2 | sed 's,$,/combined.webmx,' | uniq | - varlist 'combined.webmx' + mpds | cut -d/ -f1-2 | sed 's,$,/combined.txt,' | uniq | + varlist 'combined.txt' printf '\n' mpds | sed 's/^\(.*\)\.mpd$/\1.webmx:\t\1.mpd/' @@ -50,8 +55,11 @@ mkdeps() { printf '\n' mpds | sed 's/\.mpd$/.webm/' | awk -F/ '{ - printf "data/%s/combined.webmx:\t%s\n", $2, $0 + printf "data/%s/combined.txt:\t%s\n", $2, $0 }' + + mpds | xargs dirname | xargs dirname | uniq | + sed 's|^\(.*\)$|\1/combined.webm:\t\1combined.txt|' } |