diff options
author | Jonas Smedegaard <dr@jones.dk> | 2017-04-13 10:15:12 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2017-04-13 10:53:30 +0200 |
commit | d62462fa43e10c5bccdc0f25c4ed5a26e2bfa2c8 (patch) | |
tree | e191e453329300be1096c5839e2a4c2b3e9110a7 /bin/decode+edit+encode | |
parent | 7fda1a3bd2a78dab92dfb6fdef9094b14aa16243 (diff) |
List audio before video.
Diffstat (limited to 'bin/decode+edit+encode')
-rwxr-xr-x | bin/decode+edit+encode | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/bin/decode+edit+encode b/bin/decode+edit+encode new file mode 100755 index 0000000..25ea997 --- /dev/null +++ b/bin/decode+edit+encode @@ -0,0 +1,28 @@ +#!/bin/sh + +set -e + +ITERATIONS=${1-1} # no looping by default + +HEIGHT=360 +BITRATE=500000 + +MOVIE=../src/omni/show0/earth.mp4 +LOGO=../../content/icon_small.png + +TMPMOVIE=../tmp/omni/show0/earth.webm + +mkdir -p $(dirname "$TMPMOVIE") + +# based on http://www.webmproject.org/docs/encoder-parameters/#real-time-cbr-encoding-and-streaming +# + loop-in-filter trick based on http://video.stackexchange.com/a/16933 +ffmpeg -threads auto -y -re \ + -f lavfi -i "movie=filename=$MOVIE:loop=$ITERATIONS, setpts=N/(FRAME_RATE*TB), scale=-1:$HEIGHT" \ + -i "$LOGO" -filter_complex 'overlay=main_w-overlay_w-20:main_h-overlay_h-20' \ + -an \ + -codec:v vp8 -quality realtime -deadline realtime -cpu-used 4 \ + -b:v "$BITRATE" -minrate "$BITRATE" -maxrate "$BITRATE" \ + -undershoot-pct 95 -bufsize $((6000*BITRATE/1000)) -rc_init_occupancy $((4000*BITRATE/1000)) \ + -max-intra-rate 0 \ + -qmin 4 -qmax 56 \ + -f webm "$TMPMOVIE" |