I'm trying to stream my camera to Azure Media Services LiveEvent. I'm using Media Services' REST-API to obtain the ingest URL, however the docs don't mention how to stream RTMP from an Android Phone.
So far I've tried quiet a few Android RTMP publishing libraries available on Git but each one of them fails at establishing a connection. The list of libraries I've tried so far:
- https://github.com/TakuSemba/RtmpPublisher (Fails internally NDK while opening a connection)
- https://github.com/pedroSG94/rtmp-rtsp-stream-client-java (Fails while expecting to receive a header from the ingest URL)
- And several others all exhibiting one of the two above mentioned behaviors.
I've also tried streaming from an mp4 video file using ffmpeg inspired from this SO Answer:
ffmpeg -re -i video.mp4 -vcodec libx264 -profile:v main -preset:v medium -r 30 -g 60 -keyint_min 60 -sc_threshold 0 -b:v 2500k -maxrate 2500k -bufsize 2500k -filter:v scale="trunc(oha/2)2:720" -sws_flags lanczos+accurate_rnd -acodec aac -b:a 96k -ar 48000 -ac 2 -f flv rtmp://<AZURE_INGEST_URL>
But I'm getting:
rtmp://<AZURE_INGEST_URL>: I/O error
Am I missing something?
Is it even at all possible to stream to an ingest URL without a middle tier as suggested by many Azure people is the way to go?
Edit: I've successfully streamed to YouTube Live Streaming using two RTMP libraries and so I'm now pretty sure the issue is not with the RTMP streaming libraries but with how the Azure Live Streaming works. I'm definitely missing a step here.