Skip to content

Commit

Permalink
run(ffmpeg ...) -> ffmpeg_exe(...)
Browse files Browse the repository at this point in the history
Add FFMPEG.jl to Project.toml too.
  • Loading branch information
asinghvi17 committed Jul 13, 2019
1 parent 9075e77 commit b0241e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/Plots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import GeometryTypes
using Dates, Printf, Statistics, Base64, LinearAlgebra, Random
import SparseArrays: findnz

using FFMPEG

@reexport using RecipesBase
import RecipesBase: plot, plot!, animate
using Base.Meta
Expand Down
8 changes: 4 additions & 4 deletions src/animation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ function buildanimation(animdir::AbstractString, fn::AbstractString,
if variable_palette
# generate a colorpalette for each frame for highest quality, but larger filesize
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
# 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
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
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

show_msg && @info("Saved animation to ", fn)
Expand Down

0 comments on commit b0241e1

Please sign in to comment.