I would like to trim – cut off frames at the beginning and end – a video that can be in a variety of different formats, and then save the trimmed video.
Are there any libraries or suggestions on how to do this?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’ve been using ffmpeg and the subprocess module of python to extract video thumbnails, but it seems ffmpeg can do pretty much anything.
Once you install ffmpeg, you can trim off the first second of video like so
So using the subprocess module of python
will take off the first second. For specific frames, there are flags like -vframes and -dframes, but I haven’t actually used them. Documentation of ffmpeg here.
There’s also pyffmpeg, a python wrapper for ffmpeg. But I haven’t used it.