/loopextender

Create m3u playlist files for OBS VLC Video Source.

Primary LanguagePythonOtherNOASSERTION

loopextender

Create m3u playlist files for OBS VLC Video Source.

Find a demo video on YouTube.


Dependencies


Usage

loopextender.py [-h] [-c] [-o] [-s] infile outfile
positional arguments:
  infile           absolute or relative input file path
  outfile          absolute or relative output file path

optional arguments:
  -h, --help       show this help message and exit
  -c, --check      check file paths from the input file for their existence
  -o, --overwrite  do not ask for confirmation to overwrite if the output file already exists
  -s, --shuffle    shuffle the output order

See the example input and output files too.


Motivation

I got some short loop videos with a duration of 10 seconds each. To let them run for longer than 10 seconds, lets say 30 seconds, I have to add the same file 3 times in a row. The order will also be the same every time unless I reorder the playlist manually. This is all cumbersome.

cumbersome-solution

Now, to make it easier, I just create a text file and define the videos and their repetitions there, like so:

# input.txt

3,d:\_livestream\assets\myviz\2021-lost_memory.mp4
3,d:\_livestream\assets\myviz\2021-tunnel_b21_4_3.mp4

Then I just have to feed this input to loopextender and it will create a playlist file.

# output.m3u

d:\_livestream\assets\myviz\2021-lost_memory.mp4
d:\_livestream\assets\myviz\2021-lost_memory.mp4
d:\_livestream\assets\myviz\2021-lost_memory.mp4
d:\_livestream\assets\myviz\2021-tunnel_b21_4_3.mp4
d:\_livestream\assets\myviz\2021-tunnel_b21_4_3.mp4
d:\_livestream\assets\myviz\2021-tunnel_b21_4_3.mp4

easier-solution