Skip to content

Stream from file

Pedro Sánchez edited this page Mar 8, 2024 · 10 revisions

Uses

This mode provide you an easy way to stream a local file to server totally in background mode. You are only limited by your decoders and encoders device because you need the codecs used for your file.

Also you can stream a file that is stored in the web using url. If audio codec is not supported you will see only video. Video urls tested and working:

https://gist.github.com/jsturgis/3b19447b304616f18657

Theoretically you can stream all data supported by MediaExtractor setDataSource method and you can send different paths to audio and video.

Information about Android codecs supported: https://developer.android.com/guide/topics/media/media-formats.html

To know all codecs that your device support you can use this method provided by this library:

https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/blob/master/encoder/src/main/java/com/pedro/encoder/utils/CodecUtil.java#L27

Clone this wiki locally