I am batch converting lots of songs into shorter "Advert" songs for SHOUTcast and to be recognised as adverts by the server. The song must have ":Advert"
for both the title and the artist metadata tags. When I use the following command:
ffmpeg -i "$i" -c copy -vn -map_metadata -1 -metadata title=":Advert" -metadata artist=":Advert" -t 120 "adverts/ADVERT_$i"
I would expect it to output the song with only ":Advert"
as title and artist metadata but when I import it into the radio playout software (using ID3 1.x tagging) the metadata has not copied across and is therefore lost. Output from ffmpeg:
ffmpeg version 3.0.2 Copyright (c) 2000-2016 the FFmpeg developers
built with Apple LLVM version 9.0.0 (clang-900.0.37)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.0.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --disable-lzma --enable-vda
libavutil 55. 17.103 / 55. 17.103
libavcodec 57. 24.102 / 57. 24.102
libavformat 57. 25.100 / 57. 25.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 31.100 / 6. 31.100
libavresample 3. 0. 0 / 3. 0. 0
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
[mp3 @ 0x7feba6800000] Skipping 0 bytes of junk at 230934.
[mjpeg @ 0x7feba7000600] Changing bps to 8
Input #0, mp3, from 'Joakim Karud - Vibe With Me.mp3':
Metadata:
major_brand : dash
minor_version : 0
compatible_brands: iso6mp41
encoder : Lavf56.40.101
artist : Joakim Karud
title : Vibe With Me
Duration: 00:02:53.06, start: 0.025056, bitrate: 138 kb/s
Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s
Metadata:
encoder : Lavc56.60
Stream #0:1: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 1280x720 [SAR 1:1 DAR 16:9], 90k tbr, 90k tbn, 90k tbc
Metadata:
comment : Cover (front)
Output #0, mp3, to 'adverts/ADVERT_Joakim Karud - Vibe With Me.mp3':
Metadata:
TIT2 : :Advert
TPE1 : :Advert
TSSE : Lavf57.25.100
Stream #0:0: Audio: mp3, 44100 Hz, stereo, 128 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
size= 1876kB time=00:02:00.00 bitrate= 128.1kbits/s speed=1.44e+03x
video:0kB audio:1876kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.024837%
I believe this is happening because the tag names are different (e.g. title should be title
, but is TIT2
when output. Please could someone specify how I could ensure that the metadata is encoded in the ID3 1.x format so that it is readable by the radio playout software. Many thanks.
FFmpeg, by default, writes only ID3v2.4 tags. ID3v1 has to be specified for writing.
Use
ffmpeg -i "$i" -c copy -vn -write_id3v1 true -map_metadata -1 -metadata title=":Advert" -metadata artist=":Advert" -t 120 "adverts/ADVERT_$i"