Automated Youtube Playlists From CC-language? - youtube-api

If the videos of a certain account to a varying degree have closed captions/subtitles in multiple languages, would it be possible programmatically (or at all) to set up playlists, based on their CC-languages?
I.e. so that all the videos having French subtitles would figure in one playlist, and all that had German in one etc.
(Naturally, some videos might figure in more than one list).
The information exists, as the language of any given CC is specified at upload time. So in principle it ought to be possible .

You can use captions.list on the videos in the list of uploaded videos for that channel and specify part=snippet to get the language of the closed captions. From there, you can create a playlist based on that closed captions' language and add the video using videos.insert. Based on the programming language you'd like to use, you could do this programmatically as well.

Related

Is it possible to obtain the spoken language from youtube-dl?

I'm using youtube-dl to download videos from youtube that we query using words from a target foreign language, but there's no guarantee that the video is in the target language. Is there any way to know what is the spoken language in a video when using youtube-dl? I figure youtube must know this info since it generates captions for some videos.
Thanks!
I am not sure if you can use youtube-dl to get the video language, but if you use the Youtube Data API it is possible.
The documentation here shows that you can get the video language in multiple ways:
Video title / description language: snippet.defaultLanguage
spoken language in default audio track: snippet.defaultAudioLanguage
The option for you would be to call the Youtube Data API and check if snippet.defaultAudioLanguage matches your desired language.

is it allowed to save meta data about youtube videos in local databases

Is it allowed to save meta-data like video lengths, keywords and specific event information at certain point in time in the video?
For example, there is a movie trailer and I want to save the point in the video where a certain event occurs in my own database.
If the information is being used in conjunction with the YouTube api/player, then there is no problem as you are just creating shortcuts to an evet.
If you are not sure, then you can read the YouTube terms of service for an in depth answer.

iOS: Choosing specific Closed Captions EIA-608

There is lot of mystery around CC608 usage under iOS.
Apple's UsingHLS offers to declare them in the manifest like this:
#EXT-X-MEDIA:TYPE=CLOSED-CAPTIONS,GROUP-ID="cc",NAME="CC1",LANGUAGE="en",DEFAULT=YES,AUTOSELECT=YES,INSTREAM-ID="CC1"
#EXT-X-MEDIA:TYPE=CLOSED-CAPTIONS,GROUP-ID="cc",NAME="CC2",LANGUAGE="sp",AUTOSELECT=YES,INSTREAM-ID="CC2"
#EXT-X-STREAM-INF:BANDWIDTH=1000000,SUBTITLES="subs",CLOSED-CAPTIONS="cc" x.m3u8
But Apple's official sample stream do include CC608 embedded into the MPEG, and still they didn't list them in their manifest!
On that sample stream, I can turn CC608 on using closedCaptionDisplayEnabled=YES, but this method does not allow selection of a specific language.
In Apple's dev forum I have found this question with a promising answer:
Are you still calling "player?.closedCaptionDisplayEnabled=true"?
There's no need to do that. If you author your HLS playlist properly
with the appropriate language tags, the user can enable captions in
the language of their choice, or disable them completely as well.
I was failing to find API in iOS which will allow me to:
Read the list of available CC608 streams
Activate CC for a specific language
Would appreciate your help with this!

youtube direct lite playlists and auto-approval

After struggling with getting Ytd to work for a couple of days I'm about to dive into Youtube Direct Lite which looks much friendlier to set up.
My first question is about the playlist size limit. Once a playlist is full (200 videos?) what would happen with further video submissions? Would the oldest be dropped or is it just impossible to add any more, effectively breaking the widget for that playlist?
I expect I would need to use multiple playlists and manually make new playlists and widgets if there's a lot of videos, but is there a best practice kinda way to do this for a large number of videoslso?
Also, would it be possible to automate the submission approvals programmatically if there's a lot of videos or is this beyond the scope of ytd-lite.
Thought it's better to ask these questions now before starting the process of setting this up for my site. Ytd-lite looks like a great project.
thanks.
from the Doc:
https://developers.google.com/youtube/2.0/developers_guide_protocol_playlists#Adding_a_playlist
Note: Playlists contain a maximum of 200 videos. As such, you will not be able to add a video to a playlist that already contains that many videos.
I dont'n try to force this situation but I expect an error.
I believe that to automate the submission approvals programmatically you can modify the source code of YouTube Direct Lite, and with a little logic in the server side of your app you can do what you want.

Does AVPlayer support closed captions delivered in a separate text file?

My team produces iOS apps that play video using AVPlayer. We've recently been told that we MUST allow display of closed captions for all videos... but that the closed captions would not be coming as a track within the video files (we already support closed captions that come in this way). Instead, we'll be getting them as a separate text file. I've seen a couple references to including the caption text file in the SMIL, but I've found nothing about how to incorporate this text file into the playback experience. Does anyone have any personal experience with this, or know of any online documentation/tutorials that would help?
OK, we have a plan now, though it's a little complicated because DRM is involved. The simplified version is that we're going to do what's described in the What's New in HTTP Live Streaming talk from WWDC 2012 (https://developer.apple.com/videos/wwdc/2012/?id=512): namely, create a playlist that references our webvtt file(s), and then reference that playlist from the main m3u8. This will give us closed-captions-as-subtitles in iOS6.

Resources