Skip to content

World-of-Enlighten/VideoGeneration

Repository files navigation

Video generation

In order to have distinguishables videos in style while having an harmony in our posts, videos will be respecting norms : The video template is available in another repo temporarily (VideoTemplate), during the process it should be in the same directory.

#go to the desired folder
git clone https://github.com/World-of-Enlighten/VideoGeneration
cd VideoGeneration
git clone https://github.com/World-of-Enlighten/VideoTemplate
  • Intro ~5sec : date, title, watermarks, theme / categorie...
  • Content : Components variables, time variable
  • Outro ~3sec : same components for each videos, with same pos but color scheme may vary,

Builtin functions

Todo list

  • Get Tiktok trending Hashtags
  • Get TikTok trending songs
  • Prompt to GPT
  • Caption generation
  • Default video templates with remotion
  • Video generation with Deforum
  • Scrap TikTok Creative Assistant

TikTok

TikTok hashtags

Use :

#assuming that you are running in parent dir
from src.scraper import Scraper
scraper = Scraper()
print(scraper.tiktokHashtags(numHashtags=14,tag='Education'))

Note that all the variables in this function are optionnals so no need to put anything.
Here are the default values in case you don't put anything for the respective options :

  • <numhashtags> is 9
  • <tag> is Health

Replace <number hashtags by any positive integer between 3 and 100. Replace <your tag> by one of the tags available in TikTok Creative Center.

Tags Available - Apparel & Accessories
- Baby, Kids & Maternity
- Beauty & Personal Care
- Business Services
- Education
- Financial Services
- Food & Beverage
- Games
- Health
- Home Improvement
- Household Products
- Life Services
- News & Entertainment
- Pets
- Sports & Outdoor
- Tech & Electronics
- Travel
- Vehicle & Transportation

TikTok Songs

This function allows you to get all the approved for business use songs in TikTok Creative in a list of file url.

#assuming that you are running in parent dir
from src.scraper import Scraper
scraper = Scraper()
print(scraper.tiktokSongs())

TikTok video that uses a song

This function allows you to get the url of a video using the respective song.

#assuming that you are running in parent dir
from src.scraper import Scraper
scraper = Scraper()
print(scraper.tiktokSongsVideoUrl())

Ask GPT

There is two ways to prompt to GPT, the first one uses GPT-4 through you.com and playwright.dev the second one use GPT-3 through Ava AI API

GPT-4

In order ot use GPT-4 function, you should give a prompt, the other arguments of the function are optionnal.

#assuming that you are running in parent dir
from src.scraper import Scraper
Scraper().askGPT('hello world',option='caption',random=0))
  • option : Choose whether you want default instructions or not. Using None it will be a « vanilla » GPT-4, else it would be given instructions about the generation : it will generate captions for a TikTok video depending on a long description. The default value of option is caption
  • random : Since those answers are obtained with a scraper, a login is required, setting random to True will login to a newly created account, False will login into a pedefined email associated with an existing account. random is set to False by default. You will not need to change this, except in case you're not getting answers.

GPT-3

In order to use the GPT-3 api, the arguments are the same than for GPT-4 except the fact that the random argument has been deleted.

#assuming that you are running in parent dir
from src.gpt import Completion
print(Completion.create("hello world",option='caption'))

Same for GPT-4, default value of option is caption and it is an optional argument.

GPT-3 Turbo

#assuming that you are running in parent dir
from src.gpt import Completion
print(Completion.g4f("hello world",option='caption2'))

The delay tag serve for a lot of things. It was meant to make the video generation easier. This component is in charge of :

  • Wait time before display
  • Fade, with custom frames
  • Time of display (choose whether you want to remove the element after a certain time or keep it)
  • Typing effect for text

Wait time

About the delay, wait time is relative to the Delay parents. Example below

<Delay wait={5}>
Hello world!
<Delay wait={10}>
Foo bar
</Delay>
World hello ?
</Delay>

This example will display Hello world and World hello ? after 5 seconds since they are inside of the Delay component. Additionnaly, depending on the position time can be relative. This explains why Foo bar will not show at the 10th second but the 15th.

Fade

You can make an element fading when displaying, this can be done with the following :

<Delay fade={20}>
Lorem Ipsum
</Delay>

This will lead to a fade of 20 frames.

Remove after

If you want to remove elements after a certain amount of time you can use the following :

<Delay removeafter={5}>
Bonjour!
</Delay>

The following element will disappear after 5 seconds. If you are using wait in the same time, it will start counting only after the display of the element so it will still remain visible on screen for 5 seconds.

Typing effect

To make a typing effect, you will need to put the text as an argument. Then you can set the typing speed. typingSpeed $&gt; 1$ results to a speed up, typingSpeed $&lt; 1$ results to speed lowering. The text will appear at the beggining, so you can still put other elements within the Delay tags, they just wont have the typing effect.

<Delay text={"Hello world!"} typingSpeed={1}>

This tag allows you to display any branding element given options. There is two arguments :

  • type : Type of the branding element
  • theme : Color scheme of the branding element (by default main green).

Alt text
This tag produces the calendar above. By default it will take the actual date (month and day) but you can change separately the month and the day as you want with the optional arguments of the same name.

Create a slide depending on the arguments provided as type.
This argument is optional, by default 0. It is a number.

Different slide types
Slide Number Result
0
1
2

About

An API that scrapes the TikTok trends.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published