Video Conversion in Python on Google App Engine - python

I am using Google App Engine to host a website where I want users to be able to upload any video and then I want to use flowplayer to display it, which requires MP4 and webm formats to support all browsers. I have it working correctly where a user uploads a video and then I can serve it but I need to convert it into those two formats so that I everyone can view the video.
Is there any Python project I can import to do the conversion on App Engine or any resources showing how I can do it with something like Google Compute Engine? I need it to be done automatically on the server and most projects that look stable for this in python are written to by done by command line on a personal computer.

I'm not sure about Google App Engine, but you may want to look into using FFMPEG. I am currently hosting a site on heroku and have been able to use it spawning a task that will automatically grab an image from the uploaded video for display and convert the uploaded file to mp4. In order for conversion to mp4, you will need a compilation using libx264. I am no expert on this, but it may be something you want to look into if you haven't already. In my app on heroku, I am able to convert uploads to mp4, but it has definitely taken some time to figure out the right configuration and it still takes longer than I would like. However, I am also a fairly new developer and this is my first app ever created, so it might be easier for you to get working the way you want it.

Related

Automatically create and upload a Youtube video from my cloud storage

I was pondering the idea of a script/program that will auto upload to Youtube from cloud storage. I'm sure this has already been done and would appreciate it if someone could put me on the right path.
Thanks
Your are not giving a lot of detail informations e.g. what cloud you use? Maybe i'm keeping it way too simple though:
I guess this problem can be splited in to two parts:
Download to video to your local system. There are a lot of articles/documentation for all kind of cloud storage provider e.g. google cloud
Use the provided YouTube API documentation to upload your video you just fetched to your local system.
You may want to delete the video on your local file system.

embedding videos loaded on box

So basically we would like to integrate our platform with box.net, in particular to be able to stream videos uploaded there, since we can't unfortunately use youtube/vimeo (which support noembed).
I had a look in the doc and:
it seems that for videos the preview is only working for flv and swf.
However I tried with my personal account and one swf embedded with their embedding link didn't preview anyway.
I would like to use the API to upload videos directly from the client, but what happens if the user is not actually authenticated to box.net and the video is private (which is our requirement).
If embedding videos with box is just not going to work we can look at other alternatives, but unfortunately from the list of supported sites http://noembed.com/
it doesn't that we could use any of the services..
For the second point, you can just do all the authentication for your site via box.net. They provide authentication as part of their api: http://developers.box.com/oauth/.
When a user logs into your site, authenticate them with box.net using python requests, and a custom authentication backend, django docs here, example on stack overflow here: Django Remote Authentication without redirecting.

convert text post into xml file using python in google app engine

newbie here in need of help.
Using App Inventor amd App Engine. Learning python as i go along. Still early days. Need to post text data from AI to app engine, save in blob store as file (.xml), to be emailed as an attachment.
Am able to send pictures using Shival Wolfs wolfwebmail2, and am sure with a bit of playing with the code i can change it to save the text post as a file in blob store to do the same operation.
As stated newbie learning fast.
Many thanks in advance for any pointers.
The solution I found was to do nothing with shival wolfs code on app engine, and to replace the 'postfile' block in the app inventor code with a 'posttext' block with the text you want to send attached to it. Also change the filename variable to the name you want the file called including file type (i.e. .xml, .csv, .txt etc). This appears to work for me.

Python: How to Capture WebPage as Image File?

I want to cache a webpage as an image upon a user request, but I don't know where to start with this.
I'm developing on App Engine with python.
Here's a good library for capturing a webpage as a png image:
http://github.com/AdamN/python-webkit2png
One way is to use a web service such as thumbalizr since a lot of the programs for this type of thing aren't always install-able on appengine (because they use C++, etc). Other options include girafa and browsershots.
There are websites that to this for you. Google is your friend. If you build a script around them, you have what you need. As a demonstration, see http://webshots.velocitysc.com/sandbox/.
There are also downloadable programs that do it, such as the one at http://download.cnet.com/Advanced-Website-to-Image-JPG-BMP-Converter-Free/3000-2094_4-10900902.html. These are just examples; google a while and you'll find better implementations.
If you want to do it yourself, you basically need to duplicate a web browser (the HTML rendering part, anyway), which is unrealistic, or use a preexisting rendering engine like webkit as Zach suggests. If I were you, I would forget about doing it myself and use a preexisting web service, unless this is going to be the core of your application.

CDN options for image resizing

Background:
I working on an application on Google App Engine. Its been going really well until I hit one of their limitations in file size -- 1MB. One of the components of my application resizes images, which have been uploaded by users. The files are directly uploaded to S3 (http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1434) via POST. I was planning on using a CDN to delivered the resized images.
Question:
I was wondering if there was CDN that provided an API for resizing images through HTTP call. I found out that SimpleCDN once provided the service, but has sense removed it. I would like to tell the CDN to resize the image I am requesting from the URL.
For example,
original URL:
http://cdn.example.com/images/large_picture.jpg
resized image to 125x100:
http://cdn.example.com/images/large_picture.jpg/125/100
Does anyone know of CDN that provides a functionality like this? Or have a suggestion to get around the 1MB limit on Google App Engine (not a hack, but alternative method of code).
Looks like I have found a service that provides what I am indeed looking for. Nirvanix provides an image resize API and even has a nice library for Google App Engine to use with their API. Just thought I would share my findings.
SteadyOffload does it as well.

Categories