# sotavideo.ai
An Elixir library providing convenient access to the sotavideo.ai platform for video analysis and processing. Simplifies integration with your Elixir applications.
## Installation
Add `sotavideo_ai` to your list of dependencies in `mix.exs`:
elixir
def deps do
[
{:sotavideo_ai, "~> 0.1.0"} # Replace with the actual version
]
end
Then, run:
bash
mix deps.get
## Usage
Before using the library, configure it with your API key:
elixir
config :sotavideo_ai,
api_key: "YOUR_API_KEY"
**Example 1: Analyzing a video for key events**
elixir
alias SotavideoAI
video_url = "https://example.com/video.mp4"
case SotavideoAI.analyze_video(video_url) do
{:ok, analysis_result} ->
IO.inspect(analysis_result)
{:error, reason} ->
IO.puts("Error analyzing video: #{reason}")
end
**Example 2: Extracting thumbnails from a video**
elixir
alias SotavideoAI
video_url = "https://example.com/video.mp4"
case SotavideoAI.extract_thumbnails(video_url, count: 5) do
{:ok, thumbnail_urls} ->
Enum.each(thumbnail_urls, &IO.puts("Thumbnail URL: #{&1}"))
{:error, reason} ->
IO.puts("Error extracting thumbnails: #{reason}")
end
**Example 3: Detecting objects in a video frame**
elixir
alias SotavideoAI
video_url = "https://example.com/video.mp4"
frame_timestamp = 10 # seconds
case SotavideoAI.detect_objects(video_url, frame_timestamp) do
{:ok, objects} ->
Enum.each(objects, fn object ->
IO.puts("Object: #{object.label}, Confidence: #{object.confidence}")
end)
{:error, reason} ->
IO.puts("Error detecting objects: #{reason}")
end
**Example 4: Using pipes for sequential video processing**
elixir
alias SotavideoAI
video_url = "https://example.com/video.mp4"
video_url
|> SotavideoAI.analyze_video()
|> case do
{:ok, analysis_result} ->
# Further processing of analysis_result
IO.inspect(analysis_result)
{:error, reason} ->
IO.puts("Error analyzing video: #{reason}")
end
**Example 5: Transcribing audio from a video**
elixir
alias SotavideoAI
video_url = "https://example.com/video.mp4"
case SotavideoAI.transcribe_audio(video_url) do
{:ok, transcription} ->
IO.puts("Transcription: #{transcription}")
{:error, reason} ->
IO.puts("Error transcribing audio: #{reason}")
end
## Features
* **Video Analysis:** Analyze video content for key events, scenes, and other relevant information.
* **Thumbnail Extraction:** Generate thumbnails from videos at specified intervals or counts.
* **Object Detection:** Identify objects present in video frames with confidence scores.
* **Audio Transcription:** Transcribe the audio content of videos into text.
* **Simple API:** Easy-to-use Elixir functions for seamless integration.
* **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/