unable to copy metadata of mp3 file to m4a using ffmpeg and libfdk-aac.

Hi I am Rupesh from India and I have some mp3 files and I want to convert them to m4a files using ffmpeg. I am able to convert mp3 files which do not have metadata successfully to m4a files but unable to convert mp3 files which have artwork.

I have installed open suse leap 15.0 on my system and I have compiled source code successfully which is obtained from ffmpeg website.

I am providing the command I have issued and the error I am getting below.


linux-y30w:~/work/music_test/temp # ffmpeg -i mp3_file.mp3  -codec:a libfdk_aac -vbr 4 output.m4a 
ffmpeg version 4.1 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 7 (SUSE Linux)
  configuration: --enable-libfdk-aac --enable-nonfree --enable-libopus --enable-gpl --enable-libsoxr --enable-libmp3lame --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libfreetype --enable-decoder=png --enable-encoder=png
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
Incorrect BOM value
Error reading frame author, skipped
[mp3 @ 0x2e29b00] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from 'mp3_file.mp3':
  Metadata:
    title           : TOP 75 Songs of M.S. Subbulakshmi - Part 2 _ 101 Years _ Audio Jukebox _ Carnati
    artist          : <unknown>
    album           : mp3
    encoder         : Lavf51.12.1
  Duration: 09:24:48.77, start: 0.000000, bitrate: 128 kb/s
    Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 128 kb/s
    Stream #0:1: Video: png, rgb24(pc), 360x360, 90k tbr, 90k tbn, 90k tbc
    Metadata:
      comment         : Cover (front)
Stream mapping:
  Stream #0:1 -> #0:0 (png (native) -> h264 (h264_v4l2m2m))
  Stream #0:0 -> #0:1 (mp3 (mp3float) -> aac (libfdk_aac))
Press [q] to stop, ?] for help
[ipod @ 0x2e31280] Frame rate very high for a muxer not efficiently supporting it.
Please consider specifying a lower framerate, a different muxer or -vsync 2
[h264_v4l2m2m @ 0x2e3b840] Could not find a valid device
[h264_v4l2m2m @ 0x2e3b840] can't configure encoder
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!
linux-y30w:~/work/music_test/temp # 

On getting the above I have even re compiled source code successfully of ffmpeg with options --enable-decoder=png --enable-encoder=png and even no use.

please suggest how to convert mp3 file’s to m4a files using ffmpeg and libfdk-aac including metadata.

You’re asking this again???

https://forums.opensuse.org/showthread.php/534156-Failed-in-compiling-or-installing-fdk-aac-and-after-that-compiling-libav-with-enable-lib-fdk-aac-opt

https://forums.opensuse.org/showthread.php/534053-Converting-mp3-files-to-opus-and-m4a-recursively-using-command-line-tools-and-scripts-in-Linux

Please concentrate on what I am asking. What is the meaning of the following errors.


Stream mapping:
  Stream #0:1 -> #0:0 (png (native) -> h264 (h264_v4l2m2m))
  
Please consider specifying a lower framerate, a different muxer or -vsync 2
[h264_v4l2m2m @ 0x2e3b840] Could not find a valid device
[h264_v4l2m2m @ 0x2e3b840] can't configure encoder
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!


Your posted output means a transcoding failure.
Your error suggests but isn’t specific that you’re possibly passing at least one unsupported parameter.
And, this has nothing to do with metadata.

You can verify your result by using mediainfo to analyze your file… Although from your error I don’t think you even created an output file.

TSU

Was wondering the same thing, and it’s probably related to these other, more-than-a-year-old threads:

https://forums.opensuse.org/showthread.php/528201-How-to-download-mp3-file-s-from-a-webpage-which-are-hidden-or-not-visible
https://forums.opensuse.org/showthread.php/525604-how-to-compare-two-huge-music-directories-playback-length-and-file-count-of-corresponding-files
https://forums.opensuse.org/showthread.php/527421-using-wget-as-an-offline-browser-to-download-all-mp3-files-from-a-website
https://forums.opensuse.org/showthread.php/526857-How-to-create-a-database-for-the-contents-of-folder-containing-11000-mp3-files

And rupeshforu3, instead of getting nasty with comments like “concentrate on what I’m asking”, think about what you’re asking. You compiled ffmpeg? Why? You can install it easily from the repos. Did you look at the ffmpeg site, that says writing cover art to m4a files is an ongoing issue that’s not supported yet? Or their recommendations to use things like tagwriter and tagreader (also in the repos by installing taglib), to do this?

Write a simple script by going back to the several other threads you’ve opened about scripting, to loop through the file names, strip the cover art from the Mp3 file, reencode to m4a, and put the art back in.