Skip to content

Stream from file

Pedro Sánchez edited this page Nov 13, 2018 · 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 (only video):

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

Note

You need to know that this feature was recently developed to work with audio and video so it is under tests. For now this was tested with a Samsung S7 working with mp4 and webm files that use h264/acc and vp8/vorbis codecs, both with 44100hz samplerate audio.

Clone this wiki locally