OptimalBits / navcodec

nodejs extension for libavcodec
151 stars 19 forks source link

Missing Cover Art and Rating #8

Closed anthonywebb closed 11 years ago

anthonywebb commented 11 years ago

Love this lib, I am able to get at most of the data, however I am not seeing the album art being returned, or the movie rating? I know the rating and the album art are in there as I see them in other tools that read metadata, any idea how to get at that data?

navcodec.open('21.m4v', function(err, media){
  if(media){
    console.log(media.metadata);
  }
});

Outputs:

{ major_brand: 'mp42',
  minor_version: '0',
  compatible_brands: 'mp42isom',
  creation_time: '2008-08-08 15:56:02',
  encoder: 'HandBrake 0.9.2 2008021900',
  title: '21',
  artist: 'Kate Bosworth',
  date: '2008-03-28T00:00:00Z',
  description: 'An unconvincing exercise in moral complexity, 21 is based on Ben Mezrich\'s book Bringing Down the House: The Inside Story of Six M.I.T. Students Who Took Vegas for Millions. Jim Sturgess (Across the Universe) plays brilliant, blue-collar scholar Ben Campbe',
  media_type: '0' }
manast commented 11 years ago

Hello,

I don't know why the rating is not in the metadata object, this may be some limitation of avcodec, but with the latest version of navcodec (0.3.4), this works to extract the album art:

navcodec.open('assets/robots.mp3', function(err, media){

  media.addOutput('art.jpg');

  media.transcode(function(err, progress, finished, time){
    if(finished){
      console.log("Finished");
    }
  });
});
anthonywebb commented 11 years ago

Bummer, I must have tried 5 different libraries last night trying to get at the rating. The only one I found that can easily get at all the meta info (including coverart, genre, duration, rating, among a plethora of other useful meta info) is this one: https://code.google.com/p/mp4v2/

anthonywebb commented 11 years ago

Do you know if genre is somewhere in avcodec?

manast commented 11 years ago

It seems that avcodec is not so good for video metadata, for audio it works fine I think.