This function parses SlidesLIve URL into the presentation ID and name.
sl_url = ('https://slideslive.com/38956531/'
'beyond-static-papers-rethinking-how-we-share-scientific-understanding-in-ml')
my_sl_id, my_sl_name = url2id(sl_url)
my_sl_id, my_sl_name
Pulls video presentation details from SlidesLive.
get_sl_info(my_sl_id)
This function extracts the synchronisation between slide images and video presentation.
This information can either be pulled from XML (approach='xml'
) or
JSON (approach='json'
, default) format.
slides_structure_json = 'https://cdn.slideslive.com/data/presentations/38956531/v1/slides.json'
slides_metadata = get_slide_metadata(slides_structure_json)
print(slides_metadata.get('slide_qualities'))
print(slides_metadata.get('slides')[0])
This function allows to generate a list of slide URLs for a given SlidesLive presentation. You can filter the slides by time or ID if your talk is in the middle of a session.
my_id_bounds = (1074, 1163)
my_urls = get_urls(my_sl_id, slides_metadata,
slide=my_id_bounds)
print(my_urls[0])
print(my_urls[-1])
You can use this function ot download slides to a selected directory.
If you want to speed yp the process, install wget
and parallel
,
and use the technique='wget+parallel'
option.
my_slides = [
'https://rs.slideslive.com/38956531/slides/00793.png?h=1080&f=png',
'https://rs.slideslive.com/38956531/slides/00794.png?h=1080&f=png'
]
download_slides(my_slides, directory='my_slides_dir')
ls my_slides_dir
download_slides(my_slides, directory='my_slides_dir_wget-parallel', technique='wget+parallel')
ls my_slides_dir_wget-parallel
This function creates a script for concatenating images into a video.
It can be executed with the
ffmpeg -safe 0 -f concat -i ffmpeg_concat_script.txt -vsync vfr slides.mp4
command. See thecompose_ffmpeg_video
function for more details.
my_slides_ffmpeg, start_second, end_second = ffmpeg_concat_script(
slides_metadata,
slide_folder='my_slides_dir',
slide=(793, 794))
print(my_slides_ffmpeg)
print(f'\n{start_second}--{end_second}')
Alternatively, you can save the ffmpeg script to a file yourself and execute this command from your terminal.
compose_ffmpeg_video(my_slides_ffmpeg)
ls -la slides.mp4
The SlidesLive
class helps to navigate through the myslideslive.slideslive
module functions.
msl = SlidesLive('https://slideslive.com/38956531/'
'beyond-static-papers-'
'rethinking-how-we-share-scientific-understanding-in-ml',
slides_folder='beyond-static-papers')
msl.download_slides(slide=(1074, 1075))
ls {msl.slides_dir}
msl.compose_video()
ls -la {msl.slides_video}
msl1 = SlidesLive('https://slideslive.com/38988636/'
'24-sparsity-on-gpu-tensor-cores',
slides_folder='sparsity-on-gpu-tensor-cores')
msl1.download_slides(slide=(30, 31))
ls {msl1.slides_dir}
msl1.compose_video()
ls -la {msl1.slides_video}