Skip to content
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

Adding metadata to audio files doesnt work #11047

Closed
Tomhoogstra opened this issue Oct 27, 2016 · 10 comments
Closed

Adding metadata to audio files doesnt work #11047

Tomhoogstra opened this issue Oct 27, 2016 · 10 comments

Comments

@Tomhoogstra
Copy link

@Tomhoogstra Tomhoogstra commented Oct 27, 2016

Please follow the guide below

  • You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your issue (like that [x])
  • Use Preview tab to see how your issue will actually look like

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2016.10.26. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running youtube-dl 2016.10.26

Before submitting an issue make sure you have:

  • At least skimmed through README and most notably FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

Description of your issue, suggested solution and other information

Attempting to load extracted wav files into a java AudioInputStream but receiving an error due to the Bit rate and length properties not being present in the file.

A file converted on convert2mp3.net added the following properties to the file and it worked flawlessly
Image of working file
However, using youtube-dl, it retrieves a file with the following properties
Image of broken file

Is there an argument to add this kind of information to a downloaded video? I tried a view such as meta data.
If there isn't would it be possible to add?
Thanks, keep up the good work.

Edit: Done some more digging, --add-metadata tag mentions that is adds the metadata for videos, but I tried it for audio anyway with no success. Decided to check the output when running it, and apparently using the following settings
"youtube-dl.py https://www.youtube.com/watch?v=6Cp6mKbRTQY --add-metadata --extract-audio --audio-format wav --output /Songs/6Cp6mKbRTQY.wav", the following error pops up at the very end.

Error

@Tomhoogstra Tomhoogstra changed the title Adding properties to audio files Adding metadata to audio files doesnt work Oct 27, 2016
@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Oct 28, 2016

Could you paste the whole output of this command:

youtube-dl.py -v https://www.youtube.com/watch?v=6Cp6mKbRTQY --add-metadata --extract-audio --audio-format wav --output /Songs/6Cp6mKbRTQY.wav

Please paste as texts. Don't paste screenshots.

@Tomhoogstra
Copy link
Author

@Tomhoogstra Tomhoogstra commented Oct 29, 2016

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Oct 30, 2016

@Tomhoogstra Could you try this:

youtube-dl.py -v https://www.youtube.com/watch?v=6Cp6mKbRTQY --add-metadata --extract-audio --audio-format wav --output /Songs/6Cp6mKbRTQY.%(ext)s
@Tomhoogstra
Copy link
Author

@Tomhoogstra Tomhoogstra commented Oct 30, 2016

@yan12125
http://pastebin.com/RAchZ227

It creates a file with unknown extension

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Oct 30, 2016

The percentage sign in %(ext)s disappears from your command. If things are still broken after fixing the command, please test this: --output 6Cp6mKbRTQY.%%(ext)s.

@Tomhoogstra
Copy link
Author

@Tomhoogstra Tomhoogstra commented Oct 30, 2016

@yan12125 Yes, using this command
youtube-dl.py https://www.youtube.com/watch?v=EbJtYqBYCV8 --audio-format wav --extract-audio --add-metadata --output /Songs/EbJtYqBYCV8.%%(ext)s

It adds the meta deta correctly, and even converts it to wav like I wanted it to.
So in the end it was a user error I guess.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Oct 30, 2016

Yeah. Windows is tricky.

Closing as problem solved.

@yan12125 yan12125 closed this Oct 30, 2016
@Spenhouet
Copy link

@Spenhouet Spenhouet commented Nov 4, 2016

This doesn't work for me.

youtube-dl -x --audio-format "mp3" --audio-quality 0 -o "/Music/%(uploader)s/%(title)s.%(ext)s" --metadata-from-title "%(artist)s - %(title)s" --add-metadata https://www.youtube.com/watch?v=0sjR0-EG3BM

The artist and other metadata is not set.
On Windows.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Nov 4, 2016

@Spenhouet That's a known bug. See #5594

@Spenhouet
Copy link

@Spenhouet Spenhouet commented Nov 4, 2016

@yan12125 I did find out what's the problem: If the first downloaded file format is .webm then, this file doesn't contain any metadata. Therefor the converted .mp3 file also doesn't contain any metadata.

I added this command: --format "bestaudio[ext=m4a]"
Now it's downloading a .m4a file and saving the metadata correct (also in the converted .mp3 file).

Could be related to this: #9730

I created a new issue to raise awareness: #11116

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.