Does VLC Provide Stream Mapping Capability?

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
Greg Frederick
New Cone
New Cone
Posts: 7
Joined: 14 Dec 2018 21:27

Does VLC Provide Stream Mapping Capability?

Postby Greg Frederick » 25 Jan 2019 01:06

My issue is that when recording with VLC, sometimes Audio = Stream 1, and Video = Stream 2. This is fine for playback if there is no pause in the recording. However, when there is a pause, two recording files are created, and for some reason the audio and video streams will be flipped. The issue I'm having is that when I mux the two recording files (i.e. segments), only part of the muxed output plays back (the other part has the streams flipped and looks/sounds as though it is a corrupt file).

I know it is possible to flip the streams with ffmpeg (ffmpeg.exe -i "input.flv" -map 0:1 -map 0:0 -c copy output.flv). However, I can't find any equivalent in VLC. It seems like there should be a command line tool that would force the video to always map to stream 1, so that this issue doesn't occur. Or at the very least, a command that will check whether segments' streams match, and flip any that don't, prior to muxing them together.

Any help would be greatly appreciated!

User avatar
InTheWings
Developer
Developer
Posts: 1275
Joined: 07 Aug 2013 13:15
VLC version: crashing
Operating System: Linux
Contact:

Re: Does VLC Provide Stream Mapping Capability?

Postby InTheWings » 28 Jan 2019 10:21

There's no stream mapping. Only stream filtering (and pid setup with ts).
:!: If you want your problem to be solved :
* First read troubleshooting guide VSG:Main
* Always provide verbose LOGS ! (command line or from gui)
* Always check your issue against a developer build from Nightly Build of VLC
* Tell us when your problem is solved !

Greg Frederick
New Cone
New Cone
Posts: 7
Joined: 14 Dec 2018 21:27

Re: Does VLC Provide Stream Mapping Capability?

Postby Greg Frederick » 28 Jan 2019 19:02

Hi InTheWings,

Thank you for your response! When you say there is only stream filtering, are your referring to playback? In other words, there is no way to make the streams all match type (i.e. Video always = Stream 1) prior to merging segments?

Greg Frederick
New Cone
New Cone
Posts: 7
Joined: 14 Dec 2018 21:27

Re: Does VLC Provide Stream Mapping Capability?

Postby Greg Frederick » 29 Jan 2019 00:35

There's no stream mapping. Only stream filtering (and pid setup with ts).
Is is possible to merge files together in a way that lines up media types instead of stream numbers? For instance, typically, merging files lines up stream 0 of file 1 with stream 0 of file 2. When the streams are swapped, this leads to a useless output file. Instead, can I specify instead that whichever stream has a specific attribute (e.g. resolution or codec) from file 1 lines up with the same for file 2? If yes, an example of what that command line looks like would be greatly appreciated :)

User avatar
InTheWings
Developer
Developer
Posts: 1275
Joined: 07 Aug 2013 13:15
VLC version: crashing
Operating System: Linux
Contact:

Re: Does VLC Provide Stream Mapping Capability?

Postby InTheWings » 29 Jan 2019 10:20

Stream order is only defined by data timings. If you have 2 recordings, yes that can happen.
if that's muxed with ts, video pid is still the same.
other formats, vlc can't remap
:!: If you want your problem to be solved :
* First read troubleshooting guide VSG:Main
* Always provide verbose LOGS ! (command line or from gui)
* Always check your issue against a developer build from Nightly Build of VLC
* Tell us when your problem is solved !

Greg Frederick
New Cone
New Cone
Posts: 7
Joined: 14 Dec 2018 21:27

Re: Does VLC Provide Stream Mapping Capability?

Postby Greg Frederick » 29 Jan 2019 21:52

Stream order is only defined by data timings. If you have 2 recordings, yes that can happen.
if that's muxed with ts, video pid is still the same.
other formats, vlc can't remap
Hi InTheWings,

Thank you again! I apologize for my beginner level ignorance, but I'm still having difficulty understanding. My original files were in FLV format, so I converted them to TS format. I then used the following command to mux them together:

"C:\Program Files\VideoLAN\VLC\vlc.exe" input0.ts input1.ts --sout "#gather:std{access=file,dst=out.ts}" --sout-keep

However, the output file still has the issue caused by the streams being swapped on one of the original two files. What am I missing? Would you be so kind as to modify my command line? It is difficult to find beginner level how-tos for VLC that are up-to-date.

Greg Frederick
New Cone
New Cone
Posts: 7
Joined: 14 Dec 2018 21:27

Re: Does VLC Provide Stream Mapping Capability?

Postby Greg Frederick » 30 Jan 2019 18:41

Hi InTheWings,

I found this page - https://wiki.videolan.org/VLC_HowTo/Mer ... _together/, which states "if you are wanting to join streams that do not have matching video/audio, then it is recommended to transcode. Given your advise regarding using TS, I modified the example code to the following:

"C:\Program Files\VideoLAN\VLC\vlc.exe" -vvv input0.ts input1.ts --sout-keep --sout=#gather:transcode{vcodec=h264,vb=960,scale=1,acodec=mp4a,ab=64,channels=2}:standard{access=file,mux=ts,dst=out.ts} --sout-all -I dummy "vlc://quit"

However, when I run that command, the output does not line up the video streams. Is the wiki wrong, or am I missing something? If it has something to do with the PIDs you referenced, would you please explain how to use those to line up the video and audio streams?

Greg Frederick
New Cone
New Cone
Posts: 7
Joined: 14 Dec 2018 21:27

Re: Does VLC Provide Stream Mapping Capability?

Postby Greg Frederick » 01 Feb 2019 17:50

Is anyone able to help? I greatly appreciate all the hard work you devs put into this product. I just want the opportunity to learn how to better use it.


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 48 guests