From 2efc8f4dda46334654b7c0ee159fdbd2031fa8f7 Mon Sep 17 00:00:00 2001 From: Thomas Nordquist Date: Wed, 20 Feb 2019 15:40:35 +0100 Subject: [PATCH] Record videos in 720p --- scripts/prepareVideo.sh | 12 +++++++----- scripts/uiTests.sh | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/scripts/prepareVideo.sh b/scripts/prepareVideo.sh index 624a810..a950343 100755 --- a/scripts/prepareVideo.sh +++ b/scripts/prepareVideo.sh @@ -1,5 +1,7 @@ #!/bin/bash -ffmpeg -s:v 1024x700 -r 20 -f rawvideo -pix_fmt yuv420p -i qrawvideorgb24.yuv app2.mp4 +DIMENSIONS="1280x720" + +ffmpeg -s:v $DIMENSIONS -r 20 -f rawvideo -pix_fmt yuv420p -i qrawvideorgb24.yuv app2.mp4 # The video starts with a few blank frames, we want to know when the stop ffprobe -f lavfi -i "movie=app2.mp4,blackdetect[out0]" -show_entries tags=lavfi.black_start,lavfi.black_end -of default=nw=1 -v quiet > ffmpeg_info @@ -9,16 +11,16 @@ END_OF_BLACK=`cat ffmpeg_info | grep end | head -n1 | cut -d'=' -f2` END_OF_BLACK=`awk "BEGIN {print $END_OF_BLACK+0.8; exit}"` # Trim black frames at start -ffmpeg -s:v 1024x700 -r 20 -f rawvideo -pix_fmt yuv420p -i qrawvideorgb24.yuv -ss $END_OF_BLACK app.mp4 +ffmpeg -s:v $DIMENSIONS -r 20 -f rawvideo -pix_fmt yuv420p -i qrawvideorgb24.yuv -ss $END_OF_BLACK app.mp4 # Generate gif palette -ffmpeg -y -s:v 1024x700 -r 20 -f rawvideo -pix_fmt yuv420p -i qrawvideorgb24.yuv -vf fps=10,scale=1024:-1:flags=lanczos,palettegen palette1024.png +ffmpeg -y -s:v $DIMENSIONS -r 20 -f rawvideo -pix_fmt yuv420p -i qrawvideorgb24.yuv -vf fps=10,scale=1024:-1:flags=lanczos,palettegen palette1024.png # Create gif -ffmpeg -s:v 1024x700 -r 20 -f rawvideo -pix_fmt yuv420p -i qrawvideorgb24.yuv -i palette1024.png -ss $END_OF_BLACK -filter_complex "fps=10,scale=1024:-1:flags=lanczos[x];[x][1:v]paletteuse" app1024.gif +ffmpeg -s:v $DIMENSIONS -r 20 -f rawvideo -pix_fmt yuv420p -i qrawvideorgb24.yuv -i palette1024.png -ss $END_OF_BLACK -filter_complex "fps=10,scale=1024:-1:flags=lanczos[x];[x][1:v]paletteuse" app720.gif # Clean up rm ffmpeg_info palette*.png qrawvideorgb24.yuv mv app.mp4 ui-test.mp4 -mv app1024.gif ui-test.gif +mv app720.gif ui-test.gif diff --git a/scripts/uiTests.sh b/scripts/uiTests.sh index 65e121c..905346d 100755 --- a/scripts/uiTests.sh +++ b/scripts/uiTests.sh @@ -9,7 +9,7 @@ function finish { trap finish EXIT -DIMENSIONS="1024x700" +DIMENSIONS="1280x720" SCR=99 # Start new window manager Xvfb :$SCR -screen 0 "$DIMENSIONS"x24 -ac &