update recording.sh
parent
6e73e65dfc
commit
ca5e405a7e
|
@ -18,6 +18,7 @@ pub fn record(app: &App, frame: &Frame) {
|
||||||
// Capture all frames to a directory called `/<path_to_nannou>/nannou/simple_capture`.
|
// Capture all frames to a directory called `/<path_to_nannou>/nannou/simple_capture`.
|
||||||
.join("recordings")
|
.join("recordings")
|
||||||
.join(app.exe_name().unwrap())
|
.join(app.exe_name().unwrap())
|
||||||
|
.join("frames")
|
||||||
// Name each file after the number of the frame.
|
// Name each file after the number of the frame.
|
||||||
.join(format!("{:03}", frame.nth()))
|
.join(format!("{:03}", frame.nth()))
|
||||||
// The extension will be PNG. We also support tiff, bmp, gif, jpeg, webp and some others.
|
// The extension will be PNG. We also support tiff, bmp, gif, jpeg, webp and some others.
|
||||||
|
|
|
@ -7,8 +7,9 @@ if [[ -z $1 ]]; then
|
||||||
echo "example:"
|
echo "example:"
|
||||||
echo -e "\t$0 packagename"
|
echo -e "\t$0 packagename"
|
||||||
else
|
else
|
||||||
rm -rf "recordings/$1"
|
rm -rf "recordings/frames/$1"
|
||||||
cargo run --release --package $1 -- -record
|
cargo run --release --package $1 -- -record
|
||||||
ffmpeg -framerate 60 -i "recordings/$1/%03d.png" -pix_fmt yuv420p "recordings/$1.mp4"
|
filename="video$(( $(find recordings/$1/videos -type f -exec basename -s .mp4 {} \; | sed 's/^video//' | sort -n | tail -n1) + 1)).mp4"
|
||||||
|
ffmpeg -framerate 60 -i "recordings/$1/frames/%03d.png" -pix_fmt yuv420p "recordings/$1/videos/$filename"
|
||||||
echo "done"
|
echo "done"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue