DEV Community

Cover image for No Bullshit Guide to Youtube shorts automation in NodeJS, OpenAI, Ollama, ElevanLabs & ffmpeg
No Bullshit Coder
No Bullshit Coder

Posted on

No Bullshit Guide to Youtube shorts automation in NodeJS, OpenAI, Ollama, ElevanLabs & ffmpeg

We all have seen tutorials on YouTube that promise YouTube faceless shorts automation using some tools that use drag-drop or “No/low code” and all seems too easy, but as a developer you know “No/Low code” is not really “no/low code” it’s just hiding complexity for babies.

So just like any other developer, I thought I could “code” this as well, and instead of “Good UI/UX” I could create a “Great UI/UX”, a CLI (Command Line Interface).

So without any bullshit here is what you are for.

We will be creating a YouTube shorts automation that will accept 3 parameters

  1. topic: Topic for video (default: “science facts”)
  2. num: Number of shorts to generate (default: “3”)
  3. output: Output directory (default: “output”)

node index.js --help

Image description

Workflow

  • Fetch topics from generative AI for video content
  • Generate high-quality audio using Text to Speech services
  • Create captions automatically with the transcribe service
  • Download a stock video from the free video API
  • Produce the final video

With this powerful automation script, you can generate high-quality YouTube Shorts quickly and efficiently, saving you hours of work!

What You’ll Learn:

  • Setting up the automation script in JavaScript
  • Using the OpenAI API and Local Ollama API for content generation
  • Integrating Eleven Labs API or OpenAI Audio API for Audio Creation
  • Capturing captions with AWS Transcribe using AWS SDK v3
  • Pexels API and download video
  • Rendering with FFmpeg

Github


Full step-by-step Youtube Tutorial

https://www.youtube.com/watch?v=YvGKsPkWzRs

I am working on creating more content on YouTube, and you see I still don’t have enough subscribers and views to monetize my channel. I would appreciate it if you subscribe and watch the video. Please show some love.

No monetizing also means
You will see the whole video "Ad Free" 🤣.

Free or Open Source alternative to paid service

  1. I have also provided code to use Local Lamma instead of chatGPT
  2. Pexels video API is free
  3. FFMPEG is free and open source

Out of 5 services used in the code, 3 of them are either free or you can find an open-source alternative.

If you find any good open-source or free alternative to text-to-speech and audio transcription, please let me know in the comments.

Links

Next Steps:

  1. Add a background music
  2. Randomize the TTS voices
  3. How to break long videos into clips and then create shorts out of that
    • Break the clips into smaller chunks
    • we will resize them to fit the vertical format
    • transcribe and caption
  4. We will use AI to center the speaker in case of podcast or interview videos
  5. We will also use YouTube data API to upload the video directly to YouTube
  6. We will use a YouTube heatmap to figure out what was trending moment in the given video and auto-create clips out of it — this will be the true long-to-short automation. you just pass the video URL and it will generate 10–20 shorts of trending topics.

What do you think?

Let me know what else we can do and your thoughts on the process improvements and peer review.

If you like this tutorial
Subscribe to me on YouTube: https://www.youtube.com/watch?v=YvGKsPkWzRs
and follow me on Twitter (X) (Yeah I still call it Twitter): https://x.com/nobullshitcoder

Thank you & take care.

Top comments (0)