Giter VIP home page Giter VIP logo

ffmpegd_old's Introduction

FFMPEG tcp stream pipeline

Erlang implementation for handling a tcp stream of a transcoded file using ffmpeg.

Usage

start a worker process for listening to the transcoded stream

1> {ok, Port} = start_m3u8_worker:start_m3u8_worker(my_module, upload_to_s3, [{key1, val1}]).
 {ok, 50000}

start_m3u8_worker takes 3 arguments: module name, function name and function args. The moment the worker process starts receiving parts it will call the module function and pass it the arguments along with a map :

#{part => PartData,
  name => PartName,
  m3u8 => M3U8}

Now use ffmpeg to tanscode the file and redirect the output to the tcp port returned by executing the above function

ffmpeg -i file.mkv -f hls tcp://localhost:10009/feed1.ffm

example usage

Let us assume we wish to write the parts to a file, so the following can be a function:

write_to_file(M3U8Part) ->
    #{part := Part, name := Name,
      m3u8 := _MetaData} = M3U8Part,
    file:write_file(<<"/tmp/", Name/bitstring>>, Part).

The function can now be passed to the worker which will later on call it to store the data

1> {ok, Port} = start_m3u8_worker:start_m3u8_worker(my_module, write_to_file, []).
 {ok, 50000}

ffmpegd_old's People

Contributors

kansi avatar

Stargazers

Kristian Sällberg avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.