最終更新 6 months ago

nv1t revised this gist 11 years ago. Go to revision

1 file changed, 1 insertion, 4 deletions

create_video.sh

@@ -16,8 +16,6 @@ set -x
16 16
17 17 FRAMERATE=24
18 18 RESOLUTION=800x600
19 -
20 - mkdir -p rename
21 19
22 20 # Rename the images into a sequence
23 21 # http://www.ralree.com/2008/08/06/renaming-files-sequentially-with-bash/
@@ -33,5 +31,4 @@ done
33 31
34 32 # Now create the video using ffmpeg
35 33 #cat rename/*.JPG | ffmpeg -f image2pipe -r $FRAMERATE -vcodec mjpeg -i - -vcodec libx264 out_$FRAMERATE.mp4
36 - ffmpeg -f image2 -r $FRAMERATE -i rename/IMG_%06d.JPG movie_$FRAMERATE.mp4
37 - rm -rf rename
34 + ffmpeg -f image2 -r $FRAMERATE -i rename/IMG_%06d.JPG movie_$FRAMERATE.mp4

nv1t revised this gist 11 years ago. Go to revision

1 file changed, 2 insertions, 1 deletion

create_video.sh

@@ -33,4 +33,5 @@ done
33 33
34 34 # Now create the video using ffmpeg
35 35 #cat rename/*.JPG | ffmpeg -f image2pipe -r $FRAMERATE -vcodec mjpeg -i - -vcodec libx264 out_$FRAMERATE.mp4
36 - ffmpeg -f image2 -r $FRAMERATE -i rename/IMG_%06d.JPG movie_$FRAMERATE.mp4
36 + ffmpeg -f image2 -r $FRAMERATE -i rename/IMG_%06d.JPG movie_$FRAMERATE.mp4
37 + rm -rf rename

nv1t revised this gist 11 years ago. Go to revision

1 file changed, 1 insertion, 2 deletions

create_video.sh

@@ -23,8 +23,7 @@ mkdir -p rename
23 23 # http://www.ralree.com/2008/08/06/renaming-files-sequentially-with-bash/
24 24 EII=1
25 25 # If sorting according to the file date, copy them using cp -a ../*.JPG ./
26 - for i in $(ls -tr *.JPG); do
27 - ls $i
26 + for i in $(ls -tr *.JPG); do
28 27 NEWNAME=IMG_$(printf "%06d" $EII).JPG
29 28 #echo Renaming $i to $NEWNAME
30 29 mv "${i}" "rename/${NEWNAME}"

nv1t revised this gist 11 years ago. Go to revision

1 file changed, 1 insertion, 1 deletion

create_video.sh

@@ -25,7 +25,7 @@ EII=1
25 25 # If sorting according to the file date, copy them using cp -a ../*.JPG ./
26 26 for i in $(ls -tr *.JPG); do
27 27 ls $i
28 - NEWNAME=IMG_`printf "%06d" $EII`.JPG
28 + NEWNAME=IMG_$(printf "%06d" $EII).JPG
29 29 #echo Renaming $i to $NEWNAME
30 30 mv "${i}" "rename/${NEWNAME}"
31 31 mogrify -resize $RESOLUTION "rename/${NEWNAME}"

nv1t revised this gist 11 years ago. Go to revision

1 file changed, 37 insertions

create_video.sh(file created)

@@ -0,0 +1,37 @@
1 + #!/bin/bash
2 +
3 + # This is a script to create a video from series of JPEG images
4 + # Call it in a folder full of JPEGs that you want to turn into a video.
5 + # Written on 2013-01-08 by Philipp Klaus <philipp.l.klaus →AT→ web.de>.
6 + # Check <https://gist.github.com/4572552> for newer versions.
7 + # Modified Version from: nv1t (coz of many image files)
8 +
9 + # Resources
10 + # * http://www.itforeveryone.co.uk/image-to-video.html
11 + # * http://spielwiese.la-evento.com/hokuspokus/index.html
12 + # * http://ffmpeg.org/trac/ffmpeg/wiki/Create%20a%20video%20slideshow%20from%20images
13 + # * http://wiki.ubuntuusers.de/FFmpeg
14 +
15 + set -x
16 +
17 + FRAMERATE=24
18 + RESOLUTION=800x600
19 +
20 + mkdir -p rename
21 +
22 + # Rename the images into a sequence
23 + # http://www.ralree.com/2008/08/06/renaming-files-sequentially-with-bash/
24 + EII=1
25 + # If sorting according to the file date, copy them using cp -a ../*.JPG ./
26 + for i in $(ls -tr *.JPG); do
27 + ls $i
28 + NEWNAME=IMG_`printf "%06d" $EII`.JPG
29 + #echo Renaming $i to $NEWNAME
30 + mv "${i}" "rename/${NEWNAME}"
31 + mogrify -resize $RESOLUTION "rename/${NEWNAME}"
32 + EII=$(($EII+1))
33 + done
34 +
35 + # Now create the video using ffmpeg
36 + #cat rename/*.JPG | ffmpeg -f image2pipe -r $FRAMERATE -vcodec mjpeg -i - -vcodec libx264 out_$FRAMERATE.mp4
37 + ffmpeg -f image2 -r $FRAMERATE -i rename/IMG_%06d.JPG movie_$FRAMERATE.mp4
Newer Older