Commit 181d8fe7 authored by Clément Pinard's avatar Clément Pinard
Browse files

new missing stems to change

parent 62f802d9
......@@ -15,7 +15,7 @@ class FFMpeg(Wrapper):
fps_arg = []
self.__call__(["-y", "-i", str(video_file), "-vsync", "0", "-qscale:v", "2"]
+ fps_arg + [str(output_folder / output_folder.namebase + "_%05d.jpg")])
+ fps_arg + [str(output_folder / output_folder.stem + "_%05d.jpg")])
return sorted(output_folder.files("*.jpg"))
def extract_specific_frames(self, video_file, output_folder, frame_ids):
......@@ -27,17 +27,17 @@ class FFMpeg(Wrapper):
so we need to decrement the frame index compared to what we would have got when extracting every frame
'''
select_string = "select='" + '+'.join(['eq(n\\,{})'.format(f-1) for f in frame_ids]) + "'"
frame_string = output_folder/(video_file.namebase + "tmp_%05d.jpg")
frame_string = output_folder/(video_file.stem + "tmp_%05d.jpg")
ffmpeg_options = ["-y", "-i", video_file,
"-vf", select_string, "-vsync", "0",
"-qscale:v", "2", frame_string]
self.__call__(ffmpeg_options)
frame_files = sorted(output_folder.files(video_file.namebase + "tmp_*.jpg"))
frame_files = sorted(output_folder.files(video_file.stem + "tmp_*.jpg"))
assert(len(frame_files) == len(frame_ids)), \
"error, got {} frame_ids, but got {} images extracted".format(len(frame_ids), len(frame_files))
for f, frame_id in zip(frame_files, frame_ids):
f.rename(f.parent / (video_file.namebase + "_{:05d}.jpg".format(frame_id)))
f.rename(f.parent / (video_file.stem + "_{:05d}.jpg".format(frame_id)))
return sorted(output_folder.files("*.jpg"))
def get_size_and_framerate(self, video_file):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment