Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Linux, Mac OS X, & Co

Reply
 
Thread Tools Search this Thread Display Modes
Old 24th December 2020, 17:57   #1  |  Link
For Fun
Registered User
 
Join Date: Oct 2020
Posts: 11
How to BATCH remux combine video and audio to one file?

How can BATCH remux video and audio to one file?

I'm trying this on mine android termux.
So what I'm trying:
1. I want to rip audio from video and convert to wav. ffmpeg -i inp.mkv -map 0:1 audio.wav
2. Extract only video. mkvextract tracks "inp.mkv" 0:video.mkv
3. Remux Combine extracted video and wav audio file. mkvmerge -o final.mkv video.mkv audio.wav

So I have multiple videos from tv show and I want to batch convert the things I mentioned above?

example:
Movie1.mkv and Movie1.wav remux to Movie1.mkv

Movie2.mkv and Movie2.wav remux to Movie2.mkv

And then I want movie1.mkv and movie1.wav files to be deleted and only the combined video and audio file to exist.

I did try myself but I couldn't figure it out further:


Quote:
for f in *.mkv;do ffmpeg -i "$f" -map 0:1 "${f%mkv}wav";done &&

Could I create a new folder and send the converted file to the folder would that do the trick?
İf someone could help I would be appreciated.

Last edited by For Fun; 24th December 2020 at 18:26.
For Fun is offline   Reply With Quote
Old 24th December 2020, 22:12   #2  |  Link
For Fun
Registered User
 
Join Date: Oct 2020
Posts: 11
I have solved it my self for f in .mkv;do ffmpeg -i "$f" -map 0:1 "${f%mkv}wav";done && for i in .mkv; do mkdir -p "${i%.}" && mkvmerge -o "${i%.}/${i%.}.mkv" -A "$i" "${i%.}.wav"; done
For Fun is offline   Reply With Quote
Reply

Tags
android, combing, ffmpeg, merge, mkv batch

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:42.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.