Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify loudness report #166

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions makebroadcast
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ MIDDLEOPTIONS+=(-map "[with_slate_video]" -map "[with_slate_stereo1]" -map "[wit

_run_critical_event ffmpeg "${INPUTOPTIONS[@]}" "${FFMPEGINPUT[@]}" "${MIDDLEOPTIONS[@]}" "${OUTPUT}"
echo
_lookup_final_loudness
_summarize_make
_deliver_output "${MAKEBROADCAST_DELIVERY_EMAIL_TO}"
_log -e
Expand Down
25 changes: 20 additions & 5 deletions mmfunctions
Original file line number Diff line number Diff line change
Expand Up @@ -699,11 +699,11 @@ _email_delivery(){
if [[ -f "${INGESTLOG}" ]] ; then
FROMLOG="Operator: $(_readingestlog "operator")\n
Processing Computer: $(_readingestlog "computer_name")
Audio True Peak (dBTP): $(_readingestlog "measured_true_peak")
Integrated Loudness (LUFS): $(_readingestlog "r128_integrated_loudness")
Audio True Peak (dBTP): $(_readingestlog "output_measured_true_peak")
Integrated Loudness (LUFS): $(_readingestlog "output_r128_integrated_loudness")
Loudness Adjustment (LUFS): $(_readingestlog "loudness_adjustment")
Loudness Range (LU): $(_readingestlog "r128_loudness_range")
Threshold (LUFS) : $(_readingestlog "measured_threshold")
Loudness Range (LU): $(_readingestlog "output_r128_loudness_range")
Threshold (LUFS) : $(_readingestlog "output_measured_threshold")
Out of Phase Audio Ranges: $(_readingestlog "Out_of_phase_audio_ranges")"
fi
echo -e "Subject: [delivery] $(basename "${OUTPUT}")\n
Expand Down Expand Up @@ -1435,7 +1435,22 @@ _prep_volume_adjustment(){
_get_volume_adjustment "${SOURCEFILE}"
fi
_report -dt "Integrated loudness for $(basename "${INPUT_MOVIE}") is ${measured_I} LUFS. Reference is -24 LUFS. Will adjust by ${LOUD_ADJ} LUFS"
_add_audio_filter "loudnorm=measured_I=${measured_I}:measured_LRA=${measured_LRA}:measured_TP=${measured_TP}:measured_thresh=${measured_thresh}:offset=${target_offset}:linear=true:print_format=summary"
_add_audio_filter "loudnorm=measured_I=${measured_I}:measured_LRA=${measured_LRA}:measured_TP=${measured_TP}:measured_thresh=${measured_thresh}:offset=${target_offset}:linear=true:print_format=json"
fi
}

_lookup_final_loudness(){
FFMPEGLOG=$(ls -t "${LOGDIR}" | grep "${0}" | head -n 1)
PARSE_FOR_LOUDNESS=$(cat "${LOGDIR}/${FFMPEGLOG}")
output_i=$(echo "${PARSE_FOR_LOUDNESS}" | grep "output_i" | awk -F\" '{print $4}')
output_lra=$(echo "${PARSE_FOR_LOUDNESS}" | grep "output_lra" | awk -F\" '{print $4}')
output_tp=$(echo "${PARSE_FOR_LOUDNESS}" | grep "output_tp" | awk -F\" '{print $4}')
output_thresh=$(echo "${PARSE_FOR_LOUDNESS}" | grep "output_thresh" | awk -F\" '{print $4}')
if [[ -f "${INGESTLOG}" ]] ; then
_writeingestlog "output_r128_integrated_loudness" "${output_i}"
_writeingestlog "output_r128_loudness_range" "${output_lra}"
_writeingestlog "output_measured_true_peak" "${output_tp}"
_writeingestlog "output_measured_threshold" "${output_thresh}"
fi
}

Expand Down