# sotavideo.ai
A comprehensive Elixir library for interacting with the sotavideo.ai platform, enabling seamless video processing and analysis within your Elixir applications. This package provides a streamlined interface to leverage sotavideo.ai's powerful video intelligence capabilities.
## Installation
To install `sotavideo.ai`, add it as a dependency to your `mix.exs` file:
elixir
def deps do
[
{:sotavideo_ai, "~> 0.1.0"} # Replace with the latest version
]
end
Then, run `mix deps.get` to fetch the dependency. You will also need to configure your API key as an environment variable: `SOTAVIDEO_API_KEY`.
## Usage
Here are some examples illustrating how to use the `sotavideo.ai` library:
**1. Retrieving Video Metadata:**
elixir
alias SotavideoAI
video_id = "your_video_id"
case SotavideoAI.Video.get_metadata(video_id) do
{:ok, metadata} ->
IO.puts "Video Title: #{metadata["title"]}"
IO.puts "Duration: #{metadata["duration"]}"
{:error, reason} ->
IO.puts "Error retrieving metadata: #{reason}"
end
**2. Generating a Video Thumbnail:**
elixir
alias SotavideoAI
video_id = "your_video_id"
case SotavideoAI.Video.generate_thumbnail(video_id, size: {320, 240}) do
{:ok, thumbnail_url} ->
IO.puts "Thumbnail URL: #{thumbnail_url}"
{:error, reason} ->
IO.puts "Error generating thumbnail: #{reason}"
end
**3. Analyzing Video for Object Detection:**
elixir
alias SotavideoAI
video_id = "your_video_id"
case SotavideoAI.Analysis.object_detection(video_id) do
{:ok, detections} ->
Enum.each(detections, fn detection ->
IO.puts "Object: #{detection["object"]}, Confidence: #{detection["confidence"]}"
end)
{:error, reason} ->
IO.puts "Error performing object detection: #{reason}"
end
**4. Transcribing Video Audio:**
elixir
alias SotavideoAI
video_id = "your_video_id"
case SotavideoAI.Transcription.transcribe(video_id) do
{:ok, transcript} ->
IO.puts "Transcript: #{transcript}"
{:error, reason} ->
IO.puts "Error transcribing video: #{reason}"
end
**5. Summarizing Video Content:**
elixir
alias SotavideoAI
video_id = "your_video_id"
case SotavideoAI.Summary.generate(video_id) do
{:ok, summary} ->
IO.puts "Summary: #{summary}"
{:error, reason} ->
IO.puts "Error generating summary: #{reason}"
end
## Feature Summary
* **Video Metadata Retrieval:** Easily access detailed information about your videos, including title, description, duration, and more.
* **Thumbnail Generation:** Dynamically create thumbnails with customizable sizes.
* **Object Detection:** Identify and locate objects within your videos.
* **Video Transcription:** Automatically transcribe audio into text.
* **Video Summarization:** Generate concise summaries of video content.
* **Error Handling:** Robust error handling with informative error messages.
## License
MIT
This package is part of the sotavideo.ai ecosystem. For advanced features and enterprise-grade tools, visit: https://sotavideo.ai/