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

When I used the latest version of the 6.0-2 library to mix audio and video on the Android platform, I found that the -shortest parameter did not work. But there was no such problem before version 6.0. Can you fix this bug? #962

Open
JeremyTanZone opened this issue Apr 16, 2024 · 4 comments
Labels
android Affect Android platform ffmpeg-bug Something isn't right in ffmpeg source code library Affects the library v6.0

Comments

@JeremyTanZone
Copy link

Description
When I used the latest version of the 6.0-2 library to mix audio and video on the Android platform, I found that the -shortest parameter did not work. But there was no such problem before version 6.0. Can you fix this bug?
Because sometimes the duration of the audio is longer than the duration of the video, the -shortest parameter must be used.
This is the command used to mix audio and video:
ffmpeg
-i video1.mp4 -i audio1.mp3
-c:v copy
-map 0:v -map 1:a
-shortest
-y output.mp4

Expected behavior
Hope the -shortest parameter will take effect, like in versions before 6.0.
Because sometimes the duration of the audio is longer than the duration of the video, the -shortest parameter must be used.

Current behavior
Mix audio and video on the Android platform, the -shortest parameter did not work,when the audio duration is longer than the video duration.

To Reproduce

Screenshots
If applicable, add screenshots to help explain your problem.

Logs

Environment

  • Platform: Android
  • Architecture: arm-v7a, arm-v7a-neon, arm64-v8a,
  • Version: v6.0-2/v6.0-2.LTS
  • Source branch: main, development
  • Android Studio version: 4.0
  • Android NDK version: r21b

Other
Add any other context about the problem here.

@tanersener tanersener added ffmpeg-bug Something isn't right in ffmpeg source code android Affect Android platform v6.0 library Affects the library needs-analysis We don't know that this is. It must be investigated further and removed ffmpeg-bug Something isn't right in ffmpeg source code labels Apr 16, 2024
@tanersener
Copy link
Collaborator

It sounds like this is coming from FFmpeg. Either it is a bug or a change in FFmpeg behaviour.

Can you test your command in desktop FFmpeg 6.0 and share the results?

@JeremyTanZone
Copy link
Author

@tanersener
I tested this command of mine in desktop FFmpeg 6.0 and got the same results.(The -shortest parameter did not work. )

It should be a bug in FFmpeg 6.0 itself, or a change in the behavior of FFmpeg 6.0.

Test Environment
Platform: Mac
Desktop System: macOS Sonoma 14.2.1
FFmpeg Version: 6.0-tessus

Thanks for your reply

@JeremyTanZone
Copy link
Author

@tanersener

Later, I tried it in desktop FFmpeg 6.0.1 and desktop FFmpeg 6.1.1 respectively.
The -shortest parameter did not work in desktop FFmpeg 6.0.1, but it worked in desktop FFmpeg 6.1.1.

Maybe it's a bug in FFmpeg 6.0 and FFmpeg 6.0.1, but this bug is fixed in FFmpeg 6.1.1

-shortest Parameter is invalid: FFmpeg 6.0 and FFmpeg 6.0.1
-shortest Parameter is valid: FFmpeg 6.1.1 and before FFmpeg 6.0

Test Environment
Platform: Mac
Desktop System: macOS Sonoma 14.2.1
FFmpeg Version: 6.0.1-tessus,6.1.1-tessus

This is the command used to mix audio and video:
ffmpeg
-i video1.mp4 -i audio1.mp3
-c:v copy
-map 0:v -map 1:a
-shortest
-y output.mp4

Can you upgrade the version of FFmpeg in your library to 6.1.1 on the Android platform?

Thanks.

@tanersener tanersener added ffmpeg-bug Something isn't right in ffmpeg source code and removed needs-analysis We don't know that this is. It must be investigated further labels Apr 17, 2024
@tanersener
Copy link
Collaborator

Thanks for the tests. This confirms that it is an ffmpeg bug.

I don't have a date for the FFmpeg update. The plan is to complete it in the next few months. Until then, you can change the version yourself, in this line. That line defines which FFmpeg version will be compiled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android Affect Android platform ffmpeg-bug Something isn't right in ffmpeg source code library Affects the library v6.0
Projects
None yet
Development

No branches or pull requests

2 participants