Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added transcoding support for android and video trimming. #3

Merged
merged 16 commits into from
Feb 4, 2015

Conversation

rossmartin
Copy link
Collaborator

This PR has a few additions and improvements:

  • Added transcoding support for Android using ffmpeg4android lib (bundled with CLI install).
  • Added video trimming support for both platforms via the duration option.
  • Refactored the plugin interface, now similar to the cordova media capture plugin and options are now passed as an object rather than parameters.
  • Renamed all instances of VideoEditorPlugin to VideoEditor.
  • Renamed VideoEditorConstants to VideoEditorOptions.
  • Updated the readme to reflect all new changes.
  • Changed plugin id from org.apache.cordova.videoediting to org.apache.cordova.videoeditor.

Next I will be adding the ability to grab JPEG snapshots from a video file and continuing to test/improve the plugin.

@jbavari
Copy link
Owner

jbavari commented Feb 4, 2015

Beautiful dude! Thanks again.. You're crushing it!

jbavari added a commit that referenced this pull request Feb 4, 2015
Added transcoding support for android and video trimming.
@jbavari jbavari merged commit 4a1bfc7 into jbavari:master Feb 4, 2015
@rossmartin
Copy link
Collaborator Author

@jbavari Thanks I'm going to start working on creating JPEG snapshots from video today. Appreciate all the help can't wait to get the next version of my app out that is already using this.

@oliverholmberg
Copy link

Woohoo!

@oliverholmberg
Copy link

This is great. I've worked with FFMPEG in linux quite a bit. Working on a
pull request with a few tweaks to encoding settings based on QUALITY
variable.

For now, I think the encoding settings for the 3 quality levels should
match those that iOS produces with said quality levels, for consistent
results between platforms.

As a side note, it would nice to get FFMPEG going in the IOS version of the
plugin. That would allow more granular control of encoding options
(bitrate, custom frame sizes like squares for Vine like integrations) on
both platforms.

Encoding with FFMPEG, you could provide the following options from within
the JS interface:

Height, Width, Video Bitrate, Audio Bitrate, Audio Channels, Rotation,
Start Time, End Time, ect.

On Wed, Feb 4, 2015 at 12:41 PM, Ross Martin notifications@github.com
wrote:

@jbavari https://github.com/jbavari Thanks I'm going to start working
on creating JPEG snapshots from video today. Appreciate all the help can't
wait to get the next version of my app out that is already using this.


Reply to this email directly or view it on GitHub
#3 (comment)
.

@rossmartin
Copy link
Collaborator Author

@oliverholmberg Awesome are you working on the Android version right now? I just added support for creating JPEG images from video in this new PR - #5

PR #5 fixes an issue with the wrong plugin class name for iOS. The plugin worked but the JS was calling the wrong plugin class but it is fixed now in the new PR.

Looking forward to seeing where this goes, it's already changed the game for my Ionic app. Now my HTML5 videos run smooth on each platform and have posters!!!

@oliverholmberg
Copy link

@rossmartin Copy that. I'm just changing a few ffmpeg settings based on the quality setting (for android versions), namely bitrate and framesize. I'll PR that in the next day or so.

I don't really know where to begin with updating iOS to use ffmpeg.

@jbavari
Copy link
Owner

jbavari commented Feb 5, 2015

@oliverholmberg - it'd be nice to have FFMPEG on iphone, but realistically speaking, they probably wouldnt allow it due to 'invalid apis' being used.

They already provide their own transcoding class.

Here's to thinking big though! :)

@oliverholmberg
Copy link

I'll bet you're right on that, however, there would have to be another way
to do more specific transcoding on iOS than the method in this plugin, as
it doesn't allow you to specify bitrates and resolution, and I know that
some apps are doing that. (IG, Vine) I'll probably be looking into that
further. The more video editing capability I can get from phonegap, the
more success I will have with my project.

Cheers.

On Thu, Feb 5, 2015 at 4:01 PM, Josh Bavari notifications@github.com
wrote:

@oliverholmberg https://github.com/oliverholmberg - it'd be nice to
have FFMPEG on iphone, but realistically speaking, they probably wouldnt
allow it due to 'invalid apis' being used.

They already provide their own transcoding class.

Here's to thinking big though! :)


Reply to this email directly or view it on GitHub
#3 (comment)
.

@oliverholmberg
Copy link

There are a few "ffmpeg for ios" projects out there. That is no guarantee
of course that Apple will allow them.

https://github.com/chrisballinger/FFmpeg-iOS - This one has an obscure note
regarding Apple and lisencing at the end.

On Thu, Feb 5, 2015 at 6:58 PM, Oliver Holmberg oliverholmberg@gigity.tv
wrote:

I'll bet you're right on that, however, there would have to be another way
to do more specific transcoding on iOS than the method in this plugin, as
it doesn't allow you to specify bitrates and resolution, and I know that
some apps are doing that. (IG, Vine) I'll probably be looking into that
further. The more video editing capability I can get from phonegap, the
more success I will have with my project.

Cheers.

On Thu, Feb 5, 2015 at 4:01 PM, Josh Bavari notifications@github.com
wrote:

@oliverholmberg https://github.com/oliverholmberg - it'd be nice to
have FFMPEG on iphone, but realistically speaking, they probably wouldnt
allow it due to 'invalid apis' being used.

They already provide their own transcoding class.

Here's to thinking big though! :)


Reply to this email directly or view it on GitHub
#3 (comment)
.

raozhiming pushed a commit to elastos/Elastos.Trinity.Plugins.VideoEditor that referenced this pull request Nov 20, 2020
Added transcoding support for android and video trimming.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants