Newbie here to ask for help. I have 600 mp3 audio files. i want to post those on youtube but since youtube doesnt take mp3 so i have to convert them to video format mp4. For video i want to attach just one still pic for all those mp4 files. Plz suggest a software (preferably free) in which i can set a pic path for the one image file i have and set mp4 variables to batch-process all 600 mp3 files in one go. I tried FREEMAKE which can batch process all mp3 to mp4 but the problem is FREEMAKE asks to input Pic separately for each file which means probably some 1800+ clicks for these 600 files Anyone plz guide.
+ Reply to Thread
Results 1 to 16 of 16
Appreciate the help JVRaines (Y) but unfortunately being a novice i wont be able to do it from command line unless i learn a few basics about it. However i save it as a last resort if i couldnt find any Software Program with some interface (dunno what its called technically, GUI perhaps)
then D: (my hard drive is D)
cd F (F is the folder where i placed ffmpeg portable files)
cd Bin (bin is the folder where ffmpeg.exe and other 2 exe files are present)
[in this Bin folder i placed 2 mp3 files named 1.mp3 and 2.mp3 and one image file p.jpg
now plz guide which variable to tune and perform this command you told Sir
ffmpeg.exe -loop 1 -i my_image.jpg -i %F -c:v libx264 -tune stillimage -pix_fmt yuv420p -c:a copy -shortest %~nF.mp4
which command should i input there now considering mp3 and pic file names i mentioned?
SOME SUCCESS.. just using some common sense (as much as there is in old person of 70 years age) i gave this command
ffmpeg.exe -loop 1 -i m.jpg -i 1.mp3 -c:v libx264 -tune stillimage -pix_fmt yuv420p -c:a copy -shortest 1.mp4
My input 1.mp3 was 4.71 MB and 128kbps and duration 00:04:34
Output file 1.mp4 got generated after 6 minutes with size 13MB , same duration, 25fps, video 1920x1080 at 262kbps and audio 128kbps
Issues now are:
1. is the conversion speed (showing in command window) 0.8x Okay? or there is some way to fine tune it?
2. while i succeeded after input of one of mp3 file (thanx to you) how to do with rest of 599 files? cant go one by one like this... where am i making mistake? plz specify.
3. If i want just 640x480 screen size of resultant video, what wud be the change in the command line you gave.
Thanx again JVRaines for help.. am so pleased at least i tried n got some partial success.. in this age
Put this in a batch file (named mp3_to_mp4.bat, for example) along with my_image.jpg and some mp3 files. Then double click on the batch file.
for %%F in (*.mp3) do ffmpeg.exe -loop 1 -i my_image.jpg -i "%%F" -vf scale=640:-2 -c:v libx264 -preset veryfast -tune stillimage -pix_fmt yuv420p -c:a copy -shortest "%%~nF.mp4" pause
Unfortunately, looping an image like this is very slow in ffmpeg, especially with large images. If your image is large scale it to 640x480 before running the batch file (and you won't need the "-vf scale=640:-2" in the batch file. With a 640x480 image I get about 12x realtime (quad core desktop).
Since you are using the same image for every mp3 file you can greatly speed things up by encoding the video first, then using that video in your batch conversion. I went from 20 seconds per mp3 file (~4 minutes each) to less than 1 second each.
for %%F in (*.mp3) do ffmpeg.exe -i my_image.mp4 -i "%%F" -c:v copy -c:a copy -shortest "%%~nF.mp4" pause
Last edited by jagabo; 20th Dec 2018 at 20:43.
As jagabo wisely suggests, you can first encode the video stream from the image file:
ffmpeg.exe -loop 1 -i m.jpg -c:v libx264 -tune stillimage -pix_fmt yuv420p -s 640x480 -t mm:ss m.mp4
replacing mm:ss with a duration that is longer than your longest MP3 file. Then you can run this command to loop over all your MP3 files:
for %F in (x:\input\path\to\*.mp3) do ffmpeg.exe -i m.mp4 -i "%F" -c copy -shortest "x:\output\path\to\%~nF.mp4"
replacing x:\in(out)put\path\to\ with the appropriate paths to where your MP3 files are stored and where you would like the finished files to go.
By the way, the differences between the commands that JVRains and I are using are because of the differences between running directly from the command line vs. from a batch file. From the command line you only need one % in "%F", but from a batch file you need two "%%F".
Results when i executed a go.bat file with this code
for %%F in (*.mp3) do ffmpeg.exe -loop 1 -i my_image.jpg -i "%%F" -vf scale=640:-2 -c:v libx264 -preset veryfast -tune stillimage -pix_fmt yuv420p -c:a copy -shortest "%%~nF.mp4"
Speed was 1.39 this time as shown while processing (too low i think)
and while i played one output mp4 file in MPC player it gave these properties.
Video: MPEG4 Video (H264) 640x360 25fps 27kbps [V: h264 high L3.0, yuv420p, 640x360, 27 kb/s]
Audio: MP3 44100Hz stereo 128kbps [A: mp3, 44100 Hz, stereo, 128 kb/s]
Audio: MP3 44100Hz stereo 127kbps [A: SoundHandler (mp3, 44100 Hz, stereo, 127 kb/s)]
why am i getting 2 audio lines instead of one as nomally we get? this additional "sound handler" line appears from where?
Will youtube be able to process despite this?
But once again, since you are using the same image for every mp3 file there's no need to encode a video for each one. Create one long video file first and then simply remux that video with each mp3 file. ffmpeg showed a speed of 4000x when doing this.
MPCHC. But MediaInfo reports only one audio stream. Several other players I tried showed only one audio stream. Even the output of ffmpeg while it's encoding show only one audio track.
Last edited by Love; 22nd Dec 2018 at 04:10.