<p>Final answer: Use -map to copy all 3 streams. First disposition UNSETS the existing default; Second disposition SETS the NEW default;</p>
<p>If you don't unset, all 3 streams are marked as default, and thus when opening in VLC the mjpeg will still play !</p>
<pre><code>ffmpeg -i &quot;myInputFile.mp4&quot; -y ^
    -c copy -map 0:0 -map 0:1 -map 0:2 ^
    -disposition:v:0 0 ^
    -disposition:v:1 default ^
    myOutputFile.mp4
</code></pre>

CC BY-SA 4.0
2023-04-01T17:36:41.097Z
2023-04-01T17:36:41.097Z
joedotnot
<p>Based on <a href="https://ffmpeg.org/ffmpeg.html" rel="nofollow noreferrer">https://ffmpeg.org/ffmpeg.html</a>, there is an example of making the second audio stream the default stream:</p>
<pre><code>ffmpeg -i in.mkv -c copy -disposition:a:1 default out.mkv
</code></pre>
<p>such that making the second video stream the default stream would be</p>
<pre><code>ffmpeg -i in.mkv -c copy -disposition:v:1 default out.mkv
</code></pre>

CC BY-SA 4.0
2023-04-01T04:06:02.477Z
No need for multiple commands.
Gyan
CC BY-SA 4.0
2023-04-01T17:05:33.873Z
@Gyan what multiple commands?
joedotnot
CC BY-SA 4.0
2023-04-01T17:36:33.683Z
@xer-rex Using your example, I end up with the mjpeg stream as the default, and the sound stream as the default; i.e. 2 streams only, the actual video stream h264 is dropped ! But thanks for pointing me to the DISPOSITION flag, see my revised answer below.
joedotnot
CC BY-SA 4.0
2023-04-01T02:46:55.200Z
2023-04-01T02:46:55.200Z
xer-rex
<p>I used VLC to play what's supposed to be a video file, and it plays just a still image with sound; Before trashing it, I decided to open it in the Windows Media Player, and to my surprise I can see video and sound normally.</p>
<p>Next I used ffprobe and discovered the video file contains 3 streams, and VLC picks up the 1st (video) stream, which is just a mjpeg image! Whereas WMP picks up the 2nd (video) stream.</p>
<pre><code>Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'mySupaDupaFile.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.33.100
  Duration: 01:46:15.80, start: 0.000000, bitrate: 3191 kb/s
  Stream #0:0[0x1](und): Video: mjpeg (Baseline) (mp4v / 0x7634706D), yuvj444p(pc, bt470bg/unknown/unknown), 749x972, 99348 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
  Stream #0:1[0x2](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 3101 kb/s, 25 fps, 25 tbr, 90k tbn
  Stream #0:2[0x3](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 82 kb/s (default)
</code></pre>
<p>Looking at the ffprobe output, stream#0 is marked as (default).
Does ffmpeg have a command that can unset (default) on stream-0, and set (default) on stream-1 ?</p>
<p>For now, I have just re-encoded into another file the h264 + aac streams, and discarded the mjpeg stream, but would like to know if it's possible just to change the default video stream ! (and more generally how to mark a stream as DEFAULT when there are multiple streams).</p>

<ffmpeg>
Changing the DEFAULT video stream?
joedotnot
# Changing the DEFAULT video stream?

(Asked by: username_0 on 2023-03-31)

I used VLC to play what's supposed to be a video file, and it plays just a still image with sound; Before trashing it, I decided to open it in the Windows Media Player, and to my surprise I can see video and sound normally.
Next I used ffprobe and discovered the video file contains 3 streams, and VLC picks up the 1st (video) stream, which is just a mjpeg image! Whereas WMP picks up the 2nd (video) stream.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'mySupaDupaFile.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.33.100
  Duration: 01:46:15.80, start: 0.000000, bitrate: 3191 kb/s
  Stream #0:0[0x1](und): Video: mjpeg (Baseline) (mp4v / 0x7634706D), yuvj444p(pc, bt470bg/unknown/unknown), 749x972, 99348 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
  Stream #0:1[0x2](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 3101 kb/s, 25 fps, 25 tbr, 90k tbn
  Stream #0:2[0x3](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 82 kb/s (default)

Looking at the ffprobe output, stream#0 is marked as (default).
Does ffmpeg have a command that can unset (default) on stream-0, and set (default) on stream-1 ?
For now, I have just re-encoded into another file the h264 + aac streams, and discarded the mjpeg stream, but would like to know if it's possible just to change the default video stream ! (and more generally how to mark a stream as DEFAULT when there are multiple streams).

**Tags:** ffmpeg


---

## 2 answers

### Answer by username_0 on 2023-04-01. Score: 1 | Accepted answer

Final answer: Use -map to copy all 3 streams. First disposition UNSETS the existing default; Second disposition SETS the NEW default;
If you don't unset, all 3 streams are marked as default, and thus when opening in VLC the mjpeg will still play !
ffmpeg -i "myInputFile.mp4" -y ^
    -c copy -map 0:0 -map 0:1 -map 0:2 ^
    -disposition:v:0 0 ^
    -disposition:v:1 default ^
    myOutputFile.mp4


---

### Answer by username_1 on 2023-04-01. Score: 0

Based on https://ffmpeg.org/ffmpeg.html, there is an example of making the second audio stream the default stream:
ffmpeg -i in.mkv -c copy -disposition:a:1 default out.mkv

such that making the second video stream the default stream would be
ffmpeg -i in.mkv -c copy -disposition:v:1 default out.mkv

> **Comments:**
> **username_2**: No need for multiple commands.  
> **username_0**: @username_2 what multiple commands?  
> **username_0**: @username_1 Using your example, I end up with the mjpeg stream as the default, and the sound stream as the default; i.e. 2 streams only, the actual video stream h264 is dropped ! But thanks for pointing me to the DISPOSITION flag, see my revised answer below.  

---

