Giter Site home page Giter Site logo

creatingbif's Introduction

CreatingBIF CesSil

Here is an explanation of how to create bif files with the ffmpeg tool in Windows.

This is the guide that Roku gives: https://developer.roku.com/es-mx/docs/developer-program/media-playback/trick-mode/bif-file-creation.md Prerequisites for windows: Tool bftool y ffmpeg https://github.com/rokudev/samples/blob/master/utilities/bif%20tool/biftool_windows.zip https://ffmpeg.zeranoe.com/builds/ Installation guide and add ffmpeg to the path, I recommend that you do the same with biftool, because otherwise you will always put the executable https://www.youtube.com/watch?v=qjtmgCb8NcE

BIFTool can generate a bif file from a directory of jpg images that correspond to frames in the stream seperated by the specified time interval. It does not generate the directory of images, but other tools can.

Here is an example using ffmpeg to create a jpg every 10 seconds, and then creating an abc.bif file from those images that corresponds to the abc.mp4 stream:

  • mkdir abc
  • cd abc
  • ffmpeg -i ../abc.mp4 -r .1 -f image2 %010.jpg
  • cd ..
  • biftool -t 10000 abc

You'll likely want to generate two .bif archives for each piece of content. One for SD and one for HD. Which archive is used depends not on the resolution of the content, but on the resolution of the user's UI. That's why it's important to generate HD .bif archives even if the content is SD. However, if there is no HD .bif available, the player will fallback to using the SD .bif.

So here's one way to generate them:

  • mkdir abc-sd abc-hd
  • ffmpeg -i abc.mp4 -r .1 -s 240x180 abc-sd/%08d.jpg
  • ffmpeg -i abc.mp4 -r .1 -s 320x240 abc-hd/%08d.jpg
  • biftool -t 10000 abc-sd
  • biftool -t 10000 abc-hd

This will result in two new files: abc-sd.bif and abc-hd.bif (ffmpeg separates the images and biftool converts them to a bif file)

There are two caveats here:

  1. ffmpeg generates the .jpg files starting with index 1. This means that all the timestamps will be off by 10 seconds.
  2. The SD frames should have a width of 240 and the HD frames should have a width of 320. Their height should be specified to coincide with their aspect ratio. The commands above assume a 4x3 aspect ratio. Unfortunately, ffmpeg doesn't let you specify only a width, keeping the original aspect ratio.

You will need to write code/scripts to overcome these caveats.

For bif files have to be uploaded to a server: http://www.instanttvchannel.com/roku/bif

Other sources:https://community.roku.com/t5/Roku-Developer-Program/what-is-the-exact-syntax-for-BIFTool/td-p/111994 If you want to use other source from a server:https://trac.ffmpeg.org/ticket/4126

https://www.adictosaltrabajo.com/2017/07/31/ffmpeg-para-edicion-video-funcionamiento-y-comandos/ https://h4ckseed.wordpress.com/2016/01/31/ffmpeg-solucion-para-convertir-grabar-y-stream-av-ii/

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.