Hi All..
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.
Dr. Bukhari
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 16 of 16
Thread
-
-
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)
-
Just as a startup .. i went to command prompt ..
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.
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" 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.
Code: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".
-
Thanx first.. i understood the first Code.. but about the 2nd Code in ur reply, i got confused. Plz tell if you are asking to prepare a video image.mp4 by myself separately and then keep it in that folder? Also 2nd thing is.. i got all 600 mp3 with different duration.. so it will be really difficult to make videos for each mp3
-
-
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"
pause
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? -
The processing is faster or slower depending on the size of the source image. I get about 12x if the source image is already 640 pixels wide. With a 320x240 image being upscaled to 640x480 I get about 25x. With a 1280x960 image downscaled to 640x480 I get about 4x. With a 4000x3000 image it was 0.1x.
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.
That appears to be some quirk in MPC. I see the same in 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. -
Yes.
You don't need to make a video for each mp3. You make one long video (with no audio). When you use second the batch file I gave "-shortest" cuts the video to match the audio length. I recommend you create the video with fairly short GOPs -- say, 25 frames at 25 fps. -
-
That stands for "minutes and seconds." Supply a value which is longer than your longest MP3. For example, if your longest MP3 is 4 minutes and 26 seconds long, then you could supply the value "05:00". You are creating ONE video file that will be used in the second command, which will handle all of your MP3s AT ONCE. You only have to enter these two commands.
-
Last edited by Love; 22nd Dec 2018 at 04:10.
Similar Threads
-
convert mp3 to mp4 and add picture
By kasfig in forum AudioReplies: 8Last Post: 14th Oct 2017, 22:47 -
Can I convert videos from a DVD to a file format such as MP3/MP4 surround?
By R.STEED in forum Video ConversionReplies: 1Last Post: 29th Sep 2017, 10:12 -
How do I use FFmpeg to convert H.264/AAC to H.263/MP3 in .MP4 container?
By Gary_G in forum Video ConversionReplies: 18Last Post: 25th Dec 2016, 16:40 -
How to convert mp3 audio to mp4 video using Windows Movie Maker?
By Agita Weltschmertz in forum Video ConversionReplies: 3Last Post: 22nd Feb 2016, 08:20 -
Convert Mp4 (AAC) to MP4 (AC3)
By GreaterMuta in forum Video ConversionReplies: 3Last Post: 4th Oct 2014, 05:32