Trim video using YouTube Data API - youtube-data-api

I understand that you can trim the video using the youtube.com interface but I was wondering if it is possible to use the YouTube Data API to trim the video.
Since I don't user to upload video on my site longer than 15 seconds.
Thanks

API example (according to http://www.youtube.com/player_api) to TRIM with START and END parameters:
http://rawgit.com/tazotodua/several-YOUTUBE-PLAYER-SCRIPTS__with_API/master/example99-CUTTER/index.html

Related

YouTube search API not filtering embeddable/syndicated videos

Somebody already asked this question a year ago here, but it didn't get much elaborated answers.
I'm trying to embed YouTube videos into my application. I use YouTube Data API v3 - Search: list to search for videos to embed. To check if video is embbedable and syndicated, I set the videoEmbeddable and videoSyndicated parameters to true (as well as the type parameter to video). But this doesn't work most of the time.
For example, when I search for some random commercial song (e.g. Weeknd - Blinding Lights), the first result I get is some unofficial lyrics video (this), which is fine but can't be embedded into my application. Here's a screenshot of how it looks like when I embed it:
I know this happens due to copyright issues, but is there a way to be sure if video can be played outside of YouTube?

Retrieve audio data in JSON format and play it through Amazon Alexa

I am working on a custom lambda function in JavaScript for the Amazon Alexa. Amazon's docs have clear details on building custom skills, and I have successfully built several "stock" skills from their templates.
I am writing a unique skill now which must retrieve the JSON data located at this link:
https://api.ense.nyc/latest
and then 'play' that data (since the data is snippets of audio) through the Alexa. I am not sure what to write to bring about this functionality.
This is a bit complicated than your average stock skills, from the url it looks like a podcast skill.
You need to
Parse The JSON and get the audiourl from the list.
Set the skill state to PLAY_MODE.
Keep track of audio progress with audio event handlers.
Probably use a dynamodb alike database to persist incase your session ends and your audios are long so they keep on playing.
here is a sample skill, that parses a RSS feed for a podcast then plays the audios in a row
https://github.com/bespoken/streamer
It seems that the audio files are short. In that case connect to the endpoint using an http fetch library (eg. httpm module, node-fetch or axios in node.js). Once you get the json file navigate to the properties that have the audio, get the url, surround them by audio tags <audio src="url"/> ands send them in a standard speech response of your skill. The audio tag has time and quality limitations so if you run into issues the audio is probably longer or a different quality than expected.
1)The audio should be available to public in (.mp3)
2)The audio should be in Alexa-friendly format
Converting audio files to an Alexa-friendly format using Audacity
1)Open the file to convert.
2)Set the Project Rate in the lower-left corner to 16000.
3)Click File > Export Audio and change the Save as type to MP3 Files.
4)Click Options, set the Quality to 48 kbps and the Bit Rate Mode to Constant.

Video Playlist from different vendor sources (Anvato/Brightcove)

Is it possible to create a video playlist using videos either from Anvato or Brightcove at the same time?
So far I created playlists from one or the other using their respective docs, but I would like one that takes videos from either.
Context:
You have settings to create a video from Brightcove or from Anvato.
Brightcove requires:
Video Id
Account Id
Player Id
Anvato requires:
Account Id
Video Id
Using their respective SDKs you can load a video using those settings. But both BC and Anvato provide mechanisms to load a playlist from a list of Video Ids.
So to create a BC Playlist you use their docs and use the markup along with your list of Video Ids. Same for Anvato.
But in theory it should be possible to have one video player that runs all of the video sources if we could get the straight url to the source file.
You could certainly do this with the Brightcove Player. By default, it assumes you're pulling all of the videos from the Video Cloud catalog, as that's what most people do. However, there is a lower level API that allows you to pass an array of video objects in to the playlist. It's call player.catalog.load().
So if you wanted to merge playlists from Anvato and Brightcove:
1) Call Anvato's API to get the list of video metadata/URLs.
2) Call catalog.getPlaylist() on the Video Cloud APIs.
3) Append the data from Anvato to the array you got in #2
4) Pass the merged list into player.catalog.load()
Here's some more info.
http://docs.brightcove.com/en/video-cloud/brightcove-player/guides/playlist-api.html

Take image out of video stream in ruby

I have a link to some video stream (web cam that is always recording some place). I would like to be able to take a screenshot of what ever is on that video stream at the moment a user goes to my app.
Can it be done and how?
I have looked but all I could find was for taking screenshots out of a movie/video, not out of a streaming video.
I suspect ffmpeg connected to the streaming service as an input could probably extract thumbnails for you. You could either leave it running and pick up latest thumbnails, or fire it up with a system command and make it connect and emit a single screenshot. The latter would be more efficient and easier to code if you have a low number of hits, but would have a high latency on each request.
I did a quick search for you, but the most common uses of ffmpeg with streaming input is to re-format and re-stream, or to use it in personal video recorder setup. Ffmpeg is quite complex, so I could not complete the search in the time I have had so far.

How to access data in AudioQueue buffers?

I am struggling to work out how to pass the data from buffer to an array to allow me to display what is in the buffer. Is there an example of code somewhere that is a simple record audio and read buffer? Simpler the better.
I am trying to do something in real time and not read in data from a saved file. I could paste some code that I have tried with no success.
The classic example of writing and reading to audio buffers using AudioQueue is Apple's SpeakHere sample project.
You can find tons of stuff on this and on the web. Just search on "speakhere". One standout page is Matt Gallagher's articles on Streaming and playing an MP3 stream.
Check out my personal answers also. I have some quite in depth posts on audio buffers, e.g.
iOS Stream Audio from one iOS Device to Another

Resources