rainbowcreatures / FlashyWrappers

AIR / Flash video recording SDK
17 stars 10 forks source link

iOS 10.2.1 and AIR SDK 25 #21

Open cph007g opened 7 years ago

cph007g commented 7 years ago

Pavel,

WE NEED YOU MAN!! PLEASE HELP US UPDATE GITHUB FOR iOS 10.2.1(and 10.3)!!

Anyone else have issues with iOS 10.2.1 and/or the AIR SDK 25? Everything was working fine until I installed iOS 10.x on the iPAD.

Perhaps there are some new required Cocoa Keys that need to be declared? I already declared the Camera, MicroPhone, and Photo Library static strings in the infoAdditions

UPDATE: Below is where the app exits on both iOS 10.2.1 and iOS 10.3 (I am testing this using AIR 23 SDK)

UPDATE #2: I was able to build an ANE which got past the Error #1 below, but now I believe I have one last hurdle. I think the video is being compiled(I see this in the console logs), but the following error appears right after the video compiles:

NEW ERROR SandboxViolation: appName(606) deny(1) file-write-create /private/var/tmp/temp.tiKPjj

ERROR #1: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[AVAssetWriter initWithURL:fileType:error:] invalid parameter not satisfying: [outputURL isFileURL]

rainbowcreatures commented 7 years ago

Something with file saving goes wrong apparently. I'm doing a (paid) support these days for a former customer for FW iOS, so if I see this issue I can check out how to fix it.

Sorry for checking this git so sparsely(I think still better than never though), I'm just busy with other things, so if you need urgent support the only way to get it is through emailing me (best directly pavellangweil@gmail.com) - and it will be paid.

cph007g commented 7 years ago

Pavel,

I am one of your former FW iOS support customers. I was the one with the special SoundMixer needs. Please do see if you can look into this, because I am not all that familiar with the languages used in the ANE, and 2 of my projects have stalled out in the last month because of these new iOS updates.

Thanks in advance!

rainbowcreatures commented 7 years ago

I remember I think :)

Well unfortunately I discovered some more issues, with AIR 24 it seems to be causing issues with Starling(and possibly Stage3D) recording. I'm not sure whats the problem yet.

Fortunately, I managed to implement experimental ReplayKit support (pretty soon I should be able to push this to this git repo). ReplayKit is completely separate from FW's codebase - its a solution from Apple and as such has both advantages and disadvantages. The biggest advantage is, the recording should work reliably and, it captures all playing audio, without having to use FWSoundMixer or anything else.

Disadvantages include some generic popups that are mandatory and not having direct control over the video file (including quality settings, filename etc.). It can just share / save to camera roll, basically.

I didn't test the latest iOS yet, but maybe the ReplayKit path would solve all of your issues as a workaround.

cph007g commented 7 years ago

Pavel,

I too have had issues with AIR 24 & AIR 25, since I am building against the new iOS updates and an updated xCode. However, in my experience, it takes awhile for the AIR SDKs and iOS updates to mesh together so I am staying with AIR 23 until I can get one of the newer AIR SDKs to work the same as AIR 23. Perhaps the AIR 26 SDK will prove to be the next jump for us. Only time will tell, but for now, as long as I can continue using FW using AIR 23 then I am pleased(the new iOS update is the only thing holding me back when using AIR 23).

Thus, I am continuing all my development with the future in mind. With your help, you may be able to offer the final piece(the experimental ReplayKit) that will bring all of my current new implementations to completion. Until then, I will complete everything in my updates that do not include FW, and continually monitor this thread in hopes that you have a working experimental update when I am ready to finalize my 2 latests projects and move to production.

Do you think you will be able to push an update to this git repo in a week or 2(without the watermark)?

also...

Will you be able to provide access to the filename with the experimental ReplayKit(my code only needs to know the filename after encoding)?

I am counting on you Pavel! So much so that we need to exchange phone numbers one day, and stay in touch over the coming years! I can't promise anything, but our future working together looks very bright.

BEST REGARDS,

Conrad

rainbowcreatures commented 7 years ago

"Will you be able to provide access to the filename with the experimental ReplayKit", unfortunately I don't think so. Apple keeps this under wraps on purpose...all I can do is tap into their library and ask it to do things, such as "record video", "stop video recording". There is no access to files...

I'll push the ReplayKit experimental update shortly, I won't be able to update the pdf until later so for now I'll just slap that to the front page of the git.

cph007g commented 7 years ago

UPDATE: I just read your instructions on the front page of the git... and I may have an idea how to accomplish what I wrote below.

hmmm... In the current version of FW we told the encoder the file name, and had access to the bytearray. Perhaps we can read the byte array into a new file?

Either being allowed to name the file or retrieving the filename from the app' s Working/Temp directory or accessing the byteArray is what we need to complete our project. I sincerely hope you can get the filename Pavel. You are awesome and I know you have it in you to figure it out.

TTYS

rainbowcreatures commented 7 years ago

If you can figure out something, make sure to let me know!

Actually I checked the ReplayKit doc once more and, only since iOS 10, they've added broadcasting option. This looks interesting:

func process​Sample​Buffer(CMSample​Buffer, with:​ RPSample​Buffer​Type)

Processes video and audio data delivered as CMSample​Buffer objects become available during a live broadcast.

So it seems as they've added the broadcast they made the recorded data directly available in some way. I'm not sure 100%, but it seems you can take CMSampleBuffer and save that into a file(as also this thread says):

http://stackoverflow.com/questions/34692596/how-to-convert-cmsamplebufferrefaudio-video-to-a-video-file-mp4-or-mov-usi

I've never done this so I'm not sure if ReplayKit is omitting some important data, but if not there might be a way to save to a custom mp4 file by starting a "fake" broadcast.

cph007g commented 7 years ago

Well, I am about to have some free time to explore the remainder of this project and how we can access the MP4 file as we previously did. Before I do, I wanted to check in with you and see if you have any additional insights on how we can get at the MP4 since it is our app that is saving the data to the application directory. If this is the case then we should have some way of knowing where that file is so we can display it to the user within the app.

So to help me better understand this, if any of the recent AIR SDKs (25 or quite possibly 26) work with Starling and/or Stage3D recording then we should be able to use FW as before to access the mp4 file?

Please advise.

rainbowcreatures commented 7 years ago

Nope, the only idea I've had was the one I highlighted above - that is for ReplayKit, which can record anything, regardless of AIR version, also it records all audio etc. It would involve more native programming into the ANE just to test if that idea works.

With the "original" capture method I saw some issues with AIR 25, it might be only in certain situations, but there was connection with Stage3D (in non-stage3D mode it seemed to capture fine ever with AIR 25). So the only way would be simply to try how it works for your specific app.

dannycortesv commented 7 years ago

I also need this, i can also pay to support your project this is awesome! Please let me know how can i procced and if you have time :)