Is there a tool that can batch convert mp3 to mp4 with the video just being black screen but with audio only?
+ Reply to Thread
Results 1 to 5 of 5
-
-
Can be done with ffmpeg. Default audio in mp4 is aac.
-
-
Can be done with ffmpeg. Default audio in mp4 is aac.
What I don't know is if ffmpeg alone allows to create a black frame or a blank clip, with no need for an input file.
Otherwise, it should be quite simple. In this thread for instance the following command was suggested :
Code:ffmpeg -loop 1 -framerate 0.1 -i img.jpg -i audio.mp3 -c:v libx264 -crf 20 -c:a copy -shortest out.mp4
This link was provided for further information :
https://trac.ffmpeg.org/wiki/Slideshow
Then, with a command that produces the desired result, it is easy to loop it in order to process an entire directory, using the FOR ... DO ... syntax (on Windows). For instance :
Code:FOR %F in (*.mp3) DO ffmpeg -loop 1 -i "black.png" -i "%F" -c:v libx264 -crf 20 -c:a copy -shortest "%~nF.mp4"
On the page linked above it is implied that MP3 is not supported by the MP4 container, but I've read on this forum that it was in fact supported, and, doing a quick test, it seems to work with no issue indeed. It is preferable whenever possible to preserve the native stream as re-encoding always degrades the quality somewhat. If there is an issue (with a standalone device which does not accept MP4 files with MP3 audio), then replace “-c:a copy” with “-c:a aac -b:a 192k” as suggested on the page linked above (which means : the audio stream will be re-encoded as AAC with an average bitrate of 192kbps).
For this to work, ffmpeg.exe should be in the same directory as the input files, or included in Windows PATH. Otherwise the complete path should be specified in the command itself, for instance : "C:\command line tools\ffmpeg\ffmpeg.exe".
The argument “%~nF” stands for the name of input file %F without its extension, so if an input file is called "dummy song name.mp3", the ouput will be called "dummy song name.mp4". Quotation marks are required if there's at least one space in the file name or path name. Another potential caveat are file names with accentuated or special characters, which require to set a special codepage (but this is rare with english language file names).
The command can be executed from the command prompt (CMD) or from a batch script, which is a simple text file saved with a .bat extension. But in a .bat script the “%” percent signs must be doubled.
Is there a GUI for this? I have no experience in using command lineLast edited by abolibibelot; 26th Dec 2020 at 16:25.
-
It's not clear what the desired objective of converting mp3 to mp4 is. It's possible that converting to .m4a (mp4 audio) or .mkv (black frame + keep mp3 audio) would be preferable.
If video output is actually needed, ffmpeg can generate a blank clip of any color using -f lavfi or an input blank image can be used as suggested.
Similar Threads
-
Need Help to convert mp3 to mp4 using mp3's album art pic as still pic
By Love in forum Video ConversionReplies: 38Last Post: 3rd Jan 2019, 10:11 -
Batch convert animated GIFs to video? (Any format: AVI, MP4, etc.)
By vidyanoob in forum Video ConversionReplies: 3Last Post: 31st May 2018, 09:04 -
Batch Convert from MPEG-2 to MP4 (Windows 7) in main and sub-folders
By ohlee2010 in forum Video ConversionReplies: 2Last Post: 18th Oct 2017, 20:02 -
convert mp3 to mp4 and add picture
By kasfig in forum AudioReplies: 8Last Post: 14th Oct 2017, 22:47 -
Mux Batch convert MKV to MP4 with subtitles in Linux
By coquex in forum Video ConversionReplies: 7Last Post: 17th Jun 2016, 17:47