Uncategorized

FFmpeg Unity Bind

FFmpeg Unity Bind is a powerful solution to perform all kind of video editing operations. 17 years of Video Programming experience now can be easily integrated into every mobile cross-platform app. We released it as a Unity 3d package in Asset Store. Thousands of developers enjoys a power of the product.
FFmpeg Unity Bind is a functionality of complete Video Editor on phones and tablets (Supports IOS + Android).

FFmpeg Unity Bind at Unity 3d Asset Store

FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. It is also highly portable.

This package offers FFmpeg Binding to Unity + Helpers for quick commands building and callbacks handling. FFmpeg API is easily available inside Unity C # scripting environment to control from code of your app.

In version 3.1 we’ve added Screen Capturing Demo

F.A.Q.

1. How to use FFmpeg?

Here is a great guide which most people like to start from. If you understand how to use the library which is built for Stand Alone, then it will be easier to work on mobile.

2. Is The FFmpeg Unity Bind works for me?

To make sure that it works on mobile do the same with this Preview Apk DOWNLOAD
Use Absolute paths instead of local. First element of the command (ffmpeg) is no needed on mobile. Test with this build whatever you want to achieve. If it works there it will definitely work from Unity C#.

3. Where I can find usage examples?

Here is a great collection of examples VIEW
In the package there are a lot of runtime commands written in C# with UI examples.

4. How can I add custom command to FFmpeg Unity Bind Helpers?

FFmpegCommands.cs is the best place for it. Every command in the examples are implemented with it method like (Convert, Trim etc.) and reusable command elements at the top of the class file.

5. Which filters are included into the FFmpeg lib?

To check available filters download preview build from the point 2. and input -filters command. Original filter name starts after dots. There are several sections order by name (i.e. new alphabetical sequence starts after current section again due to different libraries).

6. Log text in example scene is truncated.

It’s because UnityEngine.UI.Text have limitation on vertices and can’t handle too big texts. You can find full log of operation in ffmpeg_log_to_unity_bind.txt file at Aplication.persistentData folder. NOTE: To access this files you may need Root on Android and software like iExplorer on IOS.

7. Which version of FFmpeg is used?

Android: 3.0.1
IOS: 3.3
MacOS 3.4.1
Windows 3.4.1

8. What is the size (weight) of the build?

Unpacked, installed build on IOS device with full library and examples content is 57.4 mb.
Same on android is 79.78mb. APK without example content (UI) is 22mb.
On MacOS ffmpeg binaries weights 35.7 mb and example contents 52.4 mb.
On Windows binaries weights 35.8 and everything else 38.6 mb.

9. What eldest Unity Editor version is supported?

It supports latest editor version. Fine, but what about backward compatibility?
Successful tests were made in older versions up to Unity 5.5.2f1 (is supported).

10. Why FFmpeg doesn’t work on Mac OS?

Please make sure you have all rights to execute ffmpeg binary file in Assets/FFmpeg/Standalone/Mac folder.
You can navigate to this directory in terminal and execute: chmod 700 ffmpeg


Good luck and have a Happy coding,
Sincerely yours GigaNeo.

22 comments to FFmpeg Unity Bind

  • Mauricio de Souza Ferreira

    Hello, grate job.
    This bind support pipe? Because I need send image buffer and audio at runtime frame by frame from unity to ffmpeg.
    Thanks.

    Reply
    • Giga Admin

      Hi Mauricio
      We didn’t test pipe feature. In the bind there is used usual ffmpeg build with command line interface so potentially it should work. To make sure please check Preview APK.

      Reply
  • Maxim

    Hi,

    this asset looks intresting. Do you have any idea if your code is adaptable for UWP deployment using FFMPEG interop? If not, do you want to add this functionality in future releases?

    Thanks

    Reply
    • Giga Admin

      Hi Maxim, thanks for interesting FFmpeg Unity Bind. Let me sure you that it is amazing and most powerful video editing library. We are planning support of Mac OS and Windows soon. Maybe we’ll include UWP to Windows part depending on how well it go.

      Reply
  • Thomas

    Hi, is it possible to “transcode” a video to keep the per pixel transparency for android at run-time. (not in the editor but in the game engine).

    Reply
  • mossman

    biz@giganeo.comHello,

    I am very interested in your Unity plugin called FFmpeg Unity Bind. But i need some info to check if the plugin features satisfies my project needs.

    We are developing a app for iOS and Android usign Unity. This app must do:
    1- Record very short video from the screen.
    2- Preview the recorded video.
    3- Add sound to the recorded vídeo. (If the duration of the sound is less than the duration of the video, the sound must be repeated. If the duration of the sound is longer than the duration of the video, the sound must be trimmed.)
    4- Save the video in the device (video gallery).
    5- Share this video in social networks.

    FFmpeg Unity Bind Can that do points 1, 2, 3 and 4?

    Thanks!

    Reply
    • GigaAdmin

      It’s a very multi-functional tool. Most listed points can be achieved with some integration steps.
      1. There is FFmpegREC demo scene with screen recording example.
      2. After recording video you have a callback with a path to created video file. In the demo this path is passes to default device player for demonstration, but you can do even more using Unity Video Player. In this way you can play recorded video on custom surfaces, such as 3d geometry.
      3. There is Add Sound demo feature to set new sound of video. Other logic should be on application side.
      4. As mentioned in point 2. you have path to created video, so can easily move it to gallery: File.Move(appStoragePath, galleryPath).

      Reply
  • Michele

    Hi, is it possible record (for example 20 seconds) a video of the screen of ipad during a game and save it into camera roll of ipad?
    Thank you

    Reply
    • GigaAdmin

      Yes you can record video of desired duration and in the end get a callback with a file path to captured video. With this path you can move or copy file as you wish. The package requires coding skills.

      Reply
  • TamV

    Hi,
    Is it possible to live streaming to rtmp server?

    Reply
  • Valentin

    Hello. How to check screen recording functions by ffmpeg on Android/iOS? Maybe you have compiled apk or command for SampleFFmpeg.apk?

    Reply
  • Umair Bhatti

    Hi, I have purchased your FFmpeg Unity Bind plugin. The main focus to buy this to record my app screen and it does that pretty well but i encounter an issue which i didn’t foreseen before that my unity app also contain sound and i also need that sound to be in captured video. Right now its not capturing audio. Does your plugin do that? Please help me out on this that i can be able to get audio in my video somehow.

    Reply
    • GigaAdmin

      In version 3.2 Audio Recording support is added.

      Reply
      • Umair Bhatti

        Thanks for the reply i will look in to it.
        Is there any way so that without saving these textures on location i directly provide array of textures to ffmpeg to create video?

        Reply
        • GigaAdmin

          Hi Umair
          FFmpeg exists a long time before array of textures. It is designed to work with file paths.

          Reply
      • Umair Bhatti

        I created a build for windows full screen when i call stop my screen got full black. I tested the demo in separate build it also crashed and its generate an log in which it says : Read from location 00000000 caused an access violation.

        Reply
        • GigaAdmin

          Hi Umair

          Make sure you have all rights to use ffmpeg binary file in \Assets\FFmpeg\Standalone\Win directory.
          You can even replace it with new one from HERE (choose Release Windows-64bit Static) and rename as original without extension.

          Cheers!

          Reply
  • Arvind

    How do I redirect output to receive the stream as bytes ?

    Reply
    • GigaAdmin

      Hi Arvind
      Usual use case is to work with files. Take a look at this info as well.
      Have a good luck with a project!

      Reply

Leave a Reply

Comment
Name*
Mail*
Website*