开发者

Viewing MJPEG Video Streams

I know Android doesn't support MJPEG natively but are there any jar files/drivers available that can be added to a project to make it poss开发者_Python百科ible?


There is a View available to display MJPEG streams: Android and MJPEG Topic


Hardly, unless it's your Android platform (i.e. you are the integrator of special-purpose devices running Android).

A good place to start looking on how the Android framework handles video streams is here: http://opencore.net/files/opencore_framework_capabilities.pdf

If you want to cook up something entirely incompatible, I guess you could do that with the NDK, jam ffmpeg into there, and with a bit of luck (and a nightmare supporting different Android devices) you can have it working.

What is the root problem you are trying to solve, perhaps we could work something out.


You can of course write or port software to handle any documented video format, the problem is that you won't have the same degree of hardware optimized code as the built in video codecs, and won't have as efficient low-level access to the framebuffer. So your code is likely to not be able to play back at full speed. Sometimes that might be okay, if you just want to get a sense of something. Also mjpeg compresses frames individually, so it should be trivial to write something that just skips a lot of frames and only decodes whatever fraction of them it can keep up with.

I think that some people have managed to build ffmpeg or mplayer using the optional features of the cpus in some phones and get to full frame rate for some videos, but it's tricky and device-specific.


I'm probably stating the obvious here, but MJPEG consists simply of multiple JPEGs. If you can grab the frames by cutting out data, you can probably get that data to be displayed as any other image.


I couldn't find any information on when exactly this was implemented, but as of now (testing on Android 8) you can view MJPEG stream just fine using a WebView.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