Ticket #443: still2mov.sh

File still2mov.sh, 795 bytes (added by nichot20, 5 years ago)

script to generate outputs using varying values of -color_range

Line 
1#! /bin/bash
2
3# looped still frame to yuv mov o/p for
4# color_range testing
5
6# check existence of source
7if [ $# -lt 1 ] ; then
8echo usage $0 input file
9exit 1
10elif [ ! -e "$1" ] ; then
11echo Error: Source file doesn not exist
12exit 1
13fi
14
15# set up coding parameters
16in_file=$1
17tmp=$(basename $1)
18tmp=${tmp%.*} #strip random file extension
19#range="0" # auto
20#range="1" # 16-235
21#range="2" # 0-255
22
23for range in 0 1 2
24do
25# range output
26out_file=${tmp}.${range}.avi
27ffmpeg -v 9 -loglevel 99  -f image2 -loop 1 -i $1 -t 5 -vcodec rawvideo -pix_fmt uyvy422 -color_range $range -vtag 2vuy -an -y "$out_file"
28
29# range input
30out_file=${range}.${tmp}.avi
31ffmpeg -v 9 -loglevel 99  -f image2 -loop 1 -color_range $range -i $1 -t 5 -vcodec rawvideo -pix_fmt uyvy422 -vtag 2vuy -an -y "$out_file"
32
33done
34exit 0