Looks like by compiling ffmpeg by yourself, on RPi3B+ you can get
ENCODING HIGH-COMPLEXITY 30 FPS VIDEO FROM A 1920 X 1080 JPEG IMAGE SEQUENCE – SIGNIFICANT MOTION AND INTRAFRAME DETAIL – HIGH QUALITY SETTINGS:
Software-Based H.264 Encoding (CPU): 2.6 FPS (11.5 times slower than real time)
Hardware-Based H.264 Encoding (GPU): 6.3 FPS (4.8 times slower than real time)
ENCODING HIGH-COMPLEXITY 30 FPS VIDEO FROM A 640 X 480 JPEG IMAGE
SEQUENCE – SIGNIFICANT MOTION AND INTRAFRAME DETAIL – HIGH QUALITY
SETTINGS:
Software-Based H.264 Encoding (CPU): 18 FPS (1.7 times slower than real time)
Hardware-Based H.264 Encoding (GPU): 38 FPS (1.3 times FASTER than real time)
The script to help achieve all this is in a forum thread.
raspiyuv -o - | rpi-encode-yuv
(roughly) where therpi-encode-yuv
tool is from here. The frame size is hard-coded in this tool, so you need to change it at the beginning of the C file and recompile. Unfortunately I haven't managed to get a properly aligned output yet, asraspiyuv
doesn't seem to encode the frame size into its output. I get a gradually shifting picture that eventually turns to garbage. Still working on it. – Szabolcs Jun 6 '14 at 3:20