Skip to content

Commit

Permalink
make gif optimisation optional
Browse files Browse the repository at this point in the history
  • Loading branch information
landmanbester committed Apr 18, 2024
1 parent 5ed0a53 commit 36b82fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions pfb/parser/smoovie.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ inputs:
The format to write movie out in.
gifs are usually better quality but can get quite large.
mp4 quality not currently great with streamjoy.
optimize:
dtype: bool
default: false
info:
To try and optimize the resulting gif.
Only possible if gifsicle is installed.

outputs:
{}
4 changes: 2 additions & 2 deletions pfb/workers/smoovie.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def plot_frame(frame):
if not res[1]:
results.pop(i)
nframeso = len(results)
print(f"Dropped {nframes - nframeso} epmpty frames")
print(f"Dropped {nframes - nframeso} empty frames in band {b}", file=log)
# get median rms
medrms = np.median([res[1] for res in results])

Expand All @@ -296,7 +296,7 @@ def plot_frame(frame):
results,
renderer=plot_frame,
intro_title=f"{opts.outname}-Band{b:04d}",
optimize=True,
optimize=opts.optimize,
threads_per_worker=1,
fps=opts.fps,
uri=f'{opts.outname}_band{b}_{idfy}.gif'
Expand Down

0 comments on commit 36b82fc

Please sign in to comment.