-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Dump is writing errors to stdout #26
Comments
Ah, this pretty much relates to #25... there should never be an exception printed out, especially when dumping data. Errors have to be handled very carefully and robust. |
So, I tried to follow the steps creating a bogus ffmpeg -i without_id3.m4b -metadata ASIN="1337" -movflags use_metadata_tags with_id3.m4b and it failed to create a file. Would you mind providing a test file, that leads to this error, so that I can reproduce the issue directly? |
So now I added a simple try catch block to prevent these errors in stdout, but I have to verify, that this fixes your problem - so an example file would be awesome. The try catch is targeted for |
I just committed a sample m4b with bad metadata here: https://github.com/advplyr/node-tone/tree/master/samples tone dump .\samples\m4b_bad_metadata.m4b --format json Will produce the error |
Thank you, reproduced. I'll try what I can :-) |
Ok, I found a problem in |
I want to add that when I write ASIN as an additional field in tone to an m4b file it won't show when doing an ffprobe. |
I think so. If you have a sample I use |
I can't get an m4b file to show the ASIN in both ffprobe and tone. Tone won't read the ASIN embedded by ffmpeg and ffprobe won't read the ASIN embedded by tone. |
You can add a new issue for this with an example file, if you like. I don't think, that ASIN is a specified Tag in any well known format, but I'm definitely willing to investigate this.
https://gist.github.com/coolaj86/965870/9a0ad076fddd9a2ae0ab4eddc2ab1a3dc222d50a |
I think ffmpeg is writing custom id3 tags into mp4 files which is why this causes problems with tone. |
If that is the case, What you could also try: ffmpeg -i input.mp3 -movflags use_metadata_tags -metadata ASIN=B01M1KJCQB outfile.m4a
ffmpeg -i input.mp3 -movflags use_metadata_tags -metadata "----:com.apple.iTunes:ASIN=B01M1KJCQB" outfile.m4a Is the file you provided generated this way? If so, I could talk to the |
I'm not sure if ffmpeg is doing the wrong thing or I am just using it incorrectly with that I just tested what you mentioned and it causes the same error in tone as I mentioned in the OP. I think it is safe to say that |
I think you might be right... (see mifi/lossless-cut#402). Basically this is why I wrote
This is a huge effort but it is accurate, while So to conclue this issue, my todo:
|
Ok, since there was no release of Explanation:
Using |
Is there a way to get an error message in stderr or stdout? node-tone is always going to be using the json format. I can now correctly identify it failed using the error code but I won't be able to get any error message to the user without it coming through stdout or stderr. As far as what you mentioned for this release my tests are all working as you described. |
You mean putting the error to stderr and the dump output to stdout? Well, that would be possible... I thought putting the error to the logfile on demand ( |
With the log file there is no good way for this to be used in abs that I know of. I'm assuming when an exit code of 4 is returned this is a critical error and I'm going to ignore the stdout. In that case I could log the error from stderr in abs. For this first implementation I'm going to have abs fallback to ffprobe when a tone dump returns exit code > 0. |
Yeah, I would target the stderr output for |
Should be fixed in the latest code - targeted for |
This is how I was writing custom metadata to
m4b
files using ffmpeg, which I found out was NOT a good idea.I will outline it here to show how tone dumps the file, I am not expecting tone to correctly parse this.
First writing a custom tag to the sample
m4b
hereFfprobe format output:
Now tone dump
Output:
The issue is that tone is outputting all of this to stdout so node-tone is unable parse the JSON of the metadata that was found. It is okay that tone didn't pull the ASIN tag, but I still want to get the rest of the output.
The text was updated successfully, but these errors were encountered: