Skip to content

Commit 5f2029b

Browse files
committed
fix path and check
1 parent 98a8054 commit 5f2029b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Scripts/Miscellaneous/Unwrap_video/unwrap.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,21 @@
77
if not 'jpeg' in video:
88
#get video resolution
99
try:
10-
result = subprocess.run(['ffprobe', '-v', 'error', '-select_streams', 'v:0', '-show_entries', 'stream=width,height', '-of', 'csv=s=,:p=0', video], stdout=subprocess.PIPE)
10+
cwd = os.getcwd()
11+
path = cwd + '/' + video
12+
result = subprocess.run(['ffprobe', '-v', 'error', '-select_streams', 'v:0', '-show_entries', 'stream=width,height', '-of', 'csv=s=,:p=0', path],check=True,stdout=subprocess.PIPE)
1113
except Exception:
1214
print('Error running ffprobe.')
1315
sys.exit()
1416

1517
resolution = result.stdout.decode('utf-8')
16-
height,width = resolution.split(',')
18+
height,width = resolution.split(',')
1719
height = int(height)
1820
width = int(width)
1921

2022
#from each frame of the video, grab the center pixels and store them temporarily
2123
os.system('ffmpeg -i ' + video +' -filter:v "crop=2:' + str(height) + ':' + str(width/2) + ':1" -q:v 1 tmp/images-%04d.jpeg')
22-
24+
2325
#define the series of images to be processed from the temp images
2426
series = glob.glob("tmp/*.jpeg")
2527
#the composite will be as wide as the number of images
@@ -41,4 +43,3 @@
4143

4244
#save composite
4345
composite.save(video + '_unwrapped.jpeg', 'JPEG')
44-

0 commit comments

Comments
 (0)