October 22, 2024 · fdfind find locate mv cp batch change

Quick & Easy: FDFind (FD) Examples

fdfind aka fd is a nifty tool, you can do alot with it like finding files fast and run commands on the results quick and easily

Search for a file in /

find all jpg files in current folder and move them to new folder

find all mkv files and run a extract image script

import os
import subprocess

def extract_frame(input_file):
    input_dir = os.path.dirname(input_file)
    base_name = os.path.basename(input_file).replace('.mkv', '')
    output_file = os.path.join(input_dir, f"{base_name}-thumb.jpg")
    time = "00:03:50"  # Set the desired time in HH:MM:SS format
    
    # Run ffmpeg command to extract the frame
    command = ["ffmpeg", "-ss", time, "-i", input_file, "-frames:v", "1", output_file]
    subprocess.run(command)
    
    print(f"Frame extracted and saved to {output_file}")

if __name__ == "__main__":
    if len(sys.argv) != 2:
        print("Usage: python script.py <input_file>")
        sys.exit(1)

    input_file = sys.argv[1]
    extract_frame(input_file)
  • LinkedIn
  • Tumblr
  • Reddit
  • Pinterest
  • Pocket
DigitalOcean Referral Badge
Keep my site online & receive a $200 60-day credit at DigitalOcean for your VPS Hosting
Cheaper Games on Instant-Gaming
Creative Commons Licence Clicky