Skip to content

Commit

Permalink
improve gif generation
Browse files Browse the repository at this point in the history
  • Loading branch information
ufechner7 committed Sep 29, 2024
1 parent 85ad19d commit 8350bd4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion video/export_gif.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ mp4name = joinpath(folder, "Tether.mp4")
A = Array{Array{RGB{Normed{UInt8,8}},2},1}()
files = readdir(folder)
pngfiles = filter(file->(occursin.("png",file)), files )
rm(gifname, force=true)
rm(mp4name, force=true)

FFMPEG.ffmpeg_exe(`-framerate $(framerate) -f image2 -i $(folder)/img-%4d.png -vf palettegen -y $(gifname)`)
FFMPEG.ffmpeg_exe(`-framerate $(framerate) -f image2 -i $(folder)/img-%4d.png -c:v libx264 -pix_fmt yuv420p -y $(mp4name)`)
FFMPEG.ffmpeg_exe(`-i $(mp4name) -filter_complex "[0]split[a][b]; [a]palettegen[palette]; [b][palette]paletteuse" -y $(gifname)`)

println("\nGif file $(gifname) created!")
println("Mp4 file $(mp4name) created!")

0 comments on commit 8350bd4

Please sign in to comment.