我有一些Python代码,这些代码循环遍历音频文件,查找.FLAC文件,然后使用Python子命令运行ffmpeg。有用。音频效果很好,但是即使我在外壳中看到了元数据,它也没有将数据传输到MP3中的ID3标签,并且我使用的是上一篇文章中的示例。这是命令:
cmd = 'ffmpeg -y -i "' + src + '" -codec:a libmp3lame -q:a 0 -map_metadata 0 -id3v2_version 3 -write_id3v1 1 "' + dst + '"'
哪个可以解决:
ffmpeg -y -i "source.flac" -codec:a libmp3lame -q:a 0 -map_metadata 0 -id3v2_version 3 -write_id3v1 1 "destination.mp3"
这是日志转储:
/usr/local/bin/python3.7 /home/krypterro/PycharmProjects/mediaman/RipFLAC.py
1 Music Files Found
2019-04-09 14:32:47.758 | INFO | __main__:main:31 - Start of program
2019-04-09 14:32:48.110 | DEBUG | __main__:ripmp3:206 - Running Command: ffmpeg -y -i "/home/krypterro/audio/music_in/Visions/01-grimes-laughing_and_not_being_normal.flac" -acodec libmp3lame -ab 192000 "/home/krypterro/audio/music_out/Visions/01-grimes-laughing_and_not_being_normal.mp3"
ffmpeg version 3.4.4-0ubuntu0.18.04.1 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --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-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
WARNING: library configuration mismatch
avcodec configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --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-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared --enable-version3 --disable-doc --disable-programs --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract --enable-libvo_amrwbenc
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libavresample 3. 7. 0 / 3. 7. 0
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100
Input #0, flac, from '/home/krypterro/audio/music_in/Visions/01-grimes-laughing_and_not_being_normal.flac':
Metadata:
ARTIST : Grimes
TITLE : Laughing And Not Being Normal
ALBUM : Art Angels
DATE : 2015
track : 1
GENRE : Electronic
disc : 1
TOTALDISCS : 1
TOTALTRACKS : 15
LANGUAGE : English
RIP DATE : 2015-12-12
RETAIL DATE : 2015-00-00
MEDIA : CD
ENCODER : FLAC 1.2.1 -8 -V
RIPPING TOOL : EAC 1.0 Beta 3
RELEASE TYPE : Retail
ORGANIZATION : 4AD
CATALOG : CAD3535CD
Duration: 00:01:47.51, start: 0.000000, bitrate: 743 kb/s
Stream #0:0: Audio: flac, 44100 Hz, stereo, s16
Stream mapping:
Stream #0:0 -> #0:0 (flac (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
Output #0, mp3, to '/home/krypterro/audio/music_out/Visions/01-grimes-laughing_and_not_being_normal.mp3':
Metadata:
TPE1 : Grimes
TIT2 : Laughing And Not Being Normal
TALB : Art Angels
TDRC : 2015
TRCK : 1
TCON : Electronic
TPOS : 1
TOTALDISCS : 1
TOTALTRACKS : 15
TLAN : English
RIP DATE : 2015-12-12
RETAIL DATE : 2015-00-00
MEDIA : CD
CATALOG : CAD3535CD
RIPPING TOOL : EAC 1.0 Beta 3
RELEASE TYPE : Retail
ORGANIZATION : 4AD
TSSE : Lavf57.83.100
Stream #0:0: Audio: mp3 (libmp3lame), 44100 Hz, stereo, s16p, 192 kb/s
Metadata:
encoder : Lavc57.107.100 libmp3lame
size= 2522kB time=00:01:47.52 bitrate= 192.1kbits/s speed= 41x
video:0kB audio:2521kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.042501%
2019-04-09 14:32:50.811 | INFO | __main__:main:73 - End of program
Process finished with exit code 0