|
import os |
|
import os.path as osp |
|
import glob |
|
|
|
|
|
if __name__ == "__main__": |
|
root = "../data/xiph" |
|
|
|
if not os.path.exists(root): |
|
os.mkdir(root) |
|
|
|
download_links = [ |
|
'https://media.xiph.org/video/derf/ElFuente/Netflix_BoxingPractice_4096x2160_60fps_10bit_420.y4m', |
|
'https://media.xiph.org/video/derf/ElFuente/Netflix_Crosswalk_4096x2160_60fps_10bit_420.y4m', |
|
'https://media.xiph.org/video/derf/Chimera/Netflix_DrivingPOV_4096x2160_60fps_10bit_420.y4m', |
|
'https://media.xiph.org/video/derf/ElFuente/Netflix_FoodMarket_4096x2160_60fps_10bit_420.y4m', |
|
'https://media.xiph.org/video/derf/ElFuente/Netflix_FoodMarket2_4096x2160_60fps_10bit_420.y4m', |
|
'https://media.xiph.org/video/derf/ElFuente/Netflix_RitualDance_4096x2160_60fps_10bit_420.y4m', |
|
'https://media.xiph.org/video/derf/ElFuente/Netflix_SquareAndTimelapse_4096x2160_60fps_10bit_420.y4m', |
|
'https://media.xiph.org/video/derf/ElFuente/Netflix_Tango_4096x2160_60fps_10bit_420.y4m', |
|
] |
|
file_list = ['BoxingPractice', 'Crosswalk', 'DrivingPOV', 'FoodMarket', 'FoodMarket2', 'RitualDance', |
|
'SquareAndTimelapse', 'Tango'] |
|
|
|
for file_name, link in zip(file_list, download_links): |
|
data_dir = osp.join(root, file_name) |
|
if osp.exists(data_dir) is False: |
|
os.makedirs(data_dir) |
|
if len(glob.glob(f'{data_dir}/*.png')) < 100: |
|
ffmpeg_path = "~/anaconda3/bin/ffmpeg" |
|
os.system(f'{ffmpeg_path} -i {link} -pix_fmt rgb24 -vframes 100 {data_dir}/%03d.png') |
|
|
|
|