1

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

UPDATE

I Have found the command Solved myself

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

Another Question

How can I batch convert ssa to srt and send it to folder and also give subtitle the same name as video?

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 f in *.ass;do ffmpeg -i "$f" "${f%ass}srt";done

0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.