The video is simply too large to work with in RAM all at once, so you'll either need to make the file smaller, or work with it in pieces, in which case your server will need to be configured to accept chunks of streamed data as well. From the HttpURLConnection
docs:
To upload data to a web server, configure the connection for output
using setDoOutput(true). For best performance, you should call either
setFixedLengthStreamingMode(int) when the body length is known in
advance, or setChunkedStreamingMode(int) when it is not. Otherwise
HttpURLConnection will be forced to buffer the complete request body
in memory before it is transmitted, wasting (and possibly exhausting)
heap and increasing latency.
So setting setChunkedStreamingMode()
might solve your issue.
Also you might take a look at this question: Upload large file in Android without outofmemory error