Commit 445e2ce8 authored by gijs's avatar gijs

More efficient movie generation

parent 9016dd5a
# Transform SVG to PNG
PREVIOUS=""
for FILE in svg/*.svg
do
FILENAME=$(basename $FILE)
inkscape -z -e png/${FILENAME%.*}.png -w 1080 -h 1920 $FILE;
echo "PREVIOUS: ${PREVIOUS} FILE: ${FILENAME}"
DIFF=$(cmp "svg/${PREVIOUS}" "svg/${FILENAME}")
if [ "$PREVIOUS" != "" ] && [ "$DIFF" = "" ]
then
echo "Copy frame ${FILENAME}"
cp "png/${PREVIOUS%.*}.png" "png/${FILENAME%.*}.png"
else
inkscape -z -e png/${FILENAME%.*}.png -w 1080 -h 1920 $FILE;
PREVIOUS=$FILENAME
fi
done
ffmpeg -i png/%05d.png -c:v libx264 -vf fps=25 -pix_fmt yuv420p 1080x1920.mp4;
\ No newline at end of file
# Transform SVG to PNG
PREVIOUS=""
for FILE in svg/*.svg
do
FILENAME=$(basename $FILE)
inkscape -z -e png/${FILENAME%.*}.png -w 1920 -h 1080 $FILE;
echo "PREVIOUS: ${PREVIOUS} FILE: ${FILENAME}"
DIFF=$(cmp "svg/${PREVIOUS}" "svg/${FILENAME}")
if [ "$PREVIOUS" != "" ] && [ "$DIFF" = "" ]
then
echo "Copy frame ${FILENAME}"
cp "png/${PREVIOUS%.*}.png" "png/${FILENAME%.*}.png"
else
inkscape -z -e png/${FILENAME%.*}.png -w 1920 -h 1080 $FILE;
PREVIOUS=$FILENAME
fi
done
ffmpeg -i png/%05d.png -c:v libx264 -vf fps=25 -pix_fmt yuv420p 1920x1080.mp4;
\ No newline at end of file
# Transform SVG to PNG
PREVIOUS=""
for FILE in svg/*.svg
do
FILENAME=$(basename $FILE)
inkscape -z -e png/${FILENAME%.*}.png -w 1920 -h 2160 $FILE;
echo "PREVIOUS: ${PREVIOUS} FILE: ${FILENAME}"
DIFF=$(cmp "svg/${PREVIOUS}" "svg/${FILENAME}")
if [ "$PREVIOUS" != "" ] && [ "$DIFF" = "" ]
then
echo "Copy frame ${FILENAME}"
cp "png/${PREVIOUS%.*}.png" "png/${FILENAME%.*}.png"
else
inkscape -z -e png/${FILENAME%.*}.png -w 1920 -h 2160 $FILE;
PREVIOUS=$FILENAME
fi
done
ffmpeg -i png/%05d.png -c:v libx264 -vf fps=25 -pix_fmt yuv420p 1920x2160.mp4;
\ No newline at end of file
......@@ -9,8 +9,8 @@ import os.path
sources = [
('digital-city-poster-1080x1920.svg', '1080x1920'),
('digital-city-poster-1920x1080.svg', '1920x1080'),
('digital-city-poster-1920x2160.svg', '1920x2160')
# ('digital-city-poster-1920x1080.svg', '1920x1080'),
# ('digital-city-poster-1920x2160.svg', '1920x2160')
]
fps = 25
......@@ -64,6 +64,7 @@ def write_frame(f, svg, folder = ''):
.replace('viewbox', 'viewBox')
.replace('flowroot', 'flowRoot')
.replace('textpath', 'textPath')
.replace('startoffset', 'startOffset')
.replace('spreadmethod', 'spreadMethod')
.replace('clippath', 'clipPath'))
o.close()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment