Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get album image from mp3 file using ffmpeg in php

Tags:

php

I want the album image from mp3 files. I have using ffmpeg for get the mp3 files metadata using

ffprobe -show_format path-name.

In this command i have get the all details except album image. How can i get the image from Mp3 files?

like image 380
Karthick Avatar asked Sep 29 '22 23:09

Karthick


1 Answers

You can get the image from an mp3 using the following code snippet, try this..

ffmpeg -ss 125 -i wrong-way-fixed.mp3 -t 1 \ -s 480x300 -f image2 /dev/null

or use this

ffmpeg -i input.mp3 -an -vcodec copy cover.jpg

You can define the image resolution here..

like image 60
gowri Avatar answered Oct 06 '22 19:10

gowri