Question Video player that plays random video, random timestamp, random duration?

kyrie6576

Bathwater Drinker
Oct 23, 2022
174
12,208
1,362
0fya082315al84db03fa9bf467e3.png
Like title said is there a video player that is capable of playing a random video from a playlist, at a random timestamp, for a random duration and loops itself for research purposes? I searched the internet and found a couple of solutions but not tech savvy enough to pull them off.
 

yticpmis234

Bathwater Drinker
Jun 3, 2023
276
10,781
1,282
0fya082315al84db03fa9bf467e3.png
maybe a custom script that launches vlc ? you can run it under WSL on windows

Bash:
Please, Log in or Register to view codes content!

Random Video Player Script Documentation​

This Bash script, random_video_player.sh, is designed to play random videos from a playlist named playlist.txt using cvlc (VLC media player command line interface). The script will continuously play random videos at random timestamps for random durations until interrupted by the user.

Prerequisites:​

  • VLC media player must be installed (cvlc command should be available).
  • A playlist file named playlist.txt containing the list of video file paths.

Usage:​

  1. Ensure that the playlist.txt file is in the same directory as the script.
  2. Make the script executable: chmod +x random_video_player.sh
  3. Run the script: ./random_video_player.sh
  4. Press Ctrl + C to stop the script and exit.

Functionality:​

  • The script reads the playlist.txt file to retrieve a random video file path.
  • It then selects a random timestamp within the video duration and a random duration to play the video.
  • The selected video is played using cvlc with the specified start time and duration.
  • After finishing playback, another random video is selected, and the process repeats indefinitely until interrupted.

Notes:​

  • Adjust the max_duration variable in the script to set the maximum duration (in seconds) for each video playback.
  • Ensure that the videos listed in the playlist.txt file are accessible and have appropriate file permissions.
  • This script assumes that the video files listed in the playlist are supported by VLC media player.
 
  • 100
Reactions: kyrie6576

yticpmis234

Bathwater Drinker
Jun 3, 2023
276
10,781
1,282
0fya082315al84db03fa9bf467e3.png
Please, Log in or Register to view quotes
Any issues or if you want to customize it , just feed the script to either Bing-GPT or codellama-70b-instruct , first ask it to read it and describe what it does. Then ask for modifications one at a time. Run the script, if there is an error feed it back to the LLM, it will figure out the solution 9 out of 10 times. Have patience and fun.

BTW the fun thing with using the command line version of VLC , is if you ever want to expand the scope of your project ... you can play a 2x2 grid of four videos running random clips of random duration as you wanted to, a video wall and stream that to a TV in your house network using either a chromecast or a rstp stream.

LLM links for debugging / customization
  • Bing GPT 4
    Please, Log in or Register to see links and images
  • codellama-70b-instruct on Perplexity Labs ( you can will have to change the LLM model using the drop-down menu on the bottom right of the screen )
    Please, Log in or Register to see links and images
Reading material for expanding your project cvlc documentation + examples

  • Stream to chromecast --sout-chromecast-ip=
    Please, Log in or Register to see links and images
  • Documentation:Streaming HowTo/Command Line Examples
    Please, Log in or Register to see links and images
 
Last edited:
  • 100
Reactions: kyrie6576