I believe what you're looking for is mjpegtools. In particular, jpeg2yuv. Or, if you're starting from something other than JPEG, but can convert it to PPM, the long way around is ppmtoy4m, also part of mjpegtools.
Note: I haven't used these myself, yet.
Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds