As per this link http://ffmpeg.org/ffmpeg-formats.html#mp3, you should do so (at the terminal):
ffmpeg -i ArquivoOriginal.mp3 \
-i CapaDoAlbum.png \
-c copy \
-map 0 \
-map 1 \
-metadata:s:v title="Titulo do album" \
-metadata:s:v comment="Comentário" \
ArquivoSalvo.mp3
So in PHP use with exec
or system
or popen
, example:
//Aonde fica localizado a musica original
$original = escapeshellarg('/home/pasta/ArquivoOriginal.mp3');
//Aonde fica localizado a foto
$capa = escapeshellarg('/home/pasta/CapaDoAlbum.png');
//Local que deve salvar o arquivo com capa
$salvo = escapeshellarg('/home/pasta/ArquivoSalvo.mp3');
exec('ffmpeg -i ' . $original . ' -i ' . $capa . ' -c copy -map 0 -map 1 -metadata:s:v title="Titulo do album" -metadata:s:v comment="Comentário" ' . $salvo, $out);
print_r($out);
It wasn’t impressive, you really doubled the question. Re-creating really won’t help you get the answer faster. Try editing the question by providing more details of the doubt. Edit is the best way to get help.
– user28595
@Articuno I excluded the other, because it was more than 2 days without reply.
– user41630
@LÉO is not because there is no answer that needs to delete and redo, it is unnecessary work, you can try to throw reward or edit to make it clearer, read this: https://pt.meta.stackoverflow.com/a/3969/3635
– Guilherme Nascimento
All right, I’m sorry!
– user41630