Skip to content

Commit

Permalink
makebroadcast: fix intime testing and add adjusted for start_time
Browse files Browse the repository at this point in the history
  • Loading branch information
dericed committed Aug 7, 2014
1 parent 8443529 commit 3a7df99
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions makebroadcast
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,11 @@ while [ "${*}" != "" ] ; do
if [[ -f "${ingestlog}" ]] ; then
intime=$(grep "^intime:" "${ingestlog}" | cut -d: -f2 | sed 's/ //g')
outtime=$(grep "^outtime:" "${ingestlog}" | cut -d: -f2 | sed 's/ //g')
if [[ "${intime}" =~ "^[0-9.]+$" -a "${outtime}" =~ "^[0-9]+$" ]] ; then
if [[ -z $(echo "${intime}" | grep -v "^[0-9.]*$") && -z $(echo "${outtime}" | grep -v "^[0-9.]*$") ]] ; then
report -dt "ATTENTION: Transcoding will use intime (${intime}) and/or outtime (${outtime}) during transcoding."
middleoptions+=(-ss "${intime}")
start_time=$(ffprobe "${sourcefile}" -show_entries format=start_time -of compact | cut -d= -f2)
intime_adj=$(echo "$intime - $start_time" | bc)
middleoptions+=(-ss "${intime_adj}")
middleoptions+=(-to "${outtime}")
else
report -w "WARNING: intime (${intime}) and/or outtime (${outtime}) are not numbers, skipping."
Expand Down

0 comments on commit 3a7df99

Please sign in to comment.