Page 1 of 1

Order of audio and video streams when converting

Posted: 21 Nov 2020 19:09
by jalcaid001
I have one .mp4 file with 1) video stream 2) audio stream (in that order, according to VLC codec information Ctrl+J)
After converting, the order of streams is switched: 1) audio stream 2) video stream

IS there a way to force the same order? Any problems I could run into. For starters, it seems Microsoft Explorer icons are shown differently (when audio comes first, they don't display in the right orientation)

Re: Order of audio and video streams when converting

Posted: 21 Nov 2020 23:50
by InTheWings
It all depends on the timing of the tracks

Re: Order of audio and video streams when converting

Posted: 22 Nov 2020 20:55
by jalcaid001
Sorry.. depends what?
The order in which they show when I do Ctl+J. If I do the conversion with HandBrake, I keep seeing first the video track
Or are you talking about how Windows displays the icons?

Re: Order of audio and video streams when converting

Posted: 25 Nov 2020 15:31
by mederi
Audio track (0) + video track (1) is pretty unusual order of tracks in a file. Perhaps it is possible to control the order of tracks in VLC muxer:
Change the id of an elementary stream (setid)
Set ES id:
--sout-setid-id=<integer> Elementary Stream ID
Specify an identifier integer for this elementary stream
--sout-setid-new-id=<integer>
New ES ID
Specify an new identifier integer for this elementary stream
?

Re: Order of audio and video streams when converting

Posted: 30 Nov 2020 00:27
by jalcaid001
I'm just using the convert option of the VLC windows app?

Are you saying there is a way of doing it perhaps form a command line? I was not even aware VLC had a command line. Can you explain me how would I do that?

Re: Order of audio and video streams when converting

Posted: 03 Dec 2020 15:09
by mederi
I have just found those CLI options in vlc-help file. Perhaps it is possible to use them to control the id of particular streams in output when converting a file.

Re: Order of audio and video streams when converting

Posted: 15 Dec 2020 13:16
by jalcaid001
How do you use them within the graphic program?

Re: Order of audio and video streams when converting

Posted: 15 Dec 2020 18:34
by mederi
"[v] Show more options" in Open Media dialog (Media > Convert/Save... or Stream... > [v] Show more options > Edit Options). You can edit stream output string in the final step in streaming wizard (Media > Stream...).

Re: Order of audio and video streams when converting

Posted: 05 Jul 2021 15:14
by jalcaid001
Sorry for the delay.. I finally got around to give it some tries

I add in this field ' :file-caching=300 :sout-setid-id=1 :sout-setid-new-id=0' and some variations

Still, audio stream is still the first one

Am I doing it wrong? Any ideas?

Re: Order of audio and video streams when converting

Posted: 05 Jul 2021 18:24
by mederi
I was also curious so I also tried some combinations and I really could not make video to stay the first stream in a file. I could change the order of additional tracks in a file with multiple audio tracks. Then I observed that the video file was cut according to the shortest audio track (1 audio track several minutes shorter than the other one in the same file). I do not know whether there is a different/better situation in VLC 4.

Re: Order of audio and video streams when converting

Posted: 06 Jul 2021 01:06
by jalcaid001
Both of those issues seem like bugs, no?
Didn't know 4.0 was there. I tried 3.0.16 and still seeing the same problems.

Re: Order of audio and video streams when converting

Posted: 06 Jul 2021 13:33
by mederi
VLC 4 nightly builds http://nightlies.videolan.org/

Re: Order of audio and video streams when converting

Posted: 08 Jul 2021 17:52
by jalcaid001
I tried 20210708-0426 and didn't allow me to open the input file

Re: Order of audio and video streams when converting

Posted: 16 May 2022 18:42
by jack.mauro
The problem is still present in Vlc 3.0.17.4.

Still no way to fix it in stable releases?