0

my below ffmpeg command works for combining 1 audio file with 1 image file into a video.

ffmpeg 
-loop 1 
-framerate 2 -i "C:\Users\marti\Videos\ig_sf_6.5.24_highlights\apple image.jpg"  
-i "C:\Users\marti\Videos\ig_sf_6.5.24_highlights\FITNESSS - F20 ⧸ FAITH.mp3"  
-c:a pcm_s32le  
-filter_complex concat=n=1:v=0:a=1  
-vcodec libx264  
-filter:v "scale=w=1920:h=1882,pad=ceil(iw/2)*2:ceil(ih/2)*2" 
-crf 18 -pix_fmt yuv420p  
-shortest  
-tune stillimage  
-t 254 "C:\Users\marti\Videos\ig_sf_6.5.24_highlights\oneSongOneImg.mkv"

But I know that my mp3 image file already has an embedded image as part of the file's metadata, and with programs such as mp3tag you can extract that piece of metadata as an image file. enter image description here

Is there a way I can edit my ffmpeg command so that it uses this mp3 image metadata as the image input instead of the current "C:\Users\marti\Videos\ig_sf_6.5.24_highlights\apple image.jpg"

Something such as this:

ffmpeg 
-loop 1 
-framerate 2 

// we are taking the audio mp3 file as input
-i "C:\Users\marti\Videos\ig_sf_6.5.24_highlights\FITNESSS - F20 ⧸ FAITH.mp3"  

// now take embedded image metadata as input
-i a[0].getImageMetadata()

-c:a pcm_s32le  
-filter_complex concat=n=1:v=0:a=1  
-vcodec libx264  
-filter:v "scale=w=1920:h=1882,pad=ceil(iw/2)*2:ceil(ih/2)*2" 
-crf 18 -pix_fmt yuv420p  
-shortest  
-tune stillimage  
-t 254 "C:\Users\marti\Videos\ig_sf_6.5.24_highlights\oneSongOneImg.mkv"

Can I achieve this in a single neat ffmpeg command?

Files: https://www.transfernow.net/dl/202406054pY40Lim

2
  • ffmpeg -i "FITNESSS - F20 ⧸ FAITH.mp3" -c:v h264 -crf 18 -tune stillimage -c:a pcm_s32le out.mkv Commented Jun 5 at 12:04
  • @БаярГончикжапов Wow, -tune? Normally you'd just ffmpeg -i file.mp3 -an cover.png to get the image out of the mp3. -tune is news to me.
    – JayCravens
    Commented Jun 5 at 15:07

0

You must log in to answer this question.

Browse other questions tagged .