ভিডিও বোঝা সম্পর্কে জানতে, ভিডিও বোঝার নির্দেশিকাটি দেখুন।
Veo 3.1 হলো স্বয়ংক্রিয়ভাবে তৈরি অডিও সহ ৮-সেকেন্ডের ভিডিও (720p, 1080p, বা 4k) তৈরির একটি মডেল। আপনি Gemini API ব্যবহার করে প্রোগ্রাম্যাটিকভাবে এই মডেলটি অ্যাক্সেস করতে পারেন। উপলব্ধ Veo মডেল ভ্যারিয়েন্টগুলো সম্পর্কে আরও জানতে, মডেল ভার্সন বিভাগটি দেখুন।
Veo 3.1 বিভিন্ন ধরনের ভিজ্যুয়াল ও সিনেম্যাটিক স্টাইলে পারদর্শী এবং এতে বেশ কিছু নতুন সক্ষমতা যুক্ত করা হয়েছে:
- পোর্ট্রেট ভিডিও : ল্যান্ডস্কেপ (
16:9) এবং পোর্ট্রেট (9:16) ভিডিওর মধ্যে বেছে নিন। - ভিডিও সম্প্রসারণ : Veo ব্যবহার করে পূর্বে তৈরি করা ভিডিওগুলোকে সম্প্রসারিত করুন।
- ফ্রেম-ভিত্তিক তৈরি : প্রথম এবং শেষ ফ্রেম নির্দিষ্ট করে একটি ভিডিও তৈরি করুন।
- ছবি-ভিত্তিক নির্দেশনা : আপনার তৈরি করা ভিডিওর বিষয়বস্তুকে দিকনির্দেশনা দিতে সর্বোচ্চ তিনটি রেফারেন্স ছবি ব্যবহার করুন।
ভিডিও তৈরির জন্য কার্যকর টেক্সট প্রম্পট লেখার বিষয়ে আরও তথ্যের জন্য, Veo প্রম্পট গাইড দেখুন।
টেক্সট থেকে ভিডিও তৈরি
নিম্নলিখিত উদাহরণগুলিতে দেখানো হয়েছে কীভাবে আপনি সংলাপ , সিনেমাটিক বাস্তবতা বা সৃজনশীল অ্যানিমেশন সহ একটি ভিডিও তৈরি করতে পারেন:
সংলাপ ও শব্দ প্রভাব
পাইথন
import time
from google import genai
from google.genai import types
client = genai.Client()
prompt = """A close up of two people staring at a cryptic drawing on a wall, torchlight flickering.
A man murmurs, 'This must be it. That's the secret code.' The woman looks at him and whispering excitedly, 'What did you find?'"""
operation = client.models.generate_videos(
model="veo-3.1-generate-preview",
prompt=prompt,
)
# Poll the operation status until the video is ready.
while not operation.done:
print("Waiting for video generation to complete...")
time.sleep(10)
operation = client.operations.get(operation)
# Download the generated video.
generated_video = operation.response.generated_videos[0]
client.files.download(file=generated_video.video)
generated_video.video.save("dialogue_example.mp4")
print("Generated video saved to dialogue_example.mp4")
জাভাস্ক্রিপ্ট
import { GoogleGenAI } from "@google/genai";
const ai = new GoogleGenAI({});
const prompt = `A close up of two people staring at a cryptic drawing on a wall, torchlight flickering.
A man murmurs, 'This must be it. That's the secret code.' The woman looks at him and whispering excitedly, 'What did you find?'`;
let operation = await ai.models.generateVideos({
model: "veo-3.1-generate-preview",
prompt: prompt,
});
// Poll the operation status until the video is ready.
while (!operation.done) {
console.log("Waiting for video generation to complete...")
await new Promise((resolve) => setTimeout(resolve, 10000));
operation = await ai.operations.getVideosOperation({
operation: operation,
});
}
// Download the generated video.
ai.files.download({
file: operation.response.generatedVideos[0].video,
downloadPath: "dialogue_example.mp4",
});
console.log(`Generated video saved to dialogue_example.mp4`);
যান
package main
import (
"context"
"log"
"os"
"time"
"google.golang.org/genai"
)
func main() {
ctx := context.Background()
client, err := genai.NewClient(ctx, nil)
if err != nil {
log.Fatal(err)
}
prompt := `A close up of two people staring at a cryptic drawing on a wall, torchlight flickering.
A man murmurs, 'This must be it. That's the secret code.' The woman looks at him and whispering excitedly, 'What did you find?'`
operation, _ := client.Models.GenerateVideos(
ctx,
"veo-3.1-generate-preview",
prompt,
nil,
nil,
)
// Poll the operation status until the video is ready.
for !operation.Done {
log.Println("Waiting for video generation to complete...")
time.Sleep(10 * time.Second)
operation, _ = client.Operations.GetVideosOperation(ctx, operation, nil)
}
// Download the generated video.
video := operation.Response.GeneratedVideos[0]
client.Files.Download(ctx, video.Video, nil)
fname := "dialogue_example.mp4"
_ = os.WriteFile(fname, video.Video.VideoBytes, 0644)
log.Printf("Generated video saved to %s\n", fname)
}
জাভা
import com.google.genai.Client;
import com.google.genai.types.GenerateVideosOperation;
import com.google.genai.types.Video;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
class GenerateVideoFromText {
public static void main(String[] args) throws Exception {
Client client = new Client();
String prompt = "A close up of two people staring at a cryptic drawing on a wall, torchlight flickering.\n" +
"A man murmurs, 'This must be it. That's the secret code.' The woman looks at him and whispering excitedly, 'What did you find?'";
GenerateVideosOperation operation =
client.models.generateVideos("veo-3.1-generate-preview", prompt, null, null);
// Poll the operation status until the video is ready.
while (!operation.done().isPresent() || !operation