mp4edit icon indicating copy to clipboard operation
mp4edit copied to clipboard

Library does not work.

Open heapwolf opened this issue 8 years ago • 7 comments

I updated the example and added some files that could be used by the code, but it outputs a result that cant be read by a player...

 var fs = require('fs')
 var mp4edit = require('mp4edit');
 MP4 = mp4edit.MP4;

 // Album cover
 var coverImage = fs.readFileSync('cover.jpg');

 // Original MP4 (m4a is an mp4 file that contains audio only)
 var mp4 = fs.readFileSync('./test1.m4a');

 var tags = {
     title : "Song Title",
     artist : "Song Artist",
     album : "Album",
     genre : "Any genre",
     cover : coverImage
 };

 // Parse, give tags, and build mp4 file.
 var output = MP4.make( MP4.giveTags( MP4.parse(mp4), tags));

 fs.writeFileSync('./test1-output.m4a', output);

heapwolf avatar Feb 17 '16 13:02 heapwolf

I'm now making another small personal project using this library so I'm revisiting it and getting it to work again. Hopefully by the end of this week I'll have a new release.

lukeschaefer avatar May 02 '16 01:05 lukeschaefer

Any updates on this?

xvvvyz avatar Aug 14 '16 20:08 xvvvyz

Okay so I just uploaded a recent version I have on my machine. Sorry. I'm not too good at maintaining open source software evidently. But it works for me now. I'll try to update the documentation, but for now, here's an example of how I'm using it:

var mp4 = new MP4(file); var tags = mp4.getCommonTags(); // Gives author, album, genre, cover and title. mp4.giveTags({artist:"The Beatles"}); var blob = new Blob([mp4.build().buffer], {type: 'audio/mp4'}); var url = URL.createObjectURL(blob);

lukeschaefer avatar Aug 14 '16 21:08 lukeschaefer

Okay and the Quickstart has been updated with a browser example that's close to how I use it.

lukeschaefer avatar Aug 14 '16 21:08 lukeschaefer

@lukeschaefer can you push that to npm?

xvvvyz avatar Aug 14 '16 23:08 xvvvyz

@lukeschaefer Can you push up the latest working code?

drew-wallace avatar Apr 30 '18 04:04 drew-wallace

bump...

whoiskevinrich avatar Sep 11 '21 16:09 whoiskevinrich

....7 years later....

Refactored it to typescript and added tests and reuploaded to npm. Seems to mostly work now but it's still mostly hacky gross code I wrote a decade ago.

lukeschaefer avatar Mar 11 '23 17:03 lukeschaefer

.... mostly hacky gross code I wrote a decade ago.

No worries. Updating your old code is like trying to solve a mystery in which you are the victim, investigator, and murderer. 😄

whoiskevinrich avatar Mar 11 '23 19:03 whoiskevinrich