To extract all frames losslessly, use
ffmpeg -i "$input_file" -f image2 "outdir/%05d.png"
If you prefer a different output format, just change .png; by default ffmpeg will infer the file type from the extension.
The option -f image2 tells ffmpeg to write to a series of images. The "outdir/%05d.png" gives a filename pattern, in this case "5-digit frame number.png".
If you only want to extract n frames per second, add the option -r n after "$input_file". (I think n can be floating-point.)
In the case that your video is Motion JPEG (mjpeg), instead use:
ffmpeg -i "$input_file" -vcodec copy -f image2 "outdir/%05d.jpg"
This unpacks the frames directly from the video stream, which is faster and obviously uses less disk space.
For more information/other options, see the man page or the documentation (search for image2).