Normalmente, quando executo ffmpeg -i "$name.$oldext" "$name.ogg"
, onde oldext
é qualquer .opus
, .m4a
ou .flac
, todos os metadados são preservados. No entanto, acabei de descobrir que, no caso específico em que o arquivo inicial é um .opus
com uma imagem de capa incorporada, nenhum metadado está presente no .ogg
resultante. A conversão para .flac
é a mesma. A conversão para .mp3
mantém a capa incorporada, mas não outros metadados.
O que posso fazer para manter os metadados nessa situação? Como alternativa, existe um script simples para copiar metadados de um arquivo para outro em massa. Muitas cópias um-para-um, isto é, não uma cópia um-para-muitos (eu já posso fazer isso).
Saída atual do comando:
ffmpeg version 2.8.11-0ubuntu0.16.04.1 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=
/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --dis
able-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth
--enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio
--enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --
enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enab
le-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-l
ibtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265
--enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libie
c61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
WARNING: library configuration mismatch
avcodec configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=harden
ed --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-
shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enab
le-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --en
able-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enab
le-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-li
brtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libss
h --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --en
able-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --
enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv --enable-version3 --disable-do
c --disable-programs --disable-avdevice --disable-avfilter --disable-avformat --disable-avresample --disable-postproc
--disable-swscale --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libvo_aacenc --enable-libvo_amrwben
c
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
[ogg @ 0x7e90a0] 1 bytes of comment header remain
[mjpeg @ 0x7eb020] Changeing bps to 8
Input #0, ogg, from '148 - Mewmore _ 'Zelda's Lullaby' (Remix) from The Legend of Zelda - Breath of the Wild.opus':
Duration: 00:02:50.87, start: 0.000000, bitrate: 153 kb/s
Stream #0:0: Audio: opus, 48000 Hz, stereo, fltp
Metadata:
TITLE : 'Zelda's Lullaby' (Remix) from The Legend of Zelda - Breath of the Wild
ARTIST : Mewmore
album_artist : Mewmore
ALBUM : Mewmore Remixes
track : 148
GENRE : Zelda Remixes
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)
title : 00001 - Mewmore _ 'Zelda's Lullaby' (Remix) from The Legend of Zelda - Breath of the Wild.jpg
[swscaler @ 0x7f9c60] deprecated pixel format used, make sure you did set range correctly
[ogg @ 0x816980] Frame rate very high for a muxer not efficiently supporting it.
Please consider specifying a lower framerate, a different muxer or -vsync 2
Output #0, ogg, to '148 - Mewmore _ 'Zelda's Lullaby' (Remix) from The Legend of Zelda - Breath of the Wild.ogg':
Metadata:
encoder : Lavf56.40.101
Stream #0:0: Video: theora (libtheora), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 90k fps, 90k tbn, 90k tbc
Metadata:
DESCRIPTION : Cover (front)
title : 00001 - Mewmore _ 'Zelda's Lullaby' (Remix) from The Legend of Zelda - Breath of the Wild.jpg
encoder : Lavc56.60.100 libtheora
Stream #0:1: Audio: vorbis (libvorbis), 48000 Hz, stereo, fltp
Metadata:
TITLE : 'Zelda's Lullaby' (Remix) from The Legend of Zelda - Breath of the Wild
ARTIST : Mewmore
ALBUMARTIST : Mewmore
ALBUM : Mewmore Remixes
TRACKNUMBER : 148
GENRE : Zelda Remixes
encoder : Lavc56.60.100 libvorbis
Stream mapping:
Stream #0:1 -> #0:0 (mjpeg (native) -> theora (libtheora))
Stream #0:0 -> #0:1 (opus (native) -> vorbis (libvorbis))
Press [q] to stop, [?] for help
[libvorbis @ 0x85cb60] Queue input is backward in time
Last message repeated 1 times
frame= 1 fps=0.0 q=-0.0 size= 8kB time=00:00:22.54 bitrate= 2.7kbits/s ^M[libvorbis @ 0x85cb60] Queue input is backward in time
frame= 1 fps=1.0 q=-0.0 size= 8kB time=00:00:45.99 bitrate= 1.3kbits/s ^M[libvorbis @ 0x85cb60] Queue input is backward in time
Last message repeated 4 times
frame= 1 fps=0.7 q=-0.0 size= 8kB time=00:01:09.31 bitrate= 0.9kbits/s ^M[libvorbis @ 0x85cb60] Queue input is backward in time
Last message repeated 3 times
frame= 1 fps=0.5 q=-0.0 size= 8kB time=00:01:32.72 bitrate= 0.7kbits/s ^M[libvorbis @ 0x85cb60] Queue input is backward in time
Last message repeated 2 times
frame= 1 fps=0.4 q=-0.0 size= 8kB time=00:01:56.22 bitrate= 0.5kbits/s ^M[libvorbis @ 0x85cb60] Queue input is backward in time
Last message repeated 3 times
frame= 1 fps=0.3 q=-0.0 size= 8kB time=00:02:19.43 bitrate= 0.4kbits/s ^M[libvorbis @ 0x85cb60] Queue input is backward in time
Last message repeated 1 times
frame= 1 fps=0.3 q=-0.0 size= 8kB time=00:02:42.63 bitrate= 0.4kbits/s ^Mframe= 1 fps=0.3 q=-0.0 Lsize= 2385kB time=00:02:50.84 bitrate= 114.4kbits/s
video:5kB audio:2351kB subtitle:0kB other streams:0kB global headers:7kB muxing overhead: 1.256185%
Alterar o comando para ffmpeg -i "$name.$oldext" -map-metadata 0 "$name.ogg"
não fez diferença.
Nota lateral Eu só notei - de acordo com as miniaturas padrão, o resultado é um arquivo de vídeo (o original era o áudio). Tentativas de ouvir em um player somente de música falharam. Se eu rotear via .flac
, o .ogg
resultante será o áudio.