@@ -9,7 +9,7 @@ using FFMPEG
9
9
export movie_from_images
10
10
11
11
"""
12
- movie_from_images(; dir=pwd(), file=nothing, outfile=nothing, framerate=10, copy_to_current_dir=true, type=:mp4_default)
12
+ movie_from_images(; dir=pwd(), file=nothing, outfile=nothing, framerate=10, copy_to_current_dir=true, type=:mp4_default, collect=true )
13
13
14
14
The typical way to create animations with `Paraview` is to use the `Save Animation` option to save a series of `*.png` images.
15
15
@@ -25,7 +25,7 @@ Optional options
25
25
- `type`: type of movie that is created; possible options are:
26
26
- `:mp4_default`: Default option that saves a well-compressed `mp4` movie that works well for us on ipad and embedded in a powerpoint presentation.
27
27
- `:mov_hires`: Higher-resolution quicktime movie (larger filesize & not compatible with windows)
28
-
28
+ - `collect`: surpresses output of `FFMPEG` if `true` (default).
29
29
"""
30
30
function movie_from_images (; dir= pwd (), file= nothing , outfile= nothing , framerate= 10 , copy_to_current_dir= true , type= :mp4_default )
31
31
curdir = pwd ();
@@ -51,16 +51,16 @@ function movie_from_images(; dir=pwd(), file=nothing, outfile=nothing, framerate
51
51
if type== :mp4_default
52
52
# this produces an *.mp4 movie that looks good on an ipad
53
53
outfile_ext = outfile* " .mp4"
54
- cmd = ` $ffmpeg -y -framerate $framerate -f image2 -i $file .%0$(le) d.$fileext -vf pad="""width=ceil(iw/2)*2:height=ceil(ih/2)*2""" -f mp4 -vcodec libx264 -pix_fmt yuv420p $outfile_ext `
54
+ cmd = ` -y -framerate $framerate -f image2 -i $file .%0$(le) d.$fileext -vf pad="""width=ceil(iw/2)*2:height=ceil(ih/2)*2""" -f mp4 -vcodec libx264 -pix_fmt yuv420p $outfile_ext `
55
55
elseif type== :mov_hires
56
56
outfile_ext = outfile* " .mov"
57
- cmd = ` $ffmpeg -y -f image2 -framerate $framerate -i $file .%0$(le) d.$fileext -c:v prores_ks -profile:v 1 $outfile_ext `
57
+ cmd = ` -y -f image2 -framerate $framerate -i $file .%0$(le) d.$fileext -c:v prores_ks -profile:v 1 $outfile_ext `
58
58
else
59
59
error (" unknown movie type $type " )
60
60
end
61
61
62
62
# run
63
- @ffmpeg_env run (cmd)
63
+ FFMPEG . exe (cmd, collect = true )
64
64
65
65
result = joinpath (pwd (),outfile_ext)
66
66
if copy_to_current_dir
0 commit comments