Skip to content

Add Motion JPEG extractor support#3331

Open
osscv wants to merge 1 commit into
androidx:mainfrom
osscv:pr-mjpeg-only
Open

Add Motion JPEG extractor support#3331
osscv wants to merge 1 commit into
androidx:mainfrom
osscv:pr-mjpeg-only

Conversation

@osscv

@osscv osscv commented Jul 12, 2026

Copy link
Copy Markdown

Summary

  • Add an extractor for HTTP multipart Motion JPEG (multipart/x-mixed-replace).
  • Support parts with Content-Length and marker-delimited JPEG frames without it.
  • Support X-Timestamp, CRLF/LF headers, quoted or inferred boundaries, and partial reads.
  • Support raw concatenated .mjpeg and .mjpg streams with a default 25 fps timeline.
  • Register MJPEG MIME, file-type, URI, response-header, and default extractor selection.

Motivation

This enables playback of HTTP camera streams such as:

http://61.211.241.239/nphMotionJpeg?Resolution=320x240&Quality=Standard

References

The Apple documentation also describes QuickTime-specific Motion-JPEG A/B layouts. Those container-specific variants are outside the scope of this HTTP/raw-stream extractor.

Tests

  • ./gradlew :lib-common:testDebugUnitTest --tests androidx.media3.common.FileTypesTest
  • ./gradlew :lib-extractor:testDebugUnitTest --tests androidx.media3.extractor.jpeg.MjpegExtractorTest --tests androidx.media3.extractor.DefaultExtractorsFactoryTest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant