简体   繁体   中英

ffmpeg H264 bytestream to image or video file [Java]

I have a Java function which receives bytes of an H264 stream as follows:

void bytesReceived(byte[] bytes, int size)

Using ffmpeg, how can I transcode these bytes to some sort of image format? I would be happy with mp4, jpeg, etc. I've seen lots of examples using files and ffmpeg, but I don't know how I'd use the command line operations it offers to handle a stream of bytes.

Thanks.

Since you incoming data is already compressed (H.264) and you are fine with MP4. I'd use https://github.com/sannies/mp4parser to just wrap your incoming H.264 stream into a MP4 file in pure Java.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM