mirror of
https://github.com/kkroening/ffmpeg-python.git
synced 2025-04-06 04:15:44 +08:00
Fix get_video_thumbnail example
This commit is contained in:
parent
4a70f6a868
commit
6364513485
@ -5,7 +5,7 @@ import ffmpeg
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description='Extract video thumbnail')
|
parser = argparse.ArgumentParser(description='Generate video thumbnail')
|
||||||
parser.add_argument('in_filename', help='Input filename')
|
parser.add_argument('in_filename', help='Input filename')
|
||||||
parser.add_argument('out_filename', help='Output filename')
|
parser.add_argument('out_filename', help='Output filename')
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
@ -21,7 +21,7 @@ def generate_thumbnail(in_filename, out_filename, time, width):
|
|||||||
ffmpeg
|
ffmpeg
|
||||||
.input(in_filename, ss=time)
|
.input(in_filename, ss=time)
|
||||||
.filter_('scale', width, -1)
|
.filter_('scale', width, -1)
|
||||||
.output(out_filename, vframes=1, format='image2', vcodec='mjpeg')
|
.output(out_filename, vframes=1)
|
||||||
.run(capture_stdout=True, capture_stderr=True, overwrite_output=True)
|
.run(capture_stdout=True, capture_stderr=True, overwrite_output=True)
|
||||||
)
|
)
|
||||||
except ffmpeg.Error as e:
|
except ffmpeg.Error as e:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user