Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encoding from network takes ages compared with FFmpeg-mobile library #11

Closed
buntupana opened this issue Mar 8, 2021 · 7 comments
Closed
Assignees
Labels
android Affect Android platform apple Affect Apple platforms ffmpeg-bug Something isn't right in ffmpeg source code fixed-in-v4.5 Fixed in release v4.5 library Affects the library v4.4 Affects v4.4 release

Comments

@buntupana
Copy link

buntupana commented Mar 8, 2021

I'm using this command to encode a video from web:

-y -reconnect 1 -i https://snapcellvideos.s3.amazonaws.com/manual/24/manualupload_16098586962947166522.mp4 -filter_complex "[0:v] pad=iw:'if(gt(iw, ih), iw, ih)':(ow-iw)/2:(oh-ih)/2, crop=iw:iw, scale=-1:480, setsar=1 [clip0]; [0:a] anull [audio0]; [clip0][audio0] concat=n=1:v=1:a=1 [v][a]" -map '[v]' -map '[a]' -c:a aac -c:v h264 -crf 18 -r 30 -preset veryfast /output_path/output_file.mp4

With FFmpeg-mobile library it takes around 100 seconds to encode it but with FFmpeg-kit it takes 639 seconds

I've check with local videos and it takes the same aprox, so the problem is related to videos from web

Version: com.arthenica:ffmpeg-kit-full-gpl:4.4.LTS

@tanersener tanersener added the needs-analysis We don't know that this is. It must be investigated further label Mar 8, 2021
@tanersener tanersener self-assigned this Mar 8, 2021
@tanersener
Copy link
Collaborator

Thanks for reporting this. I see the same issue as well but I'm not sure about the reason. I need to run some tests to understand what is happening there.

@tanersener tanersener added bug Something isn't working ffmpeg-bug Something isn't right in ffmpeg source code and removed bug Something isn't working labels Mar 9, 2021
@tanersener
Copy link
Collaborator

My tests show that this commit, 70d8077b795766e2486e6ec8110f22a97362d6d6, on ffmpeg master is responsible of this performance decrease. And it affects all architectures, not only Android. iOS, tvOS and macOS also have the same problem while downloading large files over https.

Ideally, this issue must be reported to ffmpeg and fixed there. But, I couldn't reproduce it on the desktop version of ffmpeg. So, I patched the files updated on that commit for now. If it is not fixed before the next release I'll use that patch to fix this issue.

@buntupana
Copy link
Author

Cool, thanks a lot.

@tanersener tanersener removed bug Something isn't working needs-analysis We don't know that this is. It must be investigated further labels Mar 14, 2021
@tanersener
Copy link
Collaborator

tanersener commented Mar 14, 2021

Created this ticket on ffmpeg for this issue, https://trac.ffmpeg.org/ticket/9148.

ffmpeg devs area already on it. Could you leave the file there a bit longer so they can work on the fix?

@buntupana
Copy link
Author

Sure, no problem.

@tanersener
Copy link
Collaborator

This issue is fixed on ffmpeg. Updated the development branch with the latest commit from ffmpeg master. So, we will have the fix on the next release.

@tanersener tanersener added fixed-on-development Fixed on the development branch. Not released yet. v4.4 Affects v4.4 release LTS Affects LTS releases android Affect Android platform apple Affect Apple platforms library Affects the library and removed fixed-on-development Fixed on the development branch. Not released yet. LTS Affects LTS releases labels Apr 30, 2021
@arthenica arthenica deleted a comment from github-actions bot Aug 31, 2021
@arthenica arthenica deleted a comment from github-actions bot Aug 31, 2021
@tanersener tanersener added fixed-in-v4.5 Fixed in release v4.5 and removed fixed-on-development Fixed on the development branch. Not released yet. labels Sep 20, 2021
@tanersener
Copy link
Collaborator

Fixed in v4.5 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android Affect Android platform apple Affect Apple platforms ffmpeg-bug Something isn't right in ffmpeg source code fixed-in-v4.5 Fixed in release v4.5 library Affects the library v4.4 Affects v4.4 release
Projects
No open projects
Development

No branches or pull requests

2 participants