Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Youtube Data API V3 Javascript - Upload audio and image as video

I am working on youtube data api v3 to upload an image and an audio as video with image will be displayed as a video.

I can able to upload videos as it is already given as an example.

I tried thumbnail: $('#file_image').val(), to set video thumbnail. But it didn't work as I expected. I also search over the internet to get an idea. But didn't get any idea.

UploadVideo.prototype.uploadFile = function(file) {
  var metadata = {
    snippet: {
      title: $('#title').val(),
      description: $('#description').text(),
      tags: this.tags,
      thumbnail: $('#file_image').val(),
      categoryId: this.categoryId
    },

Is this feature achievable using youtube data api? I knew that we can upload an image and audio together works as video in youtube (not through API).

Youtube reference url

Youtube data api Reference

UPDATE:

Using ffmpeg we can able to create a video by combining audio and image. The created video uploaded to Youtube via Youtube DATA API. It works. Now I am trying to automate the following scenario using a script.

Upload Image and Audio. Create the video using ffmpeg. Once video successfully created, upload the video using Youtube DATA API.

I can able to create a video using ffmpeg commands in command line. But when I try to use PHP code, the command is not executing.

like image 919
Gunaseelan Avatar asked Jun 03 '15 08:06

Gunaseelan


2 Answers

You can use ffmpeg to make a slideshow. Then upload the resulting video. https://trac.ffmpeg.org/wiki/Create%20a%20video%20slideshow%20from%20images

like image 98
Yetti99 Avatar answered Sep 23 '22 00:09

Yetti99


At the moment, no, unfortunately. According to the support article you posted, "Upload audio or image files", there is no API to upload images and audio separately and let YouTube combine them for you. You have to either:

  • Combine images and audio yourself and upload the resulting video
  • Use YouTube's slideshow maker on the upload page
like image 32
approxiblue Avatar answered Sep 20 '22 00:09

approxiblue