google / ExoPlayer

An extensible media player for Android
Apache License 2.0
21.63k stars 6k forks source link

Add support for MJPG format #7312

Open radheyjat opened 4 years ago

radheyjat commented 4 years ago

Add support for .mjpg streams

original issue request This is usecase come from i am trying to show Camera LiveView and some camera url is extention with .mjpg or some camera url with rtsp. So need to Give support both cameras rtsp issue already opend but i need to support .mjpg url also
dburckh commented 2 years ago

I need something similar for AVI support. A common format for older cameras is MJPEG/PCM. My AviExtractor can already packetize the JPEGs. I'm thinking the Renderer this isn't too bad on the Surface. (Pun intended) Just use BitmapFactory to decode the JPEG to Bitmap, create a Canvas from the Surface and draw it.

So, where this gets messy is integrating with Exo. I'm thinking it would be a sibling to MediaCodecVideoRenderer. Maybe BitmapFactoryVideoRenderer? So where I would need help is how to control the Renderer swapping and how the plumbing from the TrackOutput to the Renderer work. Any help would be appreciated!