Skip to content

Commit

Permalink
Remove target MB smear
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonjchen committed Oct 23, 2023
1 parent 891dfc8 commit e235d87
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions clip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,7 @@ VIDEO_RAW_OUTPUT=clip_raw.mkv
VIDEO_OUTPUT=$_arg_output
# Target an appropiate bitrate of filesize of 8MB for the video length
TARGET_MB=$_arg_target_mb
# Subtract a few megabyte to give some leeway for uploader limits
TARGET_BYTES=$((($TARGET_MB - 5) * 1024 * 1024))
TARGET_BYTES=$((($TARGET_MB) * 1024 * 1024))
TARGET_BITRATE=$(($TARGET_BYTES * 8 / $RECORDING_LENGTH))
TARGET_BITRATE_PLUS_SMEAR=$(($TARGET_BYTES * 8 / $RECORDING_LENGTH_PLUS_SMEAR))
VNC_PORT=$_arg_vnc
Expand Down
2 changes: 1 addition & 1 deletion ffmpeg_clip.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def make_ffmpeg_clip(
route_date = re.sub(r"^[^|]+\|", "", route)

# Target bitrate in bits per second (bps). Try to get close to the target file size.
target_bps = (target_mb - 5) * 8 * 1024 * 1024 // length_seconds
target_bps = (target_mb) * 8 * 1024 * 1024 // length_seconds
# Start seconds relative to the start of the concatenated video
start_seconds_relative = start_seconds % 60

Expand Down

0 comments on commit e235d87

Please sign in to comment.