run(ffmpeg ...) -> ffmpeg_exe(...)
Add FFMPEG.jl to Project.toml too.
This commit is contained in:
parent
9075e776f0
commit
b0241e19fe
@ -8,6 +8,8 @@ import GeometryTypes
|
|||||||
using Dates, Printf, Statistics, Base64, LinearAlgebra, Random
|
using Dates, Printf, Statistics, Base64, LinearAlgebra, Random
|
||||||
import SparseArrays: findnz
|
import SparseArrays: findnz
|
||||||
|
|
||||||
|
using FFMPEG
|
||||||
|
|
||||||
@reexport using RecipesBase
|
@reexport using RecipesBase
|
||||||
import RecipesBase: plot, plot!, animate
|
import RecipesBase: plot, plot!, animate
|
||||||
using Base.Meta
|
using Base.Meta
|
||||||
|
|||||||
@ -76,15 +76,15 @@ function buildanimation(animdir::AbstractString, fn::AbstractString,
|
|||||||
if variable_palette
|
if variable_palette
|
||||||
# generate a colorpalette for each frame for highest quality, but larger filesize
|
# generate a colorpalette for each frame for highest quality, but larger filesize
|
||||||
palette="palettegen=stats_mode=single[pal],[0:v][pal]paletteuse=new=1"
|
palette="palettegen=stats_mode=single[pal],[0:v][pal]paletteuse=new=1"
|
||||||
run(`ffmpeg -v 0 -framerate $fps -loop $loop -i $(animdir)/%06d.png -lavfi "$palette" -y $fn`)
|
ffmpeg_exe(`-v 0 -framerate $fps -loop $loop -i $(animdir)/%06d.png -lavfi "$palette" -y $fn`)
|
||||||
else
|
else
|
||||||
# generate a colorpalette first so ffmpeg does not have to guess it
|
# generate a colorpalette first so ffmpeg does not have to guess it
|
||||||
run(`ffmpeg -v 0 -i $(animdir)/%06d.png -vf "palettegen=stats_mode=diff" -y "$(animdir)/palette.bmp"`)
|
ffmpeg_exe(`-v 0 -i $(animdir)/%06d.png -vf "palettegen=stats_mode=diff" -y "$(animdir)/palette.bmp"`)
|
||||||
# then apply the palette to get better results
|
# then apply the palette to get better results
|
||||||
run(`ffmpeg -v 0 -framerate $fps -loop $loop -i $(animdir)/%06d.png -i "$(animdir)/palette.bmp" -lavfi "paletteuse=dither=sierra2_4a" -y $fn`)
|
ffmpeg_exe(` -v 0 -framerate $fps -loop $loop -i $(animdir)/%06d.png -i "$(animdir)/palette.bmp" -lavfi "paletteuse=dither=sierra2_4a" -y $fn`)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
run(`ffmpeg -v 0 -framerate $fps -loop $loop -i $(animdir)/%06d.png -pix_fmt yuv420p -y $fn`)
|
ffmpeg_exe(`-v 0 -framerate $fps -loop $loop -i $(animdir)/%06d.png -pix_fmt yuv420p -y $fn`)
|
||||||
end
|
end
|
||||||
|
|
||||||
show_msg && @info("Saved animation to ", fn)
|
show_msg && @info("Saved animation to ", fn)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user