ffmpeg conversion for an entire folder?

Ive been using:

sudo ffmpeg -i Test.mkv -vcodec copy -acodec libfaac -ac 2 -ab 328k Test.mp4

for individual files, but now I have many gigabytes of mkvs in a folder and would like to do a conversion for all at once and walk away from the computer. I appologize for my ignorance, but i am very new to linux and i dont understand how bash scripts are written or if it would even be necessary.

also, i believe the command downsamples the DTS audio in the mkv to 2 channel AAC. am i correct that 328k is the highest bitrate I can convert to?

Answers


One way to do it, this assumes at least one MKV file in the folder.

for INF in *.mkv
do
  ffmpeg -i "$INF" -c:v copy -c:a libfaac -ac 2 -ab 328k "${INF%.*}.mp4"
done

Need Your Help

could refresh page without hashtag and be in same page? Angular js

javascript jquery angularjs html5

I want reload my view from navigation bar and this show me the browser server...

SwingUtilities.windowForComponent(JFrame) returns null

java swing jframe swingutilities

frame is the only JFrame in my Swing app. Since JFrame extends Window I have believed from description and method name that the code should return the frame itself.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.