Looking for code to play random video at random playback point.
Hi.
I'm looking for a command to play a random video from a particular folder and play the file at a random point, e.g. 63m16s in to a film, etc. Thanks. |
I would think that about any media player where you can launch it with a index time will do that.
Example random number from 30 - 90 Code:
ran=$((30 + RANDOM % 60)) Code:
f=(file1.mp4 file2.mp4 file3.mp4 file4.mp4 file5.mp4 |
I know of this command to play a random video from a folder:
Code:
mplayer -fs -quiet -shuffle {*,*/*} |
If you aren't currently using a particular video player, you could use mpv and some shell/Perl magic.
Code:
mpv --start="$(( RANDOM % 100 ))%" "$(perl -e '@d=<*>; print $d[rand(@d)]')" Code:
#!/usr/bin/env perl |
Quote:
|
Quote:
How can I add the one line command to an alias? I'm unsure due to the quotes already in the code. Also, would it be possible to have the one line code run recursively? |
Quote:
Code:
randomFile() { |
Quote:
|
All times are GMT -5. The time now is 03:52 AM. |