Last active
December 22, 2015 01:08
-
-
Save BigWillie/6393759 to your computer and use it in GitHub Desktop.
Dream code for video conversion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
convertVideo('videoFilename.mp4').to( { | |
filename: 'newVideoFilename.3gp' | |
service: 'Amazon Elastic Transcoder', | |
frameRate :"auto", | |
resolution :"auto", | |
aspectRatio :"16:9", | |
interlaced : false, | |
compression: '90%' | |
} ).save(); | |
// Service - choose which third party, or library you wish to pump this through | |
// It uses whatever the new file extension (eg .3gp) is to decide what codec's to use internally. You can specify framerate, res.. etc... defaults are 'auto' | |
// would be cool if there was some way to add a wildcard that converts across a spread for different device types automatically... | |
// or a way that you can specify a default config for all video conversion. The same could also be applied to Audio. |
That looks awesome :) And maybe give the option to pass a path/location as an argument within save( ). If left blank - it assumes the same path as the original file.
That's interesting, now I see that you made the dream code with Node.js in mind, right? I did it as working code that runs right in the browser, meaning that /path/to/videoFilename.mp4
must be accessible via the web. And save() would open the download dialog of the browser. An optional filename could be passed, but it's already passed to the .to()
method.
And I liked your .save()
better than my download
method from my convert gist. So instead of
download( convert( $('.invoice') ).to( 'invoice.pdf' ) )
I'd rather do
convert( $('.invoice') ).to( 'invoice.pdf' ).save()
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how about:
could be combined with the dreamcode over here:
https://gist.github.com/gr2m/5463605
I like the
.save()
method at the end