List (almost) all videos on your hard drive and play selected one

Forum Forums General Tips and Tricks List (almost) all videos on your hard drive and play selected one

  • This topic has 2 replies, 2 voices, and was last updated Jan 31-6:19 pm by Brian Masinick.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #76489
    Member
    PPC

      In my continuous search for handy features for my FT10 package, I’m always coming up with ideas for tiny and (I hope) useful little scripts.

      Most computer users are now spoiled by being used to mobile devices- users of those devices don’t even know how to locate files- because they are usually displayed by type of file (video, audio, documents)
      Here’s a tiny script to list almost all video files in your computer. You can then click any file from the list to play it in mpv…
      It’s only the first draft, and the concept can be adapted to search and open more video file extensions, audio files, documents…

      #!/bin/bash
      #locate video files (most common extensions)
      locate "*.avi" "*.mpg" "*.mpeg" "*.mkv" "*.mp4" "*.mov" "*.3gp" "*.wmv" > /tmp/video-file-list.txt
      ##Get selection
      selection=$(yad --center --height=600 --width=800 --title=$"Videos" --list --column=$"" --button="Play" < /tmp/video-file-list.txt)	
      selection_to_add=$(echo $selection|cut -d\| -f1)	
      
      # if nothing was selected, exit
      if [ -z "$selection" ]; then exit
      fi
      
      # play selection
      mpv "$selection_to_add"
      • This topic was modified 1 year, 3 months ago by PPC.
      #76505
      Member
      PPC
        Helpful
        Up
        0
        ::

        This a version of this script will probably be added, in the future, to FT10, to preview all video files:

        #!/bin/bash
        #locate video files (most common extensions) and display them all in a rox window
        cd /tmp
        mkdir video_thumbnails
        locate "*.avi" "*.mpg" "*.mpeg" "*.mkv" "*.mp4" "*.mov" "*.3gp" "*.wmv" > /tmp/video-file-list.m3u
        cat /tmp/video-file-list.m3u | while read VIDEO_FILE; do destination=$(echo "$(basename "${VIDEO_FILE}")") && ln -s "$VIDEO_FILE" "/tmp/video_thumbnails/$destination"; done
        rox-filer /tmp/video_thumbnails/
        #76506
        Moderator
        Brian Masinick
          Helpful
          Up
          0
          ::

          You have a lot of good ideas PPC.
          I’m glad that several of them are now available for those who are interested in what you are doing.

          Thank you for your creative thinking and helpful tips and scripts.

          --
          Brian Masinick

        Viewing 3 posts - 1 through 3 (of 3 total)
        • You must be logged in to reply to this topic.