Is it possible to alter the compression?
Hi
Is it possible to alter the compression? At the minute I need my app to upload the videos but after applying filters the file sizes are a bit too large. Just wondering if there is a way of decreasing the file size.
Thanks
Oliver
This would need to be done using iOS methods for UIImage/ALAssets and is outside the scope of this framework.
Actually, if you're talking about the movie recording, you can adjust the compression for the movies, although I've found that it reduces the quality of the recorded product significantly for little file size savings.
I don't have anything exposed for this, but look in the -initializeMovie method of GPUImageMovieWriter, where I have some commented-out code that can be used to adjust compression settings. You could play with that and see if you get any decent results from it. If so, I might be able to expose those settings for people to tweak.
+1 on exposing the outputSettings dictionary
I've found a need to tweak some of these settings (& currently re-apply them each time I update my local copy of GPUImage). Have started to learn how to fork & apply changes to the lib (new to github), & this was on my list of things to do & submit a pull request if it was of interest to others. If you got round to it Brad, that would be amazing ;)
I was thinking of maybe adding an optional argument to initializeMovie & in turn initWithMovieURL... to pass along a custom settings dictionary on init, & if it was nil, the current defaults would be used. There may be a better/simpler way to handle this though...
I think the movie url should be exposed as well.
I've taken a stab at exposing the optionsSettings & fileType, as I currently need to override both.
Although I'm unsure if this is the best way to go about it, & also if its ok to leave the setting of the AVVideoCodecKey, AVVideoWidthKey & AVVideoHeightKey values to the calling code, or if they should be checked for & auto set if not specified?
Heres the commit to my fork (also has some other changes in the fork, but don't think any that interfere with this commit): https://github.com/phil-m/GPUImage/commit/a293ec336558dc8499b3ff455338ee4a175541f4
Any feedback/ideas appreciated! Thanks Phil
I like it. Submit a pull request and I'll merge those changes in.
Thanks Brad!
I've got some other changes in that branch, & by the looks of it, the pull request wants to push all across at once (I'm learning how best to work & structure changes with github, maybe I should of had separate branches per new feature?).
I had planned to start some other issues related to some of the those changes to check if they were ok & correct first.
Most of them are just exposing vars or adding some simple helper methods, although one does alter the movie writer finishRecording method, to attempt to get endProcessing to fire & trigger the complete delegate callback to work, & that almost certainly needs review & likely some more work (as I've only tested it with the video camera, not movie files etc.).
Would it be best to create a new branch, with just this movie writer initialize commit for now?
I thought there was a way you could selectively choose which files to send in a pull request, but I'm still figuring all this GitHub stuff out myself. A separate branch might be the cleanest way to handle this if that doesn't work.
Ah, that would be ideal, thanks. I'll have a look & read up, see if I can suss that out, & if not, start a new branch & get it submitted to you at some point today I hope. Thanks again Phil
Submitted a pull request here: https://github.com/BradLarson/GPUImage/pull/310
It seems you do need a dedicated branch to submit specific features, the first main answer here seemed to make it easy enough: http://stackoverflow.com/questions/5256021/send-a-pull-request-on-github-for-only-latest-commit Also found using the GitHub app made it easier to manage & push the new branch public.
Hopefully thats all ok, let me know if anything needs changing, & feel free to update it any way you see fit ;)