Batch video convert with FFmpeg in Ubuntu: combine image and audio - Ask Ubuntu
i have folder full of audio file .mp3 .amr , .wav extension. have image.jpg. want combine image.jpg every audio file in folder , convert them separate vidoe.mp4 file. how do ffmpge in ubuntu? using ubuntu 14.04.
adding sound video straightforward
ffmpeg -framerate 60 -i input.png -i input.mp3 -vcodec libx264 -crf 20 -preset medium -acodec aac -vf scale=1280:-2,format=yuv420p output.mp4
-i
input.mp3 audio filename-acodec copy
copies audio input stream output stream-s
output resolution of video
basically, change input.png
filename of picture, , input.mp3
audio file. finally, alter output.mp4
destination file name want.
this simple method doing want, possible script in following way:
#! /bin/bash ################################################################### picture="input.jpg" # change file name of picture ################################################################### in *.mp3; ffmpeg -framerate 60 -f image2 -i $picture -i input.mp3 -vcodec libx264 -crf 20 -preset medium -acodec aac -vf scale=1280:-2,format=yuv420p "${i%.*}.".mp4 done
put filename of picture in top, paste file, save convert.sh
. change permissions chmod 777 convert.sh
, run ./convert.sh
it should read mp3 files, add picture , output mp4 file same name mp3.
if want same wav files or amr, change for in *.mp3; do
for in *.wav; do
or for in *.amr; do
.
hope helps!
good luck :)
Comments
Post a Comment