user19904: I'm trying to map specific streams to specific output indexes. The command I'm using is more complex but it can be reduced to this simple example
ffmpeg -i input.mkv -y -map 0:0 -c:5 copy -f mp4 out.mp4
I expected this to copy stream 0 from input.mkv into stream 5 of out.mp4. The issue is that it copies it into stream 0 (I guess it's using a counter?). Why is that and how can I force it to assign it a different index number?
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))

user1871: It's using a counter! To get it to be stream #5, map 5 streams before it :)
That said, mp4box will allow you to set a custom track ID.
mp4box -set-track-id 1:5 file.mp4

This changes existing track with ID 1 to 5. Use mp4box -info file.mp4 to get existing IDs.
However, this will still show up as stream 0 in ffmpeg. But mediainfo and mp4box will show it as having ID 5.

19904: <p>I'm trying to map specific streams to specific output indexes. The command I'm using is more complex but it can be reduced to this simple example</p>

<p><code>ffmpeg -i input.mkv -y -map 0:0 -c:5 copy -f mp4 out.mp4</code></p>

<p>I expected this to copy stream <code>0</code> from <code>input.mkv</code> into stream <code>5</code> of <code>out.mp4</code>. The issue is that it copies it into stream <code>0</code> (I guess it's using a counter?). Why is that and how can I force it to assign it a different index number?</p>

<p><code>Stream #0:0 -&gt; #0:0 (h264 (native) -&gt; h264 (libx264))</code></p>
 1871: <p>It's using a counter! To get it to be stream #5, map 5 streams before it :)</p>

<p>That said, mp4box will allow you to set a custom track ID.</p>

<pre><code>mp4box -set-track-id 1:5 file.mp4
</code></pre>

<p>This changes existing track with ID 1 to 5. Use <code>mp4box -info file.mp4</code> to get existing IDs.</p>

<p>However, this will still show up as stream <code>0</code> in ffmpeg. But mediainfo and mp4box will show it as having ID 5.</p>
