Public Videos API

How to build the URL

GET calls

http://{publicvideos_api_node}/v/{version}/{resource}

  • publicvideos_api_node: Just replace it with api.publicvideos.org for now :)
  • version: the version of the API to be used. Replace it with 0 for now since there is only one version of the API (version 0).
  • resource: one of the available entrypoints for the API version you are using. Example clips/total

Example

curl http://api.publicvideos.org/v/0/clip/2184

POST, PUT, DELETE calls

Not implemented yet.

Glossary

Clip
Scene captured on video.
Set
Collection of clips.
Author
Person who shots clips.
Version
Digital file representing a clip.
Transcoder
Agent that given a clip generates a version.
Transcoding Step
A command executed by a transcoder.

Current version: 0, status:under development

Resources

Objects

Lists

Filtered Lists

Discussion

Jerome CovingtonJerome Covington, 2010/08/13 10:08

Queries to the API return filenames such as 2009-05_00346_plants-against-sun-leaves-green.mts

How do I play this file in the browser?

Fabricio ZuardiFabricio Zuardi, 2010/08/13 14:22

Yes, the documentation is a little bit confusing, that filename is not a url for a file, it is just the original file(before transcoding) filename. To get the browser-playable files you will have to use the /versions/… entrypoints. :)

Fabricio ZuardiFabricio Zuardi, 2010/08/13 14:36

For example: http://api.publicvideos.org/versions/transcoder/2/ gives you some random 640×360 Theora OGV files, while http://api.publicvideos.org/versions/transcoder/20/ gives you some random 640×360 VP8 WebM files, http://api.publicvideos.org/versions/transcoder/10/ some black and white 192×108 jpeg files, and so on…

To get a list of all transcoders available use http://api.publicvideos.org/transcoders/latest

If you have any suggestions or need any extra help please let me know :)

Jerome CovingtonJerome Covington, 2010/08/25 10:56

This call to the Public Videos API http://api.publicvideos.org/v/0/clips?callback=foo using jQuery's getJSON method does not return JSONP wrapped in foo(json goes here).

I want to access the API using client side JS only.

Is it possible to use the API strictly from the client side to get JSONP, bypassing cross domain issues?

Fabricio ZuardiFabricio Zuardi, 2010/08/25 11:38

That's actually a great feature request!!

Can you please file a bug at https://bugs.launchpad.net/publicvideos/%2Bfilebug

Or even better, create the patch that implement that and send me a pull request at http://github.com/fczuardi/api.publicvideos

Anyways, this should be a simple nice thing to add, I will give it a shot when I have time and let you know :)

Thanks!

Fabricio ZuardiFabricio Zuardi, 2010/08/25 11:53

Here is how the json output is written to the response today:

http://github.com/fczuardi/api.publicvideos/blob/3b48c24b7aba06326113cd18f30da721ffe82814/api/methods.py#L58

See that we are using a simple Python json.dumps, the fix to support a callback=foo would involve tweaking the url patterns at http://github.com/fczuardi/api.publicvideos/blob/1f3645bb0bfca53b8f0358478fe821d62a53fc2d/api/urls.py to accept this extra parameter and then update the correspondent methods to add the wrapper if the parameter is passed.

Fabricio ZuardiFabricio Zuardi, 2010/08/26 15:17

It's even easier than that, no changes in the urls.py required, just use tornado's self.request.arguments dict to get the value of the option inside the methods…

Fabricio ZuardiFabricio Zuardi, 2010/08/26 16:19

Hi Jerome, it should be fixed now, please test it and let me know :)

Enter your comment
 
 
api/main.txt · Last modified: 2010/03/21 04:01 by fczuardi
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki