Coder Social home page Coder Social logo

react-native-media-meta's Introduction

React Native Media Meta NPM version

Get media file metadata in your React Native app

Installation

$ npm install react-native-media-meta --save
$ react-native link

Usage

import MediaMeta from 'react-native-media-meta';
const path = '<your file path here>';

MediaMeta.get(path)
  .then(metadata => console.log(metadata))
  .catch(err => console.error(err));

API

MediaMeta.get(path) - Promise

Resolve: Object - included following keys (If it's found)

  • thumb - Base64 image string (video: get first frame, audio: get artwork if exist)
  • duration (video only)
  • width - the thumb width
  • height - the thumb height
  • Others:

[Android] We using FFmpegMediaMetadataRetriever, see RNMediaMeta.java#L36 for more information.
[iOS] We using official AVMatadataItem, see RNMediaMeta.m#L9 for more information.

License

MIT

react-native-media-meta's People

Contributors

dependabot[bot] avatar hzburki avatar jberendes avatar jhen0409 avatar mthahzan avatar prscx avatar ranjitpandit avatar salehjarad avatar vomchik avatar yatanvesh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

react-native-media-meta's Issues

Hangs when installing APK

This install was working, until about a day ago, when I got:

~/projects/react-native/app$ react-native run-android
Scanning 797 folders for symlinks in /home/justin/projects/react-native/app/node_modules (6ms)
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...
Reading env from: .env
> Configuring > 3/15 projects > Resolving dependencies ':app:_debugApk' > Resolving dependencies ':react-native-media-meta:_debugPublish

... it just hangs with a blank cursor in the terminal.

App is crashing only in production

I am using this package to get video meta data . App was working fine in debug mode but in release it is crashing.Below is the log i got from adb logcat.

04-15 17:10:11.509 4536 4617 E AndroidRuntime: java.lang.NoClassDefFoundError: failed for class wseemann.media.FFmpegMediaMetadataRetriever; see exception in other thread
04-15 17:10:11.509 4536 4617 E AndroidRuntime: at com.mybigday.rnmediameta.RNMediaMeta.getMetadata(Unknown Source:21)
04-15 17:10:11.509 4536 4617 E AndroidRuntime: at com.mybigday.rnmediameta.RNMediaMeta.access$000(Unknown Source:0)
04-15 17:10:11.509 4536 4617 E AndroidRuntime: at com.mybigday.rnmediameta.RNMediaMeta$a.run(Unknown Source:8)

below is the version of react native.
"react": "18.2.0",
"react-native": "0.71.5",
"react-native-media-meta": "^0.0.11",

It will be great if someone help me out

is it possible to use local URL ?

hi, i have IOS uri/local url from cameraRoll react native, can i use it ? because i always get error using that ? can you tell me path of ios file..

thanks.

Support for IPTC metadata?

Hi there.
I was curious if this package supports IPTC metadata?

For example, on apple dev documentation you can see the docs related to IPTC metadata (does it mean that it supported here too?)

Unfortunately, i couldn't find any for Android, and i'm not sure if they have it at all.

Thanks!

Question about the location metadata.

What does the coordinates in the location response means?
I get this from the response and the first two values are my lats and long. But what are the third ones and do we need these as the first two is an exact match of where the video is taken.

+61.2866+028.9573+036.774/

Lat: +61.2866
Long: +028.9573
???: +036.774/

undefined is not an object (evaluating 'RNMediaMeta.get')

"react-native": "^0.51.0",
"react-native-media-meta": "^0.0.10",

My implementation

MediaMeta.get('content://media/external/images/media/986')
      .then(metadata => console.log('HERE METADATA ', metadata))
      .catch(err => console.error(err));

Upsidedown Android Thumbnail Orientation

The Android code isn't respecting the rotation metadata that gets stored inside the video when recording video using Android's standard camera classes for recording.

Therefore thumbnails are upside down for some videos.

Here is sample code to resolve this:
https://software.intel.com/en-us/forums/intel-media-sdk/topic/561046#comment-1840836
(with full discussion of the issue and sample test videos as well).

Do you have a fix in the works for this, or should I create a pull request?

Thanks and please advise.

Roadmap

  • thumb - support get frame by time
  • thumb - support resize

iOS

  • Use FFmpegMediaMetadataRetriever iOS instead of AVMatadataItem

It does not work for images

Just added this on a React Native app (0.60+), tested it on iphone 11 pro, it works on videos but sadly not on images that I captured from the phone.

I get this object when I select a video:
{
creationDate: "2019-12-27T22:34:50+0800"
duration: 11058.333333333334
height: 1920
location: "+13.6296+123.1983+014.891/"
thumb: "iVBORw0KGgoAAAANSUhEUgAABaAAAAeACAYAAAA4k/DXAAABYW"
width: 1440
}

And if I select an image I get {}.

It would had been great if it works for images as well, for example I need to get the location taken of the image.

My question is there a way to make this work for image? or possibility adding this in the future?

No response in promise

Don't show me any response.

He never return anything, not even that there was an error

EmptyThrowable: Invalid file

EmptyThrowable: Invalid file: ***/node_modules/react-native-media-meta/android/src/main/AndroidManifest.xml

It's not causing the app to break but it's early in my discovery of it happening.

*** - represents the app path (different for everyone)

'React/RCTDefines.h' file not found

Getting following error when trying to build app with XCode:

'React/RCTDefines.h' file not found

On Android library works and compiles normally.

Any idea if this is fixable with my project itself?

Getting Read time outs when trying to build

We've been experiencing some weird error that comes up almost every time we try to build our project:

 * What went wrong:
 Could not resolve all files for configuration ':react-native-media-meta:debugRuntimeClasspath'.
 > Could not resolve com.github.wseemann:FFmpegMediaMetadataRetriever:1.0.+.
   Required by:
       project :react-native-media-meta
    > Failed to list versions for com.github.wseemann:FFmpegMediaMetadataRetriever.
       > Could not list versions using M2 pattern 'https://jitpack.io/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier])(.[ext])'.
          > Could not get resource 'https://jitpack.io/com/github/wseemann/FFmpegMediaMetadataRetriever/'.
             > Could not GET 'https://jitpack.io/com/github/wseemann/FFmpegMediaMetadataRetriever/'.
                > Read timed out

Gradle cleaning, cache-clearing, rebooting, or resetting does not fix this issue.

This pops up like 9 out of 10 times and the build fails. Then, miraculously, the build succeeds. Any idea what this could be?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.