• 0 Posts
  • 12 Comments
Joined 1 year ago
cake
Cake day: June 13th, 2023

help-circle

  • Requires ffmpeg and imagemagick

    #!/bin/bash
    
    # Check if input video file is provided and exists
    if [ $# -lt 1 ]; then
        echo "Usage: $0 <input_video>"
        exit 1
    fi
    
    input_video="$1"
    
    if [ ! -f "$input_video" ]; then
        echo "Error: Input video file not found."
        exit 1
    fi
    
    # Get video duration in seconds (floating-point)
    duration=$(ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "$input_video")
    
    # Check if the duration was successfully extracted
    if [ -z "$duration" ]; then
        echo "Error: Could not retrieve video duration."
        exit 1
    fi
    
    # Calculate fps as 20 frames divided by the duration
    fps=$(echo "20 / $duration" | bc -l)
    
    # Create a directory to store frames
    mkdir -p frames
    
    
    # Extract 20 frames from the video using the fps filter
    ffmpeg -i "$input_video" -vf "fps=$fps,scale=200:-1" -frames:v 20 "frames/frame_%02d.jpg" -loglevel error
    
    # Create the collage using ImageMagick's montage tool
    montage -mode concatenate -tile 5x4 -geometry +2+2 frames/frame_*.jpg output_collage.jpg
    
    # Clean up temporary files (delete frames directory)
    rm -r frames
    
    echo "Collage created: output_collage.jpg"
    
    

  • If you want blazing fast on an old machine, I always keep a flash drive with some good old slitaz. Can’t beat that all in ram configuration on the slitaz minimal windowed version. But that’s not really the question here. If the cinnamon variant is slow, xfce.

    Coming from someone who nuked their grandmas computer and installed ChromeOS Flex on it since she can’t screw that up too badly and just needs a Facebook/search machine.

    Tho, now I am wishing for a ChromeOS Flex version that is just Firefox since adblock will be dying on chrome with manifest v3.