Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import json, subprocess
- with open('ugoira_meta.json') as f:
- data = json.load(f)
- f.closed
- with open('timestamps.txt', 'w') as f:
- f.write('# timestamp format v2\n')
- f.write('0\n')
- cur_time = 0
- for i in data['body']['frames']:
- cur_time += i['delay']
- f.write(str(cur_time)+"\n")
- f.closed
- print(subprocess.run(['ffmpeg',
- '-framerate',
- '30',
- '-i',
- '%06d.jpg',
- '-codec',
- 'copy',
- 'mjpg.mkv']))
- print(subprocess.run(['mkvmerge',
- '-o',
- 'ugoira.mkv',
- '-d',
- '0',
- '-A',
- '--timestamps',
- '0:timestamps.txt',
- 'mjpg.mkv']))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement