For everybody struggling for video editor functionality on mobile.
Here you go: FFmpeg is integrated into Unity Editor and is reachable from C# code.
Platforms: Windows, Mac OS, IOS, Android.
Available at GitHub:
What you can do:
Convert formats
Video to Audio
Create video from images and sounds
Extract images and sounds from video
Record video with audio
Also there is available powerful console for direct control of any ffmpeg features: https://ffmpeg.org
There is a detailed documentation included into the package, check it out.
Cheers!
Isn’t FFMPEG licensed under the GPL/LGPL? I’m not sure that 3rd party libraries that are licensed under those licenses are allowed on the asset store.
The product is not a library itself. The product is an integration it to Unity3d.
You can make it by yourself or buy with a price of one working hour.
Cheers
Hi!! Great that someone finally implemented it! Although for my needs right now i just needed to know if its possible to merge a mp4 video file (example videoplayback.mp4) with a m4a audio file (exampple videoplayback.m4a) and giving a new file called for example output.mp4.
I think its possible using ffmpeg using this command “ffmpeg -i videoplayback.mp4 -i videoplayback.m4a -c:v copy -c:a copy output.mp4”, would it be possible in unity with your asset (for android)?
If so, id be really interested to have it for android but also for ios!!!
So good to suddenly find out that you added iOS support
I will definitely buy your asset now. Btw is it possible to merge a video file and a audio file from a specific point? Like taking all the video and only a portion of the audio?
Thanks!!!
Here is how you can append sound to video in usual cases:
-y -i video.mp4 -i sound.wav -map 0:v:0 -map 1:a:0 result.mp4
Here is how you can cut the audio file:
-ss 0 -t 30 -i file.mp3 output.mp3
It is a little bit more challenging to make a start offset when merging it with video. Try like this:
-y -i a.mp4 -itsoffset 00:00:30 sng.m4a -map 0:0 -map 1:0 -c:v copy -preset ultrafast -async 1 out.mp4
I’m glad to announce our F.A.Q. section where you can learn cases which other teams met.
It will be updated and boosted, by all our video programmers community. I hope you’ll find it useful. To become a part of video development community you just have to post reply to F.A.Q comments or this thread when people ask.
This looks great. For converting image sequences to video, does anyone know if unity’s Texture format can be used? Or will everything first need to be converted to a file first?
Hey Eric_Bates
Usual workflow is when you first save to the file and then work with an absolute path.
If we find opportunity to pass files into FFmpeg lib in another way, we publish update or information how to do it within Unity.
I was wondering if there’s a way where I can append images at the end of video. I’m capturing an image every 10th frame and approximately after 10 seconds I want all the images captured encoded into video. I tried the traditional way of saving all the captured images and then running the //-y -i .../image%1d.jpg -r 30 video.mp4 ffmpeg command but this takes like 15-20 seconds on Android, not tested iOS yet. Wondering if there’s a way where I can encode these images on the fly to be part of one single video output ? I’ve been googling for the last couple of days but none of the solution I’ve seen so far has worked for me. Also, in all of this, there is no audio involved at all.
The idea is to convert every single image to extreme short video of certain codec.
At the end you can append all this videos with muxing instead of encoding.
It’ll speed-up process a lot.
Does your implementation of FFmpeg include any screen recording functionality? I found this page in the wiki describing how to do it for desktop, but is it possible on iOS and Android? https://trac.ffmpeg.org/wiki/Capture/Desktop
I’m glad to present to you an upgrade of FFmpeg Unity Bind - version 3.1
Now it supports Mac OS and Windows.
That means you can test video operations right in the Editor before deploy to mobile!
NOTE: Some things may differs on standalone vs mobile due to very different hardware. Always do final testing on end destination device.
Also we’ve included SCREEN CAPTURING DEMO.
It is absolutely cross-platform and easy to use.
We’ve added extra UI presets / Examples:
Adding sound to existing video
Adding your own watermark with scale and position parameterization.