Using flutter how to merge audio file with sync of any video like camera action like that there is any specific package is available in flutter - flutter

I have been searching for the packages or any method for the particular problem, i googled but i didn't find any solution ,
So my issue is , i want functionality like ticktock App , user can select any music audio and they can play according to that user can do action, with sync of both audio and video i want output file as video. how can i achieve this , is there any method or any packages are avalibale in flutter .
i have done selecting audio and video recording feature but i ma stuck with the merging both , if FFmpeg package we can use means , how to use that packages .. please explain me guys.

In FFmpeg You can do it by playing the audio, recording video and then merging two files like
final FlutterFFmpeg _ffMpeg = FlutterFFmpeg();
_ffMpeg.execute("-i video.mp4 -i audio.mp4 -c copy output.mp4")
.then((return_code) => print("Return code $return_code"));
With FFmpeg You need to find the command that suits You the best.
But...
Personally I think FFmpeg isn't a good choice:
It is heavy
You can't use it in commercial projects (I might be wrong, please correct me if I am)
What I suggest
You can record video and have audio file and video with Flutter. Then use platform specific code.
Even if you don't have experience in specific language I found those two libraries that could help:
iOS: https://github.com/dev-labs-bg/swift-video-generator
(does exactly what You need).
Android: https://github.com/israel-fl/bitmap2video
(I'm not sure if works with videos, but it accepts bitmaps)

Related

How to convert image to 3/sec video as mp4 in flutter

How to convert image to 3/sec as mp4 file video in flutter.
my question looks so simple , but i spent many days searching , cannot find way
Your question looks really simple, but it isn't. A video file can be much more complicated than a simple Image. Flutter on its own can't do this. You would need to use an external encoder that creates the h264 video from your pixeldata.
I couldn't find a dart package that can do this so you would probably need to write some platform specific code using platform channels or wrap a library using dart FFI. Keep in mind that encoding a video file requires a lot of performance or a hardware encoder that differs on each platform. Since you didn't provide any information about your target platform or specific usecase there isn't much more I can help with.
The best approach is probably to look into FFMPEG and its CLI and look there for an encoder.

How to change HLS quality in ijkplayer for flutter or alternative solutions?

Hi can anyone help me with this issue, we decided to use the flutter ijkplayer as it's the only player on flutter that supports the option to change playback speed, but it doesn't have the option to change the hls quality, and neither does any other player as per my findings, if anyone knows please share.
As for what I've tried, I download the file and split it into 4 files with each file having only one video and audio stream and use a button to change the file.
I also tried to look into changing the tracks from master with the player but while FFMpeg does support this, I'm not sure how to do that from flutter.
Currently it works, but the splitting is hardcoded and might need to be changed for different master m3u8(we use vimeo and expect the same file format for master m3u8 but they can change it down the road or we could change service for video), and it would be preferable to change streams from the player itself instead of using an external ui button which for example won't be available in full screen mode, which you would expect most people to watch the video in.
I'm trying to make the splitting part more generalized but would like to know how others handle this problem.
Edit I've made the splitting somewhat dynamic, but I just came across another issue, in ffmpeg(complied in the ijk player it is 4-5 years old not the latest version) I have to use format option - protocol_whitelist,'http, https, tls, file, crypto, tcp, udp, concat' so I can play local file, but the player by default sets the format option - fflags 'fastseek' to allow playing faster than 1, but for some reason that functionality breaks the fastseek, or in other words, if I play local file I can't use speeds greater than 1, which I can on files I play from the internet.
Using this version of flutter ijkplayer github
You can use better player for flutter its good to choose quality
Better Player Flutter

Live Streaming Video in iPhone

I am new to iPhone Development. I need to capture video. While I'm capturing video it display on server too. Something like live streaming.
Anyone have idea from where I should have to start for this functionality?
Thanks in Advance.
Your question seems similar to this
Xcode ios: Streaming of video file while recording and removed redundant personal statements
First Half Solution
Using AVFoundation you can get video Buffer/frames while recording.
Second Half
But for uploading i didn't find any solution
There is Input Stream option there in iOS APIs but it need some file path. but as video is not recorded we didn't have any path.
Edit 1
Here is Best Example for AVFoundation provided by Apple, you can start with
I recommend you to use wowza wowza.com/https://www.wowza.com, it has all the features, from live stream, video on demand and etc.

How can I use ffmpeg on the iPhone

I've been searching a lot for ffmpeg on iphone, and how to use it to steam audio(wma ect.)
but cant figure out how this is done.
can someone please try help me on, how to/what to, download and how i get the ffmpeg lib. into my xcode project, so i can use it to steam some links i have ?
another thing is, i read something about the lisence somewhere. is it really true, that if i use the ffmpeg lib, i need to make my project/code, open source?
There is this existing question on SO, but…
You might want to read the Media Player Framework Docs as the functionality you mention already exists in the iOS SDK for many non WMA files. It is probably going to be less of a headache to convert them to mp3 or another format on your server and go from there using the built-in tech that Apple provides.

Create video in iPhone

I need to convert image sequences(ie,png) to video file in iPhone. How i can convert the images to video.
Regards,
Just ignore bad advice like "use ffmpeg". That would work on the desktop, but the license issue makes including ffmpeg source code in your iPhone app legally questionable. Apple provides a class named AVAssetWriter that you would use in your app to encode a series of images as h.264 stored in a .m4v quicktime container file. While the apple provided logic does work, it is not so easy to actually use and you will need to read quite a lot of documentation to get the code working. If you want to skip implementing it yourself (and likely save yourself 3 or 4 days of work), please consider using my AVAnimator library for iOS as the h.264 encoding logic is already implemented in the class AVAssetWriterConvertFromMaxvid. Once encoded as h.264, the video can be played with the standard player and it is small enough to upload to a remote server.
You are likely going to need something like FFMPEG