Skip to content

geekbull/ffmpex

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FFmpex

Build Status

An Elixir wrapper for the FFmpeg command line interface.

Documentation: https://hexdocs.pm/ffmpex/

Examples

import FFmpex
use FFmpex.Options

command =
  FFmpex.new_command
  |> add_global_option(option_y())
  |> add_input_file("/path/to/input.avi")
  |> add_output_file("/path/to/output.avi")
    |> add_stream_specifier(stream_type: :video)
      |> add_stream_option(option_b("64k"))
    |> add_file_option(option_maxrate("128k"))
    |> add_file_option(option_bufsize("64k"))

:ok = execute(command)

You can use the FFprobe module to query for file info:

FFprobe.duration("/path/to/input.avi")
# => result in seconds, e.g., 228.456939

See silent_video and thumbnex for more usage examples.

Prerequisites

FFmpeg must be installed.

Installation

  1. Add ffmpex to your list of dependencies in mix.exs:
```elixir
def deps do
  [{:ffmpex, "~> 0.4.0"}]
end
```
  1. Ensure ffmpex is started before your application:
```elixir
def application do
  [applications: [:ffmpex]]
end
```

Configuration

You can specify some options in config.exs:

config :ffmpex, ffmpeg_path: "/path/to/ffmpeg"
config :ffmpex, ffprobe_path: "/path/to/ffprobe"

Release notes

See the changelog for changes between versions.

Disclaimer

FFmpex is not affiliated with nor endorsed by the FFmpeg project.

FFmpeg is a trademark of Fabrice Bellard, originator of the FFmpeg project.

License

FFmpex source code is licensed under the MIT License.

About

Elixir wrapper for FFmpeg command line interface

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Elixir 100.0%