Skip to content

Commit

Permalink
add broadcast_copy type
Browse files Browse the repository at this point in the history
  • Loading branch information
dericed committed Mar 31, 2020
1 parent 9baa38c commit 3fbd8d5
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
19 changes: 18 additions & 1 deletion makebroadcast
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,24 @@ _usage(){
_report -d "makebroadcast is an alias for the updated function makederiv (options below)."
_report -d "You can create a derivative file suitable for broadcast with makederiv by typing: 'makederiv -T broadcast [options] [input]'."
_report -d "Or continue to use makebroadcast using the valid options below."
_report -d " -c This flag will cause makebroadcast to simply copy audiovisual data from the input to output. For instance"
_report -d " makebroadcast -c -I 00:00:05.000 -O 00:00:10.000 file.mov"
_report -d " will copy from teh 5th to 10th second of file.mov to a new file called file_copy.mov"
"${SCRIPTDIR}/makederiv" -h
exit
}
[ "${#}" = 0 ] && _usage
"${SCRIPTDIR}/makederiv" -T broadcast "${@}"

while getopts ":ch" OPT ; do
case "${OPT}" in
c) CUT="Y" ;;
h) _usage ;;
:) echo "Option -${OPTARG} requires an argument" ; _writeerrorlog "makederiv" "The option selected required an argument and none was provided. The script had to exit." ; exit 1 ;;
esac
done

if [[ "${CUT}" == "Y" ]] ; then
"${SCRIPTDIR}/makederiv" -T broadcast_copy "${@}"
else
"${SCRIPTDIR}/makederiv" -T broadcast "${@}"
fi
18 changes: 18 additions & 0 deletions makederiv
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ _usage(){
echo "Usage: $(basename "${0}") [ -d /path/to/deliver/to/ ] fileorpackage1 [ fileorpackage2 ...]"
echo " -T derivative (specify a derivative video type:)"
echo " broadcast (mov) for broadcast"
echo " broadcast_copy (mov) for broadcast"
echo " prores (mov) for editing"
echo " youtube (mp4) for uploading"
echo " resourcespace (mp4) for uploading to resourcespace"
Expand Down Expand Up @@ -91,6 +92,10 @@ if [[ "${OUTPUT_TYPE}" == "broadcast" ]] ; then
if [[ "${ADDSLATE}" = "Y" ]]; then
SUFFIX="_SLATE"
fi
elif [[ "${OUTPUT_TYPE}" == "broadcast_copy" ]] ; then
EXTENSION="mov"
RELATIVEPATH=""
SUFFIX="_COPY"
elif [[ "${OUTPUT_TYPE}" == "prores" ]] ; then
EXTENSION="mov"
RELATIVEPATH="objects/access/prores"
Expand Down Expand Up @@ -437,6 +442,16 @@ while [[ "${@}" != "" ]] ; do
fi
_add_video_filter "format=yuv422p"
_add_video_filter "lut=y=if(gt(val\,235)\,235\,val):u=if(gt(val\,235)\,235\,val):v=if(gt(val\,235)\,235\,val)"
elif [[ "${OUTPUT_TYPE}" == "broadcast_copy" ]] ; then
MIDDLEOPTIONS+=(-map 0:v)
MIDDLEOPTIONS+=(-c:v copy)
_get_format "${SOURCEFILE}"
if [[ "${FORMAT}" == "mxf" ]] ; then
metadata_option="-metadata"
else
metadata_option="-metadata:s:v:0"
fi
MIDDLEOPTIONS+=("$metadata_option" timecode=00:00:00.00)
elif [[ "${OUTPUT_TYPE}" == "prores" ]] ; then
MIDDLEOPTIONS+=(-map 0:v)
MIDDLEOPTIONS+=(-c:v prores_ks)
Expand Down Expand Up @@ -538,6 +553,9 @@ while [[ "${@}" != "" ]] ; do
MIDDLEOPTIONS+=(-acodec pcm_s24be)
MIDDLEOPTIONS+=(-ar 48k)
_get_audio_mapping -bv "${SOURCEFILE}"
elif [[ "${OUTPUT_TYPE}" == "broadcast_copy" ]] ; then
MIDDLEOPTIONS+=(-map 0:a)
MIDDLEOPTIONS+=(-c:a copy)
elif [[ "${OUTPUT_TYPE}" == "prores" ]] ; then
MIDDLEOPTIONS+=(-map 0:a)
MIDDLEOPTIONS+=(-c:a pcm_s16le)
Expand Down

0 comments on commit 3fbd8d5

Please sign in to comment.