Skip to content

Instantly share code, notes, and snippets.

@nofreewill42
Created March 9, 2020 21:19
Show Gist options
  • Save nofreewill42/1ab604a463561b118702d39a51bbb623 to your computer and use it in GitHub Desktop.
Save nofreewill42/1ab604a463561b118702d39a51bbb623 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nofreewill42
Copy link
Author

You can download a whole youtube playlist:
youtube-dl -i -f 160 --yes-playlist "playlist url" -o "Videos/Raw/%(title)s.%(ext)s"
or urls collected in a text file:
youtube-dl -i -f 160 -a urls/urls-new.txt -o "Videos/Raw/%(title)s.%(ext)s"

You can split videos with scene change detection:

import os
import glob

videos_folder = 'Videos/Raw'
fns = os.listdir(videos_folder)

for fn in fns:
	os.system(f'scenedetect -i "{videos_folder}/{fn}" -o Videos/Split detect-content -t 27 split-video')

But be aware that splited videos take up much more space than having them not being splited. But you can run scenedetect and have just the info in a .csv about where do the videos have scene changes in them and use just that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment