mp4box
mp4box is used to mux files into an MP4 container.
Create an MP4 file from an x264 video and a faac audio file for streaming
faac -b 96k -o audio.m4a audio.wav mp4box -add video.264 -add audio.m4a -fps 23.976 video.mp4 mp4box -inter 500 video.mp4
If you are having trouble with the audio, try re-encoding it at a constant bitrate.
In some cases, mp4box sets it's own FPS for the video, which is why -fps is passed.
Metadata
Get all the supported tags:
MP4Box -tag-list
Supported iTunes tag modifiers: album_artist usage: album_artist=album artist album usage: album=name tracknum usage: track=x/N track usage: track=name artist usage: artist=name comment usage: comment=any comment compilation usage: compilation=yes,no composer usage: composer=name created usage: created=time disk usage: disk=x/N tool usage: tool=name genre usage: genre=name name usage: name=name tempo usage: tempo=integer writer usage: writer=name group usage: group=name cover usage: cover=file.jpg,file.png encoder usage: encoder=name gapless usage: gapless=yes,no all usage: all=NULL
Since the location and naming is confusing, here's the mediainfo
output when some are set:
General Complete name : audio.m4a Movie name : name Album : album Album/Performer : album_artist Track name/Position : 99 Performer : artist Composer : writer Comment : comment trk : track com : composer
Converting M4A to MP3 with avconv, copying metadata, with id3v1 only:
avconv -y -i source.m4a -map_metadata 0 -write_id3v1 1 -vn ouput.mp3
Converting M4A to MP3 with avconv, copying metadata, with id3v2.3 only:
avconv -y -i source.m4a -map_metadata 0 -id3v2_version 3 -vn ouput.mp3
And stripping extra frames from conversion:
id3v2 --remove-frame TXXX output.mp3
name → song