tanersener / mobile-ffmpeg

FFmpeg for Android, iOS and tvOS. Not maintained anymore. Superseded by FFmpegKit.
https://tanersener.github.io/mobile-ffmpeg
GNU General Public License v3.0
3.85k stars 787 forks source link

Getting the same output in command line #585

Closed Extazx2 closed 3 years ago

Extazx2 commented 3 years ago

Description In my app, I use getMediaInformation() to get (among other things) the gps coordinates of a video. On some devices, I can't find the gps coordinates, and instead of having to download the video on my working devices and using the method on the phone, I would like to get the same information from my ubuntu's command line. But when I try to use the arguments used in FFProbe.java (e.g "-v", "error", "-hide_banner", "-print_format", "json", "-show_format", "-show_streams", "-i") in command line, I don't get the same output.

How could I get the same results, if possible ?

Expected behavior I expect to get something like this : output.txt Where we can clearly see the gps coordinates

Current behavior I get something like this : output_other.txt Where we cannot see the GPS coordinates

Other As you can see in the first output file, I use flutter_ffmpeg which is using the mobile_ffmpeg methods. That's why I'm posting here

tanersener commented 3 years ago

You don't have to use getMediaInformation() method if you're not happy with its output. Just run the command that produces output.txt on flutter_ffmpeg and you will get back the same result. There is no magic there.

And if GPS coordinates are not there, then please provide us the outputs. Because output.txt and output_other.txt you've shared in your post are executed on different files. VID_20201027_120400.mp4 output does not include any GPS coordinates. I see that. But did you try to copy that file to ubuntu and check whether it really has GPS information inside?

Extazx2 commented 3 years ago

I'm totally happy with the result of getMediaInformation() !

The logs provided in output.txt are the result of that call and I want to get the same amount of information when doing the commands in command line on my ubuntu computer (which produces output_other.txt).

By the way, that's the same file in both outputs. My file_picker is extracting it with another name (which ends with .jpg, known issue)

I might have worded my request badly, but I wanted to know if there are other arguments running in the getMediaInformation() method other than the ones I've included in my first post : "-v", "error", "-hide_banner", "-print_format", "json", "-show_format", "-show_streams", "-i"

(Or maybe I've mistaken the getMediaInformation() used by the flutter package with another one ?)

tanersener commented 3 years ago

Let's start again.

Extazx2 commented 3 years ago

On my App i'm using Flutter_ffmpeg v0.2.10 I'm not using mobile_ffmpeg "as is" only through flutter_ffmpeg.

Output.txt are the mobile_ffmpeg logs from this piece of code :

 String coordinates = await _flutterFFprobe.getMediaInformation(filePath).then((info) {
      String coordinatesIdentifier;
      if (Platform.isIOS) {
        coordinatesIdentifier = "com.apple.quicktime.location.ISO6709";
      } else {
        coordinatesIdentifier = "location";
      }
      return info['metadata'] != null ? info['metadata'][coordinatesIdentifier] : null;
    });
    if (coordinates != null) {
      return _getLongAndLat(coordinates);
    }
    return null;
  }

On my computer i'm using Ffmpeg v3.4.8

tanersener commented 3 years ago

You're using the older version of the plugin. Please use the latest version of flutter_ffmpeg. It has a new and more flexible getMediaInformation implementation.

Extazx2 commented 3 years ago

The version of the plugin I'm using is not the problem here...

What I would like to know is : what are the ffmpeg commands to use to replicate mobile-ffmpeg getMediaInformation() ?

tanersener commented 3 years ago

You're using flutter_ffmpeg v0.2.10. It depends on mobile-ffmpeg v4.3.1. You can see the version here. getMediaInformation implementation on mobile-ffmpeg v4.3.1 uses this command.

Extazx2 commented 3 years ago

Ok, so I thought well but it does not output the information I want in command line...

Thanks anyway