Simple Problem with not so simple solution i think..
I got 50 mp3 files (more coming up next month) and all of them have embedded album art pic within them. Now i want to batch convert them to video (mp4 preferably). My only need is that i want the album art pic to appear in the video automatically (just like a slide show video but with one still image only) I dont want to go through all 50 files one by one so kindly tell me any software which can batch process all of these in one click. Thanx in advance.
+ Reply to Thread
Results 1 to 30 of 39
-
Last edited by Love; 21st Dec 2018 at 13:08.
-
Look below, there seem to be several Similar Threads with the same issue already.
I believe one can use ffmpeg to loop a still image to a video with the duration of the audio track. And alternatively, in AviSynth it will certainly work... -
Thanx for response.. there are 2 issues in it
1. all mp3 have different embedded images in them.. so FFMPEG cant work am afriad.
2. even when attempting online, they ask one image per mp3 separately..
so its tuf to first extract images from all mp3 and then put them back one by one for online websites.. Risk of mixing them allLast edited by Love; 21st Dec 2018 at 13:07.
-
Oh, your point is making a video stream out of the embedded cover art? ... No, here I can't help you with confidence. Extracting them right before the conversion could be automated with a batch file, I believe, but tinkering that is an elaborate task.
-
Yes i want an automated script which should at first extract cover art from an mp3 and then make a video slide show featuring that cover art only in it as a still pic.
-
what should be the 2nd call to FFmpeg ?
Last edited by Love; 22nd Dec 2018 at 05:14.
-
You should be able to figure that out from your other thread.
https://forum.videohelp.com/threads/391449-Need-Help-to-Convert-600-mp3-to-mp4-with-ju...c-in-it-for-YT -
Thanx a lot for responding... Yes thats my thread too though different purpose which got solved by help from you and others there.. But here am stuck. once all pics are extracted.. how to get them back to their own related mp3 .. because all pics are different and should be combined to their own specific related mp3
In the thread you are referring there was just one pic and it was easy to make a dummy mp4 of that pic and remux with mp3 audios.. Here in this thread there shall be as many pics as many are their mp3 files so a second or third call to FFmpeg may be needed which being a totally noob i have no clue.. just started reading commands of FFmpeg yesterday
-
You just extracted an image called cover.jpg. The other script used an image called my_image.jpg. Isn't obvious what change you should make?
-
haha.. Luv the way you are encouraging me to learn just on the basis of my common sense. I understand that this way i can extract an image from one file and in the next call FFmpeg shall render that image alongwith its associated mp3 into an mp4 .. Upto this i can manage because it is a single file to operate upon. Problem is arising where loops will be involved. How shall FFmpeag differentiate between which image belongs to which mp3 ?
common sense says .. isnt the way out should be to assign a unique ID to every image when it is extracted which relates to its parent mp3 so that in 2nd call FFmpeg can recognise which image is to be combined to which mp3 .. this is where a layman like me is standing with hands raised above shoulder -
If you encode one file at a time there is only one image file. You use the first call to ffmpeg to extract the image, the second to create the video with the image and the mp3 file.
Code:for %%F in (*.mp3) do ( ffmpeg -y -i "%%F" -an -vcodec copy cover.jpg ffmpeg.exe -y -loop 1 -i cover.jpg -i "%%F" -c:v libx264 -preset veryfast -tune stillimage -pix_fmt yuv420p -c:a copy -shortest "%%~nF.mp4" )
-
thats great (Y) Here is the feedback..
i placed 2 mp3 there. names 001.mp3 and 002.mp3
Both mp3 had different cover art pics embedded.
script ran at the speed of 3.36 .. it did produce 2 mp4 files in say 5 minutes.
Names were correct too. 001.mp4 and 002.mp4
It also produced just 1 jpg (that of 002.mp3) with name of cover.jpg
(i want it to produce 2 JPGs with names 001.jpg and 002.jpg as given in their mp3)
Also plz note that File 002.mp4 is okay but File 001.mp4 is of zero byte -
If you want to keep the jpg for each video use:
Code:for %%F in (*.mp3) do ( ffmpeg -y -i "%%F" -an -vcodec copy "%%~nF.jpg" ffmpeg.exe -y -loop 1 -i "%%~nF.jpg" -i "%%F" -vf "scale=ceil(iw/2)*2:ceil(ih/2)*2" -c:v libx264 -preset veryfast -tune stillimage -pix_fmt yuv420p -c:a copy -shortest "%%~nF.mp4" ) pause
Last edited by jagabo; 22nd Dec 2018 at 12:12.
-
Thanx... ok i checked both cover art images in mp3.. the one which successfully completed in mp4 had image with 800x930 pixels in it .. while the other one which failed had image with 100x100 pixels .. so this turned out to be opposite to what we expected. Even image failed and Odd imaged passed.
Also another experiment in which i input 2 mp3 files with SAME image embedded in both files.. now this time both mp4 were successfully playing..
So by these two findings where exactly the error lies Sir? -
Thanx .. but NO ..i dont want to keep the same image for these mp4.. these mp3 have different singers pics embedded so i want each of the pic to be different as they are originally. Also each pic should be produced in folder with its name same as its parent mp3 name ... 001.jpg, 002.jpg and onwards.
This script however can be useful where i'll need one pic for all mp4 .. but since it will take too much time in that case so i'll be adding a dummy mp4 file in that case and the shortest command..to save time. -
That's what the script does. Did you even bother to try it?
And, of course it's slow. We're back to the problem of ffmpeg's loop and encoding being slow. A possible solution to that is to use a very low frame rate, like 1 fps, so there are fewer frames to encode. I don't know how well youtube will deal with that though. -
Yessss.... its perfect now (Y) (Y) (Y) thank you so much.. so now we can change mp3 to mp4 with their original cover art pics.. Just want to ask where does FFmpeg take the video bit rate.. does it get from the pic size? or Duration of mp3 or some other parameter ??? it is less than 100kbps in both output.
-
ffmpeg defaults to x264's CRF encoding, with a CRF value of 23. Still images and small frame sizes require very little bitrate. You can get slightly better image quality (and higher bitrate) using a lower CRF value. For example, add "-crf 12" to the x264 options. If you want to try faster encoding change the frame rate to something low like 1.0 fps. Add "-r 1.0" to the command line. I don't know how youtube will handle that though. Try a test and see what happens.
-
Thanx for the info about bit rate.. yes frame rate i have already checked.. 15 is the minimum default acceptance for youtube.. and 25 for dailymotion .. I am highly obliged for not only the guidance but also bearing a novice with great patience .. i was stick in these huge stock of mp3 with me.. being a collector i got above 30,000 mp3 songs and in this old age i just wanted to share as many as i can to youtube etc ..before i die and my relative throw my library out of home as no one is interested now in 1930s, 40s aur 50s music. Also thankful to the admins of this website for providing such a kind n helpful platform where i got answers to all my queries within the span of some 72 hours. Hats off to experts like you and others. Stay blessed and Happy Xmas to those celebrating (Y) Adios.
-
-
Just tested this script saved as a .CMD file in a folder with MP3's with cover art as well as the FFMpeg file. It produces an image with the MP3 file name in it and also creates a
larger 800x800 image in case you wanted it larger with same resolution. These lines can be stripped/changed as required but it does produce the MP4 with audio and cover art.
Code:setlocal enabledelayedexpansion ::echo off for %%a in (*.mp3) Do ( set /a count=0 cd %%~dpa set /a Number=0 ffmpeg.exe -i "%%a" -an -vcodec copy "%%~na_image.jpg" ffmpeg.exe -i "%%~na_image.jpg" -f image2 -vf scale=800:-1 "%%~na_image800.jpg" ffmpeg -loop 1 -f image2 -i "%%~na_image800.jpg"^ -i "%%a" -map 0:0 -map 1:0 -acodec copy -vcodec libx264 -r 30 -shortest -pix_fmt yuv420p^ "%%~na_AudioVideo.MP4" set /a count+=1 ) echo !count! files converted pause
[Attachment 47573 - Click to enlarge] -
Now thats excellent work too.. just 2 glitches. fps is 30 which is more than enough for a video with just one still pic.. and secondly the last command COUNT .. it counted 1 though it converted 2 mp3 files I kept in that folder. I see so many people who upload audios on youtube. In the absence of any such software.. so if this script can get some GUI with proper input options like which screen size, which bit-rate (video and audio) and fps so that person using it can get various results then may be it can bring some bucks for the programmer too
-
silly me!!! Kept resetting Count to 0. Moved it
Code:setlocal enabledelayedexpansion ::echo off set /a count=0 for %%a in (*.mp3) Do ( cd %%~dpa set /a Number=0 ffmpeg.exe -i "%%a" -an -vcodec copy "%%~na_image.jpg" ffmpeg.exe -i "%%~na_image.jpg" -f image2 -vf scale=800:-1 "%%~na_image800.jpg" ffmpeg -loop 1 -f image2 -i "%%~na_image800.jpg"^ -i "%%a" -map 0:0 -map 1:0 -acodec copy -vcodec libx264 -r 30 -shortest -pix_fmt yuv420p^ "%%~na_AudioVideo.MP4" set /a count+=1 ) echo !count! files converted pause
-
Is there a need for an image2video or possibly image(S)2video with maybe transitions between them?
[Attachment 47607 - Click to enlarge]
[Attachment 47608 - Click to enlarge] -
-
Yess.. this looks cool.. Hope there is also a switch of Transition On/Off ..and also Random Transitions check box on top of effects list.
Also Video Screen Size and FPS are a must requirement to include..
Among Audios .. the options should not be limited to mp3 only because professionally WAV and FLAC are used preferably.Last edited by Love; 24th Dec 2018 at 03:35.
-
Also your script is generating 2 images.. i think only one album art is enough with original size as embedded in mp3 .. the other one referred to image800 here is not needed by the user. If it is needed by the script for video frame size then after conversion ask the script to delete it.. it is unwanted. One jpg is sufficient if one has to build it as a separate photo album. For that you can also give user a choice of.. Original, 320x240, 640x480, 800x600 and 1024 etc.
Similar Threads
-
Software that converts mp3 to mp4 and uses liner art for image
By Julius Crouch in forum AudioReplies: 3Last Post: 22nd Dec 2018, 05:17 -
Need Help to Convert 600 mp3 to mp4 with just one still pic in it for YT
By Love in forum AudioReplies: 15Last Post: 21st Dec 2018, 10:09 -
convert mp3 to mp4 and add picture
By kasfig in forum AudioReplies: 8Last Post: 14th Oct 2017, 22:47 -
Taking the pictures/album art out of a mp3 or audio files id3 tagging?
By SyncroScales in forum AudioReplies: 2Last Post: 23rd Sep 2017, 03:28 -
App that embeds art into mp3
By mol3000 in forum AudioReplies: 1Last Post: 16th Sep 2017, 00:06