.m4a is just another commonly used file extension for the MPEG-4 Part 14 container, usually called MP4. The container can carry video, audio and subtitles. The extension doesn't change that fact, although often, you'd only put audio in
.m4a files, and video in
See Wikipedia for more info:
… since MPEG-4 Part 14 is a container format, MPEG-4 files may contain any number of audio, video, and even subtitle streams, making it impossible to determine the type of streams in an MPEG-4 file based on its filename extension alone. In response, Apple Inc. started using and popularizing the .m4a filename extension, which is used for MP4 containers with audio data in the lossy Advanced Audio Coding (AAC) or its own lossless Apple Lossless (ALAC) formats. Software capable of audio/video playback should recognize files with either .m4a or .mp4 filename extensions, as would be expected, since there are no file format differences between the two. Most software capable of creating MPEG-4 audio will allow the user to choose the filename extension of the created MPEG-4 files.
If you want one static picture shown together with the audio, you'll have to convert it to a video. For example, create the frame you want and call it
avconv -i input.mp4 -frames:v 1 image.png
This will give you the first frame of the video. If you want one from another timestamp, add the
-ss option before
-i to skip to, e.g. 10 seconds:
avconv -ss 10 -i ….
avconv -i input.mp4 -i image.png \
-c:v libx264 -pix_fmt yuv420p -r 1 -c:a copy -map 0:a:0 -map 1 output.mp4
Here, choose x264 for encoding a video from the still image, and just copy the audio stream from the original file. A frame rate of
-r 1 should be enough, although you can leave that part out.
-map 0:a:0 you select the first audio stream from the first file, and with
-map 1 you select the image to be muxed into the output. (The
\ is just to escape the newline.)
-map switches work fine for the recent (and decent) latest FFmpeg versions—I can't talk about Ubuntu's Libav though. If it doesn't work for you just download FFmpeg instead.
If you want to set the album artwork for an
.m4a file, use AtomicParsley:
AtomicParsley input.m4a --artwork image.jpg
This will create a new file with the image embedded as artwork, which now correctly shows in most media players. To overwrite the input file itself, use the
--overWrite switch as well.