RTMP protocol port to iOS

瀏覽次數:1,225 次
跳到第一則未讀訊息

Jan Cássio

未讀,
2013年8月13日 凌晨12:54:062013/8/13
收件者:haxe...@googlegroups.com
Hi guys,

I'm creating a iOS app where I have a video recorder, and is this is the most critical functionality of this app, because we working on a approach where the video is uploaded to a media server in "recording time".

I "googled" about some solutions to connect iOS on media server via RTMP, but I found some expensive and other ones with lots deprecated elements and non support for that.

Really, I not sure, but I think is possible to write a library with Haxe to creates a lib with all necessary interface to connect my app on media server and push videos on that.

For me this function is very essential and I'm disposed to write and open this for everyone, but I need some "Haxers" to think with me about this.

If someone has answers,  ideas, reference, anything to make this idea possible, please share here.

Many thanks

--
Jan,

Cauê Waneck

未讀,
2013年8月13日 清晨5:21:192013/8/13
收件者:haxe...@googlegroups.com
Hi Jan!

I'm creating a iOS app where I have a video recorder, and is this is the most critical functionality of this app, because we working on a approach where the video is uploaded to a media server in "recording time".
Really, I not sure, but I think is possible to write a library with Haxe to creates a lib with all necessary interface to connect my app on media server and push videos on that.

Haxe does provide a basic foundation you'll need to get this working, but it will involve quite a bit of work on your own. What we do have implemented is the haxevideo project ( https://code.google.com/p/haxevideo/ ), which will provide a basic RTMP server implementation. With it you can see how the RTMP protocol may be implemented in haxe, and implement the client RTMP protocol. There is also a FLV file format available at https://github.com/HaxeFoundation/format , as well as the AMF implementation.
However, all of this doesn't fix which I think is the hardest part, which is getting the video and encoding it, in real time. This is really not a trivial operation, and should really be implemented in the lowest level as possible, specially on a mobile device, which already has very constrained resources.

You can use a native library like ffmpeg alongside with Haxe-cpp (which is what compiles to iOs) using the CFFI (http://haxe.org/doc/cpp/ffi). Refer to http://stackoverflow.com/questions/7979842/video-encoding-libraries-for-ios for some ideas about this.

Searching a bit on the net, there is http://ios-rtmp-library.com . I really can't vouch for it, I just found on the net. And also as a bad downside, it's not open-source. It may however make your life easier. Also it seems that it uses ffmpeg to do the encoding - which actually looks kinda fishy, as ffmpeg is GPL/LGPL, so it wouldn't allow a closed-source commercial product using it on iOs, which only allows static linking.

It's quite a big challenge there, and definitely not easy to get it done. Good luck! ;)

Cheers!
Cauê

j...@justinfront.net

未讀,
2013年8月13日 清晨6:37:512013/8/13
收件者:haxe...@googlegroups.com
I think the other Jan has done some work round haxevideo I am not sure if it is relevant it is probably mostly flash related but not looked at source recently so not sure, but you can check the source code yourself.
 
Jan has also created Air3 haxe bindings 

I believe that Adobe air will run on iOS and provide some RTMP support for instance found this.

Best Justin


--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/groups/opt_out.

Cristian Baluta

未讀,
2013年8月13日 清晨7:13:232013/8/13
收件者:haxe...@googlegroups.com
You should definitely not waste time on passing data to haxe here, do everything in objc, c, and make an extension from it.
ios-rtmp is insanely expensive, but i don't know, maybe worths for the kind of applications is used.
--
Băluță Cristian
http://ralcr.com
http://imagin.ro

Jan Cássio

未讀,
2013年8月13日 上午9:57:432013/8/13
收件者:haxe...@googlegroups.com
Hi Cauê, thanks for your answer.

I found ios-rtmp-library too, but this seems too expensive and I never heard about or someone where use it.

I will take your library to investigate then, many thanks to share this with us, this will be useful to understand some concepts.

Like you said, this is a big challenge and I will invest a time on it.

Thanks,

--
Jan

Jan Cássio

未讀,
2013年8月13日 上午9:57:432013/8/13
收件者:haxe...@googlegroups.com
Hi Cauê, thanks for your answer.

I found ios-rtmp-library too, but this seems too expensive and I never heard about or someone where use it.

I will take your library to investigate then, many thanks to share this with us, this will be useful to understand some concepts.

Like you said, this is a big challenge and I will invest a time on it.

Thanks,

--
Jan

On Tuesday, August 13, 2013 6:21:19 AM UTC-3, Cauê Waneck wrote:

j...@justinfront.net

未讀,
2013年8月13日 清晨6:19:412013/8/13
收件者:haxe...@googlegroups.com
I think the other Jan has done some work round haxevideo I am not sure if it is relevant it is probably mostly flash related but not looked at source recently so not sure, but you can check the source code yourself.
 
Jan has also created Air3 haxe bindings 

I believe that Adobe air will run on iOS and provide some RTMP support for instance found this.


Best Justin


Cauê Waneck

未讀,
2013年8月16日 中午12:24:252013/8/16
收件者:haxe...@googlegroups.com
Hi Jan!
Okay, nice. I recommend you start by looking for encoding solutions, and testing them. 
Let us know if you need help!

Cheers
Cauê


2013/8/13 Jan Cássio <h...@jancassio.com>
--

dukope

未讀,
2013年8月16日 下午1:55:012013/8/16
收件者:haxe...@googlegroups.com
I can't say anything useful about the haxe or RTMP side of this, but about the encoding: 

You absolutely do not want to even try encoding in software (ffmpeg or similar). The built-in hardware encoders that Apple provides are much faster and less battery-hungry than any other option. Their API is a little wonky with the blocks and statuses and stuff but in the end the performance is worth the trouble. Even if you want to eventually ship on Android, I'd suggest building an abstraction layer that interfaces with each OS's built-in hardware encoding API.

I'm speaking from the experience of shipping a very video-encoding-heavy app on iOS (cpp, not haxe). Even if you can put together a software encoding solution with relative ease, there will always be the massive performance benefit of doing it natively in hardware and from a user-experience perspective I think you should just focus on that from the start.

So, I agree with Cristian. :)

