Encoding Videos In cloud Using Linux scripts or some softwares installed on linux - apache

I want to encode the videos, which user uploads, similar to youtube which transforms whatever video type you upload to flv, mp4,webm . Because i can only play webm,html5 video in my Webapp
So i need to do this thing. I have tried www.zencoder.net But thats costly for me, because i have to encode too much videos most of the time.
Is there any solution, how this can be done, I have ubuntu 12.04 server ,I think this could be done by scripting or just parsing videos to already installed encoding software, But dont know how to pass the videos to encoder, And what encoder should i install on my linux.
I am using php as server side language in my cloud storage website

You can do this by encoding the videos with FFmpeg.
On the command line you could use:
ffmpeg -i file.mp4 file.mp4.avi
You can use ffmpeg-php with PHP to get some ffmpeg features. But it looks like you will have to use the command line with the php exec function.
$fileToFlv="/var/www/test/input.wmv";
$fileFlv="/var/www/test/test.flv";
exec("/usr/bin/ffmpeg -i ".$fileToFlv." -ar 22050 -ab 32 -f flv -s 320x256 ".$fileFlv);

Related

What is the cURL command request to generate an mp3 text-to-speech file?

I am not a dev. I'm looking to generate synthetic voices for digital books which I am creating. I would really appreciate some help with the following. After inputting the curl command, what is the next step to generate a sound file? I would greatly appreciate any advice on how to proceed. Thank you.
You can generate audio files from text on your own desktop, depending on which OS your are running:
MacOs: MAC's "say" command to MP3
Ubuntu: https://askubuntu.com/questions/178736/generate-mp3-file-from-espeak
Windows: https://www.microsoft.com/en-us/search?q=text+to+audio (warning: store downloads on your own risk)
If you have a server running, you may use the server to generate the audio:
php: eSpeak to mp3 in php on both windows and linux (online text-to-speech)
nodejs: text to audio file on node.js
python: How can I convert text to speech (mp3 file) in python?

How to use MediaInfo with Amazon S3?

According to the MediaInfo ChangeLog, Amazon S3 support was added in v0.7.76 and even patched in v0.7.77 (latest).
However, I can't find any documentation on how to implement it. It's not in CLI help menu nor the SourceForge project pages. I was hoping someone here might have some insight as the SourceForge forum is closed off.
How do I craft a MediaInfo command to use Amazon S3 with Access Key & Secret Key? I'm using the CLI.
The closest thing I could find was someone's example Java code:
http://fossies.org/linux/MediaInfo_CLI/MediaInfoLib/Source/Example/HowToUse_Dll.JNA.java
It looks like they're crafting a custom HTTP request to S3 and streaming the response to MediaInfo. I'm not sure. I don't know Java; I only know Bash, Ruby, PHP.
Has anyone successfully got MediaInfo working with S3; something like this?
mediainfo https://AWSAccessKeyId:AWSSecretAccessKey#s3.amazonaws.com/bucketname/filename
Mediainfo executable can be built with libcurl on linux distribution using below commands: (I used centos)
yum groupinstall 'Development Tools'
yum install libcurl-devel
yum install wget
wget http://mediaarea.net/download/binary/mediainfo/17.12/MediaInfo_CLI_17.12_GNU_FromSource.tar.xz
tar xvf MediaInfo_CLI_17.12_GNU_FromSource.tar.xz
cd MediaInfo_CLI_GNU_FromSource/
./CLI_Compile.sh --with-libcurl
cd MediaInfo/Project/GNU/CLI
./mediainfo --version
Then following command will provide media information for Amazon S3 url.
mediainfo --Output=XML https://AWSAccessKeyId:AWSSecretAccessKey#s3.amazonaws.com/bucketname/filename
The above command won't work with AWS keys(filename) having special characters. By using pre-signed url, it is possible to use special characters in AWS Keys.
aws s3 presign 's3://bucketname/testing/mini & bar™©.mp4'
mediainfo 'presignd url'
The Java example is an example about how to download with Java and send data to MediaInfo from Memory. Now MediaInfo has native support of S3. So just provide this URL.
The only issue is that you must have libcurl available and MediaInfo compiled with libcurl support. This is not already available on all platforms (e.g. on Windows you must put libcurl.dll from libcurl website in the same folder as mediainfo).
Better delivery of such support (with libcurl provided directly, and fully tested, on all platforms) is planned but there is no ETA.
I face the same problem. Please try this, it will work
https://{yourAwsAccessKey}:{yourAwswsSecretKey}#{yourBucketName}.s3.awsamazon.com/{file_path_in_bucket}

Possible to run Dropbox within Nitrous.IO?

Nitrous.IO looks incredible. I'd love to use it with my students. However, we need the ability to have files locally accessible too. If we could run Dropbox on each Nitrous.IO box, that would be ideal. Is this possible?
Nitrous.IO has a Mac OS X application that handles local file syncing. So Mac users can utilize TextMate, SublimeText, etc... to edit their code and run it in the cloud. The Mac App is free to download:
https://www.nitrous.io/mac
For those not on Macs, you could use FTP or SCP, but I realize that might not be ideal:
http://help.nitrous.io/faq-adding-project/
Dropbox integration is on the product roadmap. Stay tuned to #nitrousio on twitter for updates.
There's a sync integration for windows, very much like Dropbox, using copy.com: Instructions here: https://coderwall.com/p/ixfokg.
So far dropbox has been running perfect! I'd love to know if there's any issue with running it this way... I simply ran:
cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -
nohup ~/.dropbox-dist/dropboxd > /dev/null 2>&1 &

ffmpeg install on windows server 2003. for use in rails app

I have a rails application which uses ffmpeg for thumbnailing/duration/file format conversion of videos.
Currently my rails app runs in ubuntu - where ffmpeg works great. But due to some client constraints , need to run rails app on windows.
I tried looking out for some writeups, googling around some forums but could not get a comprehensive list of steps to run ffmpeg on windows.
Any help/alternatives/links to ge it running would be of great help.
Thanks in advance.

Server side solution to convert PDF to SWF?

I've found some tools that can convert PDF to SWF, but I'm hoping to find something or even a library to be able to be able to incorporate this on the server to be able to store the SWF in a database.
Have you tried SWFTOOLS? On Debian/Unbuntu:
sudo apt-get install swftools
pdf2swf filename.pdf
http://wiki.swftools.org/index.php/Examples#pdf2swf
They have a Windows version, and the source so you can compile it on other Linux flavors.