<p>Ill make this as quick as possible. I recorded with obs, used ffmpeg to convert from .mkv to .mp4 with 3 audio tracks in .aac</p>
<p>Command:</p>
<pre><code>@echo off &amp; setlocal enabledelayedexpansion
for %%v in (&quot;*.mkv&quot;) do (
  set FileName=%%v
  set name=!FileName:~0,-4!

  set outname=C:\Users\Ashto\Videos\actual obs\!name!
  echo Remuxing: !name! to !outname!

  ffmpeg -i &quot;!FileName!&quot; -map 0:v -c copy &quot;!outname!.mp4&quot; -map 0:a:0 -c copy &quot;!outname!_0.aac&quot; -map 0:a:1 -c copy &quot;!outname!_1.aac&quot; -map 0:a:2 -c copy &quot;!outname!_2.aac&quot;
)
pause
</code></pre>
<p>After doing this, for the first bit of footage I got a video output of 24:31, which was correct. However the first audio track was 23:04, the second audio track was almost 12 hours (it was just looped) and the 3rd was 24:39. The second bit of footage wasn't as extreme, however the 3rd audio track for it was missing 10 minutes of audio. If anyone knows why, I would love to know.</p>

CC BY-SA 4.0
2021-08-20T04:54:12.063Z
Save to `.m4a` not `.aac`, and check.
Gyan
CC BY-SA 4.0
2021-08-20T05:26:18.910Z
@Gyan That worked, i dont know why it worked but it worked, i am extremely grateful
Liegreys
<ffmpeg>
FFMPEG Audio Stream lengths
Liegreys
# FFMPEG Audio Stream lengths

(Asked by: username_0 on 2021-08-19)

Ill make this as quick as possible. I recorded with obs, used ffmpeg to convert from .mkv to .mp4 with 3 audio tracks in .aac
Command:
@echo off & setlocal enabledelayedexpansion
for %%v in ("*.mkv") do (
  set FileName=%%v
  set name=!FileName:~0,-4!

  set outname=C:\Users\Ashto\Videos\actual obs\!name!
  echo Remuxing: !name! to !outname!

  ffmpeg -i "!FileName!" -map 0:v -c copy "!outname!.mp4" -map 0:a:0 -c copy "!outname!_0.aac" -map 0:a:1 -c copy "!outname!_1.aac" -map 0:a:2 -c copy "!outname!_2.aac"
)
pause

After doing this, for the first bit of footage I got a video output of 24:31, which was correct. However the first audio track was 23:04, the second audio track was almost 12 hours (it was just looped) and the 3rd was 24:39. The second bit of footage wasn't as extreme, however the 3rd audio track for it was missing 10 minutes of audio. If anyone knows why, I would love to know.

**Tags:** ffmpeg

> **Comments:**
> **username_1**: Save to `.m4a` not `.aac`, and check.  
> **username_0**: @username_1 That worked, i dont know why it worked but it worked, i am extremely grateful  

---

## 0 answers

