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

Send additional parameters for extract audio (ffmpeg) to add ID3 tags. #1570

Closed
andrewfree opened this issue Oct 7, 2013 · 7 comments
Closed
Assignees
Labels

Comments

@andrewfree
Copy link

Is there a way to send more parameters to ffmpeg when it converts a video to mp3 file because I would like to add params to write ID3 metadata tags.

@Elite
Copy link

Elite commented Oct 7, 2013

I would also support this if does not exist already.

@ghost ghost assigned jaimeMF Oct 10, 2013
@jaimeMF
Copy link
Collaborator

jaimeMF commented Oct 11, 2013

In the next release (or with the version from git) you can add the metadata with the --add-metadata option, for example: youtube-dl 'http://www.youtube.com/watch?v=BaW_jenozKc' --add-metadata, will add it to the video file, if you extract the audio with youtube-dl 'http://www.youtube.com/watch?v=BaW_jenozKc' --add-metadata -x it will also be added to the audio file.
Currently it sets the title, date and author.

@andrewfree
Copy link
Author

Awesome! That will be helpful. I was just using the id3v2 library and python like this in the meantime.

process = subprocess.call(["id3v2","-t",title.strip(),"-a",artist.strip(),"--COMM",downloadSource,os.path.abspath(fileName)]) 

@phihag
Copy link
Contributor

phihag commented Oct 18, 2013

These changes have been added to youtube-dl 2013.10.17 and newer. Type sudo youtube-dl -U to update.

@nealmcb
Copy link

nealmcb commented Nov 23, 2013

I updated and am now running youtube-dl version 2013.11.22.2. But when I run the suggested command on the suggested file, I get no id3 tags. After digging a lot I found out how broken the world of m4a tagging is (http://askubuntu.com/questions/364415/is-there-a-command-line-program-to-read-tags-from-m4a-files) and I see that there are tags there, so that's good.

But when I add --audio-format mp3 to get a better-standardized file, I get no tags. Can id3 tagging be added also? Thanks!

@phihag
Copy link
Contributor

phihag commented Nov 23, 2013

@nealmcb Normally, ffmpeg should just copy the ID3 tags.

$ youtube-dl --add-metadata -x --audio-format mp3 BaW_jenozKc
[youtube] Setting language
[youtube] BaW_jenozKc: Downloading video webpage
[youtube] BaW_jenozKc: Downloading video info webpage
[youtube] BaW_jenozKc: Extracting video information
[download] Destination: youtube-dl test video ''_ä↭-BaW_jenozKc.mp4
[download] 100% of 1.90MiB in 00:02
[ffmpeg] Adding metadata to 'youtube-dl test video ''_ä↭-BaW_jenozKc.mp4'
[ffmpeg] Destination: youtube-dl test video ''_ä↭-BaW_jenozKc.mp3
$ exiftool *mp3 | grep -E 'Artist|Title'
Title                           : youtube-dl test video "'/\ä↭
Artist                          : Philipp Hagemeister

Can you create a new issue where you describe precisely what you are running (the output of youtube-dl, if possible even when called with -v), what version of ffmpeg you have and how you are checking for ID3 tags?

@nealmcb
Copy link

nealmcb commented Nov 23, 2013

Thanks for the quick response! It looks like you're right, and the issue is with the id3v2 program.

When I did my original copy-paste from the command line and hit "Comment", I got this error from github:
"There was an error creating your comment: Body contains unicode characters above 0xffff"
so I've removed some of the file name characters below. (That's quite a file name for youtube-dl tests, and it made me wonder what was going on for a while. A simpler name for this sort of testing might be better.)

$ id3v2 -l youtube-dl\ test\ video-BaW_jenozKc.mp3
youtube-dl test video-BaW_jenozKc.mp3: No ID3 tag

$ eyeD3 youtube-dl\ test\ video\BaW_jenozKc.mp3
...
ID3 v2.4:
title: youtube-dl test video artist: Philipp Hagemeister
...

And mutagen-inspect and exiftool also find it.
So this seems to be an issue with id3v2 (version 0.1.12-2, on Ubuntu Precise 12.04)

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

No branches or pull requests

5 participants