For anyone curious, here was my solution. It was using OpenCV. I was unaware of this at the time that I asked the question, but OpenCV has certain features that use ffmpeg behind the scenes. And since my program was already using OpenCV, which I mentioned only in passing in the question (as I thought it was unimportant), it wasn't very difficult to use the features built in to OpenCV to do what I wanted. Here is the code:
cap = cv2.VideoCapture("video.mpg")
count = 0
frame_q = queue.Queue()
while cap.grab():
success, frame = cap.read()
if count % 5 == 0 and success:
frame_alpha = np.insert(frame, 3, 255, axis=2)
frame_q.put(frame_alpha)
count += 1
As you can see, I am just putting every fifth frame into a Queue of frames. The core of this is these three lines:
cap = cv2.VideoCapture("video.mpg")
while cap.grab():
success, frame = cap.read()
The first line opens the capture, the while clause checks if there are any more frames using cap.grab() (returning True if there is a next frame) and then I read that frame into a numpy array using cap.read(). success is a boolean that indicates whether the operation succeeded. Later I add an alpha channel to the frame and put it into the frame_q.
Then, another thread of the program gets frames out of that Queue. This way, I don't have to deal with the file system at all--like Marcus said, I'm getting them directly into the program.
Note: for cv2.VideoCapture() to work the opencv_ffmpeg.dll needs to be in the system path or in the root directory of whichever installation of Python you're using. You might have to rename it to opencv_ffmpegXYZ.dll where XYZ is the OpenCV version number minus the decimal points. So for me, it's opencv_ffmpeg330.dll because I have version 3.3.0. It also might be called opencv_ffmpeg330_64.dll on an x64 system.
The location of opencv_ffmpeg.dll depends on how you installed OpenCV, I would just search in the OpenCV directory for opencv_ffmpeg and see where it comes up. Before you copy it into the Python directory, make sure to check if it's already there. It might be, depending on how you installed OpenCV.