I use ffmpeg to generate a ton of jpeg images. However, these jpegs aren't optimized by ffmpeg. On average, the images losslessly compress another 10-20% when I run them through jpegtran.
I don't want to generate all these images, write each to disk and then run them through jpegtran afterword as it would be inefficient. I would rather pipe them using the image2pipe format in ffmpeg.
Let's say I wanted to take 1 frame per second and convert each to a jpeg. Ideally, I would like to produce a command like:
ffmpeg -i video.mpg -q 10 -r 1 -f image2pipe - | [something] | jpegtran -copy none -optimize
Obviously this won't work by itself (for many reasons) but how would I go about doing something like this?