Using ffmpeg, how can i get a random frame of an FLV video and save it as png or jpg ?
Share
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.
Generate your random time value in PHP, and then execute something like this in ffmpeg:
This will get a frame on or about 5.5 seconds in the video. I suggest you use ffmpeg ahead of time to determine the length of the video, then generate a random number between the start and end.
Also, leave plenty of padding at the end of the video, as it isn’t always possible to determine its exact length ahead of time. If your video is 1 hour, you might get a frame somewhere between 0 and 57 minutes, for example.