Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Writing metadata (Artist Name, Song Title, Year, Album, Duration, Genre) to mp3/m4a audio file using youtube-dl (subsequent AtomicParsely error)

I am extracting audio only from youtube videos using youtube-dl. I would like to write the metadata (i.e. Artist Name and Song Title, Year, Album, Duration, Genre) into the mp3/m4a file after downloading. My attempt to accomplish this starts with this code:

@echo off
youtube-dl --format m4a/mp3 --youtube-skip-dash-manifest --embed-thumbnail -o "%%(title)s.%%(ext)s" --metadata-from-title "%%(artist)s - %%(title)s" --add-metadata 2Y6Nne8RvaA
pause

This code produces the following output:

[youtube] 2Y6Nne8RvaA: Downloading webpage
[youtube] 2Y6Nne8RvaA: Extracting video information
[youtube] 2Y6Nne8RvaA: Downloading thumbnail ...
[youtube] 2Y6Nne8RvaA: Writing thumbnail to: Kungs vs Cookin' on 3 Burners - Thi
s Girl.jpg
[download] Destination: Kungs vs Cookin' on 3 Burners - This Girl.m4a
[download] 100% of 2.99MiB in 00:01
[ffmpeg] Correcting container in "Kungs vs Cookin' on 3 Burners - This Girl.m4a"

[fromtitle] parsed title: This Girl
[fromtitle] parsed artist: Kungs vs Cookin' on 3 Burners
[ffmpeg] Adding metadata to 'Kungs vs Cookin' on 3 Burners - This Girl.m4a'
ERROR: AtomicParsley was not found. Please install.
Press any key to continue . . .

As you can see, I am able to successfully able to add a few of the tags from the video, but not all of them and the Year is royally screwed up. enter image description here

What is this AtomicParsely error and how do I remedy it? Do I need this program to correctly add all the Metadata to the file that I want, or can this be accomplished in another way?

Referencing Steven Penny's post, FFmpeg metadata not showing in Windows?, is solving this problem as simple as using an ffmpeg command?

When I do a google search for this song, the first link that shows is the exact link I'm using on YouTube, and the search shows pertinent metadata (see below). I'm not sure if this data is input manually by users, or if Google mined this from the video: enter image description here

I admit that I'm new to using youtube-dl and ffmpeg, but with the help of the commenters on StackOverflow, I'm learning more each day. This post is a follow-up to my previous question: Downloading YouTube to mp3 and writing metadata (artist/song title) to mp3 file using youtube-dl

like image 990
IRNotSmart Avatar asked Oct 18 '22 21:10

IRNotSmart


1 Answers

You are trying to use YouTube-DL, and in turn AtomicParsley to set the tags of this file.

To use --embed-thumbnail, YouTube-DL must call an external program, as doing that is beyond the scope of the YouTube-DL project. In this case they are calling AtomicParsley.

Proper embedding thumbnails into M4A/MP4 is not easy, even in 2016. Several tools can do this, but they each have their problems:

  • TagEditor is probably best suited to this task. It can do in place editing assuming the file has enough padding. It does have an issue with non ASCII content however.

  • MP4Box, Bento4 and AtomicParsley can all do this as well, but none of them do in place editing. This can be a problem with larger files. In addition AtomicParsley is starting to show its age.

  • Picard is also quite useful if you do not mind a GUI.

  • FFmpeg is a huge project and can’t do this at all.


Regarding the year: in this case YouTube-DL cannot help you, because that information is not in the page:

$ de=$(mktemp)
$ wget -O "$de" https://www.youtube.com/watch?v=2Y6Nne8RvaA
$ grep '2009[^[:digit:]]' "$de" | wc
      0       0       0

It is up to the uploader what they put in the description, and in what format.

like image 58
Zombo Avatar answered Oct 21 '22 03:10

Zombo