Jump to content
Sign in to follow this  
Vanar

ffmpeg compression in android and ios

Recommended Posts

Good day!
Tell me the mechanisms that allow you to compress video files in Android and iOS applications

Short mp4 files created by the camera take up a lot of space and do not load into my applications.
Large files sent via messengers are load successfully.
I understand that messenger servers use ffmpeg compression.
Is it possible to apply ffmpeg compression in android and ios applications?
There are no problems under Windows!
Or are there other methods?
To solve my problems, only compressing mp4 files is enough!

Share this post


Link to post
2 hours ago, Vanar said:

Short mp4 files created by the camera take up a lot of space and do not load into my applications.

What happens when you try to load them, and what methods are you using?

Share this post


Link to post
5 hours ago, Dave Nottage said:

What happens when you try to load them, and what methods are you using?

I didn't express myself quite correctly. Large files are downloaded, but take too long; more often the download is interrupted, but the application continues to work - it does not crash
Tried it on Demos\FilesSelector from Kastri-master
In any case, compression is preferable for my purposes

Share this post


Link to post
2 hours ago, Vanar said:

Tried it on Demos\FilesSelector from Kastri-master

Not sure this will help you, but I have added a function just yesterday to copy large files that have been selected using TFilesSelector. It is the class function TAndroidFileStream.Copy (in DW.Android.Helpers), which can be called like this:

TAndroidFileStream.Copy(LRawPath, LFileName);

Where LRawPath contains the raw URI for the selected file, and LFileName contains the destination file path
Please be aware that copying a large file can take several seconds (in my test, a 2.5GB file took 7 seconds on my Pixel 6 Pro), so you may want to pass that task off to a thread.

2 hours ago, Vanar said:

In any case, compression is preferable for my purposes

Surely you'll need to actually have the file in order to compress it anyway?

  • Thanks 1

Share this post


Link to post
11 hours ago, Dave Nottage said:

Surely you'll need to actually have the file in order to compress it anyway?

That is the catch @Vanar might have overlooked. Once the clip is there, there is no need to compress it to load it into an application, that should work just like that, automatically. On the other hand, if you own the server, you need to do your compression (lossy, by the way) there, on the server. And you need to check if you find a matching inflation-lib for your app.

Share this post


Link to post
1 hour ago, Sherlock said:

That is the catch @Vanar might have overlooked. Once the clip is there, there is no need to compress it to load it into an application, that should work just like that, automatically. On the other hand, if you own the server, you need to do your compression (lossy, by the way) there, on the server. And you need to check if you find a matching inflation-lib for your app.

Yes

Share this post


Link to post

There are no complaints about opening files via TFilesSelector - everything works fine
The problem is that when copying a LARGE file, it takes a lot of time to the server (sometimes impossible).
I copy to the hosting (server) to run ffmpeg- compression and there will be no problems!
It turns out to be a vicious circle - to perform compression, first copy a large file, and the large file takes a long time to copy because it is not compressed.

I would like to perform compression before copying.
It turns out that you need to compress the file on Android or iOS, but this is impossible?

Share this post


Link to post

It should be possible, but just like Whatsapp, it comes with the price of losing resolution aka details. Let's get some details: What kind of films are we talking about here? Resolution, duration? Because my phone films 1080p at 30fps and gives me roughly 55MB (HEVC) for a one minute clip. That is almost not worth mentioning. Extrapolate that to 10 minutes and you get roundabout 600MB, nowadays, that is next to nothing.

Share this post


Link to post
Posted (edited)

Clients send reports on their work in mp4, mp3, jpg formats.
In a good way, all files need to be compressed.
But the problem is visible on mp4.
Requirement: no more than 15 seconds. The permission was not specified, since it is difficult for them to change the settings of their phone... 🙂
But even such mp4 files created by the camera are very large in size for transfer to their hosting in order to compress

Edited by Vanar

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×