Fix sunrise output filename to reflect SUNRISE_TARGET_SECS from conf
The output video was always named -sunrise-10s.mp4 regardless of the configured duration. Both sunrise_video.10s.sh and sunrise2mm.py now derive the filename from SUNRISE_TARGET_SECS so changing it in conf produces correctly named files that the uploader still finds. https://claude.ai/code/session_01C4jbd3waXG3eKZYbGUjLUQ
This commit is contained in:
@@ -112,15 +112,14 @@ total_seconds=$(($hours * 3600 + $minutes * 60 + $seconds)) # Convert to total
|
||||
|
||||
target_duration=$SUNRISE_TARGET_SECS
|
||||
|
||||
# Calculate the speed-up factor to make the video fit into the target duration of 10 seconds
|
||||
speed_up_factor=$(echo "scale=3; $total_seconds / $target_duration" | bc)
|
||||
echo "Calculated speed-up factor: $speed_up_factor"
|
||||
|
||||
# Output filename for the second movie (speed-adjusted)
|
||||
final_video="$output_dir/$current_date-sunrise-10s.mp4"
|
||||
final_video="$output_dir/$current_date-sunrise-${SUNRISE_TARGET_SECS}s.mp4"
|
||||
|
||||
# Apply the speed adjustment using the setpts filter
|
||||
echo "Adjusting video speed to target duration of 10 seconds..."
|
||||
echo "Adjusting video speed to ${SUNRISE_TARGET_SECS}s..."
|
||||
ffmpeg -i "$first_movie" -filter:v "setpts=PTS/$speed_up_factor" -y "$final_video"
|
||||
|
||||
# Check the duration of the adjusted video
|
||||
|
||||
Reference in New Issue
Block a user