This repository demonstrates how to use android low level multimedia api's
🏷️ When we want to do more than just `recording` a media and `capturing` a media. We need to use `Low level media API's`Muxingis also calledmultiplexing.Muxingplays an important role in video processing.Muxingmeans weaving together many elements.- We can also say as
taking multiple inputs->Then->Weaving them together->Then->Sending them over a single output line. Ex: Multiplexing example we can consider multiple calls traveling on a wire and all are different, Thus a single wire is sending many signals simultaneously.- It is an efficient way of sending multiple inputs in a single line. A handy way in broadcasting.
Muxingis when you have more inputs than outputs. Here we are selecting some inputs in a collection of inputs and deciding which is the output.
Demuxingis also calledde-multiplexing.Demuxingis an abbreviation ofde-multiplexing.- It is the process of reading a multi-part stream and saving each part.
- Parts of stream include
audio,video,subtitles. Demuxingis when you have a large number of outputs than the inputs. You select which of the inputs from the outputs.
MuxingandDemuxingare just the reverse operations of each other.- If you have something
muxed, You candemuxand vis-versa, If you have somethingdemuxyou canmuxit Muxing it wrappingandDemusing is unwapping
- Some Examples for media containers are
- Mp4
- WebM
- Avi etc.
- These are some examples of the containers for media.
- We have
video,audio,subtitlesetc and all these are wrapped together. Wrapped togetheris also calledmuxed together.- So when you are creating a media file like
mp4, below are muxed together to form an output file.- We have video from the camera.
- We have audio from the microphone.
- When you play that file of
mp4. Your player demuxes it, It pulls out the video to play invideo, It pulls outaudioto play in the speaker if any subtitles it draws them to be drawn in the bottom.
MediaCodecis used to access thelow-levelmedia codecs.Low levelmedia codec include things likeencoderanddecoder.Codecprocesses input data to provide and generate output data.- It processes the data
asynchronously - It uses a set of input and output buffers as seen in the diagram above.
- Client requests for the
buffer packetsfrom thecodec. - Then client populates the
buffer packetswith data and sends the data back to the codec for processing. - The
codecprocesses thebuffer packetsone by one and transforms them. - Finally the client again requests it or receives the transformed
buffer packets. - After receiving the
buffer packetsfrom the codec, The client utilizes them and sends the emptiedbuffer packetsback tocodec.
Codecis used to decode a media file and encode it to another one.
- Higher lever is represented as having a data source which can be a remote data source.
- The player that encodes/decodes the data source depending on the data source.
- There is a surface that plays the information from the player.
- Adding to the points of higher-level diagram, Here we divide the
media playerinto further partsMediaExtractorMedia CodecAudio DecoderVideo Decoder
- Some items to handle the cryptic parts of the stream
Media DRMMedia Crypto
MediaExtractorcombined with the 2media-codecsare used to extract the individual data packets fromdata-source.- To handle the encrypted video, You will need a
media-DRMto manage the session andmedia-cryptoto interact with the video codec.
- Compared to
media player, Themedia recorderis the inverse version of it.
- The media Recorder is a combination of media codecs that include
audio/videocodecs. - The data from the codecs is passed into the
media muxerthat generates avideo file.







