Skip to content

Commit 9e19fd9

Browse files
committed
surpress output of ffmpeg
1 parent 2f69bc5 commit 9e19fd9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/movies_from_pics.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ using FFMPEG
99
export movie_from_images
1010

1111
"""
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)
1313
1414
The typical way to create animations with `Paraview` is to use the `Save Animation` option to save a series of `*.png` images.
1515
@@ -25,7 +25,7 @@ Optional options
2525
- `type`: type of movie that is created; possible options are:
2626
- `:mp4_default`: Default option that saves a well-compressed `mp4` movie that works well for us on ipad and embedded in a powerpoint presentation.
2727
- `:mov_hires`: Higher-resolution quicktime movie (larger filesize & not compatible with windows)
28-
28+
- `collect`: surpresses output of `FFMPEG` if `true` (default).
2929
"""
3030
function movie_from_images(; dir=pwd(), file=nothing, outfile=nothing, framerate=10, copy_to_current_dir=true, type=:mp4_default)
3131
curdir = pwd();
@@ -51,16 +51,16 @@ function movie_from_images(; dir=pwd(), file=nothing, outfile=nothing, framerate
5151
if type==:mp4_default
5252
# this produces an *.mp4 movie that looks good on an ipad
5353
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`
5555
elseif type==:mov_hires
5656
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`
5858
else
5959
error("unknown movie type $type")
6060
end
6161

6262
# run
63-
@ffmpeg_env run(cmd)
63+
FFMPEG.exe(cmd, collect = true)
6464

6565
result = joinpath(pwd(),outfile_ext)
6666
if copy_to_current_dir

0 commit comments

Comments
 (0)