在PHP中使用FFMpeg av_read_frame?

I'm hoping to incorporate FFMpeg in a PHP script. My understanding is that the two best solutions are to use the command line via exec() and extract results or use PHP-FFMpeg (https://github.com/PHP-FFMpeg/PHP-FFMpeg).

What I want to do is walk through a video frame-by-frame, and I think I need to use av_read_frame(). What's the best way to use that from PHP? I don't think it's available from the command line or PHP-FFMpeg. Should I write a C program (using XCode) to do what I want and call it from my PHP script?

Thanks!

I ended up learning the command line interface to FFMPEG. (It wasn't as hard as I feared!) To walk through frame-by-frame, I just created all frames as jpeg files with a single ffmpeg command with exec(), walked through each one, then deleted them when I was done. Easy.

If the video size is a risk, FFMPEG can be used to generate a range of jpeg files using -ss and -to options. For example, 0-20 seconds, 20-40 seconds, etc. for about 200mb of files per set.