begeekmyfriend / yasea

RTMP live streaming client for Android
MIT License
4.89k stars 1.32k forks source link

Progressive upload video file to server #729

Open albka1986 opened 5 years ago

albka1986 commented 5 years ago

Hello!

Can I upload a video that is recording to a server progressively?

In my application, I have two options to broadcast live video:

  1. Using the RTMP protocol with saving the video simultaneity locally and after this, I upload this video to a server with good quality. I do it with your lib and it works excellent. Thanks.

  2. I need to record video locally and send the video in parts of 50 MB to a server in a background thread. Do I have access for this recording video file? How can I chunk this? Is it feature already exist in the lib or maybe you can give me advice about how to implement this?

begeekmyfriend commented 5 years ago

You might change the RTMP publish type field which is set here to check whether it would meet your demand or not. Sorry that I am unavailable for Android development and I have no Android IDE at hand.

albka1986 commented 5 years ago

Thanks for the fast response.

What types can I choose? What types are supported to publish?

begeekmyfriend commented 5 years ago
connected = publisher.publish("live");
connected = publisher.publish("record");
connected = publisher.publish("append");

As for your demand what you need is record. But the feature depends on the support of your RTMP server.

albka1986 commented 5 years ago

How can I set the size of a chunk (for example 5 mb), and where can I find the chunks? I investigated the method: connected = publisher.publish("live"); and I found that I'm required to set RTMP link, but in my case, I don't need to broadcast video via RTMP, I need to get chunked video during the recording and send the chunks one by one to a server via HTTP in a background

begeekmyfriend commented 5 years ago

The chunk size is set in RtmpSessionInfo.java. The RTMP module has been designed with strong taste of OOP which makes itself tough to understand. If you want to choose what kind of RTMP packets to deliver, just call the method in SrsPubsher.java