Cauê Waneck

未讀,
2013年8月16日 下午2:07:062013/8/16
收件者:haxe...@googlegroups.com
You're right. I didn't know that iOs provided their own hardware encoding API. I found this answer which provides a good direction

Cheers!
Cauê


2013/8/16 dukope <duk...@gmail.com>

--

Jan Cássio

未讀,
2013年8月19日 中午12:06:282013/8/19
收件者:haxe...@googlegroups.com
Hi Dukope,

Yeah, I spend a more time looking more deep on iOS encoders and like Christian said, I can do this with a obj-c (or c++) extension without use haxe. I'm very interesting to know about some references if you have to share.

Cauê, many thanks for reference.

I will start my work on this strategy, I will made some segmented videos and upload each piece on the record time, this will allow to deliver videos over HLS and I can control upload based on queue of segments, this seems more simple than apply a RTMP adapter now.

Thanks guys

Cauê Waneck

未讀,
2013年8月19日 下午4:56:162013/8/19
收件者:haxe...@googlegroups.com
Hey Jan!

2013/8/19 Jan Cássio <h...@jancassio.com>

Hi Dukope,

Yeah, I spend a more time looking more deep on iOS encoders and like Christian said, I can do this with a obj-c (or c++) extension without use haxe. I'm very interesting to know about some references if you have to share.

Yep, I think using Apple's hardware encoding is by far the best way to deal with it. Also take care when using the CFFI to avoid copying at all costs. This may mean that the encoded frames won't be visible from within haxe, but rather be an opaque ffi abstract (see http://nekovm.org/doc/ffi#abstracts_and_kinds for info about it)


Cauê, many thanks for reference.

I will start my work on this strategy, I will made some segmented videos and upload each piece on the record time, this will allow to deliver videos over HLS and I can control upload based on queue of segments, this seems more simple than apply a RTMP adapter now.

Okay, that seems like a good solution. Still, controlling the bitrate according to the current internet bandwidth will still be challenging by itself!

Cheers!
Cauê

Jan Cássio

未讀,
2013年8月19日 下午5:06:592013/8/19
收件者:haxe...@googlegroups.com
Cauê,

Pretty good, I will appreciate this article.

Best regards,



You received this message because you are subscribed to a topic in the Google Groups "Haxe" group.

For more options, visit https://groups.google.com/groups/opt_out.



--
Jan Cássio | Web & Mobile Apps Developer
phone: 55 11 98345-5659
works: jancassio.com
hangouts: jancassio
skype: jancassio

user123

未讀,
2014年2月24日 凌晨2:28:072014/2/24
收件者:haxe...@googlegroups.com
Hie!
I'm creating an iOS app similar to an AV Chat using a red5 server via RTMP. As the available libraries are expensive I don't know from where can I start ? Is there any other cost-free option OR core iOS code to connect to red5 server via RTMP ?

Alex Flavia

未讀,
2017年6月21日 上午9:27:182017/6/21
收件者:Haxe
Hello Jan,

You shouldn't bother trying to create a player.
There are lots of open SDKs out there. You can use them to play your RTMP stream to iOS.
I've used one of these SDKs to play live streams on my company's app.(surveillance purposes :) ) and everything runs smoothly.

Have a great day,
Alex!
回覆所有人
回覆作者
轉寄
0 則新訊息