FFMPEG- Convert video to images

后端 未结 3 467
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-31 08:03

how can i convert a video to images using ffmpeg? Example am having a video with total duration 60 seconds. I want images between different set of duration like between 2-6 seco

3条回答
  •  太阳男子
    2021-01-31 08:42

    Another way is to use ffmpeg library for python, particularly useful if you don't want to add ffmpeg to your pc environment. Start by installing ffmpeg on conda with:conda install ffmpeg Then you can write a script as bellow:

    import ffmpeg
    input_file_name = 'input_video.mp4'
    (ffmpeg
     .input(input_file_name )
     .filter('fps', fps=10, round = 'up')
     .output("%s-%%04d.jpg"%(input_file_name[:-4]), **{'qscale:v': 3})
     .run())
    

提交回复
热议问题