No background meaning no images...just black.
I'm using Windows and would prefer freeware. Recommendations?
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 24 of 24
Thread
-
-
Make yourself a small black png file then:
Code:ffmpeg -loop 1 -r 1 -i black.png -i input.mp3 -c:v libx264 -preset ultrafast -tune stillimage -crf 20 -c:a copy -shortest -pix_fmt yuv420p output.mkv
Code:ffmpeg -loop 1 -r 1 -i path\to\black.png -i %1 -c:v libx264 -preset ultrafast -tune stillimage -crf 20 -c:a copy -shortest -pix_fmt yuv420p "%~n1.mkv"
An hour long MP3 file and a 16x16 pixel black.png took about 1 minute to convert. The mp3 file was 54.8 MB and the resulting MKV file was 55.8 MB.
If you put the BAT file in your SendTo folder, say, with the name MP3toMKV, you can right click on any MP3 file in Explorer and select Send To -> MP3toMKV.Last edited by jagabo; 13th Jun 2017 at 00:33.
-
PNG input can actually become a bottleneck, even with CPU encoding (pure black is very fast to encode, even with CPU libx264). If OP has suitable GPU ,NVEnc is very fast too although benefits are not as dramatic with pure black encoding
ffmpeg actually has several internal signal generators. You can use YUV black . The benefit is much faster (no RGB=>YUV conversion) , lower CPU usage . For example , on a quick test for 1280x720 it was about 3-4 times faster just output to null with about 1/2 the CPU usage. On actual encoding , the looped PNG poses a bottleneck too, actual encoding speed is about 2-3x faster too .
eg. for 1280x720, 30.0fps black YUV generation (everything else would be the same, like -shortest, -c:a copy etc...)
Code:ffmpeg -f lavfi -i color=c=black:s=1280x720:r=30
-
It's an audio file with talking (not music) so whatever is recommended. I WOULD like the output to be 720p for Youtube.
-
Then use a 1280x720 black png image. Note that the above code produces a 1 fps video. I don't know what youtube will make of that. If Youtube doesn't like it you may have to change "-f 1" to "-f 30" or whatever fps youtube will accept.
ffmpeg took about a minute and a half to convert a one hour MP3 file to a 1280x720 black video. The 54.8 MB MP3 file became a 55.9 MB MKV.
Note that this code does not re-convert the MP3 audio. It just copies it to the MKV file.Last edited by jagabo; 13th Jun 2017 at 00:46.
-
I didn't know ffmpeg could generate a black clip. I just tried your example using a 1280x720 1 fps video and it was a little faster than using a single PNG. Converting at about 55 fps vs. 45 fps. Generating the image also has the benefit of not having to keep a PNG image around and changing the BAT file to point to it.
So my drag/drop BAT file now looks like:
Code:ffmpeg -f lavfi -i color=c=black:s=1280x720:r=1 -i %1 -c:v libx264 -preset ultrafast -tune stillimage -crf 20 -c:a copy -shortest -pix_fmt yuv420p "%~n1.mkv"
-
-
-
The only setback is that I can only convert an MP3 if it's in the same DIR as the black.png
Here's what I have in the BAT:Code:ffmpeg -loop 1 -r 1 -i C:\youtube-dl\black.png -i %1 -c:v libx264 -preset ultrafast -tune stillimage -crf 20 -c:a copy -shortest -pix_fmt yuv420p "%~n1.mkv"
-
And you don't need a SSD to see the speed benefit, my test was on the same read/write 5400rpm clunky laptop drive . NVEnc is even faster. With an old maxwell card ~900FPS with -preset:v fast -c:v h264_nvenc . A pascal card should theoretically get around 1700-1800FPS in the absense of other bottlenecks (the signal generator wasn't that fast on this laptop, about 1200-1300fps max)
--tune stillimage will slow encoding down slightly compared to no AQ or psy options (not that you would notice it when you're getting hundreds of FPS), but I would argue their use is questionable with "black" frames -
-
add ffmpeg directory to system path (you can do this locally within batch)
Code:@setlocal @set FFMPG=D:\Media\FF @set PATH=%PATH%;%FFMPG% @set FC_CONFIG_DIR=%FFMPG%\conf @set FONTCONFIG_FILE=%FFMPG%\conf\fonts.conf @set FONTCONFIG_PATH=%FFMPG%\conf @ffmpeg -y -i %1 ......." @endlocal @Pause
-
Or use the full path to ffmpeg.exe.
Code:"G:\program files\ffmpeg\bin\ffmpeg.exe" -f lavfi -i color=c=black:s=1280x720:r=1 -i %1 -c:v libx264 -preset ultrafast -tune stillimage -crf 20 -c:a copy -shortest -pix_fmt yuv420p "%~n1.mkv"
-
-
-
Start Notepad. Copy the text from the code block post #7 and paste it into Notepad. Change the initial "ffmpeg" to the full path or where you installed it on your computer, something like "C:\Program Files\ffmpeg\bin\ffmpeg.exe". Save the document to a convenient place (Desktop? Send To folder) with the extension ".BAT" rather than ".TXT". Then drag/drop any audio file onto the batch file to create a black video with that MP3 audio.
-
Yes. So your batch file will end up looking something like:
Code:"C:\Program Files\ffmpeg\bin\ffmpeg.exe" -f lavfi -i color=c=black:s=1280x720:r=1 -i %1 -c:v libx264 -preset ultrafast -tune stillimage -crf 20 -c:a copy -shortest -pix_fmt yuv420p "%~n1.mkv"
-
jagabo, so the code you posted has worked great but now, I think I want to switch from the black background to a jpg (bg.jpg) which would reside in the ffmpeg directory. How would the code be modified to use that? Here's what I have in the bat file:
Code:"C:\dl\ffmpeg.exe" -f lavfi -i color=c=black:s=1280x720:r=1 -i %1 -c:v libx264 -preset ultrafast -tune stillimage -crf 20 -c:a copy -shortest -pix_fmt yuv420p "%~n1.mkv"
-
Something like:
Code:"C:\dl\ffmpeg.exe" -loop 1 -r 1 -i "C:\dl\bg.jpg" -i %1 -c:v libx264 -preset ultrafast -tune stillimage -crf 20 -c:a copy -shortest -pix_fmt yuv420p "%~n1.mkv"
-
Similar Threads
-
Quickly Identy MKV Video Stream with Hardcoded Subtitle
By MKVFAN in forum SubtitleReplies: 2Last Post: 23rd Apr 2016, 12:07 -
Add logo or watermark quickly without affecting video file size or quality
By MGadAllah in forum EditingReplies: 29Last Post: 27th Jul 2014, 10:38 -
Wishing to Convert Ripped Blu-ray to DVD (w/Menu) Quickly
By newsgroup guy in forum Authoring (DVD)Replies: 6Last Post: 22nd May 2014, 02:40 -
Need two tools to convert the FLV video and background music
By coody in forum Video ConversionReplies: 1Last Post: 19th Aug 2012, 03:44 -
Do i have to convert with a different method now?
By goodsharer2012 in forum Video ConversionReplies: 14Last Post: 22nd Jul 2012, 09:24