Skip to content

Instantly share code, notes, and snippets.

@tusharhero
Created February 2, 2022 03:26
Show Gist options
  • Save tusharhero/1635bdcaf616e3c310a9492d993ec17c to your computer and use it in GitHub Desktop.
Save tusharhero/1635bdcaf616e3c310a9492d993ec17c to your computer and use it in GitHub Desktop.
A script to use termux-api to record videos
import os
a = 0
dir = input('dir: ')
l = 10
C=str(input('camera: ')or"0")
while a < l:
a = 1 + a
c = 'termux-camera-photo -c '+ C+" " + dir + str(a) + '.jpeg'
print(c)
os.system(c)
print(a)
os.chdir(dir)
c ="ffmpeg -f -framerate 1 -i %d.jpeg output.avi"
print(c)
os.system(c)
print('done')
print('check ' + dir +'output.mp4')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment