0

My input:

ffmpeg -i input.ogg -metadata Album='Vitaly' output.aac

Returned:

    ffmpeg version 3.3.4-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2017 the FFmpeg developers
      built with gcc 6.4.0 (Debian 6.4.0-4) 20170820
      configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libfribidi --enable-libass --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg
      libavutil      55. 58.100 / 55. 58.100
      libavcodec     57. 89.100 / 57. 89.100
      libavformat    57. 71.100 / 57. 71.100
      libavdevice    57.  6.100 / 57.  6.100
      libavfilter     6. 82.100 /  6. 82.100
      libswscale      4.  6.100 /  4.  6.100
      libswresample   2.  7.100 /  2.  7.100
      libpostproc    54.  5.100 / 54.  5.100
    Input #0, ogg, from 'concatenated_by_python.ogg':
      Duration: 00:01:27.62, start: 0.000000, bitrate: 41 kb/s
        Stream #0:0: Audio: vorbis, 22050 Hz, mono, fltp, 35 kb/s
    File 'concatenated_by_python__output_ffmpeg.aac' already exists. Overwrite ? [y/N] y
    Stream mapping:
      Stream #0:0 -> #0:0 (vorbis (native) -> aac (native))
    Press [q] to stop, [?] for help
    Output #0, adts, to 'concatenated_by_python__output_ffmpeg.aac':
      Metadata:
        Album           : Vitaly
        encoder         : Lavf57.71.100
        Stream #0:0: Audio: aac (LC), 22050 Hz, mono, fltp, 69 kb/s
        Metadata:
          encoder         : Lavc57.89.100 aac
    size=     818kB time=00:01:28.21 bitrate=  75.9kbits/s speed=  53x
    video:0kB audio:805kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.614694%
    [aac @ 0x4c73760] Qavg: 2966.099

As you see - Metadata block has Album : Vitaly

But ffprobe did now show any metadata:

$ ffprobe -v error -show_format -show_streams output.aac
[STREAM]
index=0
codec_name=aac
codec_long_name=AAC (Advanced Audio Coding)
profile=LC
codec_type=audio
codec_time_base=1/22050
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
sample_fmt=fltp
sample_rate=22050
channels=1
channel_layout=mono
bits_per_sample=0
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/28224000
start_pts=N/A
start_time=N/A
duration_ts=2696886288
duration=95.552944
bit_rate=70112
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
[/STREAM]
[FORMAT]
filename=concatenated_by_python__output_ffmpeg.aac
nb_streams=1
nb_programs=0
format_name=aac
format_long_name=raw ADTS AAC (Advanced Audio Coding)
start_time=N/A
duration=95.552944
size=837426
bit_rate=70111
probe_score=51
[/FORMAT]

I also checked in Finder on macOS - zero metadata.

But I checked the setting of metadata to the ogg instead of aac - and it works. Also I found that ffmpeg can set metadata to m4a, but I can not use this format for my project because Android can not play it out of the box.

Looks like a bug in ffmpeg - I need to create a ticket about that?

1 Answer 1

0

What you are writing is a raw ADTS AAC bitstream (.aac). While these bitstreams can carry metadata frames (ID3), ffmpeg cannot write them. The id3v2 command-line tool should be able to do it though.

With ffmpeg, you need to write your audio stream into a container that can store such metadata, e.g. .mp4, .mov, or .mkv. For example:

ffmpeg -i <input> -metadata title=Foo -metadata album=Bar output.mp4
5
  • Hm, ok, thank you for the answer. But I think that in such case FFmpeg can show warning/error to a user. Sep 19, 2017 at 11:00
  • I found in this answer than I can use id3v2 - is it a correct solution of aac? Sep 19, 2017 at 11:22
  • Ah, you are right. Apparently metadata frames are supported but ffmpeg does not write them. The command-line tool id3v2 may help, yes.
    – slhck
    Sep 19, 2017 at 11:39
  • I tried ffmpeg -i input.ogg -metadata author="Vitaly" output.m4a and I see this metadata during encoding but ffprobe and Finder does not show this metadata. Sep 20, 2017 at 7:23
  • author does not seem to be a valid tag that most players recognize. It's also not part of the ID3v2 implementation of ffmpeg. You mean artist?
    – slhck
    Sep 20, 2017 at 8:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .