Skip to content
Snippets Groups Projects
Commit cebc758f authored by Alex Ellis's avatar Alex Ellis
Browse files

gif-maker sample


Signed-off-by: default avatarAlex Ellis <alexellis2@gmail.com>
parent e2a56b72
No related branches found
No related tags found
No related merge requests found
FROM alpine:3.6
RUN apk --no-cache add ffmpeg gifsicle curl \
&& curl -LS https://github.com/alexellis/faas/releases/download/0.5.6-alpha/fwatchdog > /usr/bin/fwatchdog \
&& chmod +x /usr/bin/fwatchdog \
&& apk del curl
WORKDIR /root/
COPY entry.sh .
ENV fprocess="./entry.sh"
CMD ["fwatchdog"]
gif-maker
=========
Converts a .mov QuickTime video to a .gif
Testing:
```
$ docker build -t alexellis/gif-maker .
$ faas-cli deploy --fprocess="./entry.sh" \
--image get-giffy --name gif-maker
# wait a little
$ curl http://localhost:8080/function/gif-maker --data-binary @$HOME/Desktop/screen1.mov > screen1.gif
```
Try to use a small cropped video around 5MB. Timeouts may need to be extended for larger videos
#!/bin/sh
export nano=`date +%s%N`
# -s 600x400
cat - > ./$nano.mov
ffmpeg -loglevel panic -i $nano.mov -vf scale=iw*.5:ih*.5 -pix_fmt rgb24 -r 20 -f gif - | gifsicle --optimize=3 --delay=3 > /dev/stdout \
&& rm $nano.mov
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment