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

No output file is produced on the specified location #2

Open
ghost opened this issue May 18, 2016 · 11 comments
Open

No output file is produced on the specified location #2

ghost opened this issue May 18, 2016 · 11 comments

Comments

@ghost
Copy link

ghost commented May 18, 2016

Hi!

First of all thanks for this awesome project. I've been looking for ages for C# wrapper for FFMPEG and I came across this which got me really excited. I downloaded this project and tried to run it on my android device which uses Android API 15. The project compiles fine and the output log is generated upon running, however there's no output file produced on the specified location. The program first saves an input file on the external storage path to be encoded then this file is encoded in 3 different ways. None of the method which is used for encoded produces any output.
Is this a hardware related issue or something else? The FFMPEG binary is installed on my device when I run the project. I have tried to use this binary in many different ways but I'm not able to encode the video file.
Any idea what I might be doing wrong and how I might be able to make this work?

@leye0
Copy link
Owner

leye0 commented May 19, 2016

Hello!

  1. If you put a breakpoint at https://github.com/leye0/XamarinAndroidFFmpeg/blob/master/XamarinAndroidFFmpegTests/MainActivity.cs#L35, is the path retrieved a path that really exists?
  2. What do you see in the log? Are you able to cut and paste it here? I feel like this will be a trivial problem.
  3. What's your device?

@ghost
Copy link
Author

ghost commented May 19, 2016

The path does exist. I'm using the same path to store video recorded from the camera in another application, also cat1.mp4 is stored at that location.

Here's the log generated when I run the app:

http://postimg.org/image/dgygyeugx/

I have a Sony Xperia device with Android 4.0.3.

@ghost
Copy link
Author

ghost commented May 20, 2016

I'm hoping this is something trivial. Any idea why it's not working on my device?

@leye0
Copy link
Owner

leye0 commented May 26, 2016

Actually it doesn't look like a complete ffmpeg log, as ffmpeg would usually output all infos about the detected stream. You/I should modify the code to redirect more infos from the process to the standard output so we could get infos about which codec were detected.

For the device, mine was a Xperia 4.1 when I've coded and tested it.

@ghost
Copy link
Author

ghost commented May 30, 2016

The wrapper actually supports Android 4.1 and above devices. I tested it on another phone which has android 4.2 and it worked and the full log was created 👍

I've found a Java library for FFMPEG that has backward compatibility. I'm going to create a binding library and test if it works. Thanks for taking the time out to answer me :)

@leye0
Copy link
Owner

leye0 commented May 30, 2016

This solution is in fact just launching a process with commands, so I'm not sure where there could be any compatibility issue. Actually, I'd even not be surprised if it can run on Android 2.x.

What I'm thinking is that it may rather have something to do with the way I'm accessing external storage. I've made it so that it works on my device in a very specific context. The ideal test environment would be a new project with a single activity that launches the ffmpeg process with hardcoded params.

@ghost
Copy link
Author

ghost commented May 30, 2016

Hmm..That's strange. The file path which is "Android.OS.Environment.ExternalStorageDirectory.AbsolutePath" does exist on my phone and it's the internal storage location. The test code you have written first writes an input file to that directory, which works fine on my device. It's the encoding process that doesn't work as it should.
I'm not sure what you mean by create a new project with a single activity because your project only has a single Activity in which you test the encoding. I wonder why isn't the full log generated on my phone if the problem isn't compatibility. Maybe I'll try with a different location to see if something changes.

@ghost
Copy link
Author

ghost commented May 30, 2016

Are you sure it's not the compatibility issue? I was going to buy a new phone just so I could make it work lol. It's strange that it works on one phone but not on the other. I used a Java library that explicitly says it supports Android 2.0 and above and that library ran fine on my phone and generated the output.

@leye0
Copy link
Owner

leye0 commented May 30, 2016

My assumptions about compatibility are based on the fact that we are just running an executable. I'm not sure about the ARM version on which the ffmpeg binary included in my project is compiled, but the problem may be in some incompatible ARM calls, bad check for neon compatibility. Anyway, I'm just theorizing right now as I'm in vacations with no dev environment setup. :) I get to look at it. I'll let this issue open.

@ghost
Copy link
Author

ghost commented Jun 7, 2016

Hey Leon! Are you back from your vacations?

@leye0
Copy link
Owner

leye0 commented Jun 7, 2016

I'll be back to work in a few days. Will give a look at it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant