diff options
| -rwxr-xr-x | transcode.sh | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/transcode.sh b/transcode.sh index b3ced55..b7d19ae 100755 --- a/transcode.sh +++ b/transcode.sh @@ -1084,6 +1084,18 @@ replace_original() { # ENCODING ############################################################################### +# Print metadata collected earlier in encode_one(). +# Intentionally reads encode_one() locals via Bash dynamic scoping. +encode_one_print_metadata() { + verbose "Video stream:" "$VIDEO_STREAM" + verbose "Input codec:" "$input_codec" + verbose "Input pixel format:" "$input_pixel_format" + verbose "Output pixel format:" "$output_pixel_format" + verbose "Input frame rate:" "$input_frame_rate" + verbose "Input FPS:" "$input_fps" + verbose "Output GOP size:" "$output_gop_size" +} + # Encode a single media file according to PRESET_NAME. # # Arguments: @@ -1313,13 +1325,7 @@ encode_one() { if [[ $DRY_RUN -eq 1 ]]; then msg "DRY RUN:" "Would encode with preset $PRESET_NAME" - verbose "Video stream:" "$VIDEO_STREAM" - verbose "Input codec:" "$input_codec" - verbose "Input pixel format:" "$input_pixel_format" - verbose "Output pixel format:" "$output_pixel_format" - verbose "Input frame rate:" "$input_frame_rate" - verbose "Input FPS:" "$input_fps" - verbose "Output GOP size:" "$output_gop_size" + encode_one_print_metadata verbose "Command:" "${encode_cmd[*]}" return $EXIT_OK fi @@ -1329,6 +1335,7 @@ encode_one() { # --------------------------------------------------------------------------- msg "Encoding:" "$input_file" + encode_one_print_metadata if nice -n "$NICE_VALUE" "${encode_cmd[@]}"; then # Integrity verification: confirm the encoded output is a valid, playable |
