How to insert thumbnail into .MP3 file

0

I would like to know the right command to add thumbnail (jpg) in the .mp3 file, my current command below converts normally, but it just does not insert thumbnail because I do not know what the command is.

ffmpeg -i $tmp -ar 44100 -ab 128k -ac 2 $SAIDA_DO_MP3

I've tried the answer in this question but I did not succeed!

Can anyone help me?

    
asked by anonymous 15.10.2017 / 02:50

1 answer

2

According to this link link , you should do so (in 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

Then in PHP use with exec or system or popen , eg:

//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);
    
15.10.2017 / 02:58