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

SIGSEGV crash in android while converting MKV to MP4 #320

Closed
yeamin27 opened this issue Jan 16, 2022 · 4 comments
Closed

SIGSEGV crash in android while converting MKV to MP4 #320

yeamin27 opened this issue Jan 16, 2022 · 4 comments
Assignees
Labels
question Further information is requested

Comments

@yeamin27
Copy link

Description
I am trying to convert a video from MKV to MP4 in Android using the test app from here-> ffmpeg-kit-test-maven-central

Expected behavior
Execute command successfully.

Current behavior
After processing a few frames app crashes for a particular video.

To Reproduce
Input this video,
For input path I am using FFmpegKitConfig.getSafParameterForRead(context, inputUri)
And for output I am using FFmpegKitConfig.getSafParameterForWrite(requireContext(), outUri)
Execute the following command:

INPUT_PATH -map 0:s? -scodec mov_text -map 0:a? -map 0:v:0? -f mp4 -vcodec h264 -profile:v baseline -level 3.0 -pix_fmt yuvj420p -color_range 2 -map_metadata 0:g -acodec copy OUTPUT_PATH

Logs

libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 7648 (pool-1-thread-1), pid 7453 (.ffmpegkit.test)

Environment

  • Platform: Android
  • Architecture: arm64-v8a

Other
I've just modified the test app a little to take an input file and use uri to get saf parameter.

@tanersener
Copy link
Collaborator

tanersener commented Jan 16, 2022

We don't have enough information to make a comment about this. A single log line is not enough to understand who is throwing that SIGSEGV signal.

Consider adding console logs, the stack trace of SIGSEGV and a working command if you expect someone to investigate this. Your command includes ? characters.

@tanersener tanersener added the needs-more-details We need more details to understand what the problem is label Jan 16, 2022
@yeamin27
Copy link
Author

yeamin27 commented Jan 16, 2022

Thank you for your quick response.

This is the only error message I got, no stack trace. As I am adding prebuilt SO files, that's why couldn't get any detailed stack trace. I have attached the google drive link of the sample file, can you please try reproducing the issue?

The ? character in the command is for FFmpeg to select a stream or leave if not found. I have executed the exact same command that I shared just replacing the INPUT_PATH and OUTPUT_PATH by respective saf parameters. Even if I use the same command to just re-encode in MKV it works. The crash occurs only when I change the container to MP4.

@tanersener
Copy link
Collaborator

The ? character in the command is for FFmpeg to select a stream or leave if not found.

When I try to verify your command on macOS, it fails with zsh: no matches found: 0:s?. I guess it interprets ? in a different way. You guys can try these things upfront and help us save some time.

This is the only error message I got, no stack trace.

logcat always include something more than just a single message. See #72, #120, #173 where other people shared native crashes for different scenarios.

test-app-maven-central uses full package by default, which doesn't include an h264 encoder. So, if I run your command, where you specify -vcodec h264, with it ffmpeg can't find a valid encoder and fails (no crash).

If I use one of the GPL licensed packages, which include x264 library, then I don't see any errors. See the logs.

@tanersener tanersener added question Further information is requested and removed needs-more-details We need more details to understand what the problem is labels Jan 16, 2022
@yeamin27
Copy link
Author

I'm sorry for not providing enough information in the first place.

I was testing the from the build com.arthenica:ffmpeg-kit-full-gpl:4.5.LTS. But I got only this single line of stack trace that I shared in the description.

After your response, I upgraded the build version to 4.5.1-1.LTS and then the crash seems gone. So, I'm closing this issue. Thank you.

@tanersener tanersener self-assigned this Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants