Get info about video that not finished encoding - ruby-on-rails

Where does all meta data about video file comes from? Is it comes from original video or from encoded?
I'm trying to write video duration into database, but i'm not sure if i can get this value during POST on my server

This english is hard to read but I'll take my best shot. I also have zero experience with pandastream but the API looks easy enough. It look like the pandastream requires you to upload the video file first. Then work off an ID.
In the api docs at: https://github.com/pandastream/panda_gem, it looks like
encodings = Panda::Video.find("1234").encodings
means that you have to have encoded it first. They are just sending the attributes down to you over the web API. After you query for the attributes, you can do anything you want with it, like inserting them into a database.
You could even loop through all the videos on your account and get the video duration and bulk insert them.
videos = Panda::Video.all
# loop through videos as |upload|
# find video as video
# insert into database upload.id and video.attributes["duration"]
Good luck!

Related

Videos URL structure with nothing but a date in it to keep every video shareable?

what is the approach to store multiple videos from an author in his named folder, but then there are 1-n videos from this author?
YouTube has for every video a complete different URL with an ID. Casual/Older users don't know where they are.
News sites seem use /topic/title-id123
Cnn uses /yyyy/mm/dd/title
To keep this question answerable: What URL structure would you recommend for me?
- every person has some videos without interesting title we could use
- the date from start day to end day is more likely important (2005-12-12 to 2005-12-17)
- every video should be social media shareable, so I think they all need a single URL and can't just be all embedded in /videos/name
Store them however is the best for the backend editor workflow (you didn't mention, how and when new videos are added), in 6.2 you have file abstraction layer, so each file in fileadmin has assigned ID. If you want to make your videos nicely social media sharable, you need to provide additional metadata such as video name and thumbnail etc, so I would suggest building a plugin for this which would take the video ID from the URL and display it with all the additional data necessary.
If you are using EXT:realurl (which I hope you are), you can configure to the video title in the URL, which would look like: /somepage/video/video-title/ or even /somepage/video-title/ . Adding /yyyy/mm/dd/ in the URL only makes sense if you are producing multiple videos every day, otherwise it feels pointless.
for building unique URLs with realurl for news you find solutions to include the uid of the news.
As TYPO3 handles all files with FAl you might use the unique file_sys:uid in your video URL. You might use realurl to generate and resolve URLs like:
/videos/123/title_of_video/

Youtube videos' Topic Ids dataset / dump

While processing youtube videos, I'm working with the youtube's API v3. The cycle goes like this:
1) Get video
2) Request API for video's topic Id
3) Find the tuple(s) on my local Freebase dump
4) Do things.
For efficiency reasons I'd like to avoid the online request on step (2), and instead do it offline. Is there any datasets/dumps I can get, that store information like:
Youtube video's ID -> video's topic ID ?
Thanks in advance,
Orestes.
YouTube doesn't provide data dumps of video topicDetails (or any other data server by the YouTube Data API as far as I know).
There is not a store I know. But there are few things to make it more efficient. Instead of calling videos->list per each video, make all video Ids into a comma separated string and do one call. Also specify filters like items/contentdetails/topicId, so response would only return topicIds, instead of all other information.
That way you can get all your information at once, with less bandwidth.

Youtube upload api duplicated video (get the right ID)

When a video is duplicated (let's say v = GgVH5fXXYSE) , is there a way i can find the videoid of the "good" one (the one that should work) with the duplicated id.
(so with GgVH5fXXYSE i could find eNqZgEgOfsw)
Thanks!
Unfortunately, there's no way to get this information. It's come up as a feature request a number of times in the past, and there are technical reasons why this can't be exposed in the YouTube Data API response.
If you have APP, that solely uploads file to particular (authorized) youtube account(s), then you can get it done using following method. Maintain a hash of all input files and while uploading file, check ,if you have old file having same hash as current file upload, and that old file was uploaded successfully, then don't upload that file and use youtube link = old file's ( having same hash as current file) youtube link.

Retrieving artist and song information from youtube

A long time ago, I developed a chrome extension that is able to scrobble the songs you listen to on youtube (via your last.fm account). What I did was simply taking the title of the video and assuming it had the proper format: "Artist - Track name" (obviously, I would send a request to last.fm, confirming it was a proper artist/song pair, before scrobbling). Recently (well, probably a couple of months ago) youtube started to provide artist and song information directly under the video (see image), and I was wondering how best to extract this information.
I was hoping to retrieve the information via the youtube feed api call (http://gdata.youtube.com/feeds/api/videos/videoID?alt=json), but it doesn't apear to be featured in the returned json element. Alternatly, I could try extracting it via xpath, but I figure that might lead to complications when no artist/song information is present. If anybody could help me extract this information, and thereby greatly improving my extension, I would be very grateful.
I don't think YouTube API can provide you with the artist name
as the videos can be other things that songs
you need to stick with what you have , unless they updated there API

YouTube API: videoEntry context in playlist

Is it possible to find the context of a video in respect to any playlist that it is included in? I would like to be able to check if the videoEntry is included in a playlist and, if so, figure out the next video in the playlist.
Flickr has a lot of great photo context methods, I hope YouTube does too, I just can't find anything on it.
Well, obviously you want to know the VideoId of the video in question first, right? So say it's "4eUibFQKJqI" and it's in a playlist whose Id is "6C0464B5CC81A607" (You can easily get those Ids from your 'My Account' section in YouTube).
If I get the feed for that playlist, then the resulting xml file gives you all the information you need to check if that Video is present, and the order that you have set in 'My Account' is preserved.
So, you have two ways of analysing the results that YouTube sends you. One is to make a request to that playlist address and parsing the results using Linq-to-Sql, if you use Asp.Net, for example. Whatever language you use, it will have Xml-parsing capabilities, so it's just a case of iterating through the entries in the feed.
If you use a library for your language, it may well have a specific method to determine whether a given video is in a given playlist, but if it doesn't, it's pretty easy to query the raw xml file and get that information, as described above.
Hope that helps - it's hard to tell from your question what level you're at with this stuff... Anyway, it's all at the Developers' Guide.
http://gdata.youtube.com/feeds/api/playlists/PLAYLIST_ID?v=2
from http://code.google.com/apis/youtube/2.0/reference.html

Resources