Skip to content

Commit

Permalink
grep more specifically
Browse files Browse the repository at this point in the history
  • Loading branch information
dericed committed Jan 15, 2016
1 parent a11cd47 commit 0e6edf8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions barsandtoner
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
#!/bin/bash

get_width(){
width=$(ffprobe "$1" -show_streams -select_streams v:0 2> /dev/null | grep width= | cut -d = -f 2)
width=$(ffprobe "$1" -show_streams -select_streams v:0 2> /dev/null | grep "^width=" | cut -d = -f 2)
}

get_height(){
height=$(ffprobe "$1" -show_streams -select_streams v:0 2> /dev/null | grep height= | cut -d = -f 2)
height=$(ffprobe "$1" -show_streams -select_streams v:0 2> /dev/null | grep "^height=" | cut -d = -f 2)
}

get_framerate(){
framerate=$(ffprobe "$1" -show_streams -select_streams v:0 2> /dev/null | grep r_frame_rate= | cut -d = -f 2)
framerate=$(ffprobe "$1" -show_streams -select_streams v:0 2> /dev/null | grep "^r_frame_rate=" | cut -d = -f 2)
}

get_channels(){
channels=$(ffprobe "$1" -show_streams -select_streams a:0 2> /dev/null | grep channels= | cut -d = -f 2)
channels=$(ffprobe "$1" -show_streams -select_streams a:0 2> /dev/null | grep "^channels=" | cut -d = -f 2)
}

get_sar(){
sar=$(ffprobe "$1" -show_streams -select_streams v:0 2> /dev/null | grep sample_aspect_ratio= | cut -d = -f 2 | sed 's|:|/|g')
sar=$(ffprobe "$1" -show_streams -select_streams v:0 2> /dev/null | grep "^sample_aspect_ratio=" | cut -d = -f 2 | sed 's|:|/|g')
if [ "$sar" = "0/1" ] ; then
sar="1/1"
fi
Expand Down

0 comments on commit 0e6edf8

Please # to comment.