I know how to extract frames and audio from a video using ffmpeg.
But what I want to is, to pick a random frame in that video, and then picking a random 1 second audio clip that overlaps in time with the sampled frame.
As of now I'm doing this by preprocessing the videos for frames and audio, but that is consuming a lot of disk-space.
The way I'm doing it now is: I extract the frames and audio before hand I'm finding the number of frames and picking one from them randomly. By finding the name of that frame, which gives me it's number, say 100th out of 3000 frames, I'm picking audio which overlaps with it.
So is there a easier way of achieving this?