title: How to Extract Lyrics (USLT frame) from Mp3 using FFmpeg?
body: <p>I'm using Mp3tag's &quot;Tools&quot; feature to batch run FFmpeg in Windows, in order to batch extract the embedded lyrics content (USLT frame of <a href="https://id3.org/id3v2.3.0" rel="nofollow noreferrer">ID3v2 tag</a>) from MP3 files, I know with FFmpeg I can do something like:</p>
  <pre><code>-i &quot;%_path%&quot; -f ffmetadata &quot;%_folderpath%\%_filename%.txt&quot;
  </code></pre>
  <p>&quot;%_path%&quot; = full path of the MP3 file</p>
  <p>&quot;%_folderpath%%_filename%.txt&quot; = path and filename of the exported txt file.</p>
  <p>The command above extracts all the metadata from MP3 file and export them into a txt file with the following cotent for example:</p>
  <pre><code>;FFMETADATA1
  album=name of the album
  artist=name of the artist
  title=name of the title
  lyrics-eng=[00:01.23]line1 of lyrics
  \
  [00:04.56]line2 of lyrics
  \
  [00:07.89]line3 of lyrics
  \
  [01:03.12]3rd last line of lyrics
  \
  [02:04.34]2nd last line of lyrics
  \
  [03:05.67]Last line of lyrics
  \
  
  date=2020
  encoder=Lavf59.23.100
  </code></pre>
  <p>(the original lyrics uses <a href="https://en.wikipedia.org/wiki/LRC_(file_format)" rel="nofollow noreferrer">Simple LRC format with timestamps in each line</a>, certain lines contain only the timestamp with empty lyrics)</p>
  <p>(There might (or might not) be additional metadata (e.g. <a href="https://i.stack.imgur.com/G55oF.png" rel="nofollow noreferrer">date and encoder in the example above</a>) following the lyrics part)</p>
  <p>As seen above, the backslash &quot;\&quot; (which is not present in the original lyrics) is somehow added after each line of lyrics, <a href="https://i.stack.imgur.com/4V7K2.png" rel="nofollow noreferrer">between CR (CarriageReturn) and LF (LineFeed) as seen in Notepad++</a> (the original lyrics use <a href="https://i.stack.imgur.com/IGqNq.png" rel="nofollow noreferrer">CRLF</a> as EOL characters).</p>
  <p>So how do I <strong>modify the given command line</strong> to export <strong>only</strong> the lyrics part (<strong>exluding all other metadata and the extra backslash &quot;\&quot;</strong>), an example of the expected text file content is shown below:</p>
  <pre><code>[00:01.23]line1 of lyrics
  [00:04.56]line2 of lyrics
  [00:07.89]line3 of lyrics
  [01:03.12]3rd last line of lyrics
  [02:04.34]2nd last line of lyrics
  [03:05.67]Last line of lyrics
  </code></pre>
  <p>with the original EOL characters from lyrics such as <a href="https://i.stack.imgur.com/IGqNq.png" rel="nofollow noreferrer">CRLF</a></p>