How to obtain metadata: "Comment" file-flags in ogg-files

Hello altogether,

I´d very much like to have your opinion on a certain matter. The theme is “metadata”.

I´d better try to make my point a bit clearer by using an example.
Alas the case I´m referring to is a German-language podcast. But I believe that doesn´t matter because it´s the principle that counts.

So our local radio broadcaster “SWR3” currently transmits a radio play “Tod am Kanzleramt” (Death at the Chancellery) via FM broadcasts.
There are two episodes per day with a duration of roughly one and a half minutes up to two and a half minutes. All episodes will finally add up to about an hour.

Naturally not everyone has got the time and opportunity to listen in live. So the broadcaster puts all hitherto transmitted episodes on its web-site:

For the sake of piecing together the individual episodes (in order to finally obtain one coherent radio play) I proceed as follows:

1.) downloading the individual mp3-files from the web-page (two per day) with wget.

2.) transferring the mp3-files to ogg-files. Example:
ffmpeg -i part13.mp3 part13.ogg

3.) putting all pieces together like so:
ffmpeg -i "concat:output_all-up-to_part12.ogg|part13.ogg|part14.ogg" -acodec copy output_all-up-to_part14.ogg

This way I will in the end get one (hopefully) super piece of radio play.

Each part contains metadata, at least “Comment” as “File Tags”. Here´s an example for part13:

File tags:
Comment: Folge 13: Vor seinem Tod hatte der Ministerial-Beamte Burkhard Waibel die verschwundenen sieben Millionen Euro aus einem Entwicklungsprojket gesucht – und gefunden. Sei Vorgesetzter, Staatssekretär Schröter, hatte das Geld unterschlagen und damit sollte er nicht davonkommen. Waibel hatte eigene Pläne…
Title: „Tod am Kanzleramt“ – Folge 13

As a rule I play the latest file with mpv. Example:

mpv --start=00:21:33 /media/rosika/f14a27c2-0b49-4607-94ea-2e56bbf76fe1/DATEN-PARTITION/Musik/swr3/output_all-up-to_part14.ogg

or from the beginning:

mpv /media/rosika/f14a27c2-0b49-4607-94ea-2e56bbf76fe1/DATEN-PARTITION/Musik/swr3/output_bis_Teil14.ogg

So every time a new episode starts the terminal displays the “Comment” file-tag (see above).

What I´d like to do is displaying all the metadata and redirecting the info to a text-file.
But up and until now I haven´t come across a method of displaying all metadata.

I tried e.g.

ffmpeg -i “output_all-up-to_part14.ogg” -f ffmetadata metadata.txt

but it leads to nothing, just:


And the terminal itself:

ffmpeg -i "output_all-up-to_part14.ogg" -f ffmetadata metadata.txt

ffmpeg version 3.4.6-0ubuntu0.18.04.1 Copyright (c) 2000-2019 the FFmpeg developers
Input #0, ogg, from 'output_bis_Teil14.ogg':
  Duration: 00:26:39.29, start: 0.000000, bitrate: 100 kb/s
    Stream #0:0: Audio: vorbis, 48000 Hz, stereo, fltp, 112 kb/s
      ENCODER         : Lavc57.107.100 libvorbis
      DATE            : 2020
      TITLE           : „Tod am Kanzleramt“ – Folge 1
      AUTHOR          : SWR3
      comment         : Der SWR3-Krimi: „Tod am Kanzleramt“.  
                      : Folge 1: Und er spielt natürlich in Berlin. Wo alles so friedlich anfängt….
      COPYRIGHT       : SWR3 2020
      GENRE           : Podcast
      album_artist    : SWR
      ALBUM           : SWR
Output #0, ffmetadata, to 'metadata.txt':
    encoder         : Lavf57.83.100
Stream mapping:
Press [q] to stop, [?] for help
size=       0kB time=-577014:32:22.77 bitrate=N/A speed=N/A    
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Output file is empty, nothing was encoded 

So nothing like the info I get when playing the file with mpv.

What do you think - is there a way of getting all the “Comment” file tags?

Thanks a lot in advance.

Rosika :blush:

1 Like

Not sure - not sure if this is even an answer, or any help, or if I’m just spamming/hijacking your thread, so apologies in advance.

For MP3 files I use the “id3v2” CLI application (e.g. on ubuntu or debian “sudo apt install id3v2”).

You can list all the metadata for a given (or wildcard “*”) mp3 file with “id3v2 -l *.mp3”, and “id3v2 -c *.mp3” ** would display the comment fields from all mp3 files in the $PWD…

I like it so much, I wish it would work with FLAC files too… but it doesn’t… if I get FLAC files that have badly formed (or non existent) metadata, I just use the metadata editing features (they’re quite sophisticated) in my favourite GUI media player “Sayonara”…

I probably use id3v2 several times a week, especially tagging music I might rip off youtube or any other streaming site (using youtube-dl)… Nice and small, and easy to script too…

** that’s probably wrong… “id3v2 -c *.mp3” probably expects to update the comment tag… sorry…

I’m not much in this “multi-media” thingy… :wink:
but perhaps this will help you out.
I stumbled upon it just as of now, so no clue if this is what you seek…
I think the -c parameter may do what is wanted (?)

Thanks a lot for your answer.

I installed id3v2 and ran

id3v2 -l kgw_output_bis_Teil14.ogg
kgw_output_bis_Teil14.ogg: No ID3 tag

As can be seen there don´t seem to be any id3 tags. Perhaps they got lost during the conversation process from mp3 to ogg :question: :frowning:

But it´s good to know about id3v2, which I hadn´t known before. It may come in handy in the future.

Greetings. Rosika :slightly_smiling_face:

Hi to you too and thanks as well.

I installed vorbiscomment and had a bit of luck with that one:

vorbiscomment -l kgw_output_bis_Teil14.ogg
ENCODER=Lavc57.107.100 libvorbis
TITLE=„Tod am Kanzleramt“ – Folge 1
DESCRIPTION=Der SWR3-Krimi: „Tod am Kanzleramt“.
Folge 1: Und er spielt natürlich in Berlin. Wo alles so friedlich anfängt….

But - as can be seen - it just displays some description of the first episode which is at the beginning of the file. This is more or less the same that I caught with:

(see above). All the data from the following parts are not shown.
Yet I know they have to be there somewhere as mpv displays them in the terminal each time a new part starts.

Well, it seems to be a bit too tricky but that´s O.K.
Nevertheless thanks a lot for your help.
Rosika :slightly_smiling_face:

Just curious: what about the parameter -c ?
Does this show all of the comments (in an output file)?



vorbiscomment -c kgw_output_bis_Teil14.ogg

gives me an error. This is why I used the “-l”-option.
According to the man pages

-c file, --commentfile file
Take comments from a file.

it might not be used for displaying the comments that are present in the file. But perhaps I interpret it incorrectly.

You’re right. I misinterpreted the parameter. It takes comments from a file. Not vice-versa…

Thanks for the confirmation. Greetings. Rosika